From 6dff34312a0f7c3272f7b52c5e13af1e04f72228 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Mon, 20 Oct 2008 08:38:56 +0200 Subject: [PATCH] Added ZOOM_get_event_str. --- include/yaz/zoom.h | 4 +++- src/zoom-c.c | 17 +++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) 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 -- 1.7.10.4