Added COOKIE UserInfo OID.
[yaz-moved-to-github.git] / include / oid.h
1 /*
2  * Copyright (c) 1995-1999, Index Data.
3  *
4  * Permission to use, copy, modify, distribute, and sell this software and
5  * its documentation, in whole or in part, for any purpose, is hereby granted,
6  * provided that:
7  *
8  * 1. This copyright and permission notice appear in all copies of the
9  * software and its documentation. Notices of copyright or attribution
10  * which appear at the beginning of any file must remain unchanged.
11  *
12  * 2. The name of Index Data or the individual authors may not be used to
13  * endorse or promote products derived from this software without specific
14  * prior written permission.
15  *
16  * THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND,
17  * EXPRESS, IMPLIED, OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
18  * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
19  * IN NO EVENT SHALL INDEX DATA BE LIABLE FOR ANY SPECIAL, INCIDENTAL,
20  * INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES
21  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR
22  * NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
23  * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
24  * OF THIS SOFTWARE.
25  *
26  * $Log: oid.h,v $
27  * Revision 1.31  1999-04-15 09:19:43  adam
28  * Added COOKIE UserInfo OID.
29  *
30  * Revision 1.30  1999/04/09 12:16:11  adam
31  * Added OtherInfo private OID proxy.
32  *
33  * Revision 1.29  1998/12/03 11:33:04  adam
34  * Added OID's for XML.
35  *
36  * Revision 1.28  1998/10/13 16:01:52  adam
37  * Implemented support for dynamic object identifiers.
38  * Function oid_getvalbyname now accepts raw OID's as well as traditional
39  * names.
40  *
41  * Revision 1.27  1998/05/18 13:06:58  adam
42  * Changed the way attribute sets are handled by the retriaval module.
43  * Extended Explain conversion / schema.
44  * Modified server and client to work with ASN.1 compiled protocol handlers.
45  *
46  * Revision 1.26  1998/03/20 14:46:06  adam
47  * Added UNIverse Resource Reports.
48  *
49  * Revision 1.25  1998/02/10 15:31:52  adam
50  * Implemented date and time structure. Changed the Update Extended
51  * Service.
52  *
53  * Revision 1.24  1997/09/29 13:18:59  adam
54  * Added function, oid_ent_to_oid, to replace the function
55  * oid_getoidbyent, which is not thread safe.
56  *
57  * Revision 1.23  1997/09/01 08:49:50  adam
58  * New windows NT/95 port using MSV5.0. To export DLL functions the
59  * YAZ_EXPORT modifier was added. Defined in yconfig.h.
60  *
61  * Revision 1.22  1997/08/19 08:45:13  quinn
62  * Added Thesaurus
63  *
64  * Revision 1.21  1997/08/19 08:43:49  quinn
65  * Housekeeping
66  *
67  * Revision 1.19  1997/07/28 12:34:42  adam
68  * Added new OID entries (RVDM).
69  *
70  * Revision 1.18  1997/05/14 06:53:42  adam
71  * C++ support.
72  *
73  * Revision 1.17  1997/05/02 08:39:27  quinn
74  * Support for private OID table added. Thanks to Ronald van der Meer
75  *
76  * Revision 1.16  1997/04/30 08:52:08  quinn
77  * Null
78  *
79  * Revision 1.15  1996/10/09  15:54:57  quinn
80  * Added SearchInfoReport
81  *
82  * Revision 1.14  1996/10/07  15:29:17  quinn
83  * Added SOIF support
84  *
85  * Revision 1.13  1996/02/20  17:57:53  adam
86  * Added const to oid_getvalbyname.
87  *
88  * Revision 1.12  1996/02/20  12:52:37  quinn
89  * Various
90  *
91  * Revision 1.11  1996/01/02  08:57:30  quinn
92  * Changed enums in the ASN.1 .h files to #defines. Changed oident.class to oclass
93  *
94  * Revision 1.10  1995/11/13  09:27:31  quinn
95  * Fiddling with the variant stuff.
96  *
97  * Revision 1.9  1995/10/12  10:34:45  quinn
98  * Added Espec-1.
99  *
100  * Revision 1.8  1995/10/10  16:27:08  quinn
101  * *** empty log message ***
102  *
103  * Revision 1.7  1995/09/29  17:12:05  quinn
104  * Smallish
105  *
106  * Revision 1.6  1995/09/27  15:02:48  quinn
107  * Modified function heads & prototypes.
108  *
109  * Revision 1.5  1995/09/12  11:31:46  quinn
110  * Added some oids.
111  *
112  * Revision 1.4  1995/06/27  13:20:32  quinn
113  * Added SUTRS support
114  *
115  * Revision 1.3  1995/05/29  08:11:33  quinn
116  * Moved oid from odr/asn to util.
117  *
118  * Revision 1.2  1995/05/16  08:50:35  quinn
119  * License, documentation, and memory fixes
120  *
121  * Revision 1.1  1995/03/30  09:39:41  quinn
122  * Moved .h files to include directory
123  *
124  * Revision 1.1  1995/03/27  08:32:13  quinn
125  * Added OID database
126  *
127  *
128  */
129
130 #ifndef OID_H
131 #define OID_H
132
133 #include <yconfig.h>
134
135 #ifdef __cplusplus
136 extern "C" {
137 #endif
138
139 #define OID_SIZE 20
140     
141 typedef enum oid_proto
142 {
143     PROTO_NOP=0,
144     PROTO_Z3950,
145     PROTO_SR,
146     PROTO_GENERAL,
147     PROTO_WAIS
148 } oid_proto;
149
150 typedef enum oid_class
151 {
152     CLASS_NOP=0,
153     CLASS_APPCTX,
154     CLASS_ABSYN,
155     CLASS_ATTSET,
156     CLASS_TRANSYN,
157     CLASS_DIAGSET,
158     CLASS_RECSYN,
159     CLASS_RESFORM,
160     CLASS_ACCFORM,
161     CLASS_EXTSERV,
162     CLASS_USERINFO,
163     CLASS_ELEMSPEC,
164     CLASS_VARSET,
165     CLASS_SCHEMA,
166     CLASS_TAGSET,
167     CLASS_GENERAL
168 } oid_class;
169
170 typedef enum oid_value
171 {
172     VAL_NOP=0,
173     VAL_APDU,
174     VAL_BER,
175     VAL_BASIC_CTX,
176     VAL_BIB1,
177     VAL_EXP1,
178     VAL_EXT1,
179     VAL_CCL1,
180     VAL_GILS,
181     VAL_WAIS,
182     VAL_STAS,
183     VAL_COLLECT1,
184     VAL_CIMI1,
185     VAL_GEO,
186     VAL_DIAG1,
187     VAL_ISO2709,
188     VAL_UNIMARC,
189     VAL_INTERMARC,
190     VAL_CCF,
191     VAL_USMARC,
192     VAL_UKMARC,
193     VAL_NORMARC,
194     VAL_LIBRISMARC,
195     VAL_DANMARC,
196     VAL_FINMARC,
197     VAL_MAB,
198     VAL_CANMARC,
199     VAL_SBN,
200     VAL_PICAMARC,
201     VAL_AUSMARC,
202     VAL_IBERMARC,
203     VAL_CATMARC,
204     VAL_MALMARC,
205     VAL_EXPLAIN,
206     VAL_SUTRS,
207     VAL_OPAC,
208     VAL_SUMMARY,
209     VAL_GRS0,
210     VAL_GRS1,
211     VAL_EXTENDED,
212     VAL_FRAGMENT,
213     VAL_RESOURCE1,
214     VAL_RESOURCE2,
215     VAL_PROMPT1,
216     VAL_DES1,
217     VAL_KRB1,
218     VAL_PRESSET,
219     VAL_PQUERY,
220     VAL_PCQUERY,
221     VAL_ITEMORDER,
222     VAL_DBUPDATE,
223     VAL_EXPORTSPEC,
224     VAL_EXPORTINV,
225     VAL_NONE,
226     VAL_SETM,
227     VAL_SETG,
228     VAL_VAR1,
229     VAL_ESPEC1,
230     VAL_SOIF,
231     VAL_SEARCHRES1,
232     VAL_THESAURUS,
233     VAL_CHARLANG,
234     VAL_USERINFO1,
235     VAL_MULTISRCH1,
236     VAL_MULTISRCH2,
237     VAL_DATETIME,
238     VAL_SQLRS,
239     VAL_PDF,
240     VAL_POSTSCRIPT,
241     VAL_HTML,
242     VAL_TIFF,
243     VAL_GIF,
244     VAL_JPEG,
245     VAL_PNG,
246     VAL_MPEG,
247     VAL_SGML,
248     VAL_TIFFB,
249     VAL_WAV,
250     VAL_UPDATEES,
251     VAL_TEXT_XML,
252     VAL_APPLICATION_XML,
253     VAL_UNIVERSE_REPORT,
254     VAL_PROXY,
255     VAL_COOKIE,
256 /* add new types here... */
257
258 /* VAL_DYNAMIC must have highest value */
259     VAL_DYNAMIC
260 } oid_value;
261
262 typedef struct oident
263 {
264     oid_proto proto;
265     oid_class oclass;
266     oid_value value;
267     int oidsuffix[OID_SIZE];
268     char *desc;
269 } oident;
270
271 YAZ_EXPORT int *oid_getoidbyent(struct oident *ent);
272 YAZ_EXPORT int *oid_ent_to_oid(struct oident *ent, int *dst);
273 YAZ_EXPORT struct oident *oid_getentbyoid(int *o);
274 YAZ_EXPORT void oid_oidcpy(int *t, int *s);
275 YAZ_EXPORT void oid_oidcat(int *t, int *s);
276 YAZ_EXPORT int oid_oidcmp(int *o1, int *o2);
277 YAZ_EXPORT int oid_oidlen(int *o);
278 YAZ_EXPORT oid_value oid_getvalbyname(const char *name);
279 YAZ_EXPORT void oid_setprivateoids(oident *list);
280 YAZ_EXPORT struct oident *oid_addent (int *oid, int proto, int oclass,
281                                       const char *desc, int value);
282
283 #ifdef __cplusplus
284 }
285 #endif
286
287 #endif