Modules: add init and destroy option callbacks to module info

This commit is contained in:
李通洲
2025-08-03 18:39:41 +08:00
parent 582268f44f
commit 6f8d276545
74 changed files with 148 additions and 0 deletions
+2
View File
@@ -29,6 +29,8 @@ typedef struct FFModuleBaseInfo
// This is UB, because `void*` is not compatible with `FF*Options*`.
// However we can't do it better unless we move to C++, so that `option` becomes a `this` pointer
// https://stackoverflow.com/questions/559581/casting-a-function-pointer-to-another-type
void (*initOptions)(void* options);
void (*destroyOptions)(void* options);
void (*parseJsonObject)(void* options, struct yyjson_val *module);
void (*printModule)(void* options);
void (*generateJsonResult)(void* options, struct yyjson_mut_doc* doc, struct yyjson_mut_val* module);
+2
View File
@@ -248,6 +248,8 @@ void ffGenerateBatteryJsonResult(FFBatteryOptions* options, yyjson_mut_doc* doc,
static FFModuleBaseInfo ffModuleInfo = {
.name = FF_BATTERY_MODULE_NAME,
.description = "Print battery capacity, status, etc",
.initOptions = (void*) ffInitBatteryOptions,
.destroyOptions = (void*) ffDestroyBatteryOptions,
.parseJsonObject = (void*) ffParseBatteryJsonObject,
.printModule = (void*) ffPrintBattery,
.generateJsonResult = (void*) ffGenerateBatteryJsonResult,
+2
View File
@@ -131,6 +131,8 @@ exit:
static FFModuleBaseInfo ffModuleInfo = {
.name = FF_BIOS_MODULE_NAME,
.description = "Print information of 1st-stage bootloader (name, version, release date, etc)",
.initOptions = (void*) ffInitBiosOptions,
.destroyOptions = (void*) ffDestroyBiosOptions,
.parseJsonObject = (void*) ffParseBiosJsonObject,
.printModule = (void*) ffPrintBios,
.generateJsonResult = (void*) ffGenerateBiosJsonResult,
+2
View File
@@ -166,6 +166,8 @@ void ffGenerateBluetoothJsonResult(FFBluetoothOptions* options, yyjson_mut_doc*
static FFModuleBaseInfo ffModuleInfo = {
.name = FF_BLUETOOTH_MODULE_NAME,
.description = "List (connected) bluetooth devices",
.initOptions = (void*) ffInitBluetoothOptions,
.destroyOptions = (void*) ffDestroyBluetoothOptions,
.parseJsonObject = (void*) ffParseBluetoothJsonObject,
.printModule = (void*) ffPrintBluetooth,
.generateJsonResult = (void*) ffGenerateBluetoothJsonResult,
@@ -169,6 +169,8 @@ void ffGenerateBluetoothRadioJsonResult(FF_MAYBE_UNUSED FFBluetoothRadioOptions*
static FFModuleBaseInfo ffModuleInfo = {
.name = FF_BLUETOOTHRADIO_MODULE_NAME,
.description = "List bluetooth radios width supported version and vendor",
.initOptions = (void*) ffInitBluetoothRadioOptions,
.destroyOptions = (void*) ffDestroyBluetoothRadioOptions,
.parseJsonObject = (void*) ffParseBluetoothRadioJsonObject,
.printModule = (void*) ffPrintBluetoothRadio,
.generateJsonResult = (void*) ffGenerateBluetoothRadioJsonResult,
+2
View File
@@ -109,6 +109,8 @@ exit:
static FFModuleBaseInfo ffModuleInfo = {
.name = FF_BOARD_MODULE_NAME,
.description = "Print motherboard name and other info",
.initOptions = (void*) ffInitBoardOptions,
.destroyOptions = (void*) ffDestroyBoardOptions,
.parseJsonObject = (void*) ffParseBoardJsonObject,
.printModule = (void*) ffPrintBoard,
.generateJsonResult = (void*) ffGenerateBoardJsonResult,
+2
View File
@@ -100,6 +100,8 @@ exit:
static FFModuleBaseInfo ffModuleInfo = {
.name = FF_BOOTMGR_MODULE_NAME,
.description = "Print information of 2nd-stage bootloader (name, firmware, etc)",
.initOptions = (void*) ffInitBootmgrOptions,
.destroyOptions = (void*) ffDestroyBootmgrOptions,
.parseJsonObject = (void*) ffParseBootmgrJsonObject,
.printModule = (void*) ffPrintBootmgr,
.generateJsonResult = (void*) ffGenerateBootmgrJsonResult,
+2
View File
@@ -24,6 +24,8 @@ void ffParseBreakJsonObject(FF_MAYBE_UNUSED FFBreakOptions* options, FF_MAYBE_UN
static FFModuleBaseInfo ffModuleInfo = {
.name = FF_BREAK_MODULE_NAME,
.description = "Print a empty line",
.initOptions = (void*) ffInitBreakOptions,
.destroyOptions = (void*) ffDestroyBreakOptions,
.parseJsonObject = (void*) ffParseBreakJsonObject,
.printModule = (void*) ffPrintBreak,
};
+2
View File
@@ -190,6 +190,8 @@ void ffGenerateBrightnessJsonResult(FF_MAYBE_UNUSED FFBrightnessOptions* options
static FFModuleBaseInfo ffModuleInfo = {
.name = FF_BRIGHTNESS_MODULE_NAME,
.description = "Print current brightness level of your monitors",
.initOptions = (void*) ffInitBrightnessOptions,
.destroyOptions = (void*) ffDestroyBrightnessOptions,
.parseJsonObject = (void*) ffParseBrightnessJsonObject,
.printModule = (void*) ffPrintBrightness,
.generateJsonResult = (void*) ffGenerateBrightnessJsonResult,
+2
View File
@@ -203,6 +203,8 @@ void ffGenerateBtrfsJsonResult(FF_MAYBE_UNUSED FFBtrfsOptions* options, yyjson_m
static FFModuleBaseInfo ffModuleInfo = {
.name = FF_BTRFS_MODULE_NAME,
.description = "Print Linux BTRFS volumes",
.initOptions = (void*) ffInitBtrfsOptions,
.destroyOptions = (void*) ffDestroyBtrfsOptions,
.parseJsonObject = (void*) ffParseBtrfsJsonObject,
.printModule = (void*) ffPrintBtrfs,
.generateJsonResult = (void*) ffGenerateBtrfsJsonResult,
+2
View File
@@ -123,6 +123,8 @@ void ffGenerateCameraJsonResult(FF_MAYBE_UNUSED FFCameraOptions* options, yyjson
static FFModuleBaseInfo ffModuleInfo = {
.name = FF_CAMERA_MODULE_NAME,
.description = "Print available cameras",
.initOptions = (void*) ffInitCameraOptions,
.destroyOptions = (void*) ffDestroyCameraOptions,
.parseJsonObject = (void*) ffParseCameraJsonObject,
.printModule = (void*) ffPrintCamera,
.generateJsonResult = (void*) ffGenerateCameraJsonResult,
+2
View File
@@ -110,6 +110,8 @@ exit:
static FFModuleBaseInfo ffModuleInfo = {
.name = FF_CHASSIS_MODULE_NAME,
.description = "Print chassis type (desktop, laptop, etc)",
.initOptions = (void*) ffInitChassisOptions,
.destroyOptions = (void*) ffDestroyChassisOptions,
.parseJsonObject = (void*) ffParseChassisJsonObject,
.printModule = (void*) ffPrintChassis,
.generateJsonResult = (void*) ffGenerateChassisJsonResult,
+2
View File
@@ -242,6 +242,8 @@ void ffGenerateColorsJsonConfig(FFColorsOptions* options, yyjson_mut_doc* doc, y
static FFModuleBaseInfo ffModuleInfo = {
.name = FF_COLORS_MODULE_NAME,
.description = "Print some colored blocks",
.initOptions = (void*) ffInitColorsOptions,
.destroyOptions = (void*) ffDestroyColorsOptions,
.parseJsonObject = (void*) ffParseColorsJsonObject,
.printModule = (void*) ffPrintColors,
.generateJsonConfig = (void*) ffGenerateColorsJsonConfig,
+2
View File
@@ -123,6 +123,8 @@ void ffGenerateCommandJsonResult(FF_MAYBE_UNUSED FFCommandOptions* options, yyjs
static FFModuleBaseInfo ffModuleInfo = {
.name = FF_COMMAND_MODULE_NAME,
.description = "Run custom shell scripts",
.initOptions = (void*) ffInitCommandOptions,
.destroyOptions = (void*) ffDestroyCommandOptions,
.parseJsonObject = (void*) ffParseCommandJsonObject,
.printModule = (void*) ffPrintCommand,
.generateJsonResult = (void*) ffGenerateCommandJsonResult,
+2
View File
@@ -215,6 +215,8 @@ void ffGenerateCPUJsonResult(FFCPUOptions* options, yyjson_mut_doc* doc, yyjson_
static FFModuleBaseInfo ffModuleInfo = {
.name = FF_CPU_MODULE_NAME,
.description = "Print CPU name, frequency, etc",
.initOptions = (void*) ffInitCPUOptions,
.destroyOptions = (void*) ffDestroyCPUOptions,
.parseJsonObject = (void*) ffParseCPUJsonObject,
.printModule = (void*) ffPrintCPU,
.generateJsonResult = (void*) ffGenerateCPUJsonResult,
+2
View File
@@ -211,6 +211,8 @@ exit:
static FFModuleBaseInfo ffModuleInfo = {
.name = FF_CPUCACHE_MODULE_NAME,
.description = "Print CPU cache sizes",
.initOptions = (void*) ffInitCPUCacheOptions,
.destroyOptions = (void*) ffDestroyCPUCacheOptions,
.parseJsonObject = (void*) ffParseCPUCacheJsonObject,
.printModule = (void*) ffPrintCPUCache,
.generateJsonResult = (void*) ffGenerateCPUCacheJsonResult,
+2
View File
@@ -177,6 +177,8 @@ void ffGenerateCPUUsageJsonResult(FFCPUUsageOptions* options, yyjson_mut_doc* do
static FFModuleBaseInfo ffModuleInfo = {
.name = FF_CPUUSAGE_MODULE_NAME,
.description = "Print CPU usage. Costs some time to collect data",
.initOptions = (void*) ffInitCPUUsageOptions,
.destroyOptions = (void*) ffDestroyCPUUsageOptions,
.parseJsonObject = (void*) ffParseCPUUsageJsonObject,
.printModule = (void*) ffPrintCPUUsage,
.generateJsonResult = (void*) ffGenerateCPUUsageJsonResult,
+2
View File
@@ -97,6 +97,8 @@ void ffGenerateCursorJsonResult(FF_MAYBE_UNUSED FFCursorOptions* options, yyjson
static FFModuleBaseInfo ffModuleInfo = {
.name = FF_CURSOR_MODULE_NAME,
.description = "Print cursor style name",
.initOptions = (void*) ffInitCursorOptions,
.destroyOptions = (void*) ffDestroyCursorOptions,
.parseJsonObject = (void*) ffParseCursorJsonObject,
.printModule = (void*) ffPrintCursor,
.generateJsonResult = (void*) ffGenerateCursorJsonResult,
+2
View File
@@ -33,6 +33,8 @@ void ffParseCustomJsonObject(FFCustomOptions* options, yyjson_val* module)
static FFModuleBaseInfo ffModuleInfo = {
.name = FF_CUSTOM_MODULE_NAME,
.description = "Print a custom string, with or without key",
.initOptions = (void*) ffInitCustomOptions,
.destroyOptions = (void*) ffDestroyCustomOptions,
.parseJsonObject = (void*) ffParseCustomJsonObject,
.printModule = (void*) ffPrintCustom,
.generateJsonConfig = (void*) ffGenerateCustomJsonConfig,
+2
View File
@@ -146,6 +146,8 @@ void ffGenerateDateTimeJsonResult(FF_MAYBE_UNUSED FFDateTimeOptions* options, yy
static FFModuleBaseInfo ffModuleInfo = {
.name = FF_DATETIME_MODULE_NAME,
.description = "Print current date and time",
.initOptions = (void*) ffInitDateTimeOptions,
.destroyOptions = (void*) ffDestroyDateTimeOptions,
.parseJsonObject = (void*) ffParseDateTimeJsonObject,
.printModule = (void*) ffPrintDateTime,
.generateJsonResult = (void*) ffGenerateDateTimeJsonResult,
+2
View File
@@ -94,6 +94,8 @@ void ffGenerateDEJsonResult(FF_MAYBE_UNUSED FFDEOptions* options, yyjson_mut_doc
static FFModuleBaseInfo ffModuleInfo = {
.name = FF_DE_MODULE_NAME,
.description = "Print desktop environment name",
.initOptions = (void*) ffInitDEOptions,
.destroyOptions = (void*) ffDestroyDEOptions,
.parseJsonObject = (void*) ffParseDEJsonObject,
.printModule = (void*) ffPrintDE,
.generateJsonResult = (void*) ffGenerateDEJsonResult,
+2
View File
@@ -415,6 +415,8 @@ void ffGenerateDiskJsonResult(FFDiskOptions* options, yyjson_mut_doc* doc, yyjso
static FFModuleBaseInfo ffModuleInfo = {
.name = FF_DISK_MODULE_NAME,
.description = "Print partitions, space usage, file system, etc",
.initOptions = (void*) ffInitDiskOptions,
.destroyOptions = (void*) ffDestroyDiskOptions,
.parseJsonObject = (void*) ffParseDiskJsonObject,
.printModule = (void*) ffPrintDisk,
.generateJsonResult = (void*) ffGenerateDiskJsonResult,
+2
View File
@@ -173,6 +173,8 @@ void ffGenerateDiskIOJsonResult(FFDiskIOOptions* options, yyjson_mut_doc* doc, y
static FFModuleBaseInfo ffModuleInfo = {
.name = FF_DISKIO_MODULE_NAME,
.description = "Print physical disk I/O throughput",
.initOptions = (void*) ffInitDiskIOOptions,
.destroyOptions = (void*) ffDestroyDiskIOOptions,
.parseJsonObject = (void*) ffParseDiskIOJsonObject,
.printModule = (void*) ffPrintDiskIO,
.generateJsonResult = (void*) ffGenerateDiskIOJsonResult,
+2
View File
@@ -405,6 +405,8 @@ void ffGenerateDisplayJsonResult(FF_MAYBE_UNUSED FFDisplayOptions* options, yyjs
static FFModuleBaseInfo ffModuleInfo = {
.name = FF_DISPLAY_MODULE_NAME,
.description = "Print resolutions, refresh rates, etc",
.initOptions = (void*) ffInitDisplayOptions,
.destroyOptions = (void*) ffDestroyDisplayOptions,
.parseJsonObject = (void*) ffParseDisplayJsonObject,
.printModule = (void*) ffPrintDisplay,
.generateJsonResult = (void*) ffGenerateDisplayJsonResult,
+2
View File
@@ -142,6 +142,8 @@ exit:
static FFModuleBaseInfo ffModuleInfo = {
.name = FF_DNS_MODULE_NAME,
.description = "Print configured DNS servers",
.initOptions = (void*) ffInitDNSOptions,
.destroyOptions = (void*) ffDestroyDNSOptions,
.parseJsonObject = (void*) ffParseDNSJsonObject,
.printModule = (void*) ffPrintDNS,
.generateJsonResult = (void*) ffGenerateDNSJsonResult,
+2
View File
@@ -107,6 +107,8 @@ void ffGenerateEditorJsonResult(FF_MAYBE_UNUSED FFEditorOptions* options, yyjson
static FFModuleBaseInfo ffModuleInfo = {
.name = FF_EDITOR_MODULE_NAME,
.description = "Print information of the default editor ($VISUAL or $EDITOR)",
.initOptions = (void*) ffInitEditorOptions,
.destroyOptions = (void*) ffDestroyEditorOptions,
.parseJsonObject = (void*) ffParseEditorJsonObject,
.printModule = (void*) ffPrintEditor,
.generateJsonResult = (void*) ffGenerateEditorJsonResult,
+2
View File
@@ -91,6 +91,8 @@ void ffGenerateFontJsonResult(FF_MAYBE_UNUSED FFFontOptions* options, yyjson_mut
static FFModuleBaseInfo ffModuleInfo = {
.name = FF_FONT_MODULE_NAME,
.description = "Print system font names",
.initOptions = (void*) ffInitFontOptions,
.destroyOptions = (void*) ffDestroyFontOptions,
.parseJsonObject = (void*) ffParseFontJsonObject,
.printModule = (void*) ffPrintFont,
.generateJsonResult = (void*) ffGenerateFontJsonResult,
+2
View File
@@ -133,6 +133,8 @@ void ffGenerateGamepadJsonResult(FF_MAYBE_UNUSED FFGamepadOptions* options, yyjs
static FFModuleBaseInfo ffModuleInfo = {
.name = FF_GAMEPAD_MODULE_NAME,
.description = "List (connected) gamepads",
.initOptions = (void*) ffInitGamepadOptions,
.destroyOptions = (void*) ffDestroyGamepadOptions,
.parseJsonObject = (void*) ffParseGamepadJsonObject,
.printModule = (void*) ffPrintGamepad,
.generateJsonResult = (void*) ffGenerateGamepadJsonResult,
+2
View File
@@ -417,6 +417,8 @@ void ffGenerateGPUJsonResult(FFGPUOptions* options, yyjson_mut_doc* doc, yyjson_
static FFModuleBaseInfo ffModuleInfo = {
.name = FF_GPU_MODULE_NAME,
.description = "Print GPU names, graphic memory size, type, etc",
.initOptions = (void*) ffInitGPUOptions,
.destroyOptions = (void*) ffDestroyGPUOptions,
.parseJsonObject = (void*) ffParseGPUJsonObject,
.printModule = (void*) ffPrintGPU,
.generateJsonResult = (void*) ffGenerateGPUJsonResult,
+2
View File
@@ -134,6 +134,8 @@ exit:
static FFModuleBaseInfo ffModuleInfo = {
.name = FF_HOST_MODULE_NAME,
.description = "Print product name of your computer",
.initOptions = (void*) ffInitHostOptions,
.destroyOptions = (void*) ffDestroyHostOptions,
.parseJsonObject = (void*) ffParseHostJsonObject,
.printModule = (void*) ffPrintHost,
.generateJsonResult = (void*) ffGenerateHostJsonResult,
+2
View File
@@ -89,6 +89,8 @@ void ffGenerateIconsJsonResult(FF_MAYBE_UNUSED FFIconsOptions* options, yyjson_m
static FFModuleBaseInfo ffModuleInfo = {
.name = FF_ICONS_MODULE_NAME,
.description = "Print icon style name",
.initOptions = (void*) ffInitIconsOptions,
.destroyOptions = (void*) ffDestroyIconsOptions,
.parseJsonObject = (void*) ffParseIconsJsonObject,
.printModule = (void*) ffPrintIcons,
.generateJsonResult = (void*) ffGenerateIconsJsonResult,
+2
View File
@@ -101,6 +101,8 @@ exit:
static FFModuleBaseInfo ffModuleInfo = {
.name = FF_INITSYSTEM_MODULE_NAME,
.description = "Print init system (pid 1) name and version",
.initOptions = (void*) ffInitInitSystemOptions,
.destroyOptions = (void*) ffDestroyInitSystemOptions,
.parseJsonObject = (void*) ffParseInitSystemJsonObject,
.printModule = (void*) ffPrintInitSystem,
.generateJsonResult = (void*) ffGenerateInitSystemJsonResult,
+2
View File
@@ -69,6 +69,8 @@ void ffGenerateKernelJsonResult(FF_MAYBE_UNUSED FFKernelOptions* options, yyjson
static FFModuleBaseInfo ffModuleInfo = {
.name = FF_KERNEL_MODULE_NAME,
.description = "Print system kernel version",
.initOptions = (void*) ffInitKernelOptions,
.destroyOptions = (void*) ffDestroyKernelOptions,
.parseJsonObject = (void*) ffParseKernelJsonObject,
.printModule = (void*) ffPrintKernel,
.generateJsonResult = (void*) ffGenerateKernelJsonResult,
+2
View File
@@ -99,6 +99,8 @@ void ffGenerateKeyboardJsonResult(FF_MAYBE_UNUSED FFKeyboardOptions* options, yy
static FFModuleBaseInfo ffModuleInfo = {
.name = FF_KEYBOARD_MODULE_NAME,
.description = "List (connected) keyboards",
.initOptions = (void*) ffInitKeyboardOptions,
.destroyOptions = (void*) ffDestroyKeyboardOptions,
.parseJsonObject = (void*) ffParseKeyboardJsonObject,
.printModule = (void*) ffPrintKeyboard,
.generateJsonResult = (void*) ffGenerateKeyboardJsonResult,
+2
View File
@@ -102,6 +102,8 @@ exit:
static FFModuleBaseInfo ffModuleInfo = {
.name = FF_LM_MODULE_NAME,
.description = "Print login manager (desktop manager) name and version",
.initOptions = (void*) ffInitLMOptions,
.destroyOptions = (void*) ffDestroyLMOptions,
.parseJsonObject = (void*) ffParseLMJsonObject,
.printModule = (void*) ffPrintLM,
.generateJsonResult = (void*) ffGenerateLMJsonResult,
+2
View File
@@ -153,6 +153,8 @@ void ffGenerateLoadavgJsonResult(FF_MAYBE_UNUSED FFLoadavgOptions* options, yyjs
static FFModuleBaseInfo ffModuleInfo = {
.name = FF_LOADAVG_MODULE_NAME,
.description = "Print system load averages",
.initOptions = (void*) ffInitLoadavgOptions,
.destroyOptions = (void*) ffDestroyLoadavgOptions,
.parseJsonObject = (void*) ffParseLoadavgJsonObject,
.printModule = (void*) ffPrintLoadavg,
.generateJsonResult = (void*) ffGenerateLoadavgJsonResult,
+2
View File
@@ -66,6 +66,8 @@ void ffGenerateLocaleJsonResult(FF_MAYBE_UNUSED FFLocaleOptions* options, yyjson
static FFModuleBaseInfo ffModuleInfo = {
.name = FF_LOCALE_MODULE_NAME,
.description = "Print system locale name",
.initOptions = (void*) ffInitLocaleOptions,
.destroyOptions = (void*) ffDestroyLocaleOptions,
.parseJsonObject = (void*) ffParseLocaleJsonObject,
.printModule = (void*) ffPrintLocale,
.generateJsonResult = (void*) ffGenerateLocaleJsonResult,
+2
View File
@@ -388,6 +388,8 @@ void ffGenerateLocalIpJsonResult(FF_MAYBE_UNUSED FFLocalIpOptions* options, yyjs
static FFModuleBaseInfo ffModuleInfo = {
.name = FF_LOCALIP_MODULE_NAME,
.description = "List local IP addresses (v4 or v6), MAC addresses, etc",
.initOptions = (void*) ffInitLocalIpOptions,
.destroyOptions = (void*) ffDestroyLocalIpOptions,
.parseJsonObject = (void*) ffParseLocalIpJsonObject,
.printModule = (void*) ffPrintLocalIp,
.generateJsonResult = (void*) ffGenerateLocalIpJsonResult,
+2
View File
@@ -154,6 +154,8 @@ void ffGenerateMediaJsonResult(FF_MAYBE_UNUSED FFMediaOptions* options, yyjson_m
static FFModuleBaseInfo ffModuleInfo = {
.name = FF_MEDIA_MODULE_NAME,
.description = "Print playing song name",
.initOptions = (void*) ffInitMediaOptions,
.destroyOptions = (void*) ffDestroyMediaOptions,
.parseJsonObject = (void*) ffParseMediaJsonObject,
.printModule = (void*) ffPrintMedia,
.generateJsonResult = (void*) ffGenerateMediaJsonResult,
+2
View File
@@ -116,6 +116,8 @@ void ffGenerateMemoryJsonResult(FF_MAYBE_UNUSED FFMemoryOptions* options, yyjson
static FFModuleBaseInfo ffModuleInfo = {
.name = FF_MEMORY_MODULE_NAME,
.description = "Print system memory usage info",
.initOptions = (void*) ffInitMemoryOptions,
.destroyOptions = (void*) ffDestroyMemoryOptions,
.parseJsonObject = (void*) ffParseMemoryJsonObject,
.printModule = (void*) ffPrintMemory,
.generateJsonResult = (void*) ffGenerateMemoryJsonResult,
+2
View File
@@ -115,6 +115,8 @@ void ffGenerateMonitorJsonResult(FF_MAYBE_UNUSED FFMonitorOptions* options, yyjs
static FFModuleBaseInfo ffModuleInfo = {
.name = FF_MONITOR_MODULE_NAME,
.description = "Alias of Display module",
.initOptions = (void*) ffInitMonitorOptions,
.destroyOptions = (void*) ffDestroyMonitorOptions,
.parseJsonObject = (void*) ffParseMonitorJsonObject,
.printModule = (void*) ffPrintMonitor,
.generateJsonResult = (void*) ffGenerateMonitorJsonResult,
+2
View File
@@ -99,6 +99,8 @@ void ffGenerateMouseJsonResult(FF_MAYBE_UNUSED FFMouseOptions* options, yyjson_m
static FFModuleBaseInfo ffModuleInfo = {
.name = FF_MOUSE_MODULE_NAME,
.description = "List connected mouses",
.initOptions = (void*) ffInitMouseOptions,
.destroyOptions = (void*) ffDestroyMouseOptions,
.parseJsonObject = (void*) ffParseMouseJsonObject,
.printModule = (void*) ffPrintMouse,
.generateJsonResult = (void*) ffGenerateMouseJsonResult,
+2
View File
@@ -193,6 +193,8 @@ void ffGenerateNetIOJsonResult(FFNetIOOptions* options, yyjson_mut_doc* doc, yyj
static FFModuleBaseInfo ffModuleInfo = {
.name = FF_NETIO_MODULE_NAME,
.description = "Print network I/O throughput",
.initOptions = (void*) ffInitNetIOOptions,
.destroyOptions = (void*) ffDestroyNetIOOptions,
.parseJsonObject = (void*) ffParseNetIOJsonObject,
.printModule = (void*) ffPrintNetIO,
.generateJsonResult = (void*) ffGenerateNetIOJsonResult,
+2
View File
@@ -117,6 +117,8 @@ void ffGenerateOpenCLJsonResult(FF_MAYBE_UNUSED FFOpenCLOptions* options, yyjson
static FFModuleBaseInfo ffModuleInfo = {
.name = FF_OPENCL_MODULE_NAME,
.description = "Print highest OpenCL version supported by the GPU",
.initOptions = (void*) ffInitOpenCLOptions,
.destroyOptions = (void*) ffDestroyOpenCLOptions,
.parseJsonObject = (void*) ffParseOpenCLJsonObject,
.printModule = (void*) ffPrintOpenCL,
.generateJsonResult = (void*) ffGenerateOpenCLJsonResult,
+2
View File
@@ -130,6 +130,8 @@ void ffGenerateOpenGLJsonResult(FF_MAYBE_UNUSED FFOpenGLOptions* options, yyjson
static FFModuleBaseInfo ffModuleInfo = {
.name = FF_OPENGL_MODULE_NAME,
.description = "Print highest OpenGL version supported by the GPU",
.initOptions = (void*) ffInitOpenGLOptions,
.destroyOptions = (void*) ffDestroyOpenGLOptions,
.parseJsonObject = (void*) ffParseOpenGLJsonObject,
.printModule = (void*) ffPrintOpenGL,
.generateJsonResult = (void*) ffGenerateOpenGLJsonResult,
+2
View File
@@ -162,6 +162,8 @@ void ffGenerateOSJsonResult(FF_MAYBE_UNUSED FFOSOptions* options, yyjson_mut_doc
static FFModuleBaseInfo ffModuleInfo = {
.name = FF_OS_MODULE_NAME,
.description = "Print operating system name and version",
.initOptions = (void*) ffInitOSOptions,
.destroyOptions = (void*) ffDestroyOSOptions,
.parseJsonObject = (void*) ffParseOSJsonObject,
.printModule = (void*) ffPrintOS,
.generateJsonResult = (void*) ffGenerateOSJsonResult,
+2
View File
@@ -434,6 +434,8 @@ void ffGeneratePackagesJsonResult(FF_MAYBE_UNUSED FFPackagesOptions* options, yy
static FFModuleBaseInfo ffModuleInfo = {
.name = FF_PACKAGES_MODULE_NAME,
.description = "List installed package managers and count of installed packages",
.initOptions = (void*) ffInitPackagesOptions,
.destroyOptions = (void*) ffDestroyPackagesOptions,
.parseJsonObject = (void*) ffParsePackagesJsonObject,
.printModule = (void*) ffPrintPackages,
.generateJsonResult = (void*) ffGeneratePackagesJsonResult,
+2
View File
@@ -229,6 +229,8 @@ void ffGeneratePhysicalDiskJsonResult(FFPhysicalDiskOptions* options, yyjson_mut
static FFModuleBaseInfo ffModuleInfo = {
.name = FF_PHYSICALDISK_MODULE_NAME,
.description = "Print physical disk information",
.initOptions = (void*) ffInitPhysicalDiskOptions,
.destroyOptions = (void*) ffDestroyPhysicalDiskOptions,
.parseJsonObject = (void*) ffParsePhysicalDiskJsonObject,
.printModule = (void*) ffPrintPhysicalDisk,
.generateJsonResult = (void*) ffGeneratePhysicalDiskJsonResult,
@@ -142,6 +142,8 @@ void ffGeneratePhysicalMemoryJsonResult(FF_MAYBE_UNUSED FFPhysicalMemoryOptions*
static FFModuleBaseInfo ffModuleInfo = {
.name = FF_PHYSICALMEMORY_MODULE_NAME,
.description = "Print system physical memory devices",
.initOptions = (void*) ffInitPhysicalMemoryOptions,
.destroyOptions = (void*) ffDestroyPhysicalMemoryOptions,
.parseJsonObject = (void*) ffParsePhysicalMemoryJsonObject,
.printModule = (void*) ffPrintPhysicalMemory,
.generateJsonConfig = (void*) ffGeneratePhysicalMemoryJsonConfig,
+2
View File
@@ -110,6 +110,8 @@ void ffGeneratePlayerJsonResult(FF_MAYBE_UNUSED FFMediaOptions* options, yyjson_
static FFModuleBaseInfo ffModuleInfo = {
.name = FF_PLAYER_MODULE_NAME,
.description = "Print music player name",
.initOptions = (void*) ffInitPlayerOptions,
.destroyOptions = (void*) ffDestroyPlayerOptions,
.parseJsonObject = (void*) ffParsePlayerJsonObject,
.printModule = (void*) ffPrintPlayer,
.generateJsonResult = (void*) ffGeneratePlayerJsonResult,
+2
View File
@@ -114,6 +114,8 @@ void ffGeneratePowerAdapterJsonResult(FF_MAYBE_UNUSED FFPowerAdapterOptions* opt
static FFModuleBaseInfo ffModuleInfo = {
.name = FF_POWERADAPTER_MODULE_NAME,
.description = "Print power adapter name and charging watts",
.initOptions = (void*) ffInitPowerAdapterOptions,
.destroyOptions = (void*) ffDestroyPowerAdapterOptions,
.parseJsonObject = (void*) ffParsePowerAdapterJsonObject,
.printModule = (void*) ffPrintPowerAdapter,
.generateJsonResult = (void*) ffGeneratePowerAdapterJsonResult,
+2
View File
@@ -67,6 +67,8 @@ void ffGenerateProcessesJsonResult(FF_MAYBE_UNUSED FFProcessesOptions* options,
static FFModuleBaseInfo ffModuleInfo = {
.name = FF_PROCESSES_MODULE_NAME,
.description = "Print number of running processes",
.initOptions = (void*) ffInitProcessesOptions,
.destroyOptions = (void*) ffDestroyProcessesOptions,
.parseJsonObject = (void*) ffParseProcessesJsonObject,
.printModule = (void*) ffPrintProcesses,
.generateJsonResult = (void*) ffGenerateProcessesJsonResult,
+2
View File
@@ -111,6 +111,8 @@ void ffGeneratePublicIpJsonResult(FFPublicIpOptions* options, yyjson_mut_doc* do
static FFModuleBaseInfo ffModuleInfo = {
.name = FF_PUBLICIP_MODULE_NAME,
.description = "Print your public IP address, etc",
.initOptions = (void*) ffInitPublicIpOptions,
.destroyOptions = (void*) ffDestroyPublicIpOptions,
.parseJsonObject = (void*) ffParsePublicIpJsonObject,
.printModule = (void*) ffPrintPublicIp,
.generateJsonResult = (void*) ffGeneratePublicIpJsonResult,
+2
View File
@@ -157,6 +157,8 @@ void ffGenerateSeparatorJsonConfig(FFSeparatorOptions* options, yyjson_mut_doc*
static FFModuleBaseInfo ffModuleInfo = {
.name = FF_SEPARATOR_MODULE_NAME,
.description = "Print a separator line",
.initOptions = (void*) ffInitSeparatorOptions,
.destroyOptions = (void*) ffDestroySeparatorOptions,
.parseJsonObject = (void*) ffParseSeparatorJsonObject,
.printModule = (void*) ffPrintSeparator,
.generateJsonConfig = (void*) ffGenerateSeparatorJsonConfig,
+2
View File
@@ -91,6 +91,8 @@ void ffGenerateShellJsonResult(FF_MAYBE_UNUSED FFShellOptions* options, yyjson_m
static FFModuleBaseInfo ffModuleInfo = {
.name = FF_SHELL_MODULE_NAME,
.description = "Print current shell name and version",
.initOptions = (void*) ffInitShellOptions,
.destroyOptions = (void*) ffDestroyShellOptions,
.parseJsonObject = (void*) ffParseShellJsonObject,
.printModule = (void*) ffPrintShell,
.generateJsonResult = (void*) ffGenerateShellJsonResult,
+2
View File
@@ -209,6 +209,8 @@ void ffGenerateSoundJsonResult(FF_MAYBE_UNUSED FFSoundOptions* options, yyjson_m
static FFModuleBaseInfo ffModuleInfo = {
.name = FF_SOUND_MODULE_NAME,
.description = "Print sound devices, volume, etc",
.initOptions = (void*) ffInitSoundOptions,
.destroyOptions = (void*) ffDestroySoundOptions,
.parseJsonObject = (void*) ffParseSoundJsonObject,
.printModule = (void*) ffPrintSound,
.generateJsonResult = (void*) ffGenerateSoundJsonResult,
+2
View File
@@ -192,6 +192,8 @@ void ffGenerateSwapJsonResult(FF_MAYBE_UNUSED FFSwapOptions* options, yyjson_mut
static FFModuleBaseInfo ffModuleInfo = {
.name = FF_SWAP_MODULE_NAME,
.description = "Print swap (paging file) space usage",
.initOptions = (void*) ffInitSwapOptions,
.destroyOptions = (void*) ffDestroySwapOptions,
.parseJsonObject = (void*) ffParseSwapJsonObject,
.printModule = (void*) ffPrintSwap,
.generateJsonResult = (void*) ffGenerateSwapJsonResult,
+2
View File
@@ -84,6 +84,8 @@ void ffGenerateTerminalJsonResult(FF_MAYBE_UNUSED FFTerminalOptions* options, yy
static FFModuleBaseInfo ffModuleInfo = {
.name = FF_TERMINAL_MODULE_NAME,
.description = "Print current terminal name and version",
.initOptions = (void*) ffInitTerminalOptions,
.destroyOptions = (void*) ffDestroyTerminalOptions,
.parseJsonObject = (void*) ffParseTerminalJsonObject,
.printModule = (void*) ffPrintTerminal,
.generateJsonResult = (void*) ffGenerateTerminalJsonResult,
+2
View File
@@ -109,6 +109,8 @@ void ffGenerateTerminalFontJsonResult(FF_MAYBE_UNUSED FFTerminalOptions* options
static FFModuleBaseInfo ffModuleInfo = {
.name = FF_TERMINALFONT_MODULE_NAME,
.description = "Print font name and size used by current terminal",
.initOptions = (void*) ffInitTerminalFontOptions,
.destroyOptions = (void*) ffDestroyTerminalFontOptions,
.parseJsonObject = (void*) ffParseTerminalFontJsonObject,
.printModule = (void*) ffPrintTerminalFont,
.generateJsonResult = (void*) ffGenerateTerminalFontJsonResult,
+2
View File
@@ -79,6 +79,8 @@ void ffGenerateTerminalSizeJsonResult(FF_MAYBE_UNUSED FFTerminalOptions* options
static FFModuleBaseInfo ffModuleInfo = {
.name = FF_TERMINALSIZE_MODULE_NAME,
.description = "Print current terminal size",
.initOptions = (void*) ffInitTerminalSizeOptions,
.destroyOptions = (void*) ffDestroyTerminalSizeOptions,
.parseJsonObject = (void*) ffParseTerminalSizeJsonObject,
.printModule = (void*) ffPrintTerminalSize,
.generateJsonResult = (void*) ffGenerateTerminalSizeJsonResult,
@@ -92,6 +92,8 @@ void ffGenerateTerminalThemeJsonResult(FF_MAYBE_UNUSED FFTerminalOptions* option
static FFModuleBaseInfo ffModuleInfo = {
.name = FF_TERMINALTHEME_MODULE_NAME,
.description = "Print current terminal theme (foreground and background colors)",
.initOptions = (void*) ffInitTerminalThemeOptions,
.destroyOptions = (void*) ffDestroyTerminalThemeOptions,
.parseJsonObject = (void*) ffParseTerminalThemeJsonObject,
.printModule = (void*) ffPrintTerminalTheme,
.generateJsonResult = (void*) ffGenerateTerminalThemeJsonResult,
+2
View File
@@ -89,6 +89,8 @@ void ffGenerateThemeJsonResult(FF_MAYBE_UNUSED FFThemeOptions* options, yyjson_m
static FFModuleBaseInfo ffModuleInfo = {
.name = FF_THEME_MODULE_NAME,
.description = "Print current theme of desktop environment",
.initOptions = (void*) ffInitThemeOptions,
.destroyOptions = (void*) ffDestroyThemeOptions,
.parseJsonObject = (void*) ffParseThemeJsonObject,
.printModule = (void*) ffPrintTheme,
.generateJsonResult = (void*) ffGenerateThemeJsonResult,
+2
View File
@@ -143,6 +143,8 @@ void ffGenerateTitleJsonResult(FF_MAYBE_UNUSED FFTitleOptions* options, yyjson_m
static FFModuleBaseInfo ffModuleInfo = {
.name = FF_TITLE_MODULE_NAME,
.description = "Print title, which contains your user name, hostname",
.initOptions = (void*) ffInitTitleOptions,
.destroyOptions = (void*) ffDestroyTitleOptions,
.parseJsonObject = (void*) ffParseTitleJsonObject,
.printModule = (void*) ffPrintTitle,
.generateJsonResult = (void*) ffGenerateTitleJsonResult,
+2
View File
@@ -84,6 +84,8 @@ void ffGenerateTPMJsonResult(FF_MAYBE_UNUSED FFTerminalOptions* options, yyjson_
static FFModuleBaseInfo ffModuleInfo = {
.name = FF_TPM_MODULE_NAME,
.description = "Print info of Trusted Platform Module (TPM) Security Device",
.initOptions = (void*) ffInitTPMOptions,
.destroyOptions = (void*) ffDestroyTPMOptions,
.parseJsonObject = (void*) ffParseTPMJsonObject,
.printModule = (void*) ffPrintTPM,
.generateJsonResult = (void*) ffGenerateTPMJsonResult,
+2
View File
@@ -96,6 +96,8 @@ void ffGenerateUptimeJsonResult(FF_MAYBE_UNUSED FFUptimeOptions* options, yyjson
static FFModuleBaseInfo ffModuleInfo = {
.name = FF_UPTIME_MODULE_NAME,
.description = "Print how long system has been running",
.initOptions = (void*) ffInitUptimeOptions,
.destroyOptions = (void*) ffDestroyUptimeOptions,
.parseJsonObject = (void*) ffParseUptimeJsonObject,
.printModule = (void*) ffPrintUptime,
.generateJsonResult = (void*) ffGenerateUptimeJsonResult,
+2
View File
@@ -188,6 +188,8 @@ void ffGenerateUsersJsonResult(FFUsersOptions* options, yyjson_mut_doc* doc, yyj
static FFModuleBaseInfo ffModuleInfo = {
.name = FF_USERS_MODULE_NAME,
.description = "Print users currently logged in",
.initOptions = (void*) ffInitUsersOptions,
.destroyOptions = (void*) ffDestroyUsersOptions,
.parseJsonObject = (void*) ffParseUsersJsonObject,
.printModule = (void*) ffPrintUsers,
.generateJsonResult = (void*) ffGenerateUsersJsonResult,
+2
View File
@@ -100,6 +100,8 @@ void ffGenerateVersionJsonResult(FF_MAYBE_UNUSED FFVersionOptions* options, yyjs
static FFModuleBaseInfo ffModuleInfo = {
.name = FF_VERSION_MODULE_NAME,
.description = "Print Fastfetch version",
.initOptions = (void*) ffInitVersionOptions,
.destroyOptions = (void*) ffDestroyVersionOptions,
.parseJsonObject = (void*) ffParseVersionJsonObject,
.printModule = (void*) ffPrintVersion,
.generateJsonResult = (void*) ffGenerateVersionJsonResult,
+2
View File
@@ -131,6 +131,8 @@ void ffGenerateVulkanJsonResult(FF_MAYBE_UNUSED FFVulkanOptions* options, yyjson
static FFModuleBaseInfo ffModuleInfo = {
.name = FF_VULKAN_MODULE_NAME,
.description = "Print highest Vulkan version supported by the GPU",
.initOptions = (void*) ffInitVulkanOptions,
.destroyOptions = (void*) ffDestroyVulkanOptions,
.parseJsonObject = (void*) ffParseVulkanJsonObject,
.printModule = (void*) ffPrintVulkan,
.generateJsonResult = (void*) ffGenerateVulkanJsonResult,
+2
View File
@@ -76,6 +76,8 @@ void ffGenerateWallpaperJsonResult(FF_MAYBE_UNUSED FFWallpaperOptions* options,
static FFModuleBaseInfo ffModuleInfo = {
.name = FF_WALLPAPER_MODULE_NAME,
.description = "Print image file path of current wallpaper",
.initOptions = (void*) ffInitWallpaperOptions,
.destroyOptions = (void*) ffDestroyWallpaperOptions,
.parseJsonObject = (void*) ffParseWallpaperJsonObject,
.printModule = (void*) ffPrintWallpaper,
.generateJsonResult = (void*) ffGenerateWallpaperJsonResult,
+2
View File
@@ -94,6 +94,8 @@ void ffGenerateWeatherJsonResult(FFWeatherOptions* options, yyjson_mut_doc* doc,
static FFModuleBaseInfo ffModuleInfo = {
.name = FF_WEATHER_MODULE_NAME,
.description = "Print weather information",
.initOptions = (void*) ffInitWeatherOptions,
.destroyOptions = (void*) ffDestroyWeatherOptions,
.parseJsonObject = (void*) ffParseWeatherJsonObject,
.printModule = (void*) ffPrintWeather,
.generateJsonResult = (void*) ffGenerateWeatherJsonResult,
+2
View File
@@ -209,6 +209,8 @@ void ffGenerateWifiJsonResult(FF_MAYBE_UNUSED FFWifiOptions* options, yyjson_mut
static FFModuleBaseInfo ffModuleInfo = {
.name = FF_WIFI_MODULE_NAME,
.description = "Print connected Wi-Fi info (SSID, connection and security protocol)",
.initOptions = (void*) ffInitWifiOptions,
.destroyOptions = (void*) ffDestroyWifiOptions,
.parseJsonObject = (void*) ffParseWifiJsonObject,
.printModule = (void*) ffPrintWifi,
.generateJsonResult = (void*) ffGenerateWifiJsonResult,
+2
View File
@@ -122,6 +122,8 @@ void ffGenerateWMJsonResult(FF_MAYBE_UNUSED FFWMOptions* options, yyjson_mut_doc
static FFModuleBaseInfo ffModuleInfo = {
.name = FF_WM_MODULE_NAME,
.description = "Print window manager name and version",
.initOptions = (void*) ffInitWMOptions,
.destroyOptions = (void*) ffDestroyWMOptions,
.parseJsonObject = (void*) ffParseWMJsonObject,
.printModule = (void*) ffPrintWM,
.generateJsonResult = (void*) ffGenerateWMJsonResult,
+2
View File
@@ -65,6 +65,8 @@ void ffGenerateWMThemeJsonResult(FF_MAYBE_UNUSED FFWMThemeOptions* options, yyjs
static FFModuleBaseInfo ffModuleInfo = {
.name = FF_WMTHEME_MODULE_NAME,
.description = "Print current theme of window manager",
.initOptions = (void*) ffInitWMThemeOptions,
.destroyOptions = (void*) ffDestroyWMThemeOptions,
.parseJsonObject = (void*) ffParseWMThemeJsonObject,
.printModule = (void*) ffPrintWMTheme,
.generateJsonResult = (void*) ffGenerateWMThemeJsonResult,
+2
View File
@@ -167,6 +167,8 @@ void ffGenerateZpoolJsonResult(FF_MAYBE_UNUSED FFZpoolOptions* options, yyjson_m
static FFModuleBaseInfo ffModuleInfo = {
.name = FF_ZPOOL_MODULE_NAME,
.description = "Print ZFS storage pools",
.initOptions = (void*) ffInitZpoolOptions,
.destroyOptions = (void*) ffDestroyZpoolOptions,
.parseJsonObject = (void*) ffParseZpoolJsonObject,
.printModule = (void*) ffPrintZpool,
.generateJsonResult = (void*) ffGenerateZpoolJsonResult,