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