summaryrefslogtreecommitdiff
path: root/include/tinyff/dbg.h
diff options
context:
space:
mode:
authortazy <gardendistrict0x0@outlook.com>2026-01-04 21:19:13 +0000
committertazy <gardendistrict0x0@outlook.com>2026-01-04 21:19:13 +0000
commitd33aeddbfb1510c7a1846067c5512cfb942ccb17 (patch)
tree635055db5399af3d9b3e87b5a5241a3886e1090b /include/tinyff/dbg.h
parentab3873609baf282f9158566c8242be2c9b126f5d (diff)
feat(dbg): Add debugging to png.c
Diffstat (limited to 'include/tinyff/dbg.h')
-rw-r--r--include/tinyff/dbg.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/include/tinyff/dbg.h b/include/tinyff/dbg.h
new file mode 100644
index 0000000..7392f5a
--- /dev/null
+++ b/include/tinyff/dbg.h
@@ -0,0 +1,29 @@
+#ifndef DBG_H
+#define DBG_H
+
+// Debug writes extra messages to a stream of the user's choice
+// To enable debug, the user needs to include this header
+// Then they can use the ff_set_debug_stream function to set the stream
+// And then use ff_dprintf to print debug messages
+// By default, debug is disabled
+
+
+#define FF_DEBUG_ENABLED 1
+
+#include <stdio.h>
+#include <stdarg.h>
+#include "result.h"
+#include "common.h"
+
+static FILE *intff_debug_stream = NULL;
+
+// This flag is the same name as FF_DEBUG_ENABLED but is local to this file
+// Thats why it has the int prefix
+static ff_flag intff_debug_enabled = 0;
+
+ff_result ff_set_debug_stream(FILE *stream);
+
+
+ff_result ff_dprintf(const char *format, ...);
+
+#endif \ No newline at end of file