2 * Copyright (c) 1995-2001, Index Data
3 * See the file LICENSE for details.
5 * $Id: z3950oid.c,v 1.1 2001-09-25 07:35:37 adam Exp $
12 #include <yaz/proto.h>
14 Odr_oid *yaz_oidval_to_z3950oid (ODR o, int oid_class, int oid_value)
19 ident.proto = PROTO_Z3950;
20 ident.oclass = oid_class;
21 ident.value = oid_value;
23 if (ident.value == VAL_NONE)
26 return odr_oiddup(o, oid_ent_to_oid(&ident, oid));
29 Odr_oid *yaz_str_to_z3950oid (ODR o, int oid_class, const char *str)
34 ident.proto = PROTO_Z3950;
35 ident.oclass = oid_class;
36 ident.value = oid_getvalbyname(str);
38 if (ident.value == VAL_NONE)
41 return odr_oiddup(o, oid_ent_to_oid(&ident, oid));
44 const char *yaz_z3950oid_to_str (Odr_oid *oid, int *oid_class)
46 struct oident *ident = oid_getentbyoid(oid);
48 if (!ident || ident->value == VAL_NONE)
50 *oid_class = ident->oclass;