summaryrefslogtreecommitdiff
path: root/include/backend.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/backend.h')
-rw-r--r--include/backend.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/include/backend.h b/include/backend.h
new file mode 100644
index 0000000..42c6e8c
--- /dev/null
+++ b/include/backend.h
@@ -0,0 +1,25 @@
+#ifndef BACKEND_H
+#define BACKEND_H
+
+#include <stdint.h>
+#include <stddef.h>
+
+#define DEBUG(fmt, ...) debug(__func__, __FILE__, __LINE__, fmt , ## __VA_ARGS__)
+#define DIE(fmt, ...) die(__func__, __FILE__, __LINE__, fmt , ## __VA_ARGS__)
+
+void debug(const char *name, const char *file, size_t line, const char *fmt, ...);
+void die(const char *name, const char *file, size_t line, const char *fmt, ...);
+
+void emit8(uint8_t out);
+void emit16(uint16_t out);
+void emit32(uint32_t out);
+void emit64(uint64_t out);
+
+struct string_view backend_stream_init_src(const char *path);
+void backend_stream_init_dst(const char *path);
+void backend_stream_close_src();
+void backend_stream_close_dst();
+
+void save(const char* path);
+
+#endif