Added termlist source for data1 system.
authorAdam Dickmeiss <adam@indexdata.dk>
Tue, 5 Dec 2000 12:21:44 +0000 (12:21 +0000)
committerAdam Dickmeiss <adam@indexdata.dk>
Tue, 5 Dec 2000 12:21:44 +0000 (12:21 +0000)
include/Makefile.in
include/yaz/data1.h
retrieval/d1_absyn.c

index b1c943b..277d702 100644 (file)
@@ -109,6 +109,8 @@ Makefile: $(srcdir)/Makefile.in  $(top_builddir)/config.status $(BUILT_SOURCES)
 #     (which will cause the Makefiles to be regenerated when you run `make');
 # (2) otherwise, pass the desired values on the `make' command line.
 
 #     (which will cause the Makefiles to be regenerated when you run `make');
 # (2) otherwise, pass the desired values on the `make' command line.
 
+@SET_MAKE@
+
 all-recursive install-data-recursive install-exec-recursive \
 installdirs-recursive install-recursive uninstall-recursive  \
 check-recursive installcheck-recursive info-recursive dvi-recursive:
 all-recursive install-data-recursive install-exec-recursive \
 installdirs-recursive install-recursive uninstall-recursive  \
 check-recursive installcheck-recursive info-recursive dvi-recursive:
@@ -135,11 +137,10 @@ maintainer-clean-recursive:
        @set fnord $(MAKEFLAGS); amf=$$2; \
        dot_seen=no; \
        rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \
        @set fnord $(MAKEFLAGS); amf=$$2; \
        dot_seen=no; \
        rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \
-         if test "$$subdir" = "."; then :; else \
-           rev="$$subdir $$rev"; \
-         fi; \
+         rev="$$subdir $$rev"; \
+         test "$$subdir" = "." && dot_seen=yes; \
        done; \
        done; \
-       rev="$$rev ."; \
+       test "$$dot_seen" = "no" && rev=". $$rev"; \
        target=`echo $@ | sed s/-recursive//`; \
        for subdir in $$rev; do \
          echo "Making $$target in $$subdir"; \
        target=`echo $@ | sed s/-recursive//`; \
        for subdir in $$rev; do \
          echo "Making $$target in $$subdir"; \
index 23dce1f..25d9400 100644 (file)
  * OF THIS SOFTWARE.
  *
  * $Log: data1.h,v $
  * OF THIS SOFTWARE.
  *
  * $Log: data1.h,v $
- * Revision 1.5  2000-11-29 14:22:47  adam
+ * Revision 1.6  2000-12-05 12:21:45  adam
+ * Added termlist source for data1 system.
+ *
+ * Revision 1.5  2000/11/29 14:22:47  adam
  * Implemented XML/SGML attributes for data1 so that d1_read reads them
  * and d1_write generates proper attributes for XML/SGML records. Added
  * register locking for threaded version.
  * Implemented XML/SGML attributes for data1 so that d1_read reads them
  * and d1_write generates proper attributes for XML/SGML records. Added
  * register locking for threaded version.
@@ -377,6 +380,7 @@ typedef struct data1_termlist
 {
     data1_att *att;
     char *structure;
 {
     data1_att *att;
     char *structure;
+    char *source;
     struct data1_termlist *next;
 } data1_termlist;
 
     struct data1_termlist *next;
 } data1_termlist;
 
index 9488626..c664825 100644 (file)
@@ -4,7 +4,10 @@
  * Sebastian Hammer, Adam Dickmeiss
  *
  * $Log: d1_absyn.c,v $
  * Sebastian Hammer, Adam Dickmeiss
  *
  * $Log: d1_absyn.c,v $
- * Revision 1.27  1999-12-21 14:16:19  ian
+ * Revision 1.28  2000-12-05 12:21:45  adam
+ * Added termlist source for data1 system.
+ *
+ * Revision 1.27  1999/12/21 14:16:19  ian
  * Changed retrieval module to allow data1 trees with no associated absyn.
  * Also added a simple interface for extracting values from data1 trees using
  * a string based tagpath.
  * Changed retrieval module to allow data1 trees with no associated absyn.
  * Also added a simple interface for extracting values from data1 trees using
  * a string based tagpath.
@@ -492,6 +495,7 @@ data1_absyn *data1_read_absyn (data1_handle dh, const char *file)
                do
                {
                    char attname[512], structure[512];
                do
                {
                    char attname[512], structure[512];
+                   char *source;
                    int r;
                    
                    if (!(r = sscanf(p, "%511[^:,]:%511[^,]", attname,
                    int r;
                    
                    if (!(r = sscanf(p, "%511[^:,]:%511[^,]", attname,
@@ -517,15 +521,18 @@ data1_absyn *data1_read_absyn (data1_handle dh, const char *file)
                        fclose(f);
                        return 0;
                    }
                        fclose(f);
                        return 0;
                    }
+                   if (r == 2 && (source = strchr(structure, ':')))
+                       *source++ = '\0';   /* cut off structure .. */
+                   else
+                       source = "data";    /* ok: default is leaf data */
+                   (*tp)->source = (char *)
+                       nmem_strdup (data1_nmem_get (dh), source);
+
                    if (r < 2) /* is the structure qualified? */
                        (*tp)->structure = "w";
                    else 
                    if (r < 2) /* is the structure qualified? */
                        (*tp)->structure = "w";
                    else 
-                   {
                        (*tp)->structure = (char *)
                        (*tp)->structure = (char *)
-                           nmem_malloc (data1_nmem_get (dh),
-                                        strlen(structure)+1);
-                       strcpy ((*tp)->structure, structure);
-                   }
+                           nmem_strdup (data1_nmem_get (dh), structure);
                    tp = &(*tp)->next;
                }
                while ((p = strchr(p, ',')) && *(++p));
                    tp = &(*tp)->next;
                }
                while ((p = strchr(p, ',')) && *(++p));