1 <!-- $Id: zoom.xml,v 1.30 2003-06-04 09:15:40 adam Exp $ -->
2 <chapter id="zoom"><title>ZOOM</title>
4 &zoom; is an acronym for 'Z39.50 Object-Orientation Model' and is
5 an initiative started by Mike Taylor (Mike is from the UK, which
6 explains the peculiar name of the model). The goal of &zoom; is to
7 provide a common Z39.50 client API not bound to a particular
8 programming language or toolkit.
13 A recent addition to &yaz; is SRW support. You can now make
14 SRW ZOOM connections by specifying scheme <literal>http://</literal>
15 for the hostname for a connection.
20 The lack of a simple Z39.50 client API for &yaz; has become more
21 and more apparent over time. So when the first &zoom; specification
23 an implementation for &yaz; was quickly developed. For the first time, it is
24 now as easy (or easier!) to develop clients than servers with &yaz;. This
25 chapter describes the &zoom; C binding. Before going further, please
26 reconsider whether C is the right programming language for the job.
27 There are other language bindings available for &yaz;, and still
29 are in active development. See the
30 <ulink url="http://zoom.z3950.org/">ZOOM web-site</ulink> for
35 In order to fully understand this chapter you should read and
36 try the example programs <literal>zoomtst1.c</literal>,
37 <literal>zoomtst2.c</literal>, .. in the <literal>zoom</literal>
42 The C language misses features found in object oriented languages
43 such as C++, Java, etc. For example, you'll have to manually,
44 destroy all objects you create, even though you may think of them as
45 temporary. Most objects has a <literal>_create</literal> - and a
46 <literal>_destroy</literal> variant.
47 All objects are in fact pointers to internal stuff, but you don't see
48 that because of typedefs. All destroy methods should gracefully ignore a
49 <literal>NULL</literal> pointer.
52 In each of the sections below you'll find a sub section called
53 protocol behavior, that describes how the API maps to the Z39.50
56 <sect1 id="zoom.connections"><title>Connections</title>
58 <para>The Connection object is a session with a target.
61 #include <yaz/zoom.h>
63 ZOOM_connection ZOOM_connection_new (const char *host, int portnum);
65 ZOOM_connection ZOOM_connection_create (ZOOM_options options);
67 void ZOOM_connection_connect(ZOOM_connection c, const char *host,
69 void ZOOM_connection_destroy (ZOOM_connection c);
72 Connection objects are created with either function
73 <function>ZOOM_connection_new</function> or
74 <function>ZOOM_connection_create</function>.
75 The former creates and automatically attempts to establish a network
76 connection with the target. The latter doesn't establish
77 a connection immediately, thus allowing you to specify options
78 before establishing network connection using the function
79 <function>ZOOM_connection_connect</function>.
80 If the port number, <literal>portnum</literal>, is zero, the
81 <literal>host</literal> is consulted for a port specification.
82 If no port is given, 210 is used. A colon denotes the beginning of
83 a port number in the host string. If the host string includes a
84 slash, the following part specifies a database for the connection.
87 You can prefix the host with a scheme followed by colon. The
88 default scheme is <literal>tcp</literal> (Z39.50 protocol).
89 The scheme <literal>http</literal> selects SRW over HTTP.
92 Connection objects should be destroyed using the function
93 <function>ZOOM_connection_destroy</function>.
96 void ZOOM_connection_option_set (ZOOM_connection c,
100 const char *ZOOM_connection_option_get (ZOOM_connection c,
104 The <function>ZOOM_connection_option_set</function> allows you to
105 set an option given by <parameter>key</parameter> to the value
106 <parameter>value</parameter> for the connection.
107 Function <function>ZOOM_connection_option_get</function> returns
108 the value for an option given by <parameter>key</parameter>.
110 <table frame="top"><title>ZOOM Connection Options</title>
112 <colspec colwidth="4*" colname="name"></colspec>
113 <colspec colwidth="7*" colname="description"></colspec>
114 <colspec colwidth="3*" colname="default"></colspec>
117 <entry>Option</entry>
118 <entry>Description</entry>
119 <entry>Default</entry>
124 implementationName</entry><entry>Name of Your client
125 </entry><entry>none</entry></row>
127 user</entry><entry>Authentication user name
128 </entry><entry>none</entry></row>
130 group</entry><entry>Authentication group name
131 </entry><entry>none</entry></row>
133 pass</entry><entry>Authentication password
134 </entry><entry>none</entry></row>
136 host</entry><entry>Target host. This setting is "read-only".
137 It's automatically set internally when connecting to a target.
138 </entry><entry>none</entry></row>
140 proxy</entry><entry>Proxy host
141 </entry><entry>none</entry></row>
143 async</entry><entry>If true (1) the connection operates in
144 asynchronous operation which means that all calls are non-blocking
146 <link linkend="zoom.events"><function>ZOOM_event</function></link>.
147 </entry><entry>0</entry></row>
149 maximumRecordSize</entry><entry> Maximum size of single record.
150 </entry><entry>1 MB</entry></row>
152 preferredMessageSize</entry><entry> Maximum size of multiple records.
153 </entry><entry>1 MB</entry></row>
155 lang</entry><entry> Language for negotiation.
156 </entry><entry>none</entry></row>
158 charset</entry><entry> Character set for negotiation.
159 </entry><entry>none</entry></row>
161 targetImplementationId</entry><entry> Implementation ID of target.
162 </entry><entry>none</entry></row>
164 targetImplementationName</entry><entry> Implementation Name of target.
165 </entry><entry>none</entry></row>
167 targetImplementationVersion</entry><entry> Implementation Version
169 </entry><entry>none</entry></row>
171 databaseName</entry><entry>One or more database names
172 separated by character plus (<literal>+</literal>), which to
173 be used by subsequent search requests on this Connection.
174 </entry><entry>Default</entry></row>
179 If either option <literal>lang</literal> or <literal>charset</literal>
181 <ulink url="http://lcweb.loc.gov/z3950/agency/defns/charneg-3.html">
182 Character Set and Language Negotiation</ulink> is in effect.
185 int ZOOM_connection_error (ZOOM_connection c, const char **cp,
186 const char **addinfo);
187 int ZOOM_connection_error_x (ZOOM_connection c, const char **cp,
188 const char **addinfo, const char **dset);
191 Function <function>ZOOM_connection_error</function> checks for
192 errors for the last operation(s) performed. The function returns
193 zero if no errors occurred; non-zero otherwise indicating the error.
194 Pointers <parameter>cp</parameter> and <parameter>addinfo</parameter>
195 holds messages for the error and additional-info if passed as
196 non-<literal>NULL</literal>. Function
197 <function>ZOOM_connection_error_x</function> is an extended version
198 of <function>ZOOM_connection_error</function> that is capable of
199 returning name of diagnostic set in <parameter>dset</parameter>.
201 <sect2><title>Z39.50 Protocol behavior</title>
203 The calls <function>ZOOM_connection_new</function> and
204 <function>ZOOM_connection_connect</function> establishes a TCP/IP
205 connection and sends an Initialize Request to the target if
206 possible. In addition, the calls waits for an Initialize Response
207 from the target and the result is inspected (OK or rejected).
210 If <literal>proxy</literal> is set then the client will establish
211 a TCP/IP connection with the peer as specified by the
212 <literal>proxy</literal> host and the hostname as part of the
213 connect calls will be set as part of the Initialize Request.
214 The proxy server will then "forward" the PDU's transparently
215 to the target behind the proxy.
218 For the authentication parameters, if option <literal>user</literal>
219 is set and both options <literal>group</literal> and
220 <literal>pass</literal> are unset, then Open style
221 authentication is used (Version 2/3) in which case the username
222 is usually followed by a slash, then by a password.
223 If either <literal>group</literal>
224 or <literal>pass</literal> is set then idPass authentication
225 (Version 3 only) is used. If none of the options are set, no
226 authentication parameters are set as part of the Initialize Request
230 When option <literal>async</literal> is 1, it really means that
231 all network operations are postponed (and queued) until the
232 function <literal>ZOOM_event</literal> is invoked. When doing so
233 it doesn't make sense to check for errors after
234 <literal>ZOOM_connection_new</literal> is called since that
235 operation "connecting - and init" is still incomplete and the
236 API cannot tell the outcome (yet).
239 <sect2><title>SRW Protocol behavior</title>
241 The SRW protocol doesn't feature an Inititialize Request, so
242 the connection phase merely establishes a TCP/IP connection
243 with the SOAP service.
245 <para>Most of the ZOOM connection options do not
246 affect SRW and they are ignored. However, future versions
247 of &yaz; might honor <literal>implementationName</literal> and
248 put that as part of User-Agent header for HTTP requests.
251 The <literal>charset</literal> is used in the Content-Type header
256 <sect1 id="zoom.query"><title>Queries</title>
258 Query objects represents queries.
261 ZOOM_query ZOOM_query_create(void);
263 void ZOOM_query_destroy(ZOOM_query q);
265 int ZOOM_query_prefix(ZOOM_query q, const char *str);
267 int ZOOM_query_cql(ZOOM_query s, const char *str);
269 int ZOOM_query_sortby(ZOOM_query q, const char *criteria);
272 Create query objects using <function>ZOOM_query_create</function>
273 and destroy them by calling <function>ZOOM_query_destroy</function>.
274 RPN-queries can be specified in <link linkend="PQF">PQF</link>
275 notation by using the
276 function <function>ZOOM_query_prefix</function>.
277 The <function>ZOOM_query_cql</function> specifies a CQL
278 query to be sent to the server/target.
279 More query types will be added in future versions of &yaz;, such as
280 <link linkend="CCL">CCL</link> to RPN-mapping, native CCL query,
281 etc. In addition to a search, a sort criteria may be set. Function
282 <function>ZOOM_query_sortby</function> specifies a
283 sort criteria using the same string notation for sort as offered by
284 the <link linkend="sortspec">YAZ client</link>.
286 <sect2><title>Protocol behavior</title>
288 The query object is just an interface for the member Query
289 in the SearchRequest. The sortby-function is an interface to the
290 sortSequence member of the SortRequest.
294 <sect1 id="zoom.resultsets"><title>Result sets</title>
296 The result set object is a container for records returned from
300 ZOOM_resultset ZOOM_connection_search(ZOOM_connection,
303 ZOOM_resultset ZOOM_connection_search_pqf(ZOOM_connection c,
306 void ZOOM_resultset_destroy(ZOOM_resultset r);
309 Function <function>ZOOM_connection_search</function> creates
310 a result set given a connection and query.
311 Destroy a result set by calling
312 <function>ZOOM_resultset_destroy</function>.
313 Simple clients may using PQF only may use function
314 <function>ZOOM_connection_search_pqf</function> in which case
315 creating query objects is not necessary.
318 void ZOOM_resultset_option_set (ZOOM_resultset r,
322 const char *ZOOM_resultset_option_get (ZOOM_resultset r,
325 size_t ZOOM_resultset_size (ZOOM_resultset r);
328 Functions <function>ZOOM_resultset_options_set</function> and
329 <function>ZOOM_resultset_get</function> sets and gets an option
330 for a result set similar to <function>ZOOM_connection_option_get</function>
331 and <function>ZOOM_connection_option_set</function>.
334 The number of hits also called result-count is returned by
335 function <function>ZOOM_resultset_size</function>.
337 <table frame="top"><title>ZOOM Result set Options</title>
339 <colspec colwidth="4*" colname="name"></colspec>
340 <colspec colwidth="7*" colname="description"></colspec>
341 <colspec colwidth="2*" colname="default"></colspec>
344 <entry>Option</entry>
345 <entry>Description</entry>
346 <entry>Default</entry>
351 piggyback</entry><entry>True (1) if piggyback should be
352 used in searches; false (0) if not.
353 </entry><entry>1</entry></row>
355 start</entry><entry>Offset of first record to be
356 retrieved from target. First record has offset 0 unlike the
357 protocol specifications where first record has position 1.
358 </entry><entry>0</entry></row>
360 count</entry><entry>Number of records to be retrieved.
361 </entry><entry>0</entry></row>
363 step</entry><entry>Number of records to be retrieved in
364 one chunk. The value, 0 means unchunked.
365 </entry><entry>0</entry></row>
367 elementSetName</entry><entry>Element-Set name of records.
368 Most targets should honor element set name <literal>B</literal>
369 and <literal>F</literal> for brief and full respectively.
370 </entry><entry>none</entry></row>
372 preferredRecordSyntax</entry><entry>Preferred Syntax, such as
373 <literal>USMARC</literal>, <literal>SUTRS</literal>, etc.
374 </entry><entry>none</entry></row>
376 schema</entry><entry>Schema for retrieval, such as
377 <literal>Gils-schema</literal>, <literal>Geo-schema</literal>, etc.
378 </entry><entry>none</entry></row>
380 smallSetUpperBound</entry><entry>If hits is less than or equal to this
381 value, then target will return all records using small element set name
382 </entry><entry>0</entry></row>
384 largeSetLowerBound</entry><entry>If hits is greater than this
385 value, the target will return no records.
386 </entry><entry>1</entry></row>
388 mediumSetPresentNumber</entry><entry>This value represents
389 the number of records to be returned as part of a search when when
390 hits is less than or equal to large set lower bound and if hits
391 is greater than small set upper bound.
392 </entry><entry>0</entry></row>
394 smallSetElementSetName</entry><entry>
395 The element set name to be used for small result sets.
396 </entry><entry>none</entry></row>
398 mediumSetElementSetName</entry><entry>
399 The element set name to be for medium-sized result sets.
400 </entry><entry>none</entry></row>
402 setname</entry><entry>Name of Result Set (Result Set ID).
403 If this option isn't set, the ZOOM module will automatically
404 allocate a result set name.
405 </entry><entry>default</entry></row>
410 <title>Z39.50 Protocol behavior</title>
412 The creation of a result set involves at least a SearchRequest
413 - SearchResponse protocol handshake. Following that, if a sort
414 criteria was specified as part of the query, a SortRequest -
415 SortResponse handshake takes place. Note that it is necessary to
416 perform sorting before any retrieval takes place, so no records will
417 be returned from the target as part of the SearchResponse because these
418 would be unsorted. Hence, piggyback is disabled when sort criteria
419 is set. Following Search - and a Possible sort, Retrieval takes
420 place - as one or more Present Requests - Present Response being
424 The API allows for two different modes for retrieval. A high level
425 mode which is somewhat more powerful and a low level one.
426 The low level is "enabled" when the settings
427 <literal>smallSetUpperBound</literal>,
428 <literal>mediumSetPresentNumber</literal> and
429 <literal>largeSetLowerBound</literal> are set. The low level mode
430 thus allows you to precisely set how records are returned as part
431 of a search response as offered by the Z39.50 protocol.
432 Since the client may be retrieving records as part of the
433 search response, this mode doesn't work well if sorting is used.
436 The high-level mode allows you to fetch a range of records from
437 the result set with a given start offset. When you use this mode
438 the client will automatically use piggyback if that is possible
439 with the target and perform one or more present requests as needed.
440 Even if the target returns fewer records as part of a present response
441 because of a record size limit, etc. the client will repeat sending
442 present requests. As an example, if option <literal>start</literal>
443 is 0 (default) and <literal>count</literal> is 4, and
444 <literal>piggyback</literal> is 1 (default) and no sorting criteria
445 is specified, then the client will attempt to retrieve the 4
446 records as part the search response (using piggyback). On the other
447 hand, if either <literal>start</literal> is positive or if
448 a sorting criteria is set, or if <literal>piggyback</literal>
449 is 0, then the client will not perform piggyback but send Present
453 If either of the options <literal>mediumSetElementSetName</literal> and
454 <literal>smallSetElementSetName</literal> are unset, the value
455 of option <literal>elementSetName</literal> is used for piggyback
456 searches. This means that for the high-level mode you only have
457 to specify one elementSetName option rather than three.
461 <title>SRW Protocol behavior</title>
463 Current version of &yaz; does not take advantage of a result set id
464 returned by the SRW server. Future versions might do, however.
465 Since, the ZOOM driver does not save result set IDs any
466 present (retrieval) is transformed to a SRW SearchRetrieveRequest
467 with same query but, possibly, different offsets.
470 Option <literal>schema</literal> specifies SRW schema
471 for retrieval. However, options <literal>elementSetName</literal> and
472 <literal>preferredRecordSyntax</literal> are ignored.
475 Options <literal>start</literal> and <literal>count</literal>
476 are supported by SRW.
477 The remaining options
478 <literal>piggyback</literal>,
479 <literal>smallSetUpperBound</literal>,
480 <literal>largeSetLowerBound</literal>,
481 <literal>mediumSetPresentNumber</literal>,
482 <literal>mediumSetElementSetName</literal>,
483 <literal>smallSetElementSetName</literal> are
487 SRW supports CQL queries, <emphasis>not</emphasis> PQF.
488 If PQF is used, however, the PQF query is transferred anyway
489 using non-standard element <literal>pQuery</literal> in
490 SRW SearchRetrieveRequest.
493 Unfortunately, SRW does not define a database setting. Hence,
494 <literal>databaseName</literal> is unsupported and ignored.
495 However, the path part in host parameter for functions
496 <function>ZOOM_connecton_new</function> and
497 <function>ZOOM_connection_connect</function> acts as a
498 database (at least for the &yaz; SRW server).
502 <sect1 id="zoom.records"><title>Records</title>
504 A record object is a retrieval record on the client side -
505 created from result sets.
508 void ZOOM_resultset_records (ZOOM_resultset r,
510 size_t start, size_t count);
511 ZOOM_record ZOOM_resultset_record (ZOOM_resultset s, size_t pos);
513 const char *ZOOM_record_get (ZOOM_record rec, const char *type,
516 ZOOM_record ZOOM_record_clone (ZOOM_record rec);
518 void ZOOM_record_destroy (ZOOM_record rec);
521 References to temporary records are returned by functions
522 <function>ZOOM_resultset_records</function> or
523 <function>ZOOM_resultset_record</function>.
526 If a persistent reference to a record is desired
527 <function>ZOOM_record_clone</function> should be used.
528 It returns a record reference that should be destroyed
529 by a call to <function>ZOOM_record_destroy</function>.
532 A single record is returned by function
533 <function>ZOOM_resultset_record</function> that takes a
534 position as argument. First record has position zero.
535 If no record could be obtained <literal>NULL</literal> is returned.
538 Function <function>ZOOM_resultset_records</function> retrieves
539 a number of records from a result set. Parameter <literal>start</literal>
540 and <literal>count</literal> specifies the range of records to
541 be returned. Upon completion array
542 <literal>recs[0], ..recs[count-1]</literal>
543 holds record objects for the records. The array of records
544 <literal>recs</literal> should be allocated prior the call
545 <function>ZOOM_resultset_records</function>. Note that for those
546 records that couldn't be retrieved from the target
547 <literal>recs[ ..]</literal> is set to <literal>NULL</literal>.
549 <para id="zoom.record.get">
550 In order to extract information about a single record,
551 <function>ZOOM_record_get</function> is provided. The
552 function returns a pointer to certain record information. The
553 nature (type) of the pointer depends on the parameter,
554 <parameter>type</parameter>.
557 The <parameter>type</parameter> is a string of the format:
560 <replaceable>form</replaceable>[; charset=<replaceable>from</replaceable>[,<replaceable>to</replaceable>]]
563 where <replaceable>form</replaceable> specifies the format of the
564 returned record, <replaceable>from</replaceable>
565 specifies the character set of the record in its original form
566 (as returned by the server), <replaceable>to</replaceable> specifies
567 the output (returned)
568 character set encoding.
569 If charset is not given, then no character set conversion takes place.
570 If <replaceable>to</replaceable> is omitted UTF-8 is assumed.
573 In addition, for certain types, the length
574 <literal>len</literal> passed will be set to the size in bytes of
575 the returned information.
578 The following are the supported values for <replaceable>form</replaceable>.
580 <varlistentry><term><literal>database</literal></term>
581 <listitem><para>Database of record is returned
582 as a C null-terminated string. Return type
583 <literal>const char *</literal>.
586 <varlistentry><term><literal>syntax</literal></term>
587 <listitem><para>The transfer syntax (OID) of the record is returned
588 as a C null-terminated string. Return type is
589 <literal>const char *</literal>.
592 <varlistentry><term><literal>render</literal></term>
593 <listitem><para>The record is returned in a display friendly
594 format. Upon completion buffer is returned
595 (type <literal>const char *</literal>) and length is stored in
596 <literal>*len</literal>.
599 <varlistentry><term><literal>raw</literal></term>
600 <listitem><para>The record is returned in the internal
601 YAZ specific format. For GRS-1, Explain, and others, the
602 raw data is returned as type
603 <literal>Z_External *</literal> which is just the type for
604 the member <literal>retrievalRecord</literal> in
605 type <literal>NamePlusRecord</literal>.
606 For SUTRS and octet aligned record (including all MARCs) the
607 octet buffer is returned and the length of the buffer.
610 <varlistentry><term><literal>xml</literal></term>
611 <listitem><para>The record is returned in XML if possible.
612 SRW/SRU and Z39.50 records with transfer syntax XML are
613 returned verbatim. MARC records are returned in
614 <ulink url="http://www.loc.gov/standards/marcxml/">
617 (converted from ISO2709 to MARCXML by YAZ).
618 GRS-1 and OPAC records are not supported for this form.
619 Upon completion, the XML buffer is returned
620 (type <literal>const char *</literal>) and length is stored in
621 <literal>*len</literal>.
628 <ulink url="http://www.loc.gov/marc/">
632 <ulink url="http://www.loc.gov/marc/specifications/speccharmarc8.html">
635 character set encoding.
636 An application that wishes to display in Latin-1 would use
638 render; charset=marc8,iso-8859-1
641 <sect2><title>Z39.50 Protocol behavior</title>
643 The functions <function>ZOOM_resultset_record</function> and
644 <function>ZOOM_resultset_records</function> inspects the client-side
645 record cache. Records not found in cache are fetched using
647 The functions may block (and perform network I/O) - even though option
648 <literal>async</literal> is 1, because they return records objects.
649 (and there's no way to return records objects without retrieving them!).
652 There is a trick, however, in the usage of function
653 <function>ZOOM_resultset_records</function> that allows for
654 delayed retrieval (and makes it non-blocking). By using
655 a null pointer for <parameter>recs</parameter> you're indicating
656 you're not interested in getting records objects
657 <emphasis>now</emphasis>.
660 <sect2><title>SRW Protocol behavior</title>
662 The ZOOM driver for SRW treats records returned by a SRW server
663 as if they where Z39.50 records with transfer syntax XML and
664 no element set name or database name.
668 <sect1 id="zoom.scan"><title>Scan</title>
670 This section describes an interface for Scan. Scan is not an
671 official part of the ZOOM model yet. The result of a scan operation
672 is the <literal>ZOOM_scanset</literal> which is a set of terms
673 returned by a target.
677 The Scan interface is Z39.50 only. SRW version 1.0 does not
682 ZOOM_scanset ZOOM_connection_scan (ZOOM_connection c,
683 const char *startterm);
685 size_t ZOOM_scanset_size(ZOOM_scanset scan);
687 const char * ZOOM_scanset_term(ZOOM_scanset scan, size_t pos,
688 int *occ, size_t *len);
691 void ZOOM_scanset_destroy (ZOOM_scanset scan);
693 const char *ZOOM_scanset_option_get (ZOOM_scanset scan,
696 void ZOOM_scanset_option_set (ZOOM_scanset scan, const char *key,
700 The scan set is created by function
701 <function>ZOOM_connection_scan</function> which performs a scan
702 operation on the connection and start term given.
703 If the operation was successful, the size of the scan set can be
704 retrieved by a call to <function>ZOOM_scanset_size</function>.
705 Like result sets, the items are numbered 0,..size-1.
706 To obtain information about a particular scan term, call function
707 <function>ZOOM_scanset_term</function>. This function takes
708 a scan set offset <literal>pos</literal> and returns a pointer
709 to an actual term or <literal>NULL</literal> if non-present.
710 If present, the <literal>occ</literal> and <literal>len</literal>
711 are set to the number of occurrences and the length
712 of the actual term respectively.
713 A scan set may be freed by a call to function
714 <function>ZOOM_scanset_destroy</function>.
715 Functions <function>ZOOM_scanset_option_get</function> and
716 <function>ZOOM_scanset_option_set</function> retrieves and sets
717 an option respectively.
720 <table frame="top"><title>ZOOM Scan Set Options</title>
722 <colspec colwidth="4*" colname="name"></colspec>
723 <colspec colwidth="7*" colname="description"></colspec>
724 <colspec colwidth="2*" colname="default"></colspec>
727 <entry>Option</entry>
728 <entry>Description</entry>
729 <entry>Default</entry>
734 number</entry><entry>Number of Scan Terms requested in next scan.
735 After scan it holds the actual number of terms returned.
736 </entry><entry>10</entry></row>
738 position</entry><entry>Preferred Position of term in response
739 in next scan; actual position after completion of scan.
740 </entry><entry>1</entry></row>
742 stepSize</entry><entry>Step Size
743 </entry><entry>0</entry></row>
745 scanStatus</entry><entry>An integer indicating the Scan Status
747 </entry><entry>0</entry></row>
753 <sect1 id="zoom.options"><title>Options</title>
755 Most &zoom; objects provide a way to specify options to change behavior.
756 From an implementation point of view a set of options is just like
757 an associative array / hash array, etc.
760 ZOOM_options ZOOM_options_create (void);
762 ZOOM_options ZOOM_options_create_with_parent (ZOOM_options parent);
764 void ZOOM_options_destroy (ZOOM_options opt);
767 const char *ZOOM_options_get (ZOOM_options opt, const char *name);
769 void ZOOM_options_set (ZOOM_options opt, const char *name,
773 typedef const char *(*ZOOM_options_callback)
774 (void *handle, const char *name);
776 ZOOM_options_callback
777 ZOOM_options_set_callback (ZOOM_options opt,
778 ZOOM_options_callback c,
782 <sect1 id="zoom.events"><title>Events</title>
784 If you're developing non-blocking applications, you have to deal
788 int ZOOM_event (int no, ZOOM_connection *cs);
791 The <function>ZOOM_event</function> executes pending events for
792 a number of connections. Supply the number of connections in
793 <literal>no</literal> and an array of connections in
794 <literal>cs</literal> (<literal>cs[0] ... cs[no-1]</literal>).
795 A pending event could be a sending a search, receiving a response,
797 When an event has occurred for one of the connections, this function
798 returns a positive integer <literal>n</literal> denoting that an event
799 occurred for connection <literal>cs[n-1]</literal>.
800 When no events are pending for the connections, a value of zero is
802 To ensure that all outstanding requests are performed call this function
803 repeatedly until zero is returned.
808 <!-- Keep this comment at the end of the file
813 sgml-minimize-attributes:nil
814 sgml-always-quote-attributes:t
817 sgml-parent-document: "yaz.xml"
818 sgml-local-catalogs: nil
819 sgml-namecase-general:t