mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-10-29 16:26:39 +01:00
Migration: finish modules support
This commit is contained in:
@@ -109,6 +109,15 @@ void ffParseSeparatorJsonObject(FFSeparatorOptions* options, yyjson_val* module)
|
||||
}
|
||||
}
|
||||
|
||||
void ffGenerateSeparatorJsonConfig(FFSeparatorOptions* options, yyjson_mut_doc* doc, yyjson_mut_val* module)
|
||||
{
|
||||
__attribute__((__cleanup__(ffDestroySeparatorOptions))) FFSeparatorOptions defaultOptions;
|
||||
ffInitSeparatorOptions(&defaultOptions);
|
||||
|
||||
if (!ffStrbufEqual(&options->string, &defaultOptions.string))
|
||||
yyjson_mut_obj_add_strbuf(doc, module, "string", &options->string);
|
||||
}
|
||||
|
||||
void ffInitSeparatorOptions(FFSeparatorOptions* options)
|
||||
{
|
||||
ffOptionInitModuleBaseInfo(
|
||||
@@ -119,7 +128,7 @@ void ffInitSeparatorOptions(FFSeparatorOptions* options)
|
||||
ffPrintSeparator,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL
|
||||
ffGenerateSeparatorJsonConfig
|
||||
);
|
||||
ffStrbufInit(&options->string);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user