<!--Generated by stripref.xsl . Do not edit-->
<refentry id="yaz-client">
 <refentryinfo>
  <productname class="trade">YAZ</productname>
  <productnumber>3.0.51</productnumber>
 </refentryinfo>
 
 <refmeta>
  <refentrytitle>yaz-client</refentrytitle>
  <manvolnum>1</manvolnum>
 </refmeta>
 
 <refnamediv>
  <refname>yaz-client</refname>
  <refpurpose>Z39.50/SRU client for implementors</refpurpose>
 </refnamediv>

 <refsynopsisdiv>
  <cmdsynopsis sepchar=" ">
   <command moreinfo="none">yaz-client</command>
   <arg choice="opt" rep="norepeat"><option>-a <replaceable>apdulog</replaceable></option></arg>
   <arg choice="opt" rep="norepeat"><option>-b <replaceable>berdump</replaceable></option></arg>
   <arg choice="opt" rep="norepeat"><option>-c <replaceable>cclfile</replaceable></option></arg>
   <arg choice="opt" rep="norepeat"><option>-d <replaceable>dump</replaceable></option></arg>
   <arg choice="opt" rep="norepeat"><option>-f <replaceable>cmdfile</replaceable></option></arg>
   <arg choice="opt" rep="norepeat"><option>-k <replaceable>size</replaceable></option></arg>
   <arg choice="opt" rep="norepeat"><option>-m <replaceable>marclog</replaceable></option></arg>
   <arg choice="opt" rep="norepeat"><option>-p <replaceable>proxy-addr</replaceable></option></arg>
   <arg choice="opt" rep="norepeat"><option>-q <replaceable>cqlfile</replaceable></option></arg>
   <arg choice="opt" rep="norepeat"><option>-t <replaceable>dispcharset</replaceable></option></arg>
   <arg choice="opt" rep="norepeat"><option>-u <replaceable>auth</replaceable></option></arg>
   <arg choice="opt" rep="norepeat"><option>-v <replaceable>loglevel</replaceable></option></arg>
   <arg choice="opt" rep="norepeat"><option>-V</option></arg>
   <arg choice="opt" rep="norepeat"><option>-x</option></arg>
   <arg choice="opt" rep="norepeat">server-addr</arg>
  </cmdsynopsis>

 </refsynopsisdiv>
  
 <refsect1><title>DESCRIPTION</title>
  <para>
   <command moreinfo="none">yaz-client</command> is a Z39.50/SRU client (origin) with a
   simple command line interface that allows you to test behavior and
   performance of Z39.50 targets and SRU servers.
  </para>
  <para>
   If the <replaceable>server-addr</replaceable> is specified, the client creates
   a connection to the Z39.50/SRU target at the address given.
  </para>
  <para>
   When <command moreinfo="none">yaz-client</command> is started it tries to read
   commands from one of the following files:
   <itemizedlist>
    <listitem><para>
      Command file if it is given by option -f. 
     </para></listitem>
    <listitem><para>
      <filename moreinfo="none">.yazclientrc</filename> in current working directory.
     </para></listitem>
    <listitem><para>
      <filename moreinfo="none">.yazclientrc</filename> in the user's home directory.
      The value of the <literal moreinfo="none">HOME</literal> is used to determine
      the home directory. Normally, <literal moreinfo="none">HOME</literal> is only set
      on POSIX systems such as Linux, FreeBSD, Solaris.
     </para></listitem>
   </itemizedlist>
  </para>
 </refsect1>
  <refsect1>
   <title>OPTIONS</title>
   <variablelist>
    <varlistentry>
     <term>-a <replaceable>filename</replaceable></term>
     <listitem><para>
       If specified, logging of protocol packages will be appended
       file given. If <replaceable>filename</replaceable> is
       specified as <literal moreinfo="none">-</literal>, the output is written
       to <literal moreinfo="none">stdout</literal>.
      </para></listitem>
    </varlistentry>
    <varlistentry>
     <term>-b <replaceable>filename</replaceable></term>
     <listitem><para>
       If specified, YAZ will dump BER data in readable notation
       to the file specified. If <replaceable>filename</replaceable>
       is specified as <literal moreinfo="none">-</literal> the output is written
       to <literal moreinfo="none">stdout</literal>.
      </para></listitem>
    </varlistentry>
    <varlistentry>
     <term>-c <replaceable>filename</replaceable></term>
     <listitem><para>
       If specified, CCL configuration will be read from
       the file given.
      </para></listitem>
    </varlistentry>
    <varlistentry>
     <term>-d <replaceable>dump</replaceable></term>
     <listitem><para>
       If specified, YAZ will dump BER data for all PDUs sent and received 
       to individual files, named
       <replaceable>dump</replaceable>.DDD.<literal moreinfo="none">raw</literal>, 
       where DDD is 001, 002, 003, ..
      </para></listitem>
    </varlistentry>

    <varlistentry>
     <term>-f <replaceable>cmdfile</replaceable></term>
     <listitem><para>
      Reads commands from <replaceable>cmdfile</replaceable>. When
      this option is used, YAZ client does not read .yazclientrc
      from current directory or home directory.
      </para></listitem>
    </varlistentry>

    <varlistentry>
     <term>-k <replaceable>size</replaceable></term>
     <listitem><para>
      Sets preferred messages and maximum record size for Initialize
      Request in kilobytes. Default value is 1024 (1 MB).
      </para></listitem>
    </varlistentry>
    <varlistentry>
     <term>-m <replaceable>filename</replaceable></term>
     <listitem><para>
       If specified, retrieved records will be appended to the file given.
      </para></listitem>
    </varlistentry>
    <varlistentry>
     <term>-p <replaceable>proxy-addr</replaceable></term>
     <listitem><para>
       If specified, the client will use the proxy at the address
       given. YAZ client will
       connect to a proxy on the address and port given. 
       The actual target will be specified as part of the InitRequest
       to inform the proxy about actual target.
      </para></listitem>
    </varlistentry>
    <varlistentry>
     <term>-q <replaceable>filename</replaceable></term>
     <listitem><para>
       If specified, CQL configuration will be read from
       the file given.
      </para></listitem>
    </varlistentry>
    <varlistentry>
     <term>-t <replaceable>displaycharset</replaceable></term>
     <listitem><para>
       If displaycharset is given, it specifies name of the character set of the
       output (on the terminal on which YAZ client is running). 
      </para></listitem>
    </varlistentry>
    <varlistentry>
     <term>-u <replaceable>auth</replaceable></term>
     <listitem><para>
       If specified, the <replaceable>auth</replaceable> string
       will be used for authentication.
      </para></listitem>
    </varlistentry>
    <varlistentry><term>
      <literal moreinfo="none">-v</literal> <replaceable>level</replaceable>
     </term><listitem>
      <simpara>Sets the LOG level to <replaceable>level</replaceable>.
       Level is a sequence of tokens separated by comma. Each token
       is a integer or a named LOG item - one of 
       <literal moreinfo="none">fatal</literal>,
       <literal moreinfo="none">debug</literal>,
       <literal moreinfo="none">warn</literal>,
       <literal moreinfo="none">log</literal>,
       <literal moreinfo="none">malloc</literal>,
       <literal moreinfo="none">all</literal>,
       <literal moreinfo="none">none</literal>.
      </simpara></listitem>
    </varlistentry>
    <varlistentry>
     <term>-V</term>
     <listitem><para>
       Prints YAZ version.
     </para></listitem>
    </varlistentry>
    <varlistentry>
     <term>-x</term>
     <listitem><para>
       Makes the YAZ client print hex dumps of packages sent and received
       on standard output.
       </para></listitem>
    </varlistentry>
   </variablelist>
  </refsect1>
  <refsect1>
   <title>COMMANDS</title>
   <para>
    The YAZ client accepts the following commands.
   </para>
   <!-- 
   Commands for YAZ client.
   Included in both manual and man page for yaz-client.
-->
<variablelist>
 <varlistentry id="command-open"><term>
   <literal moreinfo="none">open </literal><replaceable>zurl</replaceable>
  </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 moreinfo="none">(tcp|ssl|unix|http)':'</literal>]<replaceable>host</replaceable>
    [:<replaceable>port</replaceable>][/<replaceable>base</replaceable>]
   </para>
  </listitem>
 </varlistentry>
 <varlistentry><term>
   <literal moreinfo="none">quit</literal>
  </term>
  <listitem>
   <para>Quits YAZ client</para>
  </listitem>
 </varlistentry>
 <varlistentry id="command-find"><term>
   <literal moreinfo="none">find </literal><replaceable>query</replaceable></term>
  <listitem>
   <para>Sends a Search Request using the <replaceable>query</replaceable>
    given. By default the query is assumed to be PQF. See command
    <link linkend="command-querytype">querytype</link> for more information.
   </para>
  </listitem>
 </varlistentry>
 <varlistentry><term>
   <literal moreinfo="none">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 moreinfo="none">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 moreinfo="none">show </literal>
   [<replaceable>start</replaceable>[+<replaceable>number</replaceable>]]
  </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, then the client
    will fetch from position of the last retrieved record plus 1. If
    <replaceable>number</replaceable> is not given, then one record will
    be fetched at a time.
   </para>
  </listitem>
 </varlistentry>
 <varlistentry><term>
   <literal moreinfo="none">scan</literal> <replaceable>term</replaceable>
  </term>
  <listitem>
   <simpara>Scans
    database index for a term. The syntax resembles the syntax
    for <link linkend="command-find"><literal moreinfo="none">find</literal></link>.
    If you want to scan for the word <literal moreinfo="none">water</literal> you could
    write
   </simpara>
   <screen format="linespecific">
    scan water
   </screen>
   <simpara>
    but if you want to scan only in, say the title field, you would write
   </simpara>
   <screen format="linespecific">
    scan @attr 1=4 water
   </screen>
  </listitem>
 </varlistentry>
 <varlistentry><term>
   <literal moreinfo="none">setscan</literal> <replaceable>set</replaceable> <replaceable>term</replaceable>
  </term>
  <listitem>
   <simpara>Scans database index for a term within a result set. This
    is similar to the scan command but has a result set as its first argument.
   </simpara>
  </listitem>
 </varlistentry>
 <varlistentry><term>
   <literal moreinfo="none">scanpos</literal> <replaceable>pos</replaceable>
  </term>
  <listitem>
   <simpara>
    Sets preferred position for scan. This value
    is used in next scan. By default position is 1.
   </simpara>
  </listitem>
 </varlistentry>
 <varlistentry><term>
   <literal moreinfo="none">scansize</literal> <replaceable>size</replaceable>
  </term>
  <listitem>
   <simpara>
    Sets number of entries to be returned by scan. Default
    number of entries is 20.
   </simpara>
  </listitem>
 </varlistentry>
 <varlistentry><term>
   <literal moreinfo="none">scanstep</literal> <replaceable>step</replaceable>
  </term>
  <listitem>
   <simpara>
    Set step-size for scan. This value is used in next scan
    sent to the target. By default step-size is 0.
   </simpara>
  </listitem>
 </varlistentry>
 <varlistentry id="sortspec"><term>
   <literal moreinfo="none">sort</literal> <replaceable>sortspecs</replaceable>
  </term>
  <listitem>
   <para>Sorts a result set. The sort command takes a
    sequence of space-separated sort specifications, with each sort
    specification consisting of two space-separated words (so that the
    whole specification list is made up of an even number of words).
    The first word of each specification
    holds a field (sort criterion) and the second holds flags.
    If the sort criterion includes <literal moreinfo="none">=</literal> it is assumed
    that the <literal moreinfo="none">SortKey</literal> is of type
    <literal moreinfo="none">sortAttributes</literal> using Bib-1: in this case
    the integer before <literal moreinfo="none">=</literal> is
    the attribute type and the integer following <literal moreinfo="none">=</literal>
    is the attribute value.
    If no <literal moreinfo="none">=</literal> is in the criterion it is treated as a
    sortfield of type InternationalString.
    The flags word of each sort specification must consist of
    <literal moreinfo="none">s</literal> 
    for case sensitive or <literal moreinfo="none">i</literal> for case insensitive, and
    <literal moreinfo="none">&lt;</literal> for ascending order or <literal moreinfo="none">&gt;</literal>
    for descending order.
   </para>
  </listitem>
 </varlistentry>
 <varlistentry><term>
   <literal moreinfo="none">sort+</literal>
  </term>
  <listitem>
   <para>Same as <literal moreinfo="none">sort</literal> but stores the sorted
    result set in a new result set.
   </para>
  </listitem>
 </varlistentry>
 <varlistentry><term>
   <literal moreinfo="none">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 
    <link linkend="command-open"><literal moreinfo="none">open</literal></link> command is
    issued and the Z39.50 Initialize Request is sent, so this command
    must be used before <literal moreinfo="none">open</literal> in order to be effective.
    A common convention for the <replaceable>authopen</replaceable> string
    is that the username - and password is separated by a slash, e.g.
    <literal moreinfo="none">myusername/mysecret</literal>.
   </para>
  </listitem>
 </varlistentry>

 <varlistentry><term>
   <literal moreinfo="none">sru</literal> <replaceable>method</replaceable> <replaceable>version</replaceable>
  </term>
  <listitem>
   <para>Selects SRU method and version.
    Must be one of <literal moreinfo="none">POST</literal>,
    <literal moreinfo="none">GET</literal>, <literal moreinfo="none">SOAP</literal> (default). Version
    should be either 1.1 or 1.2. Other versions are allowed - for testing
    purposes (version negotiation with SRU server).
   </para>
  </listitem>
 </varlistentry>

 <varlistentry><term>
   <literal moreinfo="none">list_all</literal>
  </term>
  <listitem>
   <para>This command displays status and values for many settings.
   </para>
  </listitem>
 </varlistentry>
 
 <varlistentry><term>
   <literal moreinfo="none">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://www.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 moreinfo="none">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://www.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 moreinfo="none">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 moreinfo="none">lslb</literal> and <literal moreinfo="none">ssub</literal>.
    See the
    <ulink url="http://www.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 moreinfo="none">status</literal>
  </term>
  <listitem>
   <para>Displays the values of <literal moreinfo="none">lslb</literal>,
    <literal moreinfo="none">ssub</literal> and <literal moreinfo="none">mspn</literal>.
   </para>
  </listitem>
 </varlistentry>
 <varlistentry><term>
   <literal moreinfo="none">setname</literal>
  </term>
  <listitem>
   <para>Switches named result sets on and off. Default is on.
   </para>
  </listitem>
 </varlistentry>
 <varlistentry><term>
   <literal moreinfo="none">cancel</literal>
  </term>
  <listitem>
   <para>Sends a Trigger Resource Control Request to the target.
   </para>
  </listitem>
 </varlistentry>
 <varlistentry><term>
   <literal moreinfo="none">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://www.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 moreinfo="none">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 moreinfo="none">close</literal>
  </term>
  <listitem>
   <para>Sends a Z39.50 Close APDU and closes connection with the peer
   </para>
  </listitem>
 </varlistentry>
 <varlistentry id="command-querytype"><term>
   <literal moreinfo="none">querytype</literal> <replaceable>type</replaceable>
  </term>
  <listitem>
   <para>Sets the query type as used by command 
   <link linkend="command-find"><literal moreinfo="none">find</literal></link>.
    The following is supported:
    <literal moreinfo="none">prefix</literal> for
	<link linkend="PQF">Prefix Query Notation</link> (Type-1 Query);
    <literal moreinfo="none">ccl</literal> for CCL search (Type-2 Query),
    <literal moreinfo="none">cql</literal> for CQL (Type-104 search with CQL OID),
    <literal moreinfo="none">ccl2rpn</literal> for
	<link linkend="CCL">CCL</link> to RPN conversion (Type-1 Query).
    <literal moreinfo="none">cql2rpn</literal> for
	CQL to RPN conversion (Type-1 Query).
   </para>
  </listitem>
 </varlistentry>
 <varlistentry><term>
   <literal moreinfo="none">attributeset</literal> <replaceable>set</replaceable>
  </term>
  <listitem>
   <para>
    Sets attribute set OID for prefix queries (RPN, Type-1).
   </para>
  </listitem>
 </varlistentry>
 <varlistentry><term>
   <literal moreinfo="none">refid</literal> <replaceable>id</replaceable>
  </term>
  <listitem>
   <para>Sets reference ID for Z39.50 Request(s).
   </para>
  </listitem>
 </varlistentry>
 <varlistentry><term>
   <literal moreinfo="none">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 corresponds 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 moreinfo="none">update</literal>
   <replaceable>action</replaceable>
   <replaceable>recid</replaceable>
   <replaceable>doc</replaceable>
  </term>
  <listitem>
   <para>Sends Item Update Request. The <replaceable>action</replaceable>
    argument must be the action type: one of <literal moreinfo="none">insert</literal>,
    <literal moreinfo="none">replace</literal>, <literal moreinfo="none">delete</literal> and
    <literal moreinfo="none">update</literal>. The second argument, 
    <replaceable>recid</replaceable>, is the
    record identifier (any string). Third argument which is optional is
    the record document for the request. If doc is preceded with 
    "&lt;", then the following characters are treated as a filename
    with the records to be updated. Otherwise doc is treated as
    a document itself. The doc may also be quited in double quotes.
    If doc is omitted, the last received record (as part of present
    response or piggybacked search response) is used for the update.
   </para>
  </listitem>
 </varlistentry>

 <varlistentry><term>
   <literal moreinfo="none">source</literal>
   <replaceable>filename</replaceable>
  </term>
  <listitem>
   <para>Executes list of commands from
    file <replaceable>filename</replaceable>, just like source on
    most UNIX shells. A single dot (<literal moreinfo="none">.</literal>) can be used
    as an alternative.
   </para>
  </listitem>
 </varlistentry>

 <varlistentry><term>
   <literal moreinfo="none">!</literal>
   <replaceable>args</replaceable>
  </term>
  <listitem>
   <para>Executes command <replaceable>args</replaceable> in subshell
    using the <literal moreinfo="none">system</literal> call.
   </para>
  </listitem>
 </varlistentry>

 <varlistentry><term>
   <literal moreinfo="none">push_command</literal>
   <replaceable>command</replaceable>
  </term>
  <listitem>
   <para>The push_command takes another command as its argument.
    That command is then added to the history information (so
    you can retrieve it later). The command itself is not
    executed. This command only works if you have GNU readline/history
    enabled.
   </para>
  </listitem>
 </varlistentry>

 <varlistentry><term>
   <literal moreinfo="none">set_apdufile</literal>
   <replaceable>filename</replaceable>
  </term>
  <listitem>
   <para>Sets that APDU should be logged to file
    <replaceable>filename</replaceable>. Another way to achieve
    APDU log is by using command-line option <literal moreinfo="none">-a</literal>.
   </para>
  </listitem>
 </varlistentry>

 <varlistentry><term>
   <literal moreinfo="none">set_auto_reconnect</literal>
   <replaceable>flag</replaceable>
  </term>
  <listitem>
   <para>Specifies whether YAZ client automatically reconnect if
    target closes connection (Z39.50 only).
   </para>
   <para>
    <replaceable>flag</replaceable> must be either
    <literal moreinfo="none">on</literal> or <literal moreinfo="none">off</literal>.
   </para>
  </listitem>
 </varlistentry>

 <varlistentry id="command-set-auto-wait"><term>
   <literal moreinfo="none">set_auto_wait</literal>
   <replaceable>flag</replaceable>
  </term>
  <listitem>
   <para>Specifies whether YAZ client should wait for
   response protocol packages after a request.
   By default YAZ client waits (on) for response packages immediately
   after a command (find, show) has been issued. If <literal moreinfo="none">off</literal>
   is used, YAZ client does not attempt to receive packages automatically.
   These will have to be manually received when command 
   <link linkend="command-wait-response">
    <literal moreinfo="none">wait_response</literal>
   </link> is used.
   </para>
   <para>
   <replaceable>flag</replaceable> must be either
   <literal moreinfo="none">on</literal> or <literal moreinfo="none">off</literal>.
   </para>
  </listitem>
 </varlistentry>

 <varlistentry><term>
   <literal moreinfo="none">set_marcdump</literal>
   <replaceable>filename</replaceable>
  </term>
  <listitem>
   <para>Specifies that all retrieved records should be appended to
    file <replaceable>filename</replaceable>. This command does the
    thing as option <literal moreinfo="none">-m</literal>.
   </para>
  </listitem>
 </varlistentry>

 <varlistentry><term>
   <literal moreinfo="none">schema</literal>
   <replaceable>schemaid</replaceable>
  </term>
  <listitem>
   <para>Specifies schema for retrieval.
    Schema may be specified as an OID for Z39.50.
    For SRU, schema is a simple string URI.
   </para>
  </listitem>
 </varlistentry>

 <varlistentry id="command-charset"><term>
   <literal moreinfo="none">charset</literal>
   <replaceable>negotiationcharset</replaceable>
   [<replaceable>displaycharset</replaceable>]
   [[<replaceable>marccharset</replaceable>]]
  </term>
  <listitem>
   <para>Specifies character set (encoding) for Z39.50
    negotiation / SRU encoding and/or character set for output (terminal).
   </para>
   <para>
    <replaceable>negotiationcharset</replaceable> is the name
    of the character set to be negotiated by the server. The special name
    <literal moreinfo="none">-</literal> for <replaceable>negotiationcharset</replaceable>
    specifies <emphasis>no</emphasis> character set to be negotiated.
   </para>
   <para>
    If <replaceable>displaycharset</replaceable> is given, it specifies name
    of the character set of the output (on the terminal on which
    YAZ client is running). To disable conversion of characters
    to the output encoding, the special name <literal moreinfo="none">-</literal> (dash)
    can be used.
    If the special name <literal moreinfo="none">auto</literal> is given, YAZ client will
    convert strings to the encoding of the
    terminal as returned by <function moreinfo="none">nl_langinfo</function> call.
   </para>
   <para>
    If <replaceable>marcharset</replaceable> is given, it specifies name
    of the character set of retrieved MARC records from server. See
    also <literal moreinfo="none">marcharset</literal> command.
   </para>
   <note>
    <para>
     Since character set negotation takes effect in the Z39.50
     Initialize Request you should issue this command before
     command <link linkend="command-open"><literal moreinfo="none">open</literal></link>
     is used.
    </para>
   </note>
   <note>
    <para>
     MARC records are not covered by Z39.50 character set negotiation,
     so that's why there is a separate character that must be known
     in order to do meaningful conversion(s).
    </para>
   </note>
  </listitem>
 </varlistentry>

 <varlistentry><term>
   <literal moreinfo="none">negcharset</literal>
   <replaceable>charset</replaceable>
  </term>
  <listitem>
   <para>Specifies character set for negotiation (Z39.50). The
    argument is the same as second argument for command
    <link linkend="command-charset"><literal moreinfo="none">charset</literal></link>.
   </para>
  </listitem>
 </varlistentry>

 <varlistentry><term>
   <literal moreinfo="none">displaycharset</literal>
   <replaceable>charset</replaceable>
  </term>
  <listitem>
   <para>Specifies character set for output (display). The
    argument is the same as second argument for command 
    <link linkend="command-charset"><literal moreinfo="none">charset</literal></link>.
   </para>
  </listitem>
 </varlistentry>

 <varlistentry><term>
   <literal moreinfo="none">marccharset</literal>
   <replaceable>charset</replaceable>
  </term>
  <listitem>
   <para>Specifies character set for retrieved MARC records so
    that YAZ client can display them in a character suitable
    for your display. See <literal moreinfo="none">charset</literal> command.
    If <literal moreinfo="none">auto</literal> is given, YAZ will assume
    that MARC21/USMARC is using MARC8/UTF8 and ISO-8859-1
    for all other MARC variants. The charset argument is the
    same as third argument for command
    <link linkend="command-charset"><literal moreinfo="none">charset</literal></link>.
   </para>
  </listitem>
 </varlistentry>

 <varlistentry><term>
   <literal moreinfo="none">querycharset</literal>
   <replaceable>charset</replaceable>
  </term>
  <listitem>
   <para>Specifies character set for query terms for Z39.50 RPN
    queries and Z39.50 Scan Requests (termListAndStartPoint).
    This is a pure client-side conversion which converts from
    displayCharset to queryCharset.
   </para>
  </listitem>
 </varlistentry>
 
 <varlistentry><term>
   <literal moreinfo="none">set_cclfile</literal>
   <replaceable>filename</replaceable>
  </term>
  <listitem>
   <para>Specifies that CCL fields should be read from file
    file <replaceable>filename</replaceable>. This command does the
    thing as option <literal moreinfo="none">-c</literal>.
   </para>
  </listitem>
 </varlistentry>

 <varlistentry><term>
   <literal moreinfo="none">set_cqlfile</literal>
   <replaceable>filename</replaceable>
  </term>
  <listitem>
   <para>Specifies that CQL fields should be read from file
    file <replaceable>filename</replaceable>. This command does the
    thing as option <literal moreinfo="none">-q</literal>.
   </para>
  </listitem>
 </varlistentry>

 <varlistentry><term>
   <literal moreinfo="none">register_oid</literal>
   <replaceable>name</replaceable>
   <replaceable>class</replaceable>
   <replaceable>OID</replaceable>
  </term>
  <listitem>
   <para>This command allows you to register your own object
    identifier - so that instead of entering a long dot-notation
    you can use a short name instead.
    The <replaceable>name</replaceable> is your
    name for the OID, <replaceable>class</replaceable> is the
    class, and <replaceable>OID</replaceable> is the raw OID in
    dot notation. Class is one <literal moreinfo="none">appctx</literal>,
    <literal moreinfo="none">absyn</literal>, <literal moreinfo="none">attet</literal>,
    <literal moreinfo="none">transyn</literal>, <literal moreinfo="none">diagset</literal>,
    <literal moreinfo="none">recsyn</literal>, <literal moreinfo="none">resform</literal>,
    <literal moreinfo="none">accform</literal>, <literal moreinfo="none">extserv</literal>,
    <literal moreinfo="none">userinfo</literal>, <literal moreinfo="none">elemspec</literal>,
    <literal moreinfo="none">varset</literal>, <literal moreinfo="none">schema</literal>,
    <literal moreinfo="none">tagset</literal>, <literal moreinfo="none">general</literal>.
    If you're in doubt use the <literal moreinfo="none">general</literal>
    class.
   </para>
  </listitem>
 </varlistentry>

 <varlistentry><term>
   <literal moreinfo="none">register_tab</literal>
   <replaceable>command</replaceable>
   <replaceable>string</replaceable>
  </term>
  <listitem>
   <para>This command registers a TAB completion string for
    the command given.
   </para>
  </listitem>
 </varlistentry>

 <varlistentry><term>
   <literal moreinfo="none">sleep</literal>
   <replaceable>seconds</replaceable>
  </term>
  <listitem>
   <para>This command makes YAZ client sleep (be idle) for
    the number of seconds given.
   </para>
  </listitem>
 </varlistentry>

 <varlistentry id="command-wait-response"><term>
   <literal moreinfo="none">wait_response</literal>
   [ <replaceable>number</replaceable>]
  </term>
  <listitem>
   <para>This command makes YAZ client wait for a number of
    response packages from target. If <replaceable>number</replaceable> is
    omitted, 1 is assumed. 
   </para>
   <para>This command is rarely used and is only useful if command
    <link linkend="command-set-auto-wait">
     <literal moreinfo="none">set_auto_wait</literal>
    </link> is set to off.
   </para>
  </listitem>
 </varlistentry>

 <varlistentry id="command-xmles"><term>
   <literal moreinfo="none">xmles</literal>
   <replaceable>OID</replaceable>
   <replaceable>doc</replaceable>
  </term>
  <listitem>
   <para>Sends XML Extended Services request using the OID and doc given.
   </para>
  </listitem>
 </varlistentry>

 <varlistentry><term>
   <literal moreinfo="none">zversion</literal>
   <replaceable>ver</replaceable>
  </term>
  <listitem>
   <para>This command sets Z39.50 version for negotiation. 
    Should be used before 
    <link linkend="command-open"><literal moreinfo="none">open</literal></link>.
    By default 3 (version 3) is used.
   </para>
  </listitem>
 </varlistentry>

 <varlistentry><term>
   <literal moreinfo="none">options</literal>
   <replaceable>op1 op2..</replaceable>
  </term>
  <listitem>
   <para>This command sets Z39.50 options for negotiation. 
    Should be used before 
   <link linkend="command-open"><literal moreinfo="none">open</literal></link>.
   </para>
   <para>
    The following options are supported:
    <literal moreinfo="none">search</literal>,  
    <literal moreinfo="none">present</literal>,  
    <literal moreinfo="none">delSet</literal>,  
    <literal moreinfo="none">resourceReport</literal>,  
    <literal moreinfo="none">triggerResourceCtrl</literal>,  
    <literal moreinfo="none">resourceCtrl</literal>,  
    <literal moreinfo="none">accessCtrl</literal>,  
    <literal moreinfo="none">scan</literal>,  
    <literal moreinfo="none">sort</literal>,  
    <literal moreinfo="none">extendedServices</literal>,  
    <literal moreinfo="none">level_1Segmentation</literal>,  
    <literal moreinfo="none">level_2Segmentation</literal>,  
    <literal moreinfo="none">concurrentOperations</literal>,  
    <literal moreinfo="none">namedResultSets</literal>,  
    <literal moreinfo="none">encapsulation</literal>,  
    <literal moreinfo="none">resultCount</literal>,  
    <literal moreinfo="none">negotiationModel</literal>,  
    <literal moreinfo="none">duplicationDetection</literal>,  
    <literal moreinfo="none">queryType104</literal>,  
    <literal moreinfo="none">pQESCorrection</literal>,  
    <literal moreinfo="none">stringSchema</literal>.
   </para>
  </listitem>
 </varlistentry>
 
</variablelist>
<!-- 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: nil
sgml-namecase-general:t
End:
-->

   </refsect1>
 <refsect1><title>EXAMPLE</title>
  <para>
   The simplest example of a Prefix Query would be something like
   <screen format="linespecific">
    f knuth
   </screen>
   or
   <screen format="linespecific">
    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 format="linespecific">
    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 format="linespecific">
    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 format="linespecific">
    f @attrset Bib-1 @and @attr GILS 1=2008 Washington @attr 1=21 weather
   </screen>
  </para>
 </refsect1>
  <refsect1><title>FILES</title>
   <para>
    <filename moreinfo="none">yaz-&lt;version&gt;/client/client.c</filename>
   </para>
   <para>
    <filename moreinfo="none">$HOME/.yazclientrc</filename>
   </para>
   <para>
    <filename moreinfo="none">$HOME/.yazclient.history</filename>
   </para>
  </refsect1>
  <refsect1><title>SEE ALSO</title>
   <para>
    <citerefentry>
     <refentrytitle>yaz</refentrytitle>
     <manvolnum>7</manvolnum>
    </citerefentry>
    <citerefentry>
     <refentrytitle>bib1-attr</refentrytitle>
     <manvolnum>7</manvolnum>
    </citerefentry>
   </para>
  </refsect1>
</refentry>
<!--Generated by stripref.xsl . Do not edit-->
<refentry id="yaz-ztest">
 <refentryinfo>
  <productname class="trade">YAZ</productname>
  <productnumber>3.0.51</productnumber>
 </refentryinfo>
 
 <refmeta>
  <refentrytitle>yaz-ztest</refentrytitle>
  <manvolnum>8</manvolnum>
 </refmeta>
 
 <refnamediv>
  <refname>yaz-ztest</refname>
  <refpurpose>Z39.50 Test Server</refpurpose>
 </refnamediv>
 
 <refsynopsisdiv>
  <!-- 
   cmd description of YAZ GFS application.
   Included in both manual and man page for yaz-ztest
-->

<cmdsynopsis sepchar=" ">
 <command moreinfo="none">application</command>
 <arg choice="opt" rep="norepeat"><option>-install</option></arg>
 <arg choice="opt" rep="norepeat"><option>-installa</option></arg>
 <arg choice="opt" rep="norepeat"><option>-remove</option></arg>
 <arg choice="opt" rep="norepeat"><option>-a <replaceable>file</replaceable></option></arg>
 <arg choice="opt" rep="norepeat"><option>-v <replaceable>level</replaceable></option></arg>
 <arg choice="opt" rep="norepeat"><option>-l <replaceable>file</replaceable></option></arg>
 <arg choice="opt" rep="norepeat"><option>-u <replaceable>uid</replaceable></option></arg>
 <arg choice="opt" rep="norepeat"><option>-c <replaceable>config</replaceable></option></arg>
 <arg choice="opt" rep="norepeat"><option>-f <replaceable>vconfig</replaceable></option></arg>
 <arg choice="opt" rep="norepeat"><option>-C <replaceable>fname</replaceable></option></arg>
 <arg choice="opt" rep="norepeat"><option>-t <replaceable>minutes</replaceable></option></arg>
 <arg choice="opt" rep="norepeat"><option>-k <replaceable>kilobytes</replaceable></option></arg>
 <arg choice="opt" rep="norepeat"><option>-d <replaceable>daemon</replaceable></option></arg>
 <arg choice="opt" rep="norepeat"><option>-w <replaceable>dir</replaceable></option></arg>
 <arg choice="opt" rep="norepeat"><option>-p <replaceable>pidfile</replaceable></option></arg>
 <arg choice="opt" rep="norepeat"><option>-r <replaceable>kilobytes</replaceable></option></arg>
 <arg choice="opt" rep="norepeat"><option>-ziDST1</option></arg>
 <arg choice="opt" rep="repeat">listener-spec</arg>
</cmdsynopsis>

<!-- 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: nil
sgml-namecase-general:t
End:
-->

 </refsynopsisdiv>
 <refsect1><title>DESCRIPTION</title>
  <para>
   <command moreinfo="none">yaz-ztest</command> is a Z39.50 test server that uses
   the YAZ generic frontend server API.
   The server acts as a real Z39.50 server but does not use a database.
   It returns a random hit count and returns a subset of a few built-in
   records.
  </para>
  <para>
   The <replaceable>listener-spec</replaceable> consists of a transport
   mode followed by a colon, followed by a listener address. The
   transport mode is either <literal moreinfo="none">tcp</literal>, <literal moreinfo="none">unix</literal>,
   or <literal moreinfo="none">ssl</literal>.
  </para>
  <para>
   For TCP and SSL, an address has the form:
   <screen format="linespecific">
    hostname | IP-number [ : portnumber ]
   </screen>
  </para>
  <para>
   For UNIX local socket the address is the filename of the local socket.
  </para>
 </refsect1>
 <refsect1>
  <title>OPTIONS</title>
  <!-- 
   Options for generic frontend server and yaz-ztest.
   Included in both manual and man page for yaz-ztest
-->

<variablelist>
 
 <varlistentry><term><literal moreinfo="none">-a </literal>
   <replaceable>file</replaceable></term>
  <listitem><para>
    Specify a file for dumping PDUs (for diagnostic purposes).
    The special name <literal moreinfo="none">-</literal> (dash) sends output to
    <literal moreinfo="none">stderr</literal>.
   </para></listitem></varlistentry>
 
 <varlistentry><term><literal moreinfo="none">-S</literal></term>
  <listitem><para>
    Don't fork or make threads on connection requests. This is good for
    debugging, but not recommended for real operation: Although the
    server is asynchronous and non-blocking, it can be nice to keep
    a software malfunction (okay then, a crash) from affecting all
    current users.
   </para></listitem></varlistentry>
 
 <varlistentry><term><literal moreinfo="none">-1</literal></term>
  <listitem><para>
    Like <literal moreinfo="none">-S</literal> but after one session the server
    exits. This mode is for debugging <emphasis>only</emphasis>.
   </para></listitem></varlistentry>
 
 <varlistentry><term><literal moreinfo="none">-T</literal></term>
  <listitem><para>
    Operate the server in threaded mode. The server creates a thread
    for each connection rather than a fork a process. Only available
    on UNIX systems that offers POSIX threads.
   </para></listitem></varlistentry>

 <varlistentry><term><literal moreinfo="none">-s</literal></term>
  <listitem><para>
    Use the SR protocol (obsolete).
   </para></listitem></varlistentry>

 <varlistentry><term><literal moreinfo="none">-z</literal></term>
  <listitem><para>
    Use the Z39.50 protocol (default). This option and <literal moreinfo="none">-s</literal>
    complement each other.
    You can use both multiple times on the same command
    line, between listener-specifications (see below). This way, you
    can set up the server to listen for connections in both protocols
    concurrently, on different local ports.
   </para></listitem></varlistentry>

 <varlistentry><term><literal moreinfo="none">-l </literal>
   <replaceable>file</replaceable></term>
  <listitem><para>The logfile.
   </para></listitem></varlistentry>

 <varlistentry><term><literal moreinfo="none">-c </literal>
   <replaceable>config</replaceable></term>
  <listitem><para>A user option that serves as a specifier for some
    sort of configuration, usually a filename.
    The argument to this option is transferred to member
    <literal moreinfo="none">configname</literal> of the
    <literal moreinfo="none">statserv_options_block</literal>.
   </para></listitem></varlistentry>

 <varlistentry><term><literal moreinfo="none">-f </literal>
   <replaceable>vconfig</replaceable></term>
  <listitem><para>This specifies an XML file that describes
    one or more YAZ frontend virtual servers.
   </para></listitem></varlistentry>

 <varlistentry><term><literal moreinfo="none">-C </literal>
   <replaceable>fname</replaceable></term>
  <listitem><para>Sets SSL certificate file name for server (PEM).
   </para></listitem></varlistentry>

 <varlistentry><term><literal moreinfo="none">-v </literal>
   <replaceable>level</replaceable></term>
  <listitem><para>
    The log level. Use a comma-separated list of members of the set
    {fatal,debug,warn,log,malloc,all,none}.
   </para></listitem></varlistentry>

 <varlistentry><term><literal moreinfo="none">-u </literal>
   <replaceable>uid</replaceable></term>
  <listitem><para>
    Set user ID. Sets the real UID of the server process to that of the
    given user. It's useful if you aren't comfortable with having the
    server run as root, but you need to start it as such to bind a
    privileged port.
   </para></listitem></varlistentry>

 <varlistentry><term><literal moreinfo="none">-w </literal>
   <replaceable>dir</replaceable></term>
  <listitem><para>
    The server changes to this directory during before listening 
    on incoming connections. This option is useful
    when the server is operating from the <application moreinfo="none">inetd</application>
    daemon (see <literal moreinfo="none">-i</literal>).
   </para></listitem></varlistentry>

 <varlistentry><term><literal moreinfo="none">-p </literal>
   <replaceable>pidfile</replaceable></term>
  <listitem><para>
    Specifies that the server should write its Process ID to
    file given by <replaceable>pidfile</replaceable>. 
    A typical location would be <filename moreinfo="none">/var/run/yaz-ztest.pid</filename>.
   </para></listitem></varlistentry>

 <varlistentry><term><literal moreinfo="none">-i</literal></term>
  <listitem><para>
    Use this to make the the server run from the
    <application moreinfo="none">inetd</application> server (UNIX only).
   </para></listitem></varlistentry>
 
 <varlistentry><term><literal moreinfo="none">-D</literal></term>
  <listitem><para>
    Use this to make the server put itself in the background and
    run as a daemon. If neither <literal moreinfo="none">-i</literal> nor 
    <literal moreinfo="none">-D</literal> is given, the server starts in the foreground.
   </para></listitem></varlistentry>
 
 <varlistentry><term><literal moreinfo="none">-install</literal></term>
  <listitem><para>
    Use this to install the server as an NT service
    (Windows NT/2000/XP only). 
    Control the server by going to the Services in the Control Panel.
   </para></listitem></varlistentry>
 
 <varlistentry><term><literal moreinfo="none">-installa</literal></term>
  <listitem><para>
    Use this to install and activate the server as an NT service
    (Windows NT/2000/XP only). 
    Control the server by going to the Services in the Control Panel.
   </para></listitem></varlistentry>
 
 <varlistentry><term><literal moreinfo="none">-remove</literal></term>
  <listitem><para>
    Use this to remove the server from the NT services
    (Windows NT/2000/XP only). 
   </para></listitem></varlistentry>
 
 <varlistentry><term><literal moreinfo="none">-t </literal>
   <replaceable>minutes</replaceable></term>
  <listitem><para>
    Idle session timeout, in minutes.
   </para></listitem></varlistentry>
 
 <varlistentry><term><literal moreinfo="none">-k </literal>
   <replaceable>size</replaceable></term>
  <listitem><para>
    Maximum record size/message size, in kilobytes.
   </para></listitem>
 </varlistentry>

 <varlistentry><term><literal moreinfo="none">-r </literal>
   <replaceable>size</replaceable></term>
  <listitem><para>
    Maximum size of log file before rotation occurs, in kilobytes.
    Default size is 1048576 k (=1 GB).
   </para></listitem>
 </varlistentry>

 <varlistentry><term><literal moreinfo="none">-d </literal>
   <replaceable>daemon</replaceable></term>
  <listitem><para>
    Set name of daemon to be used in hosts access file.
    See
    <citerefentry>
     <refentrytitle>hosts_access</refentrytitle>
     <manvolnum>5</manvolnum>
    </citerefentry>
    and 
    <citerefentry>
     <refentrytitle>tcpd</refentrytitle>
     <manvolnum>8</manvolnum>
    </citerefentry>.
   </para></listitem>
 </varlistentry>

 <varlistentry><term><literal moreinfo="none">-m </literal>
   <replaceable>time-format</replaceable></term>
  <listitem><para>
   Sets the format of time-stamps in the log-file. Specify a string in
   the input format to <literal moreinfo="none">strftime()</literal>.
   </para></listitem>
 </varlistentry>
 
</variablelist>

<!-- 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: nil
sgml-namecase-general:t
End:
-->

 </refsect1>
 <refsect1><title>GFS CONFIGURATION AND VIRTUAL HOSTS</title>
  <!-- 
   Description of the virtual host mechanism in YAZ GFS
   Included in both manual and man page for yaz-ztest
-->

<para>
 The Virtual hosts mechanism allows a YAZ frontend server to
 support multiple backends. A backend is selected on the basis of
 the TCP/IP binding (port+listening adddress) and/or the virtual host.
</para>
<para>
 A backend can be configured to execute in a particular working
 directory. Or the YAZ frontend may perform CQL to RPN conversion, thus
 allowing traditional Z39.50 backends to be offered as a SRW/SRU
 service. SRW/SRU Explain information for a particular backend may also
 be specified.
</para>
<para>
 For the HTTP protocol, the virtual host is specified in the Host header.
 For the Z39.50 protocol, the virtual host is specified as in the
 Initialize Request in the OtherInfo, OID 1.2.840.10003.10.1000.81.1.
</para>
<note>
 <para>
  Not all Z39.50 clients allows the VHOST information to be set.
  For those the selection of the backend must rely on the
  TCP/IP information alone (port and address).
 </para>
</note>
<para>
 The YAZ frontend server uses XML to describe the backend
 configurations. Command-line option <literal moreinfo="none">-f</literal> 
 specifies filename of the XML configuration.
</para>
<para>
 The configuration uses the root element <literal moreinfo="none">yazgfs</literal>.
 This element includes a list of <literal moreinfo="none">listen</literal> elements,
 followed by one or more <literal moreinfo="none">server</literal> elements.
</para>
<para>
 The <literal moreinfo="none">listen</literal> describes listener (transport end point),
 such as TCP/IP, Unix file socket or SSL server. Content for 
 a listener:
 <variablelist>
  <varlistentry><term>CDATA (required)</term>
   <listitem>
    <para>
     The CDATA for the <literal moreinfo="none">listen</literal> element holds the
     listener string, such as <literal moreinfo="none">tcp:@:210</literal>, 
     <literal moreinfo="none">tcp:server1:2100</literal>,
     etc.
    </para>
   </listitem>
  </varlistentry>
  <varlistentry><term>attribute <literal moreinfo="none">id</literal> (optional)</term>
    <listitem>
     <para>
      identifier for this listener. This may be referred to from
      server sections.
     </para>
    </listitem>
   </varlistentry>
 </variablelist>
 <note>
  <para>
   We expect more information to be added for the listen section in
   a future version, such as CERT file for SSL servers.
  </para>
 </note>
</para>
<para>
 The <literal moreinfo="none">server</literal> describes a server and the parameters
 for this server type. Content for a server:
 <variablelist>
  <varlistentry><term>attribute <literal moreinfo="none">id</literal> (optional)</term>
   <listitem>
    <para>
     Identifier for this server. Currently not used for anything,
     but it might be for logging purposes.
   </para>
   </listitem>
  </varlistentry>

  <varlistentry><term>attribute <literal moreinfo="none">listenref</literal> (optional)</term>
   <listitem>
    <para>
     Specifies listener for this server. If this attribute is not
     given, the server is accessible from all listener. In order
     for the server to be used for real, howeever, the virtual host
     must match (if specified in the configuration).
    </para>
   </listitem>
  </varlistentry>

  <varlistentry><term>element <literal moreinfo="none">config</literal> (optional)</term>
   <listitem>
    <para>
     Specifies the server configuration. This is equivalent
     to the config specified using command line option
     <literal moreinfo="none">-c</literal>.
    </para>
   </listitem>
  </varlistentry>

  <varlistentry><term>element <literal moreinfo="none">directory</literal> (optional)</term>
   <listitem>
    <para>
     Specifies a working directory for this backend server. If
     specifid, the YAZ fronend changes current working directory
     to this directory whenever a backend of this type is
     started (backend handler bend_start), stopped (backend handler hand_stop)
     and initialized (bend_init).
    </para>
   </listitem>
  </varlistentry>

  <varlistentry><term>element <literal moreinfo="none">host</literal> (optional)</term>
   <listitem>
    <para>
     Specifies the virtual host for this server. If this is specified
     a client <emphasis>must</emphasis> specify this host string in
     order to use this backend.
    </para>
   </listitem>
  </varlistentry>

  <varlistentry><term>element <literal moreinfo="none">cql2rpn</literal> (optional)</term>
   <listitem>
    <para>
     Specifies a filename that includes CQL to RPN conversion for this
     backend server. See <xref linkend="cql.to.rpn"/>
     If given, the backend server will only "see" a Type-1/RPN query. 
    </para>
   </listitem>
  </varlistentry>

  <varlistentry><term>element <literal moreinfo="none">ccl2rpn</literal> (optional)</term>
   <listitem>
    <para>
     Specifies a filename that includes CCL to RPN conversion for this
     backend server. See <xref linkend="ccl.qualifiers"/>
     If given, the backend server will only "see" a Type-1/RPN query. 
    </para>
   </listitem>
  </varlistentry>

  <varlistentry><term>element <literal moreinfo="none">stylesheet</literal> (optional)</term>
   <listitem>
    <para>
     Specifies the stylesheet reference to be part of SRU HTTP responses
     when the client does not specify one. If neither this is given, nor
     the client specifies one, no stylesheet reference is part of the
     SRU HTTP response.
    </para>
   </listitem>
  </varlistentry>
   
  <varlistentry><term>element <literal moreinfo="none">docpath</literal> (optional)</term>
   <listitem>
    <para>
     Specifies a path for local file access using HTTP. All URLs with
     a leading prefix (/ exluded) that matches the value of docpath
     are used for file access. For example, if the server is to offer
     access in directory <literal moreinfo="none">xsl</literal>, the docpath would be
     <literal moreinfo="none">xsl</literal> and all URLs of the form
     <literal moreinfo="none">http://host/exl</literal> will result in a local file access.
    </para>
   </listitem>
  </varlistentry>
   
  <varlistentry><term>element <literal moreinfo="none">explain</literal> (optional)</term>
   <listitem>
    <para>
     Specifies SRW/SRU ZeeRex content for this server. Copied verbatim
     to the client. As things are now, some of the Explain content
     seeem redundant because host information, etc. is also stored
     elsewhere.
    </para>
   </listitem>
  </varlistentry>

  <varlistentry><term>element <literal moreinfo="none">maximumrecordsize</literal> (optional)</term>
   <listitem>
    <para>
     Specifies maximum record size/message size, in bytes. This
     value also servers as maximum size of <emphasis>incoming</emphasis>
     packages (for Record Updates etc). It's the same value as that
     given by the <literal moreinfo="none">-k</literal> option.
    </para>
   </listitem>
  </varlistentry>

  <varlistentry><term>element <literal moreinfo="none">retrievalinfo</literal> (optional)</term>
   <listitem>
    <para>
     Enables the retrieval facility supporting conversions and
     specifications of record formats/types.
     See <xref linkend="tools.retrieval"/> for
     more information.
    </para>
   </listitem>
  </varlistentry>
   
 </variablelist>
</para>
 
<para>
 The XML below configures a server that accepts connections from
 two ports, TCP/IP port 9900 and a local UNIX file socket.
 We name the TCP/IP server <literal moreinfo="none">public</literal> and the
 other server <literal moreinfo="none">internal</literal>.
 </para>
 <screen format="linespecific">
  
 &lt;yazgfs&gt;
  &lt;listen id="public"&gt;tcp:@:9900&lt;/listen&gt;
  &lt;listen id="internal"&gt;unix:/var/tmp/socket&lt;/listen&gt;
  &lt;server id="server1"&gt;
    &lt;host&gt;server1.mydomain&lt;/host&gt;
    &lt;directory&gt;/var/www/s1&lt;/directory&gt;
    &lt;config&gt;config.cfg&lt;/config&gt;
  &lt;/server&gt;
  &lt;server id="server2"&gt;
    &lt;host&gt;server2.mydomain&lt;/host&gt;
    &lt;directory&gt;/var/www/s2&lt;/directory&gt;
    &lt;config&gt;config.cfg&lt;/config&gt;
    &lt;cql2rpn&gt;../etc/pqf.properties&lt;/cql2rpn&gt;
    &lt;explain xmlns="http://explain.z3950.org/dtd/2.0/"&gt;
      &lt;serverInfo&gt;
        &lt;host&gt;server2.mydomain&lt;/host&gt;
        &lt;port&gt;9900&lt;/port&gt;
        &lt;database&gt;a&lt;/database&gt;
      &lt;/serverInfo&gt;
    &lt;/explain&gt;
  &lt;/server&gt;
  &lt;server id="server3" listenref="internal"&gt;
    &lt;directory&gt;/var/www/s3&lt;/directory&gt;
    &lt;config&gt;config.cfg&lt;/config&gt;
  &lt;/server&gt;
 &lt;/yazgfs&gt;

 </screen>
<para>
 There are three configured backend servers. The first two
 servers, <literal moreinfo="none">"server1"</literal> and <literal moreinfo="none">"server2"</literal>,
 can be reached by both listener addresses - since
 no <literal moreinfo="none">listenref</literal> attribute is specified.
 In order to distinguish between the two a virtual host has
 been specified for each of server in the <literal moreinfo="none">host</literal>
 elements.
</para>
<para>
 For <literal moreinfo="none">"server2"</literal> elements for CQL to RPN conversion
 is supported and explain information has been added (a short one here
 to keep the example small).
</para>
<para>
 The third server, <literal moreinfo="none">"server3"</literal> can only be reached
 via listener <literal moreinfo="none">"internal"</literal>.
</para>

<!-- 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: nil
sgml-namecase-general:t
End:
-->

 </refsect1>
 <refsect1><title>FILES</title>
  <para>
   <filename moreinfo="none">yaz-&lt;version&gt;/ztest/yaz-ztest.c</filename>
  </para>
  <para>
   <filename moreinfo="none">yaz-&lt;version&gt;/include/yaz/backend.h</filename>
  </para>
 </refsect1>
 <refsect1><title>SEE ALSO</title>
  <para>
   <citerefentry>
    <refentrytitle>yaz</refentrytitle>
    <manvolnum>7</manvolnum>
   </citerefentry>
   <citerefentry>
    <refentrytitle>yaz-log</refentrytitle>
    <manvolnum>7</manvolnum>
   </citerefentry>
  </para>
 </refsect1>
</refentry>
<!--Generated by stripref.xsl . Do not edit-->
<refentry id="yaz-config">
 <refentryinfo>
  <productname class="trade">YAZ</productname>
  <productnumber>3.0.51</productnumber>
 </refentryinfo>
 
 <refmeta>
  <refentrytitle>yaz-config</refentrytitle>
  <manvolnum>8</manvolnum>
 </refmeta>
 
 <refnamediv>
  <refname>yaz-config</refname>
  <refpurpose>Script to get information about YAZ.</refpurpose>
 </refnamediv>
 
 <refsynopsisdiv>
  <cmdsynopsis sepchar=" ">
   <command moreinfo="none">yaz-config</command>
   <arg choice="opt" rep="norepeat"><option>--prefix[=<replaceable>DIR</replaceable>]</option></arg>
   <arg choice="opt" rep="norepeat"><option>--version</option></arg>
   <arg choice="opt" rep="norepeat"><option>--libs</option></arg>
   <arg choice="opt" rep="norepeat"><option>--lalibs</option></arg>
   <arg choice="opt" rep="norepeat"><option>--cflags</option></arg>
   <arg choice="opt" rep="norepeat"><option>--comp</option></arg>
   <arg choice="opt" rep="norepeat"><option>-V</option></arg>
   <arg choice="opt" rep="repeat">libraries</arg>
  </cmdsynopsis>
 </refsynopsisdiv>
 
 <refsect1><title>DESCRIPTION</title>
  <para>
   <command moreinfo="none">yaz-config</command> is a script that returns information
   that your own software should use to build software that uses YAZ.
  </para>

  <para>
   The following libraries are supported:
  </para>

  <variablelist>
   <varlistentry>
    <term>threads</term>
    <listitem><para>
      Use the threaded version of YAZ.
     </para></listitem>
   </varlistentry>
  </variablelist>
  
 </refsect1>
 
 <refsect1><title>OPTIONS</title>
  
  <variablelist>
   <varlistentry>
    <term>--prefix[=<replaceable>DIR</replaceable>]</term>
    <listitem><para>
      Returns prefix of YAZ or assume a different one if DIR is
      specified.
     </para></listitem>
   </varlistentry>

   <varlistentry>
    <term>--version</term>
    <listitem><para>
      Returns version of YAZ.
     </para></listitem>
   </varlistentry>

   <varlistentry>
    <term>--libs</term>
    <listitem><para>
      Library specification be used when using YAZ.
     </para></listitem>
   </varlistentry>

   <varlistentry>
    <term>--lalibs</term>
    <listitem><para>
      Return library specification.
     </para></listitem>
   </varlistentry>

   <varlistentry>
    <term>--cflags</term>
    <listitem><para>
      Return C Compiler flags.
     </para></listitem>
   </varlistentry>

   <varlistentry>
    <term>--comp</term>
    <listitem><para>
      Returns full path to YAZ' ASN.1 compiler: yaz-asncomp.
     </para></listitem>
   </varlistentry>

   <varlistentry>
    <term>-V</term>
    <listitem><para>
      veturns YAZ SHA1 ID (from Git) and version.
     </para></listitem>
   </varlistentry>

  </variablelist>
 </refsect1>
 
 <refsect1><title>FILES</title>
  <para>
   <filename moreinfo="none">/usr/local/bin/yaz-config</filename>
  </para>
  <para>
   <filename moreinfo="none">/usr/local/lib/libyaz*.a</filename>
  </para>
  <para>
   <filename moreinfo="none">/usr/local/include/yaz/*.h</filename>
  </para>
  </refsect1>
 <refsect1><title>SEE ALSO</title>
  <para>
   yaz(7)
  </para>
  <para>
   Section "How to make apps using YAZ on UNIX" in the YAZ manual.
  </para>
 </refsect1>
</refentry>
<!--Generated by stripref.xsl . Do not edit-->
<refentry id="yaz">
 <refentryinfo>
  <productname class="trade">YAZ</productname>
  <productnumber>3.0.51</productnumber>
 </refentryinfo>
 
 <refmeta>
  <refentrytitle>yaz</refentrytitle>
  <manvolnum>7</manvolnum>
 </refmeta>
 
 <refnamediv>
  <refname>yaz</refname>
  <refpurpose>Z39.50 toolkit.</refpurpose>
 </refnamediv>
 
 <refsect1><title>DESCRIPTION</title>
  <para>
   YAZ is a C/C++ programmer's toolkit supporting the development
   of Z39.50v3 clients and servers. The YAZ toolkit offers
   several different levels of access to the ISO23950/Z39.50, SRU
   and ILL protocols. The level that you need to use depends
   on your requirements, and the role (server of client) that you want
   to implement.
  </para>
 </refsect1>

 <refsect1><title>COPYRIGHT</title>
  <para>
   Copyright © 1995-2009 Index Data.
  </para>
  <para>
   All rights reserved.
  </para>
  
  <para>
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions are met:
  </para>
  
  <itemizedlist>
   <listitem>
    <para>
     Redistributions of source code must retain the above copyright
     notice, this list of conditions and the following disclaimer.
    </para>
   </listitem>
   <listitem>
    <para>
     Redistributions in binary form must reproduce the above copyright
     notice, this list of conditions and the following disclaimer in the
     documentation and/or other materials provided with the distribution.
    </para>
   </listitem>
   <listitem>
    <para>
     Neither the name of Index Data nor the names of its contributors
     may be used to endorse or promote products derived from this
     software without specific prior written permission.
    </para>
   </listitem>
  </itemizedlist>
  
  <para>
   THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY
   EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
   WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR
   ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
   SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
   CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
   LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
   OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   SUCH DAMAGE.
  </para>
  
 </refsect1>
 
 <refsect1><title>SEE ALSO</title>
  <para>
    <citerefentry>
     <refentrytitle>yaz-client</refentrytitle>
     <manvolnum>1</manvolnum>
    </citerefentry>,
    <citerefentry>
     <refentrytitle>yaz-ztest</refentrytitle>
     <manvolnum>8</manvolnum>
    </citerefentry>,
    <citerefentry>
     <refentrytitle>yaz-config</refentrytitle>
     <manvolnum>8</manvolnum>
    </citerefentry>,
    <citerefentry>
     <refentrytitle>zoomsh</refentrytitle>
     <manvolnum>1</manvolnum>
    </citerefentry>
    <citerefentry>
     <refentrytitle>bib1-attr</refentrytitle>
     <manvolnum>7</manvolnum>
    </citerefentry>
  </para>
  <para>YAZ manual (
   <filename moreinfo="none">/usr/local/share/doc/yaz</filename>)
  </para>
  <para>
   <ulink url="http://www.indexdata.com/yaz/">YAZ home page</ulink>.
  </para>
  <para>
   <ulink url="http://www.loc.gov/z3950/agency/">Z39.50 Maintenance Agency Page</ulink>.
  </para>
 </refsect1>
</refentry>
<!--Generated by stripref.xsl . Do not edit-->
<refentry id="zoomsh">
 <refentryinfo>
  <productname class="trade">YAZ</productname>
  <productnumber>3.0.51</productnumber>
 </refentryinfo>
 
 <refmeta>
  <refentrytitle>zoomsh</refentrytitle>
  <manvolnum>1</manvolnum>
 </refmeta>
 
 <refnamediv>
  <refname>zoomsh</refname>
  <refpurpose>ZOOM shell</refpurpose>
 </refnamediv>

 <refsynopsisdiv>
  <cmdsynopsis sepchar=" ">
   <command moreinfo="none">zoomsh</command>
   <arg choice="opt" rep="repeat">commands</arg>
  </cmdsynopsis>
 </refsynopsisdiv>

  <refsect1><title>DESCRIPTION</title>
   <para>
    <command moreinfo="none">zoomsh</command> is a ZOOM client with a simple
    command line interface. The client demonstrates the ZOOM
    API and is useful for testing targets.
   </para>
   <para>
    You may pass one or more commands to <command moreinfo="none">zoomsh</command>.
    These commands are invoked first. 
   </para>
  </refsect1>
  <refsect1><title>EXAMPLES</title>
   <para>
    If you start the <command moreinfo="none">yaz-ztest</command> in one console you
    can use the ZOOM shell as follows:
    <screen format="linespecific">
$ zoomsh
ZOOM&gt;connect localhost:9999
ZOOM&gt;search computer
localhost:9999: 7 hits
ZOOM&gt;show 0 1
1 Default USmarc
001    11224466 
003 DLC
005 00000000000000.0
008 910710c19910701nju           00010 eng  
010    $a    11224466 
040    $a DLC $c DLC
050 00 $a 123-xyz
100 10 $a Jack Collins
245 10 $a How to program a computer
260 1  $a Penguin
263    $a 8710
300    $a p. cm.
ZOOM&gt;quit

    </screen>
   </para>
   <para>
    You can also achieve the same result by passing the commands
    as arguments on a single command line:
   </para>
   <para>
    <literal moreinfo="none">$ zoomsh "connect localhost:9999" "search computer"</literal>
    <literal moreinfo="none">"show 0 1" quit</literal>
   </para>
  </refsect1>
  <refsect1><title>COMMANDS</title>
   <variablelist>
    
    <varlistentry><term><literal moreinfo="none">connect</literal>
      <replaceable>zurl</replaceable></term>
     <listitem><para>
       Connects to the target given by <replaceable>zurl</replaceable>.
      </para></listitem></varlistentry>
    
    <varlistentry><term><literal moreinfo="none">close</literal>
      [<replaceable>zurl</replaceable>]</term>
     <listitem><para>
       Closes connection to target given by
       <replaceable>zurl</replaceable> or all targets if
       <replaceable>zurl</replaceable> was omitted.
      </para></listitem></varlistentry>
    
    <varlistentry><term><literal moreinfo="none">show</literal>
      [<replaceable>start</replaceable>
      [<replaceable>count</replaceable>]]
     </term>
     <listitem><para>
       Displays <literal moreinfo="none">count</literal> records starting at offset given
       by <replaceable>start</replaceable>. First records has offset 0
       (unlike the Z39.50 protocol).
      </para></listitem></varlistentry>
    
    <varlistentry><term><literal moreinfo="none">quit</literal>
     </term>
     <listitem><para>
       Quits <command moreinfo="none">zoomsh</command>.
      </para></listitem></varlistentry>
    
    <varlistentry><term><literal moreinfo="none">set</literal>
      <replaceable>name</replaceable>
      [<replaceable>value</replaceable>]
     </term>
     <listitem><para>
       Sets option <replaceable>name</replaceable> to
       <replaceable>value</replaceable>.
      </para></listitem></varlistentry>
    
    <varlistentry><term><literal moreinfo="none">get</literal>
      <replaceable>name</replaceable>
     </term>
     <listitem><para>
       Prints value of option <replaceable>name</replaceable>.
      </para></listitem></varlistentry>
    
    <varlistentry><term><literal moreinfo="none">help</literal>
     </term>
     <listitem><para>
       Prints list of available commands.
      </para></listitem></varlistentry>
    
   </variablelist>
   
  </refsect1>
  <refsect1><title>SEE ALSO</title>
   <para>
    <citerefentry>
     <refentrytitle>yaz</refentrytitle>
     <manvolnum>7</manvolnum>
    </citerefentry>,
    <citerefentry>
     <refentrytitle>yaz-ztest</refentrytitle>
     <manvolnum>8</manvolnum>
    </citerefentry>,
   </para>
   <para>
    Section "Building clients with ZOOM" in the YAZ manual.
   </para>
   <para>
    <ulink url="http://zoom.z3950.org/">ZOOM home page</ulink>.
   </para>
  </refsect1>
</refentry>
<!--Generated by stripref.xsl . Do not edit-->
<refentry id="yaz-asncomp">
 <refentryinfo>
  <productname class="trade">YAZ</productname>
  <productnumber>3.0.51</productnumber>
 </refentryinfo>
 
 <refmeta>
  <refentrytitle>yaz-asncomp</refentrytitle>
  <manvolnum>1</manvolnum>
 </refmeta>
 
 <refnamediv>
  <refname>yaz-asncomp</refname>
  <refpurpose>YAZ ASN.1 compiler</refpurpose>
 </refnamediv>
 
 <refsynopsisdiv>
  <cmdsynopsis sepchar=" ">
   <command moreinfo="none">yaz-asncomp</command>
   <arg choice="opt" rep="norepeat"><option>-v</option></arg>
   <arg choice="opt" rep="norepeat"><option>-c <replaceable>cfile</replaceable></option></arg>
   <arg choice="opt" rep="norepeat"><option>-h <replaceable>hfile</replaceable></option></arg>
   <arg choice="opt" rep="norepeat"><option>-p <replaceable>pfile</replaceable></option></arg>
   <arg choice="opt" rep="norepeat"><option>-d <replaceable>config</replaceable></option></arg>
   <arg choice="opt" rep="norepeat"><option>-I <replaceable>includeout</replaceable></option></arg>
   <arg choice="opt" rep="norepeat"><option>-i <replaceable>includedir</replaceable></option></arg>
   <arg choice="opt" rep="norepeat"><option>-m <replaceable>module</replaceable></option></arg>
   <arg choice="opt" rep="norepeat">filename</arg>
  </cmdsynopsis>
  
 </refsynopsisdiv>
  <refsect1><title>DESCRIPTION</title>
  <para>
   <command moreinfo="none">yaz-asncomp</command> is an ASN.1 compiler that
   reads an ASN.1 specification in <replaceable>filename</replaceable>
   and produces C/C++ definitions and BER encoders/decoders for it.
  </para>
  <para>
   The produced C/C++ code and header files uses the ODR module of YAZ
   which is a library that encodes/decodes/prints BER packages.
   <command moreinfo="none">yaz-asncomp</command> allows you to specify name of
   resulting source via options. Alternatively, you can specify
   a DEFINISIONS file, which provides customized output to
   many output files - if the ASN.1 specification file consists
   of many modules.
  </para>
  <para>
   This utility is written in Tcl. Any version of Tcl should work.
  </para>
  </refsect1>
    <refsect1>
  <title>OPTIONS</title>
  <variablelist>
   <varlistentry><term><literal moreinfo="none">-v </literal>
 </term>
    <listitem>
     <para>
      Makes the ASN.1 compiler print more verbose about the
      various stages of operations. 
     </para>
    </listitem>
   </varlistentry>
   
   <varlistentry><term><literal moreinfo="none">-c </literal>
     <replaceable>cfile</replaceable></term>
    <listitem><para>
      Specifies the name of the C/C++ file with encoders/decoders.
     </para></listitem>
   </varlistentry>
   
   <varlistentry><term><literal moreinfo="none">-h </literal>
     <replaceable>hfile</replaceable></term>
    <listitem><para>
      Specifies the name of header file with definitions.
     </para></listitem>
   </varlistentry>
   
   <varlistentry><term><literal moreinfo="none">-p </literal>
     <replaceable>pfile</replaceable></term>
    <listitem><para>
      Specifies the name of the a private header file with
      definitions. By default all definitions are put
      in header file (option -h).
     </para></listitem>
   </varlistentry>
   
   <varlistentry><term><literal moreinfo="none">-d </literal>
     <replaceable>dfile</replaceable></term>
    <listitem><para>
      Specifies the name of a definitions file.
     </para></listitem>
   </varlistentry>
   
   <varlistentry><term><literal moreinfo="none">-I </literal>
     <replaceable>iout</replaceable></term>
    <listitem><para>
      Specifies first part of directory in which header files
      are written.
     </para></listitem>
   </varlistentry>
   
   <varlistentry><term><literal moreinfo="none">-i </literal>
     <replaceable>idir</replaceable></term>
    <listitem><para>
      Specifies second part of directory in which header files
      are written.
     </para></listitem>
   </varlistentry>
   
   <varlistentry><term><literal moreinfo="none">-m </literal>
     <replaceable>module</replaceable></term>
    <listitem><para>
      Specifies that ASN.1 compiler should only process the
      module given. If this option is not specified,
      all modules in the ASN.1 file are processed.
     </para></listitem>
   </varlistentry>
   
  </variablelist>
 </refsect1>
 <refsect1><title>DEFINITIONS FILE</title>
  <para>
   The definitions file is really a Tcl script but follows
   traditional rules for Shell like configuration files.
   That is # denotes the beginning of a comment. Definitions
   are line oriented. The definitions files usually consists of
   a series of variable assignments of the form:
  </para>
  <para>
   <literal moreinfo="none">set</literal> <replaceable>name</replaceable> <replaceable>value</replaceable>
  </para>
  <para>
   Available variables are:
   <variablelist>
    
    <varlistentry><term><literal moreinfo="none">default-prefix</literal></term>
     <listitem><para>
       Sets prefix for names in the produced output.
       The value consists of three tokens: C function prefix,
       C typedef prefix and preprocessor prefix respectively.
      </para></listitem>
    </varlistentry>
    
    <varlistentry><term><literal moreinfo="none">prefix(</literal><replaceable>module</replaceable><literal moreinfo="none">)</literal></term>
     <listitem><para>
       This value sets prefix values for module
       <replaceable>module</replaceable>.
       The value has same form as <literal moreinfo="none">default-prefix</literal>.
      </para></listitem>
    </varlistentry>
    
    <varlistentry><term><literal moreinfo="none">filename(</literal><replaceable>module</replaceable><literal moreinfo="none">)</literal></term>
     <listitem><para>
       Specifies filename for C/header file for module
       <replaceable>module</replaceable>.
      </para></listitem>
    </varlistentry>
    
    <varlistentry><term><literal moreinfo="none">init(</literal><replaceable>module</replaceable><literal moreinfo="none">,h)</literal></term>
     <listitem><para>
       Code fragment to be put in first part of public header for module 
    <replaceable>module</replaceable>.
      </para></listitem>
    </varlistentry>
    
    <varlistentry><term><literal moreinfo="none">body(</literal><replaceable>module</replaceable><literal moreinfo="none">,h)</literal></term>
     <listitem><para>
       Code fragment to be put in last part of public header for module 
    <replaceable>module</replaceable> (trailer).
      </para></listitem>
    </varlistentry>

    <varlistentry><term><literal moreinfo="none">init(</literal><replaceable>module</replaceable><literal moreinfo="none">,c)</literal></term>
     <listitem><para>
       Code fragment to be put in first part of C based encoder/decoder for
       module <replaceable>module</replaceable>.
      </para></listitem>
    </varlistentry>
    
    <varlistentry><term><literal moreinfo="none">body(</literal><replaceable>module</replaceable><literal moreinfo="none">,c)</literal></term>
     <listitem><para>
       Code fragment to be put in last part of C based encoder/decoder for
       module <replaceable>module</replaceable> (trailer).
      </para></listitem>
    </varlistentry>
    
    <varlistentry><term><literal moreinfo="none">map(</literal><replaceable>module</replaceable><literal moreinfo="none">,</literal><replaceable>name</replaceable><literal moreinfo="none">)</literal></term>
     <listitem><para>
       Maps ASN.1 type in module <replaceable>module</replaceable> 
       of <replaceable>name</replaceable> to value.
      </para></listitem>
    </varlistentry>
    
    <varlistentry><term><literal moreinfo="none">membermap(</literal><replaceable>module</replaceable><literal moreinfo="none">,</literal><replaceable>name</replaceable><literal moreinfo="none">,</literal><replaceable>member</replaceable><literal moreinfo="none">)</literal></term>
     <listitem><para>
       Maps member <replaceable>member</replaceable> in SEQUENCE/CHOICE of
       <replaceable>name</replaceable> in module
       <replaceable>module</replaceable> to value.
       The value consists of one or two tokens.
       First token is name of C preprocessor part. Second token
       is resulting C member name. If second token is omitted
       the value (one token) is both preprocessor part and
       C <literal moreinfo="none">struct</literal>,<literal moreinfo="none">union</literal>.
      </para></listitem>
    </varlistentry>
    
    <varlistentry><term><literal moreinfo="none">unionmap(</literal><replaceable>module</replaceable><literal moreinfo="none">,</literal><replaceable>name</replaceable><literal moreinfo="none">,</literal><replaceable>member</replaceable><literal moreinfo="none">)</literal></term>
     <listitem><para>
       Maps member <replaceable>member</replaceable> in CHOICE of
       <replaceable>name</replaceable> in module
       <replaceable>module</replaceable> to value.
       Value consists of to or three tokens. The first token
       is name of the integer in the <literal moreinfo="none">union</literal> that
       is used as selector for the <literal moreinfo="none">union</literal> itself.
       The second token is name of the <literal moreinfo="none">union</literal>.
       The third token overrides the name of the CHOICE member;
       if omitted the member name is used.
      </para></listitem>
    </varlistentry>
   </variablelist>
  </para>
 </refsect1>
 <refsect1><title>FILES</title>
  <para>
   <filename moreinfo="none">/usr/share/yaz/z39.50/z.tcl</filename>
  </para>
  <para>
   <filename moreinfo="none">/usr/share/yaz/z39.50/*.asn</filename>
  </para>
 </refsect1>
 <refsect1><title>SEE ALSO</title>
  <para>
   <citerefentry>
    <refentrytitle>yaz</refentrytitle>
    <manvolnum>7</manvolnum></citerefentry>
  </para>
  <para>
   Section "The ODR Module" in the YAZ manual.
  </para>
 </refsect1>
</refentry>
<!--Generated by stripref.xsl . Do not edit-->
<refentry id="yaz-marcdump">
 <refentryinfo>
  <productname class="trade">YAZ</productname>
  <productnumber>3.0.51</productnumber>
 </refentryinfo>
 <refmeta>
  <refentrytitle>yaz-marcdump</refentrytitle>
  <manvolnum>1</manvolnum>
 </refmeta>
 
 <refnamediv>
  <refname>yaz-marcdump</refname>
  <refpurpose>MARC record dump utility</refpurpose>
 </refnamediv>
 
 <refsynopsisdiv>
  <cmdsynopsis sepchar=" ">
   <command moreinfo="none">yaz-marcdump</command>
   <arg choice="opt" rep="norepeat"><option>-i <replaceable>format</replaceable></option></arg>
   <arg choice="opt" rep="norepeat"><option>-o <replaceable>format</replaceable></option></arg>
   <arg choice="opt" rep="norepeat"><option>-f <replaceable>from</replaceable></option></arg>
   <arg choice="opt" rep="norepeat"><option>-t <replaceable>to</replaceable></option></arg>
   <arg choice="opt" rep="norepeat"><option>-l <replaceable>spec</replaceable></option></arg>
   <arg choice="opt" rep="norepeat"><option>-c <replaceable>cfile</replaceable></option></arg>
   <arg choice="opt" rep="norepeat"><option>-s <replaceable>prefix</replaceable></option></arg>
   <arg choice="opt" rep="norepeat"><option>-C <replaceable>size</replaceable></option></arg>
   <arg choice="opt" rep="norepeat"><option>-n</option></arg>
   <arg choice="opt" rep="norepeat"><option>-p</option></arg>
   <arg choice="opt" rep="norepeat"><option>-v</option></arg>
   <arg choice="opt" rep="norepeat"><option>-V</option></arg>
   <arg choice="opt" rep="repeat">file</arg>
  </cmdsynopsis>
 </refsynopsisdiv>
 
 <refsect1><title>DESCRIPTION</title>
  <para>
   <command moreinfo="none">yaz-marcdump</command> reads MARC records from one or
   more files.
   It parses each record and supports output in line-format, 
   ISO2709, MARCXML, MarcXchange as well as Hex output.
  </para>
  <para>
   This utility parses records ISO2709(raw MARC) as well as XML
   if that is structured as MARCXML/MarcXchange.
  </para>
  <note>
   <para>
    As of YAZ 2.1.18, OAI-MARC is no longer supported.
    OAI-MARC is deprecated. Use MARCXML instead.
   </para>
  </note>
  <para>
   By default, each record is written to standard output in a line
   format with newline for each field, $x for each subfield x.
   The output format may be changed with option <literal moreinfo="none">-o</literal>,
  </para>
  <para>
   <command moreinfo="none">yaz-marcdump</command> can also be requested to perform
   character set conversion of each record.
  </para>
 </refsect1>
 
 <refsect1><title>OPTIONS</title>
  
  <variablelist>
   <varlistentry>
    <term>-i <replaceable>format</replaceable></term>
    <listitem><para>
      Specifies input format. Must be one of
      <literal moreinfo="none">marcxml</literal>, <literal moreinfo="none">marc</literal> (ISO2709),
      <literal moreinfo="none">marcxchange</literal> (ISO25577),
      <literal moreinfo="none">line</literal> (line mode MARC).
     </para></listitem>
   </varlistentry>

   <varlistentry>
    <term>-o <replaceable>format</replaceable></term>
    <listitem><para>
      Specifies output format. Must be one of
      <literal moreinfo="none">marcxml</literal>, <literal moreinfo="none">marc</literal> (ISO2709),
      <literal moreinfo="none">marcxchange</literal> (ISO25577),
      <literal moreinfo="none">line</literal> (line mode MARC).
     </para></listitem>
   </varlistentry>

   <varlistentry>
    <term>-f <replaceable>from</replaceable></term>
    <listitem><para>
      Specify the character set <replaceable>from</replaceable>
      of the input MARC record.
      Should be used in conjunction with option <literal moreinfo="none">-t</literal>.
      Refer to the yaz-iconv man page for supported character sets.
     </para></listitem>
   </varlistentry>

   <varlistentry>
    <term>-t <replaceable>to</replaceable></term>
    <listitem><para>
      Specify the character set <replaceable>of</replaceable>
      of the output.
      Should be used in conjunction with option <literal moreinfo="none">-f</literal>.
      Refer to the yaz-iconv man page for supported character sets.
     </para></listitem>
   </varlistentry>

   <varlistentry>
    <term>-l <replaceable>leaderspec</replaceable></term>
    <listitem><para>
      Specify a simple modification string for MARC leader. The
      <replaceable>leaderspec</replaceable> is a list of pos=value
      pairs, where pos is an integer offset (0 - 23) for leader. Value
      is either a quoted string or an integer (character value in decimal).
      Pairs are comma separated. For example, to set leader at offset 9
      to a, use <literal moreinfo="none">9=a</literal>.
     </para></listitem>
   </varlistentry>

   <varlistentry>
    <term>-s <replaceable>prefix</replaceable></term>
    <listitem><para>
      Writes a chunk of records to a separate file with prefix given,
      i.e. splits a record batch into files with only at most
      "chunk" ISO2709 record per file. By default chunk is 1 (one record
      per file). See option <literal moreinfo="none">-C</literal>.
     </para></listitem>
   </varlistentry>

   <varlistentry>
    <term>-C <replaceable>chunksize</replaceable></term>
    <listitem><para>
      Specifies chunk size; to be used conjunction with option 
      <literal moreinfo="none">-s</literal>.
     </para></listitem>
   </varlistentry>

   <varlistentry>
    <term>-p</term>
    <listitem><para>
      Makes yaz-marcdump prints record number and input file offset
      of each record read.
     </para></listitem>
   </varlistentry>

   <varlistentry>
    <term>-n</term>
    <listitem><para>
      MARC output is omitted so that MARC input is only checkecd.
     </para></listitem>
   </varlistentry>

   <varlistentry>
    <term>-v</term>
    <listitem><para>
      Writes more information about the parsing process.
      Useful if you have ill-formatted ISO2709 records as input.
     </para></listitem>
   </varlistentry>
   
   <varlistentry>
    <term>-V</term>
    <listitem><para>
      Prints YAZ version.
     </para></listitem>
   </varlistentry>

  </variablelist>
 </refsect1>

 <refsect1><title>EXAMPLES</title>
  <para>
   The following command converts MARC21/USMARC in MARC-8 encoding to
   MARC21/USMARC in UTF-8 encoding. Leader offset 9 is set to 'a'.
   Both input and output records are ISO2709 encoded.
   <screen format="linespecific">
    yaz-marcdump -f MARC-8 -t UTF-8 -o marc -l 9=97 marc21.raw &gt;marc21.utf8.raw
   </screen>
  </para>
  <para>
   The same records may be converted to MARCXML instead in UTF-8:
   <screen format="linespecific">
    yaz-marcdump -f MARC-8 -t UTF-8 -o marcxml marc21.raw &gt;marcxml.xml
   </screen>
  </para>
 </refsect1> 

 <refsect1><title>FILES</title>
  <para>
   <filename moreinfo="none"><replaceable>prefix</replaceable>/bin/yaz-marcdump</filename>
  </para>
  <para>
   <filename moreinfo="none"><replaceable>prefix</replaceable>/include/yaz/marcdisp.h</filename>
  </para>
  </refsect1>
 <refsect1><title>SEE ALSO</title>
  <para>
   <citerefentry>
    <refentrytitle>yaz</refentrytitle>
    <manvolnum>7</manvolnum>
   </citerefentry>
  </para>
  <para>
   <citerefentry>
    <refentrytitle>yaz-iconv</refentrytitle>
    <manvolnum>1</manvolnum>
   </citerefentry>
  </para>
  <para>
   <ulink url="http://www.loc.gov/standards/marcxml/">MARCXML</ulink>.
  </para>
  <para>
   <ulink url="http://www.loc.gov/standards/iso25577/">ISO25577</ulink>.
  </para>
 </refsect1>
</refentry>
<!--Generated by stripref.xsl . Do not edit-->
<refentry id="yaz-iconv">
 <refentryinfo>
  <productname class="trade">YAZ</productname>
  <productnumber>3.0.51</productnumber>
 </refentryinfo>
 
 <refmeta>
  <refentrytitle>yaz-iconv</refentrytitle>
  <manvolnum>1</manvolnum>
 </refmeta>
 
 <refnamediv>
  <refname>yaz-iconv</refname>
  <refpurpose>YAZ Character set conversion utility</refpurpose>
 </refnamediv>
 
 <refsynopsisdiv>
  <cmdsynopsis sepchar=" ">
   <command moreinfo="none">yaz-iconv</command>
   <arg choice="opt" rep="norepeat"><option>-f <replaceable>from</replaceable></option></arg>
   <arg choice="opt" rep="norepeat"><option>-t <replaceable>to</replaceable></option></arg>
   <arg choice="opt" rep="norepeat"><option>-v</option></arg>
   <arg choice="opt" rep="repeat">file</arg>
  </cmdsynopsis>
 </refsynopsisdiv>
 
 <refsect1><title>DESCRIPTION</title>
  <para>
   <command moreinfo="none">yaz-iconv</command> converts data in file in character
   set specified by <replaceable>from</replaceable> to output in
   character set as specified by <replaceable>to</replaceable>.
  </para>
  <para>
   This <command moreinfo="none">yaz-iconv</command> utility similar to the
   <command moreinfo="none">iconv</command> found on many POSIX systems (Glibc, Solaris, etc).
  </para>
  <para>
   If no <replaceable>file</replaceable> is specified,
   <command moreinfo="none">yaz-iconv</command> reads from standard input.
  </para>
 </refsect1>
 
 <refsect1><title>OPTIONS</title>
  
  <variablelist>
   <varlistentry>
    <term>-f<replaceable>from</replaceable>]</term>
    <listitem><para>
      Specify the character set <replaceable>from</replaceable>
      of the input file.
      Should be used in conjunction with option <literal moreinfo="none">-t</literal>.
     </para></listitem>
   </varlistentry>

   <varlistentry>
    <term>-t<replaceable>to</replaceable>]</term>
    <listitem><para>
      Specify the character set <replaceable>of</replaceable>
      of the output.
      Should be used in conjunction with option <literal moreinfo="none">-f</literal>.
     </para></listitem>
   </varlistentry>

   <varlistentry>
    <term>-v</term>
    <listitem><para>
      Print more information about the conversion process.
     </para></listitem>
   </varlistentry>

  </variablelist>
 </refsect1>
 
 <refsect1><title>ENCODINGS</title>
  <para>
   The yaz-iconv command and the API as defined in
   <filename moreinfo="none">yaz/yaz-iconv.h</filename> is a wrapper for the
   library system call iconv. But YAZ' iconv utility also implements
   conversions on its own. The table below lists characters sets (or encodings).
   that are supported by YAZ. Each character set is marked with either
   <emphasis>encode</emphasis> or <emphasis>decode</emphasis>. If
   an encoding is encode-enabled YAZ may convert <emphasis>to</emphasis>
   to the designated encoding. If an encoding is decode-enabled, YAZ
   may convert <emphasis>from</emphasis> the designated encoding.
  </para>
  <variablelist>
   <varlistentry>
    <term>marc8 (encode, decode)</term>
    <listitem>
     <para>
      The <ulink url="http://www.loc.gov/marc/specifications/speccharmarc8.html">MARC8</ulink> encoding as defined by
      the Library of Congress. Most MARC21/USMARC records usees
      this encoding.
     </para>
    </listitem>
   </varlistentry>
   <varlistentry>
    <term>marc8s (encode, decode)</term>
    <listitem>
     <para>
      Like MARC8 but with conversion prefers non-combined characters
      in the Latin-1 plane over combined characters.
     </para>
    </listitem>
   </varlistentry>
   <varlistentry>
    <term>marc8lossy (encode)</term>
    <listitem>
     <para>
      Lossy encoding of MARC-8.
     </para>
    </listitem>
   </varlistentry>
   <varlistentry>
    <term>marc8lossless (encode)</term>
    <listitem>
     <para>
      Lossless encoding of MARC8.
     </para>
    </listitem>
   </varlistentry>
   <varlistentry>
    <term>utf8 (encode, decode)</term>
    <listitem>
     <para>
      The most commonly used UNICODE encoding on the Internet.
     </para>
    </listitem>
   </varlistentry>
   <varlistentry>
    <term>iso8859-1 (encode, decode)</term>
    <listitem>
     <para>
      ISO-8859-1, AKA Latin-1.
     </para>
    </listitem>
   </varlistentry>
   <varlistentry>
    <term>iso5426 (decode)</term>
    <listitem>
     <para>
      ISO 5426. Some MARC records (UNIMARC) uses this encoding.
     </para>
    </listitem>
   </varlistentry>
   <varlistentry>
    <term>iso5428:1984 (encode, decode)</term>
    <listitem>
     <para>
      ISO 5428:1984.
     </para>
    </listitem>
   </varlistentry>
   <varlistentry>
    <term>advancegreek (encode, decode)</term>
    <listitem>
     <para>
      An encoding for Greek used by some vendors (Advance).
     </para>
    </listitem>
   </varlistentry>
   <varlistentry>
    <term>danmarc (decode)</term>
    <listitem>
     <para>
      <ulink url="http://www.kat-format.dk/danMARC2/Danmarc2.4.htm#felt+Indl.+4">Danmarc (in danish)</ulink> is
      an encoding based on UNICODE which is used for DanMARC2 records.
     </para>
    </listitem>
   </varlistentry>
  </variablelist>
 </refsect1>

 <refsect1><title>EXAMPLES</title>
  <para>
   The following command converts from ISO-8859-1 (Latin-1) to
   UTF-8.
   <screen format="linespecific">
    yaz-iconv -f ISO-8859-1 -t UTF-8 -X &lt;input.lst &gt;output.lst
   </screen>
  </para>
 </refsect1> 

 <refsect1><title>FILES</title>
  <para>
   <filename moreinfo="none"><replaceable>prefix</replaceable>/bin/yaz-iconv</filename>
  </para>
  <para>
   <filename moreinfo="none"><replaceable>prefix</replaceable>/include/yaz/yaz-iconv.h</filename>
  </para>
 </refsect1>
 <refsect1><title>SEE ALSO</title>
  <para>
   yaz(7)
   iconv(1)
  </para>
 </refsect1>
</refentry>
<!--Generated by stripref.xsl . Do not edit-->
<refentry id="yaz-log">
 <refentryinfo>
  <productname class="trade">YAZ</productname>
  <productnumber>3.0.51</productnumber>
 </refentryinfo>
 
 <refmeta>
  <refentrytitle>yaz-log</refentrytitle>
  <manvolnum>7</manvolnum>
 </refmeta>
 
 <refnamediv>
  <refname>yaz-log</refname>
  <refpurpose>Log handling in all yaz-based programs</refpurpose>
 </refnamediv>
 
 <refsynopsisdiv>
  <cmdsynopsis sepchar=" ">
   <command moreinfo="none">yaz-XXXX</command>
   <arg choice="opt" rep="norepeat"><option>-v <replaceable>loglevel,...</replaceable></option></arg>
   <arg choice="opt" rep="norepeat"><option>-l <replaceable>logfile</replaceable></option></arg>
  </cmdsynopsis>
 </refsynopsisdiv>
 
 <refsect1><title>DESCRIPTION</title>
  <para>
   All YAZ-based programs use a common log subsystem, and should support
   common command line options for controlling it. This man page documents
   those.
  </para>
  <para>
  </para>
 </refsect1>
 
 <refsect1><title>OPTIONS</title>
  
  <variablelist>
   <varlistentry>
    <term>-l<replaceable> logfile</replaceable></term>
    <listitem>
     <para>
      Specify the file where the log is to be written. If none is specified,
      <filename moreinfo="none">stderr</filename> is used. The log is appended to this file.
      If the file grows overly large, it is silently rotated: It is renamed to
      <replaceable>logfile</replaceable>.1,
      <replaceable>logfile</replaceable>.2, .., 9 
      (old such file is deleted), and a
      new file is opened. The limit defaults to 1GB, but can be set by the
      program.
      The rotating limit can be specified with option <literal moreinfo="none">-r</literal>
      for the YAZ frontend server (yaz-ztest).
     </para>
     <para>
      Rotation can also be implicitly enabled by using a filename
      which gets changed for a given date, due to substitutions as
      given by the strftime(3) function.
     </para>
    </listitem>
   </varlistentry>

   <varlistentry>
    <term>-v<replaceable> loglevel</replaceable></term>
    <listitem><para>
      Specify the logging level. The argument is a set of log level names,
      separated by commas (no whitespace!), optionally preceded by a '-' to
      negate that level. Most programs have their own default, often
      containing <literal moreinfo="none">fatal,warn,log</literal>, and some
      application-specific values. The default list can be cleared with the
      word <literal moreinfo="none">none</literal>, or individual bits can be removed by
      prefixing them with a dash '-'.
     </para></listitem>
   </varlistentry>

  </variablelist>
 </refsect1>

 <refsect1><title>LOG LEVELS TO CONTROL LOGGING</title>
  <para>
   Some of the log levels control the way the log is written. 
  </para>
  <para>
   <literal moreinfo="none">flush</literal> causes the log to be flushed after every write.
   This can have serious implications to performance, and should not be used
   in production. On the other hand, when debugging a program crash, this can
   be extremely useful. The option <literal moreinfo="none">debug</literal> implies
   <literal moreinfo="none">flush</literal> as well.
  </para>
  <para>
   <literal moreinfo="none">notime</literal> prevents the writing of time stamps. This is
   intended for automatic test scripts, which should produce predictable log
   files that are easy to compare.
  </para>
  
 </refsect1> 

 <refsect1><title>GENERAL LOG LEVELS IN YAZ ITSELF</title>
  <para>
   YAZ itself uses the following log levels:
  </para>
  <para>
   <literal moreinfo="none">fatal</literal> for fatal errors, that prevent further execution
   of the program.
  </para>
  <para>
   <literal moreinfo="none">warn</literal> for warnings about things that should be corrected.
  </para>
  <para>
   <literal moreinfo="none">debug</literal> for debugging. This flag may be used temporarily
   when developing or debugging yaz, or a program that uses yaz. It is
   practically deprecated, you should be defining and using your own log
   levels (see below).
  </para>
  <para>
   <literal moreinfo="none">all</literal> turns on almost all hard-coded log levels. 
  </para>
  <para>
   <literal moreinfo="none">loglevel</literal> logs information about the log levels used by
   the program. Every time the log level is changed, lists all bits that are
   on. Every time a module asks for its log bits, this is logged. This can be
   used for getting an idea of what log levels are available in any program
   that uses yaz-log. Start the program with <literal moreinfo="none">-v
   none,loglevel</literal>, and do some common operations with it. Another way
   is to grep for <function moreinfo="none">yaz_log_module_level</function> in the source
   code, as in
   <screen format="linespecific">
      find . -name '*.[ch]' -print | 
         xargs grep yaz_log_module_level | 
         grep '"' |
         cut -d'"' -f2 | 
         sort -u   
   </screen>
  </para>
  <para>
   <literal moreinfo="none">eventl</literal>, <literal moreinfo="none">malloc</literal>, 
   <literal moreinfo="none">nmem</literal>, <literal moreinfo="none">odr</literal> are used internally for
   debugging yaz.
  </para>
  <para>
  </para>
 </refsect1> 

 <refsect1><title>LOG LEVELS FOR CLIENTS</title>
  <para>
   <literal moreinfo="none">zoom</literal> logs the calls to the zoom API, which may be useful
   in debugging client applications.
  </para>
 </refsect1> 

 <refsect1><title>LOG LEVELS FOR SERVERS</title>
  <para>
   <literal moreinfo="none">server</literal> logs the server functions on a high level,
   starting up, listening on a port, etc.
  </para>
  <para>
   <literal moreinfo="none">session</literal> logs individual sessions (connections).
  </para>
  <para>
   <literal moreinfo="none">request</literal> logs a one-liner for each request (init, search,
   etc).
  </para>
  <para>
   <literal moreinfo="none">requestdetail</literal> logs the details of every request, before
   it is passed to the back-end, and the results received from it.
  </para>
  <para>
   Each server program (zebra, etc) is supposed to define its own log levels
   in addition to these. As they depend on the server in question, they can
   not be described here. See above how to find out about them.
  </para>
 </refsect1>

 <refsect1><title>LOGGING EXAMPLES</title>
  <para>
   See what log levels yaz-ztest is using:
   <screen format="linespecific">
    yaz-ztest -1 -v none,loglevel
    14:43:29-23/11 [loglevel] Setting log level to 4096 = 0x00001000
    14:43:29-23/11 [loglevel] Static  log bit 00000001 'fatal' is off
    14:43:29-23/11 [loglevel] Static  log bit 00000002 'debug' is off
    14:43:29-23/11 [loglevel] Static  log bit 00000004 'warn' is off
    14:43:29-23/11 [loglevel] Static  log bit 00000008 'log' is off
    14:43:29-23/11 [loglevel] Static  log bit 00000080 'malloc' is off
    14:43:29-23/11 [loglevel] Static  log bit 00000800 'flush' is off
    14:43:29-23/11 [loglevel] Static  log bit 00001000 'loglevel' is ON
    14:43:29-23/11 [loglevel] Static  log bit 00002000 'server' is off
    14:43:29-23/11 [loglevel] Dynamic log bit 00004000 'session' is off
    14:43:29-23/11 [loglevel] Dynamic log bit 00008000 'request' is off
    14:44:13-23/11 yaz-ztest [loglevel] returning log bit 0x4000 for 'session'
    14:44:13-23/11 yaz-ztest [loglevel] returning log bit 0x2000 for 'server'
    14:44:13-23/11 yaz-ztest [loglevel] returning NO log bit for 'eventl'
    14:44:20-23/11 yaz-ztest [loglevel] returning log bit 0x4000 for 'session'
    14:44:20-23/11 yaz-ztest [loglevel] returning log bit 0x8000 for 'request'
    14:44:20-23/11 yaz-ztest [loglevel] returning NO log bit for 'requestdetail'
    14:44:20-23/11 yaz-ztest [loglevel] returning NO log bit for 'odr'
    14:44:20-23/11 yaz-ztest [loglevel] returning NO log bit for 'ztest'
   </screen>
  </para>
  <para>
   See the details of the requests for yaz-ztest
   <screen format="linespecific">
   ./yaz-ztest -1 -v requestdetail
   14:45:35-23/11 yaz-ztest [server] Adding static Z3950 listener on tcp:@:9999
   14:45:35-23/11 yaz-ztest [server] Starting server ./yaz-ztest pid=32200
   14:45:38-23/11 yaz-ztest [session] Starting session from tcp:127.0.0.1 (pid=32200)
   14:45:38-23/11 yaz-ztest [requestdetail] Got initRequest
   14:45:38-23/11 yaz-ztest [requestdetail] Id:        81
   14:45:38-23/11 yaz-ztest [requestdetail] Name:      YAZ
   14:45:38-23/11 yaz-ztest [requestdetail] Version:   2.0.28
   14:45:38-23/11 yaz-ztest [requestdetail] Negotiated to v3: srch prst del extendedServices namedresults scan sort
   14:45:38-23/11 yaz-ztest [request] Init from 'YAZ' (81) (ver 2.0.28) OK
   14:45:39-23/11 yaz-ztest [requestdetail] Got SearchRequest.
   14:45:39-23/11 yaz-ztest [requestdetail] ResultSet '1'
   14:45:39-23/11 yaz-ztest [requestdetail] Database 'Default'
   14:45:39-23/11 yaz-ztest [requestdetail] RPN query. Type: Bib-1
   14:45:39-23/11 yaz-ztest [requestdetail]  term 'foo' (general)
   14:45:39-23/11 yaz-ztest [requestdetail] resultCount: 7
   14:45:39-23/11 yaz-ztest [request] Search Z: @attrset Bib-1 foo  OK:7 hits
   14:45:41-23/11 yaz-ztest [requestdetail] Got PresentRequest.
   14:45:41-23/11 yaz-ztest [requestdetail] Request to pack 1+1 1
   14:45:41-23/11 yaz-ztest [requestdetail] pms=1048576, mrs=1048576
   14:45:41-23/11 yaz-ztest [request] Present: [1] 1+1  OK 1 records returned
   </screen> 
  </para>
 </refsect1> 

 <refsect1><title>LOG FILENAME EXAMPLES</title>
  <para>
   A file with format my_YYYYMMDD.log is where Y, M, D is year, month, and day
   digits is given as follows
   <literal moreinfo="none">-l my_%Y%m%d.log</literal> . And since the filename
   is depending on day, rotaion will occur on midnight.
  </para>
  <para>
   A weekly log could be specified as 
   <literal moreinfo="none">-l my_%Y%U.log</literal>.
  </para>
 </refsect1>
  
 <refsect1><title>FILES</title>
  <para>
   <filename moreinfo="none"><replaceable>prefix</replaceable>/include/yaz/log.h</filename>
   <filename moreinfo="none"><replaceable>prefix</replaceable>/src/log.c</filename>
  </para>
 </refsect1>
 <refsect1><title>SEE ALSO</title>
  <para>
   <citerefentry>
    <refentrytitle>yaz</refentrytitle>
    <manvolnum>7</manvolnum>
   </citerefentry>

   <citerefentry>
    <refentrytitle>yaz-ztest</refentrytitle>
    <manvolnum>8</manvolnum>
   </citerefentry>

   <citerefentry>
    <refentrytitle>yaz-client</refentrytitle>
    <manvolnum>1</manvolnum>
   </citerefentry>

   <citerefentry>
    <refentrytitle>strftime</refentrytitle>
    <manvolnum>3</manvolnum>
   </citerefentry>
  </para>
 </refsect1>
</refentry>
<!--Generated by stripref.xsl . Do not edit-->
<refentry id="yaz-illclient">
 <refentryinfo>
  <productname class="trade">YAZ</productname>
  <productnumber>3.0.51</productnumber>
 </refentryinfo>
 
 <refmeta>
  <refentrytitle>yaz-illclient</refentrytitle>
  <manvolnum>1</manvolnum>
 </refmeta>
 
 <refnamediv>
  <refname>yaz-illclient</refname>
  <refpurpose>ILL client</refpurpose>
 </refnamediv>
 
 <refsynopsisdiv>
  <cmdsynopsis sepchar=" ">
   <command moreinfo="none">yaz-illclient</command>
   <arg choice="opt" rep="norepeat"><option>-f <replaceable>filename</replaceable></option></arg>
   <arg choice="opt" rep="norepeat"><option>-v <replaceable>loglevel</replaceable></option></arg>
   <arg choice="opt" rep="repeat"><option>-D</option> <replaceable>name=value</replaceable></arg>
   <arg choice="opt" rep="norepeat"><option>-o</option></arg>
   <arg choice="opt" rep="norepeat"><option>-u <replaceable>user</replaceable></option></arg>
   <arg choice="opt" rep="norepeat"><option>-p <replaceable>password</replaceable></option></arg>   
   <arg choice="opt" rep="norepeat"><option>-V</option></arg>
   <arg choice="opt" rep="norepeat">server-addr</arg>
  </cmdsynopsis>
 </refsynopsisdiv>
 
 <refsect1><title>DESCRIPTION</title>
  <para>
   <command moreinfo="none">yaz-illclient</command> is an client which sends an ISO
   ILL request to a remote server and decodes the response from it.
   Exactly one server address ( <replaceable>server-addr</replaceable> )
   must be specified.
  </para>
 </refsect1>
 
 <refsect1><title>OPTIONS</title>
  
  <variablelist>
   <varlistentry>
    <term>-f <replaceable>filename</replaceable>]</term>
    <listitem><para>
      Specify filename.
     </para></listitem>
   </varlistentry>

   <varlistentry>
    <term>-v <replaceable>loglevel</replaceable>]</term>
    <listitem><para>
      Specify the log level
     </para></listitem>
   </varlistentry>

   <varlistentry>
    <term>-D <replaceable>name=value</replaceable>]</term>
    <listitem><para>
      Defines name &amp; value pair.
     </para></listitem>
   </varlistentry>

   <varlistentry>
    <term>-o</term>
    <listitem><para>
      Enable OCLC authentication.
     </para></listitem>
   </varlistentry>

   <varlistentry>
    <term>-u <replaceable>user</replaceable>]</term>
    <listitem><para>
      Specify user.
     </para></listitem>
   </varlistentry>

   <varlistentry>
    <term>-p <replaceable>password</replaceable>]</term>
    <listitem><para>
      Specify password.
     </para></listitem>
   </varlistentry>

   <varlistentry>
    <term>-V</term>
    <listitem><para>
      Show yaz-illclient version.
     </para></listitem>
   </varlistentry>

  </variablelist>
 </refsect1>

 <refsect1><title>EXAMPLES</title>
  <para>
   None yet.
  </para>
 </refsect1> 

 <refsect1><title>FILES</title>
  <para>
   None yet.
  </para>
 </refsect1>
 <refsect1><title>SEE ALSO</title>
  <para>
   yaz(7)
  </para>
 </refsect1>
</refentry>
<!--Generated by stripref.xsl . Do not edit-->
<refentry id="yaz-icu">
 <refentryinfo>
  <productname class="trade">YAZ</productname>
  <productnumber>3.0.51</productnumber>
 </refentryinfo>
 
 <refmeta>
  <refentrytitle>yaz-icu</refentrytitle>
  <manvolnum>1</manvolnum>
 </refmeta>
 
 <refnamediv>
  <refname>yaz-icu</refname>
  <refpurpose>YAZ ICU utility</refpurpose>
 </refnamediv>

 <refsynopsisdiv>
  <cmdsynopsis sepchar=" ">
   <command moreinfo="none">yaz-icu</command>
   <arg choice="opt" rep="repeat">commands</arg>
   <arg choice="opt" rep="norepeat">-c <replaceable>config</replaceable></arg>
   <arg choice="opt" rep="norepeat">-p <replaceable>opt</replaceable></arg>
   <arg choice="opt" rep="norepeat">-s</arg>
   <arg choice="opt" rep="norepeat">-x</arg>
  </cmdsynopsis>
 </refsynopsisdiv>
 
 <refsect1><title>DESCRIPTION</title>
  <para>
   <command moreinfo="none">yaz-icu</command> is utility which demonstrates 
   the ICU chain module of yaz. (<filename moreinfo="none">yaz/icu.h</filename>).
  </para>
 </refsect1>

 <refsect1><title>OPTIONS</title>
  <variablelist>
   <varlistentry>
    <term>-c <replaceable>config</replaceable></term>
    <listitem><para>
      Specifies the file containing ICU chain configuration
      which is XML based.
     </para></listitem>
   </varlistentry>

   <varlistentry>
    <term>-p <replaceable>type</replaceable></term>
    <listitem><para>
      Specifies extra information to be printed about the ICU system.
      If <replaceable>type</replaceable> is <literal moreinfo="none">c</literal>
      then ICU converters are printed. 
      If <replaceable>type</replaceable> is <literal moreinfo="none">l</literal>
      available locales are printed.
      If <replaceable>type</replaceable> is <literal moreinfo="none">t</literal>
      available transliterators are printed.
     </para></listitem>
   </varlistentry>

   <varlistentry>
    <term>-s</term>
    <listitem><para>
      Specifies that output should include sort key as well. Note that
      sort key differs between ICU versions.
     </para></listitem>
   </varlistentry>

   <varlistentry>
    <term>-x</term>
    <listitem><para>
      Specifies that output should be XML based rather than
      "text" based.
     </para></listitem>
   </varlistentry>

  </variablelist>
 </refsect1>
 <refsect1><title>ICU chain configuration</title>
  <para>
   The ICU chain configuration speicifies one or more rules to convert
   text data into tokens. The configuration format is XML based.
  </para>
  <para>
   The toplevel element must be named <literal moreinfo="none">icu_chain</literal>.
   The <literal moreinfo="none">icu_chain</literal> element has one required attribute
   <literal moreinfo="none">locale</literal> which specifies the ICU locale to be used
   in the conversion steps.
  </para>
  <para>
   The <literal moreinfo="none">icu_chain</literal> element must include elements where
   each element specifies a conversion step. The conversion is performed
   in the order in which the conversion steps are specified.
   Each conversion element takes one attribute: <literal moreinfo="none">rule</literal>
   which serves as argument to the conversion step.
  </para>
  <para>
   The following conversion elements are available:
   
   <variablelist>
    <varlistentry>
     <term>casemap</term>
     <listitem><para>
       Converts case and rule specifies how:

       <variablelist>
	<varlistentry>
	 <term>l</term>
	 <listitem>
	  <para>Lowercase using ICU function u_strToLower. </para>
	 </listitem>
	</varlistentry>

	<varlistentry>
	 <term>u</term>
	 <listitem>
	  <para>Upper case using ICU function u_strToUpper.</para>
	 </listitem>
	</varlistentry>
	
	<varlistentry>
	 <term>t</term>
	 <listitem>
	  <para>To title using UCU function u_strToTitle.</para>
	 </listitem>
	</varlistentry>

	<varlistentry>
	 <term>f</term>
	 <listitem>
	  <para>Fold case using ICU function u_strFoldCase.</para>
	 </listitem>
	</varlistentry>
	
       </variablelist>
      </para></listitem>
    </varlistentry>

    <varlistentry>
     <term>display</term>
     <listitem><para>
       This is a meta step which specifies that a term/token is to
       be displayed. This term is retrieved in an application
       using function icu_chain_token_display (<filename moreinfo="none">yaz/icu.h</filename>).
      </para></listitem>
    </varlistentry>
    
    <varlistentry>
     <term>transform</term>
     <listitem><para>
       Specifies an ICU transform rule using a transliterator
       Identifier.
       The rule attribute is the transliterator Identifier.
       See  <ulink url="http://www.icu-project.org/userguide/Transform.html">ICU Transforms</ulink> for
       more information.
      </para></listitem>
    </varlistentry>
    
    <varlistentry>
     <term>transliterate</term>
     <listitem><para>
       Specifies a rule-based transliterator.
       The rule attribute is the custom transformation rule to be used.
       See <ulink url="http://www.icu-project.org/userguide/Transform.html">ICU Transforms</ulink> for
       more information.
      </para></listitem>
    </varlistentry>
    
    <varlistentry>
     <term>tokenize</term>
     <listitem><para>
       Breaks / tokenizes a string into components using
       ICU functions ubrk_open, ubrk_setText, .. . The rule is
       one of:
       <variablelist>
	<varlistentry>
	 <term>l</term>
	 <listitem>
	  <para>Line. ICU: UBRK_LINE.</para>
	 </listitem>
	</varlistentry>

	<varlistentry>
	 <term>s</term>
	 <listitem>
	  <para>Sentence. ICU: UBRK_SENTENCE.</para>
	 </listitem>
	</varlistentry>
	
	<varlistentry>
	 <term>w</term>
	 <listitem>
	  <para>Word. ICU: UBRK_WORD.</para>
	 </listitem>
	</varlistentry>

	<varlistentry>
	 <term>c</term>
	 <listitem>
	  <para>Character. ICU: UBRK_CHARACTER.</para>
	 </listitem>
	</varlistentry>

	<varlistentry>
	 <term>t</term>
	 <listitem>
	  <para>Title. ICU: UBRK_TITLE.</para>
	 </listitem>
	</varlistentry>

       </variablelist>
      </para></listitem>
    </varlistentry>
    
   </variablelist>
   
  </para>
 </refsect1>
 <refsect1><title>EXAMPLES</title>
  <para>
   The following command analyzes text in file <filename moreinfo="none">text</filename>
   using ICU chain configuration <filename moreinfo="none">chain.xml</filename>:
   <screen format="linespecific">
    cat text | yaz-icu -c chain.xml
   </screen>
   The chain.xml might look as follows:
    <screen format="linespecific">
&lt;icu_chain locale="en"&gt;
  &lt;transform rule="[:Control:] Any-Remove"/&gt;
  &lt;tokenize rule="w"/&gt;
  &lt;transform rule="[[:WhiteSpace:][:Punctuation:]] Remove"/&gt;
  &lt;transliterate rule="xy &gt; z"/&gt;
  &lt;display/&gt;
  &lt;casemap rule="l"/&gt;
&lt;/icu_chain&gt;

   </screen>
  </para>
 </refsect1>
 <refsect1><title>SEE ALSO</title>
  <para>
   <citerefentry>
    <refentrytitle>yaz</refentrytitle>
    <manvolnum>7</manvolnum>
   </citerefentry>
  </para>
  <para>
   <ulink url="http://www.icu-project.org/">ICU Home</ulink>
  </para>
  <para>
   <ulink url="http://www.icu-project.org/userguide/Transform.html">ICU Transforms</ulink>
  </para>
 </refsect1>
</refentry>
<!--Generated by stripref.xsl . Do not edit-->
<refentry id="bib1">
 <refentryinfo>
  <productname class="trade">YAZ</productname>
  <productnumber>3.0.51</productnumber>
 </refentryinfo>
 
 <refmeta>
  <refentrytitle>Bib-1 Attribute Set</refentrytitle>
  <manvolnum>7</manvolnum>
 </refmeta>
 
 <refnamediv>
  <refname>bib1-attr</refname>
  <refpurpose>Bib-1 Attribute Set</refpurpose>
 </refnamediv>
 
 <refsect1><title>DESCRIPTION</title>
  <para>
   This reference entry lists the Bib-1 attribute set types and values.
  </para>
 </refsect1>

 <refsect1><title>TYPES</title>
  <para>
   The Bib-1 attribute defines six attribute types: Use (1), Relation (2),
   Position (3), Structure (4), Truncation (5) and completeness (6).
  </para>
 </refsect1>
 
 <refsect1><title>USE (1)</title>
  <para>
   <screen format="linespecific">
    1     Personal-name
    2     Corporate-name
    3     Conference-name
    4     Title
    5     Title-series
    6     Title-uniform
    7     ISBN
    8     ISSN
    9     LC-card-number
    10    BNB-card-number
    11    BGF-number
    12    Local-number
    13    Dewey-classification
    14    UDC-classification
    15    Bliss-classification
    16    LC-call-number
    17    NLM-call-number
    18    NAL-call-number
    19    MOS-call-number
    20    Local-classification
    21    Subject-heading
    22    Subject-Rameau
    23    BDI-index-subject
    24    INSPEC-subject
    25    MESH-subject
    26    PA-subject
    27    LC-subject-heading
    28    RVM-subject-heading
    29    Local-subject-index
    30    Date
    31    Date-of-publication
    32    Date-of-acquisition
    33    Title-key
    34    Title-collective
    35    Title-parallel
    36    Title-cover
    37    Title-added-title-page
    38    Title-caption
    39    Title-running
    40    Title-spine
    41    Title-other-variant
    42    Title-former
    43    Title-abbreviated
    44    Title-expanded
    45    Subject-precis
    46    Subject-rswk
    47    Subject-subdivision
    48    Number-natl-biblio
    49    Number-legal-deposit
    50    Number-govt-pub
    51    Number-music-publisher
    52    Number-db
    53    Number-local-call
    54    Code-language
    55    Code-geographic
    56    Code-institution
    57    Name-and-title
    58    Name-geographic
    59    Place-publication
    60    CODEN
    61    Microform-generation
    62    Abstract
    63    Note
    1000  Author-title
    1001  Record-type
    1002  Name
    1003  Author
    1004  Author-name-personal
    1005  Author-name-corporate
    1006  Author-name-conference
    1007  Identifier-standard
    1008  Subject-LC-childrens
    1009  Subject-name-personal
    1010  Body-of-text
    1011  Date/time-added-to-db
    1012  Date/time-last-modified
    1013  Authority/format-id
    1014  Concept-text
    1015  Concept-reference
    1016  Any
    1017  Server-choice
    1018  Publisher
    1019  Record-source
    1020  Editor
    1021  Bib-level
    1022  Geographic-class
    1023  Indexed-by
    1024  Map-scale
    1025  Music-key
    1026  Related-periodical
    1027  Report-number
    1028  Stock-number
    1030  Thematic-number
    1031  Material-type
    1032  Doc-id
    1033  Host-item
    1034  Content-type
    1035  Anywhere
    1036  Author-Title-Subject
   </screen>
  </para>
 </refsect1>
 
 <refsect1><title>RELATION (2)</title>
  <para>
   <screen format="linespecific">
    1 Less than
    2 Less than or equal
    3 Equal
    4 Greater or equal
    5 Greater than
    6 Not equal
    100 Phonetic
    101 Stem
    102 Relevance
    103 AlwaysMatches
   </screen>
  </para>
 </refsect1>
 
 <refsect1><title>POSITION (3)</title>
  <para>
   <screen format="linespecific">
    1 First in field
    2 First in subfield
    3 Any position in field
   </screen>
  </para>
 </refsect1>
 
 <refsect1><title>STRUCTURE (4)</title>
  <para>
   <screen format="linespecific">
    1 Phrase
    2 Word
    3 Key
    4 Year
    5 Date (normalized)
    6 Word list
    100 Date (un-normalized)
    101 Name (normalized)
    102 Name (un-normalized)
    103 Structure
    104 Urx
    105 Free-form-text
    106 Document-text
    107 Local-number
    108 String
    109 Numeric-string
   </screen>
  </para>
 </refsect1>

 <refsect1><title>TRUNCATION (5)</title>
  <para>
   <screen format="linespecific">
    1 Right truncation
    2 Left truncation
    3 Left and right truncation
    100 Do not truncate
    101 Process # in search term
    102 RegExpr-1
    103 RegExpr-2
   </screen>
  </para>
 </refsect1>
 
 <refsect1><title>COMPLETENSS (6)</title>
  <para>
   <screen format="linespecific">
    1 Incomplete subfield
    2 Complete subfield
    3 Complete field
   </screen>
  </para>
 </refsect1>
 
 <refsect1><title>SEE ALSO</title>
  <para>
   <ulink url="http://www.loc.gov/z3950/agency/defns/bib1.html">Bib-1 Attribute Set</ulink>
  </para>
  <para>
   <ulink url="http://www.loc.gov/z3950/agency/bib1.html">Attibute
    Set Bib-1 Semantics</ulink>.
  </para>
 </refsect1>
</refentry>
