* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-/* $Id: zoom.h,v 1.42 2007-01-09 13:56:48 adam Exp $ */
+/* $Id: zoom.h,v 1.43 2007-01-10 13:25:46 adam Exp $ */
/**
* \file zoom.h
+/** \brief peek at next event
+ \param c connection
+ \returns ZOOM_EVENT_NONE (for no events in queue), ZOOM_EVENT_CONNECT, ..
+
+ Does not actually remove the event from the event queue. ZOOM_event and
+ ZOOM_process_event removes one event.
+*/
+
+ZOOM_API(int)
+ ZOOM_connection_peek_event(ZOOM_connection c);
+
ZOOM_END_CDECL
/*
* Local variables:
* Copyright (C) 1995-2007, Index Data ApS
* See the file LICENSE for details.
*
- * $Id: zoom-c.c,v 1.105 2007-01-09 13:56:48 adam Exp $
+ * $Id: zoom-c.c,v 1.106 2007-01-10 13:25:46 adam Exp $
*/
/**
* \file zoom-c.c
return event;
}
+int ZOOM_connection_peek_event(ZOOM_connection c)
+{
+ ZOOM_Event event = c->m_queue_front;
+
+ return event ? event->kind : ZOOM_EVENT_NONE;
+}
static void set_dset_error(ZOOM_connection c, int error,
const char *dset,
odr_prepend(c->odr_out, "ZOOM-C",
ireq->implementationName));
- version = odr_strdup(c->odr_out, "$Revision: 1.105 $");
+ version = odr_strdup(c->odr_out, "$Revision: 1.106 $");
if (strlen(version) > 10) /* check for unexpanded CVS strings */
version[strlen(version)-2] = '\0';
ireq->implementationVersion =
-/* $Id: zoomtst3.c,v 1.12 2007-01-03 08:42:17 adam Exp $ */
+/* $Id: zoomtst3.c,v 1.13 2007-01-10 13:25:46 adam Exp $ */
/** \file zoomtst3.c
\brief Asynchronous multi-target client
/* network I/O. pass number of connections and array of connections */
while ((i = ZOOM_event (no, z)))
{
- printf ("no = %d event = %d\n", i-1,
+ int peek = ZOOM_connection_peek_event(z[i-1]);
+ printf ("no = %d peek = %d event = %d\n", i-1,
+ peek,
ZOOM_connection_last_event(z[i-1]));
}