ZOOM_API(void) ZOOM_resultset_release(ZOOM_resultset r)
{
-#if ZOOM_RESULT_LISTS
-#else
if (r->connection)
{
/* remove ourselves from the resultsets in connection */
}
r->connection = 0;
}
-#endif
}
ZOOM_API(void)
ZOOM_connection_destroy(ZOOM_connection c)
{
-#if ZOOM_RESULT_LISTS
- ZOOM_resultsets list;
-#else
ZOOM_resultset r;
-#endif
if (!c)
return;
yaz_log(c->log_api, "%p ZOOM_connection_destroy", c);
if (c->cs)
cs_close(c->cs);
-#if ZOOM_RESULT_LISTS
- /* Remove the connection's usage of resultsets */
- list = c->resultsets;
- while (list) {
- ZOOM_resultsets removed = list;
- ZOOM_resultset_destroy(list->resultset);
- list = list->next;
- xfree(removed);
- }
-#else
for (r = c->resultsets; r; r = r->next)
r->connection = 0;
-#endif
xfree(c->buf_in);
xfree(c->addinfo);
const char *cp;
int start, count;
const char *syntax, *elementSetName, *schema;
-#if ZOOM_RESULT_LISTS
- ZOOM_resultsets set;
-#endif
yaz_log(c->log_api, "%p ZOOM_connection_search set %p query %p", c, r, q);
r->r_sort_spec = ZOOM_query_get_sortspec(q);
r->odr);
r->connection = c;
-
-#if ZOOM_RESULT_LISTS
- yaz_log(log_details, "%p ZOOM_connection_search: Adding new resultset (%p) to resultsets (%p) ", c, r, c->resultsets);
- set = xmalloc(sizeof(*set));
- ZOOM_resultset_addref(r);
- set->resultset = r;
- set->next = c->resultsets;
- c->resultsets = set;
-#else
r->next = c->resultsets;
c->resultsets = r;
-#endif
if (c->host_port && c->proto == PROTO_HTTP)
{
if (!c->cs)
#include <yaz/mutex.h>
#define SHPTR 1
-#define ZOOM_RESULT_LISTS 0
typedef struct ZOOM_Event_p *ZOOM_Event;
#define STATE_CONNECTING 1
#define STATE_ESTABLISHED 2
-#if ZOOM_RESULT_LISTS
-typedef struct ZOOM_resultsets_p *ZOOM_resultsets;
-#endif
-
struct ZOOM_connection_p {
enum oid_proto proto;
COMSTACK cs;
ZOOM_task tasks;
ZOOM_options options;
-#if ZOOM_RESULT_LISTS
- ZOOM_resultsets resultsets;
-#else
ZOOM_resultset resultsets;
-#endif
ZOOM_Event m_queue_front;
ZOOM_Event m_queue_back;
zoom_sru_mode sru_mode;
WRBUF saveAPDU_wrbuf;
};
-#if ZOOM_RESULT_LISTS
-struct ZOOM_resultsets_p {
- ZOOM_resultset resultset;
- ZOOM_resultsets next;
-};
-#endif
-
typedef struct ZOOM_record_cache_p *ZOOM_record_cache;
#define RECORD_HASH_SIZE 131
#if SHPTR
struct WRBUF_shptr *record_wrbuf;
#endif
-#if ZOOM_RESULT_LISTS
-#else
ZOOM_resultset next;
-#endif
ZOOM_facet_field *facets;
int num_facets;
char **facets_names;
result sets on the server. */
for (ord = 1; ; ord++)
{
-#if ZOOM_RESULT_LISTS
- ZOOM_resultsets rsp;
- sprintf(setname, "%d", ord);
- for (rsp = c->resultsets; rsp; rsp = rsp->next)
- if (rsp->resultset->setname && !strcmp(rsp->resultset->setname, setname))
- break;
- if (!rsp)
- break;
-#else
ZOOM_resultset rp;
sprintf(setname, "%d", ord);
for (rp = c->resultsets; rp; rp = rp->next)
break;
if (!rp)
break;
-#endif
-
}
r->setname = xstrdup(setname);
yaz_log(c->log_details, "%p ZOOM_connection_send_search: "