From fec7f7b97c77fbf1d7073bbd47816b9da02d0adb Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Tue, 5 Dec 2000 12:21:44 +0000 Subject: [PATCH] Added termlist source for data1 system. --- include/Makefile.in | 9 +++++---- include/yaz/data1.h | 6 +++++- retrieval/d1_absyn.c | 19 +++++++++++++------ 3 files changed, 23 insertions(+), 11 deletions(-) diff --git a/include/Makefile.in b/include/Makefile.in index b1c943b..277d702 100644 --- a/include/Makefile.in +++ b/include/Makefile.in @@ -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. +@SET_MAKE@ + 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 \ - if test "$$subdir" = "."; then :; else \ - rev="$$subdir $$rev"; \ - fi; \ + rev="$$subdir $$rev"; \ + test "$$subdir" = "." && dot_seen=yes; \ done; \ - rev="$$rev ."; \ + test "$$dot_seen" = "no" && rev=". $$rev"; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ diff --git a/include/yaz/data1.h b/include/yaz/data1.h index 23dce1f..25d9400 100644 --- a/include/yaz/data1.h +++ b/include/yaz/data1.h @@ -24,7 +24,10 @@ * 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. @@ -377,6 +380,7 @@ typedef struct data1_termlist { data1_att *att; char *structure; + char *source; struct data1_termlist *next; } data1_termlist; diff --git a/retrieval/d1_absyn.c b/retrieval/d1_absyn.c index 9488626..c664825 100644 --- a/retrieval/d1_absyn.c +++ b/retrieval/d1_absyn.c @@ -4,7 +4,10 @@ * 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. @@ -492,6 +495,7 @@ data1_absyn *data1_read_absyn (data1_handle dh, const char *file) do { char attname[512], structure[512]; + char *source; 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; } + 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 - { (*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)); -- 1.7.10.4