Go to the documentation of this file.
49 #define ODR_INT_PRINTF NMEM_INT_PRINTF
59 #define ODR_IMPLICIT 0
60 #define ODR_EXPLICIT 1
65 #define ODR_UNIVERSAL 0
66 #define ODR_APPLICATION 1
75 #define ODR_BITSTRING 3
76 #define ODR_OCTETSTRING 4
80 #define ODR_EXTERNAL 8
83 #define ODR_SEQUENCE 16
85 #define ODR_NUMERICSTRING 18
86 #define ODR_PRINTABLESTRING 19
87 #define ODR_GENERALIZEDTIME 24
88 #define ODR_GRAPHICSTRING 25
89 #define ODR_VISIBLESTRING 26
90 #define ODR_GENERALSTRING 27
113 #define ODR_BITMASK_SIZE 256
137 const unsigned char *
bp;
164 #define OUNEXPECTED 5
177 YAZ_EXPORT
void odr_seterror(ODR o,
int errorno,
int errorid);
180 YAZ_EXPORT
void odr_perror(ODR o,
const char *message);
185 YAZ_EXPORT
void odr_setbuf(ODR o,
char *buf,
int len,
int can_grow);
186 YAZ_EXPORT
char *
odr_getbuf(ODR o,
int *len,
int *size);
187 YAZ_EXPORT
void *
odr_malloc(ODR o,
size_t size);
188 YAZ_EXPORT
char *
odr_strdup(ODR o,
const char *str);
189 YAZ_EXPORT
char *
odr_strdupn(ODR o,
const char *str,
size_t n);
197 #define odr_release_mem(m) nmem_destroy(m)
200 #define odr_implicit_tag(o, t, p, cl, tg, opt, name)\
201 (odr_implicit_settag((o), cl, tg), t ((o), (p), (opt), name) )
203 #define odr_explicit_tag(o, t, p, cl, tg, opt, name)\
204 ((int) (odr_constructed_begin((o), (p), (cl), (tg), 0) ? \
205 t ((o), (p), (opt), name) &&\
206 odr_constructed_end(o) : odr_missing((o), opt, name)))
208 #define ODR_MASK_ZERO(mask)\
209 ((void) (memset((mask)->bits, 0, ODR_BITMASK_SIZE),\
212 #define ODR_MASK_SET(mask, num)\
213 (((mask)->bits[(num) >> 3] |= 0X80 >> ((num) & 0X07)),\
214 (void) ((mask)->top < (num) >> 3 ? ((mask)->top = (num) >> 3) : 0))
216 #define ODR_MASK_CLEAR(mask, num)\
217 ((mask)->bits[(num) >> 3] &= ~(0X80 >> ((num) & 0X07)))
219 #define ODR_MASK_GET(mask, num) ( ((num) >> 3 <= (mask)->top) ? \
220 ((mask)->bits[(num) >> 3] & (0X80 >> ((num) & 0X07)) ? 1 : 0) : 0)
223 #define odr_tell(o) ((o)->pos)
224 #define odr_offset(o) ((o)->bp - (o)->buf)
225 #define odr_ok(o) (!(o)->error)
226 #define odr_getmem(o) ((o)->mem)
228 #define ODR_MAXNAME 256
231 YAZ_EXPORT
int ber_tag(ODR o,
void *p,
int zclass,
int tag,
232 int *constructed,
int opt,
const char *
name);
233 YAZ_EXPORT
int ber_enctag(ODR o,
int zclass,
int tag,
int constructed);
234 YAZ_EXPORT
int ber_dectag(
const unsigned char *buf,
int *zclass,
235 int *tag,
int *constructed,
int max);
240 YAZ_EXPORT
int ber_enclen(ODR o,
int len,
int lenlen,
int exact);
241 YAZ_EXPORT
int ber_declen(
const unsigned char *buf,
int *len,
int max);
255 YAZ_EXPORT
int odp_more_chunks(ODR o,
const unsigned char *base,
int len);
280 YAZ_EXPORT
int completeBER(
const unsigned char *buf,
int len);
283 YAZ_EXPORT
void odr_end(ODR o);
287 YAZ_EXPORT
int odr_write(ODR o,
unsigned char *buf,
int bytes);
288 YAZ_EXPORT
int odr_write2(ODR o,
const char *buf,
int bytes);
289 YAZ_EXPORT
int odr_seek(ODR o,
int whence,
int offset);
290 YAZ_EXPORT
int odr_dumpBER(FILE *f,
const char *buf,
int len);
299 YAZ_EXPORT
int odr_peektag(ODR o,
int *zclass,
int *tag,
int *cons);
302 YAZ_EXPORT
char *
odr_prepend(ODR o,
const char *prefix,
const char *old);
310 #define ODR_EXTERNAL_single 0
311 #define ODR_EXTERNAL_octet 1
312 #define ODR_EXTERNAL_arbitrary 2
330 YAZ_EXPORT
int odr_set_charset(ODR o,
const char *to,
const char *from);
333 void (*stream_write)(ODR o,
338 void (*stream_close)(
void *handle));
340 YAZ_EXPORT
void odr_printf(ODR o,
const char *fmt, ...);