Fixed a few entities
[yaz-moved-to-github.git] / doc / tools.xml
index 4b2a9a1..2122e69 100644 (file)
@@ -1,13 +1,13 @@
-<!-- $Id: tools.xml,v 1.2 2001-07-19 23:29:40 adam Exp $ -->
- <chapter><title>Supporting Tools</title>
-
+<!-- $Id: tools.xml,v 1.10 2002-02-24 12:23:43 adam Exp $ -->
+ <chapter id="tools"><title>Supporting Tools</title>
+  
   <para>
    In support of the service API - primarily the ASN module, which
-   provides the programmatic interface to the Z39.50 APDUs, YAZ contains
+   provides the pro-grammatic interface to the Z39.50 APDUs, &yaz; contains
    a collection of tools that support the development of applications.
   </para>
 
-  <sect1><title>Query Syntax Parsers</title>
+  <sect1 id="tools.query"><title>Query Syntax Parsers</title>
 
    <para>
     Since the type-1 (RPN) query structure has no direct, useful string
@@ -51,9 +51,8 @@ int p_query_attset (const char *arg);
      to provide a memory source (the structure created is released on
      the next call to <function>odr_reset()</function> on the stream), a
      protocol identifier (one of the constants <token>PROTO_Z3950</token> and
-     <token>PROTO_SR</token>), an attribute set
-     reference, and finally a null-terminated string holding the query
-     string.
+     <token>PROTO_SR</token>), an attribute set reference, and
+     finally a null-terminated string holding the query string.
     </para>
     <para>
      If the parse went well, <function>p_query_rpn()</function> returns a
@@ -74,17 +73,17 @@ int p_query_attset (const char *arg);
     </para>
 
     <screen>
-     Query ::= &lsqb; AttSet &rsqb; QueryStruct.
+     Query ::= &lsqb; '@attrset' AttSet &rsqb; QueryStruct.
 
      AttSet ::= string.
 
-     QueryStruct ::= { Attribute } Simple | Complex.
+     QueryStruct ::= &lsqb; Attribute &rsqb; Simple | Complex.
 
-     Attribute ::= '@attr' AttributeType '=' AttributeValue.
+     Attribute ::= '@attr' &lsqb; AttSet &rsqb; AttributeType '=' AttributeValue.
 
      AttributeType ::= integer.
 
-     AttributeValue ::= integer.
+     AttributeValue ::= integer || string.
 
      Complex ::= Operator QueryStruct QueryStruct.
 
@@ -139,6 +138,8 @@ int p_query_attset (const char *arg);
      @attr 4=1 @attr 1=4 "self portrait"
 
      @prox 0 3 1 2 k 2 dylan zimmerman
+
+     @and @attr 2=4 @attr gils 1=2038 -114 @attr 2=2 @attr gils 1=2039 -109
     </screen>
 
    </sect2>
@@ -155,14 +156,15 @@ int p_query_attset (const char *arg);
     </para>
 
     <para>
-     The EUROPAGATE research project working under the Libraries programme
+     The <ulink url="http://europagate.dtv.dk/">EUROPAGATE</ulink>
+     research project working under the Libraries programme
      of the European Commission's DG XIII has, amongst other useful tools,
      implemented a general-purpose CCL parser which produces an output
      structure that can be trivially converted to the internal RPN
-     representation of YAZ (The <literal>Z_RPNQuery</literal> structure).
+     representation of &yaz; (The <literal>Z_RPNQuery</literal> structure).
      Since the CCL utility - along with the rest of the software
-     produced by EUROPAGATE - is made freely available on a liberal license, it
-     is included as a supplement to YAZ.
+     produced by EUROPAGATE - is made freely available on a liberal
+     license, it is included as a supplement to &yaz;.
     </para>
 
     <sect3><title>CCL Syntax</title>
@@ -205,7 +207,7 @@ int p_query_attset (const char *arg);
                   | string
       -- Qualifiers is a list of strings separated by comma
 
-      Relation ::= '=' | '>=' | '<=' | '<>' | '>' | '<'
+      Relation ::= '=' | '>=' | '&lt;=' | '&lt;>' | '>' | '&lt;'
       -- Relational operators. This really doesn't follow the ISO8777
       -- standard.
 
@@ -252,7 +254,7 @@ int p_query_attset (const char *arg);
       index, such as title (ti) and author indexes (au). The CCL standard
       itself doesn't specify a particular set of qualifiers, but it does
       suggest a few short-hand notations. You can customize the CCL parser
-      to support a particular set of qualifiers to relect the current target
+      to support a particular set of qualifiers to reflect the current target
       profile. Traditionally, a qualifier would map to a particular
       use-attribute within the BIB-1 attribute set. However, you could also
       define qualifiers that would set, for example, the
@@ -264,12 +266,12 @@ int p_query_attset (const char *arg);
       title-index. In this case, the user could specify
      </para>
 
-     <screen>>
+     <screen>
       ti,ranked=knuth computer
      </screen>
      <para>
-      and the <literal>ranked</literal> would map to structure=free-form-text
-      (4=105) and the <literal>ti</literal> would map to title (1=4).
+      and the <literal>ranked</literal> would map to relation=relevance
+      (2=102) and the <literal>ti</literal> would map to title (1=4).
      </para>
 
      <para>
@@ -341,20 +343,20 @@ int p_query_attset (const char *arg);
       To parse a simple string with a FIND query use the function
      </para>
      <screen>
-      struct ccl_rpn_node *ccl_find_str (CCL_bibset bibset, const char *str,
-      int *error, int *pos);
+struct ccl_rpn_node *ccl_find_str (CCL_bibset bibset, const char *str,
+                                   int *error, int *pos);
      </screen>
      <para>
       which takes the CCL profile (<literal>bibset</literal>) and query
       (<literal>str</literal>) as input. Upon successful completion the RPN
-      tree is returned. If an error eccur, such as a syntax error, the integer
+      tree is returned. If an error occur, such as a syntax error, the integer
       pointed to by <literal>error</literal> holds the error code and
       <literal>pos</literal> holds the offset inside query string in which
       the parsing failed.
      </para>
 
      <para>
-      An english representation of the error may be obtained by calling
+      An English representation of the error may be obtained by calling
       the <literal>ccl_err_msg</literal> function. The error codes are
       listed in <filename>ccl.h</filename>.
      </para>
@@ -385,7 +387,7 @@ int p_query_attset (const char *arg);
     </sect3>
    </sect2>
   </sect1>
-  <sect1><title>Object Identifiers</title>
+  <sect1 id="tools.oid"><title>Object Identifiers</title>
 
    <para>
     The basic YAZ representation of an OID is an array of integers,
@@ -591,7 +593,7 @@ typedef struct oident
     The function
    </para>
 
-   <screen><
+   <screen>
     oid_value oid_getvalbyname(const char *name);
    </screen>
 
@@ -631,7 +633,7 @@ typedef struct oident
 
   </sect1>
 
-  <sect1><title>Nibble Memory</title>
+  <sect1 id="tools.nmem"><title>Nibble Memory</title>
 
    <para>
     Sometimes when you need to allocate and construct a large,
@@ -659,6 +661,7 @@ typedef struct oident
     void nmem_reset(NMEM n);
     int nmem_total(NMEM n);
     void nmem_init(void);
+    void nmem_exit(void);
    </screen>
 
    <para>
@@ -674,19 +677,22 @@ typedef struct oident
     allocated on the handle.
    </para>
 
-   <note>
-    <para>
-     The nibble memory pool is shared amonst threads. POSIX
-     mutex'es and WIN32 Critical sections are introduced to keep the
-     module thread safe. On WIN32 function <function>nmem_init()</function>
-     initialises the Critical Section handle and should be called once
-     before any other nmem function is used.
-    </para>
-   </note>
+   <para>
+    The nibble memory pool is shared amongst threads. POSIX
+    mutex'es and WIN32 Critical sections are introduced to keep the
+    module thread safe. Function <function>nmem_init()</function>
+    initializes the nibble memory library and it is called automatically
+    the first time the <literal>YAZ.DLL</literal> is loaded. &yaz; uses
+    function <function>DllMain</function> to achieve this. You should
+    <emphasis>not</emphasis> call <function>nmem_init</function> or
+    <function>nmem_exit</function> unless you're absolute sure what
+    you're doing. Note that in previous &yaz; versions you'd have to call
+    <function>nmem_init</function> yourself. 
+   </para>
 
   </sect1>
  </chapter>
-
  <!-- Keep this comment at the end of the file
  Local variables:
  mode: sgml
@@ -697,7 +703,7 @@ typedef struct oident
  sgml-indent-step:1
  sgml-indent-data:t
  sgml-parent-document: "yaz.xml"
- sgml-local-catalogs: "../../docbook/docbook.cat"
+ sgml-local-catalogs: nil
  sgml-namecase-general:t
  End:
  -->