Changed structure field in data1 node to be simple string which
authorAdam Dickmeiss <adam@indexdata.dk>
Mon, 27 Oct 1997 13:54:18 +0000 (13:54 +0000)
committerAdam Dickmeiss <adam@indexdata.dk>
Mon, 27 Oct 1997 13:54:18 +0000 (13:54 +0000)
is "unknown" to the retrieval system itself.

include/data1.h
retrieval/d1_absyn.c
tab/gils.abs
tab/meta.abs

index ef47cb8..e2d0d20 100644 (file)
  * OF THIS SOFTWARE.
  *
  * $Log: data1.h,v $
- * Revision 1.28  1997-10-06 09:37:53  adam
+ * 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
@@ -195,12 +199,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;
@@ -294,7 +292,7 @@ typedef struct data1_tagset
 typedef struct data1_termlist
 {
     data1_att *att;
-    data1_structure structure;
+    char *structure;
     struct data1_termlist *next;
 } data1_termlist;
 
@@ -331,13 +329,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;
 
@@ -375,8 +373,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
@@ -392,6 +388,7 @@ typedef struct data1_node
     } 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;
@@ -471,6 +468,7 @@ 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
 }
index ab1b3ac..3262dec 100644 (file)
@@ -4,7 +4,11 @@
  * Sebastian Hammer, Adam Dickmeiss
  *
  * $Log: d1_absyn.c,v $
- * Revision 1.12  1997-09-17 12:10:34  adam
+ * Revision 1.13  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.12  1997/09/17 12:10:34  adam
  * YAZ version 1.4.
  *
  * Revision 1.11  1997/09/05 09:50:55  adam
@@ -317,12 +321,13 @@ data1_absyn *data1_read_absyn (data1_handle dh, const char *file)
                        return 0;
                    }
                    if (r < 2) /* is the structure qualified? */
-                       (*tp)->structure = DATA1S_word;
-                   else if (!data1_matchstr(structure, "w"))
-                       (*tp)->structure = DATA1S_word;
-                   else if (!data1_matchstr(structure, "p"))
-                       (*tp)->structure = DATA1S_phrase;
-
+                       (*tp)->structure = "w";
+                   else 
+                   {
+                       (*tp)->structure = nmem_malloc (data1_nmem_get (dh),
+                                                       strlen(structure)+1);
+                       strcpy ((*tp)->structure, structure);
+                   }
                    tp = &(*tp)->next;
                }
                while ((p = strchr(p, ',')) && *(++p));
@@ -373,12 +378,13 @@ data1_absyn *data1_read_absyn (data1_handle dh, const char *file)
                    return 0;
                }
                if (r < 2) /* is the structure qualified? */
-                   (*tp)->structure = DATA1S_word;
-               else if (!data1_matchstr(structure, "w"))
-                   (*tp)->structure = DATA1S_word;
-               else if (!data1_matchstr(structure, "p"))
-                   (*tp)->structure = DATA1S_phrase;
-               
+                   (*tp)->structure = "w";
+               else 
+               {
+                   (*tp)->structure = nmem_malloc (data1_nmem_get (dh),
+                                                   strlen(structure)+1);
+                   strcpy ((*tp)->structure, structure);
+               }
                (*tp)->next = 0;
                tp = &(*tp)->next;
            }
index e0f0811..c9b18f0 100644 (file)
@@ -69,10 +69,10 @@ elm (4,97)                  subjectTermsUncontrolled    uncontrolled-term
 elm (4,97)/(4,22)           uncontrolledTerm           uncontrolled-term
 elm (4,71)                  spatialDomain              !
 elm (4,71)/(4,91)           boundingCoordinates                !
-elm (4,71)/(4,91)/(4,9)     westBoundingCoordinate      !
-elm (4,71)/(4,91)/(4,10)    eastBoundingCoordinate     !
-elm (4,71)/(4,91)/(4,11)    northBoundingCoordinate    !
-elm (4,71)/(4,91)/(4,12)    southBoundingCoordinate    !
+elm (4,71)/(4,91)/(4,9)     westBoundingCoordinate      !:n
+elm (4,71)/(4,91)/(4,10)    eastBoundingCoordinate     !:n
+elm (4,71)/(4,91)/(4,11)    northBoundingCoordinate    !:n
+elm (4,71)/(4,91)/(4,12)    southBoundingCoordinate    !:n
 elm (4,71)/(4,92)           place                      !
 elm (4,71)/(4,92)/(4,14)    placeKeywordThesaurus      -
 elm (4,71)/(4,92)/(4,13)    placeKeyword               place
@@ -108,7 +108,7 @@ elm (4,70)/(4,93)/(4,102)/(4,15)  beginningDate        available-time-structured
 elm (4,70)/(4,93)/(4,102)/(4,36)  endingDate           available-time-structured
 elm (4,70)/(4,99)           availableLinkage           !
 elm (4,70)/(4,99)/(4,18)    linkageType                        !
-elm (4,70)/(4,99)/(4,17)    linkage                   available-linkage,linkage
+elm (4,70)/(4,99)/(4,17)    linkage                   available-linkage:u,linkage:u
 elm (4,57)                  sourcesOfData              !
 elm (4,58)                  methodology                        !
 elm (4,53)                  accessConstraints          !
@@ -135,8 +135,8 @@ elm (4,98)                  crossReference          !
 elm (4,98)/(2,1)            crossReferenceTitle                !
 elm (4,98)/(4,35)           crossReferenceRelationship !
 elm (4,98)/(4,100)          crossReferenceLinkage      !
-elm (4,98)/(4,100)/(4,18)    linkageType                       -
-elm (4,98)/(4,100)/(4,17)    linkage                   cross-reference-linkage
+elm (4,98)/(4,100)/(4,18)    linkageType               -
+elm (4,98)/(4,100)/(4,17)    linkage                   cross-reference-linkage:u
 elm (4,31)                  scheduleNumber             !
 elm (4,1)                   controlIdentifier          identifier-standard
 elm (4,23)                  originalControlIdentifier  !
index b379724..e1da9fe 100644 (file)
@@ -17,8 +17,8 @@ elm (1,12)            url                     -
 elm (1,14)             localControlNumber      Local-number
 elm (1,16)             dateOfLastModification  Date/time-last-modified
 elm (4,1)              subject                 Subject-heading
-elm (2,1)              title                   Title
-elm (2,2)              author                  Author
+elm (2,1)              title                   Title:w,Title:p
+elm (2,2)              author                  Author:w,Author:p
 elm (2,3)              publisher               Publisher
 elm (4,2)              otherAgent              -
 elm (2,4)              date                    Date