summaryrefslogtreecommitdiff
path: root/src/gd_io.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/gd_io.h')
-rw-r--r--src/gd_io.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/gd_io.h b/src/gd_io.h
new file mode 100644
index 0000000..5c0bd24
--- /dev/null
+++ b/src/gd_io.h
@@ -0,0 +1,39 @@
+#ifndef GD_IO_H
+#define GD_IO_H 1
+
+#include <stdio.h>
+
+typedef struct gdIOCtx {
+ int (*getC)(struct gdIOCtx*);
+ int (*getBuf)(struct gdIOCtx*, void*, int);
+
+ void (*putC)(struct gdIOCtx*, int);
+ int (*putBuf)(struct gdIOCtx*, const void*, int);
+
+ int (*seek)(struct gdIOCtx*, const int);
+ long (*tell)(struct gdIOCtx*);
+
+ void (*free)(struct gdIOCtx*);
+
+} gdIOCtx;
+
+typedef struct gdIOCtx *gdIOCtxPtr;
+
+void Putword(int w, gdIOCtx *ctx);
+void Putchar(int c, gdIOCtx *ctx);
+
+void gdPutC(const unsigned char c, gdIOCtx *ctx);
+int gdPutBuf(const void *, int, gdIOCtx*);
+void gdPutWord(int w, gdIOCtx *ctx);
+void gdPutInt(int w, gdIOCtx *ctx);
+
+int gdGetC(gdIOCtx *ctx);
+int gdGetBuf(void *, int, gdIOCtx*);
+int gdGetByte(int *result, gdIOCtx *ctx);
+int gdGetWord(int *result, gdIOCtx *ctx);
+int gdGetInt(int *result, gdIOCtx *ctx);
+
+int gdSeek(gdIOCtx *ctx, const int);
+long gdTell(gdIOCtx *ctx);
+
+#endif