Changed the way implementationName - and version is set.
[yaz-moved-to-github.git] / include / data1.h
index dce4698..9ea9cfc 100644 (file)
  * OF THIS SOFTWARE.
  *
  * $Log: data1.h,v $
- * Revision 1.39  1998-10-28 15:10:06  adam
+ * Revision 1.42  1999-10-21 12:06:28  adam
+ * Retrieval module no longer uses ctype.h - functions.
+ *
+ * Revision 1.41  1999/07/13 13:23:47  adam
+ * Non-recursive version of data1_read_node. data1_read_nodex reads
+ * stream of bytes (instead of buffer in memory).
+ *
+ * Revision 1.40  1998/11/03 10:14:12  adam
+ * Changed definition of data1 node so that it uses less space.
+ *
+ * Revision 1.39  1998/10/28 15:10:06  adam
  * Added --with-yc option to configure. For the data1_node in data1.h:
  * decreased size of localdata and removed member "line" which wasn't useful.
  *
 #include <yaz-util.h>
 #include <wrbuf.h>
 
+#define d1_isspace(c) strchr(" \r\n\t\f", c)
+#define d1_isdigit(c) ((c) <= '9' && (c) >= '0')
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -410,14 +422,16 @@ typedef struct data1_node
        {
            char *tag;
            data1_element *element;
-           int node_selected;
-           int make_variantlist;
            int no_data_requested;
            int get_bytes;
+           unsigned node_selected : 1;
+           unsigned make_variantlist : 1;
        } tag;
 
        struct
        {
+           char *data;      /* filename or data */
+           int len;
         /* text inclusion */
 #define DATA1I_inctxt 1
         /* binary data inclusion */
@@ -428,10 +442,8 @@ typedef struct data1_node
 #define DATA1I_num 4
         /* object identifier */
 #define DATA1I_oid 5         
-            int what;
-           int formatted_text;     /* newlines are significant */
-           int len;
-           char *data;      /* filename or data */
+            unsigned what:7;
+           unsigned formatted_text : 1;   /* newlines are significant */
        } data;
 
        struct
@@ -442,7 +454,7 @@ typedef struct data1_node
     } u;
 
     void (*destroy)(struct data1_node *n);
-#define DATA1_LOCALDATA 20
+#define DATA1_LOCALDATA 12
     char lbuf[DATA1_LOCALDATA]; /* small buffer for local data */
     struct data1_node *next;
     struct data1_node *child;
@@ -455,8 +467,10 @@ YAZ_EXPORT data1_handle data1_create (void);
 YAZ_EXPORT void data1_destroy(data1_handle dh);
 YAZ_EXPORT data1_node *get_parent_tag(data1_handle dh, data1_node *n);
 YAZ_EXPORT data1_node *data1_read_node(data1_handle dh, const char **buf,
-                                      data1_node *parent,
-                                      int *line, data1_absyn *absyn, NMEM m);
+                                      NMEM m);
+YAZ_EXPORT data1_node *data1_read_nodex (data1_handle dh, NMEM m,
+                                        int (*get_byte)(void *fh), void *fh,
+                                        WRBUF wrbuf);
 YAZ_EXPORT data1_node *data1_read_record(data1_handle dh, 
                                         int (*rf)(void *, char *, size_t),
                                         void *fh, NMEM m);