74aed36e1eeb99cdf6323f065cce837cb00c0c31
[yaz-moved-to-github.git] / doc / zoom.xml
1 <!--
2 ### Still to document:
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_diag_str(error)
9 ZOOM_resultset_record_immediate(s, pos)
10 ZOOM_resultset_cache_reset(r)
11 ZOOM_resultset_sort(r, sort_type, sort_spec)
12 ZOOM_resultset_sort1(r, sort_type, sort_spec)
13 ZOOM_options_set_callback(opt, function, handle)
14 ZOOM_options_create_with_parent2(parent1, parent2)
15 ZOOM_options_getl(opt, name, len)
16 ZOOM_options_setl(opt, name, value, len)
17 ZOOM_options_get_bool(opt, name, defa)
18 ZOOM_options_get_int(opt, name, defa)
19 ZOOM_options_set_int(opt, name, value)
20 ZOOM_connection_scan1 (ZOOM_connection c, ZOOM_query startterm)
21 ZOOM_query_cql2rpn(ZOOM_query s, const char *str, ZOOM_connection conn)
22 -->
23 <!-- $Id: zoom.xml,v 1.53 2006-10-24 11:48:42 mike Exp $ -->
24  <chapter id="zoom"><title>ZOOM</title>
25   <para>
26     &zoom; is an acronym for 'Z39.50 Object-Orientation Model' and is
27    an initiative started by Mike Taylor (Mike is from the UK, which
28    explains the peculiar name of the model). The goal of &zoom; is to
29    provide a common Z39.50 client API not bound to a particular
30    programming language or toolkit.
31   </para>
32
33   <note>
34    <para>
35     A recent addition to &yaz; is SRU support. You can now make
36     SRU ZOOM connections by specifying scheme <literal>http://</literal>
37     for the hostname for a connection.  The dialect of SRU used is
38     specified by the value of the connection's <literal>sru</literal>
39     option, which may be SRU over HTTP GET (<literal>get</literal>),
40     SRU over HTTP POST (<literal>post</literal>) or SRW (SRU over
41     SOAP) (<literal>soap</literal>).
42    </para>
43   </note>
44
45   <para>
46    The lack of a simple Z39.50 client API for &yaz; has become more
47    and more apparent over time. So when the first &zoom; specification
48    became available,
49    an implementation for &yaz; was quickly developed. For the first time, it is
50    now as easy (or easier!) to develop clients than servers with &yaz;. This
51    chapter describes the &zoom; C binding. Before going further, please
52    reconsider whether C is the right programming language for the job.
53    There are other language bindings available for &yaz;, and still
54    more
55    are in active development. See the
56    <ulink url="&url.zoom;">ZOOM web-site</ulink> for
57    more information.
58   </para>
59   
60   <para>
61    In order to fully understand this chapter you should read and
62    try the example programs <literal>zoomtst1.c</literal>,
63    <literal>zoomtst2.c</literal>, .. in the <literal>zoom</literal>
64    directory.
65   </para>
66   
67   <para>
68    The C language misses features found in object oriented languages
69    such as C++, Java, etc. For example, you'll have to manually,
70    destroy all objects you create, even though you may think of them as
71    temporary. Most objects has a <literal>_create</literal> - and a
72    <literal>_destroy</literal> variant.
73    All objects are in fact pointers to internal stuff, but you don't see
74    that because of typedefs. All destroy methods should gracefully ignore a
75    <literal>NULL</literal> pointer.
76   </para>
77   <para>
78    In each of the sections below you'll find a sub section called
79    protocol behavior, that describes how the API maps to the Z39.50
80    protocol.
81   </para>
82   <sect1 id="zoom-connections"><title>Connections</title>
83    
84    <para>The Connection object is a session with a target.
85    </para>
86    <synopsis>
87     #include &lt;yaz/zoom.h>
88     
89     ZOOM_connection ZOOM_connection_new (const char *host, int portnum);
90     
91     ZOOM_connection ZOOM_connection_create (ZOOM_options options);
92     
93     void ZOOM_connection_connect(ZOOM_connection c, const char *host,
94                                  int portnum);
95     void ZOOM_connection_destroy (ZOOM_connection c);
96    </synopsis>
97    <para>
98     Connection objects are created with either function
99     <function>ZOOM_connection_new</function> or 
100     <function>ZOOM_connection_create</function>.
101     The former creates and automatically attempts to establish a network
102     connection with the target. The latter doesn't establish
103     a connection immediately, thus allowing you to specify options
104     before establishing network connection using the function
105     <function>ZOOM_connection_connect</function>. 
106     If the port number, <literal>portnum</literal>, is zero, the
107     <literal>host</literal> is consulted for a port specification.
108     If no port is given, 210 is used. A colon denotes the beginning of
109     a port number in the host string. If the host string includes a
110     slash, the following part specifies a database for the connection.
111    </para>
112    <para>
113     You can prefix the host with a scheme followed by colon. The
114     default scheme is <literal>tcp</literal> (Z39.50 protocol).
115     The scheme <literal>http</literal> selects SRU over HTTP.
116    </para>
117    <para>
118     You can prefix the scheme-qualified host-string with one or more
119     comma-separated
120     <literal><parameter>key</parameter>=<parameter>value</parameter></literal>
121     sequences, each of which represents an option to be set into the
122     connection structure <emphasis>before</emphasis> the
123     protocol-level connection is forged and the initialisation
124     handshake takes place.  This facility can be used to provide
125     authentication credentials, as in host-strings such as:
126     <literal>user=admin,password=halfAm4n,tcp:localhost:8017/db</literal>
127    </para>
128    <para>
129     Connection objects should be destroyed using the function
130     <function>ZOOM_connection_destroy</function>.
131    </para>
132    <synopsis>
133     void ZOOM_connection_option_set(ZOOM_connection c,
134                                     const char *key, const char *val);
135
136     void ZOOM_connection_option_setl(ZOOM_connection c,
137                                      const char *key,
138                                      const char *val, int len);
139
140     const char *ZOOM_connection_option_get(ZOOM_connection c,
141                                            const char *key);
142     const char *ZOOM_connection_option_getl(ZOOM_connection c,
143                                             const char *key,
144                                             int *lenp);
145    </synopsis>
146    <para>
147     The functions <function>ZOOM_connection_option_set</function> and
148     <function>ZOOM_connection_option_setl</function> allows you to
149     set an option given by <parameter>key</parameter> to the value
150     <parameter>value</parameter> for the connection. 
151     For <function>ZOOM_connection_option_set</function>, the
152     value is assumed to be a 0-terminated string. Function
153     <function>ZOOM_connection_option_setl</function> specifies a
154     value of a certain size (len).
155    </para>
156    <para>
157     Functions <function>ZOOM_connection_option_get</function> and
158     <function>ZOOM_connection_option_getl</function> returns
159     the value for an option given by <parameter>key</parameter>.
160    </para>
161    <table id="zoom-connection-options" frame="top">
162     <title>ZOOM Connection Options</title>
163     <tgroup cols="3">
164      <colspec colwidth="4*" colname="name"></colspec>
165      <colspec colwidth="7*" colname="description"></colspec>
166      <colspec colwidth="3*" colname="default"></colspec>
167      <thead>
168       <row>
169        <entry>Option</entry>
170        <entry>Description</entry>
171        <entry>Default</entry>
172       </row>
173      </thead>
174      <tbody>
175       <row><entry>
176         implementationName</entry><entry>Name of Your client
177        </entry><entry>none</entry></row>
178       <row><entry>
179         user</entry><entry>Authentication user name
180        </entry><entry>none</entry></row>
181       <row><entry>
182         group</entry><entry>Authentication group name
183        </entry><entry>none</entry></row>
184       <row><entry>
185         password</entry><entry>Authentication password.
186        </entry><entry>none</entry></row>
187       <row><entry>
188         host</entry><entry>Target host. This setting is "read-only".
189         It's automatically set internally when connecting to a target.
190        </entry><entry>none</entry></row>
191       <row><entry>
192         proxy</entry><entry>Proxy host
193        </entry><entry>none</entry></row>
194       <row><entry>
195         async</entry><entry>If true (1) the connection operates in 
196         asynchronous operation which means that all calls are non-blocking
197         except
198         <link linkend="zoom.events"><function>ZOOM_event</function></link>.
199        </entry><entry>0</entry></row>
200       <row><entry>
201         maximumRecordSize</entry><entry> Maximum size of single record.
202        </entry><entry>1 MB</entry></row>
203       <row><entry>
204         preferredMessageSize</entry><entry> Maximum size of multiple records.
205        </entry><entry>1 MB</entry></row>
206       <row><entry>
207         lang</entry><entry> Language for negotiation.
208        </entry><entry>none</entry></row>
209       <row><entry>
210         charset</entry><entry> Character set for negotiation.
211        </entry><entry>none</entry></row>
212       <row><entry>
213         serverImplementationId</entry><entry>
214         Implementation ID of server.  (The old targetImplementationId
215         option is also supported for the benefit of old applications.)
216        </entry><entry>none</entry></row>
217       <row><entry>
218         targetImplementationName</entry><entry>
219         Implementation Name of server.  (The old
220         targetImplementationName option is also supported for the
221         benefit of old applications.)
222        </entry><entry>none</entry></row>
223       <row><entry>
224         serverImplementationVersion</entry><entry>
225         Implementation Version of server.  (the old
226         targetImplementationVersion option is also supported for the
227         benefit of old applications.)
228        </entry><entry>none</entry></row>
229       <row><entry>
230         databaseName</entry><entry>One or more database names
231         separated by character plus (<literal>+</literal>), which to
232         be used by subsequent search requests on this Connection.
233        </entry><entry>Default</entry></row>
234       <row><entry>
235         piggyback</entry><entry>True (1) if piggyback should be
236         used in searches; false (0) if not.
237        </entry><entry>1</entry></row>
238       <row><entry>
239         smallSetUpperBound</entry><entry>If hits is less than or equal to this
240         value, then target will return all records using small element set name
241        </entry><entry>0</entry></row>
242       <row><entry>
243         largeSetLowerBound</entry><entry>If hits is greater than this
244         value, the target will return no records.
245        </entry><entry>1</entry></row>
246       <row><entry>
247         mediumSetPresentNumber</entry><entry>This value represents
248         the number of records to be returned as part of a search when when
249         hits is less than or equal to large set lower bound and if hits
250         is greater than small set upper bound.
251        </entry><entry>0</entry></row>
252       <row><entry>
253         smallSetElementSetName</entry><entry>
254         The element set name to be used for small result sets.
255        </entry><entry>none</entry></row>
256       <row><entry>
257         mediumSetElementSetName</entry><entry>
258         The element set name to be for medium-sized result sets.
259        </entry><entry>none</entry></row>
260      </tbody>
261     </tgroup>
262    </table>
263    <para>
264     If either option <literal>lang</literal> or <literal>charset</literal>
265     is set, then 
266     <ulink url="&url.z39.50.charneg;">
267      Character Set and Language Negotiation</ulink> is in effect.
268    </para>
269    <synopsis>
270      int ZOOM_connection_error (ZOOM_connection c, const char **cp,
271                                 const char **addinfo);
272      int ZOOM_connection_error_x (ZOOM_connection c, const char **cp,
273                                   const char **addinfo, const char **dset);
274    </synopsis>
275    <para>
276     Function <function>ZOOM_connection_error</function> checks for
277     errors for the last operation(s) performed. The function returns
278     zero if no errors occurred; non-zero otherwise indicating the error.
279     Pointers <parameter>cp</parameter> and <parameter>addinfo</parameter>
280     holds messages for the error and additional-info if passed as
281     non-<literal>NULL</literal>. Function
282     <function>ZOOM_connection_error_x</function> is an extended version
283     of <function>ZOOM_connection_error</function> that is capable of
284     returning name of diagnostic set in <parameter>dset</parameter>.
285    </para>
286    <sect2 id="zoom-connection-z39.50">
287     <title>Z39.50 Protocol behavior</title>
288     <para>
289      The calls <function>ZOOM_connection_new</function> and
290      <function>ZOOM_connection_connect</function> establishes a TCP/IP
291       connection and sends an Initialize Request to the target if
292       possible. In addition, the calls waits for an Initialize Response
293       from the target and the result is inspected (OK or rejected).
294     </para>
295     <para>
296      If <literal>proxy</literal> is set then the client will establish
297      a TCP/IP connection with the peer as specified by the
298      <literal>proxy</literal> host and the hostname as part of the
299      connect calls will be set as part of the Initialize Request.
300      The proxy server will then "forward" the PDU's transparently
301      to the target behind the proxy.
302     </para>
303     <para>
304      For the authentication parameters, if option <literal>user</literal>
305      is set and both options <literal>group</literal> and
306      <literal>pass</literal> are unset, then Open style
307      authentication is used (Version 2/3) in which case the username
308      is usually followed by a slash, then by a password.
309      If either <literal>group</literal>
310      or <literal>pass</literal> is set then idPass authentication
311      (Version 3 only) is used. If none of the options are set, no
312      authentication parameters are set as part of the Initialize Request
313      (obviously).
314     </para>
315     <para>
316      When option <literal>async</literal> is 1, it really means that
317      all network operations are postponed (and queued) until the
318      function <literal>ZOOM_event</literal> is invoked. When doing so
319      it doesn't make sense to check for errors after
320      <literal>ZOOM_connection_new</literal> is called since that
321      operation "connecting - and init" is still incomplete and the
322      API cannot tell the outcome (yet).
323     </para>
324     </sect2>
325    <sect2 id="zoom.sru.init.behavior">
326     <title>SRU Protocol behavior</title>
327     <para>
328      The SRU protocol doesn't feature an Inititialize Request, so
329      the connection phase merely establishes a TCP/IP connection
330      with the SOAP service.
331     </para>
332     <para>Most of the ZOOM connection options do not
333      affect SRU and they are ignored. However, future versions
334      of &yaz; might honor <literal>implementationName</literal> and
335      put that as part of User-Agent header for HTTP requests.
336      </para>
337     <para>
338      The <literal>charset</literal> is used in the Content-Type header
339      of HTTP requests.
340     </para>
341    </sect2>
342   </sect1>
343   <sect1 id="zoom.query"><title>Queries</title>
344    <para>
345     Query objects represents queries.
346    </para>
347    <synopsis>
348      ZOOM_query ZOOM_query_create(void);
349
350      void ZOOM_query_destroy(ZOOM_query q);
351
352      int ZOOM_query_prefix(ZOOM_query q, const char *str);
353
354      int ZOOM_query_cql(ZOOM_query s, const char *str);
355
356      int ZOOM_query_sortby(ZOOM_query q, const char *criteria);
357    </synopsis>
358    <para>
359     Create query objects using <function>ZOOM_query_create</function>
360     and destroy them by calling <function>ZOOM_query_destroy</function>.
361     RPN-queries can be specified in <link linkend="PQF">PQF</link>
362     notation by using the
363     function <function>ZOOM_query_prefix</function>.
364     The <function>ZOOM_query_cql</function> specifies a CQL
365     query to be sent to the server/target.
366     More query types will be added in future versions of &yaz;, such as
367     <link linkend="CCL">CCL</link> to RPN-mapping, native CCL query,
368     etc. In addition to a search, a sort criteria may be set. Function
369     <function>ZOOM_query_sortby</function> specifies a 
370     sort criteria using the same string notation for sort as offered by
371     the <link linkend="sortspec">YAZ client</link>.
372    </para>
373    <sect2 id="zoom.sort.behavior"><title>Protocol behavior</title>
374     <para>
375      The query object is just an interface for the member Query
376      in the SearchRequest. The sortby-function is an interface to the
377      sortSequence member of the SortRequest.
378     </para>
379    </sect2>
380   </sect1>
381   <sect1 id="zoom.resultsets"><title>Result sets</title>
382    <para>
383     The result set object is a container for records returned from
384     a target.
385    </para>
386    <synopsis>
387      ZOOM_resultset ZOOM_connection_search(ZOOM_connection,
388                                            ZOOM_query q);
389
390      ZOOM_resultset ZOOM_connection_search_pqf(ZOOM_connection c,
391                                                const char *q);
392
393      void ZOOM_resultset_destroy(ZOOM_resultset r);
394    </synopsis>
395    <para>
396     Function <function>ZOOM_connection_search</function> creates
397      a result set given a connection and query.
398     Destroy a result set by calling
399     <function>ZOOM_resultset_destroy</function>.
400     Simple clients may using PQF only may use function
401     <function>ZOOM_connection_search_pqf</function> in which case
402     creating query objects is not necessary.
403    </para>
404    <synopsis>
405      void ZOOM_resultset_option_set (ZOOM_resultset r,
406                                       const char *key,
407                                       const char *val);
408
409      const char *ZOOM_resultset_option_get (ZOOM_resultset r,
410                                              const char *key);
411
412      size_t ZOOM_resultset_size (ZOOM_resultset r);
413    </synopsis>
414    <para>
415     Functions <function>ZOOM_resultset_options_set</function> and
416     <function>ZOOM_resultset_get</function> sets and gets an option
417     for a result set similar to <function>ZOOM_connection_option_get</function>
418     and <function>ZOOM_connection_option_set</function>.
419    </para>
420    <para>
421     The number of hits also called result-count is returned by
422     function <function>ZOOM_resultset_size</function>.
423    </para>
424    <table id="zoom.resultset.options" 
425     frame="top"><title>ZOOM Result set Options</title>
426     <tgroup cols="3">
427      <colspec colwidth="4*" colname="name"></colspec>
428      <colspec colwidth="7*" colname="description"></colspec>
429      <colspec colwidth="2*" colname="default"></colspec>
430      <thead>
431       <row>
432        <entry>Option</entry>
433        <entry>Description</entry>
434        <entry>Default</entry>
435       </row>
436      </thead>
437      <tbody>
438       <row><entry>
439         start</entry><entry>Offset of first record to be 
440         retrieved from target. First record has offset 0 unlike the
441         protocol specifications where first record has position 1.
442        </entry><entry>0</entry></row>
443       <row><entry>
444         count</entry><entry>Number of records to be retrieved.
445        </entry><entry>0</entry></row>
446       <row><entry>
447         presentChunk</entry><entry>The number of records to be
448         requested from the server in each chunk (present requst).  The
449         value 0 means to request all the records in a single chunk.
450         (The old <literal>step</literal>
451         option is also supported for the benefit of old applications.)
452        </entry><entry>0</entry></row>
453       <row><entry>
454         elementSetName</entry><entry>Element-Set name of records. 
455         Most targets should honor element set name <literal>B</literal>
456         and <literal>F</literal> for brief and full respectively.
457        </entry><entry>none</entry></row>
458       <row><entry>
459         preferredRecordSyntax</entry><entry>Preferred Syntax, such as
460         <literal>USMARC</literal>, <literal>SUTRS</literal>, etc.
461        </entry><entry>none</entry></row>
462       <row><entry>
463         schema</entry><entry>Schema for retrieval, such as
464         <literal>Gils-schema</literal>, <literal>Geo-schema</literal>, etc.
465        </entry><entry>none</entry></row>
466       <row><entry>
467         setname</entry><entry>Name of Result Set (Result Set ID).
468         If this option isn't set, the ZOOM module will automatically
469         allocate a result set name.
470        </entry><entry>default</entry></row>
471      </tbody>
472     </tgroup>
473    </table>
474    <para>
475     For servers that support Search Info report, the following
476     options may be read using <function>ZOOM_resultset_get</function>.
477     This detailed information is read after a successful search has
478     completed.
479    </para>
480    <para>
481     This information is a list of of items, where each item is
482     information about a term or subquery. All items in the list 
483     are prefixed by 
484     <literal>SearchResult.</literal><replaceable>no</replaceable>
485     where no presents the item number (0=first, 1=second). 
486     Read <literal>searchresult.size</literal> to determine the
487     number of items.
488    </para>
489    <table id="zoom.search.info.report.options" 
490     frame="top"><title>Search Info Report Options</title>
491     <tgroup cols="2">
492      <colspec colwidth="4*" colname="name"></colspec>
493      <colspec colwidth="7*" colname="description"></colspec>
494      <thead>
495       <row>
496        <entry>Option</entry>
497        <entry>Description</entry>
498       </row>
499      </thead>
500      <tbody>
501       <row>
502        <entry>searchresult.size</entry>
503        <entry>
504         number of search result entries. This option is-nonexistant
505         if no entries are returned by the server.
506        </entry>
507       </row>
508       <row>
509        <entry>searchresult.<replaceable>no</replaceable>.id</entry>
510        <entry>sub query ID</entry>
511       </row>
512       <row>
513        <entry>searchresult.<replaceable>no</replaceable>.count</entry>
514        <entry>result count for item (number of hits)</entry>
515       </row>
516       <row>
517        <entry>searchresult.<replaceable>no</replaceable>.subquery.term</entry>
518        <entry>subquery term</entry>
519       </row>
520       <row>
521        <entry>
522         searchresult.<replaceable>no</replaceable>.interpretation.term
523        </entry>
524        <entry>interpretation term</entry>
525       </row>
526       <row>
527        <entry>
528         searchresult.<replaceable>no</replaceable>.recommendation.term
529        </entry>
530        <entry>recommendation term</entry>
531       </row>
532      </tbody>
533     </tgroup>
534    </table>
535    <sect2 id="zoom.z3950.resultset.behavior">
536     <title>Z39.50 Protocol behavior</title>
537     <para>
538      The creation of a result set involves at least a SearchRequest
539      - SearchResponse protocol handshake. Following that, if a sort
540      criteria was specified as part of the query, a SortRequest -
541      SortResponse handshake takes place. Note that it is necessary to
542      perform sorting before any retrieval takes place, so no records will
543      be returned from the target as part of the SearchResponse because these
544      would be unsorted. Hence, piggyback is disabled when sort criteria
545      are set. Following Search - and a possible sort - Retrieval takes
546      place - as one or more Present Requests/Response pairs being
547      transferred.
548      </para>
549     <para>
550      The API allows for two different modes for retrieval. A high level
551      mode which is somewhat more powerful and a low level one.
552      The low level is enabled when searching on a Connection object
553      for which the settings
554      <literal>smallSetUpperBound</literal>,
555      <literal>mediumSetPresentNumber</literal> and
556      <literal>largeSetLowerBound</literal> are set. The low level mode
557      thus allows you to precisely set how records are returned as part
558      of a search response as offered by the Z39.50 protocol.
559      Since the client may be retrieving records as part of the
560      search response, this mode doesn't work well if sorting is used.
561      </para>
562     <para>
563      The high-level mode allows you to fetch a range of records from
564      the result set with a given start offset. When you use this mode
565      the client will automatically use piggyback if that is possible
566      with the target and perform one or more present requests as needed.
567      Even if the target returns fewer records as part of a present response
568      because of a record size limit, etc. the client will repeat sending
569      present requests. As an example, if option <literal>start</literal>
570      is 0 (default) and <literal>count</literal> is 4, and
571      <literal>piggyback</literal> is 1 (default) and no sorting criteria
572      is specified, then the client will attempt to retrieve the 4
573      records as part the search response (using piggyback). On the other
574      hand, if either <literal>start</literal> is positive or if
575      a sorting criteria is set, or if <literal>piggyback</literal>
576      is 0, then the client will not perform piggyback but send Present
577      Requests instead.
578     </para>
579     <para>
580      If either of the options <literal>mediumSetElementSetName</literal> and
581      <literal>smallSetElementSetName</literal> are unset, the value
582      of option <literal>elementSetName</literal> is used for piggyback
583      searches. This means that for the high-level mode you only have
584      to specify one elementSetName option rather than three.
585      </para>
586    </sect2>
587    <sect2 id="zoom.sru.resultset.behavior">
588     <title>SRU Protocol behavior</title>
589     <para>
590      Current version of &yaz; does not take advantage of a result set id
591      returned by the SRU server. Future versions might do, however.
592      Since, the ZOOM driver does not save result set IDs any
593      present (retrieval) is transformed to a SRU SearchRetrieveRequest
594      with same query but, possibly, different offsets.
595     </para>
596     <para>
597      Option <literal>schema</literal> specifies SRU schema
598      for retrieval. However, options <literal>elementSetName</literal> and
599      <literal>preferredRecordSyntax</literal> are ignored.
600     </para>
601     <para>
602      Options <literal>start</literal> and <literal>count</literal> 
603      are supported by SRU.
604      The remaining options
605      <literal>piggyback</literal>, 
606      <literal>smallSetUpperBound</literal>, 
607      <literal>largeSetLowerBound</literal>, 
608      <literal>mediumSetPresentNumber</literal>, 
609      <literal>mediumSetElementSetName</literal>,
610       <literal>smallSetElementSetName</literal> are
611      unsupported.
612     </para>
613     <para>
614      SRU supports CQL queries, <emphasis>not</emphasis> PQF.
615      If PQF is used, however, the PQF query is transferred anyway
616      using non-standard element <literal>pQuery</literal> in
617      SRU SearchRetrieveRequest.
618     </para>
619     <para>
620      Unfortunately, SRU does not define a database setting. Hence,
621      <literal>databaseName</literal> is unsupported and ignored.
622      However, the path part in host parameter for functions 
623      <function>ZOOM_connecton_new</function> and
624      <function>ZOOM_connection_connect</function> acts as a
625      database (at least for the &yaz; SRU server).
626     </para>
627    </sect2>
628   </sect1>
629   <sect1 id="zoom.records"><title>Records</title>
630    <para>
631     A record object is a retrieval record on the client side -
632     created from result sets.
633    </para>
634    <synopsis>
635      void ZOOM_resultset_records (ZOOM_resultset r,
636                                   ZOOM_record *recs,
637                                   size_t start, size_t count);
638      ZOOM_record ZOOM_resultset_record (ZOOM_resultset s, size_t pos);
639
640      const char *ZOOM_record_get (ZOOM_record rec, const char *type,
641                                   size_t *len);
642
643      ZOOM_record ZOOM_record_clone (ZOOM_record rec);
644
645      void ZOOM_record_destroy (ZOOM_record rec);
646    </synopsis>
647    <para>
648     References to temporary records are returned by functions 
649     <function>ZOOM_resultset_records</function> or
650     <function>ZOOM_resultset_record</function>.
651     </para>
652    <para>
653     If a persistent reference to a record is desired
654     <function>ZOOM_record_clone</function> should be used.
655     It returns a record reference that should be destroyed
656     by a call to <function>ZOOM_record_destroy</function>.
657    </para>
658    <para>
659     A single record is returned by function
660     <function>ZOOM_resultset_record</function> that takes a 
661     position as argument. First record has position zero.
662     If no record could be obtained <literal>NULL</literal> is returned.
663    </para>
664    <para>
665     Function <function>ZOOM_resultset_records</function> retrieves
666     a number of records from a result set. Parameter <literal>start</literal>
667     and <literal>count</literal> specifies the range of records to
668     be returned. Upon completion array
669     <literal>recs[0], ..recs[count-1]</literal>
670     holds record objects for the records. The array of records
671      <literal>recs</literal> should be allocated prior the call
672     <function>ZOOM_resultset_records</function>. Note that for those
673     records that couldn't be retrieved from the target
674     <literal>recs[ ..]</literal> is set to <literal>NULL</literal>.
675    </para>
676    <para id="zoom.record.get">
677     In order to extract information about a single record,
678     <function>ZOOM_record_get</function> is provided. The
679     function returns a pointer to certain record information. The
680     nature (type) of the pointer depends on the parameter,
681     <parameter>type</parameter>.
682    </para>
683    <para>
684     The <parameter>type</parameter> is a string of the format:
685    </para>
686    <para>
687     <replaceable>form</replaceable>[; charset=<replaceable>from</replaceable>[,<replaceable>to</replaceable>]]
688    </para>
689    <para>
690     where <replaceable>form</replaceable> specifies the format of the
691     returned record, <replaceable>from</replaceable>
692     specifies the character set of the record in its original form
693     (as returned by the server), <replaceable>to</replaceable> specifies
694     the output (returned)
695     character set encoding.
696     If charset is not given, then no character set conversion takes place.
697     If <replaceable>to</replaceable> is omitted UTF-8 is assumed.
698    </para>
699    <para>
700     In addition, for certain types, the length
701     <literal>len</literal> passed will be set to the size in bytes of
702     the returned information. 
703     </para>
704    <para>
705     The following are the supported values for <replaceable>form</replaceable>.
706     <variablelist>
707      <varlistentry><term><literal>database</literal></term>
708       <listitem><para>Database of record is returned
709         as a C null-terminated string. Return type
710         <literal>const char *</literal>. 
711        </para></listitem>
712      </varlistentry>
713      <varlistentry><term><literal>syntax</literal></term>
714       <listitem><para>The transfer syntax of the record is returned
715         as a C null-terminated string containing the symbolic name of
716         the record syntax, e.g. <literal>Usmarc</literal>. Return type
717         is
718         <literal>const char *</literal>. 
719        </para></listitem>
720      </varlistentry>
721      <varlistentry><term><literal>render</literal></term>
722       <listitem><para>The record is returned in a display friendly
723         format. Upon completion buffer is returned
724         (type <literal>const char *</literal>) and length is stored in
725         <literal>*len</literal>.
726        </para></listitem>
727      </varlistentry>
728      <varlistentry><term><literal>raw</literal></term>
729       <listitem><para>The record is returned in the internal
730         YAZ specific format. For GRS-1, Explain, and others, the
731         raw data is returned as type 
732         <literal>Z_External *</literal> which is just the type for
733         the member <literal>retrievalRecord</literal> in
734         type <literal>NamePlusRecord</literal>.
735         For SUTRS and octet aligned record (including all MARCs) the
736         octet buffer is returned and the length of the buffer.
737        </para></listitem>
738      </varlistentry>
739      <varlistentry><term><literal>xml</literal></term>
740       <listitem><para>The record is returned in XML if possible.
741         SRU and Z39.50 records with transfer syntax XML are
742         returned verbatim. MARC records are returned in
743         <ulink url="&url.marcxml;">
744          MARCXML
745          </ulink> 
746         (converted from ISO2709 to MARCXML by YAZ).
747         GRS-1 and OPAC records are not supported for this form.
748         Upon completion, the XML buffer is returned
749         (type <literal>const char *</literal>) and length is stored in
750         <literal>*len</literal>.
751        </para></listitem>
752      </varlistentry>
753      <varlistentry><term><literal>opac</literal></term>
754       <listitem><para>OPAC for record is returned in XML.
755        </para></listitem>
756      </varlistentry>
757     </variablelist>
758    </para>
759    <para>
760     Most
761     <ulink url="&url.marc21;">MARC21</ulink>
762     records uses the 
763     <ulink url="&url.marc8;">MARC-8</ulink>
764     character set encoding.
765     An application that wishes to display in Latin-1 would use
766     <screen>
767      render; charset=marc8,iso-8859-1
768     </screen>
769    </para>
770    <sect2 id="zoom.z3950.record.behavior">
771     <title>Z39.50 Protocol behavior</title>
772     <para>
773      The functions <function>ZOOM_resultset_record</function> and
774      <function>ZOOM_resultset_records</function> inspects the client-side
775      record cache. Records not found in cache are fetched using
776      Present.
777      The functions may block (and perform network I/O)  - even though option
778      <literal>async</literal> is 1, because they return records objects.
779      (and there's no way to return records objects without retrieving them!).
780      </para>
781     <para>
782      There is a trick, however, in the usage of function
783      <function>ZOOM_resultset_records</function> that allows for
784      delayed retrieval (and makes it non-blocking). By using
785      a null pointer for <parameter>recs</parameter> you're indicating
786      you're not interested in getting records objects
787      <emphasis>now</emphasis>.
788     </para>
789    </sect2>
790    <sect2 id="zoom.sru.record.behavior">
791     <title>SRU Protocol behavior</title>
792     <para>
793      The ZOOM driver for SRU treats records returned by a SRU server
794      as if they where Z39.50 records with transfer syntax XML and
795      no element set name or database name.
796     </para>
797    </sect2>
798   </sect1>
799   <sect1 id="zoom.scan"><title>Scan</title>
800    <para>
801     This section describes an interface for Scan. Scan is not an
802     official part of the ZOOM model yet. The result of a scan operation
803     is the <literal>ZOOM_scanset</literal> which is a set of terms
804     returned by a target.
805    </para>
806
807    <para>
808     The Scan interface is Z39.50 only. SRW version 1.0 does not
809     support this.
810    </para>
811
812    <synopsis>
813     ZOOM_scanset ZOOM_connection_scan(ZOOM_connection c,
814                                       const char *startpqf);
815
816     size_t ZOOM_scanset_size(ZOOM_scanset scan);
817
818     const char * ZOOM_scanset_term(ZOOM_scanset scan, size_t pos,
819                                    int *occ, size_t *len);
820
821     const char * ZOOM_scanset_display_term(ZOOM_scanset scan, size_t pos,
822                                            int *occ, size_t *len);
823
824     void ZOOM_scanset_destroy (ZOOM_scanset scan);
825
826     const char *ZOOM_scanset_option_get(ZOOM_scanset scan,
827                                          const char *key);
828
829     void ZOOM_scanset_option_set(ZOOM_scanset scan, const char *key,
830                                  const char *val);
831     </synopsis>
832    <para>
833     The scan set is created by function
834     <function>ZOOM_connection_scan</function> which performs a scan
835     operation on the connection using the specified
836     <parameter>startpqf</parameter>.
837     If the operation was successful, the size of the scan set can be
838     retrieved by a call to <function>ZOOM_scanset_size</function>.
839     Like result sets, the items are numbered 0,..size-1.
840     To obtain information about a particular scan term, call function
841     <function>ZOOM_scanset_term</function>. This function takes
842     a scan set offset <literal>pos</literal> and returns a pointer
843     to a <emphasis>raw term</emphasis> or <literal>NULL</literal> if
844     non-present.
845     If present, the <literal>occ</literal> and <literal>len</literal> 
846     are set to the number of occurrences and the length
847     of the actual term respectively.
848     <function>ZOOM_scanset_display_term</function> is similar to
849     <function>ZOOM_scanset_term</function> except that it returns
850     the <emphasis>display term</emphasis> rather than the raw term.
851     In a few cases, the term is different from display term. Always
852     use the display term for display and the raw term for subsequent
853     scan operations (to get more terms, next scan result, etc).
854    </para>
855    <para>
856     A scan set may be freed by a call to function
857     <function>ZOOM_scanset_destroy</function>.
858     Functions <function>ZOOM_scanset_option_get</function> and
859     <function>ZOOM_scanset_option_set</function> retrieves and sets
860     an option respectively.
861    </para>
862
863    <para>
864     The <parameter>startpqf</parameter> is a subset of PQF, namely
865     the Attributes+Term part. Multiple <literal>@attr</literal> can
866     be used. For example to scan in title (complete) phrases:
867     <literallayout>
868      @attr 1=4 @attr 6=2 "science o"
869     </literallayout>
870    </para>
871    
872    <table frame="top" id="zoom.scanset.options">
873     <title>ZOOM Scan Set Options</title>
874     <tgroup cols="3">
875      <colspec colwidth="4*" colname="name"></colspec>
876      <colspec colwidth="7*" colname="description"></colspec>
877      <colspec colwidth="2*" colname="default"></colspec>
878      <thead>
879       <row>
880        <entry>Option</entry>
881        <entry>Description</entry>
882        <entry>Default</entry>
883       </row>
884      </thead>
885      <tbody>
886       <row><entry>
887         number</entry><entry>Number of Scan Terms requested in next scan.
888         After scan it holds the actual number of terms returned.
889        </entry><entry>10</entry></row>
890       <row><entry>
891         position</entry><entry>Preferred Position of term in response
892         in next scan; actual position after completion of scan.
893        </entry><entry>1</entry></row>
894       <row><entry>
895         stepSize</entry><entry>Step Size
896        </entry><entry>0</entry></row>
897       <row><entry>
898         scanStatus</entry><entry>An integer indicating the Scan Status
899         of last scan.
900        </entry><entry>0</entry></row>
901      </tbody>
902     </tgroup>
903    </table>
904   </sect1>
905
906   <sect1 id="zoom.extendedservices"><title>Extended Services</title>
907    <para>
908     ZOOM offers an interface to a subset of the Z39.50 extended services
909     as well as a few privately defined ones:
910    </para>
911    <itemizedlist>
912     <listitem>
913      <para>
914       Z39.50 Item Order (ILL).
915       See <xref linkend="zoom.item.order"/>.
916      </para>
917     </listitem>
918     <listitem>
919      <para>
920       Record Update. This allows a client to insert, modify or delete
921       records.
922       See <xref linkend="zoom.record.update"/>.
923      </para>
924     </listitem>
925     <listitem>
926      <para>
927       Database Create. This a non-standard feature. Allows a client
928       to create a database.
929       See <xref linkend="zoom.database.create"/>.
930      </para>
931     </listitem>
932     <listitem>
933      <para>
934       Database Drop. This a non-standard feature. Allows a client
935       to delete/drop a database.
936       See <xref linkend="zoom.database.drop"/>.
937      </para>
938      </listitem>
939     <listitem>
940      <para>
941       Commit operation. This a non-standard feature. Allows a client
942       to commit operations.
943       See <xref linkend="zoom.commit"/>.
944      </para>
945     </listitem>
946     <!-- all the ILL PDU options should go here too -->
947    </itemizedlist>
948    <para>
949     To create an extended service operation a <literal>ZOOM_package</literal>
950     must be created. The operation is a five step operation. The
951     package is created, package is configured by means of options,
952     the package is send, result is inspected (by means of options),
953     the package is destroyed.
954    </para>
955    <synopsis>
956     ZOOM_package ZOOM_connection_package(ZOOM_connection c,
957                                          ZOOM_options options);
958
959     const char *ZOOM_package_option_get(ZOOM_package p,
960                                         const char *key);
961     void ZOOM_package_option_set(ZOOM_package p, const char *key,
962                                  const char *val);
963     void ZOOM_package_send(ZOOM_package p, const char *type);
964
965     void ZOOM_package_destroy(ZOOM_package p);
966    </synopsis>
967    <para>
968     The <function>ZOOM_connection_package</function> creates a
969     package for the connection given using the options specified.
970    </para>
971    <para>
972     Functions <function>ZOOM_package_option_get</function> and
973     <function>ZOOM_package_option_set</function> gets and sets
974     options.
975    </para>
976    <para>
977     <function>ZOOM_package_send</function> sends
978     the package the via connection specified in 
979     <function>ZOOM_connection_package</function>.
980     The <parameter>type</parameter> specifies the actual extended service
981     package type to be sent.
982    </para>
983
984    <table frame="top" id="zoom.extendedservices.options">
985     <title>Extended Service Common Options</title>
986     <tgroup cols="3">
987      <colspec colwidth="4*" colname="name"></colspec>
988      <colspec colwidth="7*" colname="description"></colspec>
989      <colspec colwidth="3*" colname="default"></colspec>
990      <thead>
991       <row>
992        <entry>Option</entry>
993        <entry>Description</entry>
994        <entry>Default</entry>
995       </row>
996      </thead>
997      <tbody>
998       <row>
999        <entry>package-name</entry>
1000        <entry>Extended Service Request package name. Must be specified
1001        as part of a request</entry>
1002        <entry>none</entry>
1003       </row>
1004       <row>
1005        <entry>user-id</entry>
1006        <entry>User ID of Extended Service Package. Is a request option</entry>
1007        <entry>none</entry>
1008       </row>
1009       <row>
1010        <entry>function</entry>
1011        <entry>
1012         Function of package - one of <literal>create</literal>,
1013         <literal>delete</literal>, <literal>modify</literal>. Is
1014         a request option.
1015        </entry>
1016        <entry><literal>create</literal></entry>
1017       </row>
1018       <row>
1019        <entry>targetReference</entry>
1020        <entry>
1021         Target Reference. This is part of the response as returned
1022         by the server. Read it after a succesful operation.
1023        </entry>
1024        <entry><literal>none</literal></entry>
1025       </row>
1026      </tbody>
1027     </tgroup>
1028    </table>
1029
1030    <sect2 id="zoom.item.order"><title>Item Order</title>
1031     <para>
1032      For Item Order, type must be set to <literal>itemorder</literal> in
1033      <function>ZOOM_package_send</function>.
1034     </para>
1035
1036     <table frame="top" id="zoom.item.order.options">
1037      <title>Item Order Options</title>
1038      <tgroup cols="3">
1039       <colspec colwidth="4*" colname="name"></colspec>
1040       <colspec colwidth="7*" colname="description"></colspec>
1041       <colspec colwidth="3*" colname="default"></colspec>
1042       <thead>
1043        <row>
1044         <entry>Option</entry>
1045         <entry>Description</entry>
1046         <entry>Default</entry>
1047        </row>
1048       </thead>
1049       <tbody>
1050        <row>
1051         <entry>contact-name</entry>
1052         <entry>ILL contact name</entry>
1053         <entry>none</entry>
1054        </row>
1055        <row>
1056         <entry>contact-phone</entry>
1057         <entry>ILL contact phone</entry>
1058         <entry>none</entry>
1059        </row>
1060        <row>
1061         <entry>contact-email</entry>
1062         <entry>ILL contact email</entry>
1063         <entry>none</entry>
1064        </row>
1065        <row>
1066         <entry>itemorder-item</entry>
1067         <entry>Position for item (record) requested. An integer</entry>
1068         <entry>1</entry>
1069        </row>
1070       </tbody>
1071      </tgroup>
1072     </table>
1073
1074    </sect2>
1075
1076    <sect2 id="zoom.record.update"><title>Record Update</title>
1077     <para>
1078      For Record Update, type must be set to <literal>update</literal> in
1079      <function>ZOOM_package_send</function>.
1080     </para>
1081
1082     <table frame="top" id="zoom.record.update.options">
1083      <title>Record Update Options</title>
1084      <tgroup cols="3">
1085       <colspec colwidth="4*" colname="name"></colspec>
1086       <colspec colwidth="7*" colname="description"></colspec>
1087       <colspec colwidth="3*" colname="default"></colspec>
1088       <thead>
1089        <row>
1090         <entry>Option</entry>
1091         <entry>Description</entry>
1092         <entry>Default</entry>
1093        </row>
1094       </thead>
1095       <tbody>
1096        <row>
1097         <entry>action</entry>
1098         <entry>
1099          The update action. One of 
1100          <literal>specialUpdate</literal>,
1101          <literal>recordInsert</literal>,
1102          <literal>recordReplace</literal>,
1103          <literal>recordDelete</literal>,
1104          <literal>elementUpdate</literal>.
1105         </entry>
1106         <entry><literal>specialUpdate</literal></entry>
1107        </row>
1108        <row>
1109         <entry>recordIdOpaque</entry>
1110         <entry>Opaque Record ID</entry>
1111         <entry>none</entry>
1112        </row>
1113        <row>
1114         <entry>recordIdNumber</entry>
1115         <entry>Record ID number</entry>
1116         <entry>none</entry>
1117        </row>
1118        <row>
1119         <entry>record</entry>
1120         <entry>The record itself</entry>
1121         <entry>none</entry>
1122        </row>
1123        <row>
1124         <entry>syntax</entry>
1125         <entry>The record syntax (transfer syntax). Is a string that
1126          is a known record syntax.
1127         </entry>
1128         <entry>no syntax</entry>
1129        </row>
1130        <row>
1131         <entry>databaseName</entry>
1132         <entry>Database from connection object</entry>
1133         <entry>Default</entry>
1134        </row>
1135       </tbody>
1136      </tgroup>
1137     </table>
1138     
1139    </sect2>
1140
1141    <sect2 id="zoom.database.create"><title>Database Create</title>
1142     <para>
1143      For Database Create, type must be set to <literal>create</literal> in
1144      <function>ZOOM_package_send</function>.
1145     </para>
1146     
1147     <table frame="top" id="zoom.database.create.options">
1148      <title>Database Create Options</title>
1149      <tgroup cols="3">
1150       <colspec colwidth="4*" colname="name"></colspec>
1151       <colspec colwidth="7*" colname="description"></colspec>
1152       <colspec colwidth="3*" colname="default"></colspec>
1153       <thead>
1154        <row>
1155         <entry>Option</entry>
1156         <entry>Description</entry>
1157         <entry>Default</entry>
1158        </row>
1159       </thead>
1160       <tbody>
1161        <row>
1162         <entry>databaseName</entry>
1163         <entry>Database from connection object</entry>
1164         <entry>Default</entry>
1165        </row>
1166       </tbody>
1167      </tgroup>
1168     </table>
1169    </sect2>
1170    
1171    <sect2 id="zoom.database.drop"><title>Database Drop</title>
1172     <para>
1173      For Database Drop, type must be set to <literal>drop</literal> in
1174      <function>ZOOM_package_send</function>.
1175     </para>
1176     
1177     <table frame="top" id="zoom.database.drop.options">
1178      <title>Database Drop Options</title>
1179      <tgroup cols="3">
1180       <colspec colwidth="4*" colname="name"></colspec>
1181       <colspec colwidth="7*" colname="description"></colspec>
1182       <colspec colwidth="3*" colname="default"></colspec>
1183       <thead>
1184        <row>
1185         <entry>Option</entry>
1186         <entry>Description</entry>
1187         <entry>Default</entry>
1188        </row>
1189       </thead>
1190       <tbody>
1191        <row>
1192         <entry>databaseName</entry>
1193         <entry>Database from connection object</entry>
1194         <entry>Default</entry>
1195        </row>
1196       </tbody>
1197      </tgroup>
1198     </table>
1199    </sect2>
1200    
1201    <sect2 id="zoom.commit"><title>Commit Operation</title>
1202     <para>
1203      For Commit, type must be set to <literal>commit</literal> in
1204      <function>ZOOM_package_send</function>.
1205     </para>
1206    </sect2>
1207
1208    <sect2 id="zoom.extended.services.behavior">
1209     <title>Protocol behavior</title>
1210     <para>
1211      All the extended services are Z39.50-only.
1212     </para>
1213     <note>
1214      <para>
1215       The database create, drop and commit services are privately defined
1216       operations.
1217       Refer to <filename>esadmin.asn</filename> in YAZ for the ASN.1
1218       definitions.
1219      </para>
1220     </note>
1221    </sect2>
1222   </sect1>
1223
1224   <sect1 id="zoom.options"><title>Options</title>
1225    <para>
1226     Most &zoom; objects provide a way to specify options to change behavior.
1227     From an implementation point of view a set of options is just like
1228     an associative array / hash.
1229    </para>
1230    <synopsis>
1231      ZOOM_options ZOOM_options_create (void);
1232
1233      ZOOM_options ZOOM_options_create_with_parent (ZOOM_options parent);
1234
1235      void ZOOM_options_destroy (ZOOM_options opt);
1236    </synopsis>
1237    <synopsis>
1238      const char *ZOOM_options_get (ZOOM_options opt, const char *name);
1239
1240      void ZOOM_options_set (ZOOM_options opt, const char *name,
1241                             const char *v);
1242    </synopsis>
1243    <synopsis>
1244      typedef const char *(*ZOOM_options_callback)
1245                                      (void *handle, const char *name);
1246
1247      ZOOM_options_callback
1248              ZOOM_options_set_callback (ZOOM_options opt,
1249                                         ZOOM_options_callback c,
1250                                         void *handle);
1251    </synopsis>
1252   </sect1>
1253   <sect1 id="zoom.events"><title>Events</title>
1254    <para>
1255     If you're developing non-blocking applications, you have to deal 
1256     with events.
1257    </para>
1258    <synopsis>
1259     int ZOOM_event (int no, ZOOM_connection *cs);
1260    </synopsis>
1261    <para>
1262     The <function>ZOOM_event</function> executes pending events for
1263     a number of connections. Supply the number of connections in
1264     <literal>no</literal> and an array of connections in
1265     <literal>cs</literal> (<literal>cs[0] ... cs[no-1]</literal>).
1266     A pending event could be a sending a search, receiving a response,
1267     etc.
1268     When an event has occurred for one of the connections, this function
1269     returns a positive integer <literal>n</literal> denoting that an event
1270     occurred for connection <literal>cs[n-1]</literal>.
1271     When no events are pending for the connections, a value of zero is
1272     returned.
1273     To ensure that all outstanding requests are performed call this function
1274     repeatedly until zero is returned.
1275    </para>
1276    <para>
1277     If <function>ZOOM_event</function> returns and returns non-zero, the
1278     last event that occurred can be expected.
1279    </para>
1280    <synopsis>
1281     int ZOOM_connection_last_event(ZOOM_connection cs);
1282    </synopsis>
1283    <para>
1284     <function>ZOOM_connection_last_event</function> returns an event type
1285     (integer) for the last event.
1286    </para>
1287
1288    <table frame="top" id="zoom.event.ids">
1289     <title>ZOOM Event IDs</title>
1290     <tgroup cols="2">
1291      <colspec colwidth="4*" colname="name"></colspec>
1292      <colspec colwidth="7*" colname="description"></colspec>
1293      <thead>
1294       <row>
1295        <entry>Event</entry>
1296        <entry>Description</entry>
1297       </row>
1298      </thead>
1299      <tbody>
1300       <row>
1301        <entry>ZOOM_EVENT_NONE</entry>
1302        <entry>No event has occurred</entry>
1303       </row>
1304       <row>
1305        <entry>ZOOM_EVENT_CONNECT</entry>
1306        <entry>TCP/IP connect has initiated</entry>
1307       </row>
1308       <row>
1309        <entry>ZOOM_EVENT_SEND_DATA</entry>
1310        <entry>Data has been transmitted (sending)</entry>
1311       </row>
1312       <row>
1313        <entry>ZOOM_EVENT_RECV_DATA</entry>
1314        <entry>Data has been received)</entry>
1315       </row>
1316       <row>
1317        <entry>ZOOM_EVENT_TIMEOUT</entry>
1318        <entry>Timeout</entry>
1319       </row>
1320       <row>
1321        <entry>ZOOM_EVENT_UNKNOWN</entry>
1322        <entry>Unknown event</entry>
1323       </row>
1324       <row>
1325        <entry>ZOOM_EVENT_SEND_APDU</entry>
1326        <entry>An APDU has been transmitted (sending)</entry>
1327       </row>
1328       <row>
1329        <entry>ZOOM_EVENT_RECV_APDU</entry>
1330        <entry>An APDU has been received</entry>
1331       </row>
1332       <row>
1333        <entry>ZOOM_EVENT_RECV_RECORD</entry>
1334        <entry>A result-set record has been received</entry>
1335       </row>
1336       <row>
1337        <entry>ZOOM_EVENT_RECV_SEARCH</entry>
1338        <entry>A search result been received</entry>
1339       </row>
1340      </tbody>
1341     </tgroup>
1342    </table>
1343   </sect1>
1344  </chapter>
1345  
1346  <!-- Keep this comment at the end of the file
1347  Local variables:
1348  mode: sgml
1349  sgml-omittag:t
1350  sgml-shorttag:t
1351  sgml-minimize-attributes:nil
1352  sgml-always-quote-attributes:t
1353  sgml-indent-step:1
1354  sgml-indent-data:t
1355  sgml-parent-document: "yaz.xml"
1356  sgml-local-catalogs: nil
1357  sgml-namecase-general:t
1358  End:
1359  -->
1360