diff options
| author | TazyFoundSoup <gardendistrict0x0@outlook.com> | 2026-01-14 14:17:58 +1100 |
|---|---|---|
| committer | TazyFoundSoup <gardendistrict0x0@outlook.com> | 2026-01-14 14:17:58 +1100 |
| commit | fbf406c34adb0a65924f15a1f0e5142e695b36ad (patch) | |
| tree | 846b7e135dafae9bf8790f86d66bf5201a7f22fb /src/dbg.c | |
| parent | d33aeddbfb1510c7a1846067c5512cfb942ccb17 (diff) | |
feat(dbg): Add tinyff debug splash message
Diffstat (limited to 'src/dbg.c')
| -rw-r--r-- | src/dbg.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/dbg.c b/src/dbg.c new file mode 100644 index 0000000..8d3aba3 --- /dev/null +++ b/src/dbg.c @@ -0,0 +1,26 @@ +#include "dbg.h" + +ff_result ff_set_debug_stream(FILE *stream) +{ + intff_debug_stream = stream; + intff_debug_enabled = (stream != NULL); + + ff_dprintf("tinyff 0.1.0 debug stream\n"); + ff_dprintf("For more information, visit\n"); + ff_dprintf("https://github.com/TazyFoundSoup/tinyff\n"); + ff_dprintf("------------------------------\n"); + + 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; +} |
