summaryrefslogtreecommitdiff
path: root/src/format/image/dbg.c
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 /src/format/image/dbg.c
parentab3873609baf282f9158566c8242be2c9b126f5d (diff)
feat(dbg): Add debugging to png.c
Diffstat (limited to 'src/format/image/dbg.c')
-rw-r--r--src/format/image/dbg.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/format/image/dbg.c b/src/format/image/dbg.c
new file mode 100644
index 0000000..56cb53b
--- /dev/null
+++ b/src/format/image/dbg.c
@@ -0,0 +1,20 @@
+#include "dbg.h"
+
+ff_result ff_set_debug_stream(FILE *stream)
+{
+ intff_debug_stream = stream;
+ intff_debug_enabled = (stream != NULL);
+ return FF_RESULT_OK;
+}
+
+ff_result ff_dprintf(const char *format, ...)
+{
+ if (!intff_debug_enabled || !intff_debug_stream) return FF_RESULT_WARN_DEBUG_DISABLED;
+
+ va_list args;
+ va_start(args, format);
+ vfprintf(intff_debug_stream, format, args);
+ va_end(args);
+
+ return FF_RESULT_OK;
+}