From: Adam Dickmeiss Date: Sat, 17 Aug 2002 07:56:59 +0000 (+0000) Subject: Updated version. Data1 compatibility fix for nodetomarc X-Git-Tag: YAZ.1.8.9~3 X-Git-Url: http://sru.miketaylor.org.uk/cgi-bin?a=commitdiff_plain;h=0e8b1116b97d769ea233858fe3c2ced5d1da5d7c;p=yaz-moved-to-github.git Updated version. Data1 compatibility fix for nodetomarc --- diff --git a/CHANGELOG b/CHANGELOG index 6b6246d..fa42f6d 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,7 @@ Possible compatibility problems with earlier versions marked with '*'. +--- 1.8.9 2002/MM/DD + --- 1.8.8 2002/08/02 Added three members in bend_initrequest structure to facilitate diff --git a/configure.in b/configure.in index 720b187..ead21ac 100644 --- a/configure.in +++ b/configure.in @@ -1,8 +1,8 @@ dnl YAZ Toolkit, Index Data 1994-2002 dnl See the file LICENSE for details. -dnl $Id: configure.in,v 1.78 2002-08-02 08:54:04 adam Exp $ +dnl $Id: configure.in,v 1.79 2002-08-17 07:56:59 adam Exp $ AC_INIT(include/yaz/yaz-version.h) -AM_INIT_AUTOMAKE(yaz, 1.8.8) +AM_INIT_AUTOMAKE(yaz, 1.8.9) dnl AC_SUBST(READLINE_LIBS) AC_SUBST(YAZ_CONF_CFLAGS) diff --git a/debian/rules b/debian/rules index 9d78d8f..8614357 100755 --- a/debian/rules +++ b/debian/rules @@ -28,7 +28,7 @@ else SSL_FLAGS= endif -YAZ_VERSION=1.8.8 +YAZ_VERSION=1.8.9 YAZSRCDIR?=$(shell pwd) # If this is not IndexData's release, then it is a cvs-checkout. Go cheat! # YAZ_VERSION:=$(YAZ_VERSION)-$(shell date -r$(YAZSRCDIR)/CVS +"CVS%Y%m%d") diff --git a/include/yaz/data1.h b/include/yaz/data1.h index ad65e15..bc43074 100644 --- a/include/yaz/data1.h +++ b/include/yaz/data1.h @@ -23,7 +23,7 @@ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE * OF THIS SOFTWARE. * - * $Id: data1.h,v 1.15 2002-07-29 20:04:08 adam Exp $ + * $Id: data1.h,v 1.16 2002-08-17 07:56:59 adam Exp $ */ #ifndef DATA1_H @@ -212,6 +212,7 @@ typedef struct data1_absyn data1_sub_elements *sub_elements; data1_element *main_elements; char *encoding; + int enable_xpath_indexing; } data1_absyn; /* @@ -308,7 +309,8 @@ YAZ_EXPORT data1_node *data1_read_nodex (data1_handle dh, NMEM m, YAZ_EXPORT data1_node *data1_read_record(data1_handle dh, int (*rf)(void *, char *, size_t), void *fh, NMEM m); -YAZ_EXPORT data1_absyn *data1_read_absyn(data1_handle dh, const char *file); +YAZ_EXPORT data1_absyn *data1_read_absyn(data1_handle dh, const char *file, + int file_must_exist); YAZ_EXPORT data1_tag *data1_gettagbynum(data1_handle dh, data1_tagset *s, int type, int value); diff --git a/include/yaz/yaz-version.h b/include/yaz/yaz-version.h index 9031526..99c0769 100644 --- a/include/yaz/yaz-version.h +++ b/include/yaz/yaz-version.h @@ -1,12 +1,12 @@ /* * Current software version. * - * $Id: yaz-version.h,v 1.17 2002-08-02 08:54:04 adam Exp $ + * $Id: yaz-version.h,v 1.18 2002-08-17 07:56:59 adam Exp $ */ #ifndef YAZ_VERSION -#define YAZ_VERSION "1.8.8" -#define YAZ_VERSIONL 0x010808 +#define YAZ_VERSION "1.8.9" +#define YAZ_VERSIONL 0x010809 #define YAZ_DATE 1 diff --git a/retrieval/d1_absyn.c b/retrieval/d1_absyn.c index 9e4d41b..4dda340 100644 --- a/retrieval/d1_absyn.c +++ b/retrieval/d1_absyn.c @@ -1,125 +1,9 @@ /* - * Copyright (c) 1995-2000, Index Data. + * Copyright (c) 1995-2002, Index Data. * See the file LICENSE for details. * Sebastian Hammer, Adam Dickmeiss * - * $Log: d1_absyn.c,v $ - * Revision 1.32 2002-07-25 12:52:53 adam - * Character set negotiation updates - * - * Revision 1.31 2002/04/04 20:49:46 adam - * New functions yaz_is_abspath, yaz_path_fopen_base - * - * Revision 1.30 2000/12/05 19:07:24 adam - * Fixed problem with element level in reading of abstract syntax. - * - * Revision 1.29 2000/12/05 14:34:49 adam - * Fixed bug with termlists (introduced by previous commit). - * - * 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. - * - * Revision 1.26 1999/11/30 13:47:12 adam - * Improved installation. Moved header files to include/yaz. - * - * Revision 1.25 1999/10/21 12:06:29 adam - * Retrieval module no longer uses ctype.h - functions. - * - * Revision 1.24 1999/08/27 09:40:32 adam - * Renamed logf function to yaz_log. Removed VC++ project files. - * - * Revision 1.23 1998/10/15 08:29:16 adam - * Tag set type may be specified in reference to it using "tagset" - * directive in .abs-files and "include" directive in .tag-files. - * - * Revision 1.22 1998/10/13 16:09:47 adam - * Added support for arbitrary OID's for tagsets, schemas and attribute sets. - * Added support for multiple attribute set references and tagset references - * from an abstract syntax file. - * Fixed many bad logs-calls in routines that read the various - * specifications regarding data1 (*.abs,*.att,...) and made the messages - * consistent whenever possible. - * Added extra 'lineno' argument to function readconf_line. - * - * Revision 1.21 1998/06/09 13:55:07 adam - * Minor changes. - * - * Revision 1.20 1998/05/18 13:07:02 adam - * Changed the way attribute sets are handled by the retriaval module. - * Extended Explain conversion / schema. - * Modified server and client to work with ASN.1 compiled protocol handlers. - * - * Revision 1.19 1998/03/05 08:15:32 adam - * Implemented data1_add_insert_taggeddata utility which is more flexible - * than data1_insert_taggeddata. - * - * Revision 1.18 1998/02/27 14:08:04 adam - * Added const to some char pointer arguments. - * Reworked data1_read_node so that it doesn't create a tree with - * pointers to original "SGML"-buffer. - * - * Revision 1.17 1998/02/11 11:53:34 adam - * Changed code so that it compiles as C++. - * - * Revision 1.16 1997/12/18 10:51:30 adam - * Implemented sub-trees feature for schemas - including forward - * references. - * - * Revision 1.15 1997/12/09 16:18:16 adam - * Work on EXPLAIN schema. First implementation of sub-schema facility - * in the *.abs files. - * - * Revision 1.14 1997/10/31 12:20:09 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.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 - * Removed global data1_tabpath - uses data1_get_tabpath() instead. - * - * Revision 1.10 1997/05/14 06:54:01 adam - * C++ support. - * - * Revision 1.9 1997/02/19 14:46:15 adam - * The "all" specifier only affects elements that are indexed (and not - * all elements). - * - * Revision 1.8 1997/01/02 10:47:59 quinn - * Added optional, physical ANY - * - * Revision 1.7 1996/06/10 08:56:01 quinn - * Work on Summary. - * - * Revision 1.6 1996/05/31 13:52:21 quinn - * Fixed uninitialized variable for local tags in abstract syntax. - * - * Revision 1.5 1996/05/09 07:27:43 quinn - * Multiple local attributes values supported. - * - * Revision 1.4 1996/05/01 12:45:28 quinn - * Support use of local tag names in abs file. - * - * Revision 1.3 1995/11/01 16:34:55 quinn - * Making data1 look for tables in data1_tabpath - * - * Revision 1.2 1995/11/01 13:54:44 quinn - * Minor adjustments - * - * Revision 1.1 1995/11/01 11:56:06 quinn - * Added Retrieval (data management) functions en masse. - * + * $Id: d1_absyn.c,v 1.33 2002-08-17 07:56:59 adam Exp $ */ #include @@ -181,7 +65,7 @@ data1_absyn *data1_absyn_add (data1_handle dh, const char *name) data1_absyn_cache *pp = data1_absyn_cache_get (dh); sprintf(fname, "%s.abs", name); - p->absyn = data1_read_absyn (dh, fname); + p->absyn = data1_read_absyn (dh, fname, 0); p->name = nmem_strdup (mem, name); p->next = *pp; *pp = p; @@ -289,7 +173,7 @@ data1_element *data1_getelementbytagname (data1_handle dh, data1_absyn *abs, r = abs->main_elements; else r = parent->children; - assert (abs->main_elements); + for (; r; r = r->next) { data1_name *n; @@ -309,8 +193,6 @@ data1_element *data1_getelementbyname (data1_handle dh, data1_absyn *absyn, /* It's now possible to have a data1 tree with no abstract syntax */ if ( !absyn ) return 0; - - assert (absyn->main_elements); for (r = absyn->main_elements; r; r = r->next) if (!data1_matchstr(r->name, name)) return r; @@ -364,10 +246,6 @@ static int parse_termlists (data1_handle dh, data1_termlist ***tpp, "%s:%d: Syntax error in termlistspec '%s'", file, lineno, p); return -1; -/* - fclose(f); - return 0; -*/ } if (*attname == '!') strcpy(attname, element_name); @@ -381,10 +259,6 @@ static int parse_termlists (data1_handle dh, data1_termlist ***tpp, "%s:%d: Couldn't find att '%s' in attset", file, lineno, attname); return -1; -/* - fclose(f); - return 0; -*/ } if (r == 2 && (source = strchr(structure, ':'))) *source++ = '\0'; /* cut off structure .. */ @@ -405,7 +279,8 @@ static int parse_termlists (data1_handle dh, data1_termlist ***tpp, return 0; } -data1_absyn *data1_read_absyn (data1_handle dh, const char *file) +data1_absyn *data1_read_absyn (data1_handle dh, const char *file, + int file_must_exist) { data1_sub_elements *cur_elements = NULL; data1_absyn *res = 0; @@ -425,7 +300,8 @@ data1_absyn *data1_read_absyn (data1_handle dh, const char *file) if (!(f = data1_path_fopen(dh, file, "r"))) { yaz_log(LOG_WARN|LOG_ERRNO, "Couldn't open %s", file); - return 0; + if (file_must_exist) + return 0; } res = (data1_absyn *) nmem_malloc(data1_nmem_get(dh), sizeof(*res)); @@ -433,6 +309,7 @@ data1_absyn *data1_read_absyn (data1_handle dh, const char *file) res->reference = VAL_NONE; res->tagset = 0; res->encoding = 0; + res->enable_xpath_indexing = (f ? 0 : 1); tagset_childp = &res->tagset; res->attset = data1_empty_attset (dh); @@ -448,8 +325,8 @@ data1_absyn *data1_read_absyn (data1_handle dh, const char *file) res->sub_elements = NULL; res->main_elements = NULL; - - while ((argc = readconf_line(f, &lineno, line, 512, argv, 50))) + + while (f && (argc = readconf_line(f, &lineno, line, 512, argv, 50))) { char *cmd = *argv; if (!strcmp(cmd, "elm")) @@ -595,6 +472,24 @@ data1_absyn *data1_read_absyn (data1_handle dh, const char *file) level = 0; ppl[level] = &cur_elements->elements; } + else if (!strcmp(cmd, "xpath")) + { + if (argc != 2) + { + yaz_log(LOG_WARN, "%s:%d: Bad # of args to 'xpath' directive", + file, lineno); + continue; + } + if (!strcmp(argv[1], "enable")) + res->enable_xpath_indexing = 1; + else if (!strcmp (argv[1], "disable")) + res->enable_xpath_indexing = 0; + else + { + yaz_log(LOG_WARN, "%s:%d: Expecting disable/enable " + "after 'xpath' directive", file, lineno); + } + } else if (!strcmp(cmd, "all")) { data1_termlist **tp = &all; @@ -785,11 +680,13 @@ data1_absyn *data1_read_absyn (data1_handle dh, const char *file) } else { - yaz_log(LOG_WARN, "%s:%d: Unknown directive '%s'", file, lineno, cmd); + yaz_log(LOG_WARN, "%s:%d: Unknown directive '%s'", file, + lineno, cmd); continue; } } - fclose(f); + if (f) + fclose(f); for (cur_elements = res->sub_elements; cur_elements; cur_elements = cur_elements->next) diff --git a/retrieval/d1_marc.c b/retrieval/d1_marc.c index bb054ac..e649b58 100644 --- a/retrieval/d1_marc.c +++ b/retrieval/d1_marc.c @@ -3,7 +3,7 @@ * See the file LICENSE for details. * Sebastian Hammer, Adam Dickmeiss * - * $Id: d1_marc.c,v 1.21 2002-07-25 12:52:53 adam Exp $ + * $Id: d1_marc.c,v 1.22 2002-08-17 07:56:59 adam Exp $ */ @@ -204,8 +204,9 @@ static int is_indicator (data1_marctab *p, data1_node *subf) return 0; } -static int nodetomarc(data1_marctab *p, data1_node *n, int selected, - char **buf, int *size) +static int nodetomarc(data1_handle dh, + data1_marctab *p, data1_node *n, int selected, + char **buf, int *size) { int len = 26; int dlen; @@ -235,6 +236,12 @@ static int nodetomarc(data1_marctab *p, data1_node *n, int selected, if (subf->which == DATA1N_data) is00X = 1; + if (!data1_is_xmlmode(dh)) + { + if (subf->which == DATA1N_tag && !strcmp(subf->u.tag.tag, "@")) + is00X = 1; + } + if (!is00X) len += p->indicator_length; @@ -285,6 +292,11 @@ static int nodetomarc(data1_marctab *p, data1_node *n, int selected, if (subf->which == DATA1N_data) is00X = 1; + if (!data1_is_xmlmode(dh)) + { + if (subf->which == DATA1N_tag && !strcmp(subf->u.tag.tag, "@")) + is00X = 1; + } if (is_indicator (p, subf)) { @@ -341,6 +353,6 @@ char *data1_nodetomarc(data1_handle dh, data1_marctab *p, data1_node *n, n = data1_get_root_tag (dh, n); if (!n) return 0; - *len = nodetomarc(p, n, selected, buf, size); + *len = nodetomarc(dh, p, n, selected, buf, size); return *buf; } diff --git a/server/statserv.c b/server/statserv.c index 7a02be7..03713d4 100644 --- a/server/statserv.c +++ b/server/statserv.c @@ -6,7 +6,7 @@ * NT threaded server code by * Chas Woodfield, Fretwell Downing Informatics. * - * $Id: statserv.c,v 1.82 2002-05-17 12:48:29 adam Exp $ + * $Id: statserv.c,v 1.83 2002-08-17 07:56:59 adam Exp $ */ #include @@ -831,7 +831,7 @@ int check_options(int argc, char **argv) fprintf(stderr, "Usage: %s [ -a -v " " -l -u -c -t " " -k -d " - " -ziST -w ... ]\n", me); + " -ziST1 -w ... ]\n", me); return 1; } } diff --git a/win/yaz.nsi b/win/yaz.nsi index 3e37755..2b357f0 100644 --- a/win/yaz.nsi +++ b/win/yaz.nsi @@ -1,6 +1,6 @@ -; $Id: yaz.nsi,v 1.9 2002-07-25 12:52:54 adam Exp $ +; $Id: yaz.nsi,v 1.10 2002-08-17 07:56:59 adam Exp $ -!define VERSION "1.8.8" +!define VERSION "1.8.9" Name "YAZ" Caption "Index Data YAZ ${VERSION} Setup" diff --git a/win/yaz.rc b/win/yaz.rc index 306d72c..0ae1ccb 100644 --- a/win/yaz.rc +++ b/win/yaz.rc @@ -54,8 +54,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,8,8,2 - PRODUCTVERSION 1,8,8,2 + FILEVERSION 1,8,9,1 + PRODUCTVERSION 1,8,9,1 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -73,14 +73,14 @@ BEGIN VALUE "Comments", "Z39.50 C Library\0" VALUE "CompanyName", "Index Data\0" VALUE "FileDescription", "YAZ Toolkit\0" - VALUE "FileVersion", "1, 8, 8, 2\0" + VALUE "FileVersion", "1, 8, 9, 1\0" VALUE "InternalName", "YAZ\0" VALUE "LegalCopyright", "Copyright © 1995-2002 Index Data\0" VALUE "LegalTrademarks", "\0" VALUE "OriginalFilename", "yaz.rc\0" VALUE "PrivateBuild", "\0" VALUE "ProductName", "Index Data YAZ Toolkit\0" - VALUE "ProductVersion", "1, 8, 8, 2\0" + VALUE "ProductVersion", "1, 8, 9, 1\0" VALUE "SpecialBuild", "\0" END END