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/jsonconfig.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 src/common/jsonconfig.h (limited to 'src/common/jsonconfig.h') diff --git a/src/common/jsonconfig.h b/src/common/jsonconfig.h new file mode 100644 index 0000000..a78aafd --- /dev/null +++ b/src/common/jsonconfig.h @@ -0,0 +1,27 @@ +#pragma once + +#include "common/ffdata.h" +#include "common/option.h" + +bool ffJsonConfigParseModuleArgs(yyjson_val* key, yyjson_val* val, FFModuleArgs* moduleArgs); +const char* ffJsonConfigParseEnum(yyjson_val* val, int* result, FFKeyValuePair pairs[]); + +yyjson_api_inline yyjson_mut_val* yyjson_mut_strbuf(yyjson_mut_doc* doc, const FFstrbuf* buf) { + return yyjson_mut_strncpy(doc, buf->chars, buf->length); +} + +yyjson_api_inline bool yyjson_mut_obj_add_strbuf(yyjson_mut_doc* doc, + yyjson_mut_val* obj, + const char* _key, + const FFstrbuf* buf) { + return yyjson_mut_obj_add_strncpy(doc, obj, _key, buf->chars, buf->length); +} + +yyjson_api_inline bool yyjson_mut_arr_add_strbuf(yyjson_mut_doc* doc, + yyjson_mut_val* obj, + const FFstrbuf* buf) { + return yyjson_mut_arr_add_strncpy(doc, obj, buf->chars, buf->length); +} + +void ffPrintJsonConfig(FFdata* data, bool prepare); +void ffJsonConfigGenerateModuleArgsConfig(yyjson_mut_doc* doc, yyjson_mut_val* module, FFModuleArgs* moduleArgs); -- cgit v1.2.3