mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-09-12 10:22:12 +02:00
Global: renames FFformatArgType to FFArgType for future reuse
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
#pragma once
|
||||
|
||||
#include "common/FFstrbuf.h"
|
||||
|
||||
typedef enum __attribute__((__packed__)) FFArgType
|
||||
{
|
||||
FF_ARG_TYPE_NULL = 0,
|
||||
FF_ARG_TYPE_UINT,
|
||||
FF_ARG_TYPE_UINT64,
|
||||
FF_ARG_TYPE_UINT16,
|
||||
FF_ARG_TYPE_UINT8,
|
||||
FF_ARG_TYPE_INT,
|
||||
FF_ARG_TYPE_STRING,
|
||||
FF_ARG_TYPE_STRBUF,
|
||||
FF_ARG_TYPE_FLOAT,
|
||||
FF_ARG_TYPE_DOUBLE,
|
||||
FF_ARG_TYPE_LIST,
|
||||
FF_ARG_TYPE_BOOL
|
||||
} FFArgType;
|
||||
|
||||
#define FF_ARG(variable, var_name) { _Generic((variable), \
|
||||
uint32_t: FF_ARG_TYPE_UINT, \
|
||||
uint64_t: FF_ARG_TYPE_UINT64, \
|
||||
uint16_t: FF_ARG_TYPE_UINT16, \
|
||||
uint8_t: FF_ARG_TYPE_UINT8, \
|
||||
int32_t: FF_ARG_TYPE_INT, \
|
||||
char*: FF_ARG_TYPE_STRING, \
|
||||
const char*: FF_ARG_TYPE_STRING, \
|
||||
FFstrbuf: FF_ARG_TYPE_STRBUF, \
|
||||
float: FF_ARG_TYPE_FLOAT, \
|
||||
double: FF_ARG_TYPE_DOUBLE, \
|
||||
FFlist: FF_ARG_TYPE_LIST, \
|
||||
bool: FF_ARG_TYPE_BOOL \
|
||||
), _Generic((variable), char*: (variable), const char*: (variable), default: &(variable) ), (var_name) }
|
||||
+2
-33
@@ -1,41 +1,10 @@
|
||||
#pragma once
|
||||
|
||||
#include "common/FFstrbuf.h"
|
||||
|
||||
typedef enum __attribute__((__packed__)) FFformatArgType
|
||||
{
|
||||
FF_FORMAT_ARG_TYPE_NULL = 0,
|
||||
FF_FORMAT_ARG_TYPE_UINT,
|
||||
FF_FORMAT_ARG_TYPE_UINT64,
|
||||
FF_FORMAT_ARG_TYPE_UINT16,
|
||||
FF_FORMAT_ARG_TYPE_UINT8,
|
||||
FF_FORMAT_ARG_TYPE_INT,
|
||||
FF_FORMAT_ARG_TYPE_STRING,
|
||||
FF_FORMAT_ARG_TYPE_STRBUF,
|
||||
FF_FORMAT_ARG_TYPE_FLOAT,
|
||||
FF_FORMAT_ARG_TYPE_DOUBLE,
|
||||
FF_FORMAT_ARG_TYPE_LIST,
|
||||
FF_FORMAT_ARG_TYPE_BOOL
|
||||
} FFformatArgType;
|
||||
|
||||
#define FF_FORMAT_ARG(variable, var_name) { _Generic((variable), \
|
||||
uint32_t: FF_FORMAT_ARG_TYPE_UINT, \
|
||||
uint64_t: FF_FORMAT_ARG_TYPE_UINT64, \
|
||||
uint16_t: FF_FORMAT_ARG_TYPE_UINT16, \
|
||||
uint8_t: FF_FORMAT_ARG_TYPE_UINT8, \
|
||||
int32_t: FF_FORMAT_ARG_TYPE_INT, \
|
||||
char*: FF_FORMAT_ARG_TYPE_STRING, \
|
||||
const char*: FF_FORMAT_ARG_TYPE_STRING, \
|
||||
FFstrbuf: FF_FORMAT_ARG_TYPE_STRBUF, \
|
||||
float: FF_FORMAT_ARG_TYPE_FLOAT, \
|
||||
double: FF_FORMAT_ARG_TYPE_DOUBLE, \
|
||||
FFlist: FF_FORMAT_ARG_TYPE_LIST, \
|
||||
bool: FF_FORMAT_ARG_TYPE_BOOL \
|
||||
), _Generic((variable), char*: (variable), const char*: (variable), default: &(variable) ), (var_name) }
|
||||
#include "common/argType.h"
|
||||
|
||||
typedef struct FFformatarg
|
||||
{
|
||||
FFformatArgType type;
|
||||
FFArgType type;
|
||||
const void* value;
|
||||
const char* name; // argument name, must start with an alphabet
|
||||
} FFformatarg;
|
||||
|
||||
+22
-22
@@ -10,37 +10,37 @@ void ffFormatAppendFormatArg(FFstrbuf* buffer, const FFformatarg* formatarg)
|
||||
{
|
||||
switch(formatarg->type)
|
||||
{
|
||||
case FF_FORMAT_ARG_TYPE_INT:
|
||||
case FF_ARG_TYPE_INT:
|
||||
ffStrbufAppendSInt(buffer, *(int32_t*)formatarg->value);
|
||||
break;
|
||||
case FF_FORMAT_ARG_TYPE_UINT:
|
||||
case FF_ARG_TYPE_UINT:
|
||||
ffStrbufAppendUInt(buffer, *(uint32_t*)formatarg->value);
|
||||
break;
|
||||
case FF_FORMAT_ARG_TYPE_UINT64:
|
||||
case FF_ARG_TYPE_UINT64:
|
||||
ffStrbufAppendUInt(buffer, *(uint64_t*)formatarg->value);
|
||||
break;
|
||||
case FF_FORMAT_ARG_TYPE_UINT16:
|
||||
case FF_ARG_TYPE_UINT16:
|
||||
ffStrbufAppendUInt(buffer, *(uint16_t*)formatarg->value);
|
||||
break;
|
||||
case FF_FORMAT_ARG_TYPE_UINT8:
|
||||
case FF_ARG_TYPE_UINT8:
|
||||
ffStrbufAppendUInt(buffer, *(uint8_t*)formatarg->value);
|
||||
break;
|
||||
case FF_FORMAT_ARG_TYPE_STRING:
|
||||
case FF_ARG_TYPE_STRING:
|
||||
ffStrbufAppendS(buffer, (const char*)formatarg->value);
|
||||
break;
|
||||
case FF_FORMAT_ARG_TYPE_STRBUF:
|
||||
case FF_ARG_TYPE_STRBUF:
|
||||
ffStrbufAppend(buffer, (const FFstrbuf*)formatarg->value);
|
||||
break;
|
||||
case FF_FORMAT_ARG_TYPE_FLOAT:
|
||||
case FF_ARG_TYPE_FLOAT:
|
||||
ffStrbufAppendDouble(buffer, *(float*)formatarg->value, instance.config.display.fractionNdigits, instance.config.display.fractionTrailingZeros != FF_FRACTION_TRAILING_ZEROS_TYPE_NEVER);
|
||||
break;
|
||||
case FF_FORMAT_ARG_TYPE_DOUBLE:
|
||||
case FF_ARG_TYPE_DOUBLE:
|
||||
ffStrbufAppendDouble(buffer, *(double*)formatarg->value, instance.config.display.fractionNdigits, instance.config.display.fractionTrailingZeros != FF_FRACTION_TRAILING_ZEROS_TYPE_NEVER);
|
||||
break;
|
||||
case FF_FORMAT_ARG_TYPE_BOOL:
|
||||
case FF_ARG_TYPE_BOOL:
|
||||
ffStrbufAppendS(buffer, *(bool*)formatarg->value ? "true" : "false");
|
||||
break;
|
||||
case FF_FORMAT_ARG_TYPE_LIST:
|
||||
case FF_ARG_TYPE_LIST:
|
||||
{
|
||||
const FFlist* list = (const FFlist*) formatarg->value;
|
||||
for(uint32_t i = 0; i < list->length; i++)
|
||||
@@ -52,7 +52,7 @@ void ffFormatAppendFormatArg(FFstrbuf* buffer, const FFformatarg* formatarg)
|
||||
break;
|
||||
}
|
||||
default:
|
||||
if(formatarg->type != FF_FORMAT_ARG_TYPE_NULL)
|
||||
if(formatarg->type != FF_ARG_TYPE_NULL)
|
||||
fprintf(stderr, "Error: format string \"%s\": argument is not implemented: %i\n", buffer->chars, formatarg->type);
|
||||
break;
|
||||
}
|
||||
@@ -107,16 +107,16 @@ static inline void appendInvalidPlaceholder(FFstrbuf* buffer, const char* start,
|
||||
static inline bool formatArgSet(const FFformatarg* arg)
|
||||
{
|
||||
return arg->value != NULL && (
|
||||
(arg->type == FF_FORMAT_ARG_TYPE_DOUBLE && *(double*)arg->value > 0.0) ||
|
||||
(arg->type == FF_FORMAT_ARG_TYPE_FLOAT && *(float*)arg->value > 0.0) ||
|
||||
(arg->type == FF_FORMAT_ARG_TYPE_INT && *(int*)arg->value > 0) ||
|
||||
(arg->type == FF_FORMAT_ARG_TYPE_STRBUF && ((FFstrbuf*)arg->value)->length > 0) ||
|
||||
(arg->type == FF_FORMAT_ARG_TYPE_STRING && ffStrSet((char*)arg->value)) ||
|
||||
(arg->type == FF_FORMAT_ARG_TYPE_UINT8 && *(uint8_t*)arg->value > 0) ||
|
||||
(arg->type == FF_FORMAT_ARG_TYPE_UINT16 && *(uint16_t*)arg->value > 0) ||
|
||||
(arg->type == FF_FORMAT_ARG_TYPE_UINT && *(uint32_t*)arg->value > 0) ||
|
||||
(arg->type == FF_FORMAT_ARG_TYPE_BOOL && *(bool*)arg->value) ||
|
||||
(arg->type == FF_FORMAT_ARG_TYPE_LIST && ((FFlist*)arg->value)->length > 0)
|
||||
(arg->type == FF_ARG_TYPE_DOUBLE && *(double*)arg->value > 0.0) ||
|
||||
(arg->type == FF_ARG_TYPE_FLOAT && *(float*)arg->value > 0.0) ||
|
||||
(arg->type == FF_ARG_TYPE_INT && *(int*)arg->value > 0) ||
|
||||
(arg->type == FF_ARG_TYPE_STRBUF && ((FFstrbuf*)arg->value)->length > 0) ||
|
||||
(arg->type == FF_ARG_TYPE_STRING && ffStrSet((char*)arg->value)) ||
|
||||
(arg->type == FF_ARG_TYPE_UINT8 && *(uint8_t*)arg->value > 0) ||
|
||||
(arg->type == FF_ARG_TYPE_UINT16 && *(uint16_t*)arg->value > 0) ||
|
||||
(arg->type == FF_ARG_TYPE_UINT && *(uint32_t*)arg->value > 0) ||
|
||||
(arg->type == FF_ARG_TYPE_BOOL && *(bool*)arg->value) ||
|
||||
(arg->type == FF_ARG_TYPE_LIST && ((FFlist*)arg->value)->length > 0)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -47,8 +47,8 @@ void ffPrintLogoAndKey(const char* moduleName, uint8_t moduleIndex, const FFModu
|
||||
{
|
||||
FF_STRBUF_AUTO_DESTROY key = ffStrbufCreate();
|
||||
FF_PARSE_FORMAT_STRING_CHECKED(&key, &moduleArgs->key, ((FFformatarg[]) {
|
||||
FF_FORMAT_ARG(moduleIndex, "index"),
|
||||
FF_FORMAT_ARG(moduleArgs->keyIcon, "icon"),
|
||||
FF_ARG(moduleIndex, "index"),
|
||||
FF_ARG(moduleArgs->keyIcon, "icon"),
|
||||
}));
|
||||
ffStrbufWriteTo(&key, stdout);
|
||||
}
|
||||
|
||||
@@ -21,9 +21,9 @@ static void printBattery(FFBatteryOptions* options, FFBatteryResult* result, uin
|
||||
{
|
||||
ffStrbufClear(&key);
|
||||
FF_PARSE_FORMAT_STRING_CHECKED(&key, &options->moduleArgs.key, ((FFformatarg[]) {
|
||||
FF_FORMAT_ARG(index, "index"),
|
||||
FF_FORMAT_ARG(result->modelName, "name"),
|
||||
FF_FORMAT_ARG(options->moduleArgs.keyIcon, "icon"),
|
||||
FF_ARG(index, "index"),
|
||||
FF_ARG(result->modelName, "name"),
|
||||
FF_ARG(options->moduleArgs.keyIcon, "icon"),
|
||||
}));
|
||||
}
|
||||
|
||||
@@ -106,21 +106,21 @@ static void printBattery(FFBatteryOptions* options, FFBatteryResult* result, uin
|
||||
ffDurationAppendNum((uint32_t) result->timeRemaining, &timeStr);
|
||||
|
||||
FF_PRINT_FORMAT_CHECKED(key.chars, 0, &options->moduleArgs, FF_PRINT_TYPE_NO_CUSTOM_KEY, ((FFformatarg[]) {
|
||||
FF_FORMAT_ARG(result->manufacturer, "manufacturer"),
|
||||
FF_FORMAT_ARG(result->modelName, "model-name"),
|
||||
FF_FORMAT_ARG(result->technology, "technology"),
|
||||
FF_FORMAT_ARG(capacityNum, "capacity"),
|
||||
FF_FORMAT_ARG(result->status, "status"),
|
||||
FF_FORMAT_ARG(tempStr, "temperature"),
|
||||
FF_FORMAT_ARG(result->cycleCount, "cycle-count"),
|
||||
FF_FORMAT_ARG(result->serial, "serial"),
|
||||
FF_FORMAT_ARG(result->manufactureDate, "manufacture-date"),
|
||||
FF_FORMAT_ARG(capacityBar, "capacity-bar"),
|
||||
FF_FORMAT_ARG(days, "time-days"),
|
||||
FF_FORMAT_ARG(hours, "time-hours"),
|
||||
FF_FORMAT_ARG(minutes, "time-minutes"),
|
||||
FF_FORMAT_ARG(seconds, "time-seconds"),
|
||||
FF_FORMAT_ARG(timeStr, "time-formatted"),
|
||||
FF_ARG(result->manufacturer, "manufacturer"),
|
||||
FF_ARG(result->modelName, "model-name"),
|
||||
FF_ARG(result->technology, "technology"),
|
||||
FF_ARG(capacityNum, "capacity"),
|
||||
FF_ARG(result->status, "status"),
|
||||
FF_ARG(tempStr, "temperature"),
|
||||
FF_ARG(result->cycleCount, "cycle-count"),
|
||||
FF_ARG(result->serial, "serial"),
|
||||
FF_ARG(result->manufactureDate, "manufacture-date"),
|
||||
FF_ARG(capacityBar, "capacity-bar"),
|
||||
FF_ARG(days, "time-days"),
|
||||
FF_ARG(hours, "time-hours"),
|
||||
FF_ARG(minutes, "time-minutes"),
|
||||
FF_ARG(seconds, "time-seconds"),
|
||||
FF_ARG(timeStr, "time-formatted"),
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,8 +43,8 @@ bool ffPrintBios(FFBiosOptions* options)
|
||||
{
|
||||
ffStrbufClear(&key);
|
||||
FF_PARSE_FORMAT_STRING_CHECKED(&key, &options->moduleArgs.key, ((FFformatarg[]) {
|
||||
FF_FORMAT_ARG(bios.type, "type"),
|
||||
FF_FORMAT_ARG(options->moduleArgs.keyIcon, "icon"),
|
||||
FF_ARG(bios.type, "type"),
|
||||
FF_ARG(options->moduleArgs.keyIcon, "icon"),
|
||||
}));
|
||||
}
|
||||
|
||||
@@ -60,11 +60,11 @@ bool ffPrintBios(FFBiosOptions* options)
|
||||
else
|
||||
{
|
||||
FF_PRINT_FORMAT_CHECKED(key.chars, 0, &options->moduleArgs, FF_PRINT_TYPE_NO_CUSTOM_KEY, ((FFformatarg[]) {
|
||||
FF_FORMAT_ARG(bios.date, "date"),
|
||||
FF_FORMAT_ARG(bios.release, "release"),
|
||||
FF_FORMAT_ARG(bios.vendor, "vendor"),
|
||||
FF_FORMAT_ARG(bios.version, "version"),
|
||||
FF_FORMAT_ARG(bios.type, "type"),
|
||||
FF_ARG(bios.date, "date"),
|
||||
FF_ARG(bios.release, "release"),
|
||||
FF_ARG(bios.vendor, "vendor"),
|
||||
FF_ARG(bios.version, "version"),
|
||||
FF_ARG(bios.type, "type"),
|
||||
}));
|
||||
}
|
||||
success = true;
|
||||
|
||||
@@ -46,12 +46,12 @@ static void printDevice(FFBluetoothOptions* options, const FFBluetoothResult* de
|
||||
ffPercentAppendBar(&percentageBar, device->battery, options->percent, &options->moduleArgs);
|
||||
|
||||
FF_PRINT_FORMAT_CHECKED(FF_BLUETOOTH_MODULE_NAME, index, &options->moduleArgs, FF_PRINT_TYPE_DEFAULT, ((FFformatarg[]) {
|
||||
FF_FORMAT_ARG(device->name, "name"),
|
||||
FF_FORMAT_ARG(device->address, "address"),
|
||||
FF_FORMAT_ARG(device->type, "type"),
|
||||
FF_FORMAT_ARG(percentageNum, "battery-percentage"),
|
||||
FF_FORMAT_ARG(device->connected, "connected"),
|
||||
FF_FORMAT_ARG(percentageBar, "battery-percentage-bar"),
|
||||
FF_ARG(device->name, "name"),
|
||||
FF_ARG(device->address, "address"),
|
||||
FF_ARG(device->type, "type"),
|
||||
FF_ARG(percentageNum, "battery-percentage"),
|
||||
FF_ARG(device->connected, "connected"),
|
||||
FF_ARG(percentageBar, "battery-percentage-bar"),
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,9 +17,9 @@ static void printDevice(FFBluetoothRadioOptions* options, const FFBluetoothRadio
|
||||
else
|
||||
{
|
||||
FF_PARSE_FORMAT_STRING_CHECKED(&key, &options->moduleArgs.key, ((FFformatarg[]) {
|
||||
FF_FORMAT_ARG(index, "index"),
|
||||
FF_FORMAT_ARG(radio->name, "name"),
|
||||
FF_FORMAT_ARG(options->moduleArgs.keyIcon, "icon"),
|
||||
FF_ARG(index, "index"),
|
||||
FF_ARG(radio->name, "name"),
|
||||
FF_ARG(options->moduleArgs.keyIcon, "icon"),
|
||||
}));
|
||||
}
|
||||
|
||||
@@ -55,14 +55,14 @@ static void printDevice(FFBluetoothRadioOptions* options, const FFBluetoothRadio
|
||||
else
|
||||
{
|
||||
FF_PRINT_FORMAT_CHECKED(key.chars, 0, &options->moduleArgs, FF_PRINT_TYPE_NO_CUSTOM_KEY, ((FFformatarg[]) {
|
||||
FF_FORMAT_ARG(radio->name, "name"),
|
||||
FF_FORMAT_ARG(radio->address, "address"),
|
||||
FF_FORMAT_ARG(radio->lmpVersion, "lmp-version"),
|
||||
FF_FORMAT_ARG(radio->lmpSubversion, "lmp-subversion"),
|
||||
FF_FORMAT_ARG(version, "version"),
|
||||
FF_FORMAT_ARG(radio->vendor, "vendor"),
|
||||
FF_FORMAT_ARG(radio->discoverable, "discoverable"),
|
||||
FF_FORMAT_ARG(radio->connectable, "connectable"),
|
||||
FF_ARG(radio->name, "name"),
|
||||
FF_ARG(radio->address, "address"),
|
||||
FF_ARG(radio->lmpVersion, "lmp-version"),
|
||||
FF_ARG(radio->lmpSubversion, "lmp-subversion"),
|
||||
FF_ARG(version, "version"),
|
||||
FF_ARG(radio->vendor, "vendor"),
|
||||
FF_ARG(radio->discoverable, "discoverable"),
|
||||
FF_ARG(radio->connectable, "connectable"),
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,10 +37,10 @@ bool ffPrintBoard(FFBoardOptions* options)
|
||||
else
|
||||
{
|
||||
FF_PRINT_FORMAT_CHECKED(FF_BOARD_MODULE_NAME, 0, &options->moduleArgs, FF_PRINT_TYPE_DEFAULT, ((FFformatarg[]) {
|
||||
FF_FORMAT_ARG(result.name, "name"),
|
||||
FF_FORMAT_ARG(result.vendor, "vendor"),
|
||||
FF_FORMAT_ARG(result.version, "version"),
|
||||
FF_FORMAT_ARG(result.serial, "serial"),
|
||||
FF_ARG(result.name, "name"),
|
||||
FF_ARG(result.vendor, "vendor"),
|
||||
FF_ARG(result.version, "version"),
|
||||
FF_ARG(result.serial, "serial"),
|
||||
}));
|
||||
}
|
||||
success = true;
|
||||
|
||||
@@ -40,11 +40,11 @@ bool ffPrintBootmgr(FFBootmgrOptions* options)
|
||||
else
|
||||
{
|
||||
FF_PRINT_FORMAT_CHECKED(FF_BOOTMGR_MODULE_NAME, 0, &options->moduleArgs, FF_PRINT_TYPE_DEFAULT, ((FFformatarg[]) {
|
||||
FF_FORMAT_ARG(bootmgr.name, "name"),
|
||||
FF_FORMAT_ARG(bootmgr.firmware, "firmware-path"),
|
||||
FF_FORMAT_ARG(firmwareName, "firmware-name"),
|
||||
FF_FORMAT_ARG(bootmgr.secureBoot, "secure-boot"),
|
||||
FF_FORMAT_ARG(bootmgr.order, "order"),
|
||||
FF_ARG(bootmgr.name, "name"),
|
||||
FF_ARG(bootmgr.firmware, "firmware-path"),
|
||||
FF_ARG(firmwareName, "firmware-name"),
|
||||
FF_ARG(bootmgr.secureBoot, "secure-boot"),
|
||||
FF_ARG(bootmgr.order, "order"),
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,9 +56,9 @@ bool ffPrintBrightness(FFBrightnessOptions* options)
|
||||
{
|
||||
uint32_t moduleIndex = result.length == 1 ? 0 : index + 1;
|
||||
FF_PARSE_FORMAT_STRING_CHECKED(&key, &options->moduleArgs.key, ((FFformatarg[]) {
|
||||
FF_FORMAT_ARG(moduleIndex, "index"),
|
||||
FF_FORMAT_ARG(item->name, "name"),
|
||||
FF_FORMAT_ARG(options->moduleArgs.keyIcon, "icon"),
|
||||
FF_ARG(moduleIndex, "index"),
|
||||
FF_ARG(item->name, "name"),
|
||||
FF_ARG(options->moduleArgs.keyIcon, "icon"),
|
||||
}));
|
||||
}
|
||||
|
||||
@@ -96,13 +96,13 @@ bool ffPrintBrightness(FFBrightnessOptions* options)
|
||||
ffPercentAppendBar(&valueBar, percent, options->percent, &options->moduleArgs);
|
||||
|
||||
FF_PRINT_FORMAT_CHECKED(key.chars, 0, &options->moduleArgs, FF_PRINT_TYPE_NO_CUSTOM_KEY, ((FFformatarg[]) {
|
||||
FF_FORMAT_ARG(valueNum, "percentage"),
|
||||
FF_FORMAT_ARG(item->name, "name"),
|
||||
FF_FORMAT_ARG(item->max, "max"),
|
||||
FF_FORMAT_ARG(item->min, "min"),
|
||||
FF_FORMAT_ARG(item->current, "current"),
|
||||
FF_FORMAT_ARG(valueBar, "percentage-bar"),
|
||||
FF_FORMAT_ARG(item->builtin, "is-builtin"),
|
||||
FF_ARG(valueNum, "percentage"),
|
||||
FF_ARG(item->name, "name"),
|
||||
FF_ARG(item->max, "max"),
|
||||
FF_ARG(item->min, "min"),
|
||||
FF_ARG(item->current, "current"),
|
||||
FF_ARG(valueBar, "percentage-bar"),
|
||||
FF_ARG(item->builtin, "is-builtin"),
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
+16
-16
@@ -20,9 +20,9 @@ static void printBtrfs(FFBtrfsOptions* options, FFBtrfsResult* result, uint8_t i
|
||||
{
|
||||
ffStrbufClear(&buffer);
|
||||
FF_PARSE_FORMAT_STRING_CHECKED(&buffer, &options->moduleArgs.key, ((FFformatarg[]) {
|
||||
FF_FORMAT_ARG(index, "index"),
|
||||
FF_FORMAT_ARG(result->name, "name"),
|
||||
FF_FORMAT_ARG(options->moduleArgs.keyIcon, "icon"),
|
||||
FF_ARG(index, "index"),
|
||||
FF_ARG(result->name, "name"),
|
||||
FF_ARG(options->moduleArgs.keyIcon, "icon"),
|
||||
}));
|
||||
}
|
||||
|
||||
@@ -80,19 +80,19 @@ static void printBtrfs(FFBtrfsOptions* options, FFBtrfsResult* result, uint8_t i
|
||||
ffSizeAppendNum(result->sectorSize, §orSizePretty);
|
||||
|
||||
FF_PRINT_FORMAT_CHECKED(buffer.chars, 0, &options->moduleArgs, FF_PRINT_TYPE_NO_CUSTOM_KEY, ((FFformatarg[]) {
|
||||
FF_FORMAT_ARG(result->name, "name"),
|
||||
FF_FORMAT_ARG(result->uuid, "uuid"),
|
||||
FF_FORMAT_ARG(result->devices, "devices"),
|
||||
FF_FORMAT_ARG(result->features, "features"),
|
||||
FF_FORMAT_ARG(usedPretty, "used"),
|
||||
FF_FORMAT_ARG(allocatedPretty, "allocated"),
|
||||
FF_FORMAT_ARG(totalPretty, "total"),
|
||||
FF_FORMAT_ARG(usedPercentageNum, "used-percentage"),
|
||||
FF_FORMAT_ARG(allocatedPercentageNum, "allocated-percentage"),
|
||||
FF_FORMAT_ARG(usedPercentageBar, "used-percentage-bar"),
|
||||
FF_FORMAT_ARG(allocatedPercentageBar, "allocated-percentage-bar"),
|
||||
FF_FORMAT_ARG(nodeSizePretty, "node-size"),
|
||||
FF_FORMAT_ARG(sectorSizePretty, "sector-size"),
|
||||
FF_ARG(result->name, "name"),
|
||||
FF_ARG(result->uuid, "uuid"),
|
||||
FF_ARG(result->devices, "devices"),
|
||||
FF_ARG(result->features, "features"),
|
||||
FF_ARG(usedPretty, "used"),
|
||||
FF_ARG(allocatedPretty, "allocated"),
|
||||
FF_ARG(totalPretty, "total"),
|
||||
FF_ARG(usedPercentageNum, "used-percentage"),
|
||||
FF_ARG(allocatedPercentageNum, "allocated-percentage"),
|
||||
FF_ARG(usedPercentageBar, "used-percentage-bar"),
|
||||
FF_ARG(allocatedPercentageBar, "allocated-percentage-bar"),
|
||||
FF_ARG(nodeSizePretty, "node-size"),
|
||||
FF_ARG(sectorSizePretty, "sector-size"),
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,12 +26,12 @@ static void printDevice(FFCameraOptions* options, const FFCameraResult* device,
|
||||
else
|
||||
{
|
||||
FF_PRINT_FORMAT_CHECKED(FF_CAMERA_MODULE_NAME, index, &options->moduleArgs, FF_PRINT_TYPE_DEFAULT, (((FFformatarg[]) {
|
||||
FF_FORMAT_ARG(device->name, "name"),
|
||||
FF_FORMAT_ARG(device->vendor, "vendor"),
|
||||
FF_FORMAT_ARG(device->colorspace, "colorspace"),
|
||||
FF_FORMAT_ARG(device->id, "id"),
|
||||
FF_FORMAT_ARG(device->width, "width"),
|
||||
FF_FORMAT_ARG(device->height, "height"),
|
||||
FF_ARG(device->name, "name"),
|
||||
FF_ARG(device->vendor, "vendor"),
|
||||
FF_ARG(device->colorspace, "colorspace"),
|
||||
FF_ARG(device->id, "id"),
|
||||
FF_ARG(device->width, "width"),
|
||||
FF_ARG(device->height, "height"),
|
||||
})));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,10 +39,10 @@ bool ffPrintChassis(FFChassisOptions* options)
|
||||
else
|
||||
{
|
||||
FF_PRINT_FORMAT_CHECKED(FF_CHASSIS_MODULE_NAME, 0, &options->moduleArgs, FF_PRINT_TYPE_DEFAULT, ((FFformatarg[]) {
|
||||
FF_FORMAT_ARG(result.type, "type"),
|
||||
FF_FORMAT_ARG(result.vendor, "vendor"),
|
||||
FF_FORMAT_ARG(result.version, "version"),
|
||||
FF_FORMAT_ARG(result.serial, "serial"),
|
||||
FF_ARG(result.type, "type"),
|
||||
FF_ARG(result.vendor, "vendor"),
|
||||
FF_ARG(result.version, "version"),
|
||||
FF_ARG(result.serial, "serial"),
|
||||
}));
|
||||
}
|
||||
success = true;
|
||||
|
||||
@@ -35,7 +35,7 @@ bool ffPrintCommand(FFCommandOptions* options)
|
||||
else
|
||||
{
|
||||
FF_PRINT_FORMAT_CHECKED(FF_COMMAND_MODULE_NAME, ++index, &options->moduleArgs, FF_PRINT_TYPE_DEFAULT, ((FFformatarg[]){
|
||||
FF_FORMAT_ARG(line, "result")
|
||||
FF_ARG(line, "result")
|
||||
}));
|
||||
}
|
||||
}
|
||||
@@ -50,7 +50,7 @@ bool ffPrintCommand(FFCommandOptions* options)
|
||||
else
|
||||
{
|
||||
FF_PRINT_FORMAT_CHECKED(FF_COMMAND_MODULE_NAME, 0, &options->moduleArgs, FF_PRINT_TYPE_DEFAULT, ((FFformatarg[]){
|
||||
FF_FORMAT_ARG(result, "result")
|
||||
FF_ARG(result, "result")
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
+12
-12
@@ -99,18 +99,18 @@ bool ffPrintCPU(FFCPUOptions* options)
|
||||
FF_STRBUF_AUTO_DESTROY tempStr = ffStrbufCreate();
|
||||
ffTempsAppendNum(cpu.temperature, &tempStr, options->tempConfig, &options->moduleArgs);
|
||||
FF_PRINT_FORMAT_CHECKED(FF_CPU_MODULE_NAME, 0, &options->moduleArgs, FF_PRINT_TYPE_DEFAULT, ((FFformatarg[]){
|
||||
FF_FORMAT_ARG(cpu.name, "name"),
|
||||
FF_FORMAT_ARG(cpu.vendor, "vendor"),
|
||||
FF_FORMAT_ARG(cpu.coresPhysical, "cores-physical"),
|
||||
FF_FORMAT_ARG(cpu.coresLogical, "cores-logical"),
|
||||
FF_FORMAT_ARG(cpu.coresOnline, "cores-online"),
|
||||
FF_FORMAT_ARG(freqBase, "freq-base"),
|
||||
FF_FORMAT_ARG(freqMax, "freq-max"),
|
||||
FF_FORMAT_ARG(tempStr, "temperature"),
|
||||
FF_FORMAT_ARG(coreTypes, "core-types"),
|
||||
FF_FORMAT_ARG(cpu.packages, "packages"),
|
||||
FF_FORMAT_ARG(cpu.march, "march"),
|
||||
FF_FORMAT_ARG(cpu.numaNodes, "numa-nodes"),
|
||||
FF_ARG(cpu.name, "name"),
|
||||
FF_ARG(cpu.vendor, "vendor"),
|
||||
FF_ARG(cpu.coresPhysical, "cores-physical"),
|
||||
FF_ARG(cpu.coresLogical, "cores-logical"),
|
||||
FF_ARG(cpu.coresOnline, "cores-online"),
|
||||
FF_ARG(freqBase, "freq-base"),
|
||||
FF_ARG(freqMax, "freq-max"),
|
||||
FF_ARG(tempStr, "temperature"),
|
||||
FF_ARG(coreTypes, "core-types"),
|
||||
FF_ARG(cpu.packages, "packages"),
|
||||
FF_ARG(cpu.march, "march"),
|
||||
FF_ARG(cpu.numaNodes, "numa-nodes"),
|
||||
}));
|
||||
}
|
||||
success = true;
|
||||
|
||||
@@ -23,9 +23,9 @@ static void printCPUCacheNormal(const FFCPUCacheResult* result, FFCPUCacheOption
|
||||
{
|
||||
uint32_t index = i + 1;
|
||||
FF_PARSE_FORMAT_STRING_CHECKED(&key, &options->moduleArgs.key, ((FFformatarg[]) {
|
||||
FF_FORMAT_ARG(index, "index"),
|
||||
FF_FORMAT_ARG(levelStr, "level"),
|
||||
FF_FORMAT_ARG(options->moduleArgs.keyIcon, "icon"),
|
||||
FF_ARG(index, "index"),
|
||||
FF_ARG(levelStr, "level"),
|
||||
FF_ARG(options->moduleArgs.keyIcon, "icon"),
|
||||
}));
|
||||
}
|
||||
|
||||
@@ -62,8 +62,8 @@ static void printCPUCacheNormal(const FFCPUCacheResult* result, FFCPUCacheOption
|
||||
FF_STRBUF_AUTO_DESTROY buffer2 = ffStrbufCreate();
|
||||
ffSizeAppendNum(sum, &buffer2);
|
||||
FF_PRINT_FORMAT_CHECKED(key.chars, 0, &options->moduleArgs, FF_PRINT_TYPE_NO_CUSTOM_KEY, ((FFformatarg[]) {
|
||||
FF_FORMAT_ARG(buffer, "result"),
|
||||
FF_FORMAT_ARG(buffer2, "sum"),
|
||||
FF_ARG(buffer, "result"),
|
||||
FF_ARG(buffer2, "sum"),
|
||||
}));
|
||||
}
|
||||
}
|
||||
@@ -95,8 +95,8 @@ static void printCPUCacheCompact(const FFCPUCacheResult* result, FFCPUCacheOptio
|
||||
FF_STRBUF_AUTO_DESTROY buffer2 = ffStrbufCreate();
|
||||
ffSizeAppendNum(sum, &buffer2);
|
||||
FF_PRINT_FORMAT_CHECKED(FF_CPUCACHE_DISPLAY_NAME, 0, &options->moduleArgs, FF_PRINT_TYPE_DEFAULT, ((FFformatarg[]) {
|
||||
FF_FORMAT_ARG(buffer, "result"),
|
||||
FF_FORMAT_ARG(buffer2, "sum"),
|
||||
FF_ARG(buffer, "result"),
|
||||
FF_ARG(buffer2, "sum"),
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -104,14 +104,14 @@ bool ffPrintCPUUsage(FFCPUUsageOptions* options)
|
||||
ffPercentAppendBar(&maxBar, maxValue, options->percent, &options->moduleArgs);
|
||||
|
||||
FF_PRINT_FORMAT_CHECKED(FF_CPUUSAGE_DISPLAY_NAME, 0, &options->moduleArgs, FF_PRINT_TYPE_DEFAULT, ((FFformatarg[]){
|
||||
FF_FORMAT_ARG(avgNum, "avg"),
|
||||
FF_FORMAT_ARG(maxNum, "max"),
|
||||
FF_FORMAT_ARG(maxIndex, "max-index"),
|
||||
FF_FORMAT_ARG(minNum, "min"),
|
||||
FF_FORMAT_ARG(minIndex, "min-index"),
|
||||
FF_FORMAT_ARG(avgBar, "avg-bar"),
|
||||
FF_FORMAT_ARG(maxBar, "max-bar"),
|
||||
FF_FORMAT_ARG(minBar, "min-bar"),
|
||||
FF_ARG(avgNum, "avg"),
|
||||
FF_ARG(maxNum, "max"),
|
||||
FF_ARG(maxIndex, "max-index"),
|
||||
FF_ARG(minNum, "min"),
|
||||
FF_ARG(minIndex, "min-index"),
|
||||
FF_ARG(avgBar, "avg-bar"),
|
||||
FF_ARG(maxBar, "max-bar"),
|
||||
FF_ARG(minBar, "min-bar"),
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
@@ -38,8 +38,8 @@ bool ffPrintCursor(FFCursorOptions* options)
|
||||
else
|
||||
{
|
||||
FF_PRINT_FORMAT_CHECKED(FF_CURSOR_MODULE_NAME, 0, &options->moduleArgs, FF_PRINT_TYPE_DEFAULT, ((FFformatarg[]) {
|
||||
FF_FORMAT_ARG(result.theme, "theme"),
|
||||
FF_FORMAT_ARG(result.size, "size"),
|
||||
FF_ARG(result.theme, "theme"),
|
||||
FF_ARG(result.size, "size"),
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
@@ -67,29 +67,29 @@ static void printDateTimeFormat(struct tm* tm, const FFModuleArgs* moduleArgs)
|
||||
strftime(result.timezoneName, sizeof(result.timezoneName), "%Z", tm);
|
||||
|
||||
FF_PRINT_FORMAT_CHECKED(FF_DATETIME_DISPLAY_NAME, 0, moduleArgs, FF_PRINT_TYPE_DEFAULT, ((FFformatarg[]) {
|
||||
FF_FORMAT_ARG(result.year, "year"), // 1
|
||||
FF_FORMAT_ARG(result.yearShort, "year-short"), // 2
|
||||
FF_FORMAT_ARG(result.month, "month"), // 3
|
||||
FF_FORMAT_ARG(result.monthPretty, "month-pretty"), // 4
|
||||
FF_FORMAT_ARG(result.monthName, "month-name"), // 5
|
||||
FF_FORMAT_ARG(result.monthNameShort, "month-name-short"), // 6
|
||||
FF_FORMAT_ARG(result.week, "week"), // 7
|
||||
FF_FORMAT_ARG(result.weekday, "weekday"), // 8
|
||||
FF_FORMAT_ARG(result.weekdayShort, "weekday-short"), // 9
|
||||
FF_FORMAT_ARG(result.dayInYear, "day-in-year"), // 10
|
||||
FF_FORMAT_ARG(result.dayInMonth, "day-in-month"), // 11
|
||||
FF_FORMAT_ARG(result.dayInWeek, "day-in-week"), // 12
|
||||
FF_FORMAT_ARG(result.hour, "hour"), // 13
|
||||
FF_FORMAT_ARG(result.hourPretty, "hour-pretty"), // 14
|
||||
FF_FORMAT_ARG(result.hour12, "hour-12"), // 15
|
||||
FF_FORMAT_ARG(result.hour12Pretty, "hour-12-pretty"), // 16
|
||||
FF_FORMAT_ARG(result.minute, "minute"), // 17
|
||||
FF_FORMAT_ARG(result.minutePretty, "minute-pretty"), // 18
|
||||
FF_FORMAT_ARG(result.second, "second"), // 19
|
||||
FF_FORMAT_ARG(result.secondPretty, "second-pretty"), // 20
|
||||
FF_FORMAT_ARG(result.offsetFromUtc, "offset-from-utc"), // 21
|
||||
FF_FORMAT_ARG(result.timezoneName, "timezone-name"), // 22
|
||||
FF_FORMAT_ARG(result.dayPretty, "day-pretty"), // 23
|
||||
FF_ARG(result.year, "year"), // 1
|
||||
FF_ARG(result.yearShort, "year-short"), // 2
|
||||
FF_ARG(result.month, "month"), // 3
|
||||
FF_ARG(result.monthPretty, "month-pretty"), // 4
|
||||
FF_ARG(result.monthName, "month-name"), // 5
|
||||
FF_ARG(result.monthNameShort, "month-name-short"), // 6
|
||||
FF_ARG(result.week, "week"), // 7
|
||||
FF_ARG(result.weekday, "weekday"), // 8
|
||||
FF_ARG(result.weekdayShort, "weekday-short"), // 9
|
||||
FF_ARG(result.dayInYear, "day-in-year"), // 10
|
||||
FF_ARG(result.dayInMonth, "day-in-month"), // 11
|
||||
FF_ARG(result.dayInWeek, "day-in-week"), // 12
|
||||
FF_ARG(result.hour, "hour"), // 13
|
||||
FF_ARG(result.hourPretty, "hour-pretty"), // 14
|
||||
FF_ARG(result.hour12, "hour-12"), // 15
|
||||
FF_ARG(result.hour12Pretty, "hour-12-pretty"), // 16
|
||||
FF_ARG(result.minute, "minute"), // 17
|
||||
FF_ARG(result.minutePretty, "minute-pretty"), // 18
|
||||
FF_ARG(result.second, "second"), // 19
|
||||
FF_ARG(result.secondPretty, "second-pretty"), // 20
|
||||
FF_ARG(result.offsetFromUtc, "offset-from-utc"), // 21
|
||||
FF_ARG(result.timezoneName, "timezone-name"), // 22
|
||||
FF_ARG(result.dayPretty, "day-pretty"), // 23
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -35,9 +35,9 @@ bool ffPrintDE(FFDEOptions* options)
|
||||
else
|
||||
{
|
||||
FF_PRINT_FORMAT_CHECKED(FF_DE_MODULE_NAME, 0, &options->moduleArgs, FF_PRINT_TYPE_DEFAULT, ((FFformatarg[]){
|
||||
FF_FORMAT_ARG(result->deProcessName, "process-name"),
|
||||
FF_FORMAT_ARG(result->dePrettyName, "pretty-name"),
|
||||
FF_FORMAT_ARG(version, "version")
|
||||
FF_ARG(result->deProcessName, "process-name"),
|
||||
FF_ARG(result->dePrettyName, "pretty-name"),
|
||||
FF_ARG(version, "version")
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
+34
-34
@@ -46,14 +46,14 @@ static void printDisk(FFDiskOptions* options, const FFDisk* disk, uint32_t index
|
||||
}
|
||||
|
||||
FF_PARSE_FORMAT_STRING_CHECKED(&key, &options->moduleArgs.key, ((FFformatarg[]) {
|
||||
FF_FORMAT_ARG(disk->mountpoint, "mountpoint"),
|
||||
FF_FORMAT_ARG(disk->name, "name"),
|
||||
FF_FORMAT_ARG(disk->mountFrom, "mount-from"),
|
||||
FF_FORMAT_ARG(options->moduleArgs.keyIcon, "icon"),
|
||||
FF_FORMAT_ARG(index, "index"),
|
||||
FF_FORMAT_ARG(disk->filesystem, "filesystem"),
|
||||
FF_FORMAT_ARG(mountpointLink, "mountpoint-link"),
|
||||
FF_FORMAT_ARG(nameLink, "name-link"),
|
||||
FF_ARG(disk->mountpoint, "mountpoint"),
|
||||
FF_ARG(disk->name, "name"),
|
||||
FF_ARG(disk->mountFrom, "mount-from"),
|
||||
FF_ARG(options->moduleArgs.keyIcon, "icon"),
|
||||
FF_ARG(index, "index"),
|
||||
FF_ARG(disk->filesystem, "filesystem"),
|
||||
FF_ARG(mountpointLink, "mountpoint-link"),
|
||||
FF_ARG(nameLink, "name-link"),
|
||||
}));
|
||||
}
|
||||
|
||||
@@ -159,32 +159,32 @@ static void printDisk(FFDiskOptions* options, const FFDisk* disk, uint32_t index
|
||||
|
||||
FFTimeGetAgeResult age = ffTimeGetAge(disk->createTime, now);
|
||||
FF_PRINT_FORMAT_CHECKED(key.chars, 0, &options->moduleArgs, FF_PRINT_TYPE_NO_CUSTOM_KEY, ((FFformatarg[]) {
|
||||
FF_FORMAT_ARG(usedPretty, "size-used"),
|
||||
FF_FORMAT_ARG(totalPretty, "size-total"),
|
||||
FF_FORMAT_ARG(bytesPercentageNum, "size-percentage"),
|
||||
FF_FORMAT_ARG(disk->filesUsed, "files-used"),
|
||||
FF_FORMAT_ARG(disk->filesTotal, "files-total"),
|
||||
FF_FORMAT_ARG(filesPercentageNum, "files-percentage"),
|
||||
FF_FORMAT_ARG(isExternal, "is-external"),
|
||||
FF_FORMAT_ARG(isHidden, "is-hidden"),
|
||||
FF_FORMAT_ARG(disk->filesystem, "filesystem"),
|
||||
FF_FORMAT_ARG(disk->name, "name"),
|
||||
FF_FORMAT_ARG(isReadOnly, "is-readonly"),
|
||||
{FF_FORMAT_ARG_TYPE_STRING, ffTimeToShortStr(disk->createTime), "create-time"},
|
||||
FF_FORMAT_ARG(bytesPercentageBar, "size-percentage-bar"),
|
||||
FF_FORMAT_ARG(filesPercentageBar, "files-percentage-bar"),
|
||||
FF_FORMAT_ARG(days, "days"),
|
||||
FF_FORMAT_ARG(hours, "hours"),
|
||||
FF_FORMAT_ARG(minutes, "minutes"),
|
||||
FF_FORMAT_ARG(seconds, "seconds"),
|
||||
FF_FORMAT_ARG(milliseconds, "milliseconds"),
|
||||
FF_FORMAT_ARG(disk->mountpoint, "mountpoint"),
|
||||
FF_FORMAT_ARG(disk->mountFrom, "mount-from"),
|
||||
FF_FORMAT_ARG(age.years, "years"),
|
||||
FF_FORMAT_ARG(age.daysOfYear, "days-of-year"),
|
||||
FF_FORMAT_ARG(age.yearsFraction, "years-fraction"),
|
||||
FF_FORMAT_ARG(freePretty, "size-free"),
|
||||
FF_FORMAT_ARG(availPretty, "size-available"),
|
||||
FF_ARG(usedPretty, "size-used"),
|
||||
FF_ARG(totalPretty, "size-total"),
|
||||
FF_ARG(bytesPercentageNum, "size-percentage"),
|
||||
FF_ARG(disk->filesUsed, "files-used"),
|
||||
FF_ARG(disk->filesTotal, "files-total"),
|
||||
FF_ARG(filesPercentageNum, "files-percentage"),
|
||||
FF_ARG(isExternal, "is-external"),
|
||||
FF_ARG(isHidden, "is-hidden"),
|
||||
FF_ARG(disk->filesystem, "filesystem"),
|
||||
FF_ARG(disk->name, "name"),
|
||||
FF_ARG(isReadOnly, "is-readonly"),
|
||||
{FF_ARG_TYPE_STRING, ffTimeToShortStr(disk->createTime), "create-time"},
|
||||
FF_ARG(bytesPercentageBar, "size-percentage-bar"),
|
||||
FF_ARG(filesPercentageBar, "files-percentage-bar"),
|
||||
FF_ARG(days, "days"),
|
||||
FF_ARG(hours, "hours"),
|
||||
FF_ARG(minutes, "minutes"),
|
||||
FF_ARG(seconds, "seconds"),
|
||||
FF_ARG(milliseconds, "milliseconds"),
|
||||
FF_ARG(disk->mountpoint, "mountpoint"),
|
||||
FF_ARG(disk->mountFrom, "mount-from"),
|
||||
FF_ARG(age.years, "years"),
|
||||
FF_ARG(age.daysOfYear, "days-of-year"),
|
||||
FF_ARG(age.yearsFraction, "years-fraction"),
|
||||
FF_ARG(freePretty, "size-free"),
|
||||
FF_ARG(availPretty, "size-available"),
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
+12
-12
@@ -22,10 +22,10 @@ static void formatKey(const FFDiskIOOptions* options, FFDiskIOResult* dev, uint3
|
||||
{
|
||||
ffStrbufClear(key);
|
||||
FF_PARSE_FORMAT_STRING_CHECKED(key, &options->moduleArgs.key, ((FFformatarg[]){
|
||||
FF_FORMAT_ARG(index, "index"),
|
||||
FF_FORMAT_ARG(dev->name, "name"),
|
||||
FF_FORMAT_ARG(dev->devPath, "dev-path"),
|
||||
FF_FORMAT_ARG(options->moduleArgs.keyIcon, "icon"),
|
||||
FF_ARG(index, "index"),
|
||||
FF_ARG(dev->name, "name"),
|
||||
FF_ARG(dev->devPath, "dev-path"),
|
||||
FF_ARG(options->moduleArgs.keyIcon, "icon"),
|
||||
}));
|
||||
}
|
||||
}
|
||||
@@ -75,14 +75,14 @@ bool ffPrintDiskIO(FFDiskIOOptions* options)
|
||||
if (!options->detectTotal) ffStrbufAppendS(&buffer2, "/s");
|
||||
|
||||
FF_PRINT_FORMAT_CHECKED(key.chars, 0, &options->moduleArgs, FF_PRINT_TYPE_NO_CUSTOM_KEY, ((FFformatarg[]){
|
||||
FF_FORMAT_ARG(buffer, "size-read"),
|
||||
FF_FORMAT_ARG(buffer2, "size-written"),
|
||||
FF_FORMAT_ARG(dev->name, "name"),
|
||||
FF_FORMAT_ARG(dev->devPath, "dev-path"),
|
||||
FF_FORMAT_ARG(dev->bytesRead, "bytes-read"),
|
||||
FF_FORMAT_ARG(dev->bytesWritten, "bytes-written"),
|
||||
FF_FORMAT_ARG(dev->readCount, "read-count"),
|
||||
FF_FORMAT_ARG(dev->writeCount, "write-count"),
|
||||
FF_ARG(buffer, "size-read"),
|
||||
FF_ARG(buffer2, "size-written"),
|
||||
FF_ARG(dev->name, "name"),
|
||||
FF_ARG(dev->devPath, "dev-path"),
|
||||
FF_ARG(dev->bytesRead, "bytes-read"),
|
||||
FF_ARG(dev->bytesWritten, "bytes-written"),
|
||||
FF_ARG(dev->readCount, "read-count"),
|
||||
FF_ARG(dev->writeCount, "write-count"),
|
||||
}));
|
||||
}
|
||||
++index;
|
||||
|
||||
@@ -92,10 +92,10 @@ bool ffPrintDisplay(FFDisplayOptions* options)
|
||||
else
|
||||
{
|
||||
FF_PARSE_FORMAT_STRING_CHECKED(&key, &options->moduleArgs.key, ((FFformatarg[]) {
|
||||
FF_FORMAT_ARG(moduleIndex, "index"),
|
||||
FF_FORMAT_ARG(result->name, "name"),
|
||||
FF_FORMAT_ARG(displayType, "type"),
|
||||
FF_FORMAT_ARG(options->moduleArgs.keyIcon, "icon"),
|
||||
FF_ARG(moduleIndex, "index"),
|
||||
FF_ARG(result->name, "name"),
|
||||
FF_ARG(displayType, "type"),
|
||||
FF_ARG(options->moduleArgs.keyIcon, "icon"),
|
||||
}));
|
||||
}
|
||||
|
||||
@@ -192,30 +192,30 @@ bool ffPrintDisplay(FFDisplayOptions* options)
|
||||
buf[0] = '\0';
|
||||
|
||||
FF_PRINT_FORMAT_CHECKED(key.chars, 0, &options->moduleArgs, FF_PRINT_TYPE_NO_CUSTOM_KEY, ((FFformatarg[]) {
|
||||
FF_FORMAT_ARG(result->width, "width"),
|
||||
FF_FORMAT_ARG(result->height, "height"),
|
||||
FF_FORMAT_ARG(refreshRate, "refresh-rate"),
|
||||
FF_FORMAT_ARG(result->scaledWidth, "scaled-width"),
|
||||
FF_FORMAT_ARG(result->scaledHeight, "scaled-height"),
|
||||
FF_FORMAT_ARG(result->name, "name"),
|
||||
FF_FORMAT_ARG(displayType, "type"),
|
||||
FF_FORMAT_ARG(result->rotation, "rotation"),
|
||||
FF_FORMAT_ARG(result->primary, "is-primary"),
|
||||
FF_FORMAT_ARG(result->physicalWidth, "physical-width"),
|
||||
FF_FORMAT_ARG(result->physicalHeight, "physical-height"),
|
||||
FF_FORMAT_ARG(iInch, "inch"),
|
||||
FF_FORMAT_ARG(iPpi, "ppi"),
|
||||
FF_FORMAT_ARG(result->bitDepth, "bit-depth"),
|
||||
FF_FORMAT_ARG(hdrEnabled, "hdr-enabled"),
|
||||
FF_FORMAT_ARG(result->manufactureYear, "manufacture-year"),
|
||||
FF_FORMAT_ARG(result->manufactureWeek, "manufacture-week"),
|
||||
FF_FORMAT_ARG(buf, "serial"),
|
||||
FF_FORMAT_ARG(result->platformApi, "platform-api"),
|
||||
FF_FORMAT_ARG(hdrCompatible, "hdr-compatible"),
|
||||
FF_FORMAT_ARG(scaleFactor, "scale-factor"),
|
||||
FF_FORMAT_ARG(result->preferredWidth, "preferred-width"),
|
||||
FF_FORMAT_ARG(result->preferredHeight, "preferred-height"),
|
||||
FF_FORMAT_ARG(preferredRefreshRate, "preferred-refresh-rate"),
|
||||
FF_ARG(result->width, "width"),
|
||||
FF_ARG(result->height, "height"),
|
||||
FF_ARG(refreshRate, "refresh-rate"),
|
||||
FF_ARG(result->scaledWidth, "scaled-width"),
|
||||
FF_ARG(result->scaledHeight, "scaled-height"),
|
||||
FF_ARG(result->name, "name"),
|
||||
FF_ARG(displayType, "type"),
|
||||
FF_ARG(result->rotation, "rotation"),
|
||||
FF_ARG(result->primary, "is-primary"),
|
||||
FF_ARG(result->physicalWidth, "physical-width"),
|
||||
FF_ARG(result->physicalHeight, "physical-height"),
|
||||
FF_ARG(iInch, "inch"),
|
||||
FF_ARG(iPpi, "ppi"),
|
||||
FF_ARG(result->bitDepth, "bit-depth"),
|
||||
FF_ARG(hdrEnabled, "hdr-enabled"),
|
||||
FF_ARG(result->manufactureYear, "manufacture-year"),
|
||||
FF_ARG(result->manufactureWeek, "manufacture-week"),
|
||||
FF_ARG(buf, "serial"),
|
||||
FF_ARG(result->platformApi, "platform-api"),
|
||||
FF_ARG(hdrCompatible, "hdr-compatible"),
|
||||
FF_ARG(scaleFactor, "scale-factor"),
|
||||
FF_ARG(result->preferredWidth, "preferred-width"),
|
||||
FF_ARG(result->preferredHeight, "preferred-height"),
|
||||
FF_ARG(preferredRefreshRate, "preferred-refresh-rate"),
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ bool ffPrintDNS(FFDNSOptions* options)
|
||||
else
|
||||
{
|
||||
FF_PRINT_FORMAT_CHECKED(FF_DNS_MODULE_NAME, 0, &options->moduleArgs, FF_PRINT_TYPE_DEFAULT, ((FFformatarg[]) {
|
||||
FF_FORMAT_ARG(buf, "result"),
|
||||
FF_ARG(buf, "result"),
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
@@ -40,11 +40,11 @@ bool ffPrintEditor(FFEditorOptions* options)
|
||||
else
|
||||
{
|
||||
FF_PRINT_FORMAT_CHECKED(FF_EDITOR_MODULE_NAME, 0, &options->moduleArgs, FF_PRINT_TYPE_DEFAULT, ((FFformatarg[]){
|
||||
FF_FORMAT_ARG(result.type, "type"),
|
||||
FF_FORMAT_ARG(result.name, "name"),
|
||||
FF_FORMAT_ARG(result.exe, "exe-name"),
|
||||
FF_FORMAT_ARG(result.path, "path"),
|
||||
FF_FORMAT_ARG(result.version, "version"),
|
||||
FF_ARG(result.type, "type"),
|
||||
FF_ARG(result.name, "name"),
|
||||
FF_ARG(result.exe, "exe-name"),
|
||||
FF_ARG(result.path, "path"),
|
||||
FF_ARG(result.version, "version"),
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
@@ -28,11 +28,11 @@ bool ffPrintFont(FFFontOptions* options)
|
||||
else
|
||||
{
|
||||
FF_PRINT_FORMAT_CHECKED(FF_FONT_MODULE_NAME, 0, &options->moduleArgs, FF_PRINT_TYPE_DEFAULT, ((FFformatarg[]) {
|
||||
FF_FORMAT_ARG(font.fonts[0], "font1"),
|
||||
FF_FORMAT_ARG(font.fonts[1], "font2"),
|
||||
FF_FORMAT_ARG(font.fonts[2], "font3"),
|
||||
FF_FORMAT_ARG(font.fonts[3], "font4"),
|
||||
FF_FORMAT_ARG(font.display, "combined"),
|
||||
FF_ARG(font.fonts[0], "font1"),
|
||||
FF_ARG(font.fonts[1], "font2"),
|
||||
FF_ARG(font.fonts[2], "font3"),
|
||||
FF_ARG(font.fonts[3], "font4"),
|
||||
FF_ARG(font.display, "combined"),
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
@@ -42,10 +42,10 @@ static void printDevice(FFGamepadOptions* options, const FFGamepadDevice* device
|
||||
ffPercentAppendBar(&percentageBar, device->battery, options->percent, &options->moduleArgs);
|
||||
|
||||
FF_PRINT_FORMAT_CHECKED(FF_GAMEPAD_MODULE_NAME, index, &options->moduleArgs, FF_PRINT_TYPE_DEFAULT, ((FFformatarg[]) {
|
||||
FF_FORMAT_ARG(device->name, "name"),
|
||||
FF_FORMAT_ARG(device->serial, "serial"),
|
||||
FF_FORMAT_ARG(percentageNum, "battery-percentage"),
|
||||
FF_FORMAT_ARG(percentageBar, "battery-percentage-bar"),
|
||||
FF_ARG(device->name, "name"),
|
||||
FF_ARG(device->serial, "serial"),
|
||||
FF_ARG(percentageNum, "battery-percentage"),
|
||||
FF_ARG(percentageBar, "battery-percentage-bar"),
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
+20
-20
@@ -135,26 +135,26 @@ static void printGPUResult(FFGPUOptions* options, uint8_t index, const FFGPUResu
|
||||
}
|
||||
|
||||
FF_PRINT_FORMAT_CHECKED(FF_GPU_MODULE_NAME, index, &options->moduleArgs, FF_PRINT_TYPE_DEFAULT, ((FFformatarg[]) {
|
||||
FF_FORMAT_ARG(gpu->vendor, "vendor"),
|
||||
FF_FORMAT_ARG(gpu->name, "name"),
|
||||
FF_FORMAT_ARG(gpu->driver, "driver"),
|
||||
FF_FORMAT_ARG(tempStr, "temperature"),
|
||||
FF_FORMAT_ARG(gpu->coreCount, "core-count"),
|
||||
FF_FORMAT_ARG(type, "type"),
|
||||
FF_FORMAT_ARG(dTotal, "dedicated-total"),
|
||||
FF_FORMAT_ARG(dUsed, "dedicated-used"),
|
||||
FF_FORMAT_ARG(sTotal, "shared-total"),
|
||||
FF_FORMAT_ARG(sUsed, "shared-used"),
|
||||
FF_FORMAT_ARG(gpu->platformApi, "platform-api"),
|
||||
FF_FORMAT_ARG(frequency, "frequency"),
|
||||
FF_FORMAT_ARG(index, "index"),
|
||||
FF_FORMAT_ARG(dPercentNum, "dedicated-percentage-num"),
|
||||
FF_FORMAT_ARG(dPercentBar, "dedicated-percentage-bar"),
|
||||
FF_FORMAT_ARG(sPercentNum, "shared-percentage-num"),
|
||||
FF_FORMAT_ARG(sPercentBar, "shared-percentage-bar"),
|
||||
FF_FORMAT_ARG(coreUsageNum, "core-usage-num"),
|
||||
FF_FORMAT_ARG(coreUsageBar, "core-usage-bar"),
|
||||
FF_FORMAT_ARG(gpu->memoryType, "memory-type"),
|
||||
FF_ARG(gpu->vendor, "vendor"),
|
||||
FF_ARG(gpu->name, "name"),
|
||||
FF_ARG(gpu->driver, "driver"),
|
||||
FF_ARG(tempStr, "temperature"),
|
||||
FF_ARG(gpu->coreCount, "core-count"),
|
||||
FF_ARG(type, "type"),
|
||||
FF_ARG(dTotal, "dedicated-total"),
|
||||
FF_ARG(dUsed, "dedicated-used"),
|
||||
FF_ARG(sTotal, "shared-total"),
|
||||
FF_ARG(sUsed, "shared-used"),
|
||||
FF_ARG(gpu->platformApi, "platform-api"),
|
||||
FF_ARG(frequency, "frequency"),
|
||||
FF_ARG(index, "index"),
|
||||
FF_ARG(dPercentNum, "dedicated-percentage-num"),
|
||||
FF_ARG(dPercentBar, "dedicated-percentage-bar"),
|
||||
FF_ARG(sPercentNum, "shared-percentage-num"),
|
||||
FF_ARG(sPercentBar, "shared-percentage-bar"),
|
||||
FF_ARG(coreUsageNum, "core-usage-num"),
|
||||
FF_ARG(coreUsageBar, "core-usage-bar"),
|
||||
FF_ARG(gpu->memoryType, "memory-type"),
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,13 +48,13 @@ bool ffPrintHost(FFHostOptions* options)
|
||||
else
|
||||
{
|
||||
FF_PRINT_FORMAT_CHECKED(FF_HOST_MODULE_NAME, 0, &options->moduleArgs, FF_PRINT_TYPE_DEFAULT, ((FFformatarg[]) {
|
||||
FF_FORMAT_ARG(host.family, "family"),
|
||||
FF_FORMAT_ARG(host.name, "name"),
|
||||
FF_FORMAT_ARG(host.version, "version"),
|
||||
FF_FORMAT_ARG(host.sku, "sku"),
|
||||
FF_FORMAT_ARG(host.vendor, "vendor"),
|
||||
FF_FORMAT_ARG(host.serial, "serial"),
|
||||
FF_FORMAT_ARG(host.uuid, "uuid"),
|
||||
FF_ARG(host.family, "family"),
|
||||
FF_ARG(host.name, "name"),
|
||||
FF_ARG(host.version, "version"),
|
||||
FF_ARG(host.sku, "sku"),
|
||||
FF_ARG(host.vendor, "vendor"),
|
||||
FF_ARG(host.serial, "serial"),
|
||||
FF_ARG(host.uuid, "uuid"),
|
||||
}));
|
||||
}
|
||||
success = true;
|
||||
|
||||
@@ -35,8 +35,8 @@ bool ffPrintIcons(FFIconsOptions* options)
|
||||
else
|
||||
{
|
||||
FF_PRINT_FORMAT_CHECKED(FF_ICONS_MODULE_NAME, 0, &options->moduleArgs, FF_PRINT_TYPE_DEFAULT, ((FFformatarg[]){
|
||||
FF_FORMAT_ARG(result.icons1, "icons1"),
|
||||
FF_FORMAT_ARG(result.icons2, "icons2"),
|
||||
FF_ARG(result.icons1, "icons1"),
|
||||
FF_ARG(result.icons2, "icons2"),
|
||||
}));
|
||||
}
|
||||
success = true;
|
||||
|
||||
@@ -36,10 +36,10 @@ bool ffPrintInitSystem(FFInitSystemOptions* options)
|
||||
else
|
||||
{
|
||||
FF_PRINT_FORMAT_CHECKED(FF_INITSYSTEM_DISPLAY_NAME, 0, &options->moduleArgs, FF_PRINT_TYPE_DEFAULT, ((FFformatarg[]) {
|
||||
FF_FORMAT_ARG(result.name, "name"),
|
||||
FF_FORMAT_ARG(result.exe, "exe"),
|
||||
FF_FORMAT_ARG(result.version, "version"),
|
||||
FF_FORMAT_ARG(result.pid, "pid"),
|
||||
FF_ARG(result.name, "name"),
|
||||
FF_ARG(result.exe, "exe"),
|
||||
FF_ARG(result.version, "version"),
|
||||
FF_ARG(result.pid, "pid"),
|
||||
}));
|
||||
}
|
||||
success = true;
|
||||
|
||||
@@ -17,11 +17,11 @@ bool ffPrintKernel(FFKernelOptions* options)
|
||||
FF_STRBUF_AUTO_DESTROY str = ffStrbufCreate();
|
||||
ffSizeAppendNum(info->pageSize, &str);
|
||||
FF_PRINT_FORMAT_CHECKED(FF_KERNEL_MODULE_NAME, 0, &options->moduleArgs, FF_PRINT_TYPE_DEFAULT, ((FFformatarg[]){
|
||||
FF_FORMAT_ARG(info->name, "sysname"),
|
||||
FF_FORMAT_ARG(info->release, "release"),
|
||||
FF_FORMAT_ARG(info->version, "version"),
|
||||
FF_FORMAT_ARG(info->architecture, "arch"),
|
||||
FF_FORMAT_ARG(str, "page-size"),
|
||||
FF_ARG(info->name, "sysname"),
|
||||
FF_ARG(info->release, "release"),
|
||||
FF_ARG(info->version, "version"),
|
||||
FF_ARG(info->architecture, "arch"),
|
||||
FF_ARG(str, "page-size"),
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
@@ -15,8 +15,8 @@ static void printDevice(FFKeyboardOptions* options, const FFKeyboardDevice* devi
|
||||
else
|
||||
{
|
||||
FF_PRINT_FORMAT_CHECKED(FF_KEYBOARD_MODULE_NAME, index, &options->moduleArgs, FF_PRINT_TYPE_DEFAULT, ((FFformatarg[]) {
|
||||
FF_FORMAT_ARG(device->name, "name"),
|
||||
FF_FORMAT_ARG(device->serial, "serial"),
|
||||
FF_ARG(device->name, "name"),
|
||||
FF_ARG(device->serial, "serial"),
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -38,9 +38,9 @@ bool ffPrintLM(FFLMOptions* options)
|
||||
else
|
||||
{
|
||||
FF_PRINT_FORMAT_CHECKED(FF_LM_MODULE_NAME, 0, &options->moduleArgs, FF_PRINT_TYPE_DEFAULT, ((FFformatarg[]){
|
||||
FF_FORMAT_ARG(result.service, "service"),
|
||||
FF_FORMAT_ARG(result.type, "type"),
|
||||
FF_FORMAT_ARG(result.version, "version"),
|
||||
FF_ARG(result.service, "service"),
|
||||
FF_ARG(result.type, "type"),
|
||||
FF_ARG(result.version, "version"),
|
||||
}));
|
||||
}
|
||||
success = true;
|
||||
|
||||
@@ -47,9 +47,9 @@ bool ffPrintLoadavg(FFLoadavgOptions* options)
|
||||
{
|
||||
ffStrbufClear(&buffer);
|
||||
FF_PARSE_FORMAT_STRING_CHECKED(&buffer, &options->moduleArgs.key, ((FFformatarg[]) {
|
||||
FF_FORMAT_ARG(index, "index"),
|
||||
FF_FORMAT_ARG(duration, "duration"),
|
||||
FF_FORMAT_ARG(options->moduleArgs.keyIcon, "icon"),
|
||||
FF_ARG(index, "index"),
|
||||
FF_ARG(duration, "duration"),
|
||||
FF_ARG(options->moduleArgs.keyIcon, "icon"),
|
||||
}));
|
||||
}
|
||||
|
||||
@@ -83,9 +83,9 @@ bool ffPrintLoadavg(FFLoadavgOptions* options)
|
||||
else
|
||||
{
|
||||
FF_PRINT_FORMAT_CHECKED(FF_LOADAVG_MODULE_NAME, 0, &options->moduleArgs, FF_PRINT_TYPE_DEFAULT, ((FFformatarg[]){
|
||||
FF_FORMAT_ARG(result[0], "loadavg1"),
|
||||
FF_FORMAT_ARG(result[1], "loadavg2"),
|
||||
FF_FORMAT_ARG(result[2], "loadavg3"),
|
||||
FF_ARG(result[0], "loadavg1"),
|
||||
FF_ARG(result[1], "loadavg2"),
|
||||
FF_ARG(result[2], "loadavg3"),
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ bool ffPrintLocale(FFLocaleOptions* options)
|
||||
else
|
||||
{
|
||||
FF_PRINT_FORMAT_CHECKED(FF_LOCALE_MODULE_NAME, 0, &options->moduleArgs, FF_PRINT_TYPE_DEFAULT, ((FFformatarg[]){
|
||||
FF_FORMAT_ARG(locale, "result")
|
||||
FF_ARG(locale, "result")
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
@@ -25,10 +25,10 @@ static void formatKey(const FFLocalIpOptions* options, FFLocalIpResult* ip, uint
|
||||
{
|
||||
ffStrbufClear(key);
|
||||
FF_PARSE_FORMAT_STRING_CHECKED(key, &options->moduleArgs.key, ((FFformatarg[]) {
|
||||
FF_FORMAT_ARG(index, "index"),
|
||||
FF_FORMAT_ARG(ip->name, "ifname"),
|
||||
FF_FORMAT_ARG(ip->mac, "mac"),
|
||||
FF_FORMAT_ARG(options->moduleArgs.keyIcon, "icon"),
|
||||
FF_ARG(index, "index"),
|
||||
FF_ARG(ip->name, "ifname"),
|
||||
FF_ARG(ip->mac, "mac"),
|
||||
FF_ARG(options->moduleArgs.keyIcon, "icon"),
|
||||
}));
|
||||
}
|
||||
}
|
||||
@@ -151,14 +151,14 @@ bool ffPrintLocalIp(FFLocalIpOptions* options)
|
||||
if (ip->speed > 0)
|
||||
appendSpeed(ip, &buffer);
|
||||
FF_PRINT_FORMAT_CHECKED(key.chars, 0, &options->moduleArgs, FF_PRINT_TYPE_NO_CUSTOM_KEY, ((FFformatarg[]){
|
||||
FF_FORMAT_ARG(ip->ipv4, "ipv4"),
|
||||
FF_FORMAT_ARG(ip->ipv6, "ipv6"),
|
||||
FF_FORMAT_ARG(ip->mac, "mac"),
|
||||
FF_FORMAT_ARG(ip->name, "ifname"),
|
||||
FF_FORMAT_ARG(ip->defaultRoute, "is-default-route"),
|
||||
FF_FORMAT_ARG(ip->mtu, "mtu"),
|
||||
FF_FORMAT_ARG(buffer, "speed"),
|
||||
FF_FORMAT_ARG(ip->flags, "flags"),
|
||||
FF_ARG(ip->ipv4, "ipv4"),
|
||||
FF_ARG(ip->ipv6, "ipv6"),
|
||||
FF_ARG(ip->mac, "mac"),
|
||||
FF_ARG(ip->name, "ifname"),
|
||||
FF_ARG(ip->defaultRoute, "is-default-route"),
|
||||
FF_ARG(ip->mtu, "mtu"),
|
||||
FF_ARG(buffer, "speed"),
|
||||
FF_ARG(ip->flags, "flags"),
|
||||
}));
|
||||
}
|
||||
++index;
|
||||
|
||||
@@ -94,14 +94,14 @@ bool ffPrintMedia(FFMediaOptions* options)
|
||||
else
|
||||
{
|
||||
FF_PRINT_FORMAT_CHECKED(FF_MEDIA_MODULE_NAME, 0, &options->moduleArgs, FF_PRINT_TYPE_DEFAULT, ((FFformatarg[]) {
|
||||
FF_FORMAT_ARG(songPretty, "combined"),
|
||||
FF_FORMAT_ARG(media->song, "title"),
|
||||
FF_FORMAT_ARG(media->artist, "artist"),
|
||||
FF_FORMAT_ARG(media->album, "album"),
|
||||
FF_FORMAT_ARG(media->status, "status"),
|
||||
FF_FORMAT_ARG(media->player, "player-name"),
|
||||
FF_FORMAT_ARG(media->playerId, "player-id"),
|
||||
FF_FORMAT_ARG(media->url, "url"),
|
||||
FF_ARG(songPretty, "combined"),
|
||||
FF_ARG(media->song, "title"),
|
||||
FF_ARG(media->artist, "artist"),
|
||||
FF_ARG(media->album, "album"),
|
||||
FF_ARG(media->status, "status"),
|
||||
FF_ARG(media->player, "player-name"),
|
||||
FF_ARG(media->playerId, "player-id"),
|
||||
FF_ARG(media->url, "url"),
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
@@ -63,10 +63,10 @@ bool ffPrintMemory(FFMemoryOptions* options)
|
||||
ffPercentAppendBar(&percentageBar, percentage, options->percent, &options->moduleArgs);
|
||||
|
||||
FF_PRINT_FORMAT_CHECKED(FF_MEMORY_MODULE_NAME, 0, &options->moduleArgs, FF_PRINT_TYPE_DEFAULT, ((FFformatarg[]){
|
||||
FF_FORMAT_ARG(usedPretty, "used"),
|
||||
FF_FORMAT_ARG(totalPretty, "total"),
|
||||
FF_FORMAT_ARG(percentageNum, "percentage"),
|
||||
FF_FORMAT_ARG(percentageBar, "percentage-bar"),
|
||||
FF_ARG(usedPretty, "used"),
|
||||
FF_ARG(totalPretty, "total"),
|
||||
FF_ARG(percentageNum, "percentage"),
|
||||
FF_ARG(percentageBar, "percentage-bar"),
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
@@ -35,9 +35,9 @@ bool ffPrintMonitor(FFMonitorOptions* options)
|
||||
{
|
||||
uint32_t moduleIndex = result->displays.length == 1 ? 0 : index + 1;
|
||||
FF_PARSE_FORMAT_STRING_CHECKED(&key, &options->moduleArgs.key, ((FFformatarg[]) {
|
||||
FF_FORMAT_ARG(moduleIndex, "index"),
|
||||
FF_FORMAT_ARG(display->name, "name"),
|
||||
FF_FORMAT_ARG(options->moduleArgs.keyIcon, "icon"),
|
||||
FF_ARG(moduleIndex, "index"),
|
||||
FF_ARG(display->name, "name"),
|
||||
FF_ARG(options->moduleArgs.keyIcon, "icon"),
|
||||
}));
|
||||
}
|
||||
|
||||
@@ -66,18 +66,18 @@ bool ffPrintMonitor(FFMonitorOptions* options)
|
||||
buf[0] = '\0';
|
||||
|
||||
FF_PRINT_FORMAT_CHECKED(key.chars, 0, &options->moduleArgs, FF_PRINT_TYPE_NO_CUSTOM_KEY, ((FFformatarg[]) {
|
||||
FF_FORMAT_ARG(display->name, "name"),
|
||||
FF_FORMAT_ARG(display->width, "width"),
|
||||
FF_FORMAT_ARG(display->height, "height"),
|
||||
FF_FORMAT_ARG(display->physicalWidth, "physical-width"),
|
||||
FF_FORMAT_ARG(display->physicalHeight, "physical-height"),
|
||||
FF_FORMAT_ARG(inch, "inch"),
|
||||
FF_FORMAT_ARG(ppi, "ppi"),
|
||||
FF_FORMAT_ARG(display->manufactureYear, "manufacture-year"),
|
||||
FF_FORMAT_ARG(display->manufactureWeek, "manufacture-week"),
|
||||
FF_FORMAT_ARG(buf, "serial"),
|
||||
FF_FORMAT_ARG(display->refreshRate, "refresh-rate"),
|
||||
FF_FORMAT_ARG(hdrCompatible, "hdr-compatible"),
|
||||
FF_ARG(display->name, "name"),
|
||||
FF_ARG(display->width, "width"),
|
||||
FF_ARG(display->height, "height"),
|
||||
FF_ARG(display->physicalWidth, "physical-width"),
|
||||
FF_ARG(display->physicalHeight, "physical-height"),
|
||||
FF_ARG(inch, "inch"),
|
||||
FF_ARG(ppi, "ppi"),
|
||||
FF_ARG(display->manufactureYear, "manufacture-year"),
|
||||
FF_ARG(display->manufactureWeek, "manufacture-week"),
|
||||
FF_ARG(buf, "serial"),
|
||||
FF_ARG(display->refreshRate, "refresh-rate"),
|
||||
FF_ARG(hdrCompatible, "hdr-compatible"),
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
@@ -15,8 +15,8 @@ static void printDevice(FFMouseOptions* options, const FFMouseDevice* device, ui
|
||||
else
|
||||
{
|
||||
FF_PRINT_FORMAT_CHECKED(FF_MOUSE_MODULE_NAME, index, &options->moduleArgs, FF_PRINT_TYPE_DEFAULT, ((FFformatarg[]) {
|
||||
FF_FORMAT_ARG(device->name, "name"),
|
||||
FF_FORMAT_ARG(device->serial, "serial"),
|
||||
FF_ARG(device->name, "name"),
|
||||
FF_ARG(device->serial, "serial"),
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
+15
-15
@@ -25,9 +25,9 @@ static void formatKey(const FFNetIOOptions* options, FFNetIOResult* inf, uint32_
|
||||
{
|
||||
ffStrbufClear(key);
|
||||
FF_PARSE_FORMAT_STRING_CHECKED(key, &options->moduleArgs.key, ((FFformatarg[]){
|
||||
FF_FORMAT_ARG(index, "index"),
|
||||
FF_FORMAT_ARG(inf->name, "name"),
|
||||
FF_FORMAT_ARG(options->moduleArgs.keyIcon, "icon"),
|
||||
FF_ARG(index, "index"),
|
||||
FF_ARG(inf->name, "name"),
|
||||
FF_ARG(options->moduleArgs.keyIcon, "icon"),
|
||||
}));
|
||||
}
|
||||
}
|
||||
@@ -80,18 +80,18 @@ bool ffPrintNetIO(FFNetIOOptions* options)
|
||||
if (!options->detectTotal) ffStrbufAppendS(&buffer2, "/s");
|
||||
|
||||
FF_PRINT_FORMAT_CHECKED(key.chars, 0, &options->moduleArgs, FF_PRINT_TYPE_NO_CUSTOM_KEY, ((FFformatarg[]){
|
||||
FF_FORMAT_ARG(buffer, "rx-size"),
|
||||
FF_FORMAT_ARG(buffer2, "tx-size"),
|
||||
FF_FORMAT_ARG(inf->name, "ifname"),
|
||||
FF_FORMAT_ARG(inf->defaultRoute, "is-default-route"),
|
||||
FF_FORMAT_ARG(inf->txBytes, "tx-bytes"),
|
||||
FF_FORMAT_ARG(inf->rxBytes, "rx-bytes"),
|
||||
FF_FORMAT_ARG(inf->txPackets, "tx-packets"),
|
||||
FF_FORMAT_ARG(inf->rxPackets, "rx-packets"),
|
||||
FF_FORMAT_ARG(inf->rxErrors, "rx-errors"),
|
||||
FF_FORMAT_ARG(inf->txErrors, "tx-errors"),
|
||||
FF_FORMAT_ARG(inf->rxDrops, "rx-drops"),
|
||||
FF_FORMAT_ARG(inf->txDrops, "tx-drops"),
|
||||
FF_ARG(buffer, "rx-size"),
|
||||
FF_ARG(buffer2, "tx-size"),
|
||||
FF_ARG(inf->name, "ifname"),
|
||||
FF_ARG(inf->defaultRoute, "is-default-route"),
|
||||
FF_ARG(inf->txBytes, "tx-bytes"),
|
||||
FF_ARG(inf->rxBytes, "rx-bytes"),
|
||||
FF_ARG(inf->txPackets, "tx-packets"),
|
||||
FF_ARG(inf->rxPackets, "rx-packets"),
|
||||
FF_ARG(inf->rxErrors, "rx-errors"),
|
||||
FF_ARG(inf->txErrors, "tx-errors"),
|
||||
FF_ARG(inf->rxDrops, "rx-drops"),
|
||||
FF_ARG(inf->txDrops, "tx-drops"),
|
||||
}));
|
||||
}
|
||||
++index;
|
||||
|
||||
@@ -23,9 +23,9 @@ bool ffPrintOpenCL(FFOpenCLOptions* options)
|
||||
else
|
||||
{
|
||||
FF_PRINT_FORMAT_CHECKED(FF_OPENCL_MODULE_NAME, 0, &options->moduleArgs, FF_PRINT_TYPE_DEFAULT, ((FFformatarg[]) {
|
||||
FF_FORMAT_ARG(result->version, "version"),
|
||||
FF_FORMAT_ARG(result->name, "name"),
|
||||
FF_FORMAT_ARG(result->vendor, "vendor"),
|
||||
FF_ARG(result->version, "version"),
|
||||
FF_ARG(result->name, "name"),
|
||||
FF_ARG(result->vendor, "vendor"),
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
@@ -29,11 +29,11 @@ bool ffPrintOpenGL(FFOpenGLOptions* options)
|
||||
else
|
||||
{
|
||||
FF_PRINT_FORMAT_CHECKED(FF_OPENGL_MODULE_NAME, 0, &options->moduleArgs, FF_PRINT_TYPE_DEFAULT, ((FFformatarg[]) {
|
||||
FF_FORMAT_ARG(result.version, "version"),
|
||||
FF_FORMAT_ARG(result.renderer, "renderer"),
|
||||
FF_FORMAT_ARG(result.vendor, "vendor"),
|
||||
FF_FORMAT_ARG(result.slv, "slv"),
|
||||
FF_FORMAT_ARG(result.library, "library"),
|
||||
FF_ARG(result.version, "version"),
|
||||
FF_ARG(result.renderer, "renderer"),
|
||||
FF_ARG(result.vendor, "vendor"),
|
||||
FF_ARG(result.slv, "slv"),
|
||||
FF_ARG(result.library, "library"),
|
||||
}));
|
||||
}
|
||||
success = true;
|
||||
|
||||
+16
-16
@@ -70,9 +70,9 @@ bool ffPrintOS(FFOSOptions* options)
|
||||
else
|
||||
{
|
||||
FF_PARSE_FORMAT_STRING_CHECKED(&key, &options->moduleArgs.key, ((FFformatarg[]) {
|
||||
FF_FORMAT_ARG(instance.state.platform.sysinfo.name, "sysname"),
|
||||
FF_FORMAT_ARG(os->name, "name"),
|
||||
FF_FORMAT_ARG(options->moduleArgs.keyIcon, "icon"),
|
||||
FF_ARG(instance.state.platform.sysinfo.name, "sysname"),
|
||||
FF_ARG(os->name, "name"),
|
||||
FF_ARG(options->moduleArgs.keyIcon, "icon"),
|
||||
}));
|
||||
}
|
||||
|
||||
@@ -98,19 +98,19 @@ bool ffPrintOS(FFOSOptions* options)
|
||||
else
|
||||
{
|
||||
FF_PRINT_FORMAT_CHECKED(key.chars, 0, &options->moduleArgs, FF_PRINT_TYPE_NO_CUSTOM_KEY, ((FFformatarg[]){
|
||||
FF_FORMAT_ARG(instance.state.platform.sysinfo.name, "sysname"),
|
||||
FF_FORMAT_ARG(os->name, "name"),
|
||||
FF_FORMAT_ARG(os->prettyName, "pretty-name"),
|
||||
FF_FORMAT_ARG(os->id, "id"),
|
||||
FF_FORMAT_ARG(os->idLike, "id-like"),
|
||||
FF_FORMAT_ARG(os->variant, "variant"),
|
||||
FF_FORMAT_ARG(os->variantID, "variant-id"),
|
||||
FF_FORMAT_ARG(os->version, "version"),
|
||||
FF_FORMAT_ARG(os->versionID, "version-id"),
|
||||
FF_FORMAT_ARG(os->codename, "codename"),
|
||||
FF_FORMAT_ARG(os->buildID, "build-id"),
|
||||
FF_FORMAT_ARG(instance.state.platform.sysinfo.architecture, "arch"),
|
||||
FF_FORMAT_ARG(instance.state.platform.sysinfo.release, "kernel-release"),
|
||||
FF_ARG(instance.state.platform.sysinfo.name, "sysname"),
|
||||
FF_ARG(os->name, "name"),
|
||||
FF_ARG(os->prettyName, "pretty-name"),
|
||||
FF_ARG(os->id, "id"),
|
||||
FF_ARG(os->idLike, "id-like"),
|
||||
FF_ARG(os->variant, "variant"),
|
||||
FF_ARG(os->variantID, "variant-id"),
|
||||
FF_ARG(os->version, "version"),
|
||||
FF_ARG(os->versionID, "version-id"),
|
||||
FF_ARG(os->codename, "codename"),
|
||||
FF_ARG(os->buildID, "build-id"),
|
||||
FF_ARG(instance.state.platform.sysinfo.architecture, "arch"),
|
||||
FF_ARG(instance.state.platform.sysinfo.release, "kernel-release"),
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
@@ -154,55 +154,55 @@ bool ffPrintPackages(FFPackagesOptions* options)
|
||||
else
|
||||
{
|
||||
FF_PRINT_FORMAT_CHECKED(FF_PACKAGES_MODULE_NAME, 0, &options->moduleArgs, FF_PRINT_TYPE_DEFAULT, ((FFformatarg[]){
|
||||
FF_FORMAT_ARG(counts.all, "all"),
|
||||
FF_FORMAT_ARG(counts.pacman, "pacman"),
|
||||
FF_FORMAT_ARG(counts.pacmanBranch, "pacman-branch"),
|
||||
FF_FORMAT_ARG(counts.dpkg, "dpkg"),
|
||||
FF_FORMAT_ARG(counts.rpm, "rpm"),
|
||||
FF_FORMAT_ARG(counts.emerge, "emerge"),
|
||||
FF_FORMAT_ARG(counts.eopkg, "eopkg"),
|
||||
FF_FORMAT_ARG(counts.xbps, "xbps"),
|
||||
FF_FORMAT_ARG(counts.nixSystem, "nix-system"),
|
||||
FF_FORMAT_ARG(counts.nixUser, "nix-user"),
|
||||
FF_FORMAT_ARG(counts.nixDefault, "nix-default"),
|
||||
FF_FORMAT_ARG(counts.apk, "apk"),
|
||||
FF_FORMAT_ARG(counts.pkg, "pkg"),
|
||||
FF_FORMAT_ARG(counts.flatpakSystem, "flatpak-system"),
|
||||
FF_FORMAT_ARG(counts.flatpakUser, "flatpak-user"),
|
||||
FF_FORMAT_ARG(counts.snap, "snap"),
|
||||
FF_FORMAT_ARG(counts.brew, "brew"),
|
||||
FF_FORMAT_ARG(counts.brewCask, "brew-cask"),
|
||||
FF_FORMAT_ARG(counts.macports, "macports"),
|
||||
FF_FORMAT_ARG(counts.scoopUser, "scoop-user"),
|
||||
FF_FORMAT_ARG(counts.scoopGlobal, "scoop-global"),
|
||||
FF_FORMAT_ARG(counts.choco, "choco"),
|
||||
FF_FORMAT_ARG(counts.pkgtool, "pkgtool"),
|
||||
FF_FORMAT_ARG(counts.paludis, "paludis"),
|
||||
FF_FORMAT_ARG(counts.winget, "winget"),
|
||||
FF_FORMAT_ARG(counts.opkg, "opkg"),
|
||||
FF_FORMAT_ARG(counts.amSystem, "am-system"),
|
||||
FF_FORMAT_ARG(counts.sorcery, "sorcery"),
|
||||
FF_FORMAT_ARG(counts.lpkg, "lpkg"),
|
||||
FF_FORMAT_ARG(counts.lpkgbuild, "lpkgbuild"),
|
||||
FF_FORMAT_ARG(counts.guixSystem, "guix-system"),
|
||||
FF_FORMAT_ARG(counts.guixUser, "guix-user"),
|
||||
FF_FORMAT_ARG(counts.guixHome, "guix-home"),
|
||||
FF_FORMAT_ARG(counts.linglong, "linglong"),
|
||||
FF_FORMAT_ARG(counts.pacstall, "pacstall"),
|
||||
FF_FORMAT_ARG(counts.mport, "mport"),
|
||||
FF_FORMAT_ARG(counts.amUser, "am-user"),
|
||||
FF_FORMAT_ARG(counts.pkgsrc, "pkgsrc"),
|
||||
FF_FORMAT_ARG(counts.hpkgSystem, "hpkg-system"),
|
||||
FF_FORMAT_ARG(counts.hpkgUser, "hpkg-user"),
|
||||
FF_FORMAT_ARG(counts.pisi, "pisi"),
|
||||
FF_FORMAT_ARG(counts.soar, "soar"),
|
||||
FF_FORMAT_ARG(counts.kiss, "kiss"),
|
||||
FF_FORMAT_ARG(counts.moss, "moss"),
|
||||
FF_FORMAT_ARG(nixAll, "nix-all"),
|
||||
FF_FORMAT_ARG(flatpakAll, "flatpak-all"),
|
||||
FF_FORMAT_ARG(brewAll, "brew-all"),
|
||||
FF_FORMAT_ARG(guixAll, "guix-all"),
|
||||
FF_FORMAT_ARG(hpkgAll, "hpkg-all"),
|
||||
FF_ARG(counts.all, "all"),
|
||||
FF_ARG(counts.pacman, "pacman"),
|
||||
FF_ARG(counts.pacmanBranch, "pacman-branch"),
|
||||
FF_ARG(counts.dpkg, "dpkg"),
|
||||
FF_ARG(counts.rpm, "rpm"),
|
||||
FF_ARG(counts.emerge, "emerge"),
|
||||
FF_ARG(counts.eopkg, "eopkg"),
|
||||
FF_ARG(counts.xbps, "xbps"),
|
||||
FF_ARG(counts.nixSystem, "nix-system"),
|
||||
FF_ARG(counts.nixUser, "nix-user"),
|
||||
FF_ARG(counts.nixDefault, "nix-default"),
|
||||
FF_ARG(counts.apk, "apk"),
|
||||
FF_ARG(counts.pkg, "pkg"),
|
||||
FF_ARG(counts.flatpakSystem, "flatpak-system"),
|
||||
FF_ARG(counts.flatpakUser, "flatpak-user"),
|
||||
FF_ARG(counts.snap, "snap"),
|
||||
FF_ARG(counts.brew, "brew"),
|
||||
FF_ARG(counts.brewCask, "brew-cask"),
|
||||
FF_ARG(counts.macports, "macports"),
|
||||
FF_ARG(counts.scoopUser, "scoop-user"),
|
||||
FF_ARG(counts.scoopGlobal, "scoop-global"),
|
||||
FF_ARG(counts.choco, "choco"),
|
||||
FF_ARG(counts.pkgtool, "pkgtool"),
|
||||
FF_ARG(counts.paludis, "paludis"),
|
||||
FF_ARG(counts.winget, "winget"),
|
||||
FF_ARG(counts.opkg, "opkg"),
|
||||
FF_ARG(counts.amSystem, "am-system"),
|
||||
FF_ARG(counts.sorcery, "sorcery"),
|
||||
FF_ARG(counts.lpkg, "lpkg"),
|
||||
FF_ARG(counts.lpkgbuild, "lpkgbuild"),
|
||||
FF_ARG(counts.guixSystem, "guix-system"),
|
||||
FF_ARG(counts.guixUser, "guix-user"),
|
||||
FF_ARG(counts.guixHome, "guix-home"),
|
||||
FF_ARG(counts.linglong, "linglong"),
|
||||
FF_ARG(counts.pacstall, "pacstall"),
|
||||
FF_ARG(counts.mport, "mport"),
|
||||
FF_ARG(counts.amUser, "am-user"),
|
||||
FF_ARG(counts.pkgsrc, "pkgsrc"),
|
||||
FF_ARG(counts.hpkgSystem, "hpkg-system"),
|
||||
FF_ARG(counts.hpkgUser, "hpkg-user"),
|
||||
FF_ARG(counts.pisi, "pisi"),
|
||||
FF_ARG(counts.soar, "soar"),
|
||||
FF_ARG(counts.kiss, "kiss"),
|
||||
FF_ARG(counts.moss, "moss"),
|
||||
FF_ARG(nixAll, "nix-all"),
|
||||
FF_ARG(flatpakAll, "flatpak-all"),
|
||||
FF_ARG(brewAll, "brew-all"),
|
||||
FF_ARG(guixAll, "guix-all"),
|
||||
FF_ARG(hpkgAll, "hpkg-all"),
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
@@ -23,10 +23,10 @@ static void formatKey(const FFPhysicalDiskOptions* options, FFPhysicalDiskResult
|
||||
{
|
||||
ffStrbufClear(key);
|
||||
FF_PARSE_FORMAT_STRING_CHECKED(key, &options->moduleArgs.key, ((FFformatarg[]){
|
||||
FF_FORMAT_ARG(index, "index"),
|
||||
FF_FORMAT_ARG(dev->name, "name"),
|
||||
FF_FORMAT_ARG(dev->devPath, "dev-path"),
|
||||
FF_FORMAT_ARG(options->moduleArgs.keyIcon, "icon"),
|
||||
FF_ARG(index, "index"),
|
||||
FF_ARG(dev->name, "name"),
|
||||
FF_ARG(dev->devPath, "dev-path"),
|
||||
FF_ARG(options->moduleArgs.keyIcon, "icon"),
|
||||
}));
|
||||
}
|
||||
}
|
||||
@@ -108,16 +108,16 @@ bool ffPrintPhysicalDisk(FFPhysicalDiskOptions* options)
|
||||
if (dev->type & FF_PHYSICALDISK_TYPE_READWRITE)
|
||||
readOnlyType = "Read-write";
|
||||
FF_PRINT_FORMAT_CHECKED(key.chars, 0, &options->moduleArgs, FF_PRINT_TYPE_NO_CUSTOM_KEY, ((FFformatarg[]){
|
||||
FF_FORMAT_ARG(buffer, "size"),
|
||||
FF_FORMAT_ARG(dev->name, "name"),
|
||||
FF_FORMAT_ARG(dev->interconnect, "interconnect"),
|
||||
FF_FORMAT_ARG(dev->devPath, "dev-path"),
|
||||
FF_FORMAT_ARG(dev->serial, "serial"),
|
||||
FF_FORMAT_ARG(physicalType, "physical-type"),
|
||||
FF_FORMAT_ARG(removableType, "removable-type"),
|
||||
FF_FORMAT_ARG(readOnlyType, "readonly-type"),
|
||||
FF_FORMAT_ARG(dev->revision, "revision"),
|
||||
FF_FORMAT_ARG(tempStr, "temperature"),
|
||||
FF_ARG(buffer, "size"),
|
||||
FF_ARG(dev->name, "name"),
|
||||
FF_ARG(dev->interconnect, "interconnect"),
|
||||
FF_ARG(dev->devPath, "dev-path"),
|
||||
FF_ARG(dev->serial, "serial"),
|
||||
FF_ARG(physicalType, "physical-type"),
|
||||
FF_ARG(removableType, "removable-type"),
|
||||
FF_ARG(readOnlyType, "readonly-type"),
|
||||
FF_ARG(dev->revision, "revision"),
|
||||
FF_ARG(tempStr, "temperature"),
|
||||
}));
|
||||
}
|
||||
++index;
|
||||
|
||||
@@ -78,18 +78,18 @@ bool ffPrintPhysicalMemory(FFPhysicalMemoryOptions* options)
|
||||
else
|
||||
{
|
||||
FF_PRINT_FORMAT_CHECKED(FF_PHYSICALMEMORY_DISPLAY_NAME, (uint8_t) (i + 1), &options->moduleArgs, FF_PRINT_TYPE_DEFAULT, ((FFformatarg[]) {
|
||||
FF_FORMAT_ARG(device->size, "bytes"),
|
||||
FF_FORMAT_ARG(prettySize, "size"),
|
||||
FF_FORMAT_ARG(device->maxSpeed, "max-speed"),
|
||||
FF_FORMAT_ARG(device->runningSpeed, "running-speed"),
|
||||
FF_FORMAT_ARG(device->type, "type"),
|
||||
FF_FORMAT_ARG(device->formFactor, "form-factor"),
|
||||
FF_FORMAT_ARG(device->locator, "locator"),
|
||||
FF_FORMAT_ARG(device->vendor, "vendor"),
|
||||
FF_FORMAT_ARG(device->serial, "serial"),
|
||||
FF_FORMAT_ARG(device->partNumber, "part-number"),
|
||||
FF_FORMAT_ARG(device->ecc, "is-ecc-enabled"),
|
||||
FF_FORMAT_ARG(device->installed, "is-installed"),
|
||||
FF_ARG(device->size, "bytes"),
|
||||
FF_ARG(prettySize, "size"),
|
||||
FF_ARG(device->maxSpeed, "max-speed"),
|
||||
FF_ARG(device->runningSpeed, "running-speed"),
|
||||
FF_ARG(device->type, "type"),
|
||||
FF_ARG(device->formFactor, "form-factor"),
|
||||
FF_ARG(device->locator, "locator"),
|
||||
FF_ARG(device->vendor, "vendor"),
|
||||
FF_ARG(device->serial, "serial"),
|
||||
FF_ARG(device->partNumber, "part-number"),
|
||||
FF_ARG(device->ecc, "is-ecc-enabled"),
|
||||
FF_ARG(device->installed, "is-installed"),
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,10 +73,10 @@ bool ffPrintPlayer(FFPlayerOptions* options)
|
||||
else
|
||||
{
|
||||
FF_PRINT_FORMAT_CHECKED(FF_PLAYER_DISPLAY_NAME, 0, &options->moduleArgs, FF_PRINT_TYPE_DEFAULT, ((FFformatarg[]){
|
||||
FF_FORMAT_ARG(playerPretty, "player"),
|
||||
FF_FORMAT_ARG(media->player, "name"),
|
||||
FF_FORMAT_ARG(media->playerId, "id"),
|
||||
FF_FORMAT_ARG(media->url, "url"),
|
||||
FF_ARG(playerPretty, "player"),
|
||||
FF_ARG(media->player, "name"),
|
||||
FF_ARG(media->playerId, "id"),
|
||||
FF_ARG(media->url, "url"),
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
@@ -40,12 +40,12 @@ bool ffPrintPowerAdapter(FFPowerAdapterOptions* options)
|
||||
else
|
||||
{
|
||||
FF_PRINT_FORMAT_CHECKED(FF_POWERADAPTER_DISPLAY_NAME, i, &options->moduleArgs, FF_PRINT_TYPE_DEFAULT, ((FFformatarg[]){
|
||||
FF_FORMAT_ARG(result->watts, "watts"),
|
||||
FF_FORMAT_ARG(result->name, "name"),
|
||||
FF_FORMAT_ARG(result->manufacturer, "manufacturer"),
|
||||
FF_FORMAT_ARG(result->modelName, "model-name"),
|
||||
FF_FORMAT_ARG(result->description, "description"),
|
||||
FF_FORMAT_ARG(result->serial, "serial"),
|
||||
FF_ARG(result->watts, "watts"),
|
||||
FF_ARG(result->name, "name"),
|
||||
FF_ARG(result->manufacturer, "manufacturer"),
|
||||
FF_ARG(result->modelName, "model-name"),
|
||||
FF_ARG(result->description, "description"),
|
||||
FF_ARG(result->serial, "serial"),
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ bool ffPrintProcesses(FFProcessesOptions* options)
|
||||
else
|
||||
{
|
||||
FF_PRINT_FORMAT_CHECKED(FF_PROCESSES_MODULE_NAME, 0, &options->moduleArgs, FF_PRINT_TYPE_DEFAULT, ((FFformatarg[]){
|
||||
FF_FORMAT_ARG(numProcesses, "result")
|
||||
FF_ARG(numProcesses, "result")
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
@@ -30,8 +30,8 @@ bool ffPrintPublicIp(FFPublicIPOptions* options)
|
||||
else
|
||||
{
|
||||
FF_PRINT_FORMAT_CHECKED(FF_PUBLICIP_DISPLAY_NAME, 0, &options->moduleArgs, FF_PRINT_TYPE_DEFAULT, ((FFformatarg[]) {
|
||||
FF_FORMAT_ARG(result.ip, "ip"),
|
||||
FF_FORMAT_ARG(result.location, "location"),
|
||||
FF_ARG(result.ip, "ip"),
|
||||
FF_ARG(result.location, "location"),
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
@@ -30,14 +30,14 @@ bool ffPrintShell(FFShellOptions* options)
|
||||
else
|
||||
{
|
||||
FF_PRINT_FORMAT_CHECKED(FF_SHELL_MODULE_NAME, 0, &options->moduleArgs, FF_PRINT_TYPE_DEFAULT, ((FFformatarg[]) {
|
||||
FF_FORMAT_ARG(result->processName, "process-name"),
|
||||
FF_FORMAT_ARG(result->exe, "exe"),
|
||||
FF_FORMAT_ARG(result->exeName, "exe-name"),
|
||||
FF_FORMAT_ARG(result->version, "version"),
|
||||
FF_FORMAT_ARG(result->pid, "pid"),
|
||||
FF_FORMAT_ARG(result->prettyName, "pretty-name"),
|
||||
FF_FORMAT_ARG(result->exePath, "exe-path"),
|
||||
FF_FORMAT_ARG(result->tty, "tty"),
|
||||
FF_ARG(result->processName, "process-name"),
|
||||
FF_ARG(result->exe, "exe"),
|
||||
FF_ARG(result->exeName, "exe-name"),
|
||||
FF_ARG(result->version, "version"),
|
||||
FF_ARG(result->pid, "pid"),
|
||||
FF_ARG(result->prettyName, "pretty-name"),
|
||||
FF_ARG(result->exePath, "exe-path"),
|
||||
FF_ARG(result->tty, "tty"),
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
@@ -56,12 +56,12 @@ static void printDevice(FFSoundOptions* options, const FFSoundDevice* device, ui
|
||||
}
|
||||
|
||||
FF_PRINT_FORMAT_CHECKED(FF_SOUND_MODULE_NAME, index, &options->moduleArgs, FF_PRINT_TYPE_DEFAULT, ((FFformatarg[]) {
|
||||
FF_FORMAT_ARG(device->main, "is-main"),
|
||||
FF_FORMAT_ARG(device->name, "name"),
|
||||
FF_FORMAT_ARG(percentageNum, "volume-percentage"),
|
||||
FF_FORMAT_ARG(device->identifier, "identifier"),
|
||||
FF_FORMAT_ARG(percentageBar, "volume-percentage-bar"),
|
||||
FF_FORMAT_ARG(device->platformApi, "platform-api"),
|
||||
FF_ARG(device->main, "is-main"),
|
||||
FF_ARG(device->name, "name"),
|
||||
FF_ARG(percentageNum, "volume-percentage"),
|
||||
FF_ARG(device->identifier, "identifier"),
|
||||
FF_ARG(percentageBar, "volume-percentage-bar"),
|
||||
FF_ARG(device->platformApi, "platform-api"),
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,9 +21,9 @@ void printSwap(FFSwapOptions* options, uint8_t index, FFSwapResult* storage)
|
||||
{
|
||||
ffStrbufClear(&key);
|
||||
FF_PARSE_FORMAT_STRING_CHECKED(&key, &options->moduleArgs.key, ((FFformatarg[]) {
|
||||
FF_FORMAT_ARG(index, "index"),
|
||||
FF_FORMAT_ARG(storage->name, "name"),
|
||||
FF_FORMAT_ARG(options->moduleArgs.keyIcon, "icon"),
|
||||
FF_ARG(index, "index"),
|
||||
FF_ARG(storage->name, "name"),
|
||||
FF_ARG(options->moduleArgs.keyIcon, "icon"),
|
||||
}));
|
||||
}
|
||||
|
||||
@@ -82,11 +82,11 @@ void printSwap(FFSwapOptions* options, uint8_t index, FFSwapResult* storage)
|
||||
if (percentType & FF_PERCENTAGE_TYPE_BAR_BIT)
|
||||
ffPercentAppendBar(&percentageBar, percentage, options->percent, &options->moduleArgs);
|
||||
FF_PRINT_FORMAT_CHECKED(key.chars, index, &options->moduleArgs, FF_PRINT_TYPE_NO_CUSTOM_KEY, ((FFformatarg[]){
|
||||
FF_FORMAT_ARG(usedPretty, "used"),
|
||||
FF_FORMAT_ARG(totalPretty, "total"),
|
||||
FF_FORMAT_ARG(percentageNum, "percentage"),
|
||||
FF_FORMAT_ARG(percentageBar, "percentage-bar"),
|
||||
FF_FORMAT_ARG(storage->name, "name"),
|
||||
FF_ARG(usedPretty, "used"),
|
||||
FF_ARG(totalPretty, "total"),
|
||||
FF_ARG(percentageNum, "percentage"),
|
||||
FF_ARG(percentageBar, "percentage-bar"),
|
||||
FF_ARG(storage->name, "name"),
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,14 +26,14 @@ bool ffPrintTerminal(FFTerminalOptions* options)
|
||||
else
|
||||
{
|
||||
FF_PRINT_FORMAT_CHECKED(FF_TERMINAL_MODULE_NAME, 0, &options->moduleArgs, FF_PRINT_TYPE_DEFAULT, ((FFformatarg[]){
|
||||
FF_FORMAT_ARG(result->processName, "process-name"),
|
||||
FF_FORMAT_ARG(result->exe, "exe"),
|
||||
FF_FORMAT_ARG(result->exeName, "exe-name"),
|
||||
FF_FORMAT_ARG(result->pid, "pid"),
|
||||
FF_FORMAT_ARG(result->prettyName, "pretty-name"),
|
||||
FF_FORMAT_ARG(result->version, "version"),
|
||||
FF_FORMAT_ARG(result->exePath, "exe-path"),
|
||||
FF_FORMAT_ARG(result->tty, "tty"),
|
||||
FF_ARG(result->processName, "process-name"),
|
||||
FF_ARG(result->exe, "exe"),
|
||||
FF_ARG(result->exeName, "exe-name"),
|
||||
FF_ARG(result->pid, "pid"),
|
||||
FF_ARG(result->prettyName, "pretty-name"),
|
||||
FF_ARG(result->version, "version"),
|
||||
FF_ARG(result->exePath, "exe-path"),
|
||||
FF_ARG(result->tty, "tty"),
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
@@ -34,10 +34,10 @@ bool ffPrintTerminalFont(FFTerminalFontOptions* options)
|
||||
else
|
||||
{
|
||||
FF_PRINT_FORMAT_CHECKED(FF_TERMINALFONT_DISPLAY_NAME, 0, &options->moduleArgs, FF_PRINT_TYPE_DEFAULT, ((FFformatarg[]){
|
||||
FF_FORMAT_ARG(terminalFont.font.pretty, "combined"),
|
||||
FF_FORMAT_ARG(terminalFont.font.name, "name"),
|
||||
FF_FORMAT_ARG(terminalFont.font.size, "size"),
|
||||
FF_FORMAT_ARG(terminalFont.font.styles, "styles"),
|
||||
FF_ARG(terminalFont.font.pretty, "combined"),
|
||||
FF_ARG(terminalFont.font.name, "name"),
|
||||
FF_ARG(terminalFont.font.size, "size"),
|
||||
FF_ARG(terminalFont.font.styles, "styles"),
|
||||
}));
|
||||
}
|
||||
success = true;
|
||||
|
||||
@@ -29,10 +29,10 @@ bool ffPrintTerminalSize(FFTerminalSizeOptions* options)
|
||||
else
|
||||
{
|
||||
FF_PRINT_FORMAT_CHECKED(FF_TERMINALSIZE_DISPLAY_NAME, 0, &options->moduleArgs, FF_PRINT_TYPE_DEFAULT, ((FFformatarg[]){
|
||||
FF_FORMAT_ARG(result.rows, "rows"),
|
||||
FF_FORMAT_ARG(result.columns, "columns"),
|
||||
FF_FORMAT_ARG(result.width, "width"),
|
||||
FF_FORMAT_ARG(result.height, "height"),
|
||||
FF_ARG(result.rows, "rows"),
|
||||
FF_ARG(result.columns, "columns"),
|
||||
FF_ARG(result.width, "width"),
|
||||
FF_ARG(result.height, "height"),
|
||||
}));
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -34,10 +34,10 @@ bool ffPrintTerminalTheme(FFTerminalThemeOptions* options)
|
||||
snprintf(fg, ARRAY_SIZE(fg), "#%02" PRIX16 "%02" PRIX16 "%02" PRIX16, result.fg.r, result.fg.g, result.fg.b);
|
||||
snprintf(bg, ARRAY_SIZE(bg), "#%02" PRIX16 "%02" PRIX16 "%02" PRIX16, result.bg.r, result.bg.g, result.bg.b);
|
||||
FF_PRINT_FORMAT_CHECKED(FF_TERMINALTHEME_DISPLAY_NAME, 0, &options->moduleArgs, FF_PRINT_TYPE_DEFAULT, ((FFformatarg[]){
|
||||
FF_FORMAT_ARG(fg, "fg-color"),
|
||||
FF_FORMAT_ARG(fgType, "fg-type"),
|
||||
FF_FORMAT_ARG(bg, "bg-color"),
|
||||
FF_FORMAT_ARG(bgType, "bg-type"),
|
||||
FF_ARG(fg, "fg-color"),
|
||||
FF_ARG(fgType, "fg-type"),
|
||||
FF_ARG(bg, "bg-color"),
|
||||
FF_ARG(bgType, "bg-type"),
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
@@ -34,8 +34,8 @@ bool ffPrintTheme(FFThemeOptions* options)
|
||||
else
|
||||
{
|
||||
FF_PRINT_FORMAT_CHECKED(FF_THEME_MODULE_NAME, 0, &options->moduleArgs, FF_PRINT_TYPE_DEFAULT, ((FFformatarg[]){
|
||||
FF_FORMAT_ARG(result.theme1, "theme1"),
|
||||
FF_FORMAT_ARG(result.theme2, "theme2"),
|
||||
FF_ARG(result.theme1, "theme1"),
|
||||
FF_ARG(result.theme2, "theme2"),
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
+13
-13
@@ -71,22 +71,22 @@ bool ffPrintTitle(FFTitleOptions* options)
|
||||
if (cwdTilde.length > 1) ffStrbufTrimRight(&cwdTilde, '/');
|
||||
|
||||
FF_PRINT_FORMAT_CHECKED(FF_TITLE_MODULE_NAME, 0, &options->moduleArgs, FF_PRINT_TYPE_DEFAULT, ((FFformatarg[]){
|
||||
FF_FORMAT_ARG(instance.state.platform.userName, "user-name"),
|
||||
FF_FORMAT_ARG(hostName, "host-name"),
|
||||
FF_FORMAT_ARG(instance.state.platform.homeDir, "home-dir"),
|
||||
FF_FORMAT_ARG(instance.state.platform.exePath, "exe-path"),
|
||||
FF_FORMAT_ARG(instance.state.platform.userShell, "user-shell"),
|
||||
FF_FORMAT_ARG(userNameColored, "user-name-colored"),
|
||||
FF_FORMAT_ARG(atColored, "at-symbol-colored"),
|
||||
FF_FORMAT_ARG(hostNameColored, "host-name-colored"),
|
||||
FF_FORMAT_ARG(instance.state.platform.fullUserName, "full-user-name"),
|
||||
FF_ARG(instance.state.platform.userName, "user-name"),
|
||||
FF_ARG(hostName, "host-name"),
|
||||
FF_ARG(instance.state.platform.homeDir, "home-dir"),
|
||||
FF_ARG(instance.state.platform.exePath, "exe-path"),
|
||||
FF_ARG(instance.state.platform.userShell, "user-shell"),
|
||||
FF_ARG(userNameColored, "user-name-colored"),
|
||||
FF_ARG(atColored, "at-symbol-colored"),
|
||||
FF_ARG(hostNameColored, "host-name-colored"),
|
||||
FF_ARG(instance.state.platform.fullUserName, "full-user-name"),
|
||||
#ifndef _WIN32
|
||||
FF_FORMAT_ARG(instance.state.platform.uid, "user-id"),
|
||||
FF_ARG(instance.state.platform.uid, "user-id"),
|
||||
#else
|
||||
FF_FORMAT_ARG(instance.state.platform.sid, "user-id"),
|
||||
FF_ARG(instance.state.platform.sid, "user-id"),
|
||||
#endif
|
||||
FF_FORMAT_ARG(instance.state.platform.pid, "pid"),
|
||||
FF_FORMAT_ARG(cwdTilde, "cwd"),
|
||||
FF_ARG(instance.state.platform.pid, "pid"),
|
||||
FF_ARG(cwdTilde, "cwd"),
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
@@ -29,8 +29,8 @@ bool ffPrintTPM(FFTPMOptions* options)
|
||||
else
|
||||
{
|
||||
FF_PRINT_FORMAT_CHECKED(FF_TPM_MODULE_NAME, 0, &options->moduleArgs, FF_PRINT_TYPE_DEFAULT, ((FFformatarg[]){
|
||||
FF_FORMAT_ARG(result.version, "version"),
|
||||
FF_FORMAT_ARG(result.description, "description"),
|
||||
FF_ARG(result.version, "version"),
|
||||
FF_ARG(result.description, "description"),
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
+10
-10
@@ -42,16 +42,16 @@ bool ffPrintUptime(FFUptimeOptions* options)
|
||||
FFTimeGetAgeResult age = ffTimeGetAge(result.bootTime, ffTimeGetNow());
|
||||
|
||||
FF_PRINT_FORMAT_CHECKED(FF_UPTIME_MODULE_NAME, 0, &options->moduleArgs, FF_PRINT_TYPE_DEFAULT, ((FFformatarg[]){
|
||||
FF_FORMAT_ARG(days, "days"),
|
||||
FF_FORMAT_ARG(hours, "hours"),
|
||||
FF_FORMAT_ARG(minutes, "minutes"),
|
||||
FF_FORMAT_ARG(seconds, "seconds"),
|
||||
FF_FORMAT_ARG(milliseconds, "milliseconds"),
|
||||
{FF_FORMAT_ARG_TYPE_STRING, ffTimeToShortStr(result.bootTime), "boot-time"},
|
||||
FF_FORMAT_ARG(age.years, "years"),
|
||||
FF_FORMAT_ARG(age.daysOfYear, "days-of-year"),
|
||||
FF_FORMAT_ARG(age.yearsFraction, "years-fraction"),
|
||||
FF_FORMAT_ARG(buffer, "formatted")
|
||||
FF_ARG(days, "days"),
|
||||
FF_ARG(hours, "hours"),
|
||||
FF_ARG(minutes, "minutes"),
|
||||
FF_ARG(seconds, "seconds"),
|
||||
FF_ARG(milliseconds, "milliseconds"),
|
||||
{FF_ARG_TYPE_STRING, ffTimeToShortStr(result.bootTime), "boot-time"},
|
||||
FF_ARG(age.years, "years"),
|
||||
FF_ARG(age.daysOfYear, "days-of-year"),
|
||||
FF_ARG(age.yearsFraction, "years-fraction"),
|
||||
FF_ARG(buffer, "formatted")
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
+13
-13
@@ -81,19 +81,19 @@ bool ffPrintUsers(FFUsersOptions* options)
|
||||
FFTimeGetAgeResult age = ffTimeGetAge(user->loginTime, ffTimeGetNow());
|
||||
|
||||
FF_PRINT_FORMAT_CHECKED(FF_USERS_MODULE_NAME, users.length == 1 ? 0 : (uint8_t) (i + 1), &options->moduleArgs, FF_PRINT_TYPE_DEFAULT, ((FFformatarg[]){
|
||||
FF_FORMAT_ARG(user->name, "name"),
|
||||
FF_FORMAT_ARG(user->hostName, "host-name"),
|
||||
FF_FORMAT_ARG(user->sessionName, "session-name"),
|
||||
FF_FORMAT_ARG(user->clientIp, "client-ip"),
|
||||
{FF_FORMAT_ARG_TYPE_STRING, ffTimeToShortStr(user->loginTime), "login-time"},
|
||||
FF_FORMAT_ARG(days, "days"),
|
||||
FF_FORMAT_ARG(hours, "hours"),
|
||||
FF_FORMAT_ARG(minutes, "minutes"),
|
||||
FF_FORMAT_ARG(seconds, "seconds"),
|
||||
FF_FORMAT_ARG(milliseconds, "milliseconds"),
|
||||
FF_FORMAT_ARG(age.years, "years"),
|
||||
FF_FORMAT_ARG(age.daysOfYear, "days-of-year"),
|
||||
FF_FORMAT_ARG(age.yearsFraction, "years-fraction"),
|
||||
FF_ARG(user->name, "name"),
|
||||
FF_ARG(user->hostName, "host-name"),
|
||||
FF_ARG(user->sessionName, "session-name"),
|
||||
FF_ARG(user->clientIp, "client-ip"),
|
||||
{FF_ARG_TYPE_STRING, ffTimeToShortStr(user->loginTime), "login-time"},
|
||||
FF_ARG(days, "days"),
|
||||
FF_ARG(hours, "hours"),
|
||||
FF_ARG(minutes, "minutes"),
|
||||
FF_ARG(seconds, "seconds"),
|
||||
FF_ARG(milliseconds, "milliseconds"),
|
||||
FF_ARG(age.years, "years"),
|
||||
FF_ARG(age.daysOfYear, "days-of-year"),
|
||||
FF_ARG(age.yearsFraction, "years-fraction"),
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,16 +30,16 @@ bool ffPrintVersion(FFVersionOptions* options)
|
||||
|
||||
const char* buildType = result->debugMode ? "debug" : "release";
|
||||
FF_PRINT_FORMAT_CHECKED(FF_VERSION_MODULE_NAME, 0, &options->moduleArgs, FF_PRINT_TYPE_DEFAULT, ((FFformatarg[]){
|
||||
FF_FORMAT_ARG(result->projectName, "project-name"),
|
||||
FF_FORMAT_ARG(result->version, "version"),
|
||||
FF_FORMAT_ARG(result->versionTweak, "version-tweak"),
|
||||
FF_FORMAT_ARG(buildType, "build-type"),
|
||||
FF_FORMAT_ARG(result->sysName, "sysname"),
|
||||
FF_FORMAT_ARG(result->architecture, "arch"),
|
||||
FF_FORMAT_ARG(result->cmakeBuiltType, "cmake-built-type"),
|
||||
FF_FORMAT_ARG(result->compileTime, "compile-time"),
|
||||
FF_FORMAT_ARG(result->compiler, "compiler"),
|
||||
FF_FORMAT_ARG(buf, "libc"),
|
||||
FF_ARG(result->projectName, "project-name"),
|
||||
FF_ARG(result->version, "version"),
|
||||
FF_ARG(result->versionTweak, "version-tweak"),
|
||||
FF_ARG(buildType, "build-type"),
|
||||
FF_ARG(result->sysName, "sysname"),
|
||||
FF_ARG(result->architecture, "arch"),
|
||||
FF_ARG(result->cmakeBuiltType, "cmake-built-type"),
|
||||
FF_ARG(result->compileTime, "compile-time"),
|
||||
FF_ARG(result->compiler, "compiler"),
|
||||
FF_ARG(buf, "libc"),
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
@@ -43,10 +43,10 @@ bool ffPrintVulkan(FFVulkanOptions* options)
|
||||
else
|
||||
{
|
||||
FF_PRINT_FORMAT_CHECKED(FF_VULKAN_MODULE_NAME, 0, &options->moduleArgs, FF_PRINT_TYPE_DEFAULT, ((FFformatarg[]) {
|
||||
FF_FORMAT_ARG(vulkan->driver, "driver"),
|
||||
FF_FORMAT_ARG(vulkan->apiVersion, "api-version"),
|
||||
FF_FORMAT_ARG(vulkan->conformanceVersion, "conformance-version"),
|
||||
FF_FORMAT_ARG(vulkan->instanceVersion, "instance-version"),
|
||||
FF_ARG(vulkan->driver, "driver"),
|
||||
FF_ARG(vulkan->apiVersion, "api-version"),
|
||||
FF_ARG(vulkan->conformanceVersion, "conformance-version"),
|
||||
FF_ARG(vulkan->instanceVersion, "instance-version"),
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
@@ -34,8 +34,8 @@ bool ffPrintWallpaper(FFWallpaperOptions* options)
|
||||
else
|
||||
{
|
||||
FF_PRINT_FORMAT_CHECKED(FF_WALLPAPER_MODULE_NAME, 0, &options->moduleArgs, FF_PRINT_TYPE_DEFAULT, ((FFformatarg[]){
|
||||
FF_FORMAT_ARG(filename, "file-name"),
|
||||
FF_FORMAT_ARG(fullpath, "full-path"),
|
||||
FF_ARG(filename, "file-name"),
|
||||
FF_ARG(fullpath, "full-path"),
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ bool ffPrintWeather(FFWeatherOptions* options)
|
||||
else
|
||||
{
|
||||
FF_PRINT_FORMAT_CHECKED(FF_WEATHER_MODULE_NAME, 0, &options->moduleArgs, FF_PRINT_TYPE_DEFAULT, ((FFformatarg[]) {
|
||||
FF_FORMAT_ARG(result, "result"),
|
||||
FF_ARG(result, "result"),
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
+13
-13
@@ -110,19 +110,19 @@ bool ffPrintWifi(FFWifiOptions* options)
|
||||
ffPercentAppendBar(&percentBar, item->conn.signalQuality, options->percent, &options->moduleArgs);
|
||||
|
||||
FF_PRINT_FORMAT_CHECKED(FF_WIFI_MODULE_NAME, moduleIndex, &options->moduleArgs, FF_PRINT_TYPE_DEFAULT, ((FFformatarg[]){
|
||||
FF_FORMAT_ARG(item->inf.description, "inf-desc"),
|
||||
FF_FORMAT_ARG(item->inf.status, "inf-status"),
|
||||
FF_FORMAT_ARG(item->conn.status, "status"),
|
||||
FF_FORMAT_ARG(item->conn.ssid, "ssid"),
|
||||
FF_FORMAT_ARG(item->conn.bssid, "bssid"),
|
||||
FF_FORMAT_ARG(item->conn.protocol, "protocol"),
|
||||
FF_FORMAT_ARG(percentNum, "signal-quality"),
|
||||
FF_FORMAT_ARG(item->conn.rxRate, "rx-rate"),
|
||||
FF_FORMAT_ARG(item->conn.txRate, "tx-rate"),
|
||||
FF_FORMAT_ARG(item->conn.security, "security"),
|
||||
FF_FORMAT_ARG(percentBar, "signal-quality-bar"),
|
||||
FF_FORMAT_ARG(item->conn.channel, "channel"),
|
||||
FF_FORMAT_ARG(bandStr, "band"),
|
||||
FF_ARG(item->inf.description, "inf-desc"),
|
||||
FF_ARG(item->inf.status, "inf-status"),
|
||||
FF_ARG(item->conn.status, "status"),
|
||||
FF_ARG(item->conn.ssid, "ssid"),
|
||||
FF_ARG(item->conn.bssid, "bssid"),
|
||||
FF_ARG(item->conn.protocol, "protocol"),
|
||||
FF_ARG(percentNum, "signal-quality"),
|
||||
FF_ARG(item->conn.rxRate, "rx-rate"),
|
||||
FF_ARG(item->conn.txRate, "tx-rate"),
|
||||
FF_ARG(item->conn.security, "security"),
|
||||
FF_ARG(percentBar, "signal-quality-bar"),
|
||||
FF_ARG(item->conn.channel, "channel"),
|
||||
FF_ARG(bandStr, "band"),
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
+5
-5
@@ -54,11 +54,11 @@ bool ffPrintWM(FFWMOptions* options)
|
||||
else
|
||||
{
|
||||
FF_PRINT_FORMAT_CHECKED(FF_WM_MODULE_NAME, 0, &options->moduleArgs, FF_PRINT_TYPE_DEFAULT, ((FFformatarg[]){
|
||||
FF_FORMAT_ARG(result->wmProcessName, "process-name"),
|
||||
FF_FORMAT_ARG(result->wmPrettyName, "pretty-name"),
|
||||
FF_FORMAT_ARG(result->wmProtocolName, "protocol-name"),
|
||||
FF_FORMAT_ARG(pluginName, "plugin-name"),
|
||||
FF_FORMAT_ARG(version, "version"),
|
||||
FF_ARG(result->wmProcessName, "process-name"),
|
||||
FF_ARG(result->wmPrettyName, "pretty-name"),
|
||||
FF_ARG(result->wmProtocolName, "protocol-name"),
|
||||
FF_ARG(pluginName, "plugin-name"),
|
||||
FF_ARG(version, "version"),
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ bool ffPrintWMTheme(FFWMThemeOptions* options)
|
||||
else
|
||||
{
|
||||
FF_PRINT_FORMAT_CHECKED(FF_WMTHEME_DISPLAY_NAME, 0, &options->moduleArgs, FF_PRINT_TYPE_DEFAULT, ((FFformatarg[]){
|
||||
FF_FORMAT_ARG(themeOrError, "result"),
|
||||
FF_ARG(themeOrError, "result"),
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
+17
-17
@@ -21,10 +21,10 @@ static void printZpool(FFZpoolOptions* options, FFZpoolResult* result, uint8_t i
|
||||
{
|
||||
ffStrbufClear(&buffer);
|
||||
FF_PARSE_FORMAT_STRING_CHECKED(&buffer, &options->moduleArgs.key, ((FFformatarg[]) {
|
||||
FF_FORMAT_ARG(index, "index"),
|
||||
FF_FORMAT_ARG(result->name, "name"),
|
||||
FF_FORMAT_ARG(result->guid, "guid"),
|
||||
FF_FORMAT_ARG(options->moduleArgs.keyIcon, "icon"),
|
||||
FF_ARG(index, "index"),
|
||||
FF_ARG(result->name, "name"),
|
||||
FF_ARG(result->guid, "guid"),
|
||||
FF_ARG(options->moduleArgs.keyIcon, "icon"),
|
||||
}));
|
||||
}
|
||||
|
||||
@@ -81,19 +81,19 @@ static void printZpool(FFZpoolOptions* options, FFZpoolResult* result, uint8_t i
|
||||
ffPercentAppendBar(&fragPercentageBar, result->fragmentation, options->percent, &options->moduleArgs);
|
||||
|
||||
FF_PRINT_FORMAT_CHECKED(buffer.chars, 0, &options->moduleArgs, FF_PRINT_TYPE_NO_CUSTOM_KEY, ((FFformatarg[]) {
|
||||
FF_FORMAT_ARG(result->name, "name"),
|
||||
FF_FORMAT_ARG(result->guid, "guid"),
|
||||
FF_FORMAT_ARG(result->state, "state"),
|
||||
FF_FORMAT_ARG(usedPretty, "size-used"),
|
||||
FF_FORMAT_ARG(allocatedPretty, "size-allocated"),
|
||||
FF_FORMAT_ARG(totalPretty, "size-total"),
|
||||
FF_FORMAT_ARG(usedPercentageNum, "used-percentage"),
|
||||
FF_FORMAT_ARG(allocatedPercentageNum, "allocated-percentage"),
|
||||
FF_FORMAT_ARG(fragPercentageNum, "frag-percentage"),
|
||||
FF_FORMAT_ARG(usedPercentageBar, "used-percentage-bar"),
|
||||
FF_FORMAT_ARG(allocatedPercentageBar, "allocated-percentage-bar"),
|
||||
FF_FORMAT_ARG(fragPercentageBar, "frag-percentage-bar"),
|
||||
FF_FORMAT_ARG(result->readOnly, "is-readonly"),
|
||||
FF_ARG(result->name, "name"),
|
||||
FF_ARG(result->guid, "guid"),
|
||||
FF_ARG(result->state, "state"),
|
||||
FF_ARG(usedPretty, "size-used"),
|
||||
FF_ARG(allocatedPretty, "size-allocated"),
|
||||
FF_ARG(totalPretty, "size-total"),
|
||||
FF_ARG(usedPercentageNum, "used-percentage"),
|
||||
FF_ARG(allocatedPercentageNum, "allocated-percentage"),
|
||||
FF_ARG(fragPercentageNum, "frag-percentage"),
|
||||
FF_ARG(usedPercentageBar, "used-percentage-bar"),
|
||||
FF_ARG(allocatedPercentageBar, "allocated-percentage-bar"),
|
||||
FF_ARG(fragPercentageBar, "frag-percentage-bar"),
|
||||
FF_ARG(result->readOnly, "is-readonly"),
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user