X-Git-Url: http://jsfdemo.indexdata.com/?a=blobdiff_plain;f=zoom%2Fzoom-c.c;h=2c6297b07d9ddb7c1aff356f130dac0de36d284d;hb=cd8a27308e5bb886f561b517d091437c7afbf53c;hp=1da198ded4b4344f51b2019db308e9f55f0b454d;hpb=eab4041057c94f4fd3feffd76c1f987ca67da1c3;p=yaz-moved-to-github.git diff --git a/zoom/zoom-c.c b/zoom/zoom-c.c index 1da198d..2c6297b 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.18 2002-01-03 12:18:38 adam Exp $ * * ZOOM layer for C, connections, result sets, queries. */ @@ -446,7 +446,6 @@ static void ZOOM_resultset_retrieve (ZOOM_resultset r, { ZOOM_task task; ZOOM_connection c; - const char *cp; if (!r) return; @@ -1093,7 +1092,17 @@ static int scan_response (ZOOM_connection c, Z_ScanResponse *res) 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) @@ -1325,7 +1334,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 +1343,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) { @@ -1349,6 +1359,17 @@ const char *ZOOM_scanset_term (ZOOM_scanset scan, size_t i, int *occ, size_t *le 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; @@ -1840,7 +1861,7 @@ int ZOOM_event (int no, ZOOM_connection *cs) } 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);