Using autoconf. New definitions: YAZ_BEGIN_CDECL/YAZ_END_CDECL.
[yaz-moved-to-github.git] / include / yaz / oid.h
1 /*
2  * Copyright (c) 1995-2000, 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  * $Id: oid.h,v 1.5 2000-02-28 11:20:06 adam Exp $
27  */
28
29 #ifndef OID_H
30 #define OID_H
31
32 #include <yaz/yconfig.h>
33
34 YAZ_BEGIN_CDECL
35
36 #define OID_SIZE 20
37     
38 typedef enum oid_proto
39 {
40     PROTO_NOP=0,
41     PROTO_Z3950,
42     PROTO_SR,
43     PROTO_GENERAL,
44     PROTO_WAIS
45 } oid_proto;
46
47 typedef enum oid_class
48 {
49     CLASS_NOP=0,
50     CLASS_APPCTX,
51     CLASS_ABSYN,
52     CLASS_ATTSET,
53     CLASS_TRANSYN,
54     CLASS_DIAGSET,
55     CLASS_RECSYN,
56     CLASS_RESFORM,
57     CLASS_ACCFORM,
58     CLASS_EXTSERV,
59     CLASS_USERINFO,
60     CLASS_ELEMSPEC,
61     CLASS_VARSET,
62     CLASS_SCHEMA,
63     CLASS_TAGSET,
64     CLASS_GENERAL
65 } oid_class;
66
67 typedef enum oid_value
68 {
69     VAL_NOP=0,
70     VAL_APDU,
71     VAL_BER,
72     VAL_BASIC_CTX,
73     VAL_BIB1,
74     VAL_EXP1,
75     VAL_EXT1,
76     VAL_CCL1,
77     VAL_GILS,
78     VAL_WAIS,
79     VAL_STAS,
80     VAL_COLLECT1,
81     VAL_CIMI1,
82     VAL_GEO,
83     VAL_DIAG1,
84     VAL_ISO2709,
85     VAL_UNIMARC,
86     VAL_INTERMARC,
87     VAL_CCF,
88     VAL_USMARC,
89     VAL_UKMARC,
90     VAL_NORMARC,
91     VAL_LIBRISMARC,
92     VAL_DANMARC,
93     VAL_FINMARC,
94     VAL_MAB,
95     VAL_CANMARC,
96     VAL_SBN,
97     VAL_PICAMARC,
98     VAL_AUSMARC,
99     VAL_IBERMARC,
100     VAL_CATMARC,
101     VAL_MALMARC,
102     VAL_EXPLAIN,
103     VAL_SUTRS,
104     VAL_OPAC,
105     VAL_SUMMARY,
106     VAL_GRS0,
107     VAL_GRS1,
108     VAL_EXTENDED,
109     VAL_FRAGMENT,
110     VAL_RESOURCE1,
111     VAL_RESOURCE2,
112     VAL_PROMPT1,
113     VAL_DES1,
114     VAL_KRB1,
115     VAL_PRESSET,
116     VAL_PQUERY,
117     VAL_PCQUERY,
118     VAL_ITEMORDER,
119     VAL_DBUPDATE0,
120     VAL_DBUPDATE,
121     VAL_EXPORTSPEC,
122     VAL_EXPORTINV,
123     VAL_NONE,
124     VAL_SETM,
125     VAL_SETG,
126     VAL_VAR1,
127     VAL_ESPEC1,
128     VAL_SOIF,
129     VAL_SEARCHRES1,
130     VAL_THESAURUS,
131     VAL_CHARLANG,
132     VAL_USERINFO1,
133     VAL_MULTISRCH1,
134     VAL_MULTISRCH2,
135     VAL_DATETIME,
136     VAL_SQLRS,
137     VAL_PDF,
138     VAL_POSTSCRIPT,
139     VAL_HTML,
140     VAL_TIFF,
141     VAL_GIF,
142     VAL_JPEG,
143     VAL_PNG,
144     VAL_MPEG,
145     VAL_SGML,
146     VAL_TIFFB,
147     VAL_WAV,
148     VAL_UPDATEES,
149     VAL_TEXT_XML,
150     VAL_APPLICATION_XML,
151     VAL_UNIVERSE_REPORT,
152     VAL_PROXY,
153     VAL_COOKIE,
154     VAL_CLIENT_IP,
155     VAL_ISO_ILL_1,
156     VAL_ZBIG,
157     VAL_UTIL,
158     VAL_XD1,
159     VAL_ZTHES,
160     VAL_FIN1,
161     VAL_DAN1,
162     VAL_DIAG_ES,
163     VAL_DIAG_GENERAL,
164     VAL_JPMARC,
165     VAL_SWEMARC,
166     VAL_SIGLEMARC,
167     VAL_ISDSMARC,
168     VAL_RUSMARC,
169 /* add new types here... */
170
171 /* VAL_DYNAMIC must have highest value */
172     VAL_DYNAMIC,
173     VAL_MAX = VAL_DYNAMIC+30
174 } oid_value;
175
176 typedef struct oident
177 {
178     oid_proto proto;
179     oid_class oclass;
180     oid_value value;
181     int oidsuffix[OID_SIZE];
182     char *desc;
183 } oident;
184
185 YAZ_EXPORT int *oid_getoidbyent(struct oident *ent);
186 YAZ_EXPORT int *oid_ent_to_oid(struct oident *ent, int *dst);
187 YAZ_EXPORT struct oident *oid_getentbyoid(int *o);
188 YAZ_EXPORT void oid_oidcpy(int *t, int *s);
189 YAZ_EXPORT void oid_oidcat(int *t, int *s);
190 YAZ_EXPORT int oid_oidcmp(int *o1, int *o2);
191 YAZ_EXPORT int oid_oidlen(int *o);
192 YAZ_EXPORT oid_value oid_getvalbyname(const char *name);
193 YAZ_EXPORT void oid_setprivateoids(oident *list);
194 YAZ_EXPORT struct oident *oid_addent (int *oid, enum oid_proto proto,
195                                       enum oid_class oclass,
196                                       const char *desc, int value);
197 YAZ_EXPORT void oid_init(void);
198 YAZ_EXPORT void oid_exit(void);
199
200 YAZ_END_CDECL
201
202 #endif