More on scansets.
authorAdam Dickmeiss <adam@indexdata.dk>
Wed, 2 Jan 2002 10:30:25 +0000 (10:30 +0000)
committerAdam Dickmeiss <adam@indexdata.dk>
Wed, 2 Jan 2002 10:30:25 +0000 (10:30 +0000)
CHANGELOG
LICENSE
doc/yaz.xml
doc/zoom.xml
include/yaz/zoom.h
zoom/zoom-c.c

index a06c51c..9c091ff 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,6 +1,6 @@
 Possible compatibility problems with earlier versions marked with '*'.
 
 Possible compatibility problems with earlier versions marked with '*'.
 
---- 1.8.4 2001/XX/XX
+--- 1.8.4 2002/XX/XX
 
 Scan for ZOOM API. New object ZOOM_scanset. New functions
 ZOOM_connection_scan, ZOOM_scanset_size, ZOOM_scanset_term and
 
 Scan for ZOOM API. New object ZOOM_scanset. New functions
 ZOOM_connection_scan, ZOOM_scanset_size, ZOOM_scanset_term and
diff --git a/LICENSE b/LICENSE
index c27e7ce..6235cb1 100644 (file)
--- a/LICENSE
+++ b/LICENSE
@@ -1,5 +1,5 @@
 /*
 /*
- * Copyright (c) 1995-2000, Index Data.
+ * Copyright (c) 1995-2002, Index Data.
  *
  * Permission to use, copy, modify, distribute, and sell this software and
  * its documentation, in whole or in part, for any purpose, is hereby granted,
  *
  * Permission to use, copy, modify, distribute, and sell this software and
  * its documentation, in whole or in part, for any purpose, is hereby granted,
index d1484ce..d4d94c4 100644 (file)
@@ -22,7 +22,7 @@
      <!ENTITY comstack "<acronym>COMSTACK</acronym>">
      <!ENTITY zoom "<acronym>ZOOM</acronym>">
 ]>
      <!ENTITY comstack "<acronym>COMSTACK</acronym>">
      <!ENTITY zoom "<acronym>ZOOM</acronym>">
 ]>
-<!-- $Id: yaz.xml,v 1.15 2001-11-19 20:43:39 adam Exp $ -->
+<!-- $Id: yaz.xml,v 1.16 2002-01-02 10:30:25 adam Exp $ -->
 <book id="yaz">
  <bookinfo>
   <title>YAZ User's Guide and Reference</title>
 <book id="yaz">
  <bookinfo>
   <title>YAZ User's Guide and Reference</title>
@@ -36,6 +36,7 @@
    <year>1999</year>
    <year>2000</year>
    <year>2001</year>
    <year>1999</year>
    <year>2000</year>
    <year>2001</year>
+   <year>2002</year>
    <holder>Index Data</holder>
   </copyright>
   <abstract><simpara>
    <holder>Index Data</holder>
   </copyright>
   <abstract><simpara>
index 63bff81..b08d798 100644 (file)
@@ -1,4 +1,4 @@
-<!-- $Id: zoom.xml,v 1.14 2001-11-30 08:24:06 adam Exp $ -->
+<!-- $Id: zoom.xml,v 1.15 2002-01-02 10:30:25 adam Exp $ -->
  <chapter id="zoom"><title>Building clients with ZOOM</title>
   
   <para>
  <chapter id="zoom"><title>Building clients with ZOOM</title>
   
   <para>
@@ -31,7 +31,7 @@
   </para>
 
   <para>
   </para>
 
   <para>
-   The C language misses many features found in object oriented languages
+   The C language misses features found in object oriented languages
    such as C++, Java, etc. For example, you'll have to manually,
    destroy all objects you create, even though you may think of them as
    temporary. Most objects has a <literal>_create</literal> - and a
    such as C++, Java, etc. For example, you'll have to manually,
    destroy all objects you create, even though you may think of them as
    temporary. Most objects has a <literal>_create</literal> - and a
                                         void *handle);
    </synopsis>
   </sect1>
                                         void *handle);
    </synopsis>
   </sect1>
+  <sect1 id="zoom.scan"><title>Scsn</title>
+   <para>
+    This section describes an interface for Scan. Scan is not an
+    official part of the ZOOM model yet. The result of a scan operation
+    is the <literal>ZOOM_scanset</literal> which is a set of terms
+    returned by a target.
+   </para>
+   <synopsis>
+    ZOOM_scanset ZOOM_connection_scan (ZOOM_connection c,
+                                       const char *startterm);
+
+    size_t ZOOM_scanset_size(ZOOM_scanset scan);
+
+    const char * ZOOM_scanset_term(ZOOM_scanset scan, size_t pos,
+                                   int *occ, size_t *len);
+
+
+    void ZOOM_scanset_destroy (ZOOM_scanset scan);
+    </synopsis>
+   <para>
+    The scan set is created by function
+    <function>ZOOM_connection_scan</function> which performs a scan
+    operation on the connection and start term given.
+    If the operation was successful, the size of the scan set can be
+    retrived by a call to <function>ZOOM_scanset_size</function>.
+    Like result sets, the items are numbered 0,..size-1.
+    To obtain information about a particular scan term, call function
+    <function>ZOOM_scanset_term</function>. This function takes
+    a scan set offset <literal>pos</literal> and returns a pointer
+    to an actual term or <literal>NULL</literal> if non-present.
+    If present, the <literal>occ</literal> and <literal>len</literal> 
+    are set to the number of occurrences and the length
+    of the actual term respectively.
+    A scan set may be freed by a call to function
+    <function>ZOOM_scanset_destroy</function>.
+    </para>
+   </sect1>
   <sect1 id="zoom.events"><title>Events</title>
    <para>
     If you're developing non-blocking applications, you have to deal 
   <sect1 id="zoom.events"><title>Events</title>
    <para>
     If you're developing non-blocking applications, you have to deal 
index e321fd0..ebbbf13 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Public header for ZOOM C.
 /*
  * Public header for ZOOM C.
- * $Id: zoom.h,v 1.8 2001-12-30 22:21:11 adam Exp $
+ * $Id: zoom.h,v 1.9 2002-01-02 10:30:25 adam Exp $
  */
 
 #include <yaz/yconfig.h>
  */
 
 #include <yaz/yconfig.h>
@@ -164,7 +164,8 @@ ZOOM_EXPORT
 ZOOM_scanset ZOOM_connection_scan (ZOOM_connection c, const char *startterm);
 
 ZOOM_EXPORT
 ZOOM_scanset ZOOM_connection_scan (ZOOM_connection c, const char *startterm);
 
 ZOOM_EXPORT
-const char * ZOOM_scanset_term(ZOOM_scanset scan, size_t no, int *occ, size_t *len);
+const char * ZOOM_scanset_term(ZOOM_scanset scan, size_t pos,
+                               int *occ, size_t *len);
 
 ZOOM_EXPORT
 size_t ZOOM_scanset_size(ZOOM_scanset scan);
 
 ZOOM_EXPORT
 size_t ZOOM_scanset_size(ZOOM_scanset scan);
index 1da198d..094c6e6 100644 (file)
@@ -1,5 +1,5 @@
 /*
 /*
- * $Id: zoom-c.c,v 1.15 2001-12-30 22:21:11 adam Exp $
+ * $Id: zoom-c.c,v 1.16 2002-01-02 10:30:25 adam Exp $
  *
  * ZOOM layer for C, connections, result sets, queries.
  */
  *
  * ZOOM layer for C, connections, result sets, queries.
  */
@@ -1325,7 +1325,8 @@ size_t ZOOM_scanset_size (ZOOM_scanset scan)
     return scan->scan_response->entries->num_entries;
 }
 
     return scan->scan_response->entries->num_entries;
 }
 
-const char *ZOOM_scanset_term (ZOOM_scanset scan, size_t i, int *occ, size_t *len)
+const char *ZOOM_scanset_term (ZOOM_scanset scan, size_t pos,
+                               int *occ, size_t *len)
 {
     const char *term = 0;
     size_t noent = ZOOM_scanset_size (scan);
 {
     const char *term = 0;
     size_t noent = ZOOM_scanset_size (scan);
@@ -1333,11 +1334,11 @@ const char *ZOOM_scanset_term (ZOOM_scanset scan, size_t i, int *occ, size_t *le
     
     *len = 0;
     *occ = 0;
     
     *len = 0;
     *occ = 0;
-    if (i >= noent)
+    if (pos >= noent)
         return 0;
         return 0;
-    if (res->entries->entries[i]->which == Z_Entry_termInfo)
+    if (res->entries->entries[pos]->which == Z_Entry_termInfo)
     {
     {
-        Z_TermInfo *t = res->entries->entries[i]->u.termInfo;
+        Z_TermInfo *t = res->entries->entries[pos]->u.termInfo;
         
         if (t->term->which == Z_Term_general)
         {
         
         if (t->term->which == Z_Term_general)
         {