ZOOM_API(void)
ZOOM_resultset_destroy(ZOOM_resultset r);
+/** release result set from connection.
+
+ The result will will no longer be able to perform retrievals
+ from the connection from which it was created.
+*/
+ZOOM_API(void)
+ZOOM_resultset_release(ZOOM_resultset r);
+
/* result set option */
ZOOM_API(const char *)
ZOOM_resultset_option_get(ZOOM_resultset r, const char *key);
static zoom_ret do_write(ZOOM_connection c);
+ZOOM_API(void) ZOOM_resultset_release(ZOOM_resultset r)
+{
+#if ZOOM_RESULT_LISTS
+#else
+ if (r->connection)
+ {
+ /* remove ourselves from the resultsets in connection */
+ ZOOM_resultset *rp = &r->connection->resultsets;
+ while (1)
+ {
+ assert(*rp); /* we must be in this list!! */
+ if (*rp == r)
+ { /* OK, we're here - take us out of it */
+ *rp = (*rp)->next;
+ break;
+ }
+ rp = &(*rp)->next;
+ }
+ r->connection = 0;
+ }
+#endif
+}
+
ZOOM_API(void)
ZOOM_connection_destroy(ZOOM_connection c)
{
yaz_log(log_details, "%p ZOOM_connection resultset_destroy: Deleting resultset (%p) ", r->connection, r);
ZOOM_resultset_cache_reset(r);
-#if ZOOM_RESULT_LISTS
-#else
- if (r->connection)
- {
- /* remove ourselves from the resultsets in connection */
- ZOOM_resultset *rp = &r->connection->resultsets;
- while (1)
- {
- assert(*rp); /* we must be in this list!! */
- if (*rp == r)
- { /* OK, we're here - take us out of it */
- *rp = (*rp)->next;
- break;
- }
- rp = &(*rp)->next;
- }
- }
-#endif
+ ZOOM_resultset_release(r);
ZOOM_query_destroy(r->query);
ZOOM_options_destroy(r->options);
odr_destroy(r->odr);