2023-03-15 15:24:40 +08:00
|
|
|
#pragma once
|
|
|
|
|
|
2026-01-15 15:03:38 +08:00
|
|
|
#include "common/ffdata.h"
|
|
|
|
|
#include "common/option.h"
|
2023-03-15 15:24:40 +08:00
|
|
|
|
2025-08-02 18:51:03 +08:00
|
|
|
bool ffJsonConfigParseModuleArgs(yyjson_val* key, yyjson_val* val, FFModuleArgs* moduleArgs);
|
2023-06-10 15:01:54 +08:00
|
|
|
const char* ffJsonConfigParseEnum(yyjson_val* val, int* result, FFKeyValuePair pairs[]);
|
2023-08-29 11:13:55 +08:00
|
|
|
|
2023-10-28 23:39:15 +08:00
|
|
|
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);
|
|
|
|
|
}
|
|
|
|
|
|
2023-08-29 11:13:55 +08:00
|
|
|
yyjson_api_inline bool yyjson_mut_obj_add_strbuf(yyjson_mut_doc *doc,
|
|
|
|
|
yyjson_mut_val *obj,
|
|
|
|
|
const char *_key,
|
2023-08-31 11:24:15 +08:00
|
|
|
const FFstrbuf* buf) {
|
2023-08-29 11:13:55 +08:00
|
|
|
return yyjson_mut_obj_add_strncpy(doc, obj, _key, buf->chars, buf->length);
|
|
|
|
|
}
|
2023-08-31 13:45:19 +08:00
|
|
|
|
2023-08-31 15:26:55 +08:00
|
|
|
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);
|
|
|
|
|
}
|
2026-01-15 15:03:38 +08:00
|
|
|
|
|
|
|
|
void ffPrintJsonConfig(FFdata* data, bool prepare);
|
|
|
|
|
void ffJsonConfigGenerateModuleArgsConfig(yyjson_mut_doc* doc, yyjson_mut_val* module, FFModuleArgs* moduleArgs);
|