-YAZ_EXPORT
-const char *Z3950_connection_addinfo (Z3950_connection c);
-
-#define Z3950_ERROR_NONE 0
-#define Z3950_ERROR_CONNECT 10000
-#define Z3950_ERROR_MEMORY 10001
-#define Z3950_ERROR_ENCODE 10002
-#define Z3950_ERROR_DECODE 10003
-#define Z3950_ERROR_CONNECTION_LOST 10004
-#define Z3950_ERROR_INIT 10005
-#define Z3950_ERROR_INTERNAL 10006
-#define Z3950_ERROR_TIMEOUT 10007
+ZOOM_API(const char *)
+ZOOM_connection_addinfo (ZOOM_connection c);
+/* returns diagnostic set */
+ZOOM_API(const char *)
+ZOOM_connection_diagset (ZOOM_connection c);
+/* translates error code into human-readable string */
+ZOOM_API(const char *)
+ZOOM_diag_str (int error);
+
+#define ZOOM_ERROR_NONE 0
+#define ZOOM_ERROR_CONNECT 10000
+#define ZOOM_ERROR_MEMORY 10001
+#define ZOOM_ERROR_ENCODE 10002
+#define ZOOM_ERROR_DECODE 10003
+#define ZOOM_ERROR_CONNECTION_LOST 10004
+#define ZOOM_ERROR_INIT 10005
+#define ZOOM_ERROR_INTERNAL 10006
+#define ZOOM_ERROR_TIMEOUT 10007
+#define ZOOM_ERROR_UNSUPPORTED_PROTOCOL 10008
+#define ZOOM_ERROR_UNSUPPORTED_QUERY 10009
+#define ZOOM_ERROR_INVALID_QUERY 10010
+#define ZOOM_ERROR_CQL_PARSE 10011
+#define ZOOM_ERROR_CQL_TRANSFORM 10012
+
+ZOOM_API(int)
+ZOOM_connection_last_event(ZOOM_connection cs);
+
+#define ZOOM_EVENT_NONE 0
+#define ZOOM_EVENT_CONNECT 1
+#define ZOOM_EVENT_SEND_DATA 2
+#define ZOOM_EVENT_RECV_DATA 3
+#define ZOOM_EVENT_TIMEOUT 4
+#define ZOOM_EVENT_UNKNOWN 5
+#define ZOOM_EVENT_SEND_APDU 6
+#define ZOOM_EVENT_RECV_APDU 7
+#define ZOOM_EVENT_RECV_RECORD 8
+#define ZOOM_EVENT_RECV_SEARCH 9
+#define ZOOM_EVENT_END 10