From: Adam Dickmeiss Date: Wed, 6 Nov 2013 19:07:44 +0000 (+0100) Subject: Remove ZOOM_RESULT_LISTS not in use X-Git-Tag: v5.0.3~9 X-Git-Url: http://sru.miketaylor.org.uk/cgi-bin?a=commitdiff_plain;h=30b3c16a904efc6f5e0c4326eaa7e13589921572;p=yaz-moved-to-github.git Remove ZOOM_RESULT_LISTS not in use --- diff --git a/src/zoom-c.c b/src/zoom-c.c index 5f52d7c..2877a16 100644 --- a/src/zoom-c.c +++ b/src/zoom-c.c @@ -561,8 +561,6 @@ ZOOM_API(void) ZOOM_API(void) ZOOM_resultset_release(ZOOM_resultset r) { -#if ZOOM_RESULT_LISTS -#else if (r->connection) { /* remove ourselves from the resultsets in connection */ @@ -579,36 +577,20 @@ ZOOM_API(void) ZOOM_resultset_release(ZOOM_resultset r) } 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); @@ -731,9 +713,6 @@ ZOOM_API(ZOOM_resultset) 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); @@ -758,18 +737,8 @@ ZOOM_API(ZOOM_resultset) 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) diff --git a/src/zoom-p.h b/src/zoom-p.h index 3be4591..70bb2e4 100644 --- a/src/zoom-p.h +++ b/src/zoom-p.h @@ -37,7 +37,6 @@ #include #define SHPTR 1 -#define ZOOM_RESULT_LISTS 0 typedef struct ZOOM_Event_p *ZOOM_Event; @@ -56,10 +55,6 @@ typedef struct ZOOM_task_p *ZOOM_task; #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; @@ -102,11 +97,7 @@ struct ZOOM_connection_p { 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; @@ -117,13 +108,6 @@ struct ZOOM_connection_p { 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 @@ -146,10 +130,7 @@ struct ZOOM_resultset_p { #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; diff --git a/src/zoom-z3950.c b/src/zoom-z3950.c index 69d6dbe..f2517e0 100644 --- a/src/zoom-z3950.c +++ b/src/zoom-z3950.c @@ -778,15 +778,6 @@ zoom_ret ZOOM_connection_Z3950_send_search(ZOOM_connection c) 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) @@ -794,8 +785,6 @@ zoom_ret ZOOM_connection_Z3950_send_search(ZOOM_connection c) break; if (!rp) break; -#endif - } r->setname = xstrdup(setname); yaz_log(c->log_details, "%p ZOOM_connection_send_search: "