From fd4adcc80d442f84c6a1894e890b1b6ccd02615e Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Tue, 13 Nov 2001 23:00:42 +0000 Subject: [PATCH] Separate malloc debug library. Removal of ASN_COMPILED-#ifdefs. --- client/admin.c | 37 +------------ client/client.c | 37 +------------ configure.in | 9 ++- debian/rules | 1 + doc/credits.xml | 5 +- doc/yaz.xml | 4 +- doc/zoom.xml | 4 +- include/yaz/prt-ext.h | 3 +- lib/Makefile.am | 11 +++- server/service.c | 7 ++- server/seshigh.c | 29 +--------- server/statserv.c | 4 +- util/nmem.c | 12 +++- util/xmalloc.c | 6 +- yaz-config.in | 25 ++++++--- yaz.spec | 4 ++ z39.50/prt-ext.c | 130 ++++--------------------------------------- ztest/ztest.c | 148 +------------------------------------------------ zutil/logrpn.c | 64 +-------------------- zutil/pquery.c | 116 +------------------------------------- zutil/query.c | 29 +--------- zutil/sortspec.c | 6 +- zutil/yaz-ccl.c | 80 +------------------------- 23 files changed, 93 insertions(+), 678 deletions(-) diff --git a/client/admin.c b/client/admin.c index 46cf777..e20825c 100644 --- a/client/admin.c +++ b/client/admin.c @@ -1,37 +1,8 @@ /* - * $Log: admin.c,v $ - * Revision 1.10 2001-07-19 19:51:41 adam - * Added typecasts to make C++ happy. - * - * Revision 1.9 2001/02/21 13:46:53 adam - * C++ fixes. - * - * Revision 1.8 2000/04/17 14:21:38 adam - * WIN32 update. - * - * Revision 1.7 2000/04/05 07:39:54 adam - * Added shared library support (libtool). - * - * Revision 1.6 2000/03/20 19:06:25 adam - * Added Segment request for fronend server. Work on admin for client. - * - * Revision 1.5 2000/03/17 12:47:02 adam - * Minor changes to admin client. - * - * Revision 1.4 2000/03/16 13:55:49 ian - * Added commands for sending shutdown and startup admin requests via the admin ES. - * - * Revision 1.3 2000/03/14 15:23:17 ian - * Removed unwanted ifdef and include of zes-admin.h - * - * Revision 1.2 2000/03/14 14:06:04 ian - * Minor change to order of debugging output for send_apdu, - * fixed encoding of admin request. - * - * Revision 1.1 2000/03/14 09:27:07 ian - * Added code to enable sending of admin extended service requests - * + * Copyright (c) 1995-2001, Index Data + * See the file LICENSE for details. * + * $Id: admin.c,v 1.11 2001-11-13 23:00:42 adam Exp $ */ #include @@ -60,7 +31,6 @@ #include -#ifdef ASN_COMPILED /* Helper functions to get to various statics in the client */ ODR getODROutputStream(); @@ -390,4 +360,3 @@ int cmd_adm_startup(char* arg) sendAdminES(Z_ESAdminOriginPartToKeep_start, NULL); return 2; } -#endif diff --git a/client/client.c b/client/client.c index 315b5b8..e866047 100644 --- a/client/client.c +++ b/client/client.c @@ -2,8 +2,7 @@ * Copyright (c) 1995-2001, Index Data * See the file LICENSE for details. * - * $Id: client.c,v 1.129 2001-10-29 09:17:19 adam Exp $ - * + * $Id: client.c,v 1.130 2001-11-13 23:00:42 adam Exp $ */ #include @@ -563,7 +562,6 @@ static void display_diagrecs(Z_DiagRec **pp, int num) ent->oclass != CLASS_DIAGSET || ent->value != VAL_BIB1) printf("Missing or unknown diagset\n"); printf(" [%d] %s", *r->condition, diagbib1_str(*r->condition)); -#ifdef ASN_COMPILED switch (r->which) { case Z_DefaultDiagFormat_v2Addinfo: @@ -573,12 +571,6 @@ static void display_diagrecs(Z_DiagRec **pp, int num) printf (" -- v3 addinfo '%s'\n", r->u.v3Addinfo); break; } -#else - if (r->addinfo && *r->addinfo) - printf(" -- '%s'\n", r->addinfo); - else - printf("\n"); -#endif } } @@ -599,14 +591,10 @@ static void display_records(Z_Records *p) if (p->which == Z_Records_NSD) { -#ifdef ASN_COMPILED Z_DiagRec dr, *dr_p = &dr; dr.which = Z_DiagRec_defaultFormat; dr.u.defaultFormat = p->u.nonSurrogateDiagnostic; display_diagrecs (&dr_p, 1); -#else - display_diagrecs (&p->u.nonSurrogateDiagnostic, 1); -#endif } else if (p->which == Z_Records_multipleNSD) display_diagrecs (p->u.multipleNonSurDiagnostics->diagRecs, @@ -1104,11 +1092,7 @@ static Z_External *create_ItemOrderExternal(const char *type, int itemno) r->u.itemOrder = (Z_ItemOrder *) odr_malloc(out,sizeof(Z_ItemOrder)); memset(r->u.itemOrder, 0, sizeof(Z_ItemOrder)); -#ifdef ASN_COMPILED r->u.itemOrder->which=Z_IOItemOrder_esRequest; -#else - r->u.itemOrder->which=Z_ItemOrder_esRequest; -#endif r->u.itemOrder->u.esRequest = (Z_IORequest *) odr_malloc(out,sizeof(Z_IORequest)); @@ -1488,6 +1472,7 @@ static int cmd_show(char *arg) int cmd_quit(char *arg) { printf("See you later, alligator.\n"); + xmalloc_trav (""); exit(0); return 0; } @@ -1593,20 +1578,10 @@ int send_sortrequest(char *arg, int newset) req->referenceId = set_refid (out); -#ifdef ASN_COMPILED req->num_inputResultSetNames = 1; req->inputResultSetNames = (Z_InternationalString **) odr_malloc (out, sizeof(*req->inputResultSetNames)); req->inputResultSetNames[0] = odr_strdup (out, setstring); -#else - req->inputResultSetNames = - (Z_StringList *)odr_malloc (out, sizeof(*req->inputResultSetNames)); - req->inputResultSetNames->num_strings = 1; - req->inputResultSetNames->strings = - (char **)odr_malloc (out, sizeof(*req->inputResultSetNames->strings)); - req->inputResultSetNames->strings[0] = - odr_strdup (out, setstring); -#endif if (newset && setnumber >= 0) sprintf (setstring, "%d", ++setnumber); @@ -1689,15 +1664,9 @@ void process_sortResponse(Z_SortResponse *res) } printf ("\n"); print_refid (res->referenceId); -#ifdef ASN_COMPILED if (res->diagnostics) display_diagrecs(res->diagnostics, res->num_diagnostics); -#else - if (res->diagnostics) - display_diagrecs(res->diagnostics->diagRecs, - res->diagnostics->num_diagRecs); -#endif } void process_deleteResultSetResponse (Z_DeleteResultSetResponse *res) @@ -1974,7 +1943,6 @@ static int client(int wait) {"update", cmd_update, ""}, {"packagename", cmd_packagename, ""}, {"proxy", cmd_proxy, "('tcp'|'osi')':'['/'][':']"}, -#ifdef ASN_COMPILED /* Server Admin Functions */ {"adm-reindex", cmd_adm_reindex, ""}, {"adm-truncate", cmd_adm_truncate, "('database'|'index')"}, @@ -1985,7 +1953,6 @@ static int client(int wait) {"adm-commit", cmd_adm_commit, ""}, {"adm-shutdown", cmd_adm_shutdown, ""}, {"adm-startup", cmd_adm_startup, ""}, -#endif {0,0} }; char *netbuffer= 0; diff --git a/configure.in b/configure.in index e35f0f1..1885daf 100644 --- a/configure.in +++ b/configure.in @@ -1,6 +1,6 @@ dnl YAZ Toolkit, Index Data 1994-2001 dnl See the file LICENSE for details. -dnl $Id: configure.in,v 1.53 2001-11-12 11:27:21 adam Exp $ +dnl $Id: configure.in,v 1.54 2001-11-13 23:00:42 adam Exp $ AC_INIT(include/yaz/yaz-version.h) AM_INIT_AUTOMAKE(yaz, 1.8.2) dnl @@ -67,8 +67,11 @@ AC_CHECK_LIB(history, add_history, [READLINE_LIBS="$READLINE_LIBS -lhistory"]) if test "$ac_cv_lib_readline_readline" = "yes"; then AC_CHECK_HEADERS(readline/readline.h readline/history.h) fi -dnl ------ snprintf -AC_CHECK_FUNCS(vsnprintf gettimeofday) +dnl ------ various functions +AC_CHECK_FUNCS(vsnprintf gettimeofday poll) +if test "$ac_cv_func_poll" = "yes"; then + AC_CHECK_HEADERS(sys/poll.h) +fi dnl dnl ------ tcpd AC_ARG_ENABLE(tcpd,[ --enable-tcpd[=PREFIX] enable TCP wrapper for server if available]) diff --git a/debian/rules b/debian/rules index 6b1b457..d4ee863 100755 --- a/debian/rules +++ b/debian/rules @@ -120,6 +120,7 @@ ifeq ($(BUILD_SSL),1) dh_shlibdeps -p $(DEVEL_NAME) -- debian/$(DEVEL_NAME)/usr/bin/* echo "libyaz 1 $(RUNTIME_NAME)" > debian/$(RUNTIME_NAME)/DEBIAN/shlibs echo "libyazthread 1 $(RUNTIME_NAME)" >> debian/$(RUNTIME_NAME)/DEBIAN/shlibs + echo "libyazmalloc 1 $(RUNTIME_NAME)" >> debian/$(RUNTIME_NAME)/DEBIAN/shlibs chmod 644 debian/$(RUNTIME_NAME)/DEBIAN/shlibs # dh_shlibdeps -a -- debian/yaz-runtime-ssl/usr/lib/*.so debian/yaz-runtime-ssl/usr/bin/* diff --git a/doc/credits.xml b/doc/credits.xml index d0b7fe6..a85baa5 100644 --- a/doc/credits.xml +++ b/doc/credits.xml @@ -1,4 +1,4 @@ - + Credits This appendix lists individuals that have contributed in the development @@ -21,6 +21,9 @@ Matthew Carey + Irina Dijour + + Hans van den Dool diff --git a/doc/yaz.xml b/doc/yaz.xml index e7ca157..bbc32d5 100644 --- a/doc/yaz.xml +++ b/doc/yaz.xml @@ -22,7 +22,7 @@ COMSTACK"> ZOOM"> ]> - + YAZ User's Guide and Reference @@ -40,7 +40,7 @@ This document is the programmer's guide and reference to the &yaz; - package version 1.8.2. &yaz; is a compact toolkit that provides + package version 1.8.3. &yaz; is a compact toolkit that provides access to the Z39.50 protocol, as well as a set of higher-level tools for implementing the server and client roles, respectively. The documentation can be used on its own, or as a reference when diff --git a/doc/zoom.xml b/doc/zoom.xml index 2937474..5049709 100644 --- a/doc/zoom.xml +++ b/doc/zoom.xml @@ -1,4 +1,4 @@ - + Building clients with ZOOM @@ -94,7 +94,7 @@ Otherwise, if val is NULL, the option is unchanged. - The function returns the previous value of the option. + The function returns the (new) value of the option. ZOOM Connection Options diff --git a/include/yaz/prt-ext.h b/include/yaz/prt-ext.h index 5d78106..dd55770 100644 --- a/include/yaz/prt-ext.h +++ b/include/yaz/prt-ext.h @@ -98,14 +98,13 @@ struct Z_External Z_DiagnosticFormat *diag1; Z_Espec1 *espec1; Z_BriefBib *summary; + Z_OPACRecord *opac; Z_SearchInfoReport *searchResult1; Z_IUUpdate *update; Z_DateTime *dateTime; Z_UniverseReport *universeReport; -#ifdef ASN_COMPILED Z_Admin *adminService; Z_IU0Update *update0; -#endif } u; }; diff --git a/lib/Makefile.am b/lib/Makefile.am index 740b32a..868f832 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -1,10 +1,10 @@ -## $Id: Makefile.am,v 1.15 2001-10-23 21:00:19 adam Exp $ +## $Id: Makefile.am,v 1.16 2001-11-13 23:00:42 adam Exp $ if ISTHR extra=libyazthread.la endif -lib_LTLIBRARIES = libyaz.la $(extra) +lib_LTLIBRARIES = libyaz.la $(extra) libyazmalloc.la # If the line below is omitted the LINK variable is # not set in Makefile.in and it will NOT work .. @@ -15,6 +15,8 @@ libyaz_la_SOURCES= libyazthread_la_SOURCES=nmem.c statserv.c eventl.c +libyazmalloc_la_SOURCES=xmalloc.c + $(srcdir)/nmem.c: $(top_srcdir)/util/nmem.c cp $(top_srcdir)/util/nmem.c $(srcdir) @@ -24,9 +26,12 @@ $(srcdir)/statserv.c: $(top_srcdir)/server/statserv.c $(srcdir)/eventl.c: $(top_srcdir)/server/eventl.c cp $(top_srcdir)/server/eventl.c $(srcdir) +$(srcdir)/xmalloc.c: $(top_srcdir)/util/xmalloc.c + cp $(top_srcdir)/util/xmalloc.c $(srcdir) + LDFLAGS=-version-info 1:0:0 -INCLUDES =-I$(top_srcdir)/include -I$(top_srcdir)/server @CFLAGSTHREADS@ +CFLAGS =-DTRACE_XMALLOC=2 -I$(top_srcdir)/include -I$(top_srcdir)/server @CFLAGSTHREADS@ bin_SCRIPTS = yaz-config diff --git a/server/service.c b/server/service.c index 22ec699..9108beb 100644 --- a/server/service.c +++ b/server/service.c @@ -1,9 +1,12 @@ /* * NT Service interface Utility. * Based on code written by - * Chas Woodfield, Fretwell Downing Datasystems. + * Chas Woodfield, Fretwell Downing Informatics. * $Log: service.c,v $ - * Revision 1.4 2000-12-05 19:05:10 adam + * Revision 1.5 2001-11-13 23:00:42 adam + * Separate malloc debug library. Removal of ASN_COMPILED-#ifdefs. + * + * Revision 1.4 2000/12/05 19:05:10 adam * Service automatically starts in the directory from which it was installed. * * Revision 1.3 1999/06/10 11:45:30 adam diff --git a/server/seshigh.c b/server/seshigh.c index 4cb1d35..016f268 100644 --- a/server/seshigh.c +++ b/server/seshigh.c @@ -2,7 +2,7 @@ * Copyright (c) 1995-2001, Index Data * See the file LICENSE for details. * - * $Id: seshigh.c,v 1.120 2001-10-05 14:43:22 adam Exp $ + * $Id: seshigh.c,v 1.121 2001-11-13 23:00:42 adam Exp $ */ /* @@ -741,13 +741,8 @@ static Z_APDU *process_initRequest(association *assoc, request *reqb) static void set_addinfo (Z_DefaultDiagFormat *dr, char *addinfo, ODR odr) { -#if ASN_COMPILED dr->which = Z_DefaultDiagFormat_v2Addinfo; dr->u.v2Addinfo = odr_strdup (odr, addinfo ? addinfo : ""); -#else - dr->which = Z_DiagForm_v2AddInfo; - dr->addinfo = odr_strdup (odr, addinfo ? addinfo : ""); -#endif } /* @@ -766,13 +761,7 @@ static Z_Records *diagrec(association *assoc, int error, char *addinfo) yaz_log(LOG_DEBUG, "Diagnostic: %d -- %s", error, addinfo ? addinfo : "NULL"); rec->which = Z_Records_NSD; -#if ASN_COMPILED rec->u.nonSurrogateDiagnostic = dr; -#else - rec->u.nonSurrogateDiagnostic = drec; - drec->which = Z_DiagRec_defaultFormat; - drec->u.defaultFormat = dr; -#endif dr->diagnosticSetId = yaz_oidval_to_z3950oid (assoc->encode, CLASS_DIAGSET, VAL_BIB1); dr->condition = err; @@ -831,13 +820,8 @@ static Z_DiagRecs *diagrecs(association *assoc, int error, char *addinfo) yaz_oidval_to_z3950oid (assoc->encode, CLASS_DIAGSET, VAL_BIB1); rec->condition = err; -#ifdef ASN_COMPILED rec->which = Z_DefaultDiagFormat_v2Addinfo; rec->u.v2Addinfo = odr_strdup (assoc->encode, addinfo ? addinfo : ""); -#else - rec->which = Z_DiagForm_v2AddInfo; - rec->addinfo = odr_strdup (assoc->encode, addinfo ? addinfo : ""); -#endif return recs; } @@ -1390,13 +1374,8 @@ static Z_APDU *process_sortRequest(association *assoc, request *reqb, yaz_log(LOG_LOG, "Got SortRequest."); -#ifdef ASN_COMPILED bsrr->num_input_setnames = req->num_inputResultSetNames; bsrr->input_setnames = req->inputResultSetNames; -#else - bsrr->num_input_setnames = req->inputResultSetNames->num_strings; - bsrr->input_setnames = req->inputResultSetNames->strings; -#endif bsrr->referenceId = req->referenceId; bsrr->output_setname = req->sortedResultSetName; bsrr->sort_sequence = req->sortSequence; @@ -1415,18 +1394,12 @@ static Z_APDU *process_sortRequest(association *assoc, request *reqb, if (bsrr->errcode) { Z_DiagRecs *dr = diagrecs (assoc, bsrr->errcode, bsrr->errstring); -#ifdef ASN_COMPILED res->diagnostics = dr->diagRecs; res->num_diagnostics = dr->num_diagRecs; -#else - res->diagnostics = dr; -#endif } else { -#ifdef ASN_COMPILED res->num_diagnostics = 0; -#endif res->diagnostics = 0; } res->otherInfo = 0; diff --git a/server/statserv.c b/server/statserv.c index cecc6b1..59f058b 100644 --- a/server/statserv.c +++ b/server/statserv.c @@ -3,10 +3,10 @@ * See the file LICENSE for details. * Sebastian Hammer, Adam Dickmeiss * - * NT server based on threads by + * NT threaded server code by * Chas Woodfield, Fretwell Downing Informatics. * - * $Id: statserv.c,v 1.78 2001-10-24 12:24:43 adam Exp $ + * $Id: statserv.c,v 1.79 2001-11-13 23:00:43 adam Exp $ */ #include diff --git a/util/nmem.c b/util/nmem.c index 358d7a6..70c9014 100644 --- a/util/nmem.c +++ b/util/nmem.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: nmem.c,v $ - * Revision 1.31 2001-10-24 12:24:43 adam + * Revision 1.32 2001-11-13 23:00:43 adam + * Separate malloc debug library. Removal of ASN_COMPILED-#ifdefs. + * + * Revision 1.31 2001/10/24 12:24:43 adam * WIN32 updates: ZOOM runs, nmem_init/nmem_exit called in DllMain. * * Revision 1.30 2001/10/05 13:55:17 adam @@ -222,7 +225,11 @@ YAZ_EXPORT void nmem_mutex_destroy(NMEM_MUTEX *p) static nmem_block *freelist = NULL; /* "global" freelists */ static nmem_control *cfreelist = NULL; static int nmem_active_no = 0; +#ifdef WIN32 static int nmem_init_flag = 0; +#else +static int nmem_init_flag = 1; +#endif #if NMEM_DEBUG struct nmem_debug_info { @@ -492,6 +499,7 @@ void nmem_exit (void) { if (--nmem_init_flag == 0) { + yaz_log (LOG_LOG, "nmem_exit ............."); oid_exit(); while (freelist) { @@ -528,4 +536,4 @@ BOOL WINAPI DllMain (HINSTANCE hinstDLL, } return TRUE; } -#endif \ No newline at end of file +#endif diff --git a/util/xmalloc.c b/util/xmalloc.c index 1b33b63..4900a50 100644 --- a/util/xmalloc.c +++ b/util/xmalloc.c @@ -3,7 +3,7 @@ * All rights reserved. * Sebastian Hammer, Adam Dickmeiss * - * $Id: xmalloc.c,v 1.14 2001-11-06 17:05:19 adam Exp $ + * $Id: xmalloc.c,v 1.15 2001-11-13 23:00:43 adam Exp $ */ #if HAVE_CONFIG_H @@ -17,7 +17,9 @@ #include #include -#define TRACE_XMALLOC 2 +#ifndef TRACE_XMALLOC +#define TRACE_XMALLOC 1 +#endif #if TRACE_XMALLOC > 1 diff --git a/yaz-config.in b/yaz-config.in index 6f2cd24..f0ec873 100644 --- a/yaz-config.in +++ b/yaz-config.in @@ -1,5 +1,5 @@ #!/bin/sh -# $Id: yaz-config.in,v 1.10 2001-10-15 20:37:08 adam Exp $ +# $Id: yaz-config.in,v 1.11 2001-11-13 23:00:42 adam Exp $ yazprefix=@prefix@ yaz_echo_cflags=no yaz_echo_libs=no @@ -28,6 +28,7 @@ Options: [--comp] Libraries: threads + malloc EOF exit $1 } @@ -72,6 +73,9 @@ while test $# -gt 0; do threads) lib_thread=yes ;; + malloc) + lib_malloc=yes + ;; -*) yaz_echo_help=yes ;; @@ -79,20 +83,27 @@ while test $# -gt 0; do shift done +lyaz="-lyaz" + if test "$lib_thread" = "yes" -a -n "@CFLAGSTHREADS@"; then yazextralibs="@LIBTHREAD@ $yazextralibs" - lyaz="-lyazthread -lyaz" -else - lyaz="-lyaz" + lyaz="-lyazthread $lyaz" fi + +if test "$lib_malloc" = "yes"; then + lyaz="-lyazmalloc $lyaz" +fi + if test "$yaz_echo_source" = "yes"; then YAZTAB=${yaz_src_root}/tab YAZBIN=${yaz_build_root}/bin YAZLIB="-L${yaz_build_root}/lib/.libs $lyaz $yazextralibs" + YAZLALIB="${yaz_build_root}/lib/libyaz.la $yazextralibs" if test "$lib_thread" = "yes" -a -n "@CFLAGSTHREADS@"; then - YAZLALIB="${yaz_build_root}/lib/libyazthread.la ${yaz_build_root}/lib/libyaz.la $yazextralibs" - else - YAZLALIB="${yaz_build_root}/lib/libyaz.la $yazextralibs" + YAZLALIB="${yaz_build_root}/lib/libyazthread.la $YAZLALIB" + fi + if test "$lib_malloc" = "yes"; then + YAZLALIB="${yaz_build_root}/lib/libyazmalloc.la $YAZLALIB" fi YAZINC="-I${yaz_src_root}/include" YAZCOMP=${yaz_src_root}/util/yaz-comp diff --git a/yaz.spec b/yaz.spec index 1f7e4c8..865dd00 100644 --- a/yaz.spec +++ b/yaz.spec @@ -45,6 +45,10 @@ cd doc; make prefix=$RPM_BUILD_ROOT/usr install /usr/lib/libyazthread.so /usr/lib/libyazthread.so.1 /usr/lib/libyazthread.so.1.0.0 +/usr/lib/libyazmalloc.a +/usr/lib/libyazmalloc.so +/usr/lib/libyazmalloc.so.1 +/usr/lib/libyazmalloc.so.1.0.0 /usr/include/yaz /usr/share/yaz/z39.50 /usr/share/yaz/ill diff --git a/z39.50/prt-ext.c b/z39.50/prt-ext.c index d1d2d50..6dbce99 100644 --- a/z39.50/prt-ext.c +++ b/z39.50/prt-ext.c @@ -2,102 +2,7 @@ * Copyright (c) 1995-2001, Index Data. * See the file LICENSE for details. * - * $Log: prt-ext.c,v $ - * Revision 1.1 2001-10-23 21:00:20 adam - * Old Z39.50 codecs gone. Added ZOOM. WRBUF MARC display util. - * - * Revision 1.7 2001/09/24 21:51:56 adam - * New Z39.50 OID utilities: yaz_oidval_to_z3950oid, yaz_str_to_z3950oid - * and yaz_z3950oid_to_str. - * - * Revision 1.6 2001/05/17 14:16:15 adam - * Added EXTERNAL handling for item update0 (1.0). - * - * Revision 1.5 2001/03/25 21:55:13 adam - * Added odr_intdup. Ztest server returns TaskPackage for ItemUpdate. - * - * Revision 1.4 2000/03/14 15:22:04 ian - * Added Admin external to choice table. - * - * Revision 1.3 2000/03/14 13:52:32 ian - * Added Admin Extended Service to External Choice - * - * Revision 1.2 1999/11/30 13:47:12 adam - * Improved installation. Moved header files to include/yaz. - * - * Revision 1.1 1999/06/08 10:10:16 adam - * New sub directory zutil. Moved YAZ Compiler to be part of YAZ tree. - * - * Revision 1.22 1999/05/26 15:24:26 adam - * Fixed minor bugs regarding DB Update (introduced by previous commit). - * - * Revision 1.21 1999/05/26 14:47:12 adam - * Implemented z_ext_record. - * - * Revision 1.20 1999/04/20 09:56:48 adam - * Added 'name' paramter to encoder/decoder routines (typedef Odr_fun). - * Modified all encoders/decoders to reflect this change. - * - * Revision 1.19 1998/03/31 15:13:19 adam - * Development towards compiled ASN.1. - * - * Revision 1.18 1998/03/31 11:07:44 adam - * Furhter work on UNIverse resource report. - * Added Extended Services handling in frontend server. - * - * Revision 1.17 1998/03/20 14:46:06 adam - * Added UNIverse Resource Reports. - * - * Revision 1.16 1998/02/11 11:53:32 adam - * Changed code so that it compiles as C++. - * - * Revision 1.15 1998/02/10 15:31:46 adam - * Implemented date and time structure. Changed the Update Extended - * Service. - * - * Revision 1.14 1998/01/05 09:04:57 adam - * Fixed bugs in encoders/decoders - Not operator (!) missing. - * - * Revision 1.13 1997/05/14 06:53:22 adam - * C++ support. - * - * Revision 1.12 1997/04/30 08:52:02 quinn - * Null - * - * Revision 1.11 1996/10/10 12:35:13 quinn - * Added Update extended service. - * - * Revision 1.10 1996/10/09 15:54:55 quinn - * Added SearchInfoReport - * - * Revision 1.9 1996/06/10 08:53:36 quinn - * Added Summary,OPAC,ResourceReport - * - * Revision 1.8 1996/02/20 12:51:44 quinn - * Completed SCAN. Fixed problems with EXTERNAL. - * - * Revision 1.7 1995/10/12 10:34:38 quinn - * Added Espec-1. - * - * Revision 1.6 1995/09/29 17:11:55 quinn - * Smallish - * - * Revision 1.5 1995/09/27 15:02:42 quinn - * Modified function heads & prototypes. - * - * Revision 1.4 1995/08/29 11:17:16 quinn - * *** empty log message *** - * - * Revision 1.3 1995/08/21 09:10:18 quinn - * Smallish fixes to suppport new formats. - * - * Revision 1.2 1995/08/17 12:45:00 quinn - * Fixed minor problems with GRS-1. Added support in c&s. - * - * Revision 1.1 1995/08/15 13:37:41 quinn - * Improved EXTERNAL - * - * + * $Id: prt-ext.c,v 1.2 2001-11-13 23:00:43 adam Exp $ */ #include @@ -116,11 +21,7 @@ static Z_ext_typeent type_table[] = {VAL_PROMPT1, Z_External_promptObject1, (Odr_fun)z_PromptObject1 }, {VAL_GRS1, Z_External_grs1, (Odr_fun)z_GenericRecord}, {VAL_EXTENDED, Z_External_extendedService, (Odr_fun)z_TaskPackage}, -#ifdef ASN_COMPILED {VAL_ITEMORDER, Z_External_itemOrder, (Odr_fun)z_IOItemOrder}, -#else - {VAL_ITEMORDER, Z_External_itemOrder, (Odr_fun)z_ItemOrder}, -#endif {VAL_DIAG1, Z_External_diag1, (Odr_fun)z_DiagnosticFormat}, {VAL_ESPEC1, Z_External_espec1, (Odr_fun)z_Espec1}, {VAL_SUMMARY, Z_External_summary, (Odr_fun)z_BriefBib}, @@ -128,10 +29,8 @@ static Z_ext_typeent type_table[] = {VAL_SEARCHRES1, Z_External_searchResult1, (Odr_fun)z_SearchInfoReport}, {VAL_DBUPDATE, Z_External_update, (Odr_fun)z_IUUpdate}, {VAL_DATETIME, Z_External_dateTime, (Odr_fun)z_DateTime}, - {VAL_UNIVERSE_REPORT, Z_External_universeReport, (Odr_fun)z_UniverseReport}, -#ifdef ASN_COMPILED + {VAL_UNIVERSE_REPORT, Z_External_universeReport,(Odr_fun)z_UniverseReport}, {VAL_ADMINSERVICE, Z_External_ESAdmin, (Odr_fun)z_Admin}, -#endif {VAL_NONE, 0, 0} }; @@ -172,13 +71,8 @@ int z_External(ODR o, Z_External **p, int opt, const char *name) (Odr_fun)z_GenericRecord, 0}, {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_extendedService, (Odr_fun)z_TaskPackage, 0}, -#ifdef ASN_COMPILED {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_itemOrder, (Odr_fun)z_IOItemOrder, 0}, -#else - {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_itemOrder, - (Odr_fun)z_ItemOrder, 0}, -#endif {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_diag1, (Odr_fun)z_DiagnosticFormat, 0}, {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_espec1, @@ -195,12 +89,11 @@ int z_External(ODR o, Z_External **p, int opt, const char *name) (Odr_fun)z_DateTime, 0}, {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_universeReport, (Odr_fun)z_UniverseReport, 0}, -#ifdef ASN_COMPILED {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_ESAdmin, (Odr_fun)z_Admin, 0}, {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_update0, (Odr_fun)z_IU0Update, 0}, -#endif {-1, -1, -1, -1, 0, 0} + {-1, -1, -1, -1, 0, 0} }; odr_implicit_settag(o, ODR_UNIVERSAL, ODR_EXTERNAL); @@ -247,6 +140,15 @@ Z_External *z_ext_record(ODR o, int format, const char *buf, int len) if (len < 0) /* Structured data */ { + + /* + * We cheat on the pointers here. Obviously, the record field + * of the backend-fetch structure should have been a union for + * correctness, but we're stuck with this for backwards + * compatibility. + */ + thisext->u.grs1 = (Z_GenericRecord*) buf; + switch (format) { case VAL_SUTRS: @@ -270,14 +172,6 @@ Z_External *z_ext_record(ODR o, int format, const char *buf, int len) default: return 0; } - - /* - * We cheat on the pointers here. Obviously, the record field - * of the backend-fetch structure should have been a union for - * correctness, but we're stuck with this for backwards - * compatibility. - */ - thisext->u.grs1 = (Z_GenericRecord*) buf; } else if (format == VAL_SUTRS) /* SUTRS is a single-ASN.1-type */ { diff --git a/ztest/ztest.c b/ztest/ztest.c index ba85739..ee3d2e0 100644 --- a/ztest/ztest.c +++ b/ztest/ztest.c @@ -2,149 +2,7 @@ * Copyright (c) 1995-2001, Index Data. * See the file LICENSE for details. * - * NT Service interface by - * Chas Woodfield, Fretwell Downing Datasystems. - * - * $Log: ztest.c,v $ - * Revision 1.45 2001-10-29 09:17:19 adam - * New function marc_display_exl - used by YAZ client. Server returns - * bad record on position 98 (for testing). - * - * Revision 1.44 2001/07/19 19:51:42 adam - * Added typecasts to make C++ happy. - * - * Revision 1.43 2001/06/28 09:27:25 adam - * Number of Extended Services Requests logged. - * - * Revision 1.42 2001/04/06 12:26:46 adam - * Optional CCL module. Moved atoi_n to marcdisp.h from yaz-util.h. - * - * Revision 1.41 2001/04/05 13:08:48 adam - * New configure options: --enable-module. - * - * Revision 1.40 2001/03/25 21:55:13 adam - * Added odr_intdup. Ztest server returns TaskPackage for ItemUpdate. - * - * Revision 1.39 2001/03/12 14:40:57 adam - * Minor change of print of item update info. - * - * Revision 1.38 2001/02/21 13:46:54 adam - * C++ fixes. - * - * Revision 1.37 2001/02/20 11:25:32 adam - * Added ill_get_APDU and ill_get_Cancel. - * - * Revision 1.36 2001/01/30 21:34:18 adam - * Added step-size for Scan backend interface. - * - * Revision 1.35 2000/11/23 10:58:33 adam - * SSL comstack support. Separate POSIX thread support library. - * - * Revision 1.34 2000/09/04 08:58:15 adam - * Added prefix yaz_ for most logging utility functions. - * - * Revision 1.33 2000/08/10 08:41:26 adam - * Fixes for ILL. - * - * Revision 1.32 2000/04/05 07:39:55 adam - * Added shared library support (libtool). - * - * Revision 1.31 2000/01/31 13:15:21 adam - * Removed uses of assert(3). Cleanup of ODR. CCL parser update so - * that some characters are not surrounded by spaces in resulting term. - * ILL-code updates. - * - * Revision 1.30 2000/01/13 23:05:50 adam - * Fixed tagging for member requester-CHECKED-IN in ILL ASN.1 spec. - * - * Revision 1.29 2000/01/12 14:36:07 adam - * Added printing stream (ODR) for backend functions. - * - * Revision 1.28 1999/12/16 23:36:19 adam - * Implemented ILL protocol. Minor updates ASN.1 compiler. - * - * Revision 1.27 1999/11/30 13:47:12 adam - * Improved installation. Moved header files to include/yaz. - * - * Revision 1.26 1999/08/27 09:40:32 adam - * Renamed logf function to yaz_log. Removed VC++ project files. - * - * Revision 1.25 1999/06/01 14:29:12 adam - * Work on Extended Services. - * - * Revision 1.24 1999/05/27 13:07:54 adam - * Fix. - * - * Revision 1.23 1999/05/27 13:02:20 adam - * Assigned OID for old DB Update (VAL_DBUPDATE0). - * - * Revision 1.22 1999/05/26 13:49:12 adam - * DB Update implemented in client (very basic). - * - * Revision 1.21 1998/12/15 12:45:42 adam - * Minor change. - * - * Revision 1.20 1998/12/14 14:48:05 adam - * Fixed memory leak - happened when fetching MARC records. - * - * Revision 1.19 1998/10/20 15:16:22 adam - * Minor change to prevent warning. - * - * Revision 1.18 1998/10/20 15:13:45 adam - * Minor fix regarding output for Item Order. - * - * Revision 1.17 1998/10/18 22:33:35 quinn - * Added diagnostic dump of Item Order Eservice. - * - * Revision 1.16 1998/10/15 08:26:23 adam - * Added type cast to make C++ happy. - * - * Revision 1.15 1998/10/13 20:05:57 adam - * Minor change. - * - * Revision 1.14 1998/10/13 16:12:25 adam - * Added support for Surrogate Diagnostics for Scan Term entries. - * - * Revision 1.13 1998/08/19 16:10:09 adam - * Changed som member names of DeleteResultSetRequest/Response. - * - * Revision 1.12 1998/07/20 12:38:44 adam - * Implemented delete result set service to server API. - * - * Revision 1.11 1998/06/09 13:55:08 adam - * Minor changes. - * - * Revision 1.10 1998/05/27 16:55:54 adam - * Minor changes. - * - * Revision 1.9 1998/03/31 11:07:45 adam - * Furhter work on UNIverse resource report. - * Added Extended Services handling in frontend server. - * - * Revision 1.8 1998/02/11 11:53:36 adam - * Changed code so that it compiles as C++. - * - * Revision 1.7 1998/02/10 11:03:57 adam - * Added support for extended handlers in backend server interface. - * - * Revision 1.6 1998/01/29 13:16:02 adam - * Added dummy sort in test server. - * - * Revision 1.5 1997/11/07 13:31:58 adam - * Added NT Service name part of statserv_options_block. Moved NT - * service utility to server library. - * - * Revision 1.4 1997/09/17 12:10:43 adam - * YAZ version 1.4. - * - * Revision 1.3 1997/09/09 10:10:20 adam - * Another MSV5.0 port. Changed projects to include proper - * library/include paths. - * Server starts server in test-mode when no options are given. - * - * Revision 1.2 1997/09/04 13:50:31 adam - * Bug fix in ztest. - * + * $Id: ztest.c,v 1.46 2001-11-13 23:00:43 adam Exp $ */ /* @@ -207,11 +65,7 @@ int ztest_esrequest (void *handle, bend_esrequest_rr *rr) yaz_log (LOG_LOG, "Received ItemOrder"); switch (it->which) { -#ifdef ASN_COMPILED case Z_IOItemOrder_esRequest: -#else - case Z_ItemOrder_esRequest: -#endif { Z_IORequest *ir = it->u.esRequest; Z_IOOriginPartToKeep *k = ir->toKeep; diff --git a/zutil/logrpn.c b/zutil/logrpn.c index b56e6a8..c30b80d 100644 --- a/zutil/logrpn.c +++ b/zutil/logrpn.c @@ -1,60 +1,8 @@ /* - * Copyright (C) 1995-2000, Index Data + * Copyright (C) 1995-2001, Index Data * All rights reserved. - * Sebastian Hammer, Adam Dickmeiss - * - * $Log: logrpn.c,v $ - * Revision 1.4 2000-01-31 13:15:22 adam - * Removed uses of assert(3). Cleanup of ODR. CCL parser update so - * that some characters are not surrounded by spaces in resulting term. - * ILL-code updates. - * - * Revision 1.3 1999/11/30 13:47:12 adam - * Improved installation. Moved header files to include/yaz. - * - * Revision 1.2 1999/08/27 09:40:33 adam - * Renamed logf function to yaz_log. Removed VC++ project files. - * - * Revision 1.1 1999/06/08 10:10:16 adam - * New sub directory zutil. Moved YAZ Compiler to be part of YAZ tree. - * - * Revision 1.1 1998/11/16 16:02:35 adam - * Added loggin utilies, log_rpn_query and log_scan_term. These used - * to be part of Zebra. - * - * - * - * Old logs from zlogs.c: - * - * Revision 1.9 1998/10/13 20:36:02 adam - * Changed "indent" format string in log messages. - * - * Revision 1.8 1998/04/02 14:35:29 adam - * First version of Zebra that works with compiled ASN.1. - * - * Revision 1.7 1998/01/29 13:40:11 adam - * Better logging for scan service. - * - * Revision 1.6 1997/09/29 09:06:41 adam - * Removed static var to make this module thread safe. - * - * Revision 1.5 1997/04/30 08:56:07 quinn - * null - * - * Revision 1.4 1996/10/08 09:41:25 quinn - * Fixed diagnostic. - * - * Revision 1.3 1996/03/20 09:36:40 adam - * Function dict_lookup_grep got extra parameter, init_pos, which marks - * from which position in pattern approximate pattern matching should occur. - * Approximate pattern matching is used in relevance=re-2. - * - * Revision 1.2 1996/01/03 16:22:11 quinn - * operator->roperator - * - * Revision 1.1 1995/11/16 17:00:55 adam - * Better logging of rpn query. * + * $Id: logrpn.c,v 1.5 2001-11-13 23:00:43 adam Exp $ */ #include @@ -245,21 +193,13 @@ static void zlog_attributes (Z_AttributesPlusTerm *t, int level, { int of, i; char str[80]; -#ifdef ASN_COMPILED int num_attributes = t->attributes->num_attributes; -#else - int num_attributes = t->num_attributes; -#endif for (of = 0; of < num_attributes; of++) { const char *attset_name = ""; Z_AttributeElement *element; -#ifdef ASN_COMPILED element = t->attributes->attributes[of]; -#else - element = t->attributeList[of]; -#endif if (element->attributeSet) { oident *attrset; diff --git a/zutil/pquery.c b/zutil/pquery.c index 08cec42..0df4c1b 100644 --- a/zutil/pquery.c +++ b/zutil/pquery.c @@ -2,111 +2,7 @@ * Copyright (c) 1995-2001, Index Data. * See the file LICENSE for details. * - * $Log: pquery.c,v $ - * Revision 1.10 2001-10-28 23:10:03 adam - * Fix local attribute setting for pquery. - * - * Revision 1.9 2001/09/24 21:51:56 adam - * New Z39.50 OID utilities: yaz_oidval_to_z3950oid, yaz_str_to_z3950oid - * and yaz_z3950oid_to_str. - * - * Revision 1.8 2001/07/19 19:14:53 adam - * C++ compile. - * - * Revision 1.7 2001/05/09 23:31:35 adam - * String attribute values for PQF. Proper C-backslash escaping for PQF. - * - * Revision 1.6 2001/03/07 13:24:40 adam - * Member and_not in Z_Operator is kept for backwards compatibility. - * Added support for definition of CCL operators in field spec file. - * - * Revision 1.5 2001/02/21 13:46:54 adam - * C++ fixes. - * - * Revision 1.4 1999/12/21 16:25:20 adam - * Fixed handling of default/inherited attributes. - * - * Revision 1.3 1999/12/20 15:20:13 adam - * Implemented ccl_pquery to convert from CCL tree to prefix query. - * - * Revision 1.2 1999/11/30 13:47:12 adam - * Improved installation. Moved header files to include/yaz. - * - * Revision 1.1 1999/06/08 10:10:16 adam - * New sub directory zutil. Moved YAZ Compiler to be part of YAZ tree. - * - * Revision 1.22 1999/04/20 09:56:49 adam - * Added 'name' paramter to encoder/decoder routines (typedef Odr_fun). - * Modified all encoders/decoders to reflect this change. - * - * Revision 1.21 1998/10/13 16:03:37 adam - * Better checking for invalid OID's in p_query_rpn. - * - * Revision 1.20 1998/03/31 15:13:20 adam - * Development towards compiled ASN.1. - * - * Revision 1.19 1998/03/05 08:09:03 adam - * Minor change to make C++ happy. - * - * Revision 1.18 1998/02/11 11:53:36 adam - * Changed code so that it compiles as C++. - * - * Revision 1.17 1997/11/24 11:33:57 adam - * Using function odr_nullval() instead of global ODR_NULLVAL when - * appropriate. - * - * Revision 1.16 1997/09/29 13:19:00 adam - * Added function, oid_ent_to_oid, to replace the function - * oid_getoidbyent, which is not thread safe. - * - * Revision 1.15 1997/09/29 07:13:43 adam - * Changed type of a few variables to avoid warnings. - * - * Revision 1.14 1997/09/22 12:33:41 adam - * Fixed bug introduced by previous commit. - * - * Revision 1.13 1997/09/17 12:10:42 adam - * YAZ version 1.4. - * - * Revision 1.12 1997/09/01 08:54:13 adam - * New windows NT/95 port using MSV5.0. Made prefix query handling - * thread safe. The function options ignores empty arguments when met. - * - * Revision 1.11 1996/11/11 13:15:29 adam - * Added proximity operator. - * - * Revision 1.10 1996/08/12 14:10:35 adam - * New function p_query_attset to define default attribute set. - * - * Revision 1.9 1996/03/15 11:03:46 adam - * Attribute set can be set globally for a query with the @attrset - * operator. The @attr operator has an optional attribute-set specifier - * that sets the attribute set locally. - * - * Revision 1.8 1996/01/02 11:46:56 quinn - * Changed 'operator' to 'roperator' to avoid C++ conflict. - * - * Revision 1.7 1995/09/29 17:12:36 quinn - * Smallish - * - * Revision 1.6 1995/09/27 15:03:03 quinn - * Modified function heads & prototypes. - * - * Revision 1.5 1995/06/15 12:31:02 quinn - * *** empty log message *** - * - * Revision 1.4 1995/06/15 07:45:19 quinn - * Moving to v3. - * - * Revision 1.3 1995/06/14 11:06:35 adam - * Bug fix: Attributes wasn't interpreted correctly! - * - * Revision 1.2 1995/05/26 08:56:11 adam - * New function: p_query_scan. - * - * Revision 1.1 1995/05/22 15:31:49 adam - * New function, p_query_rpn, to convert from prefix (ascii) to rpn (asn). - * + * $Id: pquery.c,v 1.11 2001-11-13 23:00:43 adam Exp $ */ #include @@ -386,15 +282,10 @@ static Z_AttributesPlusTerm *rpn_term (struct lex_info *li, ODR o, } num_attr = k; } -#ifdef ASN_COMPILED zapt->attributes = (Z_AttributeList *) odr_malloc (o, sizeof(*zapt->attributes)); zapt->attributes->num_attributes = num_attr; zapt->attributes->attributes = elements; -#else - zapt->num_attributes = num_attr; - zapt->attributeList = elements; -#endif zapt->term = term; term->which = Z_Term_general; @@ -483,14 +374,9 @@ static Z_ProximityOperator *rpn_proximity (struct lex_info *li, ODR o) if (!lex (li)) return NULL; -#ifdef ASN_COMPILED p->which = Z_ProximityOperator_known; p->u.known = (int *)odr_malloc (o, sizeof(*p->u.known)); *p->u.known = atoi (li->lex_buf); -#else - p->proximityUnitCode = (int *)odr_malloc (o, sizeof(*p->proximityUnitCode)); - *p->proximityUnitCode = atoi (li->lex_buf); -#endif return p; } diff --git a/zutil/query.c b/zutil/query.c index d0fd48e..a3b8338 100644 --- a/zutil/query.c +++ b/zutil/query.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 1995-1999, Index Data + * Copyright (c) 1995-2001, Index Data * See the file LICENSE for details. - * Sebastian Hammer, Adam Dickmeiss - * - * $Log: query.c,v $ - * Revision 1.3 1999-12-16 23:36:19 adam - * Implemented ILL protocol. Minor updates ASN.1 compiler. - * - * Revision 1.2 1999/06/09 14:01:33 adam - * Fixed for compiled ASN.1. - * - * Revision 1.1 1999/06/08 10:10:16 adam - * New sub directory zutil. Moved YAZ Compiler to be part of YAZ tree. - * - * Revision 1.3 1996/01/02 11:46:56 quinn - * Changed 'operator' to 'roperator' to avoid C++ conflict. - * - * Revision 1.2 1995/05/16 08:51:14 quinn - * License, documentation, and memory fixes - * - * Revision 1.1 1995/04/10 10:28:47 quinn - * Added copy of CCL and MARC display - * * + * $Id: query.c,v 1.4 2001-11-13 23:00:43 adam Exp $ */ #include @@ -67,14 +47,9 @@ static Z_Operand *makesimple(ODR o, char **buf) (*buf)++; r->which = Z_Operand_APT; r->u.attributesPlusTerm = t = odr_malloc(o, sizeof(*t)); -#ifdef ASN_COMPILED t->attributes = odr_malloc(o, sizeof(*t)); t->attributes->num_attributes = 0; t->attributes->attributes = 0; -#else - t->num_attributes = 0; - t->attributeList = 0; -#endif t->term = odr_malloc(o, sizeof(*t->term)); t->term->which = Z_Term_general; t->term->u.general = odr_malloc(o, sizeof(Odr_oct)); diff --git a/zutil/sortspec.c b/zutil/sortspec.c index 3be2674..3ffee80 100644 --- a/zutil/sortspec.c +++ b/zutil/sortspec.c @@ -2,7 +2,7 @@ * Copyright (c) 1995-2001, Index Data. * See the file LICENSE for details. * - * $Id: sortspec.c,v 1.3 2001-09-24 21:51:56 adam Exp $ + * $Id: sortspec.c,v 1.4 2001-11-13 23:00:43 adam Exp $ */ #include @@ -80,12 +80,8 @@ Z_SortKeySpecList *yaz_sort_spec (ODR out, const char *arg) sks->sortRelation = odr_intdup (out, Z_SortRelation_ascending); sks->caseSensitivity = odr_intdup (out, Z_SortCase_caseSensitive); -#ifdef ASN_COMPILED sks->which = Z_SortKeySpec_null; sks->u.null = odr_nullval (); -#else - sks->missingValueAction = NULL; -#endif for (i = 0; sort_flags[i]; i++) { diff --git a/zutil/yaz-ccl.c b/zutil/yaz-ccl.c index 4c86dfe..f8b8050 100644 --- a/zutil/yaz-ccl.c +++ b/zutil/yaz-ccl.c @@ -2,72 +2,7 @@ * Copyright (c) 1996-2001, Index Data. * See the file LICENSE for details. * - * $Log: yaz-ccl.c,v $ - * Revision 1.14 2001-09-24 21:51:56 adam - * New Z39.50 OID utilities: yaz_oidval_to_z3950oid, yaz_str_to_z3950oid - * and yaz_z3950oid_to_str. - * - * Revision 1.13 2001/05/09 23:31:35 adam - * String attribute values for PQF. Proper C-backslash escaping for PQF. - * - * Revision 1.12 2001/03/07 13:24:40 adam - * Member and_not in Z_Operator is kept for backwards compatibility. - * Added support for definition of CCL operators in field spec file. - * - * Revision 1.11 2001/02/21 13:46:54 adam - * C++ fixes. - * - * Revision 1.10 2001/02/20 11:23:50 adam - * Updated ccl_pquery to consider local attribute set too. - * - * Revision 1.9 2000/11/27 14:16:55 adam - * Fixed bug in ccl_rpn_simple regarding resultSetId's. - * - * Revision 1.8 2000/11/16 13:03:13 adam - * Function ccl_rpn_query sets attributeSet to Bib-1. - * - * Revision 1.7 2000/11/16 09:58:02 adam - * Implemented local AttributeSet setting for CCL field maps. - * - * Revision 1.6 2000/02/02 15:13:23 adam - * Minor change. - * - * Revision 1.5 2000/01/31 13:15:22 adam - * Removed uses of assert(3). Cleanup of ODR. CCL parser update so - * that some characters are not surrounded by spaces in resulting term. - * ILL-code updates. - * - * Revision 1.4 1999/12/20 15:20:13 adam - * Implemented ccl_pquery to convert from CCL tree to prefix query. - * - * Revision 1.3 1999/11/30 13:47:12 adam - * Improved installation. Moved header files to include/yaz. - * - * Revision 1.2 1999/06/16 12:00:08 adam - * Added proximity. - * - * Revision 1.1 1999/06/08 10:12:43 adam - * Moved file to be part of zutil (instead of util). - * - * Revision 1.13 1998/03/31 15:13:20 adam - * Development towards compiled ASN.1. - * - * Revision 1.12 1998/02/11 11:53:36 adam - * Changed code so that it compiles as C++. - * - * Revision 1.11 1997/11/24 11:33:57 adam - * Using function odr_nullval() instead of global ODR_NULLVAL when - * appropriate. - * - * Revision 1.10 1997/09/29 08:58:25 adam - * Fixed conversion of trees so that true copy is made. - * - * Revision 1.9 1997/06/23 10:31:25 adam - * Added ODR argument to ccl_rpn_query and ccl_scan_query. - * - * Revision 1.8 1996/10/29 13:36:27 adam - * Added header. - * + * $Id: yaz-ccl.c,v 1.15 2001-11-13 23:00:43 adam Exp $ */ #include @@ -126,15 +61,10 @@ static Z_AttributesPlusTerm *ccl_rpn_term (ODR o, struct ccl_rpn_node *p) *elements[i]->value.numeric = attr->value; } } -#ifdef ASN_COMPILED zapt->attributes = (Z_AttributeList *) odr_malloc (o, sizeof(*zapt->attributes)); zapt->attributes->num_attributes = num; zapt->attributes->attributes = elements; -#else - zapt->num_attributes = num; - zapt->attributeList = elements; -#endif zapt->term = term; term->which = Z_Term_general; term->u.general = term_octet; @@ -205,19 +135,11 @@ static Z_Complex *ccl_rpn_complex (ODR o, struct ccl_rpn_node *p) zo->u.prox->relationType = (int *) odr_malloc (o, sizeof(*zo->u.prox->relationType)); -#ifdef ASN_COMPILED *zo->u.prox->relationType = Z_ProximityOperator_Prox_lessThan; zo->u.prox->which = Z_ProximityOperator_known; zo->u.prox->u.known = (Z_ProxUnit *) odr_malloc (o, sizeof(*zo->u.prox->u.known)); *zo->u.prox->u.known = Z_ProxUnit_word; -#else - *zo->u.prox->relationType = Z_Prox_lessThan; - zo->u.prox->which = Z_ProxCode_known; - zo->u.prox->proximityUnitCode = (int*) - odr_malloc (o, sizeof(*zo->u.prox->proximityUnitCode)); - *zo->u.prox->proximityUnitCode = Z_ProxUnit_word; -#endif break; default: return 0; -- 1.7.10.4