Mention that @mask requires YAZ 4.2.58
[yaz-moved-to-github.git] / doc / tools.xml
index 132cb9b..1fce518 100644 (file)
     <synopsis>
      #include &lt;yaz/pquery.h&gt;
 
-     YAZ_PQF_Parser yaz_pqf_create (void);
+     YAZ_PQF_Parser yaz_pqf_create(void);
 
-     void yaz_pqf_destroy (YAZ_PQF_Parser p);
+     void yaz_pqf_destroy(YAZ_PQF_Parser p);
 
-     Z_RPNQuery *yaz_pqf_parse (YAZ_PQF_Parser p, ODR o, const char *qbuf);
+     Z_RPNQuery *yaz_pqf_parse(YAZ_PQF_Parser p, ODR o, const char *qbuf);
 
-     Z_AttributesPlusTerm *yaz_pqf_scan (YAZ_PQF_Parser p, ODR o,
+     Z_AttributesPlusTerm *yaz_pqf_scan(YAZ_PQF_Parser p, ODR o,
                           Odr_oid **attributeSetId, const char *qbuf);
 
-
-     int yaz_pqf_error (YAZ_PQF_Parser p, const char **msg, size_t *off);
+     int yaz_pqf_error(YAZ_PQF_Parser p, const char **msg, size_t *off);
     </synopsis>
     <para>
      A PQF parser is created and destructed by functions
     <synopsis>
      #include &lt;yaz/pquery.h&gt;
 
-     Z_RPNQuery *p_query_rpn (ODR o, oid_proto proto, const char *qbuf);
+     Z_RPNQuery *p_query_rpn(ODR o, oid_proto proto, const char *qbuf);
 
-     Z_AttributesPlusTerm *p_query_scan (ODR o, oid_proto proto,
+     Z_AttributesPlusTerm *p_query_scan(ODR o, oid_proto proto,
                              Odr_oid **attributeSetP, const char *qbuf);
 
-     int p_query_attset (const char *arg);
+     int p_query_attset(const char *arg);
     </synopsis>
     <para>
      The function <function>p_query_rpn()</function> takes as arguments an
 
        (dylan and bob) or set=1
 
+       righttrunc?
+
+       "notrunc?"
+
+       singlechar#mask
+
       </screen>
       <para>
        Assuming that the qualifiers <literal>ti</literal>,
          <entry><literal>?</literal></entry>
         </row>
         <row>
+         <entry>mask</entry>
+         <entry>Masking character. Requires YAZ 4.2.58 or later</entry>
+         <entry><literal>#</literal></entry>
+        </row>
+        <row>
          <entry>field</entry>
          <entry>Specifies how multiple fields are to be
           combined. There are two modes: <literal>or</literal>:
       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
@@ -1087,6 +1097,7 @@ struct cql_node *cql_parser_result(CQL_parser cp);
       <synopsis>
 #define CQL_NODE_ST 1
 #define CQL_NODE_BOOL 2
+#define CQL_NODE_SORT 3
 struct cql_node {
     int which;
     union {
@@ -1104,10 +1115,17 @@ struct cql_node {
             struct cql_node *right;
             struct cql_node *modifiers;
         } boolean;
+        struct {
+            char *index;
+            struct cql_node *next;
+            struct cql_node *modifiers;
+            struct cql_node *search;
+        } sort;
     } u;
 };
       </synopsis>
-      There are two node types: search term (ST) and boolean (BOOL).
+      There are three node types: search term (ST), boolean (BOOL)
+      and sortby (SORT).
       A modifier is treated as a search term too.
      </para>
      <para>
@@ -1152,8 +1170,8 @@ struct cql_node {
      </para>
 
      <para>
-      The boolean node represents both <literal>and</literal>,
-      <literal>or</literal>, not as well as
+      The boolean node represents <literal>and</literal>,
+      <literal>or</literal>, <literal>not</literal> +
       proximity.
       <itemizedlist>
        <listitem>
@@ -1170,6 +1188,10 @@ struct cql_node {
       </itemizedlist>
      </para>
 
+     <para>
+      The sort node represents both the SORTBY clause.
+     </para>
+
     </sect3>
     <sect3 id="cql.to.pqf"><title>CQL to PQF conversion</title>
      <para>
@@ -1552,6 +1574,27 @@ void cql_to_xml_stdio(struct cql_node *cn, FILE *f);
       a file.
      </para>
     </sect3>
+    <sect3 id="rpn.to.cql">
+     <title>PQF to CQL conversion</title>
+     <para>
+      Conversion from PQF to CQL is offered by the two functions shown
+      below. The former uses a generic stream for result. The latter
+      puts result in a WRBUF (string container).
+     <synopsis>
+#include &lt;yaz/rpn2cql.h>
+
+int cql_transform_rpn2cql_stream(cql_transform_t ct,
+                                 void (*pr)(const char *buf, void *client_data),
+                                 void *client_data,
+                                 Z_RPNQuery *q);
+
+int cql_transform_rpn2cql_wrbuf(cql_transform_t ct,
+                                WRBUF w,
+                                Z_RPNQuery *q);
+      </synopsis>
+      The configuration is the same as used in CQL to PQF conversions.
+     </para>
+    </sect3>
    </sect2>
   </sect1>
   <sect1 id="tools.oid"><title>Object Identifiers</title>