Improved installation. Moved header files to include/yaz.
[yaz-moved-to-github.git] / retrieval / d1_sumout.c
index 7f1eac1..4c477d6 100644 (file)
@@ -1,10 +1,19 @@
 /*
- * Copyright (c) 1995, Index Data.
+ * Copyright (c) 1995-1999, Index Data.
  * See the file LICENSE for details.
  * Sebastian Hammer, Adam Dickmeiss
  *
  * $Log: d1_sumout.c,v $
- * Revision 1.2  1997-09-17 12:10:38  adam
+ * Revision 1.5  1999-11-30 13:47:12  adam
+ * Improved installation. Moved header files to include/yaz.
+ *
+ * Revision 1.4  1999/08/27 09:40:32  adam
+ * Renamed logf function to yaz_log. Removed VC++ project files.
+ *
+ * Revision 1.3  1998/02/11 11:53:35  adam
+ * Changed code so that it compiles as C++.
+ *
+ * Revision 1.2  1997/09/17 12:10:38  adam
  * YAZ version 1.4.
  *
  * Revision 1.1  1996/06/10 08:56:03  quinn
@@ -17,9 +26,9 @@
 #include <string.h>
 #include <stdlib.h>
 
-#include <log.h>
-#include <proto.h>
-#include <data1.h>
+#include <yaz/log.h>
+#include <yaz/proto.h>
+#include <yaz/data1.h>
 
 static int *f_integer(data1_node *c, ODR o)
 {
@@ -29,7 +38,7 @@ static int *f_integer(data1_node *c, ODR o)
     if (!c->child || c->child->which != DATA1N_data ||
        c->child->u.data.len > 63)
        return 0;
-    r = odr_malloc(o, sizeof(*r));
+    r = (int *)odr_malloc(o, sizeof(*r));
     sprintf(intbuf, "%.*s", 63, c->child->u.data.data);
     *r = atoi(intbuf);
     return r;
@@ -41,7 +50,7 @@ static char *f_string(data1_node *c, ODR o)
 
     if (!c->child || c->child->which != DATA1N_data)
        return 0;
-    r = odr_malloc(o, c->child->u.data.len+1);
+    r = (char *)odr_malloc(o, c->child->u.data.len+1);
     memcpy(r, c->child->u.data.data, c->child->u.data.len);
     r[c->child->u.data.len] = '\0';
     return r;
@@ -50,13 +59,13 @@ static char *f_string(data1_node *c, ODR o)
 Z_BriefBib *data1_nodetosummary (data1_handle dh, data1_node *n,
                                 int select, ODR o)
 {
-    Z_BriefBib *res = odr_malloc(o, sizeof(*res));
+    Z_BriefBib *res = (Z_BriefBib *)odr_malloc(o, sizeof(*res));
     data1_node *c;
 
     assert(n->which == DATA1N_root);
     if (strcmp(n->u.root.type, "summary"))
     {
-       logf(LOG_WARN, "Attempt to convert a non-summary record");
+       yaz_log(LOG_WARN, "Attempt to convert a non-summary record");
        return 0;
     }
 
@@ -80,7 +89,7 @@ Z_BriefBib *data1_nodetosummary (data1_handle dh, data1_node *n,
     {
        if (c->which != DATA1N_tag || !c->u.tag.element)
        {
-           logf(LOG_WARN, "Malformed element in Summary record");
+           yaz_log(LOG_WARN, "Malformed element in Summary record");
            return 0;
        }
        if (select && !c->u.tag.node_selected)
@@ -102,7 +111,7 @@ Z_BriefBib *data1_nodetosummary (data1_handle dh, data1_node *n,
            case 16: res->abstract = f_string(c, o); break;
            case 17: abort(); /* TODO */
            default:
-               logf(LOG_WARN, "Unknown element in Summary record.");
+               yaz_log(LOG_WARN, "Unknown element in Summary record.");
        }
     }
     return res;