Global: don't expose internal functions

This commit is contained in:
李通洲
2023-10-23 13:32:18 +08:00
parent 824ada49b6
commit 44632e9bf6
115 changed files with 709 additions and 930 deletions
+20 -20
View File
@@ -101,17 +101,6 @@ void ffPrintBattery(FFBatteryOptions* options)
}
}
void ffInitBatteryOptions(FFBatteryOptions* options)
{
ffOptionInitModuleBaseInfo(&options->moduleInfo, FF_BATTERY_MODULE_NAME, ffParseBatteryCommandOptions, ffParseBatteryJsonObject, ffPrintBattery, ffGenerateBatteryJsonResult, ffPrintBatteryHelpFormat);
ffOptionInitModuleArg(&options->moduleArgs);
options->temp = false;
#ifdef __linux__
ffStrbufInit(&options->dir);
#endif
}
bool ffParseBatteryCommandOptions(FFBatteryOptions* options, const char* key, const char* value)
{
const char* subKey = ffOptionTestPrefix(key, FF_BATTERY_MODULE_NAME);
@@ -136,15 +125,6 @@ bool ffParseBatteryCommandOptions(FFBatteryOptions* options, const char* key, co
return false;
}
void ffDestroyBatteryOptions(FFBatteryOptions* options)
{
ffOptionDestroyModuleArg(&options->moduleArgs);
#ifdef __linux__
ffStrbufDestroy(&options->dir);
#endif
}
void ffParseBatteryJsonObject(FFBatteryOptions* options, yyjson_val* module)
{
yyjson_val *key_, *val;
@@ -219,3 +199,23 @@ void ffPrintBatteryHelpFormat(void)
"Battery status"
});
}
void ffInitBatteryOptions(FFBatteryOptions* options)
{
ffOptionInitModuleBaseInfo(&options->moduleInfo, FF_BATTERY_MODULE_NAME, ffParseBatteryCommandOptions, ffParseBatteryJsonObject, ffPrintBattery, ffGenerateBatteryJsonResult, ffPrintBatteryHelpFormat);
ffOptionInitModuleArg(&options->moduleArgs);
options->temp = false;
#ifdef __linux__
ffStrbufInit(&options->dir);
#endif
}
void ffDestroyBatteryOptions(FFBatteryOptions* options)
{
ffOptionDestroyModuleArg(&options->moduleArgs);
#ifdef __linux__
ffStrbufDestroy(&options->dir);
#endif
}
-5
View File
@@ -5,10 +5,5 @@
#define FF_BATTERY_MODULE_NAME "Battery"
void ffPrintBattery(FFBatteryOptions* options);
void ffInitBatteryOptions(FFBatteryOptions* options);
bool ffParseBatteryCommandOptions(FFBatteryOptions* options, const char* key, const char* value);
void ffDestroyBatteryOptions(FFBatteryOptions* options);
void ffParseBatteryJsonObject(FFBatteryOptions* options, yyjson_val* module);
void ffGenerateBatteryJsonResult(FFBatteryOptions* options, yyjson_mut_doc* doc, yyjson_mut_val* module);
void ffPrintBatteryHelpFormat(void);