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
112 #define ODR_BITMASK_SIZE 256
155 #define OUNEXPECTED 5
178 YAZ_EXPORT
void odr_setbuf(
ODR o,
char *buf,
int len,
int can_grow);
189 #define odr_release_mem(m) nmem_destroy(m)
192 #define odr_implicit_tag(o, t, p, cl, tg, opt, name)\
193 (odr_implicit_settag((o), cl, tg), t ((o), (p), (opt), name) )
195 #define odr_explicit_tag(o, t, p, cl, tg, opt, name)\
196 ((int) (odr_constructed_begin((o), (p), (cl), (tg), 0) ? \
197 t ((o), (p), (opt), name) &&\
198 odr_constructed_end(o) : odr_missing((o), opt, name)))
200 #define ODR_MASK_ZERO(mask)\
201 ((void) (memset((mask)->bits, 0, ODR_BITMASK_SIZE),\
204 #define ODR_MASK_SET(mask, num)\
205 (((mask)->bits[(num) >> 3] |= 0X80 >> ((num) & 0X07)),\
206 (void) ((mask)->top < (num) >> 3 ? ((mask)->top = (num) >> 3) : 0))
208 #define ODR_MASK_CLEAR(mask, num)\
209 ((mask)->bits[(num) >> 3] &= ~(0X80 >> ((num) & 0X07)))
211 #define ODR_MASK_GET(mask, num) ( ((num) >> 3 <= (mask)->top) ? \
212 ((mask)->bits[(num) >> 3] & (0X80 >> ((num) & 0X07)) ? 1 : 0) : 0)
215 #define odr_ok(o) (!(o)->error)
216 #define odr_getmem(o) ((o)->mem)
218 #define ODR_MAXNAME 256
221 YAZ_EXPORT
int ber_tag(
ODR o,
void *p,
int zclass,
int tag,
222 int *constructed,
int opt,
const char *
name);
223 YAZ_EXPORT
int ber_enctag(
ODR o,
int zclass,
int tag,
int constructed);
224 YAZ_EXPORT
int ber_dectag(
const char *buf,
int *zclass,
225 int *tag,
int *constructed,
int max);
230 YAZ_EXPORT
int ber_enclen(
ODR o,
int len,
int lenlen,
int exact);
231 YAZ_EXPORT
int ber_declen(
const char *buf,
int *len,
int max);
270 YAZ_EXPORT
int completeBER(
const char *buf,
int len);
277 YAZ_EXPORT
int odr_write(
ODR o,
const char *buf,
int bytes);
278 YAZ_EXPORT
int odr_seek(
ODR o,
int whence,
int offset);
279 YAZ_EXPORT
int odr_dumpBER(FILE *f,
const char *buf,
int len);
288 YAZ_EXPORT
int odr_peektag(
ODR o,
int *zclass,
int *tag,
int *cons);
291 YAZ_EXPORT
char *
odr_prepend(
ODR o,
const char *prefix,
const char *old);
299 #define ODR_EXTERNAL_single 0
300 #define ODR_EXTERNAL_octet 1
301 #define ODR_EXTERNAL_arbitrary 2
322 void (*stream_write)(
ODR o,
327 void (*stream_close)(
void *handle));
Header for Nibble Memory functions.
int nmem_bool_t
BER/utility boolean.
void odr_perror(ODR o, const char *message)
void odr_setprint_noclose(ODR o, FILE *file)
int odr_constructed_more(ODR o)
const char ** odr_get_element_path(ODR o)
int odr_set_begin(ODR o, void *p, int size, const char *name)
void odr_setelement(ODR o, const char *addinfo)
int odr_generalizedtime(ODR o, char **p, int opt, const char *name)
int odr_null(ODR o, Odr_null **p, int opt, const char *name)
int ber_oidc(ODR o, Odr_oid *p, int max_oid_size)
NMEM odr_extract_mem(ODR o)
int completeBER(const char *buf, int len)
determine whether a buffer is a complete BER buffer
int odr_initmember(ODR o, void *p, int size)
int odr_iconv_string(ODR o, char **p, int opt, const char *name)
int odr_sequence_of(ODR o, Odr_fun type, void *p, int *num, const char *name)
void odr_choice_bias(ODR o, int what)
int odr_any(ODR o, Odr_any **p, int opt, const char *name)
int ber_declen(const char *buf, int *len, int max)
int odr_sequence_end(ODR o)
int odr_geterrorx(ODR o, int *x)
struct odr_bitmask Odr_bitmask
int odr_choice(ODR o, Odr_arm arm[], void *p, void *whichp, const char *name)
int odr_sequence_begin(ODR o, void *p, int size, const char *name)
void odr_prname(ODR o, const char *name)
struct Odr_external Odr_external
int odr_grow_block(ODR b, int min_bytes)
int odr_constructed_begin(ODR o, void *p, int zclass, int tag, const char *name)
int ber_dectag(const char *buf, int *zclass, int *tag, int *constructed, int max)
Decodes BER identifier octets.
Odr_oid * odr_getoidbystr_nmem(NMEM o, const char *str)
int odr_peektag(ODR o, int *zclass, int *tag, int *cons)
int odr_integer(ODR o, Odr_int **p, int opt, const char *name)
ODR odr_createmem(int direction)
int ber_integer(ODR o, Odr_int *val)
int odr_generalstring(ODR o, char **p, int opt, const char *name)
int odr_missing(ODR o, int opt, const char *name)
int odr_set_charset(ODR o, const char *to, const char *from)
char * odr_strdupn(ODR o, const char *str, size_t n)
int odp_more_chunks(ODR o, const char *base, int len)
int(* Odr_fun)(ODR, char **, int, const char *)
Odr_int odr_atoi(const char *s)
int odr_constructed_end(ODR o)
int ber_enclen(ODR o, int len, int lenlen, int exact)
int odr_dumpBER(FILE *f, const char *buf, int len)
void odr_setbuf(ODR o, char *buf, int len, int can_grow)
void odr_setlenlen(ODR o, int len)
int ber_enctag(ODR o, int zclass, int tag, int constructed)
BER-encode a zclass/tag/constructed package (identifier octets).
Odr_bool * odr_booldup(ODR o, Odr_bool v)
char * odr_strdup_null(ODR o, const char *str)
int odr_octetstring(ODR o, Odr_oct **p, int opt, const char *name)
void odr_choice_enable_bias(ODR o, int mode)
int odr_bool(ODR o, Odr_bool **p, int opt, const char *name)
void odr_setprint(ODR o, FILE *file)
int odr_implicit_settag(ODR o, int zclass, int tag)
int ber_any(ODR o, Odr_any **p)
char * odr_strdup(ODR o, const char *str)
Odr_oid * odr_oiddup(ODR odr, const Odr_oid *o)
int odr_enum(ODR o, Odr_int **p, int opt, const char *name)
int odr_bitstring(ODR o, Odr_bitmask **p, int opt, const char *name)
int odr_oid(ODR o, Odr_oid **p, int opt, const char *name)
int odr_seek(ODR o, int whence, int offset)
char * odr_prepend(ODR o, const char *prefix, const char *old)
Odr_null * odr_nullval(void)
Odr_oid * odr_oiddup_nmem(NMEM nmem, const Odr_oid *o)
int odr_set_of(ODR o, Odr_fun type, void *p, int *num, const char *name)
int odr_write(ODR o, const char *buf, int bytes)
int odr_visiblestring(ODR o, char **p, int opt, const char *name)
int ber_bitstring(ODR o, Odr_bitmask *p, int cons)
Odr_oid * odr_getoidbystr(ODR o, const char *str)
void odr_set_stream(ODR o, void *handle, void(*stream_write)(ODR o, void *handle, int type, const char *buf, int len), void(*stream_close)(void *handle))
int odr_graphicstring(ODR o, char **p, int opt, const char *name)
int ber_octetstring(ODR o, Odr_oct *p, int cons)
char * odr_getbuf(ODR o, int *len, int *size)
Odr_int odr_strtol(const char *nptr, char **endptr, int base)
int odr_external(ODR o, Odr_external **p, int opt, const char *name)
int ber_tag(ODR o, void *p, int zclass, int tag, int *constructed, int opt, const char *name)
Encode/decode BER tags.
const char * odr_getelement(ODR o)
Odr_int * odr_intdup(ODR o, Odr_int v)
void * odr_malloc(ODR o, size_t size)
void odr_seterror(ODR o, int errorno, int errorid)
Odr_oct * odr_create_Odr_oct(ODR o, const char *buf, int sz)
int odr_cstring(ODR o, char **p, int opt, const char *name)
int ber_boolean(ODR o, int *val)
void odr_printf(ODR o, const char *fmt,...)
Header for OID basic functions.
union Odr_external::@26 u
Odr_oid * direct_reference
Odr_int * indirect_reference
Odr_any * single_ASN1_type
char bits[ODR_BITMASK_SIZE]
Header for memory handling functions.
Header with fundamental macros.