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