From: Adam Dickmeiss Date: Tue, 6 Nov 2001 17:05:19 +0000 (+0000) Subject: ZOOM changes. X-Git-Tag: YAZ.1.8.2~7 X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=commitdiff_plain;h=67e7a7a13ff1e787b9e5cfe84494dfd446c1bcb9 ZOOM changes. --- diff --git a/CHANGELOG b/CHANGELOG index fc7c75e..635d586 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,14 @@ Possible compatibility problems with earlier versions marked with '*'. +Documentation updates for COMSTACK. + +* ZOOM changes. Query object renamed from Z3950_search to Z3950_query. +Changed prototype Z3950_records. For some functions int parameters +were changed to size_t. + +TCP/IP COMSTACK no longer uses getprotobyname to avoid memory leak +on some Unices. + New MARC decode/display function, marc_display_exl, which better rejects bad ISO2709 records. YAZ client uses it. diff --git a/doc/yaz.xml b/doc/yaz.xml index 7beb6f3..e7ca157 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. &yaz; is a compact toolkit that provides + package version 1.8.2. &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 cc03dbc..c350599 100644 --- a/doc/zoom.xml +++ b/doc/zoom.xml @@ -1,4 +1,4 @@ - + Building clients with ZOOM @@ -154,30 +154,29 @@ non-NULL. - Search objects + Queries - Search objects defines how result sets are obtained. They - act like queries. + Query objects represents queries. - Z3950_search Z3950_search_create(void); + Z3950_query Z3950_query_create(void); - void Z3950_search_destroy(Z3950_search s); + void Z3950_query_destroy(Z3950_query q); - int Z3950_search_prefix(Z3950_search s, const char *str); + int Z3950_query_prefix(Z3950_query q, const char *str); - int Z3950_search_sortby(Z3950_search s, const char *criteria); + int Z3950_query_sortby(Z3950_query q, const char *criteria); - Create search objects using Z3950_search_create - and destroy them by calling Z3950_search_destroy. + Create query objects using Z3950_query_create + and destroy them by calling Z3950_query_destroy. RPN-queries can be specified in PQF notation by using the - function Z3950_search_prefix. More + function Z3950_query_prefix. More query types will be added later, such as CCL to RPN-mapping, native CCL query, etc. In addition to a search, a sort criteria may be set. Function - Z3950_search_sortby specifies a + Z3950_query_sortby specifies a sort criteria using the same string notation for sort as offered by the YAZ client. @@ -189,7 +188,7 @@ Z3950_resultset Z3950_connection_search(Z3950_connection, - Z3950_search q); + Z3950_query q); Z3950_resultset Z3950_connection_search_pqf(Z3950_connection c, const char *q); @@ -198,11 +197,12 @@ Function Z3950_connection_search creates - a result set given a connection - and search object. + a result set given a connection and query. Destroy a result set by calling Z3950_resultset_destroy. - Simple clients using PQF only may use function - Z3950_connection_search_pqf instead. + Simple clients may using PQF only may use function + Z3950_connection_search_pqf in which case + creating query objects is not necessary. const char *Z3950_resultset_option (Z3950_resultset r, @@ -211,8 +211,8 @@ int Z3950_resultset_size (Z3950_resultset r); - void *Z3950_resultset_get (Z3950_resultset s, int pos, - const char *type, int *len); + void *Z3950_resultset_get (Z3950_resultset s, size_t pos, + const char *type, size_t *len); Function Z3950_resultset_options sets or @@ -248,10 +248,9 @@ used in searches; false (0) if not. 1 - startOffset of first record we wish to - retrieve from the target. Note first record has offset 0 - unlike the protocol specifications where first record has position - 1. + startOffset of first record to be + retrieved from target. First record has offset 0 unlike the + protocol specifications where first record has position 1. 0 countNumber of records to be retrieved. @@ -266,6 +265,28 @@ USMARC, SUTRS, etc. none + smallSetUpperBoundIf hits is less than or equal to this + value, then target will return all records using small element set name + 0 + + largeSetLowerBoundIf hits is greator than this value, the target + will return no records. + 1 + + mediumSetPresentNumberThis value represents + the number of records to be returned as part of a search when when + hits is less than or equal to large set lower bound and if hits + is greator than small set upper bound. + 0 + + smallSetElementSetName + The element set name to be used for small result sets. + none + + mediumSetElementSetName + The element set name to be for medium-sized result sets. + none + databaseNameOne or more database names separated by character plus (+). Default @@ -281,11 +302,11 @@ void Z3950_resultset_records (Z3950_resultset r, Z3950_record *recs, - size_t *cnt); - Z3950_record Z3950_resultset_record (Z3950_resultset s, int pos); + size_t start, size_t count); + Z3950_record Z3950_resultset_record (Z3950_resultset s, size_t pos); void *Z3950_record_get (Z3950_record rec, const char *type, - int *len); + size_t *len); void Z3950_record_destroy (Z3950_record rec); @@ -303,14 +324,14 @@ Function Z3950_resultset_records retrieves - a number of records from a result set. Options start + a number of records from a result set. Parameter start and count specifies the range of records to - be returned. Upon completion recs[0], ..recs[*cnt] - holds record objects for the records. These array of records + be returned. Upon completion array recs[0], ..recs[count-1] + holds record objects for the records. The array of records recs should be allocate prior to calling - Z3950_resultset_records. Note that for + Z3950_resultset_records. Note that for those records that couldn't be retrieved from the target - recs[ ..] is NULL. + recs[ ..] is set to NULL. In order to extract information about a single record, @@ -326,9 +347,9 @@ Options - Most objects in &zoom; allow you to specify options to change - default behaviour. From an implementation point of view a set of options - is just like an associate array / hash array, etc. + Most &zoom; objects provide a way to specify options to default behaviour. + From an implementation point of view a set of options is just like + an associate array / hash array, etc. Z3950_options Z3950_options_create (void); diff --git a/include/yaz/zoom.h b/include/yaz/zoom.h index 36f0022..484a7cd 100644 --- a/include/yaz/zoom.h +++ b/include/yaz/zoom.h @@ -1,15 +1,26 @@ /* * Public header for ZOOM C. - * $Id: zoom.h,v 1.2 2001-10-24 12:24:43 adam Exp $ + * $Id: zoom.h,v 1.3 2001-11-06 17:05:19 adam Exp $ */ -/* the types we use */ +/* 1. Modification + Renamed type Z3950_search to Z3950_query and the functions + that manipulate it.. + Changed positions/sizes to be of type size_t rather than int. +*/ #include -YAZ_BEGIN_CDECL +#define ZOOM_EXPORT YAZ_EXPORT +#define ZOOM_BEGIN_CDECL YAZ_BEGIN_CDECL +#define ZOOM_END_CDECL YAZ_END_CDECL + +ZOOM_BEGIN_CDECL + +/* ----------------------------------------------------------- */ +/* the types we use */ typedef struct Z3950_options_p *Z3950_options; -typedef struct Z3950_search_p *Z3950_search; +typedef struct Z3950_query_p *Z3950_query; typedef struct Z3950_connection_p *Z3950_connection; typedef struct Z3950_resultset_p *Z3950_resultset; typedef struct Z3950_task_p *Z3950_task; @@ -20,45 +31,45 @@ typedef struct Z3950_record_p *Z3950_record; /* create connection, connect to host, if portnum is 0, then port is read from host string (e.g. myhost:9821) */ -YAZ_EXPORT +ZOOM_EXPORT Z3950_connection Z3950_connection_new (const char *host, int portnum); /* create connection, don't connect, apply options */ -YAZ_EXPORT +ZOOM_EXPORT Z3950_connection Z3950_connection_create (Z3950_options options); /* connect given existing connection */ -YAZ_EXPORT +ZOOM_EXPORT void Z3950_connection_connect(Z3950_connection c, const char *host, int portnum); -/* destroy connection (close connection also *) */ -YAZ_EXPORT +/* destroy connection (close connection also) */ +ZOOM_EXPORT void Z3950_connection_destroy (Z3950_connection c); /* set option for connection */ -YAZ_EXPORT +ZOOM_EXPORT const char *Z3950_connection_option (Z3950_connection c, const char *key, const char *val); /* return host for connection */ -YAZ_EXPORT +ZOOM_EXPORT const char *Z3950_connection_host (Z3950_connection c); /* return error code (0 == success, failure otherwise). cp holds error string on failure, addinfo holds addititional info (if any) */ -YAZ_EXPORT +ZOOM_EXPORT int Z3950_connection_error (Z3950_connection c, const char **cp, const char **addinfo); /* returns error code */ -YAZ_EXPORT +ZOOM_EXPORT int Z3950_connection_errcode (Z3950_connection c); /* returns error message */ -YAZ_EXPORT +ZOOM_EXPORT const char *Z3950_connection_errmsg (Z3950_connection c); /* returns additional info */ -YAZ_EXPORT +ZOOM_EXPORT const char *Z3950_connection_addinfo (Z3950_connection c); #define Z3950_ERROR_NONE 0 @@ -75,99 +86,99 @@ const char *Z3950_connection_addinfo (Z3950_connection c); /* result sets */ /* create result set given a search */ -YAZ_EXPORT -Z3950_resultset Z3950_connection_search(Z3950_connection, Z3950_search q); +ZOOM_EXPORT +Z3950_resultset Z3950_connection_search(Z3950_connection, Z3950_query q); /* create result set given PQF query */ -YAZ_EXPORT +ZOOM_EXPORT Z3950_resultset Z3950_connection_search_pqf(Z3950_connection c, const char *q); /* destroy result set */ -YAZ_EXPORT +ZOOM_EXPORT void Z3950_resultset_destroy(Z3950_resultset r); /* result set option */ -YAZ_EXPORT +ZOOM_EXPORT const char *Z3950_resultset_option (Z3950_resultset r, const char *key, const char *val); /* return size of result set (hit count, AKA resultCount) */ -YAZ_EXPORT +ZOOM_EXPORT int Z3950_resultset_size (Z3950_resultset r); /* return record at pos (starting from ), render given spec in type */ -YAZ_EXPORT -void *Z3950_resultset_get (Z3950_resultset s, int pos, const char *type, - int *len); +ZOOM_EXPORT +void *Z3950_resultset_get (Z3950_resultset s, size_t pos, const char *type, + size_t *len); /* retrieve records */ -YAZ_EXPORT +ZOOM_EXPORT void Z3950_resultset_records (Z3950_resultset r, Z3950_record *recs, - size_t *cnt); + size_t start, size_t count); /* return record object at pos. Returns 0 if unavailable */ -YAZ_EXPORT -Z3950_record Z3950_resultset_record (Z3950_resultset s, int pos); +ZOOM_EXPORT +Z3950_record Z3950_resultset_record (Z3950_resultset s, size_t pos); /* like Z3950_resultset_record - but never blocks .. */ -YAZ_EXPORT -Z3950_record Z3950_resultset_record_immediate (Z3950_resultset s, int pos); +ZOOM_EXPORT +Z3950_record Z3950_resultset_record_immediate (Z3950_resultset s, size_t pos); /* ----------------------------------------------------------- */ /* records */ /* Get record information, in a form given by type */ -YAZ_EXPORT -void *Z3950_record_get (Z3950_record rec, const char *type, int *len); +ZOOM_EXPORT +void *Z3950_record_get (Z3950_record rec, const char *type, size_t *len); /* Destroy record */ -YAZ_EXPORT +ZOOM_EXPORT void Z3950_record_destroy (Z3950_record rec); /* ----------------------------------------------------------- */ /* searches */ /* create search object */ -YAZ_EXPORT -Z3950_search Z3950_search_create(void); +ZOOM_EXPORT +Z3950_query Z3950_query_create(void); /* destroy it */ -YAZ_EXPORT -void Z3950_search_destroy(Z3950_search s); +ZOOM_EXPORT +void Z3950_query_destroy(Z3950_query s); /* specify prefix query for search */ -YAZ_EXPORT -int Z3950_search_prefix(Z3950_search s, const char *str); +ZOOM_EXPORT +int Z3950_query_prefix(Z3950_query s, const char *str); /* specify sort criteria for search */ -YAZ_EXPORT -int Z3950_search_sortby(Z3950_search s, const char *criteria); +ZOOM_EXPORT +int Z3950_query_sortby(Z3950_query s, const char *criteria); /* ----------------------------------------------------------- */ /* options */ typedef const char *(*Z3950_options_callback)(void *handle, const char *name); -YAZ_EXPORT +ZOOM_EXPORT Z3950_options_callback Z3950_options_set_callback (Z3950_options opt, Z3950_options_callback c, void *handle); -YAZ_EXPORT +ZOOM_EXPORT Z3950_options Z3950_options_create (void); -YAZ_EXPORT +ZOOM_EXPORT Z3950_options Z3950_options_create_with_parent (Z3950_options parent); -YAZ_EXPORT +ZOOM_EXPORT const char *Z3950_options_get (Z3950_options opt, const char *name); -YAZ_EXPORT +ZOOM_EXPORT void Z3950_options_set (Z3950_options opt, const char *name, const char *v); -YAZ_EXPORT +ZOOM_EXPORT void Z3950_options_destroy (Z3950_options opt); -YAZ_EXPORT +ZOOM_EXPORT int Z3950_options_get_bool (Z3950_options opt, const char *name, int defa); -YAZ_EXPORT +ZOOM_EXPORT int Z3950_options_get_int (Z3950_options opt, const char *name, int defa); -YAZ_EXPORT +ZOOM_EXPORT void Z3950_options_addref (Z3950_options opt); /* ----------------------------------------------------------- */ @@ -177,7 +188,7 @@ void Z3950_options_addref (Z3950_options opt); events are pending. The positive integer specifies the connection for which the event occurred. There's no way to get the details yet, sigh. */ -YAZ_EXPORT +ZOOM_EXPORT int Z3950_event (int no, Z3950_connection *cs); -YAZ_END_CDECL +ZOOM_END_CDECL diff --git a/util/xmalloc.c b/util/xmalloc.c index cc5fe3e..1b33b63 100644 --- a/util/xmalloc.c +++ b/util/xmalloc.c @@ -1,69 +1,9 @@ /* - * Copyright (C) 1994-2000, Index Data + * Copyright (C) 1994-2001, Index Data * All rights reserved. * Sebastian Hammer, Adam Dickmeiss * - * $Log: xmalloc.c,v $ - * Revision 1.13 2001-09-30 20:10:28 adam - * TRACE_MALLOC=1. - * - * Revision 1.12 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.11 2000/02/29 13:44:55 adam - * Check for config.h (currently not generated). - * - * Revision 1.10 1999/11/30 13:47:12 adam - * Improved installation. Moved header files to include/yaz. - * - * Revision 1.9 1999/09/10 08:58:32 adam - * Set TRACE_XMALLOC to 1. - * - * Revision 1.8 1999/08/27 09:40:32 adam - * Renamed logf function to yaz_log. Removed VC++ project files. - * - * Revision 1.7 1999/07/13 13:24:53 adam - * Updated memory debugging memory allocatation routines. - * - * Revision 1.6 1998/02/11 11:53:36 adam - * Changed code so that it compiles as C++. - * - * Revision 1.5 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.4 1996/07/03 13:21:36 adam - * Function xfree_f checks for NULL pointer. - * - * Revision 1.3 1995/12/05 15:08:44 adam - * Fixed verbose of xrealloc. - * - * Revision 1.2 1995/12/05 11:08:37 adam - * More verbose malloc routines. - * - * Revision 1.1 1995/11/01 11:56:53 quinn - * Added Xmalloc. - * - * Revision 1.6 1995/10/16 14:03:11 quinn - * Changes to support element set names and espec1 - * - * Revision 1.5 1995/09/04 12:34:06 adam - * Various cleanup. YAZ util used instead. - * - * Revision 1.4 1994/10/05 10:16:16 quinn - * Added xrealloc. Fixed bug in log. - * - * Revision 1.3 1994/09/26 16:31:37 adam - * Added xcalloc_f. - * - * Revision 1.2 1994/08/18 08:23:26 adam - * Res.c now use handles. xmalloc defines xstrdup. - * - * Revision 1.1 1994/08/17 13:37:54 adam - * xmalloc.c added to util. - * + * $Id: xmalloc.c,v 1.14 2001-11-06 17:05:19 adam Exp $ */ #if HAVE_CONFIG_H @@ -77,7 +17,7 @@ #include #include -#define TRACE_XMALLOC 1 +#define TRACE_XMALLOC 2 #if TRACE_XMALLOC > 1 diff --git a/zoom/zoom-c.c b/zoom/zoom-c.c index 907aa2d..8b38ce3 100644 --- a/zoom/zoom-c.c +++ b/zoom/zoom-c.c @@ -1,5 +1,5 @@ /* - * $Id: zoom-c.c,v 1.2 2001-10-24 12:24:43 adam Exp $ + * $Id: zoom-c.c,v 1.3 2001-11-06 17:05:19 adam Exp $ * * ZOOM layer for C, connections, result sets, queries. */ @@ -144,9 +144,9 @@ void Z3950_connection_connect(Z3950_connection c, } } -Z3950_search Z3950_search_create(void) +Z3950_query Z3950_query_create(void) { - Z3950_search s = xmalloc (sizeof(*s)); + Z3950_query s = xmalloc (sizeof(*s)); s->refcount = 1; s->query = 0; @@ -161,13 +161,13 @@ const char *Z3950_connection_host (Z3950_connection c) return c->host_port; } -void Z3950_search_destroy(Z3950_search s) +void Z3950_query_destroy(Z3950_query s) { if (!s) return; (s->refcount)--; - yaz_log (LOG_DEBUG, "Z3950_search_destroy count=%d", s->refcount); + yaz_log (LOG_DEBUG, "Z3950_query_destroy count=%d", s->refcount); if (s->refcount == 0) { odr_destroy (s->odr); @@ -175,7 +175,7 @@ void Z3950_search_destroy(Z3950_search s) } } -int Z3950_search_prefix(Z3950_search s, const char *str) +int Z3950_query_prefix(Z3950_query s, const char *str) { s->query = odr_malloc (s->odr, sizeof(*s->query)); s->query->which = Z_Query_type_1; @@ -185,7 +185,7 @@ int Z3950_search_prefix(Z3950_search s, const char *str) return 0; } -int Z3950_search_sortby(Z3950_search s, const char *criteria) +int Z3950_query_sortby(Z3950_query s, const char *criteria) { s->sort_spec = yaz_sort_spec (s->odr, criteria); if (!s->sort_spec) @@ -285,16 +285,16 @@ Z3950_resultset Z3950_resultset_create () Z3950_resultset Z3950_connection_search_pqf(Z3950_connection c, const char *q) { Z3950_resultset r; - Z3950_search s = Z3950_search_create(); + Z3950_query s = Z3950_query_create(); - Z3950_search_prefix (s, q); + Z3950_query_prefix (s, q); r = Z3950_connection_search (c, s); - Z3950_search_destroy (s); + Z3950_query_destroy (s); return r; } -Z3950_resultset Z3950_connection_search(Z3950_connection c, Z3950_search q) +Z3950_resultset Z3950_connection_search(Z3950_connection c, Z3950_query q) { Z3950_resultset r = Z3950_resultset_create (); Z3950_task task; @@ -350,7 +350,7 @@ void Z3950_resultset_destroy(Z3950_resultset r) rp = &(*rp)->next; } } - Z3950_search_destroy (r->search); + Z3950_query_destroy (r->search); Z3950_options_destroy (r->options); odr_destroy (r->odr); xfree (r); @@ -395,22 +395,19 @@ static void Z3950_resultset_retrieve (Z3950_resultset r, } void Z3950_resultset_records (Z3950_resultset r, Z3950_record *recs, - size_t *cnt) + size_t start, size_t count) { int force_present = 0; - int start, count; if (!r) return ; - start = Z3950_options_get_int (r->options, "start", 0); - count = Z3950_options_get_int (r->options, "count", 0); - if (cnt && recs) + if (count && recs) force_present = 1; Z3950_resultset_retrieve (r, force_present, start, count); if (force_present) { size_t i; - for (i = 0; i< *cnt; i++) + for (i = 0; i< count; i++) recs[i] = Z3950_resultset_record_immediate (r, i+start); } } @@ -731,7 +728,7 @@ Z3950_record Z3950_record_dup (Z3950_record srec) return nrec; } -Z3950_record Z3950_resultset_record_immediate (Z3950_resultset s, int pos) +Z3950_record Z3950_resultset_record_immediate (Z3950_resultset s,size_t pos) { Z3950_record rec = record_cache_lookup (s, pos, 0); if (!rec) @@ -739,7 +736,7 @@ Z3950_record Z3950_resultset_record_immediate (Z3950_resultset s, int pos) return Z3950_record_dup (rec); } -Z3950_record Z3950_resultset_record (Z3950_resultset r, int pos) +Z3950_record Z3950_resultset_record (Z3950_resultset r, size_t pos) { Z3950_resultset_retrieve (r, 1, pos, 1); return Z3950_resultset_record_immediate (r, pos); @@ -755,7 +752,7 @@ void Z3950_record_destroy (Z3950_record rec) xfree (rec); } -void *Z3950_record_get (Z3950_record rec, const char *type, int *len) +void *Z3950_record_get (Z3950_record rec, const char *type, size_t *len) { Z_NamePlusRecord *npr; if (!rec) @@ -826,8 +823,8 @@ void *Z3950_record_get (Z3950_record rec, const char *type, int *len) return 0; } -void *Z3950_resultset_get (Z3950_resultset s, int pos, const char *type, - int *len) +void *Z3950_resultset_get (Z3950_resultset s, size_t pos, const char *type, + size_t *len) { Z3950_record rec = record_cache_lookup (s, pos, 0); return Z3950_record_get (rec, type, len); diff --git a/zoom/zoom-p.h b/zoom/zoom-p.h index 4991cde..1c9a1ff 100644 --- a/zoom/zoom-p.h +++ b/zoom/zoom-p.h @@ -1,13 +1,13 @@ /* * Private C header for ZOOM C. - * $Id: zoom-p.h,v 1.2 2001-10-24 12:24:43 adam Exp $ + * $Id: zoom-p.h,v 1.3 2001-11-06 17:05:19 adam Exp $ */ #include #include #include #include -struct Z3950_search_p { +struct Z3950_query_p { Z_Query *query; Z_SortKeySpecList *sort_spec; int refcount; @@ -65,7 +65,7 @@ typedef struct Z3950_record_cache_p *Z3950_record_cache; struct Z3950_resultset_p { Z_Query *r_query; Z_SortKeySpecList *r_sort_spec; - Z3950_search search; + Z3950_query search; int refcount; int size; int start; diff --git a/zoom/zoomsh.c b/zoom/zoomsh.c index 9f9d0e4..8ff31b1 100644 --- a/zoom/zoomsh.c +++ b/zoom/zoomsh.c @@ -1,5 +1,5 @@ /* - * $Id: zoomsh.c,v 1.2 2001-10-24 12:24:43 adam Exp $ + * $Id: zoomsh.c,v 1.3 2001-11-06 17:05:19 adam Exp $ * * ZOOM-C Shell */ @@ -146,7 +146,7 @@ static void cmd_show (Z3950_connection *c, Z3950_resultset *r, Z3950_options_set (options, "count", count_str); for (i = 0; i 2) { @@ -84,7 +81,7 @@ int main(int argc, char **argv) Z3950_record_destroy (recs[0]); Z3950_record_destroy (recs[1]); - Z3950_search_destroy (s); + Z3950_query_destroy (s); putchar ('.'); if (block > 0) @@ -101,7 +98,7 @@ int main(int argc, char **argv) for (i = 0; i<1; i++) { - Z3950_search s = Z3950_search_create (); + Z3950_query q = Z3950_query_create (); char host[40]; printf ("session %2d", i+10); @@ -126,17 +123,16 @@ int main(int argc, char **argv) } Z3950_connection_destroy (z); - Z3950_options_set (o, "count", "1"); for (j = 0; j < 10; j++) { - Z3950_resultset_records (r[j], 0, 0); + Z3950_resultset_records (r[j], 0, 0, 1); if (block > 0) while (Z3950_event (1, &z)) ; } for (j = 0; j < 10; j++) Z3950_resultset_destroy (r[j]); - Z3950_search_destroy (s); + Z3950_query_destroy (q); printf ("10 searches, 10 ignored presents done\n"); } }