summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/tinyff/stream.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/include/tinyff/stream.h b/include/tinyff/stream.h
new file mode 100644
index 0000000..2cfdeaa
--- /dev/null
+++ b/include/tinyff/stream.h
@@ -0,0 +1,27 @@
+#ifndef STREAM_H
+#define STREAM_H
+
+#include <stddef.h>
+#include <stdio.h>
+
+
+#define FF_NULL_STREAM {0}
+
+
+// WARNING: This is just for reading streams for now
+// Until I finally add encoding to PNG, it will remain read-only
+
+typedef size_t (*ff_read_cb)(void *ptr, size_t size, void *user);
+
+typedef struct {
+ ff_read_cb read;
+ void *user;
+} ff_stream;
+
+// Default reads for common types (just FILE for now, memory later)
+size_t ff_file_read(void *ptr, size_t size, void *user);
+
+// Stream creation helpers
+ff_stream ff_create_file_stream(FILE *f);
+
+#endif \ No newline at end of file