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
/*
- * 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,
<!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>
<year>1999</year>
<year>2000</year>
<year>2001</year>
+ <year>2002</year>
<holder>Index Data</holder>
</copyright>
<abstract><simpara>
-<!-- $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>
</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
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
/*
* 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>
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);
/*
- * $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.
*/
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);
*len = 0;
*occ = 0;
- if (i >= noent)
+ if (pos >= noent)
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)
{