diff th_ioctx.h @ 477:96d137a6b392

Improve ioctx API. This breaks backwards compatibility of th_io_fopen().
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 09 Jul 2018 08:06:45 +0300
parents 85fa3d333556
children e4ce60239d16
line wrap: on
line diff
--- a/th_ioctx.h	Mon Jul 09 07:29:33 2018 +0300
+++ b/th_ioctx.h	Mon Jul 09 08:06:45 2018 +0300
@@ -35,8 +35,8 @@
     int status;         ///< Status
     size_t line;        ///< Line number
 
-    void (*error)(struct th_ioctx *, const int err, const char *msg);
-    void (*msg)(struct th_ioctx *, const int level, const char *msg);
+    void (*error)(struct th_ioctx *ctx, const int err, const char *msg);
+    void (*msg)(struct th_ioctx *ctx, const int level, const char *msg);
 
     const struct th_ioctx_ops *fops; ///< Pointer to I/O ops struct to be used with this context
 } th_ioctx;
@@ -79,7 +79,7 @@
 //
 th_ioctx *   th_io_new(const th_ioctx_ops *fops, const char *filename);
 int          th_io_open(th_ioctx *ctx, const char *mode);
-th_ioctx *   th_io_fopen(const th_ioctx_ops *fops, const char *filename, const char *mode);
+int          th_io_fopen(th_ioctx **pctx, const th_ioctx_ops *fops, const char *filename, const char *mode);
 void         th_io_close(th_ioctx *ctx);
 void         th_io_free(th_ioctx *ctx);