Fiddling with the variant stuff.
[yaz-moved-to-github.git] / retrieval / d1_read.c
index c951c97..910fa0e 100644 (file)
@@ -4,7 +4,16 @@
  * Sebastian Hammer, Adam Dickmeiss
  *
  * $Log: d1_read.c,v $
- * Revision 1.1  1995-11-01 11:56:09  quinn
+ * Revision 1.4  1995-11-13 09:27:36  quinn
+ * Fiddling with the variant stuff.
+ *
+ * Revision 1.3  1995/11/01  16:34:57  quinn
+ * Making data1 look for tables in data1_tabpath
+ *
+ * Revision 1.2  1995/11/01  13:54:48  quinn
+ * Minor adjustments
+ *
+ * Revision 1.1  1995/11/01  11:56:09  quinn
  * Added Retrieval (data management) functions en masse.
  *
  * Revision 1.14  1995/10/30  12:40:55  quinn
 
 #include <xmalloc.h>
 #include <log.h>
-#include "data1.h"
+#include <data1.h>
+
+char *data1_tabpath = 0; /* global path for tables */
+
+void data1_set_tabpath(char *p)
+{ data1_tabpath = p; }
 
 static data1_node *freelist = 0;
 
@@ -122,6 +136,8 @@ data1_node *data1_insert_taggeddata(data1_node *root, data1_node *at,
     tagn->line = -1;
     tagn->u.tag.tag = 0;
     tagn->u.tag.node_selected = 0;
+    tagn->u.tag.make_variantlist = 0;
+    tagn->u.tag.no_data_requested = 0;
     if (!(tagn->u.tag.element = data1_getelementbytagname(root->u.root.absyn,
        0, tagname)))
     {
@@ -280,7 +296,7 @@ data1_node *data1_read_node(char **buf, data1_node *parent, int *line,
                *buf = t + 1;
            }
        }
-       else /* acquire our element in the abstract syntax */
+       else /* tag.. acquire our element in the abstract syntax */
        {
            data1_node *partag = get_parent_tag(parent);
            data1_element *e = 0;
@@ -312,6 +328,8 @@ data1_node *data1_read_node(char **buf, data1_node *parent, int *line,
            res->u.tag.element = elem;
            res->u.tag.tag = tag;
            res->u.tag.node_selected = 0;
+           res->u.tag.make_variantlist = 0;
+           res->u.tag.no_data_requested = 0;
            res->root = parent->root;
            *buf = t + 1;
        }
@@ -414,7 +432,7 @@ data1_node *data1_read_record(int (*rf)(int, char *, size_t), int fd)
        abort();
     for (;;)
     {
-       if (rd + 4096 > size && !(buf = realloc(buf, size *= 2)))
+       if (rd + 4096 > size && !(buf =xrealloc(buf, size *= 2)))
            abort();
        if ((res = (*rf)(fd, buf + rd, 4096)) <= 0)
        {