/*
- * $Id: zoom-c.c,v 1.15 2001-12-30 22:21:11 adam Exp $
+ * $Id: zoom-c.c,v 1.18 2002-01-03 12:18:38 adam Exp $
*
* ZOOM layer for C, connections, result sets, queries.
*/
{
ZOOM_task task;
ZOOM_connection c;
- const char *cp;
if (!r)
return;
response_diag(c, res->entries->nonsurrogateDiagnostics[0]);
scan->scan_response = res;
nmem_transfer (scan->odr->mem, nmem);
+ if (res->stepSize)
+ ZOOM_options_set_int (scan->options, "stepSize", *res->stepSize);
+ if (res->positionOfTerm)
+ ZOOM_options_set_int (scan->options, "position", *res->positionOfTerm);
+ if (res->scanStatus)
+ ZOOM_options_set_int (scan->options, "scanStatus", *res->scanStatus);
+ if (res->numberOfEntriesReturned)
+ ZOOM_options_set_int (scan->options, "number",
+ *res->numberOfEntriesReturned);
nmem_destroy (nmem);
+ return 1;
}
static int send_sort (ZOOM_connection c)
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)
{
return term;
}
+const char *ZOOM_scanset_option_get (ZOOM_scanset scan, const char *key)
+{
+ return ZOOM_options_get (scan->options, key);
+}
+
+void ZOOM_scanset_option_set (ZOOM_scanset scan, const char *key,
+ const char *val)
+{
+ ZOOM_options_set (scan->options, key, val);
+}
+
static int ZOOM_connection_exec_task (ZOOM_connection c)
{
ZOOM_task task = c->tasks;
}
if (r == 0 && c->mask)
{
- ZOOM_Event event = ZOOM_Event_create(ZOOM_EVENT_IO_TIMEOUT);
+ ZOOM_Event event = ZOOM_Event_create(ZOOM_EVENT_TIMEOUT);
/* timeout and this connection was waiting */
c->error = ZOOM_ERROR_TIMEOUT;
do_close (c);