X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=zutil%2Fz3950oid.c;h=95687a0e07129a3c90853043092fe0cdb779e9ea;hb=94c77ca831e55b3dee31184347f25dd0583085d2;hp=f8eb6ab94b70ea82d6f4ab5ba9f34536295e8228;hpb=abfaf391015e3036af3d56859511bb7daaa6fe23;p=yaz-moved-to-github.git diff --git a/zutil/z3950oid.c b/zutil/z3950oid.c index f8eb6ab..95687a0 100644 --- a/zutil/z3950oid.c +++ b/zutil/z3950oid.c @@ -1,8 +1,8 @@ /* - * Copyright (c) 1995-2001, Index Data + * Copyright (c) 1995-2003, Index Data * See the file LICENSE for details. * - * $Id: z3950oid.c,v 1.1 2001-09-25 07:35:37 adam Exp $ + * $Id: z3950oid.c,v 1.5 2003-01-06 08:20:29 adam Exp $ */ #if HAVE_CONFIG_H @@ -17,8 +17,8 @@ Odr_oid *yaz_oidval_to_z3950oid (ODR o, int oid_class, int oid_value) int oid[OID_SIZE]; ident.proto = PROTO_Z3950; - ident.oclass = oid_class; - ident.value = oid_value; + ident.oclass = (enum oid_class) oid_class; + ident.value = (enum oid_value) oid_value; if (ident.value == VAL_NONE) return 0; @@ -32,7 +32,7 @@ Odr_oid *yaz_str_to_z3950oid (ODR o, int oid_class, const char *str) int oid[OID_SIZE]; ident.proto = PROTO_Z3950; - ident.oclass = oid_class; + ident.oclass = (enum oid_class) oid_class; ident.value = oid_getvalbyname(str); if (ident.value == VAL_NONE) @@ -50,3 +50,33 @@ const char *yaz_z3950oid_to_str (Odr_oid *oid, int *oid_class) *oid_class = ident->oclass; return ident->desc; } + + +const char* yaz_z3950_oid_value_to_str(oid_value ov, oid_class oc) +{ + struct oident tmpentry; + int tmp_oid[OID_SIZE]; + + tmpentry.proto = PROTO_Z3950; + tmpentry.oclass = oc; + tmpentry.value = ov; + + if( oid_ent_to_oid(&tmpentry,tmp_oid) ) + { + return tmpentry.desc; + } + else + { + return ""; + } +} + + +/* + * Local variables: + * tab-width: 8 + * c-basic-offset: 4 + * End: + * vim600: sw=4 ts=8 fdm=marker + * vim<600: sw=4 ts=8 + */