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