From: Adam Dickmeiss Date: Wed, 2 Jan 2002 10:30:25 +0000 (+0000) Subject: More on scansets. X-Git-Tag: YAZ.1.8.4~8 X-Git-Url: http://lists.indexdata.dk/?a=commitdiff_plain;h=3599bbc013ec757862d8a2d6e62aa6a432ba4514;p=yaz-moved-to-github.git More on scansets. --- diff --git a/CHANGELOG b/CHANGELOG index a06c51c..9c091ff 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,6 @@ 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 diff --git a/LICENSE b/LICENSE index c27e7ce..6235cb1 100644 --- 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, diff --git a/doc/yaz.xml b/doc/yaz.xml index d1484ce..d4d94c4 100644 --- a/doc/yaz.xml +++ b/doc/yaz.xml @@ -22,7 +22,7 @@ COMSTACK"> ZOOM"> ]> - + YAZ User's Guide and Reference @@ -36,6 +36,7 @@ 1999 2000 2001 + 2002 Index Data diff --git a/doc/zoom.xml b/doc/zoom.xml index 63bff81..b08d798 100644 --- a/doc/zoom.xml +++ b/doc/zoom.xml @@ -1,4 +1,4 @@ - + Building clients with ZOOM @@ -31,7 +31,7 @@ - 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 _create - and a @@ -526,6 +526,43 @@ void *handle); + Scsn + + 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 ZOOM_scanset which is a set of terms + returned by a target. + + + 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); + + + The scan set is created by function + ZOOM_connection_scan 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 ZOOM_scanset_size. + Like result sets, the items are numbered 0,..size-1. + To obtain information about a particular scan term, call function + ZOOM_scanset_term. This function takes + a scan set offset pos and returns a pointer + to an actual term or NULL if non-present. + If present, the occ and len + 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 + ZOOM_scanset_destroy. + + Events If you're developing non-blocking applications, you have to deal diff --git a/include/yaz/zoom.h b/include/yaz/zoom.h index e321fd0..ebbbf13 100644 --- a/include/yaz/zoom.h +++ b/include/yaz/zoom.h @@ -1,6 +1,6 @@ /* * 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 @@ -164,7 +164,8 @@ 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); diff --git a/zoom/zoom-c.c b/zoom/zoom-c.c index 1da198d..094c6e6 100644 --- a/zoom/zoom-c.c +++ b/zoom/zoom-c.c @@ -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. */ @@ -1325,7 +1325,8 @@ size_t ZOOM_scanset_size (ZOOM_scanset scan) 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); @@ -1333,11 +1334,11 @@ const char *ZOOM_scanset_term (ZOOM_scanset scan, size_t i, int *occ, size_t *le *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) {