3 ZOOM_connection_errcode(c)
4 ZOOM_connection_errmsg(c)
5 ZOOM_connection_addinfo(c)
6 ZOOM_connection_addinfo(c)
7 ZOOM_connection_diagset(c);
8 ZOOM_connection_save_apdu_wrbuf
10 ZOOM_resultset_record_immediate(s, pos)
11 ZOOM_resultset_cache_reset(r)
12 ZOOM_resultset_sort(r, sort_type, sort_spec)
13 ZOOM_resultset_sort1(r, sort_type, sort_spec)
14 ZOOM_options_set_callback(opt, function, handle)
15 ZOOM_options_create_with_parent2(parent1, parent2)
16 ZOOM_options_getl(opt, name, len)
17 ZOOM_options_setl(opt, name, value, len)
18 ZOOM_options_get_bool(opt, name, defa)
19 ZOOM_options_get_int(opt, name, defa)
20 ZOOM_options_set_int(opt, name, value)
21 ZOOM_query_cql2rpn(ZOOM_query s, const char *str, ZOOM_connection conn)
23 <chapter id="zoom"><title>ZOOM</title>
25 &zoom; is an acronym for 'Z39.50 Object-Orientation Model' and is
26 an initiative started by Mike Taylor (Mike is from the UK, which
27 explains the peculiar name of the model). The goal of &zoom; is to
28 provide a common Z39.50 client API not bound to a particular
29 programming language or toolkit.
33 From YAZ version 2.1.12, <ulink url="&url.sru;">SRU</ulink> is supported.
34 You can make SRU ZOOM connections by specifying scheme
35 <literal>http://</literal> for the hostname for a connection.
36 The dialect of SRU used is specified by the value of the
37 connection's <literal>sru</literal> option, which may be SRU over
38 HTTP GET (<literal>get</literal>),
39 SRU over HTTP POST (<literal>post</literal>), (SRU over
40 SOAP) (<literal>soap</literal>) or <literal>SOLR</literal>
41 (<ulink url="&url.solr;">SOLR</ulink> Web Service).
42 Using the facility for embedding options in target strings, a
43 connection can be forced to use SRU rather the SRW (the default) by
44 prefixing the target string with <literal>sru=get,</literal>, like this:
45 <literal>sru=get,http://sru.miketaylor.org.uk:80/sru.pl</literal>
48 <ulink url="&url.solr;">SOLR</ulink> protocol support was added to
49 YAZ in version 4.1.0, as a dialect of a SRU protocol, since both are
53 The lack of a simple Z39.50 client API for &yaz; has become more
54 and more apparent over time. So when the first &zoom; specification
56 an implementation for &yaz; was quickly developed. For the first time, it is
57 now as easy (or easier!) to develop clients than servers with &yaz;. This
58 chapter describes the &zoom; C binding. Before going further, please
59 reconsider whether C is the right programming language for the job.
60 There are other language bindings available for &yaz;, and still
62 are in active development. See the
63 <ulink url="&url.zoom;">ZOOM web-site</ulink> for
68 In order to fully understand this chapter you should read and
69 try the example programs <literal>zoomtst1.c</literal>,
70 <literal>zoomtst2.c</literal>, .. in the <literal>zoom</literal>
75 The C language misses features found in object oriented languages
76 such as C++, Java, etc. For example, you'll have to manually,
77 destroy all objects you create, even though you may think of them as
78 temporary. Most objects has a <literal>_create</literal> - and a
79 <literal>_destroy</literal> variant.
80 All objects are in fact pointers to internal stuff, but you don't see
81 that because of typedefs. All destroy methods should gracefully ignore a
82 <literal>NULL</literal> pointer.
85 In each of the sections below you'll find a sub section called
86 protocol behavior, that describes how the API maps to the Z39.50
89 <sect1 id="zoom-connections"><title>Connections</title>
91 <para>The Connection object is a session with a target.
94 #include <yaz/zoom.h>
96 ZOOM_connection ZOOM_connection_new(const char *host, int portnum);
98 ZOOM_connection ZOOM_connection_create(ZOOM_options options);
100 void ZOOM_connection_connect(ZOOM_connection c, const char *host,
102 void ZOOM_connection_destroy(ZOOM_connection c);
105 Connection objects are created with either function
106 <function>ZOOM_connection_new</function> or
107 <function>ZOOM_connection_create</function>.
108 The former creates and automatically attempts to establish a network
109 connection with the target. The latter doesn't establish
110 a connection immediately, thus allowing you to specify options
111 before establishing network connection using the function
112 <function>ZOOM_connection_connect</function>.
113 If the port number, <literal>portnum</literal>, is zero, the
114 <literal>host</literal> is consulted for a port specification.
115 If no port is given, 210 is used. A colon denotes the beginning of
116 a port number in the host string. If the host string includes a
117 slash, the following part specifies a database for the connection.
120 You can prefix the host with a scheme followed by colon. The
121 default scheme is <literal>tcp</literal> (Z39.50 protocol).
122 The scheme <literal>http</literal> selects SRU/get over HTTP by default,
123 but can overridded to use SRU/post, SRW and the SOLR protocol.
126 You can prefix the scheme-qualified host-string with one or more
128 <literal><parameter>key</parameter>=<parameter>value</parameter></literal>
129 sequences, each of which represents an option to be set into the
130 connection structure <emphasis>before</emphasis> the
131 protocol-level connection is forged and the initialization
132 handshake takes place. This facility can be used to provide
133 authentication credentials, as in host-strings such as:
134 <literal>user=admin,password=halfAm4n,tcp:localhost:8017/db</literal>
137 Connection objects should be destroyed using the function
138 <function>ZOOM_connection_destroy</function>.
141 void ZOOM_connection_option_set(ZOOM_connection c,
142 const char *key, const char *val);
144 void ZOOM_connection_option_setl(ZOOM_connection c,
146 const char *val, int len);
148 const char *ZOOM_connection_option_get(ZOOM_connection c,
150 const char *ZOOM_connection_option_getl(ZOOM_connection c,
155 The functions <function>ZOOM_connection_option_set</function> and
156 <function>ZOOM_connection_option_setl</function> allows you to
157 set an option given by <parameter>key</parameter> to the value
158 <parameter>value</parameter> for the connection.
159 For <function>ZOOM_connection_option_set</function>, the
160 value is assumed to be a 0-terminated string. Function
161 <function>ZOOM_connection_option_setl</function> specifies a
162 value of a certain size (len).
165 Functions <function>ZOOM_connection_option_get</function> and
166 <function>ZOOM_connection_option_getl</function> returns
167 the value for an option given by <parameter>key</parameter>.
169 <table id="zoom-connection-options" frame="top">
170 <title>ZOOM Connection Options</title>
172 <colspec colwidth="4*" colname="name"></colspec>
173 <colspec colwidth="7*" colname="description"></colspec>
174 <colspec colwidth="3*" colname="default"></colspec>
177 <entry>Option</entry>
178 <entry>Description</entry>
179 <entry>Default</entry>
184 implementationName</entry><entry>Name of Your client
185 </entry><entry>none</entry></row>
187 user</entry><entry>Authentication user name
188 </entry><entry>none</entry></row>
190 group</entry><entry>Authentication group name
191 </entry><entry>none</entry></row>
193 password</entry><entry>Authentication password.
194 </entry><entry>none</entry></row>
196 host</entry><entry>Target host. This setting is "read-only".
197 It's automatically set internally when connecting to a target.
198 </entry><entry>none</entry></row>
200 proxy</entry><entry>Proxy host. If set, the logical host
201 is encoded in the otherInfo area of the Z39.50 Init PDU
202 with OID 1.2.840.10003.10.1000.81.1.
203 </entry><entry>none</entry></row>
205 clientIP</entry><entry>Client IP. If set, is
206 encoded in the otherInfo area of a Z39.50 PDU with OID
207 1.2.840.10003.10.1000.81.3. Holds the original IP addreses
208 of a client. Is used of ZOOM is used in a gateway of some sort.
209 </entry><entry>none</entry></row>
211 async</entry><entry>If true (1) the connection operates in
212 asynchronous operation which means that all calls are non-blocking
214 <link linkend="zoom.events"><function>ZOOM_event</function></link>.
215 </entry><entry>0</entry></row>
217 maximumRecordSize</entry><entry> Maximum size of single record.
218 </entry><entry>1 MB</entry></row>
220 preferredMessageSize</entry><entry> Maximum size of multiple records.
221 </entry><entry>1 MB</entry></row>
223 lang</entry><entry> Language for negotiation.
224 </entry><entry>none</entry></row>
226 charset</entry><entry> Character set for negotiation.
227 </entry><entry>none</entry></row>
229 serverImplementationId</entry><entry>
230 Implementation ID of server. (The old targetImplementationId
231 option is also supported for the benefit of old applications.)
232 </entry><entry>none</entry></row>
234 targetImplementationName</entry><entry>
235 Implementation Name of server. (The old
236 targetImplementationName option is also supported for the
237 benefit of old applications.)
238 </entry><entry>none</entry></row>
240 serverImplementationVersion</entry><entry>
241 Implementation Version of server. (the old
242 targetImplementationVersion option is also supported for the
243 benefit of old applications.)
244 </entry><entry>none</entry></row>
246 databaseName</entry><entry>One or more database names
247 separated by character plus (<literal>+</literal>), which to
248 be used by subsequent search requests on this Connection.
249 </entry><entry>Default</entry></row>
251 piggyback</entry><entry>True (1) if piggyback should be
252 used in searches; false (0) if not.
253 </entry><entry>1</entry></row>
255 smallSetUpperBound</entry><entry>If hits is less than or equal to this
256 value, then target will return all records using small element set name
257 </entry><entry>0</entry></row>
259 largeSetLowerBound</entry><entry>If hits is greater than this
260 value, the target will return no records.
261 </entry><entry>1</entry></row>
263 mediumSetPresentNumber</entry><entry>This value represents
264 the number of records to be returned as part of a search when when
265 hits is less than or equal to large set lower bound and if hits
266 is greater than small set upper bound.
267 </entry><entry>0</entry></row>
269 smallSetElementSetName</entry><entry>
270 The element set name to be used for small result sets.
271 </entry><entry>none</entry></row>
273 mediumSetElementSetName</entry><entry>
274 The element set name to be for medium-sized result sets.
275 </entry><entry>none</entry></row>
277 init_opt_search, init_opt_present, init_opt_delSet, etc.</entry><entry>
278 After a successful Init, these options may be interrogated to
279 discover whether the server claims to support the specified
281 </entry><entry>none</entry></row>
283 <entry>sru</entry><entry>
284 SRU/SOLR transport type. Must be either <literal>soap</literal>,
285 <literal>get</literal>, <literal>post</literal>, or
286 <literal>solr</literal>.
287 </entry><entry>soap</entry></row>
289 sru_version</entry><entry>
290 SRU/SRW version. Should be <literal>1.1</literal>, or
291 <literal>1.2</literal>. This is , prior to connect, the version
292 to offer (highest version). And following connect (in fact
293 first operation), holds the negotiated version with the server
294 (same or lower version).
295 </entry><entry>1.2</entry></row>
297 facets</entry><entry>
298 A FacetList is comma-separated list of facet, which is defined
299 as <literal>AttributeList</literal> and a optional FacetTerm
300 (a Term and a frequency). On request the terms is missing.
301 On response the the list contains the terms that the target
303 </entry><entry>none</entry></row>
305 apdulog</entry><entry>
306 If set to a true value such as "1", a log of low-level
307 protocol packets is emitted on standard error stream. This
308 can be very useful for debugging.
309 </entry><entry>0</entry></row>
311 saveAPDU</entry><entry>
312 If set to a true value such as "1", a log of low-level
313 protocol packets is saved. The log can be retrieved by reading
314 option APDU. Setting saveAPDU always has the side effect of
315 resetting the currently saved log. This setting is
316 <emphasis>write-only</emphasis>. If read, NULL will be returned.
317 It is only recognized in
318 <function>ZOOM_connection_option_set</function>.
319 </entry><entry>0</entry></row>
322 Returns the log of protocol packets. Will be empty if logging
323 is not enabled (see saveAPDU above). This setting is
324 <emphasis>read-only</emphasis>. It is only recognized if used
325 in call to <function>ZOOM_connection_option_get</function> or
326 <function>ZOOM_connection_option_getl</function>.
327 </entry><entry></entry></row>
332 If either option <literal>lang</literal> or <literal>charset</literal>
334 <ulink url="&url.z39.50.charneg;">
335 Character Set and Language Negotiation</ulink> is in effect.
338 int ZOOM_connection_error(ZOOM_connection c, const char **cp,
339 const char **addinfo);
340 int ZOOM_connection_error_x(ZOOM_connection c, const char **cp,
341 const char **addinfo, const char **dset);
344 Function <function>ZOOM_connection_error</function> checks for
345 errors for the last operation(s) performed. The function returns
346 zero if no errors occurred; non-zero otherwise indicating the error.
347 Pointers <parameter>cp</parameter> and <parameter>addinfo</parameter>
348 holds messages for the error and additional-info if passed as
349 non-<literal>NULL</literal>. Function
350 <function>ZOOM_connection_error_x</function> is an extended version
351 of <function>ZOOM_connection_error</function> that is capable of
352 returning name of diagnostic set in <parameter>dset</parameter>.
354 <sect2 id="zoom-connection-z39.50">
355 <title>Z39.50 Protocol behavior</title>
357 The calls <function>ZOOM_connection_new</function> and
358 <function>ZOOM_connection_connect</function> establishes a TCP/IP
359 connection and sends an Initialize Request to the target if
360 possible. In addition, the calls waits for an Initialize Response
361 from the target and the result is inspected (OK or rejected).
364 If <literal>proxy</literal> is set then the client will establish
365 a TCP/IP connection with the peer as specified by the
366 <literal>proxy</literal> host and the hostname as part of the
367 connect calls will be set as part of the Initialize Request.
368 The proxy server will then "forward" the PDU's transparently
369 to the target behind the proxy.
372 For the authentication parameters, if option <literal>user</literal>
373 is set and both options <literal>group</literal> and
374 <literal>pass</literal> are unset, then Open style
375 authentication is used (Version 2/3) in which case the username
376 is usually followed by a slash, then by a password.
377 If either <literal>group</literal>
378 or <literal>pass</literal> is set then idPass authentication
379 (Version 3 only) is used. If none of the options are set, no
380 authentication parameters are set as part of the Initialize Request
384 When option <literal>async</literal> is 1, it really means that
385 all network operations are postponed (and queued) until the
386 function <literal>ZOOM_event</literal> is invoked. When doing so
387 it doesn't make sense to check for errors after
388 <literal>ZOOM_connection_new</literal> is called since that
389 operation "connecting - and init" is still incomplete and the
390 API cannot tell the outcome (yet).
393 <sect2 id="zoom.sru.init.behavior">
394 <title>SRU/SOLR Protocol behavior</title>
396 The HTTP based protocols (SRU, SRW, SOLR) doesn't feature an Inititialize Request, so
397 the connection phase merely establishes a TCP/IP connection
398 with the SOAP service.
400 <para>Most of the ZOOM connection options do not
401 affect SRU/SOLR and they are ignored. However, future versions
402 of &yaz; might honor <literal>implementationName</literal> and
403 put that as part of User-Agent header for HTTP requests.
406 The <literal>charset</literal> is used in the Content-Type header
411 <sect1 id="zoom.query"><title>Queries</title>
413 Query objects represents queries.
416 ZOOM_query ZOOM_query_create(void);
418 void ZOOM_query_destroy(ZOOM_query q);
420 int ZOOM_query_prefix(ZOOM_query q, const char *str);
422 int ZOOM_query_cql(ZOOM_query s, const char *str);
424 int ZOOM_query_sortby(ZOOM_query q, const char *criteria);
427 Create query objects using <function>ZOOM_query_create</function>
428 and destroy them by calling <function>ZOOM_query_destroy</function>.
429 RPN-queries can be specified in <link linkend="PQF">PQF</link>
430 notation by using the
431 function <function>ZOOM_query_prefix</function>.
432 The <function>ZOOM_query_cql</function> specifies a CQL
433 query to be sent to the server/target.
434 More query types will be added in future versions of &yaz;, such as
435 <link linkend="CCL">CCL</link> to RPN-mapping, native CCL query,
436 etc. In addition to a search, a sort criteria may be set. Function
437 <function>ZOOM_query_sortby</function> specifies a
438 sort criteria using the same string notation for sort as offered by
439 the <link linkend="sortspec">YAZ client</link>.
441 <sect2 id="zoom.sort.behavior"><title>Protocol behavior</title>
443 The query object is just an interface for the member Query
444 in the SearchRequest. The sortby-function is an interface to the
445 sortSequence member of the SortRequest.
449 <sect1 id="zoom.resultsets"><title>Result sets</title>
451 The result set object is a container for records returned from
455 ZOOM_resultset ZOOM_connection_search(ZOOM_connection, ZOOM_query q);
457 ZOOM_resultset ZOOM_connection_search_pqf(ZOOM_connection c,
459 void ZOOM_resultset_destroy(ZOOM_resultset r);
462 Function <function>ZOOM_connection_search</function> creates
463 a result set given a connection and query.
464 Destroy a result set by calling
465 <function>ZOOM_resultset_destroy</function>.
466 Simple clients may using PQF only may use function
467 <function>ZOOM_connection_search_pqf</function> in which case
468 creating query objects is not necessary.
471 void ZOOM_resultset_option_set(ZOOM_resultset r,
472 const char *key, const char *val);
474 const char *ZOOM_resultset_option_get(ZOOM_resultset r, const char *key);
476 size_t ZOOM_resultset_size(ZOOM_resultset r);
479 Functions <function>ZOOM_resultset_options_set</function> and
480 <function>ZOOM_resultset_get</function> sets and gets an option
481 for a result set similar to <function>ZOOM_connection_option_get</function>
482 and <function>ZOOM_connection_option_set</function>.
485 The number of hits also called result-count is returned by
486 function <function>ZOOM_resultset_size</function>.
488 <table id="zoom.resultset.options"
489 frame="top"><title>ZOOM Result set Options</title>
491 <colspec colwidth="4*" colname="name"></colspec>
492 <colspec colwidth="7*" colname="description"></colspec>
493 <colspec colwidth="2*" colname="default"></colspec>
496 <entry>Option</entry>
497 <entry>Description</entry>
498 <entry>Default</entry>
503 start</entry><entry>Offset of first record to be
504 retrieved from target. First record has offset 0 unlike the
505 protocol specifications where first record has position 1.
506 This option affects ZOOM_resultset_search and
507 ZOOM_resultset_search_pqf and must be set before any of
508 these functions are invoked. If a range of
509 records must be fetched manually after search,
510 function ZOOM_resultset_records should be used.
511 </entry><entry>0</entry></row>
513 count</entry><entry>Number of records to be retrieved.
514 This option affects ZOOM_resultset_search and
515 ZOOM_resultset_search_pqf and must be set before any of
516 these functions are invoked.
517 </entry><entry>0</entry></row>
519 presentChunk</entry><entry>The number of records to be
520 requested from the server in each chunk (present request). The
521 value 0 means to request all the records in a single chunk.
522 (The old <literal>step</literal>
523 option is also supported for the benefit of old applications.)
524 </entry><entry>0</entry></row>
526 elementSetName</entry><entry>Element-Set name of records.
527 Most targets should honor element set name <literal>B</literal>
528 and <literal>F</literal> for brief and full respectively.
529 </entry><entry>none</entry></row>
531 preferredRecordSyntax</entry><entry>Preferred Syntax, such as
532 <literal>USMARC</literal>, <literal>SUTRS</literal>, etc.
533 </entry><entry>none</entry></row>
535 schema</entry><entry>Schema for retrieval, such as
536 <literal>Gils-schema</literal>, <literal>Geo-schema</literal>, etc.
537 </entry><entry>none</entry></row>
539 setname</entry><entry>Name of Result Set (Result Set ID).
540 If this option isn't set, the ZOOM module will automatically
541 allocate a result set name.
542 </entry><entry>default</entry></row>
544 rpnCharset</entry><entry>Character set for RPN terms.
545 If this is set, ZOOM C will assume that the ZOOM application is
546 running UTF-8. Terms in RPN queries are then converted to the
547 rpnCharset. If this is unset, ZOOM C will not assume any encoding
548 of RPN terms and no conversion is performed.
549 </entry><entry>none</entry></row>
554 For servers that support Search Info report, the following
555 options may be read using <function>ZOOM_resultset_get</function>.
556 This detailed information is read after a successful search has
560 This information is a list of of items, where each item is
561 information about a term or subquery. All items in the list
563 <literal>SearchResult.</literal><replaceable>no</replaceable>
564 where no presents the item number (0=first, 1=second).
565 Read <literal>searchresult.size</literal> to determine the
568 <table id="zoom.search.info.report.options"
569 frame="top"><title>Search Info Report Options</title>
571 <colspec colwidth="4*" colname="name"></colspec>
572 <colspec colwidth="7*" colname="description"></colspec>
575 <entry>Option</entry>
576 <entry>Description</entry>
581 <entry>searchresult.size</entry>
583 number of search result entries. This option is-nonexistant
584 if no entries are returned by the server.
588 <entry>searchresult.<replaceable>no</replaceable>.id</entry>
589 <entry>sub query ID</entry>
592 <entry>searchresult.<replaceable>no</replaceable>.count</entry>
593 <entry>result count for item (number of hits)</entry>
596 <entry>searchresult.<replaceable>no</replaceable>.subquery.term</entry>
597 <entry>subquery term</entry>
601 searchresult.<replaceable>no</replaceable>.interpretation.term
603 <entry>interpretation term</entry>
607 searchresult.<replaceable>no</replaceable>.recommendation.term
609 <entry>recommendation term</entry>
614 <sect2 id="zoom.z3950.resultset.behavior">
615 <title>Z39.50 Protocol behavior</title>
617 The creation of a result set involves at least a SearchRequest
618 - SearchResponse protocol handshake. Following that, if a sort
619 criteria was specified as part of the query, a SortRequest -
620 SortResponse handshake takes place. Note that it is necessary to
621 perform sorting before any retrieval takes place, so no records will
622 be returned from the target as part of the SearchResponse because these
623 would be unsorted. Hence, piggyback is disabled when sort criteria
624 are set. Following Search - and a possible sort - Retrieval takes
625 place - as one or more Present Requests/Response pairs being
629 The API allows for two different modes for retrieval. A high level
630 mode which is somewhat more powerful and a low level one.
631 The low level is enabled when searching on a Connection object
632 for which the settings
633 <literal>smallSetUpperBound</literal>,
634 <literal>mediumSetPresentNumber</literal> and
635 <literal>largeSetLowerBound</literal> are set. The low level mode
636 thus allows you to precisely set how records are returned as part
637 of a search response as offered by the Z39.50 protocol.
638 Since the client may be retrieving records as part of the
639 search response, this mode doesn't work well if sorting is used.
642 The high-level mode allows you to fetch a range of records from
643 the result set with a given start offset. When you use this mode
644 the client will automatically use piggyback if that is possible
645 with the target and perform one or more present requests as needed.
646 Even if the target returns fewer records as part of a present response
647 because of a record size limit, etc. the client will repeat sending
648 present requests. As an example, if option <literal>start</literal>
649 is 0 (default) and <literal>count</literal> is 4, and
650 <literal>piggyback</literal> is 1 (default) and no sorting criteria
651 is specified, then the client will attempt to retrieve the 4
652 records as part the search response (using piggyback). On the other
653 hand, if either <literal>start</literal> is positive or if
654 a sorting criteria is set, or if <literal>piggyback</literal>
655 is 0, then the client will not perform piggyback but send Present
659 If either of the options <literal>mediumSetElementSetName</literal> and
660 <literal>smallSetElementSetName</literal> are unset, the value
661 of option <literal>elementSetName</literal> is used for piggyback
662 searches. This means that for the high-level mode you only have
663 to specify one elementSetName option rather than three.
666 <sect2 id="zoom.sru.resultset.behavior">
667 <title>SRU Protocol behavior</title>
669 Current version of &yaz; does not take advantage of a result set id
670 returned by the SRU server. Future versions might do, however.
671 Since, the ZOOM driver does not save result set IDs any
672 present (retrieval) is transformed to a SRU SearchRetrieveRequest
673 with same query but, possibly, different offsets.
676 Option <literal>schema</literal> specifies SRU schema
677 for retrieval. However, options <literal>elementSetName</literal> and
678 <literal>preferredRecordSyntax</literal> are ignored.
681 Options <literal>start</literal> and <literal>count</literal>
682 are supported by SRU.
683 The remaining options
684 <literal>piggyback</literal>,
685 <literal>smallSetUpperBound</literal>,
686 <literal>largeSetLowerBound</literal>,
687 <literal>mediumSetPresentNumber</literal>,
688 <literal>mediumSetElementSetName</literal>,
689 <literal>smallSetElementSetName</literal> are
693 SRU supports CQL queries, <emphasis>not</emphasis> PQF.
694 If PQF is used, however, the PQF query is transferred anyway
695 using non-standard element <literal>pQuery</literal> in
696 SRU SearchRetrieveRequest.
699 SOLR queries has to be done in SOLR query format.
702 Unfortunately, SRU or SOLR does not define a database setting. Hence,
703 <literal>databaseName</literal> is unsupported and ignored.
704 However, the path part in host parameter for functions
705 <function>ZOOM_connecton_new</function> and
706 <function>ZOOM_connection_connect</function> acts as a
707 database (at least for the &yaz; SRU server).
711 <sect1 id="zoom.records"><title>Records</title>
713 A record object is a retrieval record on the client side -
714 created from result sets.
717 void ZOOM_resultset_records(ZOOM_resultset r,
719 size_t start, size_t count);
720 ZOOM_record ZOOM_resultset_record(ZOOM_resultset s, size_t pos);
722 const char *ZOOM_record_get(ZOOM_record rec, const char *type,
725 int ZOOM_record_error(ZOOM_record rec, const char **msg,
726 const char **addinfo, const char **diagset);
728 ZOOM_record ZOOM_record_clone(ZOOM_record rec);
730 void ZOOM_record_destroy(ZOOM_record rec);
733 References to temporary records are returned by functions
734 <function>ZOOM_resultset_records</function> or
735 <function>ZOOM_resultset_record</function>.
738 If a persistent reference to a record is desired
739 <function>ZOOM_record_clone</function> should be used.
740 It returns a record reference that should be destroyed
741 by a call to <function>ZOOM_record_destroy</function>.
744 A single record is returned by function
745 <function>ZOOM_resultset_record</function> that takes a
746 position as argument. First record has position zero.
747 If no record could be obtained <literal>NULL</literal> is returned.
750 Error information for a record can be checked with
751 <function>ZOOM_record_error</function> which returns non-zero
752 (error code) if record is in error, called <emphasis>Surrogate
753 Diagnostics</emphasis> in Z39.50.
756 Function <function>ZOOM_resultset_records</function> retrieves
757 a number of records from a result set. Parameter <literal>start</literal>
758 and <literal>count</literal> specifies the range of records to
759 be returned. Upon completion array
760 <literal>recs[0], ..recs[count-1]</literal>
761 holds record objects for the records. The array of records
762 <literal>recs</literal> should be allocated prior the call
763 <function>ZOOM_resultset_records</function>. Note that for those
764 records that couldn't be retrieved from the target
765 <literal>recs[ ..]</literal> is set to <literal>NULL</literal>.
767 <para id="zoom.record.get">
768 In order to extract information about a single record,
769 <function>ZOOM_record_get</function> is provided. The
770 function returns a pointer to certain record information. The
771 nature (type) of the pointer depends on the parameter,
772 <parameter>type</parameter>.
775 The <parameter>type</parameter> is a string of the format:
778 <replaceable>format</replaceable>[;charset=<replaceable>from</replaceable>[/<replaceable>opacfrom</replaceable>][,<replaceable>to</replaceable>]][;format=<replaceable>v</replaceable>]
781 where <replaceable>format</replaceable> specifies the format of the
782 returned record, <replaceable>from</replaceable>
783 specifies the character set of the record in its original form
784 (as returned by the server), <replaceable>to</replaceable> specifies
785 the output (returned)
786 character set encoding.
787 If <replaceable>to</replaceable> is omitted UTF-8 is assumed.
788 If charset is not given, then no character set conversion takes place.
791 <para>OPAC records may be returned in a different
792 set from the bibliographic MARC record. If this is this the case,
793 <replaceable>opacfrom</replaceable> should be set to the character set
794 of the OPAC record part.
798 Specifying the OPAC record character set requires YAZ 4.1.5 or later.
802 The format argument controls whether record data should be XML
803 pretty-printed (post process operation).
804 It is enabled only if format value <replaceable>v</replaceable> is
805 <literal>1</literal> and the record content is XML well-formed.
808 In addition, for certain types, the length
809 <literal>len</literal> passed will be set to the size in bytes of
810 the returned information.
813 The following are the supported values for <replaceable>form</replaceable>.
815 <varlistentry><term><literal>database</literal></term>
816 <listitem><para>Database of record is returned
817 as a C null-terminated string. Return type
818 <literal>const char *</literal>.
821 <varlistentry><term><literal>syntax</literal></term>
822 <listitem><para>The transfer syntax of the record is returned
823 as a C null-terminated string containing the symbolic name of
824 the record syntax, e.g. <literal>Usmarc</literal>. Return type
826 <literal>const char *</literal>.
829 <varlistentry><term><literal>schema</literal></term>
830 <listitem><para>The schema of the record is returned
831 as a C null-terminated string. Return type is
832 <literal>const char *</literal>.
835 <varlistentry><term><literal>render</literal></term>
836 <listitem><para>The record is returned in a display friendly
837 format. Upon completion buffer is returned
838 (type <literal>const char *</literal>) and length is stored in
839 <literal>*len</literal>.
842 <varlistentry><term><literal>raw</literal></term>
843 <listitem><para>The record is returned in the internal
844 YAZ specific format. For GRS-1, Explain, and others, the
845 raw data is returned as type
846 <literal>Z_External *</literal> which is just the type for
847 the member <literal>retrievalRecord</literal> in
848 type <literal>NamePlusRecord</literal>.
849 For SUTRS and octet aligned record (including all MARCs) the
850 octet buffer is returned and the length of the buffer.
853 <varlistentry><term><literal>xml</literal></term>
854 <listitem><para>The record is returned in XML if possible.
855 SRU, SOLR and Z39.50 records with transfer syntax XML are
856 returned verbatim. MARC records are returned in
857 <ulink url="&url.marcxml;">
860 (converted from ISO2709 to MARCXML by YAZ).
861 OPAC records are also converted to XML and the
862 bibliographic record is converted to MARCXML (when possible).
863 GRS-1 records are not supported for this form.
864 Upon completion, the XML buffer is returned
865 (type <literal>const char *</literal>) and length is stored in
866 <literal>*len</literal>.
869 <varlistentry><term><literal>opac</literal></term>
870 <listitem><para>OPAC information for record is returned in XML
871 if an OPAC record is present at the position given. If no
872 OPAC record is present, a NULL pointer is returned.
875 <varlistentry><term><literal>txml</literal></term>
876 <listitem><para>The record is returned in TurboMARC if possible.
877 SRU and Z39.50 records with transfer syntax XML are
878 returned verbatim. MARC records are returned in
879 <link linkend="tools.turbomarc">
882 (converted from ISO2709 to TurboMARC by YAZ).
883 Upon completion, the XML buffer is returned
884 (type <literal>const char *</literal>) and length is stored in
885 <literal>*len</literal>.
892 <ulink url="&url.marc21;">MARC21</ulink>
894 <ulink url="&url.marc8;">MARC-8</ulink>
895 character set encoding.
896 An application that wishes to display in Latin-1 would use
898 render; charset=marc8,iso-8859-1
901 <sect2 id="zoom.z3950.record.behavior">
902 <title>Z39.50 Protocol behavior</title>
904 The functions <function>ZOOM_resultset_record</function> and
905 <function>ZOOM_resultset_records</function> inspects the client-side
906 record cache. Records not found in cache are fetched using
908 The functions may block (and perform network I/O) - even though option
909 <literal>async</literal> is 1, because they return records objects.
910 (and there's no way to return records objects without retrieving them!).
913 There is a trick, however, in the usage of function
914 <function>ZOOM_resultset_records</function> that allows for
915 delayed retrieval (and makes it non-blocking). By using
916 a null pointer for <parameter>recs</parameter> you're indicating
917 you're not interested in getting records objects
918 <emphasis>now</emphasis>.
921 <sect2 id="zoom.sru.record.behavior">
922 <title>SRU/SOLR Protocol behavior</title>
924 The ZOOM driver for SRU/SOLR treats records returned by a SRU/SOLR server
925 as if they where Z39.50 records with transfer syntax XML and
926 no element set name or database name.
930 <sect1 id="zoom.facets"><title>Facets</title>
932 Facets operations is not part of the official ZOOM specification, but
933 is an Index Data extension for YAZ-based Z39.50 targets or
934 <ulink url="&url.solr;">SOLR</ulink> targets.
935 In case the target can and is requested to return facets, using a
936 result set the ZOOM client can request one or all facet fields.
937 Using a facet field the client can request the term count and then
938 interate over the terms.
941 ZOOM_facet_field *ZOOM_resultset_facets(ZOOM_resultset r);
943 const char ** ZOOM_resultset_facets_names(ZOOM_resultset r);
945 ZOOM_facet_field ZOOM_resultset_get_facet_field(ZOOM_resultset r,
946 const char *facet_name);
948 ZOOM_facet_field ZOOM_resultset_get_facet_field_by_index(ZOOM_resultset r,
951 size_t ZOOM_resultset_facets_size(ZOOM_resultset r);
953 const char *ZOOM_facet_field_name(ZOOM_facet_field facet_field);
955 size_t ZOOM_facet_field_term_count(ZOOM_facet_field facet_field);
957 const char *ZOOM_facet_field_get_term(ZOOM_facet_field facet_field,
958 size_t idx, int *freq);
961 References to temporary structures are returned by all functions.
962 They are only valid as long the Result set is valid.
963 <function>ZOOM_resultset_get_facet_field</function> or
964 <function>ZOOM_resultset_get_facet_field_by_index</function>.
965 <function>ZOOM_resultset_facets</function>.
966 <function>ZOOM_resultset_facets_names</function>.
967 <function>ZOOM_facet_field_name</function>.
968 <function>ZOOM_facet_field_get_term</function>.
970 <para id="zoom.resultset.get_facet_field">
971 A single Facet field is returned by function
972 <function>ZOOM_resultset_get_facet_field</function> or
973 <function>ZOOM_resultset_get_facet_field_by_index</function> that takes
974 a result set and facet name or positive index respectively. First
975 facet has position zero. If no facet could be obtained (invalid name
976 or index out of bounds) <literal>NULL</literal> is returned.
978 <para id="zoom.resultset.facets">
979 An array of facets field can be returned by
980 <function>ZOOM_resultset_facets</function>. The length of the array is
981 given by <function>ZOOM_resultset_facets_size</function>. The array is
982 zero-based and last entry will be at
983 <function>ZOOM_resultset_facets_size(result_set)</function>-1.
985 <para id="zoom.resultset.facets_names">
986 It is possible to interate over facets by name, by calling
987 <function>ZOOM_resultset_facets_names</function>.
988 This will return an const array of char * where each string can be used
989 as parameter for <function>ZOOM_resultset_get_facet_field</function>.
992 Function <function>ZOOM_facet_field_name</function> gets the request
993 facet name from a returned facet field.
996 Function <function>ZOOM_facet_field_get_term</function> returns the
997 idx'th term and term count for a facet field.
998 Idx must between 0 and
999 <function>ZOOM_facet_field_term_count</function>-1, otherwise the
1000 returned reference will be <literal>NULL</literal>. On a valid idx, the
1001 value of the freq reference will be the term count.
1002 The <literal>freq</literal> parameter must be valid pointer to integer.
1005 <sect1 id="zoom.scan"><title>Scan</title>
1007 This section describes an interface for Scan. Scan is not an
1008 official part of the ZOOM model yet. The result of a scan operation
1009 is the <literal>ZOOM_scanset</literal> which is a set of terms
1010 returned by a target.
1014 The Scan interface is supported for both Z39.50, SRU (and SOLR?).
1018 ZOOM_scanset ZOOM_connection_scan(ZOOM_connection c,
1019 const char *startpqf);
1021 ZOOM_scanset ZOOM_connection_scan1(ZOOM_connection c,
1024 size_t ZOOM_scanset_size(ZOOM_scanset scan);
1026 const char *ZOOM_scanset_term(ZOOM_scanset scan, size_t pos,
1027 size_t *occ, size_t *len);
1029 const char *ZOOM_scanset_display_term(ZOOM_scanset scan, size_t pos,
1030 size_t *occ, size_t *len);
1032 void ZOOM_scanset_destroy(ZOOM_scanset scan);
1034 const char *ZOOM_scanset_option_get(ZOOM_scanset scan,
1037 void ZOOM_scanset_option_set(ZOOM_scanset scan, const char *key,
1041 The scan set is created by function
1042 <function>ZOOM_connection_scan</function> which performs a scan
1043 operation on the connection using the specified
1044 <parameter>startpqf</parameter>.
1045 If the operation was successful, the size of the scan set can be
1046 retrieved by a call to <function>ZOOM_scanset_size</function>.
1047 Like result sets, the items are numbered 0,..size-1.
1048 To obtain information about a particular scan term, call function
1049 <function>ZOOM_scanset_term</function>. This function takes
1050 a scan set offset <literal>pos</literal> and returns a pointer
1051 to a <emphasis>raw term</emphasis> or <literal>NULL</literal> if
1053 If present, the <literal>occ</literal> and <literal>len</literal>
1054 are set to the number of occurrences and the length
1055 of the actual term respectively.
1056 <function>ZOOM_scanset_display_term</function> is similar to
1057 <function>ZOOM_scanset_term</function> except that it returns
1058 the <emphasis>display term</emphasis> rather than the raw term.
1059 In a few cases, the term is different from display term. Always
1060 use the display term for display and the raw term for subsequent
1061 scan operations (to get more terms, next scan result, etc).
1064 A scan set may be freed by a call to function
1065 <function>ZOOM_scanset_destroy</function>.
1066 Functions <function>ZOOM_scanset_option_get</function> and
1067 <function>ZOOM_scanset_option_set</function> retrieves and sets
1068 an option respectively.
1072 The <parameter>startpqf</parameter> is a subset of PQF, namely
1073 the Attributes+Term part. Multiple <literal>@attr</literal> can
1074 be used. For example to scan in title (complete) phrases:
1076 @attr 1=4 @attr 6=2 "science o"
1081 The <function>ZOOM_connecton_scan1</function> is a newer and
1082 more generic alternative to <function>ZOOM_connection_scan</function>
1083 which allows to use both CQL and PQF for Scan.
1086 <table frame="top" id="zoom.scanset.options">
1087 <title>ZOOM Scan Set Options</title>
1089 <colspec colwidth="4*" colname="name"></colspec>
1090 <colspec colwidth="7*" colname="description"></colspec>
1091 <colspec colwidth="2*" colname="default"></colspec>
1094 <entry>Option</entry>
1095 <entry>Description</entry>
1096 <entry>Default</entry>
1101 number</entry><entry>Number of Scan Terms requested in next scan.
1102 After scan it holds the actual number of terms returned.
1103 </entry><entry>20</entry></row>
1105 position</entry><entry>Preferred Position of term in response
1106 in next scan; actual position after completion of scan.
1107 </entry><entry>1</entry></row>
1109 stepSize</entry><entry>Step Size
1110 </entry><entry>0</entry></row>
1112 scanStatus</entry><entry>An integer indicating the Scan Status
1114 </entry><entry>0</entry></row>
1116 rpnCharset</entry><entry>Character set for RPN terms.
1117 If this is set, ZOOM C will assume that the ZOOM application is
1118 running UTF-8. Terms in RPN queries are then converted to the
1119 rpnCharset. If this is unset, ZOOM C will not assume any encoding
1120 of RPN terms and no conversion is performed.
1121 </entry><entry>none</entry></row>
1127 <sect1 id="zoom.extendedservices"><title>Extended Services</title>
1129 ZOOM offers an interface to a subset of the Z39.50 extended services
1130 as well as a few privately defined ones:
1135 Z39.50 Item Order (ILL).
1136 See <xref linkend="zoom.item.order"/>.
1141 Record Update. This allows a client to insert, modify or delete
1143 See <xref linkend="zoom.record.update"/>.
1148 Database Create. This a non-standard feature. Allows a client
1149 to create a database.
1150 See <xref linkend="zoom.database.create"/>.
1155 Database Drop. This a non-standard feature. Allows a client
1156 to delete/drop a database.
1157 See <xref linkend="zoom.database.drop"/>.
1162 Commit operation. This a non-standard feature. Allows a client
1163 to commit operations.
1164 See <xref linkend="zoom.commit"/>.
1167 <!-- all the ILL PDU options should go here too -->
1170 To create an extended service operation a <literal>ZOOM_package</literal>
1171 must be created. The operation is a five step operation. The
1172 package is created, package is configured by means of options,
1173 the package is send, result is inspected (by means of options),
1174 the package is destroyed.
1177 ZOOM_package ZOOM_connection_package(ZOOM_connection c,
1178 ZOOM_options options);
1180 const char *ZOOM_package_option_get(ZOOM_package p,
1182 void ZOOM_package_option_set(ZOOM_package p, const char *key,
1184 void ZOOM_package_send(ZOOM_package p, const char *type);
1186 void ZOOM_package_destroy(ZOOM_package p);
1189 The <function>ZOOM_connection_package</function> creates a
1190 package for the connection given using the options specified.
1193 Functions <function>ZOOM_package_option_get</function> and
1194 <function>ZOOM_package_option_set</function> gets and sets
1198 <function>ZOOM_package_send</function> sends
1199 the package the via connection specified in
1200 <function>ZOOM_connection_package</function>.
1201 The <parameter>type</parameter> specifies the actual extended service
1202 package type to be sent.
1205 <table frame="top" id="zoom.extendedservices.options">
1206 <title>Extended Service Common Options</title>
1208 <colspec colwidth="4*" colname="name"></colspec>
1209 <colspec colwidth="7*" colname="description"></colspec>
1210 <colspec colwidth="3*" colname="default"></colspec>
1213 <entry>Option</entry>
1214 <entry>Description</entry>
1215 <entry>Default</entry>
1220 <entry>package-name</entry>
1221 <entry>Extended Service Request package name. Must be specified
1222 as part of a request</entry>
1226 <entry>user-id</entry>
1227 <entry>User ID of Extended Service Package. Is a request option</entry>
1231 <entry>function</entry>
1233 Function of package - one of <literal>create</literal>,
1234 <literal>delete</literal>, <literal>modify</literal>. Is
1237 <entry><literal>create</literal></entry>
1240 <entry>waitAction</entry>
1242 Wait action for package. Possible values:
1243 <literal>wait</literal>, <literal>waitIfPossible</literal>,
1244 <literal>dontWait</literal> or <literal>dontReturnPackage</literal>.
1246 <entry><literal>waitIfPossible</literal></entry>
1249 <entry>targetReference</entry>
1251 Target Reference. This is part of the response as returned
1252 by the server. Read it after a successful operation.
1254 <entry><literal>none</literal></entry>
1260 <sect2 id="zoom.item.order"><title>Item Order</title>
1262 For Item Order, type must be set to <literal>itemorder</literal> in
1263 <function>ZOOM_package_send</function>.
1266 <table frame="top" id="zoom.item.order.options">
1267 <title>Item Order Options</title>
1269 <colspec colwidth="4*" colname="name"></colspec>
1270 <colspec colwidth="7*" colname="description"></colspec>
1271 <colspec colwidth="3*" colname="default"></colspec>
1274 <entry>Option</entry>
1275 <entry>Description</entry>
1276 <entry>Default</entry>
1281 <entry>contact-name</entry>
1282 <entry>ILL contact name</entry>
1286 <entry>contact-phone</entry>
1287 <entry>ILL contact phone</entry>
1291 <entry>contact-email</entry>
1292 <entry>ILL contact email</entry>
1296 <entry>itemorder-item</entry>
1297 <entry>Position for item (record) requested. An integer</entry>
1306 <sect2 id="zoom.record.update"><title>Record Update</title>
1308 For Record Update, type must be set to <literal>update</literal> in
1309 <function>ZOOM_package_send</function>.
1312 <table frame="top" id="zoom.record.update.options">
1313 <title>Record Update Options</title>
1315 <colspec colwidth="4*" colname="name"></colspec>
1316 <colspec colwidth="7*" colname="description"></colspec>
1317 <colspec colwidth="3*" colname="default"></colspec>
1320 <entry>Option</entry>
1321 <entry>Description</entry>
1322 <entry>Default</entry>
1327 <entry>action</entry>
1329 The update action. One of
1330 <literal>specialUpdate</literal>,
1331 <literal>recordInsert</literal>,
1332 <literal>recordReplace</literal>,
1333 <literal>recordDelete</literal>,
1334 <literal>elementUpdate</literal>.
1336 <entry><literal>specialUpdate (recordInsert for updateVersion=1 which does not support specialUpdate)</literal></entry>
1339 <entry>recordIdOpaque</entry>
1340 <entry>Opaque Record ID</entry>
1344 <entry>recordIdNumber</entry>
1345 <entry>Record ID number</entry>
1349 <entry>record</entry>
1350 <entry>The record itself</entry>
1354 <entry>recordOpaque</entry>
1355 <entry>Specifies an opaque record which is
1356 encoded as an ASN.1 ANY type with the OID as tiven by option
1357 <literal>syntax</literal> (see below).
1358 Option <literal>recordOpaque</literal> is an alternative
1359 to record - and <literal>record</literal> option (above) is
1360 ignored if recordOpaque is set. This option is only available in
1361 YAZ 3.0.35 and later and is meant to facilitate Updates with
1367 <entry>syntax</entry>
1368 <entry>The record syntax (transfer syntax). Is a string that
1369 is a known record syntax.
1371 <entry>no syntax</entry>
1374 <entry>databaseName</entry>
1375 <entry>Database from connection object</entry>
1376 <entry>Default</entry>
1379 <entry>correlationInfo.note</entry>
1380 <entry>Correlation Info Note (string)</entry>
1384 <entry>correlationInfo.id</entry>
1385 <entry>Correlation Info ID (integer)</entry>
1389 <entry>elementSetName</entry>
1390 <entry>Element Set for Record</entry>
1394 <entry>updateVersion</entry>
1395 <entry>Record Update version which holds one of the values
1396 1, 2 or 3. Each version has a distinct OID:
1398 (<ulink url="&url.z39.50.extupdate1;">first version</ulink>) ,
1400 (second version) and
1401 1.2.840.10003.9.5.1.1
1402 (<ulink url="&url.z39.50.extupdate3;">third and
1403 newest version</ulink>).
1413 <sect2 id="zoom.database.create"><title>Database Create</title>
1415 For Database Create, type must be set to <literal>create</literal> in
1416 <function>ZOOM_package_send</function>.
1419 <table frame="top" id="zoom.database.create.options">
1420 <title>Database Create Options</title>
1422 <colspec colwidth="4*" colname="name"></colspec>
1423 <colspec colwidth="7*" colname="description"></colspec>
1424 <colspec colwidth="3*" colname="default"></colspec>
1427 <entry>Option</entry>
1428 <entry>Description</entry>
1429 <entry>Default</entry>
1434 <entry>databaseName</entry>
1435 <entry>Database from connection object</entry>
1436 <entry>Default</entry>
1443 <sect2 id="zoom.database.drop"><title>Database Drop</title>
1445 For Database Drop, type must be set to <literal>drop</literal> in
1446 <function>ZOOM_package_send</function>.
1449 <table frame="top" id="zoom.database.drop.options">
1450 <title>Database Drop Options</title>
1452 <colspec colwidth="4*" colname="name"></colspec>
1453 <colspec colwidth="7*" colname="description"></colspec>
1454 <colspec colwidth="3*" colname="default"></colspec>
1457 <entry>Option</entry>
1458 <entry>Description</entry>
1459 <entry>Default</entry>
1464 <entry>databaseName</entry>
1465 <entry>Database from connection object</entry>
1466 <entry>Default</entry>
1473 <sect2 id="zoom.commit"><title>Commit Operation</title>
1475 For Commit, type must be set to <literal>commit</literal> in
1476 <function>ZOOM_package_send</function>.
1480 <sect2 id="zoom.extended.services.behavior">
1481 <title>Protocol behavior</title>
1483 All the extended services are Z39.50-only.
1487 The database create, drop and commit services are privately defined
1489 Refer to <filename>esadmin.asn</filename> in YAZ for the ASN.1
1496 <sect1 id="zoom.options"><title>Options</title>
1498 Most &zoom; objects provide a way to specify options to change behavior.
1499 From an implementation point of view a set of options is just like
1500 an associative array / hash.
1503 ZOOM_options ZOOM_options_create(void);
1505 ZOOM_options ZOOM_options_create_with_parent(ZOOM_options parent);
1507 void ZOOM_options_destroy(ZOOM_options opt);
1510 const char *ZOOM_options_get(ZOOM_options opt, const char *name);
1512 void ZOOM_options_set(ZOOM_options opt, const char *name,
1516 typedef const char *(*ZOOM_options_callback)
1517 (void *handle, const char *name);
1519 ZOOM_options_callback
1520 ZOOM_options_set_callback(ZOOM_options opt,
1521 ZOOM_options_callback c,
1525 <sect1 id="zoom.events"><title>Events</title>
1527 If you're developing non-blocking applications, you have to deal
1531 int ZOOM_event(int no, ZOOM_connection *cs);
1534 The <function>ZOOM_event</function> executes pending events for
1535 a number of connections. Supply the number of connections in
1536 <literal>no</literal> and an array of connections in
1537 <literal>cs</literal> (<literal>cs[0] ... cs[no-1]</literal>).
1538 A pending event could be a sending a search, receiving a response,
1540 When an event has occurred for one of the connections, this function
1541 returns a positive integer <literal>n</literal> denoting that an event
1542 occurred for connection <literal>cs[n-1]</literal>.
1543 When no events are pending for the connections, a value of zero is
1545 To ensure that all outstanding requests are performed call this function
1546 repeatedly until zero is returned.
1549 If <function>ZOOM_event</function> returns and returns non-zero, the
1550 last event that occurred can be expected.
1553 int ZOOM_connection_last_event(ZOOM_connection cs);
1556 <function>ZOOM_connection_last_event</function> returns an event type
1557 (integer) for the last event.
1560 <table frame="top" id="zoom.event.ids">
1561 <title>ZOOM Event IDs</title>
1563 <colspec colwidth="4*" colname="name"></colspec>
1564 <colspec colwidth="7*" colname="description"></colspec>
1567 <entry>Event</entry>
1568 <entry>Description</entry>
1573 <entry>ZOOM_EVENT_NONE</entry>
1574 <entry>No event has occurred</entry>
1577 <entry>ZOOM_EVENT_CONNECT</entry>
1578 <entry>TCP/IP connect has initiated</entry>
1581 <entry>ZOOM_EVENT_SEND_DATA</entry>
1582 <entry>Data has been transmitted (sending)</entry>
1585 <entry>ZOOM_EVENT_RECV_DATA</entry>
1586 <entry>Data has been received)</entry>
1589 <entry>ZOOM_EVENT_TIMEOUT</entry>
1590 <entry>Timeout</entry>
1593 <entry>ZOOM_EVENT_UNKNOWN</entry>
1594 <entry>Unknown event</entry>
1597 <entry>ZOOM_EVENT_SEND_APDU</entry>
1598 <entry>An APDU has been transmitted (sending)</entry>
1601 <entry>ZOOM_EVENT_RECV_APDU</entry>
1602 <entry>An APDU has been received</entry>
1605 <entry>ZOOM_EVENT_RECV_RECORD</entry>
1606 <entry>A result-set record has been received</entry>
1609 <entry>ZOOM_EVENT_RECV_SEARCH</entry>
1610 <entry>A search result been received</entry>
1618 <!-- Keep this comment at the end of the file
1623 sgml-minimize-attributes:nil
1624 sgml-always-quote-attributes:t
1627 sgml-parent-document: "yaz.xml"
1628 sgml-local-catalogs: nil
1629 sgml-namecase-general:t