Implemented odr_set_of and odr_enum.
[yaz-moved-to-github.git] / include / prt.h
1 /*
2  * Copyright (c) 1995-1998, Index Data
3  * See the file LICENSE for details.
4  * Sebastian Hammer, Adam Dickmeiss
5  *
6  * $Log: prt.h,v $
7  * Revision 1.23  1998-03-20 14:45:27  adam
8  * Implemented odr_set_of and odr_enum.
9  *
10  * Revision 1.22  1998/02/11 11:53:34  adam
11  * Changed code so that it compiles as C++.
12  *
13  * Revision 1.21  1997/10/31 12:20:08  adam
14  * Improved memory debugging for xmalloc/nmem.c. References to NMEM
15  * instead of ODR in n ESPEC-1 handling in source d1_espec.c.
16  * Bug fix: missing fclose in data1_read_espec1.
17  *
18  */
19
20 #ifndef PRT_H
21 #define PRT_H
22
23 #include <yconfig.h>
24
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28
29 YAZ_EXPORT int ber_boolean(ODR o, int *val);
30 YAZ_EXPORT int ber_tag(ODR o, void *p, int zclass, int tag, int *constructed, int opt);
31 YAZ_EXPORT int ber_enctag(ODR o, int zclass, int tag, int constructed);
32 YAZ_EXPORT int ber_dectag(unsigned char *buf, int *zclass, int *tag, int *constructed);
33 YAZ_EXPORT int odr_bool(ODR o, int **p, int opt);
34 YAZ_EXPORT int odr_integer(ODR o, int **p, int opt);
35 YAZ_EXPORT int odr_implicit_settag(ODR o, int zclass, int tag);
36 YAZ_EXPORT int ber_enclen(ODR o, int len, int lenlen, int exact);
37 YAZ_EXPORT int ber_declen(unsigned char *buf, int *len);
38 YAZ_EXPORT char *odr_indent(ODR o);
39 YAZ_EXPORT int ber_null(ODR o);
40 YAZ_EXPORT int odr_null(ODR o, Odr_null **p, int opt);
41 YAZ_EXPORT int ber_integer(ODR o, int *val);
42 YAZ_EXPORT int odr_constructed_begin(ODR o, void *p, int zclass, int tag);
43 YAZ_EXPORT int odr_constructed_end(ODR o);
44 YAZ_EXPORT int odr_sequence_begin(ODR o, void *p, int size);
45 YAZ_EXPORT int odr_set_begin(ODR o, void *p, int size);
46 YAZ_EXPORT int odr_sequence_end(ODR o);
47 YAZ_EXPORT int odr_set_end(ODR o);
48 YAZ_EXPORT int ber_octetstring(ODR o, Odr_oct *p, int cons);
49 YAZ_EXPORT int odr_octetstring(ODR o, Odr_oct **p, int opt);
50 YAZ_EXPORT int odp_more_chunks(ODR o, unsigned char *base, int len);
51 YAZ_EXPORT int odr_constructed_more(ODR o);
52 YAZ_EXPORT int odr_bitstring(ODR o, Odr_bitmask **p, int opt);
53 YAZ_EXPORT int ber_bitstring(ODR o, Odr_bitmask *p, int cons);
54 YAZ_EXPORT int odr_generalstring(ODR o, char **p, int opt);
55 YAZ_EXPORT int ber_oidc(ODR o, Odr_oid *p);
56 YAZ_EXPORT int odr_oid(ODR o, Odr_oid **p, int opt);
57 YAZ_EXPORT int odr_choice(ODR o, Odr_arm arm[], void *p, void *whichp);
58 YAZ_EXPORT int odr_cstring(ODR o, char **p, int opt);
59 YAZ_EXPORT int odr_sequence_of(ODR o, Odr_fun type, void *p, int *num);
60 YAZ_EXPORT int odr_set_of(ODR o, Odr_fun type, void *p, int *num);
61 YAZ_EXPORT int odr_any(ODR o, Odr_any **p, int opt);
62 YAZ_EXPORT int ber_any(ODR o, Odr_any **p);
63 YAZ_EXPORT int completeBER(unsigned char *buf, int len);
64 YAZ_EXPORT void odr_begin(ODR o);
65 YAZ_EXPORT void odr_end(ODR o);
66 YAZ_EXPORT Odr_oid *odr_oiddup(ODR odr, Odr_oid *o);
67 YAZ_EXPORT Odr_oid *odr_oiddup_nmem(NMEM nmem, Odr_oid *o);
68 YAZ_EXPORT int odr_grow_block(odr_ecblock *b, int min_bytes);
69 YAZ_EXPORT int odr_write(ODR o, unsigned char *buf, int bytes);
70 YAZ_EXPORT int odr_seek(ODR o, int whence, int offset);
71 YAZ_EXPORT int odr_dumpBER(FILE *f, char *buf, int len);
72 YAZ_EXPORT void odr_choice_bias(ODR o, int what);
73 YAZ_EXPORT void odr_choice_enable_bias(ODR o, int mode);
74 YAZ_EXPORT int odr_total(ODR o);
75 YAZ_EXPORT char *odr_errmsg(int n);
76 YAZ_EXPORT Odr_oid *odr_getoidbystr(ODR o, char *str);
77 YAZ_EXPORT Odr_oid *odr_getoidbystr_nmem(NMEM o, char *str);
78 YAZ_EXPORT int odr_initmember(ODR o, void *p, int size);
79 YAZ_EXPORT int odr_peektag(ODR o, int *zclass, int *tag, int *cons);
80 YAZ_EXPORT void odr_setlenlen(ODR o, int len);
81 #ifdef __cplusplus
82 }
83 #endif
84
85 #endif