Added a new ZOOM event type ZOOM_EVENT_END which signals no more events
authorAdam Dickmeiss <adam@indexdata.dk>
Fri, 7 Apr 2006 11:27:24 +0000 (11:27 +0000)
committerAdam Dickmeiss <adam@indexdata.dk>
Fri, 7 Apr 2006 11:27:24 +0000 (11:27 +0000)
to be returned for this connection.

NEWS
include/yaz/zoom.h
src/zoom-c.c

diff --git a/NEWS b/NEWS
index ee69886..3597881 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,6 @@
+Added a new ZOOM event type ZOOM_EVENT_END which signals no more events
+to be returned for this connection.
+
 --- 2.1.16 2006/03/31 
 
 Allow multiple languages and charsets to be specified with
index 70f7231..8258ef5 100644 (file)
@@ -2,7 +2,7 @@
  * Copyright (C) 1995-2005, Index Data ApS
  * See the file LICENSE for details.
  *
- * $Id: zoom.h,v 1.33 2005-12-21 16:43:13 mike Exp $
+ * $Id: zoom.h,v 1.34 2006-04-07 11:27:24 adam Exp $
  */
 /**
  * \file zoom.h
@@ -127,6 +127,7 @@ ZOOM_connection_last_event(ZOOM_connection cs);
 #define ZOOM_EVENT_RECV_APDU 7
 #define ZOOM_EVENT_RECV_RECORD 8
 #define ZOOM_EVENT_RECV_SEARCH 9
+#define ZOOM_EVENT_END 10
 
 /* ----------------------------------------------------------- */
 /* result sets */
index 78c3948..4173682 100644 (file)
@@ -2,7 +2,7 @@
  * Copyright (C) 1995-2005, Index Data ApS
  * See the file LICENSE for details.
  *
- * $Id: zoom-c.c,v 1.67 2006-04-01 07:21:12 adam Exp $
+ * $Id: zoom-c.c,v 1.68 2006-04-07 11:27:24 adam Exp $
  */
 /**
  * \file zoom-c.c
@@ -245,6 +245,12 @@ void ZOOM_connection_remove_task (ZOOM_connection c)
             assert (0);
         }
         xfree (task);
+
+        if (!c->tasks)
+        {
+            ZOOM_Event event = ZOOM_Event_create(ZOOM_EVENT_END);
+            ZOOM_connection_put_event(c, event);
+        }
     }
 }
 
@@ -1144,7 +1150,7 @@ static zoom_ret ZOOM_connection_send_init (ZOOM_connection c)
         ZOOM_options_get(c->options, "implementationName"),
         odr_prepend(c->odr_out, "ZOOM-C", ireq->implementationName));
 
-    version = odr_strdup(c->odr_out, "$Revision: 1.67 $");
+    version = odr_strdup(c->odr_out, "$Revision: 1.68 $");
     if (strlen(version) > 10)   /* check for unexpanded CVS strings */
         version[strlen(version)-2] = '\0';
     ireq->implementationVersion = odr_prepend(c->odr_out,