JsonConfig: refactor JSON key handling to improve safety and consistency

Also make keys case-sensitive
This commit is contained in:
李通洲
2025-08-02 18:51:03 +08:00
parent 3cef51ec4a
commit 0b02543ef2
79 changed files with 333 additions and 603 deletions
+3 -3
View File
@@ -261,14 +261,14 @@ bool ffPercentParseCommandOptions(const char* key, const char* subkey, const cha
return false;
}
bool ffPercentParseJsonObject(const char* key, yyjson_val* value, FFPercentageModuleConfig* config)
bool ffPercentParseJsonObject(yyjson_val* key, yyjson_val* value, FFPercentageModuleConfig* config)
{
if (!ffStrEqualsIgnCase(key, "percent"))
if (!unsafe_yyjson_equals_str(key, "percent"))
return false;
if (!yyjson_is_obj(value))
{
fprintf(stderr, "Error: usage: %s must be an object\n", key);
fprintf(stderr, "Error: usage: %s must be an object\n", unsafe_yyjson_get_str(key));
exit(480);
}