/*
- * $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 <stdio.h>
#include <yaz/pquery.h>
-#ifdef ASN_COMPILED
/* Helper functions to get to various statics in the client */
ODR getODROutputStream();
sendAdminES(Z_ESAdminOriginPartToKeep_start, NULL);
return 2;
}
-#endif
* 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 <stdio.h>
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:
printf (" -- v3 addinfo '%s'\n", r->u.v3Addinfo);
break;
}
-#else
- if (r->addinfo && *r->addinfo)
- printf(" -- '%s'\n", r->addinfo);
- else
- printf("\n");
-#endif
}
}
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,
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));
int cmd_quit(char *arg)
{
printf("See you later, alligator.\n");
+ xmalloc_trav ("");
exit(0);
return 0;
}
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);
}
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)
{"update", cmd_update, "<item>"},
{"packagename", cmd_packagename, "<packagename>"},
{"proxy", cmd_proxy, "('tcp'|'osi')':'[<tsel>'/']<host>[':'<port>]"},
-#ifdef ASN_COMPILED
/* Server Admin Functions */
{"adm-reindex", cmd_adm_reindex, "<database-name>"},
{"adm-truncate", cmd_adm_truncate, "('database'|'index')<object-name>"},
{"adm-commit", cmd_adm_commit, ""},
{"adm-shutdown", cmd_adm_shutdown, ""},
{"adm-startup", cmd_adm_startup, ""},
-#endif
{0,0}
};
char *netbuffer= 0;
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
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])
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/*
-<!-- $Id: credits.xml,v 1.2 2001-11-06 17:03:33 adam Exp $ -->
+<!-- $Id: credits.xml,v 1.3 2001-11-13 23:00:42 adam Exp $ -->
<appendix id="credits"><title>Credits</title>
<para>
This appendix lists individuals that have contributed in the development
Matthew Carey
</para></listitem>
<listitem><para>
+ Irina Dijour
+ </para></listitem>
+ <listitem><para>
Hans van den Dool
</para></listitem>
<listitem><para>
<!ENTITY comstack "<acronym>COMSTACK</acronym>">
<!ENTITY zoom "<acronym>ZOOM</acronym>">
]>
-<!-- $Id: yaz.xml,v 1.13 2001-11-06 17:05:19 adam Exp $ -->
+<!-- $Id: yaz.xml,v 1.14 2001-11-13 23:00:42 adam Exp $ -->
<book id="yaz">
<bookinfo>
<title>YAZ User's Guide and Reference</title>
</copyright>
<abstract><simpara>
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
-<!-- $Id: zoom.xml,v 1.7 2001-11-11 22:25:25 adam Exp $ -->
+<!-- $Id: zoom.xml,v 1.8 2001-11-13 23:00:42 adam Exp $ -->
<chapter id="zoom"><title>Building clients with ZOOM</title>
<para>
Otherwise, if <parameter>val</parameter> is
<literal>NULL</literal>,
the option is unchanged.
- The function returns the previous value of the option.
+ The function returns the (new) value of the option.
</para>
<table frame="top"><title>ZOOM Connection Options</title>
<tgroup cols="3">
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;
};
-## $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 ..
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)
$(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
/*
* 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
* 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 $
*/
/*
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
}
/*
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;
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;
}
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;
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;
* 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 <stdio.h>
* 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
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 {
{
if (--nmem_init_flag == 0)
{
+ yaz_log (LOG_LOG, "nmem_exit .............");
oid_exit();
while (freelist)
{
}
return TRUE;
}
-#endif
\ No newline at end of file
+#endif
* 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
#include <yaz/log.h>
#include <yaz/xmalloc.h>
-#define TRACE_XMALLOC 2
+#ifndef TRACE_XMALLOC
+#define TRACE_XMALLOC 1
+#endif
#if TRACE_XMALLOC > 1
#!/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
[--comp]
Libraries:
threads
+ malloc
EOF
exit $1
}
threads)
lib_thread=yes
;;
+ malloc)
+ lib_malloc=yes
+ ;;
-*)
yaz_echo_help=yes
;;
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
/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
* 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 <yaz/proto.h>
{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},
{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}
};
(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,
(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);
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:
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 */
{
* 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 $
*/
/*
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;
/*
- * 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 <stdio.h>
{
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;
* 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 <stdio.h>
}
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;
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;
}
/*
- * 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 <stdio.h>
(*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));
* 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 <stdio.h>
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++)
{
* 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 <stdio.h>
*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;
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;