diff th_ioctx.h @ 72:43df05a632cb

Break I/O context API, add function pointers to init/open/new functions.
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 15 Nov 2012 19:52:09 +0200
parents d94af48cef7b
children 40568456eb5b
line wrap: on
line diff
--- a/th_ioctx.h	Thu Nov 15 19:44:59 2012 +0200
+++ b/th_ioctx.h	Thu Nov 15 19:52:09 2012 +0200
@@ -30,13 +30,21 @@
 } th_ioctx_t;
 
 
-BOOL         th_ioctx_init(th_ioctx_t *ctx, const char *filename);
-BOOL         th_ioctx_open(th_ioctx_t *ctx, const char *filename, const char *mode);
-void         th_ioctx_close(th_ioctx_t *ctx);
-void         th_ioctx_error(th_ioctx_t *ctx, const int err, const char *fmt, ...);
+BOOL th_ioctx_init(th_ioctx_t *ctx, const char *filename,
+    void (*error)(struct _th_ioctx_t *, const int, const char *msg),
+    void (*msg)(struct _th_ioctx_t *, const char *msg));
+
+BOOL th_ioctx_open(th_ioctx_t *ctx, const char *filename, const char *mode,
+    void (*error)(struct _th_ioctx_t *, const int, const char *msg),
+    void (*msg)(struct _th_ioctx_t *, const char *msg));
 
-th_ioctx_t * th_ioctx_new(const char *filename);
-void         th_ioctx_free(th_ioctx_t *ctx);
+void th_ioctx_close(th_ioctx_t *ctx);
+void th_ioctx_error(th_ioctx_t *ctx, const int err, const char *fmt, ...);
+
+th_ioctx_t * th_ioctx_new(const char *filename,
+    void (*error)(struct _th_ioctx_t *, const int, const char *msg),
+    void (*msg)(struct _th_ioctx_t *, const char *msg));
+void th_ioctx_free(th_ioctx_t *ctx);
 
 
 #ifdef __cplusplus