diff th_ioctx.h @ 675:fb4093ad1f7b

Add MemIO ioctx functionality.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 25 Feb 2020 06:15:08 +0200
parents 3c9205d52376
children 927772fb0745
line wrap: on
line diff
--- a/th_ioctx.h	Tue Feb 25 05:16:42 2020 +0200
+++ b/th_ioctx.h	Tue Feb 25 06:15:08 2020 +0200
@@ -42,6 +42,15 @@
     int status;         ///< Status
     size_t line;        ///< Line number
 
+    // Mem data
+    size_t maxSize;     ///< Maximum size (0 = no limit)
+    size_t memSize;     ///< Size of data
+    size_t memAlloc;    ///< Amount allocated
+    size_t minAlloc;    ///< Minimum allocation increase (0 = default)
+    off_t  memOffset;   ///< Current offset in data
+    uint8_t *memData;   ///< Pointer to data
+
+    // Message functions
     void (*error)(struct th_ioctx *ctx, const int err, const char *msg);
     void (*msg)(struct th_ioctx *ctx, const int level, const char *msg);
 
@@ -77,7 +86,7 @@
 //
 // Some basic iops
 //
-extern const th_ioctx_ops th_stdio_io_ops;
+extern const th_ioctx_ops th_stdio_io_ops, th_mem_io_ops;