Removed element num_children from data1_node. Minor changes in
[yaz-moved-to-github.git] / include / data1.h
index 9a3a4af..e6e2584 100644 (file)
  * OF THIS SOFTWARE.
  *
  * $Log: data1.h,v $
- * Revision 1.26  1997-09-17 12:10:32  adam
+ * Revision 1.31  1997-11-18 09:51:08  adam
+ * Removed element num_children from data1_node. Minor changes in
+ * data1 to Explain.
+ *
+ * Revision 1.30  1997/10/31 12:20:07  adam
+ * Improved memory debugging for xmalloc/nmem.c. References to NMEM
+ * instead of ODR in n ESPEC-1 handling in source d1_espec.c.
+ * Bug fix: missing fclose in data1_read_espec1.
+ *
+ * Revision 1.29  1997/10/27 13:54:18  adam
+ * Changed structure field in data1 node to be simple string which
+ * is "unknown" to the retrieval system itself.
+ *
+ * Revision 1.28  1997/10/06 09:37:53  adam
+ * Added prototype for data1_get_map_buf.
+ *
+ * Revision 1.27  1997/09/24 13:35:44  adam
+ * Added two members to data1_marctab to ease reading of weird MARC records.
+ *
+ * Revision 1.26  1997/09/17 12:10:32  adam
  * YAZ version 1.4.
  *
  * Revision 1.25  1997/09/05 09:50:55  adam
@@ -189,12 +208,6 @@ typedef enum data1_datatype
     DATA1K_null
 } data1_datatype;
 
-typedef enum data1_structure
-{
-    DATA1S_word,
-    DATA1S_phrase
-} data1_structure;
-
 typedef struct data1_marctab
 {
     char *name;
@@ -211,6 +224,8 @@ typedef struct data1_marctab
     int  length_implementation;
     char future_use[2];
 
+    int  force_indicator_length;
+    int  force_identifier_length;
     struct data1_marctab *next;
 } data1_marctab;
 
@@ -286,7 +301,7 @@ typedef struct data1_tagset
 typedef struct data1_termlist
 {
     data1_att *att;
-    data1_structure structure;
+    char *structure;
     struct data1_termlist *next;
 } data1_termlist;
 
@@ -323,13 +338,13 @@ typedef struct data1_absyn
 
 typedef struct data1_node
 {
-        /* the root of a record (containing global data) */
+    /* the root of a record (containing global data) */
 #define DATA1N_root 1 
-        /* a tag */
+    /* a tag */
 #define DATA1N_tag  2       
-        /* some data under a leaf tag or variant */
+    /* some data under a leaf tag or variant */
 #define DATA1N_data 3
-        /* variant specification (a triple, actually) */
+    /* variant specification (a triple, actually) */
 #define DATA1N_variant 4
     int which;
 
@@ -367,8 +382,6 @@ typedef struct data1_node
            int formatted_text;     /* newlines are significant */
            int len;
            char *data;      /* filename or data */
-#define DATA1_LOCALDATA 40
-           char lbuf[DATA1_LOCALDATA]; /* small buffer for local data */
        } data;
 
        struct
@@ -376,17 +389,12 @@ typedef struct data1_node
            data1_vartype *type;
            char *value;
        } variant;
-
-       struct
-       {
-           char *ind;
-       } indicator;
     } u;
 
     void (*destroy)(struct data1_node *n);
+#define DATA1_LOCALDATA 40
     char lbuf[DATA1_LOCALDATA]; /* small buffer for local data */
     int line;
-    int num_children;
     struct data1_node *next;
     struct data1_node *child;
     struct data1_node *last_child;
@@ -428,8 +436,7 @@ YAZ_EXPORT data1_varset *data1_read_varset(data1_handle dh, const char *file);
 YAZ_EXPORT data1_vartype *data1_getvartypebyct(data1_handle dh,
                                               data1_varset *set,
                                               char *zclass, char *type);
-YAZ_EXPORT Z_Espec1 *data1_read_espec1(data1_handle dh, const char *file,
-                                      ODR o);
+YAZ_EXPORT Z_Espec1 *data1_read_espec1(data1_handle dh, const char *file);
 YAZ_EXPORT int data1_doespec1(data1_handle dh, data1_node *n, Z_Espec1 *e);
 YAZ_EXPORT data1_esetname *data1_getesetbyname(data1_handle dh, 
                                               data1_absyn *a, char *name);
@@ -460,8 +467,10 @@ YAZ_EXPORT const char *data1_get_tabpath(data1_handle dh);
 
 YAZ_EXPORT WRBUF data1_get_wrbuf (data1_handle dp);
 YAZ_EXPORT char **data1_get_read_buf (data1_handle dp, int **lenp);
+YAZ_EXPORT char **data1_get_map_buf (data1_handle dp, int **lenp);
 YAZ_EXPORT data1_absyn_cache *data1_absyn_cache_get (data1_handle dh);
 YAZ_EXPORT NMEM data1_nmem_get (data1_handle dh);
+YAZ_EXPORT void data1_pr_tree (data1_handle dh, data1_node *n, FILE *out);
 
 #ifdef __cplusplus
 }