From 76424950e373d3b04ac3dd13019151bfba3e8423 Mon Sep 17 00:00:00 2001 From: sumuel Date: Mon, 17 Aug 2026 20:44:55 +0000 Subject: Add the files --- src/common/format.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 src/common/format.h (limited to 'src/common/format.h') diff --git a/src/common/format.h b/src/common/format.h new file mode 100644 index 0000000..5be5dff --- /dev/null +++ b/src/common/format.h @@ -0,0 +1,14 @@ +#pragma once + +#include "common/argType.h" + +typedef struct FFformatarg { + FFArgType type; + const void* value; + const char* name; // argument name, must start with an alphabet +} FFformatarg; + +void ffFormatAppendFormatArg(FFstrbuf* buffer, const FFformatarg* formatarg); +bool ffParseFormatString(FFstrbuf* buffer, const FFstrbuf* formatstr, uint32_t numArgs, const FFformatarg* arguments); +#define FF_PARSE_FORMAT_STRING_CHECKED(buffer, formatstr, arguments) \ + ffParseFormatString((buffer), (formatstr), sizeof(arguments) / sizeof(*arguments), (arguments)); -- cgit v1.2.3