Changed include/yaz/diagbib1.h and added include/yaz/diagsrw.h with
[yaz-moved-to-github.git] / src / diag-entry.c
diff --git a/src/diag-entry.c b/src/diag-entry.c
new file mode 100644 (file)
index 0000000..d3c082c
--- /dev/null
@@ -0,0 +1,17 @@
+/*
+ * Copyright (C) 1995-2005, Index Data ApS
+ * See the file LICENSE for details.
+ *
+ * $Id: diag-entry.c,v 1.1 2005-04-22 08:27:58 adam Exp $
+ */
+
+#include "diag-entry.h"
+
+const char *yaz_diag_to_str(struct yaz_diag_entry *tab, int code)
+{
+    int i;
+    for (i=0; tab[i].msg; i++)
+        if (tab[i].code == code)
+            return tab[i].msg;
+    return "Unknown error";
+}