diff options
| author | sumuel <samuel@yakubos.org> | 2026-08-17 20:44:55 +0000 |
|---|---|---|
| committer | sumuel <samuel@yakubos.org> | 2026-08-17 20:44:55 +0000 |
| commit | 76424950e373d3b04ac3dd13019151bfba3e8423 (patch) | |
| tree | 4c3cfdbda039e592b9186be3e28f8d7cfd439e8a /src/common/format.h | |
Add the files
Diffstat (limited to 'src/common/format.h')
| -rw-r--r-- | src/common/format.h | 14 |
1 files changed, 14 insertions, 0 deletions
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)); |