Added
authorja7 <ja7>
Thu, 29 Aug 2002 19:36:09 +0000 (19:36 +0000)
committerja7 <ja7>
Thu, 29 Aug 2002 19:36:09 +0000 (19:36 +0000)
YAZ_EXPORT const char* yaz_z3950_oid_value_to_str(oid_value ov, oid_class oc);
Used for gettting ui friendly names for oid_value's

include/yaz/proto.h
zutil/z3950oid.c

index be0d05b..ccdff59 100644 (file)
@@ -4,7 +4,12 @@
  * Sebastian Hammer, Adam Dickmeiss
  *
  * $Log: proto.h,v $
- * Revision 1.2  2002-02-11 23:25:26  adam
+ * Revision 1.3  2002-08-29 19:36:09  ja7
+ * Added
+ * YAZ_EXPORT const char* yaz_z3950_oid_value_to_str(oid_value ov, oid_class oc);
+ * Used for gettting ui friendly names for oid_value's
+ *
+ * Revision 1.2  2002/02/11 23:25:26  adam
  * Rustam's patch
  *
  * Revision 1.1  2001/10/23 21:00:19  adam
@@ -79,6 +84,7 @@
 #include <yaz/z-univ.h>
 #include <yaz/zes-update0.h>
 #include <yaz/z-charneg.h>
+#include <yaz/oid.h>
 
 YAZ_BEGIN_CDECL
 
@@ -143,6 +149,8 @@ YAZ_EXPORT Odr_oid *yaz_str_to_z3950oid (ODR o, int oid_class,
                                         const char *str);
 YAZ_EXPORT const char *yaz_z3950oid_to_str (Odr_oid *oid, int *oid_class);
 
+YAZ_EXPORT const char* yaz_z3950_oid_value_to_str(oid_value ov, oid_class oc);
+
 YAZ_END_CDECL
 
 #include <yaz/prt-ext.h>
index b0b6a59..2622d8e 100644 (file)
@@ -2,7 +2,7 @@
  * Copyright (c) 1995-2002, Index Data
  * See the file LICENSE for details.
  *
- * $Id: z3950oid.c,v 1.2 2002-01-28 09:27:17 adam Exp $
+ * $Id: z3950oid.c,v 1.3 2002-08-29 19:36:09 ja7 Exp $
  */
 
 #if HAVE_CONFIG_H
@@ -50,3 +50,31 @@ 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: 4
+ * c-basic-offset: 4
+ * End:
+ */