Added body-of-text to BIB-1 ANY and the WAIS profile
[yaz-moved-to-github.git] / retrieval / d1_read.c
index 2e989bf..1762248 100644 (file)
@@ -4,7 +4,16 @@
  * Sebastian Hammer, Adam Dickmeiss
  *
  * $Log: d1_read.c,v $
- * Revision 1.7  1995-12-13 13:44:32  quinn
+ * Revision 1.10  1996-01-19 15:41:47  quinn
+ * Fixed uninitialized boolean.
+ *
+ * Revision 1.9  1996/01/17  14:52:47  adam
+ * Changed prototype for reader function parsed to data1_read_record.
+ *
+ * Revision 1.8  1995/12/15  16:20:41  quinn
+ * Added formatted text.
+ *
+ * Revision 1.7  1995/12/13  13:44:32  quinn
  * Modified Data1-system to use nmem
  *
  * Revision 1.6  1995/12/12  16:37:08  quinn
@@ -169,6 +178,7 @@ data1_node *data1_insert_taggeddata(data1_node *root, data1_node *at,
     datn->parent = tagn;
     datn->root = root;
     datn->which = DATA1N_data;
+    datn->u.data.formatted_text = 0;
     tagn->next = at->child;
     tagn->parent = at;
     at->child = tagn;
@@ -400,6 +410,7 @@ data1_node *data1_read_node(char **buf, data1_node *parent, int *line,
        res->u.data.what = DATA1I_text;
        res->u.data.len = len;
        res->u.data.data = data;
+       res->u.data.formatted_text = 0;
        res->root = parent->root;
     }
     return res;
@@ -408,7 +419,8 @@ data1_node *data1_read_node(char **buf, data1_node *parent, int *line,
 /*
  * Read a record in the native syntax.
  */
-data1_node *data1_read_record(int (*rf)(int, char *, size_t), int fd, NMEM m)
+data1_node *data1_read_record(int (*rf)(void *, char *, size_t), void *fh,
+                              NMEM m)
 {
     static char *buf = 0;
     char *bp;
@@ -423,7 +435,7 @@ data1_node *data1_read_record(int (*rf)(int, char *, size_t), int fd, NMEM m)
     {
        if (rd + 4096 > size && !(buf =xrealloc(buf, size *= 2)))
            abort();
-       if ((res = (*rf)(fd, buf + rd, 4096)) <= 0)
+       if ((res = (*rf)(fh, buf + rd, 4096)) <= 0)
        {
            if (!res)
            {