Modified function heads & prototypes.
[yaz-moved-to-github.git] / util / oid.c
index bc36e70..c44ce71 100644 (file)
@@ -4,7 +4,13 @@
  * Sebastian Hammer, Adam Dickmeiss
  *
  * $Log: oid.c,v $
- * Revision 1.2  1995-08-21 09:11:16  quinn
+ * Revision 1.4  1995-09-27 15:03:03  quinn
+ * Modified function heads & prototypes.
+ *
+ * Revision 1.3  1995/09/12  11:32:06  quinn
+ * Added a looker-upper by name.
+ *
+ * Revision 1.2  1995/08/21  09:11:16  quinn
  * Smallish fixes to suppport new formats.
  *
  * Revision 1.1  1995/05/29  08:17:13  quinn
@@ -94,6 +100,10 @@ static oident oids[] =
     {PROTO_Z3950,   CLASS_EXTSERV, VAL_EXPORTSPEC,{9,6,-1},    "exp. spec."  },
     {PROTO_Z3950,   CLASS_EXTSERV, VAL_EXPORTINV, {9,7,-1},    "exp. inv."   },
 
+    {PROTO_Z3950,   CLASS_TAGSET,  VAL_SETM,      {14,1,-1},   "TagsetM"     },
+    {PROTO_Z3950,   CLASS_TAGSET,  VAL_SETG,      {14,2,-1},   "TagsetG"     },
+    {PROTO_Z3950,   CLASS_TAGSET,  VAL_GILS,      {14,3,-1},   "GILS"        },
+
     /* SR definitions. Note that some of them aren't defined by the
        standard (yet), but are borrowed from Z3950v3 */
     {PROTO_SR,      CLASS_ABSYN,   VAL_APDU,      {2,1,-1},    "SR-APDU"     },
@@ -142,24 +152,28 @@ static oident oids[] =
     {PROTO_SR,      CLASS_EXTSERV, VAL_DBUPDATE,  {9,5,-1},    "DB. Update"  },
     {PROTO_SR,      CLASS_EXTSERV, VAL_EXPORTSPEC,{9,6,-1},    "exp. spec."  },
     {PROTO_SR,      CLASS_EXTSERV, VAL_EXPORTINV, {9,7,-1},    "exp. inv."   },
+
+    {PROTO_SR,      CLASS_TAGSET,  VAL_SETM,      {14,1,-1},   "TagsetM"     },
+    {PROTO_SR,      CLASS_TAGSET,  VAL_SETG,      {14,2,-1},   "TagsetG"     },
+
     {0,             0,             0,             {-1},        0          }
 };
 
 /* OID utilities */
 
-void oid_oidcpy(int *t, int *s)
+void MDF oid_oidcpy(int *t, int *s)
 {
     while ((*(t++) = *(s++)) > -1);
 }
 
-void oid_oidcat(int *t, int *s)
+void MDF oid_oidcat(int *t, int *s)
 {
     while (*t > -1)
        t++;
     while ((*(t++) = *(s++)) > -1);
 }
 
-int oid_oidcmp(int *o1, int *o2)
+int MDF oid_oidcmp(int *o1, int *o2)
 {
     while (*o1 == *o2 && *o1 > -1)
     {
@@ -174,7 +188,7 @@ int oid_oidcmp(int *o1, int *o2)
        return -1;
 }
 
-int oid_oidlen(int *o)
+int MDF oid_oidlen(int *o)
 {
     int len = 0;
 
@@ -194,7 +208,7 @@ static int match_prefix(int *look, int *prefix)
     return 0;
 }
 
-struct oident *oid_getentbyoid(int *o)
+struct MDF oident *oid_getentbyoid(int *o)
 {
     enum oid_proto proto;
     int prelen;
@@ -218,7 +232,7 @@ struct oident *oid_getentbyoid(int *o)
 /*
  * To query, fill out proto, class, and value of the ent parameter.
  */
-int *oid_getoidbyent(struct oident *ent)
+int MDF *oid_getoidbyent(struct oident *ent)
 {
     struct oident *p;
     static int ret[OID_SIZE];
@@ -239,3 +253,13 @@ int *oid_getoidbyent(struct oident *ent)
        }
     return 0;
 }
+
+oid_value MDF oid_getvalbyname(char *name)
+{
+    struct oident *p;
+
+    for (p = oids; *p->oidsuffix >= 0; p++)
+       if (!strcmp(p->desc, name))
+           return p->value;
+    return VAL_NONE;
+}