Add check for integer overflow in odr_write YAZ-816
[yaz-moved-to-github.git] / doc / yaz-client-man.xml
1 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.4//EN"
2  "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd"
3 [
4      <!ENTITY % local SYSTEM "local.ent">
5      %local;
6      <!ENTITY % entities SYSTEM "entities.ent">
7      %entities;
8      <!ENTITY % idcommon SYSTEM "common/common.ent">
9      %idcommon;
10 ]>
11 <refentry id="yaz-client">
12  <refentryinfo>
13   <productname>YAZ</productname>
14   <productnumber>&version;</productnumber>
15   <info><orgname>Index Data</orgname></info>
16  </refentryinfo>
17
18  <refmeta>
19   <refentrytitle>yaz-client</refentrytitle>
20   <manvolnum>1</manvolnum>
21   <refmiscinfo class="manual">Commands</refmiscinfo>
22  </refmeta>
23
24  <refnamediv>
25   <refname>yaz-client</refname>
26   <refpurpose>Z39.50/SRU client for implementors</refpurpose>
27  </refnamediv>
28
29  <refsynopsisdiv>
30   <cmdsynopsis>
31    <command>yaz-client</command>
32    <arg choice="opt"><option>-a <replaceable>apdulog</replaceable></option></arg>
33    <arg choice="opt"><option>-b <replaceable>berdump</replaceable></option></arg>
34    <arg choice="opt"><option>-c <replaceable>cclfile</replaceable></option></arg>
35    <arg choice="opt"><option>-d <replaceable>dump</replaceable></option></arg>
36    <arg choice="opt"><option>-f <replaceable>cmdfile</replaceable></option></arg>
37    <arg choice="opt"><option>-k <replaceable>size</replaceable></option></arg>
38    <arg choice="opt"><option>-m <replaceable>marclog</replaceable></option></arg>
39    <arg choice="opt"><option>-p <replaceable>proxy-addr</replaceable></option></arg>
40    <arg choice="opt"><option>-q <replaceable>cqlfile</replaceable></option></arg>
41    <arg choice="opt"><option>-t <replaceable>dispcharset</replaceable></option></arg>
42    <arg choice="opt"><option>-u <replaceable>auth</replaceable></option></arg>
43    <arg choice="opt"><option>-v <replaceable>loglevel</replaceable></option></arg>
44    <arg choice="opt"><option>-V</option></arg>
45    <arg choice="opt"><option>-x</option></arg>
46    <arg choice="opt">server-addr</arg>
47   </cmdsynopsis>
48
49  </refsynopsisdiv>
50
51  <refsect1><title>DESCRIPTION</title>
52   <para>
53    <command>yaz-client</command> is a
54    <ulink url="&url.z39.50;">Z39.50</ulink>/<ulink url="&url.sru;">SRU</ulink>
55    client (origin) with a simple command line interface that allows
56    you to test behavior and performance of Z39.50 targets and SRU servers.
57   </para>
58   <para>
59    From YAZ version 4.1.0 <command>yaz-client</command> may also operate as a
60    <ulink url="&url.solr;">Solr</ulink> Web Service
61    client.
62   </para>
63   <para>
64    If the <replaceable>server-addr</replaceable> is specified, the client creates
65    a connection to the Z39.50/SRU target at the address given.
66   </para>
67   <para>
68    When <command>yaz-client</command> is started it tries to read
69    commands from one of the following files:
70    <itemizedlist>
71     <listitem><para>
72       Command file if it is given by option -f.
73      </para></listitem>
74     <listitem><para>
75       <filename>.yazclientrc</filename> in current working directory.
76      </para></listitem>
77     <listitem><para>
78       <filename>.yazclientrc</filename> in the user's home directory.
79       The value of the <literal>HOME</literal> is used to determine
80       the home directory. Normally, <literal>HOME</literal> is only set
81       on POSIX systems such as Linux, FreeBSD, Solaris.
82      </para></listitem>
83    </itemizedlist>
84   </para>
85  </refsect1>
86   <refsect1>
87    <title>OPTIONS</title>
88    <variablelist>
89     <varlistentry>
90      <term>-a <replaceable>filename</replaceable></term>
91      <listitem><para>
92        If specified, logging of protocol packages will be appended
93        file given. If <replaceable>filename</replaceable> is
94        specified as <literal>-</literal>, the output is written
95        to <literal>stdout</literal>.
96       </para></listitem>
97     </varlistentry>
98     <varlistentry>
99      <term>-b <replaceable>filename</replaceable></term>
100      <listitem><para>
101        If specified, YAZ will dump BER data in readable notation
102        to the file specified. If <replaceable>filename</replaceable>
103        is specified as <literal>-</literal> the output is written
104        to <literal>stdout</literal>.
105       </para></listitem>
106     </varlistentry>
107     <varlistentry>
108      <term>-c <replaceable>filename</replaceable></term>
109      <listitem><para>
110        If specified, CCL configuration will be read from
111        the file given.
112       </para></listitem>
113     </varlistentry>
114     <varlistentry>
115      <term>-d <replaceable>dump</replaceable></term>
116      <listitem><para>
117        If specified, YAZ will dump BER data for all PDUs sent and received
118        to individual files, named
119        <replaceable>dump</replaceable>.DDD.<literal>raw</literal>,
120        where DDD is 001, 002, 003, ..
121       </para></listitem>
122     </varlistentry>
123
124     <varlistentry>
125      <term>-f <replaceable>cmdfile</replaceable></term>
126      <listitem><para>
127       Reads commands from <replaceable>cmdfile</replaceable>. When
128       this option is used, YAZ client does not read .yazclientrc
129       from current directory or home directory.
130       </para></listitem>
131     </varlistentry>
132
133     <varlistentry>
134      <term>-k <replaceable>size</replaceable></term>
135      <listitem><para>
136       Sets preferred messages and maximum record size for Initialize
137       Request in kilobytes. Default value is 65536 (64 MB).
138       </para></listitem>
139     </varlistentry>
140     <varlistentry>
141      <term>-m <replaceable>filename</replaceable></term>
142      <listitem><para>
143        If specified, retrieved records will be appended to the file given.
144       </para></listitem>
145     </varlistentry>
146     <varlistentry>
147      <term>-p <replaceable>proxy-addr</replaceable></term>
148      <listitem><para>
149        If specified, the client will use the proxy at the address
150        given. YAZ client will
151        connect to a proxy on the address and port given.
152        The actual target will be specified as part of the InitRequest
153        to inform the proxy about actual target.
154       </para></listitem>
155     </varlistentry>
156     <varlistentry>
157      <term>-q <replaceable>filename</replaceable></term>
158      <listitem><para>
159        If specified, CQL configuration will be read from
160        the file given.
161       </para></listitem>
162     </varlistentry>
163     <varlistentry>
164      <term>-t <replaceable>displaycharset</replaceable></term>
165      <listitem><para>
166        If displaycharset is given, it specifies name of the character set of the
167        output (on the terminal on which YAZ client is running).
168       </para></listitem>
169     </varlistentry>
170     <varlistentry>
171      <term>-u <replaceable>auth</replaceable></term>
172      <listitem><para>
173        If specified, the <replaceable>auth</replaceable> string
174        will be used for authentication.
175       </para></listitem>
176     </varlistentry>
177     <varlistentry><term>
178       <literal>-v</literal> <replaceable>level</replaceable>
179      </term><listitem>
180       <simpara>Sets the LOG level to <replaceable>level</replaceable>.
181        Level is a sequence of tokens separated by comma. Each token
182        is a integer or a named LOG item - one of
183        <literal>fatal</literal>,
184        <literal>debug</literal>,
185        <literal>warn</literal>,
186        <literal>log</literal>,
187        <literal>malloc</literal>,
188        <literal>all</literal>,
189        <literal>none</literal>.
190       </simpara></listitem>
191     </varlistentry>
192     <varlistentry>
193      <term>-V</term>
194      <listitem><para>
195        Prints YAZ version.
196      </para></listitem>
197     </varlistentry>
198     <varlistentry>
199      <term>-x</term>
200      <listitem><para>
201        Makes the YAZ client print hex dumps of packages sent and received
202        on standard output.
203        </para></listitem>
204     </varlistentry>
205    </variablelist>
206   </refsect1>
207  <refsect1>
208   <title>COMMANDS</title>
209   <para>
210    The YAZ client accepts the following commands.
211   </para>
212   <variablelist>
213    <varlistentry id="command-open"><term>
214      <literal>open </literal><replaceable>zurl</replaceable>
215     </term>
216     <listitem>
217      <para>Opens a connection to a server. The syntax for
218       <replaceable>zurl</replaceable> is the same as described
219       above for connecting from the command line.
220      </para>
221      <para>
222       Syntax:
223      </para>
224      <para>
225       [<literal>(tcp|ssl|unix|http)':'</literal>]<replaceable>host</replaceable>
226       [:<replaceable>port</replaceable>][/<replaceable>base</replaceable>]
227      </para>
228     </listitem>
229    </varlistentry>
230    <varlistentry><term>
231      <literal>quit</literal>
232     </term>
233     <listitem>
234      <para>Quits YAZ client</para>
235     </listitem>
236    </varlistentry>
237    <varlistentry id="command-find"><term>
238      <literal>find </literal><replaceable>query</replaceable></term>
239     <listitem>
240      <para>Sends a Search Request using the <replaceable>query</replaceable>
241       given. By default the query is assumed to be PQF. See command
242       <link linkend="command-querytype">querytype</link> for more information.
243      </para>
244     </listitem>
245    </varlistentry>
246    <varlistentry><term>
247      <literal>delete</literal> <replaceable>setname</replaceable></term>
248     <listitem>
249      <para>Deletes result set with name <replaceable>setname</replaceable>
250       on the server.</para>
251     </listitem>
252    </varlistentry>
253    <varlistentry><term>
254      <literal>base </literal><replaceable>base1</replaceable>
255      <replaceable>base2</replaceable> ...
256     </term>
257     <listitem>
258      <para>Sets the name(s) of the database(s) to search. One or more
259       databases may be specified separated by blanks. This commands overrides
260       the database given in <replaceable>zurl</replaceable>.
261      </para>
262     </listitem>
263    </varlistentry>
264    <varlistentry><term>
265      <literal>show </literal>
266      [<replaceable>start</replaceable>[+<replaceable>number</replaceable>]]
267     </term>
268     <listitem>
269      <para>Fetches records by sending a Present Request from the start
270       position given by
271       <replaceable>start</replaceable>
272       a number of records given by <replaceable>number</replaceable>. If
273       <replaceable>start</replaceable> is not given, then the client
274       will fetch from position of the last retrieved record plus 1. If
275       <replaceable>number</replaceable> is not given, then one record will
276       be fetched at a time.
277      </para>
278     </listitem>
279    </varlistentry>
280    <varlistentry><term>
281      <literal>scan</literal> <replaceable>term</replaceable>
282     </term>
283     <listitem>
284      <simpara>Scans
285       database index for a term. The syntax resembles the syntax
286       for <link linkend="command-find"><literal>find</literal></link>.
287       If you want to scan for the word <literal>water</literal> you could
288       write
289      </simpara>
290      <screen>
291       scan water
292      </screen>
293      <simpara>
294       but if you want to scan only in, say the title field, you would write
295      </simpara>
296      <screen>
297       scan @attr 1=4 water
298      </screen>
299     </listitem>
300    </varlistentry>
301    <varlistentry><term>
302      <literal>setscan</literal> <replaceable>set</replaceable> <replaceable>term</replaceable>
303     </term>
304     <listitem>
305      <simpara>Scans database index for a term within a result set. This
306       is similar to the scan command but has a result set as its first argument.
307      </simpara>
308     </listitem>
309    </varlistentry>
310    <varlistentry><term>
311      <literal>scanpos</literal> <replaceable>pos</replaceable>
312     </term>
313     <listitem>
314      <simpara>
315       Sets preferred position for scan. This value
316       is used in next scan. By default position is 1.
317      </simpara>
318     </listitem>
319    </varlistentry>
320    <varlistentry><term>
321      <literal>scansize</literal> <replaceable>size</replaceable>
322     </term>
323     <listitem>
324      <simpara>
325       Sets number of entries to be returned by scan. Default
326       number of entries is 20.
327      </simpara>
328     </listitem>
329    </varlistentry>
330    <varlistentry><term>
331      <literal>scanstep</literal> <replaceable>step</replaceable>
332     </term>
333     <listitem>
334      <simpara>
335       Set step-size for scan. This value is used in next scan
336       sent to the target. By default step-size is 0.
337      </simpara>
338     </listitem>
339    </varlistentry>
340    <varlistentry id="sortspec"><term>
341      <literal>sort</literal> <replaceable>sortspecs</replaceable>
342     </term>
343     <listitem>
344      <para>Sorts a result set. The sort command takes a
345       sequence of space-separated sort specifications, with each sort
346       specification consisting of two space-separated words (so that the
347       whole specification list is made up of an even number of words).
348       The first word of each specification
349       holds a field (sort criterion) and the second holds flags.
350       If the sort criterion includes <literal>=</literal> it is assumed
351       that the <literal>SortKey</literal> is of type
352       <literal>sortAttributes</literal> using Bib-1: in this case
353       the integer before <literal>=</literal> is
354       the attribute type and the integer following <literal>=</literal>
355       is the attribute value.
356       If no <literal>=</literal> character is in the criterion, it is treated
357       as a sortfield of type InternationalString.
358       The flags word of each sort specification must consist of
359       <literal>s</literal>
360       for case sensitive or <literal>i</literal> for case insensitive, and
361       <literal>&lt;</literal> for ascending order or <literal>&gt;</literal>
362       for descending order.
363      </para>
364     </listitem>
365    </varlistentry>
366    <varlistentry><term>
367      <literal>sort+</literal>
368     </term>
369     <listitem>
370      <para>Same as <literal>sort</literal> but stores the sorted
371       result set in a new result set.
372      </para>
373     </listitem>
374    </varlistentry>
375    <varlistentry><term>
376      <literal>authentication</literal> <replaceable>openauth</replaceable>
377     </term>
378     <listitem>
379      <para>Sets up a authentication string if a server requires
380       authentication (v2 OpenStyle). The authentication string is first
381       sent to the server when the
382       <link linkend="command-open"><literal>open</literal></link> command is
383       issued and the Z39.50 Initialize Request is sent, so this command
384       must be used before <literal>open</literal> in order to be effective.
385       A common convention for the <replaceable>authopen</replaceable> string
386       is that the username - and password is separated by a slash, e.g.
387       <literal>myusername/mysecret</literal>.
388      </para>
389     </listitem>
390    </varlistentry>
391
392    <varlistentry><term>
393      <literal>sru</literal> <replaceable>method</replaceable> <replaceable>version</replaceable>
394     </term>
395     <listitem>
396      <para>Selects Web Service method and version.
397       Must be one of <literal>post</literal>,
398       <literal>get</literal>, <literal>soap</literal> (default)
399       or <literal>solr</literal>. Version
400       should be either 1.1, 1.2 or 2.0 for SRU.
401       Other versions are allowed - for testing
402       purposes (version negotiation with SRU server).
403       The version is currently not used for Solr Web Services
404      </para>
405     </listitem>
406    </varlistentry>
407
408    <varlistentry><term>
409      <literal>list_all</literal>
410     </term>
411     <listitem>
412      <para>This command displays status and values for many settings.
413      </para>
414     </listitem>
415    </varlistentry>
416
417    <varlistentry><term>
418      <literal>lslb</literal> <replaceable>n</replaceable>
419     </term>
420     <listitem>
421      <para>Sets the limit for when no records should be returned
422       together with the search result.
423       See the
424       <ulink
425        url="http://www.loc.gov/z3950/agency/markup/04.html#3.2.2.1.6">
426        Z39.50 standard on set bounds
427       </ulink>
428       for more details.
429      </para>
430     </listitem>
431    </varlistentry>
432
433    <varlistentry><term>
434      <literal>ssub</literal> <replaceable>n</replaceable>
435     </term>
436     <listitem>
437      <para>Sets the limit for when all records should be returned with
438       the search result.
439       See the
440       <ulink
441        url="http://www.loc.gov/z3950/agency/markup/04.html#3.2.2.1.6">
442        Z39.50 standard on set bounds
443       </ulink> for more details.
444      </para>
445     </listitem>
446    </varlistentry>
447
448    <varlistentry><term>
449      <literal>mspn</literal> <replaceable>n</replaceable>
450     </term>
451     <listitem>
452      <para>Sets the number of records should be returned if the
453       number of records in the result set is between the values of
454       <literal>lslb</literal> and <literal>ssub</literal>.
455       See the
456       <ulink
457        url="http://www.loc.gov/z3950/agency/markup/04.html#3.2.2.1.6">
458        Z39.50 standard on set bounds
459       </ulink>
460       for more details.
461      </para>
462     </listitem>
463    </varlistentry>
464    <varlistentry><term>
465      <literal>status</literal>
466     </term>
467     <listitem>
468      <para>Displays the values of <literal>lslb</literal>,
469       <literal>ssub</literal> and <literal>mspn</literal>.
470      </para>
471     </listitem>
472    </varlistentry>
473    <varlistentry><term>
474      <literal>setname</literal>
475     </term>
476     <listitem>
477      <para>Switches named result sets on and off. Default is on.
478      </para>
479     </listitem>
480    </varlistentry>
481    <varlistentry><term>
482      <literal>cancel</literal>
483     </term>
484     <listitem>
485      <para>Sends a Trigger Resource Control Request to the target.
486      </para>
487     </listitem>
488    </varlistentry>
489    <varlistentry><term>
490      <literal>format</literal> <replaceable>oid</replaceable>
491     </term>
492     <listitem>
493      <para>Sets the preferred transfer syntax for retrieved records.
494       yaz-client supports all the record syntaxes that currently
495       are registered. See
496       <ulink
497        url="http://www.loc.gov/z3950/agency/defns/oids.html#5">
498        Z39.50 Record Syntax Identifiers
499       </ulink>
500       for more details. Commonly used records syntaxes include usmarc,
501       sutrs and xml.
502      </para>
503     </listitem>
504    </varlistentry>
505    <varlistentry><term>
506      <literal>elements</literal> <replaceable>e</replaceable>
507     </term>
508     <listitem>
509      <para>Sets the element set name for the records. Many targets support
510       element sets are B (for brief) and F (for full).
511      </para>
512     </listitem>
513    </varlistentry>
514    <varlistentry><term>
515      <literal>close</literal>
516     </term>
517     <listitem>
518      <para>Sends a Z39.50 Close APDU and closes connection with the peer
519      </para>
520     </listitem>
521    </varlistentry>
522    <varlistentry id="command-querytype"><term>
523      <literal>querytype</literal> <replaceable>type</replaceable>
524     </term>
525     <listitem>
526      <para>Sets the query type as used by command
527       <link linkend="command-find"><literal>find</literal></link>.
528       The following is supported:
529       <literal>prefix</literal> for
530       <link linkend="PQF">Prefix Query Notation</link> (Type-1 Query);
531       <literal>ccl</literal> for CCL search (Type-2 Query),
532       <literal>cql</literal> for CQL (Type-104 search with CQL OID),
533       <literal>ccl2rpn</literal> for
534       <link linkend="CCL">CCL</link> to RPN conversion (Type-1 Query).
535       <literal>cql2rpn</literal> for
536       CQL to RPN conversion (Type-1 Query).
537      </para>
538     </listitem>
539    </varlistentry>
540    <varlistentry><term>
541      <literal>attributeset</literal> <replaceable>set</replaceable>
542     </term>
543     <listitem>
544      <para>
545       Sets attribute set OID for prefix queries (RPN, Type-1).
546      </para>
547     </listitem>
548    </varlistentry>
549    <varlistentry><term>
550      <literal>refid</literal> <replaceable>id</replaceable>
551     </term>
552     <listitem>
553      <para>Sets reference ID for Z39.50 Request(s).
554      </para>
555     </listitem>
556    </varlistentry>
557    <varlistentry><term>
558      <literal>itemorder</literal>
559      <replaceable>type</replaceable> <replaceable>no</replaceable>
560     </term>
561     <listitem>
562      <para>Sends an Item Order Request using the ILL External.
563       <replaceable>type</replaceable> is either 1 or 2 which corresponds to
564       ILL-Profile 1 and 2 respectively. The <replaceable>no</replaceable>
565       is the Result Set position of the record to be ordered.
566      </para>
567     </listitem>
568    </varlistentry>
569    <varlistentry><term>
570      <literal>update</literal>
571      <replaceable>action</replaceable>
572      <replaceable>recid</replaceable>
573      <replaceable>doc</replaceable>
574     </term>
575     <listitem>
576      <para>Sends Item Update Request. The <replaceable>action</replaceable>
577       argument must be the action type: one of <literal>insert</literal>,
578       <literal>replace</literal>, <literal>delete</literal> and
579       <literal>update</literal>. The second argument,
580       <replaceable>recid</replaceable>, is the
581       record identifier (any string). Third argument which is optional is
582       the record document for the request. If doc is preceded with
583       "&lt;", then the following characters are treated as a filename
584       with the records to be updated. Otherwise doc is treated as
585       a document itself. The doc may also be quited in double quotes.
586       If doc is omitted, the last received record (as part of present
587       response or piggybacked search response) is used for the update.
588      </para>
589     </listitem>
590    </varlistentry>
591
592    <varlistentry><term>
593      <literal>source</literal>
594      <replaceable>filename</replaceable>
595     </term>
596     <listitem>
597      <para>Executes list of commands from
598       file <replaceable>filename</replaceable>, just like source on
599       most UNIX shells. A single dot (<literal>.</literal>) can be used
600       as an alternative.
601      </para>
602     </listitem>
603    </varlistentry>
604
605    <varlistentry><term>
606      <literal>!</literal>
607      <replaceable>args</replaceable>
608     </term>
609     <listitem>
610      <para>Executes command <replaceable>args</replaceable> in subshell
611       using the <literal>system</literal> call.
612      </para>
613     </listitem>
614    </varlistentry>
615
616    <varlistentry><term>
617      <literal>push_command</literal>
618      <replaceable>command</replaceable>
619     </term>
620     <listitem>
621      <para>The push_command takes another command as its argument.
622       That command is then added to the history information (so
623       you can retrieve it later). The command itself is not
624       executed. This command only works if you have GNU readline/history
625       enabled.
626      </para>
627     </listitem>
628    </varlistentry>
629
630    <varlistentry><term>
631      <literal>set_apdufile</literal>
632      <replaceable>filename</replaceable>
633     </term>
634     <listitem>
635      <para>Sets that APDU should be logged to file
636       <replaceable>filename</replaceable>. Another way to achieve
637       APDU log is by using command-line option <literal>-a</literal>.
638      </para>
639     </listitem>
640    </varlistentry>
641
642    <varlistentry><term>
643      <literal>set_auto_reconnect</literal>
644      <replaceable>flag</replaceable>
645     </term>
646     <listitem>
647      <para>Specifies whether YAZ client automatically reconnect if
648       target closes connection (Z39.50 only).
649      </para>
650      <para>
651       <replaceable>flag</replaceable> must be either
652       <literal>on</literal> or <literal>off</literal>.
653      </para>
654     </listitem>
655    </varlistentry>
656
657    <varlistentry id="command-set-auto-wait"><term>
658      <literal>set_auto_wait</literal>
659      <replaceable>flag</replaceable>
660     </term>
661     <listitem>
662      <para>Specifies whether YAZ client should wait for
663       response protocol packages after a request.
664       By default YAZ client waits (on) for response packages immediately
665       after a command (find, show) has been issued. If <literal>off</literal>
666       is used, YAZ client does not attempt to receive packages automatically.
667       These will have to be manually received when command
668       <link linkend="command-wait-response">
669        <literal>wait_response</literal>
670       </link> is used.
671      </para>
672      <para>
673       <replaceable>flag</replaceable> must be either
674       <literal>on</literal> or <literal>off</literal>.
675      </para>
676     </listitem>
677    </varlistentry>
678
679    <varlistentry><term>
680      <literal>set_marcdump</literal>
681      <replaceable>filename</replaceable>
682     </term>
683     <listitem>
684      <para>Specifies that all retrieved records should be appended to
685       file <replaceable>filename</replaceable>. This command does the
686       thing as option <literal>-m</literal>.
687      </para>
688     </listitem>
689    </varlistentry>
690
691    <varlistentry><term>
692      <literal>schema</literal>
693      <replaceable>schemaid</replaceable>
694     </term>
695     <listitem>
696      <para>Specifies schema for retrieval.
697       Schema may be specified as an OID for Z39.50.
698       For SRU, schema is a simple string URI.
699      </para>
700     </listitem>
701    </varlistentry>
702
703    <varlistentry id="command-charset"><term>
704      <literal>charset</literal>
705      <replaceable>negotiationcharset</replaceable>
706      [<replaceable>displaycharset</replaceable>]
707      [[<replaceable>marccharset</replaceable>]]
708     </term>
709     <listitem>
710      <para>Specifies character set (encoding) for Z39.50
711       negotiation / SRU encoding and/or character set for output (terminal).
712      </para>
713      <para>
714       <replaceable>negotiationcharset</replaceable> is the name
715       of the character set to be negotiated by the server. The special name
716       <literal>-</literal> for <replaceable>negotiationcharset</replaceable>
717       specifies <emphasis>no</emphasis> character set to be negotiated.
718      </para>
719      <para>
720       If <replaceable>displaycharset</replaceable> is given, it specifies name
721       of the character set of the output (on the terminal on which
722       YAZ client is running). To disable conversion of characters
723       to the output encoding, the special name <literal>-</literal> (dash)
724       can be used.
725       If the special name <literal>auto</literal> is given, YAZ client will
726       convert strings to the encoding of the
727       terminal as returned by <function>nl_langinfo</function> call.
728      </para>
729      <para>
730       If <replaceable>marcharset</replaceable> is given, it specifies name
731       of the character set of retrieved MARC records from server. See
732       also <literal>marcharset</literal> command.
733      </para>
734      <note>
735       <para>
736        Since character set negotiation takes effect in the Z39.50
737        Initialize Request you should issue this command before
738        command <link linkend="command-open"><literal>open</literal></link>
739        is used.
740       </para>
741      </note>
742      <note>
743       <para>
744        MARC records are not covered by Z39.50 character set negotiation,
745        so that's why there is a separate character that must be known
746        in order to do meaningful conversion(s).
747       </para>
748      </note>
749     </listitem>
750    </varlistentry>
751
752    <varlistentry><term>
753      <literal>negcharset</literal>
754      <replaceable>charset</replaceable>
755     </term>
756     <listitem>
757      <para>Specifies character set for negotiation (Z39.50). The
758       argument is the same as second argument for command
759       <link linkend="command-charset"><literal>charset</literal></link>.
760      </para>
761     </listitem>
762    </varlistentry>
763
764    <varlistentry><term>
765      <literal>displaycharset</literal>
766      <replaceable>charset</replaceable>
767     </term>
768     <listitem>
769      <para>Specifies character set for output (display). The
770       argument is the same as second argument for command
771       <link linkend="command-charset"><literal>charset</literal></link>.
772      </para>
773     </listitem>
774    </varlistentry>
775
776    <varlistentry><term>
777      <literal>marccharset</literal>
778      <replaceable>charset</replaceable>
779     </term>
780     <listitem>
781      <para>Specifies character set for retrieved MARC records so
782       that YAZ client can display them in a character suitable
783       for your display. See <literal>charset</literal> command.
784       If <literal>auto</literal> is given, YAZ will assume
785       that MARC21/USMARC is using MARC8/UTF8 and ISO-8859-1
786       for all other MARC variants. The charset argument is the
787       same as third argument for command
788       <link linkend="command-charset"><literal>charset</literal></link>.
789      </para>
790     </listitem>
791    </varlistentry>
792
793    <varlistentry><term>
794      <literal>querycharset</literal>
795      <replaceable>charset</replaceable>
796     </term>
797     <listitem>
798      <para>Specifies character set for query terms for Z39.50 RPN
799       queries and Z39.50 Scan Requests (termListAndStartPoint).
800       This is a pure client-side conversion which converts from
801       displayCharset to queryCharset.
802      </para>
803     </listitem>
804    </varlistentry>
805
806    <varlistentry><term>
807      <literal>set_cclfile</literal>
808      <replaceable>filename</replaceable>
809     </term>
810     <listitem>
811      <para>Specifies that CCL fields should be read from file
812       file <replaceable>filename</replaceable>. This command does the
813       thing as option <literal>-c</literal>.
814      </para>
815     </listitem>
816    </varlistentry>
817
818    <varlistentry><term>
819      <literal>set_cqlfile</literal>
820      <replaceable>filename</replaceable>
821     </term>
822     <listitem>
823      <para>Specifies that CQL fields should be read from file
824       file <replaceable>filename</replaceable>. This command does the
825       thing as option <literal>-q</literal>.
826      </para>
827     </listitem>
828    </varlistentry>
829
830    <varlistentry><term>
831      <literal>register_oid</literal>
832      <replaceable>name</replaceable>
833      <replaceable>class</replaceable>
834      <replaceable>OID</replaceable>
835     </term>
836     <listitem>
837      <para>This command allows you to register your own object
838       identifier - so that instead of entering a long dot-notation
839       you can use a short name instead.
840       The <replaceable>name</replaceable> is your
841       name for the OID, <replaceable>class</replaceable> is the
842       class, and <replaceable>OID</replaceable> is the raw OID in
843       dot notation. Class is one <literal>appctx</literal>,
844       <literal>absyn</literal>, <literal>attet</literal>,
845       <literal>transyn</literal>, <literal>diagset</literal>,
846       <literal>recsyn</literal>, <literal>resform</literal>,
847       <literal>accform</literal>, <literal>extserv</literal>,
848       <literal>userinfo</literal>, <literal>elemspec</literal>,
849       <literal>varset</literal>, <literal>schema</literal>,
850       <literal>tagset</literal>, <literal>general</literal>.
851       If you're in doubt use the <literal>general</literal>
852       class.
853      </para>
854     </listitem>
855    </varlistentry>
856
857    <varlistentry><term>
858      <literal>register_tab</literal>
859      <replaceable>command</replaceable>
860      <replaceable>string</replaceable>
861     </term>
862     <listitem>
863      <para>This command registers a TAB completion string for
864       the command given.
865      </para>
866     </listitem>
867    </varlistentry>
868
869    <varlistentry><term>
870      <literal>sleep</literal>
871      <replaceable>seconds</replaceable>
872     </term>
873     <listitem>
874      <para>This command makes YAZ client sleep (be idle) for
875       the number of seconds given.
876      </para>
877     </listitem>
878    </varlistentry>
879
880    <varlistentry id="command-wait-response"><term>
881      <literal>wait_response</literal>
882      [ <replaceable>number</replaceable>]
883     </term>
884     <listitem>
885      <para>This command makes YAZ client wait for a number of
886       response packages from target. If <replaceable>number</replaceable> is
887       omitted, 1 is assumed.
888      </para>
889      <para>This command is rarely used and is only useful if command
890       <link linkend="command-set-auto-wait">
891        <literal>set_auto_wait</literal>
892       </link> is set to off.
893      </para>
894     </listitem>
895    </varlistentry>
896
897    <varlistentry id="command-xmles"><term>
898      <literal>xmles</literal>
899      <replaceable>OID</replaceable>
900      <replaceable>doc</replaceable>
901     </term>
902     <listitem>
903      <para>Sends XML Extended Services request using the OID and doc given.
904      </para>
905     </listitem>
906    </varlistentry>
907
908    <varlistentry><term>
909      <literal>zversion</literal>
910      <replaceable>ver</replaceable>
911     </term>
912     <listitem>
913      <para>This command sets Z39.50 version for negotiation.
914       Should be used before
915       <link linkend="command-open"><literal>open</literal></link>.
916       By default 3 (version 3) is used.
917      </para>
918     </listitem>
919    </varlistentry>
920
921    <varlistentry><term>
922      <literal>options</literal>
923      <replaceable>op1 op2..</replaceable>
924     </term>
925     <listitem>
926      <para>This command sets Z39.50 options for negotiation.
927       Should be used before
928       <link linkend="command-open"><literal>open</literal></link>.
929      </para>
930      <para>
931       The following options are supported:
932       <literal>search</literal>,
933       <literal>present</literal>,
934       <literal>delSet</literal>,
935       <literal>resourceReport</literal>,
936       <literal>triggerResourceCtrl</literal>,
937       <literal>resourceCtrl</literal>,
938       <literal>accessCtrl</literal>,
939       <literal>scan</literal>,
940       <literal>sort</literal>,
941       <literal>extendedServices</literal>,
942       <literal>level_1Segmentation</literal>,
943       <literal>level_2Segmentation</literal>,
944       <literal>concurrentOperations</literal>,
945       <literal>namedResultSets</literal>,
946       <literal>encapsulation</literal>,
947       <literal>resultCount</literal>,
948       <literal>negotiationModel</literal>,
949       <literal>duplicationDetection</literal>,
950       <literal>queryType104</literal>,
951       <literal>pQESCorrection</literal>,
952       <literal>stringSchema</literal>.
953      </para>
954     </listitem>
955    </varlistentry>
956
957   </variablelist>
958  </refsect1>
959  <refsect1><title>EXAMPLE</title>
960   <para>
961    The simplest example of a Prefix Query would be something like
962    <screen>
963     f knuth
964    </screen>
965    or
966    <screen>
967     f "donald knuth"
968    </screen>
969    In those queries no attributes was specified.
970    This leaves it up to the server what fields to search but
971    most servers will search in all fields. Some servers does not
972    support this feature though, and require that some attributes
973    are defined. To add one attribute you could do:
974    <screen>
975     f @attr 1=4 computer
976    </screen>
977    where we search in the title field, since the use(1) is title(4).
978    If we want to search in the author field <emphasis>and</emphasis>
979    in the title field, and in the title field using right truncation
980    it could look something like this:
981    <screen>
982     f @and @attr 1=1003 knuth @attr 1=4 @attr 5=1 computer
983    </screen>
984    Finally using a mix of Bib-1 and GILS attributes could look
985    something like this:
986    <screen>
987     f @attrset Bib-1 @and @attr GILS 1=2008 Washington @attr 1=21 weather
988    </screen>
989   </para>
990  </refsect1>
991  <refsect1><title>FILES</title>
992   <para>
993    <filename>yaz-&lt;version&gt;/client/client.c</filename>
994   </para>
995   <para>
996    <filename>$HOME/.yazclientrc</filename>
997   </para>
998   <para>
999    <filename>$HOME/.yazclient.history</filename>
1000   </para>
1001  </refsect1>
1002  <refsect1><title>SEE ALSO</title>
1003   <para>
1004    <citerefentry>
1005     <refentrytitle>yaz</refentrytitle>
1006     <manvolnum>7</manvolnum>
1007    </citerefentry>
1008    <citerefentry>
1009     <refentrytitle>bib1-attr</refentrytitle>
1010     <manvolnum>7</manvolnum>
1011    </citerefentry>
1012   </para>
1013  </refsect1>
1014 </refentry>
1015
1016 <!-- Keep this comment at the end of the file
1017 Local variables:
1018 mode: nxml
1019 nxml-child-indent: 1
1020 End:
1021 -->