From: Adam Dickmeiss Date: Mon, 20 Oct 2008 06:38:56 +0000 (+0200) Subject: Added ZOOM_get_event_str. X-Git-Tag: v3.0.38~21 X-Git-Url: http://lists.indexdata.com/cgi-bin?a=commitdiff_plain;h=6dff34312a0f7c3272f7b52c5e13af1e04f72228;p=yaz-moved-to-github.git Added ZOOM_get_event_str. --- diff --git a/include/yaz/zoom.h b/include/yaz/zoom.h index f14942d..1a07437 100644 --- a/include/yaz/zoom.h +++ b/include/yaz/zoom.h @@ -486,7 +486,9 @@ ZOOM_API(int) ZOOM_API(int) ZOOM_connection_peek_event(ZOOM_connection c); -ZOOM_END_CDECL +ZOOM_API(const char *) + ZOOM_get_event_str(int event); + /* * Local variables: * c-basic-offset: 4 diff --git a/src/zoom-c.c b/src/zoom-c.c index 2c12c6a..f61eab8 100644 --- a/src/zoom-c.c +++ b/src/zoom-c.c @@ -41,6 +41,23 @@ static zoom_ret ZOOM_connection_send_init(ZOOM_connection c); static zoom_ret do_write_ex(ZOOM_connection c, char *buf_out, int len_out); static char *cql2pqf(ZOOM_connection c, const char *cql); +const char *ZOOM_get_event_str(int event) +{ + static const char *ar[] = { + "NONE", + "CONNECT", + "SEND_DATA", + "RECV_DATA", + "TIMEOUT", + "UNKNOWN", + "SEND_APDU", + "RECV_APDU", + "RECV_RECORD", + "RECV_SEARCH", + "END" + }; + return ar[event]; +} /* * This wrapper is just for logging failed lookups. It would be nicer