/*
- * Copyright (c) 1995-2004, Index Data
+ * Copyright (C) 1995-2005, Index Data ApS
* See the file LICENSE for details.
*
- * $Id: oid.c,v 1.6 2004-12-30 00:12:54 adam Exp $
+ * $Id: oid.c,v 1.10 2005-06-21 07:33:08 adam Exp $
*/
/**
"ID-Charset" },
{PROTO_Z3950, CLASS_USERINFO,VAL_CQL, {16, 2, -1},
"CQL"},
- {PROTO_GENERAL, CLASS_GENERAL, VAL_UCS2, {1,0,10646,1,0,2,-1},
+ {PROTO_GENERAL, CLASS_GENERAL, VAL_UCS2, {1,0,10646,1,0,2,-1},
"UCS-2"},
- {PROTO_GENERAL, CLASS_GENERAL, VAL_UCS4, {1,0,10646,1,0,4,-1},
+ {PROTO_GENERAL, CLASS_GENERAL, VAL_UCS4, {1,0,10646,1,0,4,-1},
"UCS-4"},
- {PROTO_GENERAL, CLASS_GENERAL, VAL_UTF16, {1,0,10646,1,0,5,-1},
+ {PROTO_GENERAL, CLASS_GENERAL, VAL_UTF16, {1,0,10646,1,0,5,-1},
"UTF-16"},
- {PROTO_GENERAL, CLASS_GENERAL, VAL_UTF8, {1,0,10646,1,0,8,-1},
+ {PROTO_GENERAL, CLASS_GENERAL, VAL_UTF8, {1,0,10646,1,0,8,-1},
"UTF-8"},
- {PROTO_Z3950, CLASS_USERINFO,VAL_OCLCUI, {10, 1000, 17, 1, -1},
+ {PROTO_Z3950, CLASS_USERINFO,VAL_OCLCUI, {10, 1000, 17, 1, -1},
"OCLC-userInfo"},
- {PROTO_NOP, CLASS_NOP, VAL_NOP, {-1}, 0 }
+ {PROTO_Z3950, CLASS_EXTSERV, VAL_XMLES, {9,1000,105,4,-1},
+ "XML-ES"},
+ {PROTO_NOP, CLASS_NOP, VAL_NOP, {-1}, 0 }
};
/* OID utilities */
nmem_mutex_enter (oid_mutex);
if (!oident)
{
- char desc_str[200];
struct oident_list *oident_list;
oident_list = (struct oident_list *)
nmem_malloc (oid_nmem, sizeof(*oident_list));
if (!desc)
{
+ char desc_str[OID_SIZE*10];
int i;
- sprintf (desc_str, "%d", *oid);
- for (i = 1; i < 12 && oid[i] >= 0; i++)
- sprintf (desc_str+strlen(desc_str), ".%d", oid[i]);
- desc = desc_str;
+ *desc_str = '\0';
+ if (*oid >= 0)
+ {
+ sprintf (desc_str, "%d", *oid);
+ for (i = 1; i < OID_SIZE && oid[i] >= 0; i++)
+ sprintf (desc_str+strlen(desc_str), ".%d", oid[i]);
+ }
+ oident->desc = nmem_strdup(oid_nmem, desc_str);
}
- oident->desc = nmem_strdup (oid_nmem, desc);
+ else
+ oident->desc = nmem_strdup(oid_nmem, desc);
if (value == VAL_DYNAMIC)
oident->value = (enum oid_value) (++oid_value_dynamic);
else