mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-10-29 00:03:58 +01:00
Migration: support bluetooth and board
This commit is contained in:
@@ -112,6 +112,17 @@ void ffParseBluetoothJsonObject(FFBluetoothOptions* options, yyjson_val* module)
|
||||
}
|
||||
}
|
||||
|
||||
void ffGenerateBluetoothJsonConfig(FFBluetoothOptions* options, yyjson_mut_doc* doc, yyjson_mut_val* module)
|
||||
{
|
||||
__attribute__((__cleanup__(ffDestroyBluetoothOptions))) FFBluetoothOptions defaultOptions;
|
||||
ffInitBluetoothOptions(&defaultOptions);
|
||||
|
||||
ffJsonConfigGenerateModuleArgsConfig(doc, module, &defaultOptions.moduleArgs, &options->moduleArgs);
|
||||
|
||||
if (options->showDisconnected != defaultOptions.showDisconnected)
|
||||
yyjson_mut_obj_add_bool(doc, module, "showDisconnected", options->showDisconnected);
|
||||
}
|
||||
|
||||
void ffGenerateBluetoothJsonResult(FF_MAYBE_UNUSED FFBluetoothOptions* options, yyjson_mut_doc* doc, yyjson_mut_val* module)
|
||||
{
|
||||
FF_LIST_AUTO_DESTROY results = ffListCreate(sizeof(FFBluetoothResult));
|
||||
@@ -165,7 +176,7 @@ void ffInitBluetoothOptions(FFBluetoothOptions* options)
|
||||
ffPrintBluetooth,
|
||||
ffGenerateBluetoothJsonResult,
|
||||
ffPrintBluetoothHelpFormat,
|
||||
NULL
|
||||
ffGenerateBluetoothJsonConfig
|
||||
);
|
||||
ffOptionInitModuleArg(&options->moduleArgs);
|
||||
options->showDisconnected = false;
|
||||
|
||||
@@ -76,6 +76,14 @@ void ffParseBoardJsonObject(FFBoardOptions* options, yyjson_val* module)
|
||||
}
|
||||
}
|
||||
|
||||
void ffGenerateBoardJsonConfig(FFBoardOptions* options, yyjson_mut_doc* doc, yyjson_mut_val* module)
|
||||
{
|
||||
__attribute__((__cleanup__(ffDestroyBoardOptions))) FFBoardOptions defaultOptions;
|
||||
ffInitBoardOptions(&defaultOptions);
|
||||
|
||||
ffJsonConfigGenerateModuleArgsConfig(doc, module, &defaultOptions.moduleArgs, &options->moduleArgs);
|
||||
}
|
||||
|
||||
void ffGenerateBoardJsonResult(FF_MAYBE_UNUSED FFBoardOptions* options, yyjson_mut_doc* doc, yyjson_mut_val* module)
|
||||
{
|
||||
FFBoardResult board;
|
||||
@@ -127,7 +135,7 @@ void ffInitBoardOptions(FFBoardOptions* options)
|
||||
ffPrintBoard,
|
||||
ffGenerateBoardJsonResult,
|
||||
ffPrintBoardHelpFormat,
|
||||
NULL
|
||||
ffGenerateBoardJsonConfig
|
||||
);
|
||||
ffOptionInitModuleArg(&options->moduleArgs);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user