2022-07-25 14:26:08 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
2026-03-12 15:07:19 +08:00
|
|
|
#include "common/argType.h"
|
2022-07-25 14:26:08 +02:00
|
|
|
|
|
|
|
|
typedef struct FFformatarg
|
|
|
|
|
{
|
2026-03-12 15:07:19 +08:00
|
|
|
FFArgType type;
|
2022-07-25 14:26:08 +02:00
|
|
|
const void* value;
|
2024-05-27 16:41:37 +08:00
|
|
|
const char* name; // argument name, must start with an alphabet
|
2022-07-25 14:26:08 +02:00
|
|
|
} FFformatarg;
|
|
|
|
|
|
|
|
|
|
void ffFormatAppendFormatArg(FFstrbuf* buffer, const FFformatarg* formatarg);
|
|
|
|
|
void ffParseFormatString(FFstrbuf* buffer, const FFstrbuf* formatstr, uint32_t numArgs, const FFformatarg* arguments);
|
2024-12-11 10:47:02 +08:00
|
|
|
#define FF_PARSE_FORMAT_STRING_CHECKED(buffer, formatstr, arguments) \
|
|
|
|
|
ffParseFormatString((buffer), (formatstr), sizeof(arguments) / sizeof(*arguments), (arguments));
|