Added chapter about YAZ client.
authorAdam Dickmeiss <adam@indexdata.dk>
Wed, 8 Aug 2001 19:33:21 +0000 (19:33 +0000)
committerAdam Dickmeiss <adam@indexdata.dk>
Wed, 8 Aug 2001 19:33:21 +0000 (19:33 +0000)
doc/Makefile.am
doc/asn.xml
doc/client.xml [new file with mode: 0644]
doc/tools.xml
doc/yaz.xml

index f43dad3..1efb114 100644 (file)
@@ -1,4 +1,4 @@
-## $Id: Makefile.am,v 1.13 2001-07-20 21:34:36 adam Exp $
+## $Id: Makefile.am,v 1.14 2001-08-08 19:33:21 adam Exp $
 
 docdir=$(pkgdatadir)/doc
 
@@ -36,7 +36,8 @@ yaz.html: $(srcdir)/yaz.sgml
 XMLFILES=$(srcdir)/yaz.xml $(srcdir)/introduction.xml \
  $(srcdir)/installation.xml $(srcdir)/indexdata.xml $(srcdir)/asn.xml \
  $(srcdir)/tools.xml $(srcdir)/odr.xml $(srcdir)/comstack.xml \
- $(srcdir)/frontend.xml $(srcdir)/license.xml $(srcdir)/future.xml 
+ $(srcdir)/frontend.xml $(srcdir)/license.xml $(srcdir)/future.xml  \
+ $(srcdir)/client.xml
 
 $(srcdir)/book1.html: $(XMLFILES) $(srcdir)/yazhtml.dsl
        cd $(srcdir); jade -E14 -d yazhtml.dsl -t sgml xml.dcl yaz.xml
index 36da812..453e856 100644 (file)
-<!-- $Id: asn.xml,v 1.5 2001-07-20 21:34:36 adam Exp $ -->
-<chapter><title>The ASN Module</title>
- <sect1><title>Introduction</title>
-  <para>
-   The &asn; module provides you with a set of C struct definitions for the
-   various PDUs of the protocol, as well as for the complex types
-   appearing within the PDUs. For the primitive data types, the C
-   representation often takes the form of an ordinary C language type,
-   such as <literal>int</literal>. For ASN.1 constructs that have no direct
-   representation in C, such as general octet strings and bit strings,
-   the &odr; module (see section <link linkend="odr">The ODR Module</link>)
-   provides auxiliary definitions.
-  </para>
- </sect1>
- <sect1><title>Preparing PDUs</title>
-  
-  <para>
-   A structure representing a complex ASN.1 type doesn't in itself contain the
-   members of that type. Instead, the structure contains
-   <emphasis>pointers</emphasis> to the members of the type.
-   This is necessary, in part, to allow a mechanism for specifying which
-   of the optional structure (SEQUENCE) members are present, and which
-   are not. It follows that you will need to somehow provide space for
-   the individual members of the structure, and set the pointers to
-   refer to the members.
-  </para>
-  <para>
-   The conversion routines don't care how you allocate and maintain your
-   C structures - they just follow the pointers that you provide.
-   Depending on the complexity of your application, and your personal
-   taste, there are at least three different approaches that you may take
-   when you allocate the structures.
-  </para>
-  
-  <para>
-   You can use static or automatic local variables in the function that
-   prepares the PDU. This is a simple approach, and it provides the most
-   efficient form of memory management. While it works well for flat
-   PDUs like the InitReqest, it will generally not be sufficient for say,
-   the generation of an arbitrarily complex RPN query structure.
-  </para>
-  <para>
-   You can individually create the structure and its members using the
-   <function>malloc(2)</function> function. If you want to ensure that
-   the data is freed when it is no longer needed, you will have to
-   define a function that individually releases each member of a
-   structure before freeing the structure itself.
-  </para>
-  <para>
-   You can use the <function>odr_malloc()</function> function (see section 
-   <link linkend="odr-use">Using ODR</link> for details). When you use
-   <function>odr_malloc()</function>, you can release all of the
-   allocated data in a single operation, independent of any pointers and
-   relations between the data. <function>odr_malloc()</function> is based on a
-   &quot;nibble-memory&quot;
-   scheme, in which large portions of memory are allocated, and then
-   gradually handed out with each call to <function>odr_malloc()</function>.
-   The next time you call <function>odr_reset()</function>, all of the
-   memory allocated since the last call is recycled for future use (actually,
-   it is placed on a free-list).
-  </para>
-  <para>
-   You can combine all of the methods described here. This will often be
-   the most practical approach. For instance, you might use
-   <function>odr_malloc()</function> to allocate an entire structure and
-   some of its elements, while you leave other elements pointing to global
-   or per-session default variables.
-  </para>
-  
-  <para>
-   The &asn; module provides an important aid in creating new PDUs. For
-   each of the PDU types (say, <function>Z_InitRequest</function>), a
-   function is provided that allocates and initializes an instance of
-   that PDU type for you. In the case of the InitRequest, the function is
-   simply named <function>zget_InitRequest()</function>, and it sets up
-   reasonable default value for all of the mandatory members. The optional
-   members are generally initialized to null pointers. This last aspect
-   is very important: it ensures that if the PDU definitions are
-   extended after you finish your implementation (to accommodate
-   new versions of the protocol, say), you won't get into trouble with
-   uninitialized pointers in your structures. The functions use
-   <function>odr_malloc()</function> to
-   allocate the PDUs and its members, so you can free everything again with a
-   single call to <function>odr_reset()</function>. We strongly recommend
-   that you use the <literal>zget_*</literal>
-   functions whenever you are preparing a PDU (in a C++ API, the
-   <literal>zget_</literal>
-   functions would probably be promoted to constructors for the
-   individual types).
-  </para>
-  <para>
+<!-- $Id: asn.xml,v 1.6 2001-08-08 19:33:21 adam Exp $ -->
+ <chapter><title>The ASN Module</title>
+  <sect1><title>Introduction</title>
+   <para>
+    The &asn; module provides you with a set of C struct definitions for the
+    various PDUs of the protocol, as well as for the complex types
+    appearing within the PDUs. For the primitive data types, the C
+    representation often takes the form of an ordinary C language type,
+    such as <literal>int</literal>. For ASN.1 constructs that have no direct
+    representation in C, such as general octet strings and bit strings,
+    the &odr; module (see section <link linkend="odr">The ODR Module</link>)
+    provides auxiliary definitions.
+   </para>
+  </sect1>
+  <sect1><title>Preparing PDUs</title>
+   
+   <para>
+    A structure representing a complex ASN.1 type doesn't in itself contain the
+    members of that type. Instead, the structure contains
+    <emphasis>pointers</emphasis> to the members of the type.
+    This is necessary, in part, to allow a mechanism for specifying which
+    of the optional structure (SEQUENCE) members are present, and which
+    are not. It follows that you will need to somehow provide space for
+    the individual members of the structure, and set the pointers to
+    refer to the members.
+   </para>
+   <para>
+    The conversion routines don't care how you allocate and maintain your
+    C structures - they just follow the pointers that you provide.
+    Depending on the complexity of your application, and your personal
+    taste, there are at least three different approaches that you may take
+    when you allocate the structures.
+   </para>
+   
+   <para>
+    You can use static or automatic local variables in the function that
+    prepares the PDU. This is a simple approach, and it provides the most
+    efficient form of memory management. While it works well for flat
+    PDUs like the InitReqest, it will generally not be sufficient for say,
+    the generation of an arbitrarily complex RPN query structure.
+   </para>
+   <para>
+    You can individually create the structure and its members using the
+    <function>malloc(2)</function> function. If you want to ensure that
+    the data is freed when it is no longer needed, you will have to
+    define a function that individually releases each member of a
+    structure before freeing the structure itself.
+   </para>
+   <para>
+    You can use the <function>odr_malloc()</function> function (see section 
+    <link linkend="odr-use">Using ODR</link> for details). When you use
+    <function>odr_malloc()</function>, you can release all of the
+    allocated data in a single operation, independent of any pointers and
+    relations between the data. <function>odr_malloc()</function> is based on a
+    &quot;nibble-memory&quot;
+    scheme, in which large portions of memory are allocated, and then
+    gradually handed out with each call to <function>odr_malloc()</function>.
+    The next time you call <function>odr_reset()</function>, all of the
+    memory allocated since the last call is recycled for future use (actually,
+    it is placed on a free-list).
+   </para>
+   <para>
+    You can combine all of the methods described here. This will often be
+    the most practical approach. For instance, you might use
+    <function>odr_malloc()</function> to allocate an entire structure and
+    some of its elements, while you leave other elements pointing to global
+    or per-session default variables.
+   </para>
+   
+   <para>
+    The &asn; module provides an important aid in creating new PDUs. For
+    each of the PDU types (say, <function>Z_InitRequest</function>), a
+    function is provided that allocates and initializes an instance of
+    that PDU type for you. In the case of the InitRequest, the function is
+    simply named <function>zget_InitRequest()</function>, and it sets up
+    reasonable default value for all of the mandatory members. The optional
+    members are generally initialized to null pointers. This last aspect
+    is very important: it ensures that if the PDU definitions are
+    extended after you finish your implementation (to accommodate
+    new versions of the protocol, say), you won't get into trouble with
+    uninitialized pointers in your structures. The functions use
+    <function>odr_malloc()</function> to
+    allocate the PDUs and its members, so you can free everything again with a
+    single call to <function>odr_reset()</function>. We strongly recommend
+    that you use the <literal>zget_*</literal>
+    functions whenever you are preparing a PDU (in a C++ API, the
+    <literal>zget_</literal>
+    functions would probably be promoted to constructors for the
+    individual types).
+   </para>
+   <para>
    The prototype for the individual PDU types generally look like this:
-  </para>
-  <synopsis>
+   </para>
+   <synopsis>
     Z_&lt;type> *zget_&lt;type>(ODR o);
-  </synopsis>
-
-  <para>
+   </synopsis>
+   
+   <para>
     eg.:
-  </para>
-
-  <synopsis>
+   </para>
+   
+   <synopsis>
     Z_InitRequest *zget_InitRequest(ODR o);
-  </synopsis>
+   </synopsis>
 
-  <para>
+   <para>
    The &odr; handle should generally be your encoding stream, but it
-   needn't be.
-  </para>
-  <para>
+    needn't be.
+   </para>
+   <para>
    As well as the individual PDU functions, a function
-   <function>zget_APDU()</function> is provided, which allocates
-   a toplevel Z-APDU of the type requested:
-  </para>
-
-  <synopsis>
+    <function>zget_APDU()</function> is provided, which allocates
+    a toplevel Z-APDU of the type requested:
+   </para>
+   
+   <synopsis>
     Z_APDU *zget_APDU(ODR o, int which);
-  </synopsis>
-
-  <para>
-   The <varname>which</varname> parameter is (of course) the discriminator
-   belonging to the <varname>Z_APDU</varname> <literal>CHOICE</literal> type.
-   All of the interface described here is provided by the &asn; module, and
-   you access it through the <filename>proto.h</filename> header file.
-
-  </para>
- </sect1>
- <sect1><title id="oid">Object Identifiers</title>
+   </synopsis>
+   
+   <para>
+    The <varname>which</varname> parameter is (of course) the discriminator
+    belonging to the <varname>Z_APDU</varname> <literal>CHOICE</literal> type.
+    All of the interface described here is provided by the &asn; module, and
+    you access it through the <filename>proto.h</filename> header file.
+    
+   </para>
+  </sect1>
+  <sect1><title id="oid">Object Identifiers</title>
   <para>
-   When you refer to object identifiers in your application, you need to
-   be aware that SR and Z39.50 use two different set of OIDs to refer to
-   the same objects. To handle this easily, &yaz; provides a utility module
-   to &asn; which provides an internal representation of the OIDs used in
-   both protocols. Each oid is described by a structure:
-  </para>
-
-  <screen>
+    When you refer to object identifiers in your application, you need to
+    be aware that SR and Z39.50 use two different set of OIDs to refer to
+    the same objects. To handle this easily, &yaz; provides a utility module
+    to &asn; which provides an internal representation of the OIDs used in
+    both protocols. Each oid is described by a structure:
+   </para>
+   
+   <screen>
 typedef struct oident
 {
     enum oid_proto proto;
@@ -143,63 +143,63 @@ typedef struct oident
     int oidsuffix[OID_SIZE];
     char *desc;
 } oident;
-  </screen>
-  
-  <para>
-   The <literal>proto</literal> field can be set to either
-   <literal>PROTO_SR</literal> or <literal>PROTO_Z3950</literal>.
-   The <literal>class</literal> might be, say,
-   <literal>CLASS_RECSYN</literal>, and the <literal>value</literal> might be
+   </screen>
+   
+   <para>
+    The <literal>proto</literal> field can be set to either
+    <literal>PROTO_SR</literal> or <literal>PROTO_Z3950</literal>.
+    The <literal>class</literal> might be, say,
+    <literal>CLASS_RECSYN</literal>, and the <literal>value</literal> might be
     <literal>VAL_USMARC</literal> for the USMARC record format. Functions
-  </para>
-  
-  <screen>
+   </para>
+   
+   <screen>
 int *oid_ent_to_oid(struct oident *ent, int *dst);
 struct oident *oid_getentbyoid(int *o);
-  </screen>
-  
-  <para>
-   are provided to map between object identifiers and database entries.
-   If you store a member of the <literal>oid_proto</literal> type in
-   your association state information, it's a simple matter, at runtime,
-   to generate the correct OID when you need it. For decoding, you can
-   simply ignore the proto field, or if you're strict, you can verify
-   that your peer is using the OID family from the correct protocol.
-   The <literal>desc</literal> field is a short, human-readable name
-   for the PDU, useful mainly for diagnostic output.
-  </para>
-  
-  <note>
+   </screen>
+   
    <para>
-    The old function <function>oid_getoidbyent</function> still exists but
-    is not thread safe. Use <function>oid_ent_to_oid</function> instead
-    and pass an array of size <literal>OID_SIZE</literal>.
+    are provided to map between object identifiers and database entries.
+    If you store a member of the <literal>oid_proto</literal> type in
+    your association state information, it's a simple matter, at runtime,
+    to generate the correct OID when you need it. For decoding, you can
+    simply ignore the proto field, or if you're strict, you can verify
+    that your peer is using the OID family from the correct protocol.
+    The <literal>desc</literal> field is a short, human-readable name
+    for the PDU, useful mainly for diagnostic output.
    </para>
-  </note>
+   
+   <note>
+    <para>
+     The old function <function>oid_getoidbyent</function> still exists but
+     is not thread safe. Use <function>oid_ent_to_oid</function> instead
+     and pass an array of size <literal>OID_SIZE</literal>.
+    </para>
+   </note>
+   
+   <note>
+    <para>
+     Plans are underway to merge the two protocols into a single
+     definition, with one set of object identifiers. When this happens, the
+     oid module will no longer be required to support protocol
+     independence, but it should still be useful as a simple OID database.
+    </para>
+   </note>
   
-  <note>
+  </sect1>
+  <sect1><title>EXTERNAL Data</title>
+   
    <para>
-    Plans are underway to merge the two protocols into a single
-    definition, with one set of object identifiers. When this happens, the
-    oid module will no longer be required to support protocol
-    independence, but it should still be useful as a simple OID database.
+    In order to achieve extensibility and adaptability to different
+    application domains, the new version of the protocol defines many
+    structures outside of the main ASN.1 specification, referencing them
+    through ASN.1 EXTERNAL constructs. To simplify the construction and
+    access to the externally referenced data, the &asn; module defines a
+    specialized version of the EXTERNAL construct, called
+    <literal>Z_External</literal>.It is defined thus:
    </para>
-  </note>
-  
- </sect1>
- <sect1><title>EXTERNAL Data</title>
-
-  <para>
-   In order to achieve extensibility and adaptability to different
-   application domains, the new version of the protocol defines many
-   structures outside of the main ASN.1 specification, referencing them
-   through ASN.1 EXTERNAL constructs. To simplify the construction and
-   access to the externally referenced data, the &asn; module defines a
-   specialized version of the EXTERNAL construct, called
-   <literal>Z_External</literal>.It is defined thus:
-  </para>
-  
-  <screen>
+   
+   <screen>
 typedef struct Z_External
 {
     Odr_oid *direct_reference;
@@ -238,112 +238,112 @@ typedef struct Z_External
 
     } u;
 } Z_External;
-  </screen>
-  
-  <para>
-   When decoding, the &asn; module will attempt to determine which
-   syntax describes the data by looking at the reference fields
-   (currently only the direct-reference). For ASN.1 structured data, you
-   need only consult the <literal>which</literal> field to determine the
-   type of data. You can the access  the data directly through the union.
-   When constructing data for encoding, you set the union pointer to point
-   to the data, and set the <literal>which</literal> field accordingly.
+   </screen>
+   
+   <para>
+    When decoding, the &asn; module will attempt to determine which
+    syntax describes the data by looking at the reference fields
+    (currently only the direct-reference). For ASN.1 structured data, you
+    need only consult the <literal>which</literal> field to determine the
+    type of data. You can the access  the data directly through the union.
+    When constructing data for encoding, you set the union pointer to point
+    to the data, and set the <literal>which</literal> field accordingly.
     Remember also to set the direct (or indirect) reference to the correct
-   OID for the data type.
-   For non-ASN.1 data such as MARC records, use the
-   <literal>octet_aligned</literal> arm of the union.
-  </para>
-  
-  <para>
-   Some servers return ASN.1 structured data values (eg. database
-   records) as BER-encoded records placed in the
-   <literal>octet-aligned</literal> branch of the EXTERNAL CHOICE.
-   The ASN-module will <emphasis>not</emphasis> automatically decode
-   these records. To help you decode the records in the application, the
-   function
-  </para>
-
-  <screen>
+    OID for the data type.
+    For non-ASN.1 data such as MARC records, use the
+    <literal>octet_aligned</literal> arm of the union.
+   </para>
+   
+   <para>
+    Some servers return ASN.1 structured data values (eg. database
+    records) as BER-encoded records placed in the
+    <literal>octet-aligned</literal> branch of the EXTERNAL CHOICE.
+    The ASN-module will <emphasis>not</emphasis> automatically decode
+    these records. To help you decode the records in the application, the
+    function
+   </para>
+   
+   <screen>
    Z_ext_typeent *z_ext_gettypebyref(oid_value ref);
-  </screen>
+   </screen>
 
-  <para>
-   Can be used to retrieve information about the known, external data
-   types. The function return a pointer to a static area, or NULL, if no
-   match for the given direct reference is found. The
-   <literal>Z_ext_typeent</literal>
-   is defined as:
-  </para>
+   <para>
+    Can be used to retrieve information about the known, external data
+    types. The function return a pointer to a static area, or NULL, if no
+    match for the given direct reference is found. The
+    <literal>Z_ext_typeent</literal>
+    is defined as:
+   </para>
   
-  <screen>
+   <screen>
 typedef struct Z_ext_typeent
 {
     oid_value dref;    /* the direct-reference OID value. */
     int what;          /* discriminator value for the external CHOICE */
     Odr_fun fun;       /* decoder function */
 } Z_ext_typeent;
-  </screen>
-  
-  <para>
-   The <literal>what</literal> member contains the
-   <literal>Z_External</literal> union discriminator value for the
-   given type: For the SUTRS record syntax, the value would be
-   <literal>Z_External_sutrs</literal>.
-   The <literal>fun</literal> member contains a pointer to the
-   function which encodes/decodes the given type. Again, for the SUTRS
-   record syntax, the value of <literal>fun</literal> would be
-   <literal>z_SUTRS</literal> (a function pointer).
+   </screen>
+   
+   <para>
+    The <literal>what</literal> member contains the
+    <literal>Z_External</literal> union discriminator value for the
+    given type: For the SUTRS record syntax, the value would be
+    <literal>Z_External_sutrs</literal>.
+    The <literal>fun</literal> member contains a pointer to the
+    function which encodes/decodes the given type. Again, for the SUTRS
+    record syntax, the value of <literal>fun</literal> would be
+    <literal>z_SUTRS</literal> (a function pointer).
    </para>
-  
-  <para>
-   If you receive an EXTERNAL which contains an octet-string value that
-   you suspect of being an ASN.1-structured data value, you can use
-   <literal>z_ext_gettypebyref</literal> to look for the provided
-   direct-reference.
-   If the return value is different from NULL, you can use the provided
-   function to decode the BER string (see section <link linkend="odr-use">
-    Using ODR</link>).
-  </para>
-  
-  <para>
-   If you want to <emphasis>send</emphasis> EXTERNALs containing
-   ASN.1-structured values in the occtet-aligned branch of the CHOICE, this
-   is possible too. However, on the encoding phase, it requires a somewhat
-   involved juggling around of the various buffers involved.
-  </para>
-  <para>
-   If you need to add new, externally defined data types, you must update
-   the struct above, in the source file <filename>prt-ext.h</filename>, as
-   well as the encoder/decoder in the file <filename>prt-ext.c</filename>.
-   When changing the latter, remember to update both the
-   <literal>arm</literal> arrary and the list
-   <literal>type_table</literal>, which drives the CHOICE biasing that
-   is necessary to tell the different, structured types apart
-   on decoding.
-  </para>
-  
-  <note>
+   
    <para>
-    Eventually, the EXTERNAL processing will most likely
-    automatically insert the correct OIDs or indirect-refs. First,
-    however, we need to determine how application-context management
-    (specifically the presentation-context-list) should fit into the
-    various modules.
+    If you receive an EXTERNAL which contains an octet-string value that
+    you suspect of being an ASN.1-structured data value, you can use
+    <literal>z_ext_gettypebyref</literal> to look for the provided
+    direct-reference.
+    If the return value is different from NULL, you can use the provided
+    function to decode the BER string (see section <link linkend="odr-use">
+     Using ODR</link>).
    </para>
-  </note>
-  
- </sect1>
- <sect1><title>PDU Contents Table</title>
+   
+   <para>
+    If you want to <emphasis>send</emphasis> EXTERNALs containing
+    ASN.1-structured values in the occtet-aligned branch of the CHOICE, this
+    is possible too. However, on the encoding phase, it requires a somewhat
+    involved juggling around of the various buffers involved.
+   </para>
+   <para>
+    If you need to add new, externally defined data types, you must update
+    the struct above, in the source file <filename>prt-ext.h</filename>, as
+    well as the encoder/decoder in the file <filename>prt-ext.c</filename>.
+    When changing the latter, remember to update both the
+    <literal>arm</literal> arrary and the list
+    <literal>type_table</literal>, which drives the CHOICE biasing that
+    is necessary to tell the different, structured types apart
+    on decoding.
+   </para>
+   
+   <note>
+    <para>
+     Eventually, the EXTERNAL processing will most likely
+     automatically insert the correct OIDs or indirect-refs. First,
+     however, we need to determine how application-context management
+     (specifically the presentation-context-list) should fit into the
+     various modules.
+    </para>
+   </note>
   
+  </sect1>
+  <sect1><title>PDU Contents Table</title>
+   
   <para>
-   We include, for reference, a listing of the fields of each top-level
-   PDU, as well as their default settings.
-  </para>
-  
-  <table frame="top"><title>Default settings for PDU Initialize Request</title>
-   <tgroup cols="3">
-    <colspec colname="field"></colspec>
-    <colspec colname="type"></colspec>
+    We include, for reference, a listing of the fields of each top-level
+    PDU, as well as their default settings.
+   </para>
+   
+   <table frame="top"><title>Default settings for PDU Initialize Request</title>
+    <tgroup cols="3">
+     <colspec colname="field"></colspec>
+     <colspec colname="type"></colspec>
     <colspec colname="value"></colspec>
     <thead>
      <row>
@@ -397,658 +397,658 @@ typedef struct Z_ext_typeent
     <colspec colname="type"></colspec>
     <colspec colname="value"></colspec>
     <thead>
-     <row>
-      <entry>Field</entry>
-      <entry>Type</entry>
-      <entry>Default Value</entry>
-     </row>
-    </thead>
-    <tbody>
-     <row><entry>
-       referenceId</entry><entry>Z_ReferenceId</entry><entry>NULL
-      </entry></row>
-     <row><entry>
-       protocolVersion</entry><entry>Odr_bitmask</entry><entry>Empty bitmask
-      </entry></row>
-     <row><entry>
-       options</entry><entry>Odr_bitmask</entry><entry>Empty bitmask
-      </entry></row>
-     <row><entry>
-       preferredMessageSize</entry><entry>int</entry><entry>30*1024
-      </entry></row>
-     <row><entry>
-       maximumRecordSize</entry><entry>int</entry><entry>30*1024
-      </entry></row>
-     <row><entry>
-       result</entry><entry>bool_t</entry><entry>TRUE
-      </entry></row>
-     <row><entry>
-       implementationId</entry><entry>char*</entry><entry>"YAZ (id=81)"
-      </entry></row>
-     <row><entry>
-       implementationName</entry><entry>char*</entry><entry>"Index Data/YAZ"
-      </entry></row>
-     <row><entry>
-       implementationVersion</entry><entry>char*</entry><entry>YAZ_VERSION
-      </entry></row>
-     <row><entry>
-       userInformationField</entry><entry>Z_UserInformation</entry><entry>NULL
-      </entry></row>
-     <row><entry>
-       otherInfo</entry><entry>Z_OtherInformation</entry><entry>NULL
-      </entry></row>
-    </tbody>
-   </tgroup>
-  </table>
+      <row>
+       <entry>Field</entry>
+       <entry>Type</entry>
+       <entry>Default Value</entry>
+      </row>
+     </thead>
+     <tbody>
+      <row><entry>
+       referenceId</entry><entry>Z_ReferenceId</entry><entry>NULL
+       </entry></row>
+      <row><entry>
+       protocolVersion</entry><entry>Odr_bitmask</entry><entry>Empty bitmask
+       </entry></row>
+      <row><entry>
+       options</entry><entry>Odr_bitmask</entry><entry>Empty bitmask
+       </entry></row>
+      <row><entry>
+       preferredMessageSize</entry><entry>int</entry><entry>30*1024
+       </entry></row>
+      <row><entry>
+       maximumRecordSize</entry><entry>int</entry><entry>30*1024
+       </entry></row>
+      <row><entry>
+       result</entry><entry>bool_t</entry><entry>TRUE
+       </entry></row>
+      <row><entry>
+       implementationId</entry><entry>char*</entry><entry>"YAZ (id=81)"
+       </entry></row>
+      <row><entry>
+       implementationName</entry><entry>char*</entry><entry>"Index Data/YAZ"
+       </entry></row>
+      <row><entry>
+       implementationVersion</entry><entry>char*</entry><entry>YAZ_VERSION
+       </entry></row>
+      <row><entry>
+       userInformationField</entry><entry>Z_UserInformation</entry><entry>NULL
+       </entry></row>
+      <row><entry>
+       otherInfo</entry><entry>Z_OtherInformation</entry><entry>NULL
+       </entry></row>
+     </tbody>
+    </tgroup>
+   </table>
 
-  <table frame="top"><title>Default settings for PDU Search Request</title>
-   <tgroup cols="3">
-    <colspec colname="field"></colspec>
-    <colspec colname="type"></colspec>
-    <colspec colname="value"></colspec>
-    <thead>
-     <row>
-      <entry>Field</entry>
-      <entry>Type</entry>
-      <entry>Default Value</entry>
-     </row>
-    </thead>
-    <tbody>
-     <row><entry>
-       referenceId</entry><entry>Z_ReferenceId</entry><entry>NULL
-      </entry></row>
-     <row><entry>
-       smallSetUpperBound</entry><entry>int</entry><entry>0
-      </entry></row>
-     <row><entry>
-       largeSetLowerBound</entry><entry>int</entry><entry>1
-      </entry></row>
-     <row><entry>
-       mediumSetPresentNumber</entry><entry>int</entry><entry>0
-      </entry></row>
-     <row><entry>
-       replaceIndicator</entry><entry>bool_t</entry><entry>TRUE
-      </entry></row>
-     <row><entry>
-       resultSetName</entry><entry>char *</entry><entry>"default"
-      </entry></row>
-     <row><entry>
-       num_databaseNames</entry><entry>int</entry><entry>0
-      </entry></row>
-     <row><entry>
-       databaseNames</entry><entry>char **</entry><entry>NULL
-      </entry></row>
-     <row><entry>
-       smallSetElementSetNames</entry><entry>Z_ElementSetNames
-      </entry><entry>NULL
-      </entry></row>
-     <row><entry>
-       mediumSetElementSetNames</entry><entry>Z_ElementSetNames
-      </entry><entry>NULL
-      </entry></row>
-     <row><entry>
-       preferredRecordSyntax</entry><entry>Odr_oid</entry><entry>NULL
-      </entry></row>
-     <row><entry>
-       query</entry><entry>Z_Query</entry><entry>NULL
-      </entry></row>
-     <row><entry>
-       additionalSearchInfo</entry><entry>Z_OtherInformation
-      </entry><entry>NULL
-      </entry></row>
-     <row><entry>
-       otherInfo</entry><entry>Z_OtherInformation</entry><entry>NULL
-      </entry></row>
-    </tbody>
-   </tgroup>
-  </table>
+   <table frame="top"><title>Default settings for PDU Search Request</title>
+    <tgroup cols="3">
+     <colspec colname="field"></colspec>
+     <colspec colname="type"></colspec>
+     <colspec colname="value"></colspec>
+     <thead>
+      <row>
+       <entry>Field</entry>
+       <entry>Type</entry>
+       <entry>Default Value</entry>
+      </row>
+     </thead>
+     <tbody>
+      <row><entry>
+       referenceId</entry><entry>Z_ReferenceId</entry><entry>NULL
+       </entry></row>
+      <row><entry>
+       smallSetUpperBound</entry><entry>int</entry><entry>0
+       </entry></row>
+      <row><entry>
+       largeSetLowerBound</entry><entry>int</entry><entry>1
+       </entry></row>
+      <row><entry>
+       mediumSetPresentNumber</entry><entry>int</entry><entry>0
+       </entry></row>
+      <row><entry>
+       replaceIndicator</entry><entry>bool_t</entry><entry>TRUE
+       </entry></row>
+      <row><entry>
+       resultSetName</entry><entry>char *</entry><entry>"default"
+       </entry></row>
+      <row><entry>
+       num_databaseNames</entry><entry>int</entry><entry>0
+       </entry></row>
+      <row><entry>
+       databaseNames</entry><entry>char **</entry><entry>NULL
+       </entry></row>
+      <row><entry>
+       smallSetElementSetNames</entry><entry>Z_ElementSetNames
+       </entry><entry>NULL
+       </entry></row>
+      <row><entry>
+       mediumSetElementSetNames</entry><entry>Z_ElementSetNames
+       </entry><entry>NULL
+       </entry></row>
+      <row><entry>
+       preferredRecordSyntax</entry><entry>Odr_oid</entry><entry>NULL
+       </entry></row>
+      <row><entry>
+       query</entry><entry>Z_Query</entry><entry>NULL
+       </entry></row>
+      <row><entry>
+       additionalSearchInfo</entry><entry>Z_OtherInformation
+       </entry><entry>NULL
+       </entry></row>
+      <row><entry>
+       otherInfo</entry><entry>Z_OtherInformation</entry><entry>NULL
+       </entry></row>
+     </tbody>
+    </tgroup>
+   </table>
 
-  <table frame="top"><title>Default settings for PDU Search Response</title>
-   <tgroup cols="3">
-    <colspec colname="field"></colspec>
-    <colspec colname="type"></colspec>
-    <colspec colname="value"></colspec>
-    <thead>
-     <row>
-      <entry>Field</entry>
-      <entry>Type</entry>
-      <entry>Default Value</entry>
-     </row>
-    </thead>
-    <tbody>
-     
-     <row><entry>
-       referenceId</entry><entry>Z_ReferenceId</entry><entry>NULL
-      </entry></row>
-     <row><entry>
-       resultCount</entry><entry>int</entry><entry>0
-      </entry></row>
-     <row><entry>
-       numberOfRecordsReturned</entry><entry>int</entry><entry>0
-      </entry></row>
-     <row><entry>
-       nextResultSetPosition</entry><entry>int</entry><entry>0
-      </entry></row>
-     <row><entry>
-       searchStatus</entry><entry>bool_t</entry><entry>TRUE
-      </entry></row>
-     <row><entry>
-       resultSetStatus</entry><entry>int</entry><entry>NULL
-      </entry></row>
-     <row><entry>
-       presentStatus</entry><entry>int</entry><entry>NULL
-      </entry></row>
-     <row><entry>
-       records</entry><entry>Z_Records</entry><entry>NULL
-      </entry></row>
-     <row><entry>
-       additionalSearchInfo</entry>
-      <entry>Z_OtherInformation</entry><entry>NULL
-      </entry></row>
-     <row><entry>
-       otherInfo</entry><entry>Z_OtherInformation</entry><entry>NULL
-      </entry></row>
-    </tbody>
-   </tgroup>
-  </table>
+   <table frame="top"><title>Default settings for PDU Search Response</title>
+    <tgroup cols="3">
+     <colspec colname="field"></colspec>
+     <colspec colname="type"></colspec>
+     <colspec colname="value"></colspec>
+     <thead>
+      <row>
+       <entry>Field</entry>
+       <entry>Type</entry>
+       <entry>Default Value</entry>
+      </row>
+     </thead>
+     <tbody>
+      
+      <row><entry>
+       referenceId</entry><entry>Z_ReferenceId</entry><entry>NULL
+       </entry></row>
+      <row><entry>
+       resultCount</entry><entry>int</entry><entry>0
+       </entry></row>
+      <row><entry>
+       numberOfRecordsReturned</entry><entry>int</entry><entry>0
+       </entry></row>
+      <row><entry>
+       nextResultSetPosition</entry><entry>int</entry><entry>0
+       </entry></row>
+      <row><entry>
+       searchStatus</entry><entry>bool_t</entry><entry>TRUE
+       </entry></row>
+      <row><entry>
+       resultSetStatus</entry><entry>int</entry><entry>NULL
+       </entry></row>
+      <row><entry>
+       presentStatus</entry><entry>int</entry><entry>NULL
+       </entry></row>
+      <row><entry>
+       records</entry><entry>Z_Records</entry><entry>NULL
+       </entry></row>
+      <row><entry>
+       additionalSearchInfo</entry>
+       <entry>Z_OtherInformation</entry><entry>NULL
+       </entry></row>
+      <row><entry>
+       otherInfo</entry><entry>Z_OtherInformation</entry><entry>NULL
+       </entry></row>
+     </tbody>
+    </tgroup>
+   </table>
 
-  <table frame="top"><title>Default settings for PDU Present Request</title>
-   <tgroup cols="3">
-    <colspec colname="field"></colspec>
-    <colspec colname="type"></colspec>
-    <colspec colname="value"></colspec>
-    <thead>
-     <row>
-      <entry>Field</entry>
-      <entry>Type</entry>
-      <entry>Default Value</entry>
-     </row>
-    </thead>
-    <tbody>
-     <row><entry>
-       referenceId</entry><entry>Z_ReferenceId</entry><entry>NULL
-      </entry></row>
-     <row><entry>
-       resultSetId</entry><entry>char*</entry><entry>"default"
-      </entry></row>
-     <row><entry>
-       resultSetStartPoint</entry><entry>int</entry><entry>1
-      </entry></row>
-     <row><entry>
-       numberOfRecordsRequested</entry><entry>int</entry><entry>10
-      </entry></row>
-     <row><entry>
-       num_ranges</entry><entry>int</entry><entry>0
-      </entry></row>
-     <row><entry>
-       additionalRanges</entry><entry>Z_Range</entry><entry>NULL
-      </entry></row>
-     <row><entry>
-       recordComposition</entry><entry>Z_RecordComposition</entry><entry>NULL
-      </entry></row>
-     <row><entry>
-       preferredRecordSyntax</entry><entry>Odr_oid</entry><entry>NULL
-      </entry></row>
-     <row><entry>
-       maxSegmentCount</entry><entry>int</entry><entry>NULL
-      </entry></row>
-     <row><entry>
-       maxRecordSize</entry><entry>int</entry><entry>NULL
-      </entry></row>
-     <row><entry>
-       maxSegmentSize</entry><entry>int</entry><entry>NULL
-      </entry></row>
-     <row><entry>
-       otherInfo</entry><entry>Z_OtherInformation</entry><entry>NULL
-      </entry></row>
-    </tbody>
-   </tgroup>
-  </table>
-  
-  <table frame="top"><title>Default settings for PDU Present Response</title>
-   <tgroup cols="3">
-    <colspec colname="field"></colspec>
-    <colspec colname="type"></colspec>
-    <colspec colname="value"></colspec>
-    <thead>
-     <row>
-      <entry>Field</entry>
-      <entry>Type</entry>
-      <entry>Default Value</entry>
-     </row>
-    </thead>
-    <tbody>
-     <row><entry>
-       referenceId</entry><entry>Z_ReferenceId</entry><entry>NULL
-      </entry></row>
-     <row><entry>
-       numberOfRecordsReturned</entry><entry>int</entry><entry>0
-      </entry></row>
-     <row><entry>
-       nextResultSetPosition</entry><entry>int</entry><entry>0
-      </entry></row>
-     <row><entry>
-       presentStatus</entry><entry>int</entry><entry>Z_PRES_SUCCESS
-      </entry></row>
-     <row><entry>
-       records</entry><entry>Z_Records</entry><entry>NULL
-      </entry></row>
-     <row><entry>
-       otherInfo</entry><entry>Z_OtherInformation</entry><entry>NULL
-      </entry></row>
-    </tbody>
-   </tgroup>
-  </table>
-  
-  <table frame="top"><title>Default settings for Delete Result Set Request
-   </title>
-   <tgroup cols="3">
-    <colspec colname="field"></colspec>
-    <colspec colname="type"></colspec>
-    <colspec colname="value"></colspec>
-    <thead>
-     <row>
-      <entry>Field</entry>
-      <entry>Type</entry>
-      <entry>Default Value</entry>
-     </row>
-    </thead>
-    <tbody>
-     <row><entry>referenceId
-      </entry><entry>Z_ReferenceId</entry><entry>NULL
-      </entry></row>
-     <row><entry>
-       deleteFunction</entry><entry>int</entry><entry>Z_DeleteRequest_list
-      </entry></row>
-     <row><entry>
-       num_ids</entry><entry>int</entry><entry>0
-      </entry></row>
-     <row><entry>
-       resultSetList</entry><entry>char**</entry><entry>NULL
-      </entry></row>
-     <row><entry>
-       otherInfo</entry><entry>Z_OtherInformation</entry><entry>NULL
-      </entry></row>
-    </tbody>
-   </tgroup>
-  </table>
+   <table frame="top"><title>Default settings for PDU Present Request</title>
+    <tgroup cols="3">
+     <colspec colname="field"></colspec>
+     <colspec colname="type"></colspec>
+     <colspec colname="value"></colspec>
+     <thead>
+      <row>
+       <entry>Field</entry>
+       <entry>Type</entry>
+       <entry>Default Value</entry>
+      </row>
+     </thead>
+     <tbody>
+      <row><entry>
+       referenceId</entry><entry>Z_ReferenceId</entry><entry>NULL
+       </entry></row>
+      <row><entry>
+       resultSetId</entry><entry>char*</entry><entry>"default"
+       </entry></row>
+      <row><entry>
+       resultSetStartPoint</entry><entry>int</entry><entry>1
+       </entry></row>
+      <row><entry>
+       numberOfRecordsRequested</entry><entry>int</entry><entry>10
+       </entry></row>
+      <row><entry>
+       num_ranges</entry><entry>int</entry><entry>0
+       </entry></row>
+      <row><entry>
+       additionalRanges</entry><entry>Z_Range</entry><entry>NULL
+       </entry></row>
+      <row><entry>
+       recordComposition</entry><entry>Z_RecordComposition</entry><entry>NULL
+       </entry></row>
+      <row><entry>
+       preferredRecordSyntax</entry><entry>Odr_oid</entry><entry>NULL
+       </entry></row>
+      <row><entry>
+       maxSegmentCount</entry><entry>int</entry><entry>NULL
+       </entry></row>
+      <row><entry>
+       maxRecordSize</entry><entry>int</entry><entry>NULL
+       </entry></row>
+      <row><entry>
+       maxSegmentSize</entry><entry>int</entry><entry>NULL
+       </entry></row>
+      <row><entry>
+       otherInfo</entry><entry>Z_OtherInformation</entry><entry>NULL
+       </entry></row>
+     </tbody>
+    </tgroup>
+   </table>
+   
+   <table frame="top"><title>Default settings for PDU Present Response</title>
+    <tgroup cols="3">
+     <colspec colname="field"></colspec>
+     <colspec colname="type"></colspec>
+     <colspec colname="value"></colspec>
+     <thead>
+      <row>
+       <entry>Field</entry>
+       <entry>Type</entry>
+       <entry>Default Value</entry>
+      </row>
+     </thead>
+     <tbody>
+      <row><entry>
+       referenceId</entry><entry>Z_ReferenceId</entry><entry>NULL
+       </entry></row>
+      <row><entry>
+       numberOfRecordsReturned</entry><entry>int</entry><entry>0
+       </entry></row>
+      <row><entry>
+       nextResultSetPosition</entry><entry>int</entry><entry>0
+       </entry></row>
+      <row><entry>
+       presentStatus</entry><entry>int</entry><entry>Z_PRES_SUCCESS
+       </entry></row>
+      <row><entry>
+       records</entry><entry>Z_Records</entry><entry>NULL
+       </entry></row>
+      <row><entry>
+       otherInfo</entry><entry>Z_OtherInformation</entry><entry>NULL
+       </entry></row>
+     </tbody>
+    </tgroup>
+   </table>
+   
+   <table frame="top"><title>Default settings for Delete Result Set Request
+    </title>
+    <tgroup cols="3">
+     <colspec colname="field"></colspec>
+     <colspec colname="type"></colspec>
+     <colspec colname="value"></colspec>
+     <thead>
+      <row>
+       <entry>Field</entry>
+       <entry>Type</entry>
+       <entry>Default Value</entry>
+      </row>
+     </thead>
+     <tbody>
+      <row><entry>referenceId
+       </entry><entry>Z_ReferenceId</entry><entry>NULL
+       </entry></row>
+      <row><entry>
+       deleteFunction</entry><entry>int</entry><entry>Z_DeleteRequest_list
+       </entry></row>
+      <row><entry>
+       num_ids</entry><entry>int</entry><entry>0
+       </entry></row>
+      <row><entry>
+       resultSetList</entry><entry>char**</entry><entry>NULL
+       </entry></row>
+      <row><entry>
+       otherInfo</entry><entry>Z_OtherInformation</entry><entry>NULL
+       </entry></row>
+     </tbody>
+    </tgroup>
+   </table>
 
-  <table frame="top"><title>Default settings for Delete Result Set Response
-   </title>
-   <tgroup cols="3">
-    <colspec colname="field"></colspec>
-    <colspec colname="type"></colspec>
-    <colspec colname="value"></colspec>
-    <thead>
-     <row>
-      <entry>Field</entry>
-      <entry>Type</entry>
-      <entry>Default Value</entry>
-     </row>
-    </thead>
-    <tbody>
-     <row><entry>
-       referenceId</entry><entry>Z_ReferenceId</entry><entry>NULL
-      </entry></row>
-     <row><entry>
-       deleteOperationStatus</entry><entry>int</entry>
-      <entry>Z_DeleteStatus_success</entry></row>
-     <row><entry>
-       num_statuses</entry><entry>int</entry><entry>0
-      </entry></row>
-     <row><entry>
-       deleteListStatuses</entry><entry>Z_ListStatus**</entry><entry>NULL
-      </entry></row>
-     <row><entry>
-       numberNotDeleted</entry><entry>int</entry><entry>NULL
-      </entry></row>
-     <row><entry>
-       num_bulkStatuses</entry><entry>int</entry><entry>0
-      </entry></row>
-     <row><entry>
-       bulkStatuses</entry><entry>Z_ListStatus</entry><entry>NUL
-       L</entry></row>
-     <row><entry>
-       deleteMessage</entry><entry>char*</entry><entry>NULL
-      </entry></row>
-     <row><entry>
-       otherInfo</entry><entry>Z_OtherInformation</entry><entry>NULL
-      </entry></row>
-    </tbody>
-   </tgroup>
-  </table>
+   <table frame="top"><title>Default settings for Delete Result Set Response
+    </title>
+    <tgroup cols="3">
+     <colspec colname="field"></colspec>
+     <colspec colname="type"></colspec>
+     <colspec colname="value"></colspec>
+     <thead>
+      <row>
+       <entry>Field</entry>
+       <entry>Type</entry>
+       <entry>Default Value</entry>
+      </row>
+     </thead>
+     <tbody>
+      <row><entry>
+       referenceId</entry><entry>Z_ReferenceId</entry><entry>NULL
+       </entry></row>
+      <row><entry>
+       deleteOperationStatus</entry><entry>int</entry>
+       <entry>Z_DeleteStatus_success</entry></row>
+      <row><entry>
+       num_statuses</entry><entry>int</entry><entry>0
+       </entry></row>
+      <row><entry>
+       deleteListStatuses</entry><entry>Z_ListStatus**</entry><entry>NULL
+       </entry></row>
+      <row><entry>
+       numberNotDeleted</entry><entry>int</entry><entry>NULL
+       </entry></row>
+      <row><entry>
+       num_bulkStatuses</entry><entry>int</entry><entry>0
+       </entry></row>
+      <row><entry>
+       bulkStatuses</entry><entry>Z_ListStatus</entry><entry>NUL
+       L</entry></row>
+      <row><entry>
+       deleteMessage</entry><entry>char*</entry><entry>NULL
+       </entry></row>
+      <row><entry>
+       otherInfo</entry><entry>Z_OtherInformation</entry><entry>NULL
+       </entry></row>
+     </tbody>
+    </tgroup>
+   </table>
 
-  <table frame="top"><title>Default settings for Scan Request
-   </title>
-   <tgroup cols="3">
-    <colspec colname="field"></colspec>
-    <colspec colname="type"></colspec>
-    <colspec colname="value"></colspec>
-    <thead>
-     <row>
-      <entry>Field</entry>
-      <entry>Type</entry>
-      <entry>Default Value</entry>
-     </row>
-    </thead>
-    <tbody>
-     <row><entry>
-       referenceId</entry><entry>Z_ReferenceId</entry><entry>NULL
-      </entry></row>
-     <row><entry>
-       num_databaseNames</entry><entry>int</entry><entry>0
-      </entry></row>
-     <row><entry>
-       databaseNames</entry><entry>char**</entry><entry>NULL
-      </entry></row>
-     <row><entry>
-       attributeSet</entry><entry>Odr_oid</entry><entry>NULL
-      </entry></row>
-     <row><entry>
-       termListAndStartPoint</entry><entry>Z_AttributesPlus...
-      </entry><entry>NULL</entry></row>
-     <row><entry>
-       stepSize</entry><entry>int</entry><entry>NULL
-      </entry></row>
-     <row><entry>
-       numberOfTermsRequested</entry><entry>int</entry><entry>20
-      </entry></row>
-     <row><entry>
-       preferredPositionInResponse</entry><entry>int</entry><entry>NULL
-      </entry></row>
-     <row><entry>
-       otherInfo</entry><entry>Z_OtherInformation</entry><entry>NULL
-      </entry></row>
-    </tbody>
-   </tgroup>
-  </table>
+   <table frame="top"><title>Default settings for Scan Request
+    </title>
+    <tgroup cols="3">
+     <colspec colname="field"></colspec>
+     <colspec colname="type"></colspec>
+     <colspec colname="value"></colspec>
+     <thead>
+      <row>
+       <entry>Field</entry>
+       <entry>Type</entry>
+       <entry>Default Value</entry>
+      </row>
+     </thead>
+     <tbody>
+      <row><entry>
+       referenceId</entry><entry>Z_ReferenceId</entry><entry>NULL
+       </entry></row>
+      <row><entry>
+       num_databaseNames</entry><entry>int</entry><entry>0
+       </entry></row>
+      <row><entry>
+       databaseNames</entry><entry>char**</entry><entry>NULL
+       </entry></row>
+      <row><entry>
+       attributeSet</entry><entry>Odr_oid</entry><entry>NULL
+       </entry></row>
+      <row><entry>
+       termListAndStartPoint</entry><entry>Z_AttributesPlus...
+       </entry><entry>NULL</entry></row>
+      <row><entry>
+       stepSize</entry><entry>int</entry><entry>NULL
+       </entry></row>
+      <row><entry>
+       numberOfTermsRequested</entry><entry>int</entry><entry>20
+       </entry></row>
+      <row><entry>
+       preferredPositionInResponse</entry><entry>int</entry><entry>NULL
+       </entry></row>
+      <row><entry>
+       otherInfo</entry><entry>Z_OtherInformation</entry><entry>NULL
+       </entry></row>
+     </tbody>
+    </tgroup>
+   </table>
 
-  <table frame="top"><title>Default settings for Scan Response
-   </title>
-   <tgroup cols="3">
-    <colspec colname="field"></colspec>
-    <colspec colname="type"></colspec>
-    <colspec colname="value"></colspec>
-    <thead>
-     <row>
-      <entry>Field</entry>
-      <entry>Type</entry>
-      <entry>Default Value</entry>
-     </row>
-    </thead>
-    <tbody>
-     
-     <row><entry>
-       referenceId</entry><entry>Z_ReferenceId</entry><entry>NULL
-      </entry></row>
-     <row><entry>
-       stepSize</entry><entry>int</entry><entry>NULL
-      </entry></row>
-     <row><entry>
-       scanStatus</entry><entry>int</entry><entry>Z_Scan_success
-      </entry></row>
-     <row><entry>
-       numberOfEntriesReturned</entry><entry>int</entry><entry>0
-      </entry></row>
-     <row><entry>
-       positionOfTerm</entry><entry>int</entry><entry>NULL
-      </entry></row>
-     <row><entry>
-       entries</entry><entry>Z_ListEntris</entry><entry>NULL
-      </entry></row>
-     <row><entry>
-       attributeSet</entry><entry>Odr_oid</entry><entry>NULL
-      </entry></row>
-     <row><entry>
-       otherInfo</entry><entry>Z_OtherInformation</entry><entry>NULL
-      </entry></row>
-    </tbody>
-   </tgroup>
-  </table>
+   <table frame="top"><title>Default settings for Scan Response
+    </title>
+    <tgroup cols="3">
+     <colspec colname="field"></colspec>
+     <colspec colname="type"></colspec>
+     <colspec colname="value"></colspec>
+     <thead>
+      <row>
+       <entry>Field</entry>
+       <entry>Type</entry>
+       <entry>Default Value</entry>
+      </row>
+     </thead>
+     <tbody>
+      
+      <row><entry>
+       referenceId</entry><entry>Z_ReferenceId</entry><entry>NULL
+       </entry></row>
+      <row><entry>
+       stepSize</entry><entry>int</entry><entry>NULL
+       </entry></row>
+      <row><entry>
+       scanStatus</entry><entry>int</entry><entry>Z_Scan_success
+       </entry></row>
+      <row><entry>
+       numberOfEntriesReturned</entry><entry>int</entry><entry>0
+       </entry></row>
+      <row><entry>
+       positionOfTerm</entry><entry>int</entry><entry>NULL
+       </entry></row>
+      <row><entry>
+       entries</entry><entry>Z_ListEntris</entry><entry>NULL
+       </entry></row>
+      <row><entry>
+       attributeSet</entry><entry>Odr_oid</entry><entry>NULL
+       </entry></row>
+      <row><entry>
+       otherInfo</entry><entry>Z_OtherInformation</entry><entry>NULL
+       </entry></row>
+     </tbody>
+    </tgroup>
+   </table>
 
-  <table frame="top"><title>Default settings for Trigger Resource
-    Control Request </title>
-   <tgroup cols="3">
-    <colspec colname="field"></colspec>
-    <colspec colname="type"></colspec>
-    <colspec colname="value"></colspec>
-    <thead>
-     <row>
-      <entry>Field</entry>
-      <entry>Type</entry>
-      <entry>Default Value</entry>
-     </row>
-    </thead>
-    <tbody>
-     
-     <row><entry>
-       referenceId</entry><entry>Z_ReferenceId</entry><entry>NULL
-      </entry></row>
-     <row><entry>
-       requestedAction</entry><entry>int</entry><entry>
-       Z_TriggerResourceCtrl_resou..
-      </entry></row>
-     <row><entry>
-       prefResourceReportFormat</entry><entry>Odr_oid</entry><entry>NULL
-      </entry></row>
-     <row><entry>
-       resultSetWanted</entry><entry>bool_t</entry><entry>NULL
-      </entry></row>
-     <row><entry>
-       otherInfo</entry><entry>Z_OtherInformation</entry><entry>NULL
-      </entry></row>
-     
-    </tbody>
-   </tgroup>
-  </table>
+   <table frame="top"><title>Default settings for Trigger Resource
+     Control Request </title>
+    <tgroup cols="3">
+     <colspec colname="field"></colspec>
+     <colspec colname="type"></colspec>
+     <colspec colname="value"></colspec>
+     <thead>
+      <row>
+       <entry>Field</entry>
+       <entry>Type</entry>
+       <entry>Default Value</entry>
+      </row>
+     </thead>
+     <tbody>
+      
+      <row><entry>
+       referenceId</entry><entry>Z_ReferenceId</entry><entry>NULL
+       </entry></row>
+      <row><entry>
+       requestedAction</entry><entry>int</entry><entry>
+       Z_TriggerResourceCtrl_resou..
+       </entry></row>
+      <row><entry>
+       prefResourceReportFormat</entry><entry>Odr_oid</entry><entry>NULL
+       </entry></row>
+      <row><entry>
+       resultSetWanted</entry><entry>bool_t</entry><entry>NULL
+       </entry></row>
+      <row><entry>
+       otherInfo</entry><entry>Z_OtherInformation</entry><entry>NULL
+       </entry></row>
+      
+     </tbody>
+    </tgroup>
+   </table>
 
-  <table frame="top"><title>Default settings for Resource
-    Control Request</title>
-   <tgroup cols="3">
-    <colspec colname="field"></colspec>
-    <colspec colname="type"></colspec>
-    <colspec colname="value"></colspec>
-    <thead>
-     <row>
-      <entry>Field</entry>
-      <entry>Type</entry>
-      <entry>Default Value</entry>
-     </row>
-    </thead>
-    <tbody>
-     
-     <row><entry>
-       referenceId</entry><entry>Z_ReferenceId</entry><entry>NULL
-      </entry></row>
-     <row><entry>
-       suspendedFlag</entry><entry>bool_t</entry><entry>NULL
-      </entry></row>
-     <row><entry>
-       resourceReport</entry><entry>Z_External</entry><entry>NULL
-      </entry></row>
-     <row><entry>
-       partialResultsAvailable</entry><entry>int</entry><entry>NULL
-      </entry></row>
-     <row><entry>
-       responseRequired</entry><entry>bool_t</entry><entry>FALSE
-      </entry></row>
-     <row><entry>
-       triggeredRequestFlag</entry><entry>bool_t</entry><entry>NULL
-      </entry></row>
-     <row><entry>
-       otherInfo</entry><entry>Z_OtherInformation</entry><entry>NULL
-      </entry></row>
-    </tbody>
-   </tgroup>
-  </table>
+   <table frame="top"><title>Default settings for Resource
+     Control Request</title>
+    <tgroup cols="3">
+     <colspec colname="field"></colspec>
+     <colspec colname="type"></colspec>
+     <colspec colname="value"></colspec>
+     <thead>
+      <row>
+       <entry>Field</entry>
+       <entry>Type</entry>
+       <entry>Default Value</entry>
+      </row>
+     </thead>
+     <tbody>
+      
+      <row><entry>
+       referenceId</entry><entry>Z_ReferenceId</entry><entry>NULL
+       </entry></row>
+      <row><entry>
+       suspendedFlag</entry><entry>bool_t</entry><entry>NULL
+       </entry></row>
+      <row><entry>
+       resourceReport</entry><entry>Z_External</entry><entry>NULL
+       </entry></row>
+      <row><entry>
+       partialResultsAvailable</entry><entry>int</entry><entry>NULL
+       </entry></row>
+      <row><entry>
+       responseRequired</entry><entry>bool_t</entry><entry>FALSE
+       </entry></row>
+      <row><entry>
+       triggeredRequestFlag</entry><entry>bool_t</entry><entry>NULL
+       </entry></row>
+      <row><entry>
+       otherInfo</entry><entry>Z_OtherInformation</entry><entry>NULL
+       </entry></row>
+     </tbody>
+    </tgroup>
+   </table>
 
-  <table frame="top"><title>Default settings for Resource
-    Control Response</title>
-   <tgroup cols="3">
-    <colspec colname="field"></colspec>
-    <colspec colname="type"></colspec>
-    <colspec colname="value"></colspec>
-    <thead>
-     <row>
-      <entry>Field</entry>
-      <entry>Type</entry>
-      <entry>Default Value</entry>
-     </row>
-    </thead>
-    <tbody>
-     
-     <row><entry>
-       referenceId</entry><entry>Z_ReferenceId</entry><entry>NULL
-      </entry></row>
-     <row><entry>
-       continueFlag</entry><entry>bool_t</entry><entry>TRUE
-      </entry></row>
-     <row><entry>
-       resultSetWanted</entry><entry>bool_t</entry><entry>NULL
-      </entry></row>
-     <row><entry>
-       otherInfo</entry><entry>Z_OtherInformation</entry><entry>NULL
-      </entry></row>
-    </tbody>
-   </tgroup>
-  </table>
-  
-  <table frame="top"><title>Default settings for Access
-    Control Request</title>
-   <tgroup cols="3">
-    <colspec colname="field"></colspec>
-    <colspec colname="type"></colspec>
-    <colspec colname="value"></colspec>
-    <thead>
-     <row>
-      <entry>Field</entry>
-      <entry>Type</entry>
-      <entry>Default Value</entry>
-     </row>
-    </thead>
-    <tbody>
-     
-     <row><entry>
-       referenceId</entry><entry>Z_ReferenceId</entry><entry>NULL
-      </entry></row>
-     <row><entry>
-       which</entry><entry>enum</entry><entry>Z_AccessRequest_simpleForm;
-      </entry></row>
-     <row><entry>
-       u</entry><entry>union</entry><entry>NULL
-      </entry></row>
-     <row><entry>
-       otherInfo</entry><entry>Z_OtherInformation</entry><entry>NULL
-      </entry></row>
-    </tbody>
-   </tgroup>
-  </table>
+   <table frame="top"><title>Default settings for Resource
+     Control Response</title>
+    <tgroup cols="3">
+     <colspec colname="field"></colspec>
+     <colspec colname="type"></colspec>
+     <colspec colname="value"></colspec>
+     <thead>
+      <row>
+       <entry>Field</entry>
+       <entry>Type</entry>
+       <entry>Default Value</entry>
+      </row>
+     </thead>
+     <tbody>
+      
+      <row><entry>
+       referenceId</entry><entry>Z_ReferenceId</entry><entry>NULL
+       </entry></row>
+      <row><entry>
+       continueFlag</entry><entry>bool_t</entry><entry>TRUE
+       </entry></row>
+      <row><entry>
+       resultSetWanted</entry><entry>bool_t</entry><entry>NULL
+       </entry></row>
+      <row><entry>
+       otherInfo</entry><entry>Z_OtherInformation</entry><entry>NULL
+       </entry></row>
+     </tbody>
+    </tgroup>
+   </table>
+   
+   <table frame="top"><title>Default settings for Access
+     Control Request</title>
+    <tgroup cols="3">
+     <colspec colname="field"></colspec>
+     <colspec colname="type"></colspec>
+     <colspec colname="value"></colspec>
+     <thead>
+      <row>
+       <entry>Field</entry>
+       <entry>Type</entry>
+       <entry>Default Value</entry>
+      </row>
+     </thead>
+     <tbody>
+      
+      <row><entry>
+       referenceId</entry><entry>Z_ReferenceId</entry><entry>NULL
+       </entry></row>
+      <row><entry>
+       which</entry><entry>enum</entry><entry>Z_AccessRequest_simpleForm;
+       </entry></row>
+      <row><entry>
+       u</entry><entry>union</entry><entry>NULL
+       </entry></row>
+      <row><entry>
+       otherInfo</entry><entry>Z_OtherInformation</entry><entry>NULL
+       </entry></row>
+     </tbody>
+    </tgroup>
+   </table>
 
-  <table frame="top"><title>Default settings for Access
-    Control Response</title>
-   <tgroup cols="3">
-    <colspec colname="field"></colspec>
-    <colspec colname="type"></colspec>
-    <colspec colname="value"></colspec>
-    <thead>
-     <row>
-      <entry>Field</entry>
-      <entry>Type</entry>
-      <entry>Default Value</entry>
-     </row>
-    </thead>
-    <tbody>
-     
-     <row><entry>
-       referenceId</entry><entry>Z_ReferenceId</entry><entry>NULL
-      </entry></row>
-     <row><entry>
-       which</entry><entry>enum</entry><entry>Z_AccessResponse_simpleForm
-      </entry></row>
-     <row><entry>
-       u</entry><entry>union</entry><entry>NULL
-      </entry></row>
-     <row><entry>
-       diagnostic</entry><entry>Z_DiagRec</entry><entry>NULL
-      </entry></row>
-     <row><entry>
-       otherInfo</entry><entry>Z_OtherInformation</entry><entry>NULL
-      </entry></row>
-    </tbody>
-   </tgroup>
-  </table>
+   <table frame="top"><title>Default settings for Access
+     Control Response</title>
+    <tgroup cols="3">
+     <colspec colname="field"></colspec>
+     <colspec colname="type"></colspec>
+     <colspec colname="value"></colspec>
+     <thead>
+      <row>
+       <entry>Field</entry>
+       <entry>Type</entry>
+       <entry>Default Value</entry>
+      </row>
+     </thead>
+     <tbody>
+      
+      <row><entry>
+       referenceId</entry><entry>Z_ReferenceId</entry><entry>NULL
+       </entry></row>
+      <row><entry>
+       which</entry><entry>enum</entry><entry>Z_AccessResponse_simpleForm
+       </entry></row>
+      <row><entry>
+       u</entry><entry>union</entry><entry>NULL
+       </entry></row>
+      <row><entry>
+       diagnostic</entry><entry>Z_DiagRec</entry><entry>NULL
+       </entry></row>
+      <row><entry>
+       otherInfo</entry><entry>Z_OtherInformation</entry><entry>NULL
+       </entry></row>
+     </tbody>
+    </tgroup>
+   </table>
 
-  <table frame="top"><title>Default settings for Segment</title>
-   <tgroup cols="3">
-    <colspec colname="field"></colspec>
-    <colspec colname="type"></colspec>
-    <colspec colname="value"></colspec>
-    <thead>
-     <row>
-      <entry>Field</entry>
-      <entry>Type</entry>
-      <entry>Default Value</entry>
-     </row>
-    </thead>
-    <tbody>
-     
-     <row><entry>
-       referenceId</entry><entry>Z_ReferenceId</entry><entry>NULL
-      </entry></row>
-     <row><entry>
-       numberOfRecordsReturned</entry><entry>int</entry><entry>value=0
-      </entry></row>
-     <row><entry>
-       num_segmentRecords</entry><entry>int</entry><entry>0
-      </entry></row>
-     <row><entry>
-       segmentRecords</entry><entry>Z_NamePlusRecord</entry><entry>NULL
-      </entry></row>
-     <row><entry>otherInfo</entry><entry>Z_OtherInformation</entry><entry>NULL
-      </entry></row>
-    </tbody>
-   </tgroup>
-  </table>
+   <table frame="top"><title>Default settings for Segment</title>
+    <tgroup cols="3">
+     <colspec colname="field"></colspec>
+     <colspec colname="type"></colspec>
+     <colspec colname="value"></colspec>
+     <thead>
+      <row>
+       <entry>Field</entry>
+       <entry>Type</entry>
+       <entry>Default Value</entry>
+      </row>
+     </thead>
+     <tbody>
+      
+      <row><entry>
+       referenceId</entry><entry>Z_ReferenceId</entry><entry>NULL
+       </entry></row>
+      <row><entry>
+       numberOfRecordsReturned</entry><entry>int</entry><entry>value=0
+       </entry></row>
+      <row><entry>
+       num_segmentRecords</entry><entry>int</entry><entry>0
+       </entry></row>
+      <row><entry>
+       segmentRecords</entry><entry>Z_NamePlusRecord</entry><entry>NULL
+       </entry></row>
+      <row><entry>otherInfo</entry><entry>Z_OtherInformation</entry><entry>NULL
+       </entry></row>
+     </tbody>
+    </tgroup>
+   </table>
 
-  <table frame="top"><title>Default settings for Close</title>
-   <tgroup cols="3">
-    <colspec colname="field"></colspec>
-    <colspec colname="type"></colspec>
-    <colspec colname="value"></colspec>
-    <thead>
-     <row>
-      <entry>Field</entry>
-      <entry>Type</entry>
-      <entry>Default Value</entry>
-     </row>
-    </thead>
-    <tbody>
+   <table frame="top"><title>Default settings for Close</title>
+    <tgroup cols="3">
+     <colspec colname="field"></colspec>
+     <colspec colname="type"></colspec>
+     <colspec colname="value"></colspec>
+     <thead>
+      <row>
+       <entry>Field</entry>
+       <entry>Type</entry>
+       <entry>Default Value</entry>
+      </row>
+     </thead>
+     <tbody>
 
-     <row><entry>
-       referenceId</entry><entry>Z_ReferenceId</entry><entry>NULL
-      </entry></row>
-     <row><entry>
-       closeReason</entry><entry>int</entry><entry>Z_Close_finished
-      </entry></row>
-     <row><entry>
-       diagnosticInformation</entry><entry>char*</entry><entry>NULL
-      </entry></row>
-     <row><entry>
-       resourceReportFormat</entry><entry>Odr_oid</entry><entry>NULL
-      </entry></row>
-     <row><entry>
-       resourceFormat</entry><entry>Z_External</entry><entry>NULL
-      </entry></row>
-     <row><entry>
-       otherInfo</entry><entry>Z_OtherInformation</entry><entry>NULL
-      </entry></row>
-     
-    </tbody>
-   </tgroup>
-  </table>
+      <row><entry>
+       referenceId</entry><entry>Z_ReferenceId</entry><entry>NULL
+       </entry></row>
+      <row><entry>
+       closeReason</entry><entry>int</entry><entry>Z_Close_finished
+       </entry></row>
+      <row><entry>
+       diagnosticInformation</entry><entry>char*</entry><entry>NULL
+       </entry></row>
+      <row><entry>
+       resourceReportFormat</entry><entry>Odr_oid</entry><entry>NULL
+       </entry></row>
+      <row><entry>
+       resourceFormat</entry><entry>Z_External</entry><entry>NULL
+       </entry></row>
+      <row><entry>
+       otherInfo</entry><entry>Z_OtherInformation</entry><entry>NULL
+       </entry></row>
+      
+     </tbody>
+    </tgroup>
+   </table>
 
- </sect1>
-</chapter>
+  </sect1>
+ </chapter>
 
  <!-- Keep this comment at the end of the file
  Local variables:
diff --git a/doc/client.xml b/doc/client.xml
new file mode 100644 (file)
index 0000000..d7d60e6
--- /dev/null
@@ -0,0 +1,444 @@
+<!-- $Id: client.xml,v 1.1 2001-08-08 19:33:21 adam Exp $ -->
+ <chapter><title>The YAZ client</title>
+  <sect1><title>Introduction</title>
+   <para>
+    yaz-client is a linemode Z39.50 client. It supports a fair amount
+    of the functionality of the Z39.50-1995 standard, but some things you
+    need to enable or disable by recompilation.
+    Its primary purpose is to exercise the
+    package, and verify that the protocol works OK.
+    For the same reason some commands offers more functionality than others.
+    Commands that exercies common Z39.50 services such as search and present
+    have more features than less common supported services, such as Extended
+    Services (ItemOrder, ItemUpdate,..).
+   </para>
+  </sect1>
+  <sect1><title>Invoking the YAZ client</title>
+   <para>
+    It can be started by typing
+   </para>
+   <screen>
+     yaz-client [<replaceable>options</replaceable>] [<replaceable>zurl</replaceable>]
+   </screen>
+   <simpara>
+    in a UNIX shell / WIN32 console. The <replaceable>zurl</replaceable>,
+    specifies a Z39.50 host and, if specified, the client first tries to
+    establish connection with the Z39.50 target on the host.
+    Options are, as usual, are prefixed by <literal>-</literal> followed
+    by a particular letter.
+    </simpara>
+   <simpara>
+    The following options are supported:
+   </simpara>
+   <variablelist>
+    <varlistentry><term>
+      <literal>-m</literal> <replaceable>fname</replaceable>
+     </term><listitem>
+      <simpara>ISO2709 records are appended to file
+       <replaceable>fname</replaceable>. All records as returned by a target(s)
+       in Search Responses and Present Responses are appended verbatim to 
+       the file.
+      </simpara></listitem>
+    </varlistentry>
+    <varlistentry><term>
+      <literal>-a</literal> <replaceable>fname</replaceable>
+     </term><listitem>
+      <simpara>Pretty-print log of APDUs sent and received is appended
+       to the file <replaceable>fname</replaceable>.
+       If <replaceable>fname</replaceable> is <literal>-</literal> (minus)
+       the APDU log is written to <literal>stderr</literal>.
+      </simpara></listitem>
+    </varlistentry>
+    <varlistentry><term>
+      <literal>-c</literal> <replaceable>fname</replaceable>
+     </term><listitem>
+      <simpara>Sets the filename for CCL fields to
+       <replaceable>fname</replaceable>. If this option is not given the
+       YAZ client reads CCL fields from file <literal>default.bib</literal>.
+      </simpara></listitem>
+    </varlistentry>
+    <varlistentry><term>
+      <literal>-v</literal> <replaceable>level</replaceable>
+     </term><listitem>
+      <simpara>Sets the LOG level to <replaceable>level</replaceable>.
+       Level is a sequence of tokens separated by comman. Each token
+       is a integer or a named LOG item - one of 
+       <literal>fatal</literal>,
+       <literal>debug</literal>,
+       <literal>warn</literal>,
+       <literal>log</literal>,
+       <literal>all</literal>,
+       <literal>none</literal>.
+      </simpara></listitem>
+    </varlistentry>
+   </variablelist>
+   <para>
+    In order to connect to Index Data's test Z39.50 server on
+    <literal>bagel.indexdata.dk</literal>, port 210 and with the
+    database name marc, one would have to type
+   </para>
+   <screen>
+    yaz-client bagel.indexdata.dk:210/marc
+   </screen>
+   <para>
+    In order to enable APDU log and connect to localhost, port 210 (default)
+    and database Default (default) you'd write:
+   </para>
+   <screen>
+    yaz-client -a - localhost
+   </screen>
+  </sect1>
+  <sect1><title>YAZ client commands</title>
+   <para>
+    When the YAZ client has read options and connected to a target, if given,
+    it will display <literal>Z &gt;</literal> and away your command.
+    Commands are executed by hitting the return key.
+    You can always issue the command <literal>?</literal> to see the list
+    of available commands.
+    </para>
+   <para>
+    The commands are (the letters in parenthesis are short
+    names for the commands):
+   </para>
+   <variablelist>
+    <varlistentry><term>
+      <literal>open </literal><replaceable>zurl</replaceable>
+     </term>
+     <term><literal>o</literal></term>
+     <listitem>
+      <para>Opens a connection to a server. The syntax for
+       <replaceable>zurl</replaceable> is the same as described
+       above for connecting from the command line.
+      </para>
+      <para>
+       Syntax:
+      </para>
+      <para>
+       [<literal>(tcp|osi)':'</literal><[<replaceable>tsel/</replaceable>]]<replaceable>host</replaceable>[:<replaceable>port</replaceable>][/<replaceable>base&gt</replaceable>]
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry><term>
+      <literal>quit</literal>
+     </term>
+     <term><literal>q</literal></term>
+     <listitem>
+      <para>Ends YAZ client</para>
+     </listitem>
+    </varlistentry>
+    <varlistentry><term>
+      <literal>f </literal><replaceable>query</replaceable></term>
+     <term><literal>f</literal></term>
+     <listitem>
+      <para>Sends Search Request using the <replaceable>query</replaceable>
+       given.
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry><term>
+      <literal>delete</literal> <replaceable>setname</replaceable></term>
+     <listitem>
+      <para>Deletes result set with name <replaceable>setname</replaceable>
+       on the server.</para>
+     </listitem>
+    </varlistentry>
+    <varlistentry><term>
+      <literal>base </literal><replaceable>base1</replaceable>
+      <replaceable>base2</replaceable> ...
+      </term>
+     <listitem>
+      <para>Sets the name(s) of the database(s) to search. One or more
+       databases may be specified separated by blanks. This commands overrides
+       the database given in <replaceable>zurl</replaceable>.
+       </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry><term>
+      <literal>show </literal> [<replaceable>start</replaceable>[+<replaceable>number</replaceable>]]
+      </term>
+     <term><literal>s</literal></term>
+     <listitem>
+      <para>Fetches records by sending a Present Request from the start
+       position given by
+       <replaceable>start</replaceable>
+       a number of records given by <replaceable>number</replaceable>. If
+       <replaceable>start</replaceable> is not given the client will 
+       fetch from position of the last retrieved record plus 1. If
+       <replaceable>number</replaceable> is not given one record will be
+       fetched at a time.
+      </para>
+      </listitem>
+    </varlistentry>
+    <varlistentry><term>
+      <literal>scan</literal> <replaceable>term</replaceable>
+     </term>
+     <listitem>
+      <simpara>Scans
+       database index for a term. The syntax resembles the syntax
+       for <literal>find</literal>.
+       If you want to scan for the word <literal>water</literal> you could
+       write
+       </simpara>
+      <screen>
+       scan water
+      </screen>
+      <simpara>
+       but if you want to scan only in, say the title field, you would write
+       </simpara>
+      <screen>
+       scan @attr 1=4 water
+      </screen>
+     </listitem>
+    </varlistentry>
+    <varlistentry><term>
+      <literal>sort</literal> <replaceable>sortspecs</replaceable>
+     </term>
+     <listitem>
+      <para>Sorts a result set. The sort command takes a sequence of
+       sort specifications. A sort
+       specification holds a field (sort criteria) and is followed by flags.
+       If the sort criteria includes <literal>=</literal> it is assumed
+       that the sort SortKey is of type sortAttributes using Bib-1.
+       The integer before <literal>=</literal> is
+       the attribute type and the integer following <literal>=</literal>
+       is the attribute value.
+       If no <literal>=</literal> is in the SortKey it is treated as a
+       sortfield-type of type InternationalString.
+       Flags observed are: <literal>s</literal>
+       for case sensitive, <literal>i</literal> for case insensitive,
+       <literal>&lt;</literal> for sort ascending and <literal>&gt;</literal>
+       for sort descending.
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry><term>
+      <literal>sort+</literal>
+     </term>
+     <listitem>
+      <para>Same as <literal>sort</literal> but stores the sorted
+       result set in a new result set.
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry><term>
+      <literal>authentication</literal> <replaceable>openauth</replaceable>
+      </term>
+     <listitem>
+      <para>Sets up a authentication string if a server requires
+       authentication (v2 OpenStyle). The authentication string is first
+       sent to the server when the <literal>open</literal> command is
+       issued and the Z39.50 Initialize Request is sent, so this command
+       must be used before <literal>open</literal> in order to be effective.
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry><term>
+      <literal>lslb</literal> <replaceable>n</replaceable>
+     </term>
+     <listitem>
+      <para>Sets the limit for when no records should be returned
+       together with the search result.
+       See the
+       <ulink
+       url="http://lcweb.loc.gov/z3950/agency/markup/04.html#3.2.2.1.6">
+       Z39.50 standard
+       </ulink>
+       for more details.
+      </para>
+     </listitem>
+    </varlistentry>
+
+    <varlistentry><term>
+      <literal>ssub</literal> <replaceable>n</replaceable>
+     </term>
+     <listitem>
+      <para>Sets the limit for when all records should be returned with
+       the search result.
+       See the
+       <ulink
+       url="http://lcweb.loc.gov/z3950/agency/markup/04.html#3.2.2.1.6">
+       Z39.50 standard
+       </ulink> for more details.
+      </para>
+     </listitem>
+    </varlistentry>
+    
+    <varlistentry><term>
+      <literal>mspn</literal> <replaceable>n</replaceable>
+     </term>
+     <listitem>
+      <para>Sets the number of records should be returned if the
+       number of records in the result set is between the values of
+       <literal>lslb</literal> and <literal>ssub</literal>.
+       See the
+       <ulink
+       url="http://lcweb.loc.gov/z3950/agency/markup/04.html#3.2.2.1.6">
+       Z39.50 standard
+       </ulink>
+       for more details.
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry><term>
+      <literal>status</literal>
+     </term>
+     <listitem>
+      <para>Displays the values of <literal>lslb</literal>,
+       <literal>ssub</literal> and <literal>mspn</literal>.
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry><term>
+      <literal>setname</literal>
+     </term>
+     <listitem>
+      <para>Switches named result sets on and off. Default is on.
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry><term>
+      <literal>cancel</literal>
+     </term>
+     <listitem>
+      <para>Sends a Trigger Resource Control Request to the target.
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry><term>
+      <literal>format</literal> <replaceable>oid</replaceable>
+     </term>
+     <listitem>
+      <para>Sets the preferred transfer syntax for retrieved records.
+       yaz-client supports all the record syntaxes that currently
+       are registered. See
+       <ulink
+       url="http://lcweb.loc.gov/z3950/agency/defns/oids.html#5">
+       Z39.50 Standard
+       </ulink>
+       for more details. Commonly used records syntaxes include usmarc,
+       sutrs, grs1 and xml.
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry><term>
+      <literal>elements</literal> <replaceable>e</replaceable>
+     </term>
+     <listitem>
+      <para>Sets the element set name for the records. Many targets support
+       element sets are B (for brief) and F (for full).
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry><term>
+      <literal>close</literal>
+     </term>
+     <listitem>
+      <para>Sends a Z39.50 Close APDU and closes connection with the peer
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry><term>
+      <literal>querytype</literal> <replaceable>type</replaceable>
+     </term>
+     <listitem>
+      <para>Sets the query type as used by command <literal>find</literal>.
+       The following is supported: <literal>prefix</literal> for 
+       <link linkend="PQF">Prefix Query Notation</link> (Type-1 Query);
+       <literal>ccl</literal> for CCL search (Type-2
+       Query) or <literal>ccl2rpn</literal> for
+       <link linkend="CCL">CCL</link> to RPN conversion (Type-1 Query).
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry><term>
+      <literal>attributeset</literal> <replaceable>set</replaceable>
+     </term>
+     <listitem>
+      <para>
+       Sets attribute set OID for prefix queries (RPN, Type-1).
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry><term>
+      <literal>refid</literal> <replaceable>id</replaceable>
+      </term>
+     <listitem>
+      <para>Sets reference ID for Z39.50 Request(s).
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry><term>
+     <literal>itemorder</literal>
+      <replaceable>type</replaceable> <replaceable>no</replaceable>
+     </term>
+     <listitem>
+      <para>Sends an Item Order Request using the ILL External. 
+       <replaceable>type</replaceable> is either 1 or 2 which correponds to
+       ILL-Profile 1 and 2 respectively. The <replaceable>no</replaceable>
+       is the Result Set position of the record to be ordered.
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry><term>
+      <literal>update</literal>
+     </term>
+     <listitem>
+      <para>Sends Item Update Request. This command sends a "minimal"
+       PDU to the target supplying the last received record from the target.
+       If no record has been received from the target this command is ignored
+       and nothing is sent to the target.
+      </para>
+     </listitem>
+    </varlistentry>
+   </variablelist>
+  </sect1>
+  <sect1><title>Searching</title>
+   <para>
+    The simplest example of a Prefix Query would be something like
+    <screen>
+     f knuth
+    </screen>
+    or
+    <screen>
+     f "donald knuth"
+    </screen>
+    In those queries no attributes was specified.
+    This leaves it up to the server what fields to search but
+    most servers will search in all fields. Some servers does not
+    support this feature though, and require that some attributes
+    are defined. To add one attribute you could do:
+    <screen>
+     f @attr 1=4 computer
+    </screen>
+    where we search in the title field, since the use(1) is title(4).
+    If we want to search in the author field <emphasis>and</emphasis>
+    in the title field, and in the title field using right truncation
+    it could look something like this:
+    <screen>
+     f @and @attr 1=1003 knuth @attr 1=4 @attr 5=1 computer
+    </screen>
+    Finally using a mix of Bib-1 and GILS attributes could look
+    something like this:
+    <screen>
+     f @attrset Bib-1 @and @attr GILS 1=2008 Washington @attr 1=21 weather
+    </screen>
+    For the full specifiction of the Prefix Query see the section
+     <link linkend="PQF">Prefix Query Format</link>.
+   </para>
+  </sect1>
+ </chapter>
+ <!-- Keep this comment at the end of the file
+ Local variables:
+ mode: sgml
+ sgml-omittag:t
+ sgml-shorttag:t
+ sgml-minimize-attributes:nil
+ sgml-always-quote-attributes:t
+ sgml-indent-step:1
+ sgml-indent-data:t
+ sgml-parent-document: "yaz.xml"
+ sgml-local-catalogs: "../../docbook/docbook.cat"
+ sgml-namecase-general:t
+ End:
+ -->
index 4d47a1b..33de66e 100644 (file)
@@ -1,9 +1,9 @@
-<!-- $Id: tools.xml,v 1.3 2001-07-20 21:34:36 adam Exp $ -->
+<!-- $Id: tools.xml,v 1.4 2001-08-08 19:33:21 adam Exp $ -->
  <chapter><title>Supporting Tools</title>
-
+  
   <para>
    In support of the service API - primarily the ASN module, which
-   provides the programmatic interface to the Z39.50 APDUs, YAZ contains
+   provides the programmatic interface to the Z39.50 APDUs, &yaz; contains
    a collection of tools that support the development of applications.
   </para>
 
@@ -51,9 +51,8 @@ int p_query_attset (const char *arg);
      to provide a memory source (the structure created is released on
      the next call to <function>odr_reset()</function> on the stream), a
      protocol identifier (one of the constants <token>PROTO_Z3950</token> and
-     <token>PROTO_SR</token>), an attribute set
-     reference, and finally a null-terminated string holding the query
-     string.
+     <token>PROTO_SR</token>), an attribute set reference, and
+     finally a null-terminated string holding the query string.
     </para>
     <para>
      If the parse went well, <function>p_query_rpn()</function> returns a
@@ -74,13 +73,13 @@ int p_query_attset (const char *arg);
     </para>
 
     <screen>
-     Query ::= &lsqb; AttSet &rsqb; QueryStruct.
+     Query ::= &lsqb; '@attrset' AttSet &rsqb; QueryStruct.
 
      AttSet ::= string.
 
-     QueryStruct ::= { Attribute } Simple | Complex.
+     QueryStruct ::= &lsqb; Attribute &rsqb; Simple | Complex.
 
-     Attribute ::= '@attr' AttributeType '=' AttributeValue.
+     Attribute ::= '@attr' &lsqb; AttSet &rsqb; AttributeType '=' AttributeValue.
 
      AttributeType ::= integer.
 
@@ -139,6 +138,8 @@ int p_query_attset (const char *arg);
      @attr 4=1 @attr 1=4 "self portrait"
 
      @prox 0 3 1 2 k 2 dylan zimmerman
+
+     @and @attr 2=4 @attr gils 1=2038 -114 @attr 2=2 @attr gils 1=2039 -109
     </screen>
 
    </sect2>
@@ -686,7 +687,7 @@ typedef struct oident
 
   </sect1>
  </chapter>
-
  <!-- Keep this comment at the end of the file
  Local variables:
  mode: sgml
index 4ce92bc..faff797 100644 (file)
@@ -6,6 +6,7 @@
      <!ENTITY yaz "YAZ">
      <!ENTITY chap-introduction SYSTEM "introduction.xml">
      <!ENTITY chap-installation SYSTEM "installation.xml">
+     <!ENTITY chap-client SYSTEM "client.xml">
      <!ENTITY chap-asn SYSTEM "asn.xml">
      <!ENTITY chap-tools SYSTEM "tools.xml">
      <!ENTITY chap-odr SYSTEM "odr.xml">
@@ -18,7 +19,7 @@
      <!ENTITY odr "<acronym>ODR</acronym>">
      <!ENTITY comstack "<acronym>COMSTACK</acronym>">
 ]>
-<!-- $Id: yaz.xml,v 1.4 2001-07-20 21:31:35 adam Exp $ -->
+<!-- $Id: yaz.xml,v 1.5 2001-08-08 19:33:21 adam Exp $ -->
 <book>
  <bookinfo>
   <title>YAZ User's Guide and Reference</title>
@@ -46,6 +47,7 @@
  
  &chap-introduction;
  &chap-installation;
+ &chap-client;
  &chap-asn;
  &chap-tools;
  &chap-odr;