Added function, oid_ent_to_oid, to replace the function
[yaz-moved-to-github.git] / include / oid.h
index 1d90a46..eab0ca7 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, Index Data.
+ * Copyright (c) 1995-1997, Index Data.
  *
  * Permission to use, copy, modify, distribute, and sell this software and
  * its documentation, in whole or in part, for any purpose, is hereby granted,
  * OF THIS SOFTWARE.
  *
  * $Log: oid.h,v $
- * Revision 1.7  1995-09-29 17:12:05  quinn
+ * Revision 1.24  1997-09-29 13:18:59  adam
+ * Added function, oid_ent_to_oid, to replace the function
+ * oid_getoidbyent, which is not thread safe.
+ *
+ * Revision 1.23  1997/09/01 08:49:50  adam
+ * New windows NT/95 port using MSV5.0. To export DLL functions the
+ * YAZ_EXPORT modifier was added. Defined in yconfig.h.
+ *
+ * Revision 1.22  1997/08/19 08:45:13  quinn
+ * Added Thesaurus
+ *
+ * Revision 1.21  1997/08/19 08:43:49  quinn
+ * Housekeeping
+ *
+ * Revision 1.19  1997/07/28 12:34:42  adam
+ * Added new OID entries (RVDM).
+ *
+ * Revision 1.18  1997/05/14 06:53:42  adam
+ * C++ support.
+ *
+ * Revision 1.17  1997/05/02 08:39:27  quinn
+ * Support for private OID table added. Thanks to Ronald van der Meer
+ *
+ * Revision 1.16  1997/04/30 08:52:08  quinn
+ * Null
+ *
+ * Revision 1.15  1996/10/09  15:54:57  quinn
+ * Added SearchInfoReport
+ *
+ * Revision 1.14  1996/10/07  15:29:17  quinn
+ * Added SOIF support
+ *
+ * Revision 1.13  1996/02/20  17:57:53  adam
+ * Added const to oid_getvalbyname.
+ *
+ * Revision 1.12  1996/02/20  12:52:37  quinn
+ * Various
+ *
+ * Revision 1.11  1996/01/02  08:57:30  quinn
+ * Changed enums in the ASN.1 .h files to #defines. Changed oident.class to oclass
+ *
+ * Revision 1.10  1995/11/13  09:27:31  quinn
+ * Fiddling with the variant stuff.
+ *
+ * Revision 1.9  1995/10/12  10:34:45  quinn
+ * Added Espec-1.
+ *
+ * Revision 1.8  1995/10/10  16:27:08  quinn
+ * *** empty log message ***
+ *
+ * Revision 1.7  1995/09/29  17:12:05  quinn
  * Smallish
  *
  * Revision 1.6  1995/09/27  15:02:48  quinn
 
 #include <yconfig.h>
 
-#define OID_SIZE 100
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define OID_SIZE 20
+    
+typedef enum oid_proto
+{
+    PROTO_Z3950,
+    PROTO_SR,
+    PROTO_GENERAL,
+    PROTO_WAIS
+} oid_proto;
+
+typedef enum oid_class
+{
+    CLASS_APPCTX,
+    CLASS_ABSYN,
+    CLASS_ATTSET,
+    CLASS_TRANSYN,
+    CLASS_DIAGSET,
+    CLASS_RECSYN,
+    CLASS_RESFORM,
+    CLASS_ACCFORM,
+    CLASS_EXTSERV,
+    CLASS_USERINFO,
+    CLASS_ELEMSPEC,
+    CLASS_VARSET,
+    CLASS_SCHEMA,
+    CLASS_TAGSET
+} oid_class;
+
+typedef enum oid_value
+{
+    VAL_APDU,
+    VAL_BER,
+    VAL_BASIC_CTX,
+    VAL_BIB1,
+    VAL_EXP1,
+    VAL_EXT1,
+    VAL_CCL1,
+    VAL_GILS,
+    VAL_WAIS,
+    VAL_STAS,
+    VAL_COLLECT1,
+    VAL_CIMI1,
+    VAL_GEO,
+    VAL_DIAG1,
+    VAL_ISO2709,
+    VAL_UNIMARC,
+    VAL_INTERMARC,
+    VAL_CCF,
+    VAL_USMARC,
+    VAL_UKMARC,
+    VAL_NORMARC,
+    VAL_LIBRISMARC,
+    VAL_DANMARC,
+    VAL_FINMARC,
+    VAL_MAB,
+    VAL_CANMARC,
+    VAL_SBN,
+    VAL_PICAMARC,
+    VAL_AUSMARC,
+    VAL_IBERMARC,
+    VAL_CATMARC,
+    VAL_MALMARC,
+    VAL_EXPLAIN,
+    VAL_SUTRS,
+    VAL_OPAC,
+    VAL_SUMMARY,
+    VAL_GRS0,
+    VAL_GRS1,
+    VAL_EXTENDED,
+    VAL_FRAGMENT,
+    VAL_RESOURCE1,
+    VAL_RESOURCE2,
+    VAL_PROMPT1,
+    VAL_DES1,
+    VAL_KRB1,
+    VAL_PRESSET,
+    VAL_PQUERY,
+    VAL_PCQUERY,
+    VAL_ITEMORDER,
+    VAL_DBUPDATE,
+    VAL_EXPORTSPEC,
+    VAL_EXPORTINV,
+    VAL_NONE,
+    VAL_SETM,
+    VAL_SETG,
+    VAL_VAR1,
+    VAL_ESPEC1,
+    VAL_SOIF,
+    VAL_SEARCHRES1,
+    VAL_THESAURUS
+} oid_value;
 
 typedef struct oident
 {
-    enum oid_proto
-    {
-       PROTO_Z3950,
-       PROTO_SR,
-       PROTO_GENERAL
-    } proto;
-    enum oid_class
-    {
-       CLASS_APPCTX,
-       CLASS_ABSYN,
-       CLASS_ATTSET,
-       CLASS_TRANSYN,
-       CLASS_DIAGSET,
-       CLASS_RECSYN,
-       CLASS_RESFORM,
-       CLASS_ACCFORM,
-       CLASS_EXTSERV,
-       CLASS_USERINFO,
-       CLASS_ELEMSPEC,
-       CLASS_VARSET,
-       CLASS_DBSCHEMA,
-       CLASS_TAGSET
-    } class;
-    enum oid_value
-    {
-       VAL_APDU,
-       VAL_BER,
-       VAL_BASIC_CTX,
-       VAL_BIB1,
-       VAL_EXP1,
-       VAL_EXT1,
-       VAL_CCL1,
-       VAL_GILS,
-       VAL_STAS,
-       VAL_DIAG1,
-       VAL_ISO2709,
-       VAL_UNIMARC,
-       VAL_INTERMARC,
-       VAL_CCF,
-       VAL_USMARC,
-       VAL_UKMARC,
-       VAL_NORMARC,
-       VAL_LIBRISMARC,
-       VAL_DANMARC,
-       VAL_FINMARC,
-       VAL_MAB,
-       VAL_CANMARC,
-       VAL_SBN,
-       VAL_PICAMARC,
-       VAL_AUSMARC,
-       VAL_IBERMARC,
-       VAL_EXPLAIN,
-       VAL_SUTRS,
-       VAL_OPAC,
-       VAL_SUMMARY,
-       VAL_GRS0,
-       VAL_GRS1,
-       VAL_EXTENDED,
-       VAL_RESOURCE1,
-       VAL_RESOURCE2,
-       VAL_PROMPT1,
-       VAL_DES1,
-       VAL_KRB1,
-       VAL_PRESSET,
-       VAL_PQUERY,
-       VAL_PCQUERY,
-       VAL_ITEMORDER,
-       VAL_DBUPDATE,
-       VAL_EXPORTSPEC,
-       VAL_EXPORTINV,
-       VAL_NONE,
-       VAL_SETM,
-       VAL_SETG
-    } value;
+    oid_proto proto;
+    oid_class oclass;
+    oid_value value;
     int oidsuffix[20];
     char *desc;
 } oident;
 
-typedef enum oid_proto oid_proto;
-typedef enum oid_class oid_class;
-typedef enum oid_value oid_value;
+YAZ_EXPORT int *oid_getoidbyent(struct oident *ent);
+YAZ_EXPORT int *oid_ent_to_oid(struct oident *ent, int *dst);
+YAZ_EXPORT struct oident *oid_getentbyoid(int *o);
+YAZ_EXPORT void oid_oidcpy(int *t, int *s);
+YAZ_EXPORT void oid_oidcat(int *t, int *s);
+YAZ_EXPORT int oid_oidcmp(int *o1, int *o2);
+YAZ_EXPORT int oid_oidlen(int *o);
+YAZ_EXPORT oid_value oid_getvalbyname(const char *name);
+YAZ_EXPORT void oid_setprivateoids(oident *list);
 
-int *oid_getoidbyent(struct oident *ent);
-struct oident *oid_getentbyoid(int *o);
-void oid_oidcpy(int *t, int *s);
-void oid_oidcat(int *t, int *s);
-int oid_oidcmp(int *o1, int *o2);
-int oid_oidlen(int *o);
-oid_value oid_getvalbyname(char *name);
+#ifdef __cplusplus
+}
+#endif
 
 #endif