Updated footer comment
[yaz-moved-to-github.git] / src / oid_db.c
index 8318018..27f5be5 100644 (file)
@@ -1,8 +1,6 @@
-/*
- * Copyright (C) 1995-2007, Index Data ApS
+/* This file is part of the YAZ toolkit.
+ * Copyright (C) 1995-2009 Index Data
  * See the file LICENSE for details.
- *
- * $Id: oid_db.c,v 1.8 2007-05-08 08:22:36 adam Exp $
  */
 
 /**
@@ -107,6 +105,16 @@ const char *yaz_oid_to_string_buf(const Odr_oid *oid, oid_class *oclass, char *b
     return oid_oid_to_dotstring(oid, buf);
 }
 
+
+char *oid_name_to_dotstring(oid_class oclass, const char *name, char *oid_buf)
+{
+    const Odr_oid *oid = yaz_string_to_oid(yaz_oid_std(), oclass, name);
+    if (oid)
+        return oid_oid_to_dotstring(oid, oid_buf);
+    return 0;
+}
+
+
 int yaz_oid_is_iso2709(const Odr_oid *oid)
 {
     if (oid_oidlen(oid) == 6 && oid[0] == 1 && oid[1] == 2
@@ -116,7 +124,7 @@ int yaz_oid_is_iso2709(const Odr_oid *oid)
     return 0;
 }
 
-int yaz_oid_add(yaz_oid_db_t oid_db, int oclass, const char *name,
+int yaz_oid_add(yaz_oid_db_t oid_db, oid_class oclass, const char *name,
                const Odr_oid *new_oid)
 {
     const Odr_oid *oid = yaz_string_to_oid(oid_db, oclass, name);
@@ -194,6 +202,7 @@ void yaz_oid_trav(yaz_oid_db_t oid_db,
 /*
  * Local variables:
  * c-basic-offset: 4
+ * c-file-style: "Stroustrup"
  * indent-tabs-mode: nil
  * End:
  * vim: shiftwidth=4 tabstop=8 expandtab