/*
- * $Id: zoom-c.c,v 1.17 2002-01-03 10:23:46 adam Exp $
+ * $Id: zoom-c.c,v 1.19 2002-01-09 11:03:41 adam Exp $
*
* ZOOM layer for C, connections, result sets, queries.
*/
{
if (npr->which == Z_NamePlusRecord_databaseRecord)
{
- *len = -1;
- return (Z_External *) npr->u.databaseRecord;
+ Z_External *r = (Z_External *) npr->u.databaseRecord;
+
+ if (r->which == Z_External_sutrs)
+ {
+ *len = r->u.sutrs->len;
+ return r->u.sutrs->buf;
+ }
+ else if (r->which == Z_External_octet)
+ {
+ *len = r->u.octet_aligned->len;
+ return r->u.octet_aligned->buf;
+ }
+ else /* grs-1, explain, ... */
+ {
+ *len = -1;
+ return (Z_External *) npr->u.databaseRecord;
+ }
}
return 0;
}
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;
}
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;