Style: adds BreakBeforeCloseBracketBracedList: true

This commit is contained in:
李通洲
2026-03-30 10:17:45 +08:00
committed by Carter Li
parent c2da9b0cb1
commit 5f261702a9
86 changed files with 194 additions and 98 deletions
+1
View File
@@ -10,6 +10,7 @@ ColumnLimit: 0
ReflowComments: true
BreakBeforeBraces: Attach
BreakBeforeCloseBracketBracedList: true
BraceWrapping:
AfterControlStatement: false
AfterEnum: false
+4 -2
View File
@@ -210,7 +210,8 @@ static const char* initNetworkingState(FFNetworkingState* state, const char* hos
struct addrinfo hints = {
.ai_family = state->ipv6 ? AF_INET6 : AF_INET,
.ai_socktype = SOCK_STREAM,
.ai_flags = AI_NUMERICSERV};
.ai_flags = AI_NUMERICSERV
};
FF_DEBUG("Resolving address: %s (%s)", host, state->ipv6 ? "IPv6" : "IPv4");
// Use AI_NUMERICSERV flag to indicate the service is a numeric port, reducing parsing time
@@ -377,7 +378,8 @@ const char* ffNetworkingRecvHttpResponse(FFNetworkingState* state, FFstrbuf* buf
{
int pollRes = poll(&(struct pollfd) {
.fd = state->sockfd,
.events = POLLIN},
.events = POLLIN
},
1,
timeout > 0 ? (int) timeout : -1);
if (pollRes == 0) {
+2 -1
View File
@@ -142,7 +142,8 @@ const char* ffNetworkingSendHttpRequest(FFNetworkingState* state, const char* ho
// Initialize overlapped structure with WSA event for asynchronous I/O
state->overlapped = (OVERLAPPED) {
.hEvent = WSACreateEvent()};
.hEvent = WSACreateEvent()
};
if (state->overlapped.hEvent == WSA_INVALID_EVENT) {
FF_DEBUG("WSACreateEvent() failed");
+4 -2
View File
@@ -14,12 +14,14 @@ const char* ffDetectBluetooth(FFBluetoothOptions* options, FFlist* devices /* FF
FF_LIBRARY_LOAD_SYMBOL_MESSAGE(bluetoothapis, BluetoothFindDeviceClose)
BLUETOOTH_DEVICE_INFO btdi = {
.dwSize = sizeof(btdi)};
.dwSize = sizeof(btdi)
};
HBLUETOOTH_DEVICE_FIND hFind = ffBluetoothFindFirstDevice(&(BLUETOOTH_DEVICE_SEARCH_PARAMS) {
.fReturnConnected = TRUE,
.fReturnRemembered = options->showDisconnected,
.fReturnAuthenticated = options->showDisconnected,
.dwSize = sizeof(BLUETOOTH_DEVICE_SEARCH_PARAMS)},
.dwSize = sizeof(BLUETOOTH_DEVICE_SEARCH_PARAMS)
},
&btdi);
if (!hFind) {
if (GetLastError() == ERROR_NO_MORE_ITEMS) {
@@ -60,7 +60,8 @@ const char* ffDetectBluetoothRadio(FFlist* devices /* FFBluetoothRadioResult */)
HANDLE hRadio = NULL;
HBLUETOOTH_DEVICE_FIND hFind = ffBluetoothFindFirstRadio(&(BLUETOOTH_FIND_RADIO_PARAMS) {
.dwSize = sizeof(BLUETOOTH_FIND_RADIO_PARAMS)},
.dwSize = sizeof(BLUETOOTH_FIND_RADIO_PARAMS)
},
&hRadio);
if (!hFind) {
if (GetLastError() == ERROR_NO_MORE_ITEMS) {
+2 -1
View File
@@ -15,7 +15,8 @@ const char* enablePrivilege(const wchar_t* privilege) {
TOKEN_PRIVILEGES tp = {
.PrivilegeCount = 1,
.Privileges = {
(LUID_AND_ATTRIBUTES) {.Attributes = SE_PRIVILEGE_ENABLED}},
(LUID_AND_ATTRIBUTES) {.Attributes = SE_PRIVILEGE_ENABLED}
},
};
if (!LookupPrivilegeValueW(NULL, privilege, &tp.Privileges[0].Luid)) {
return "LookupPrivilegeValue() failed";
+2 -1
View File
@@ -21,7 +21,8 @@ static const char* spawnProcess(FFCommandOptions* options, FFProcessHandle* hand
options->shell.chars,
options->param.chars,
options->text.chars,
NULL}
NULL
}
: (char* const[]) {options->shell.chars, options->text.chars, NULL},
options->useStdErr,
handle);
+2 -1
View File
@@ -9,7 +9,8 @@ const char* ffDetectCPU(const FFCPUOptions* options, FFCPUResult* cpu) {
}
const char* removeStrings[] = {
" CPU", " FPU", " APU", " Processor", " Dual-Core", " Quad-Core", " Six-Core", " Eight-Core", " Ten-Core", " 2-Core", " 4-Core", " 6-Core", " 8-Core", " 10-Core", " 12-Core", " 14-Core", " 16-Core"};
" CPU", " FPU", " APU", " Processor", " Dual-Core", " Quad-Core", " Six-Core", " Eight-Core", " Ten-Core", " 2-Core", " 4-Core", " 6-Core", " 8-Core", " 10-Core", " 12-Core", " 14-Core", " 16-Core"
};
ffStrbufRemoveStrings(&cpu->name, ARRAY_SIZE(removeStrings), removeStrings);
uint32_t radeonGraphics = ffStrbufFirstIndexS(&cpu->name, " w/ Radeon "); // w/ Radeon 780M Graphics
if (radeonGraphics >= cpu->name.length) {
@@ -106,7 +106,8 @@ static void detectDisplays(FFDisplayServerResult* ds) {
.size = sizeof(preferredMode),
.adapterId = path->targetInfo.adapterId,
.id = path->targetInfo.id,
}};
}
};
double preferredRefreshRate = 0;
if (DisplayConfigGetDeviceInfo(&preferredMode.header) == ERROR_SUCCESS) {
DISPLAYCONFIG_RATIONAL freq = preferredMode.targetMode.targetVideoSignalInfo.vSyncFreq;
@@ -161,7 +162,8 @@ static void detectDisplays(FFDisplayServerResult* ds) {
.size = sizeof(advColorInfo2),
.adapterId = path->targetInfo.adapterId,
.id = path->targetInfo.id,
}};
}
};
if (DisplayConfigGetDeviceInfo(&advColorInfo2.header) == ERROR_SUCCESS) {
if (advColorInfo2.highDynamicRangeUserEnabled) {
display->hdrStatus = FF_DISPLAY_HDR_STATUS_ENABLED;
@@ -178,7 +180,8 @@ static void detectDisplays(FFDisplayServerResult* ds) {
.size = sizeof(advColorInfo),
.adapterId = path->targetInfo.adapterId,
.id = path->targetInfo.id,
}};
}
};
if (DisplayConfigGetDeviceInfo(&advColorInfo.header) == ERROR_SUCCESS) {
if (advColorInfo.advancedColorEnabled) {
display->hdrStatus = FF_DISPLAY_HDR_STATUS_ENABLED;
@@ -247,7 +247,8 @@ const char* ffdsConnectWayland(FFDisplayServerResult* result) {
struct wl_registry_listener registry_listener = {
.global = waylandGlobalAddListener,
.global_remove = (void*) stubListener};
.global_remove = (void*) stubListener
};
data.ffwl_proxy_add_listener(registry, (void (**)(void)) &registry_listener, &data);
data.ffwl_display_roundtrip(data.display);
+2 -1
View File
@@ -246,7 +246,8 @@ static bool xcbRandrHandleMonitor(XcbRandrData* data, xcb_randr_monitor_info_t*
xcb_randr_output_iterator_t outputIterator = {
.index = 0,
.data = data->ffxcb_randr_monitor_info_outputs(monitor),
.rem = data->ffxcb_randr_monitor_info_outputs_length(monitor)};
.rem = data->ffxcb_randr_monitor_info_outputs_length(monitor)
};
FF_AUTO_FREE xcb_get_atom_name_reply_t* nameReply = data->ffxcb_get_atom_name_reply(
data->connection,
+2 -1
View File
@@ -16,7 +16,8 @@ const char* ffDetectKeyboard(FFlist* devices /* List of FFKeyboardDevice */) {
FFKeyboardDevice device = {
.name = ffStrbufCreate(),
.serial = ffStrbufCreate()};
.serial = ffStrbufCreate()
};
char* line = NULL;
size_t len = 0;
+2 -1
View File
@@ -44,7 +44,8 @@ const char* ffNetIOGetIoCounters(FFlist* result, FFNetIOOptions* options) {
.rxErrors = stats.receive.errors,
.txErrors = stats.send.errors,
.rxDrops = stats.receive.dropped,
.txDrops = stats.send.dropped};
.txDrops = stats.send.dropped
};
}
return NULL;
+2 -1
View File
@@ -37,7 +37,8 @@ static const char* cglHandlePixelFormat(FFOpenGLResult* result, CGLPixelFormatOb
const char* cglDetectOpenGL(FFOpenGLResult* result) {
CGLPixelFormatObj pixelFormat;
CGLPixelFormatAttribute attrs[] = {
kCGLPFAOpenGLProfile, (CGLPixelFormatAttribute) kCGLOGLPVersion_3_2_Core, kCGLPFAAccelerated, 0};
kCGLPFAOpenGLProfile, (CGLPixelFormatAttribute) kCGLOGLPVersion_3_2_Core, kCGLPFAAccelerated, 0
};
GLint num;
if (CGLChoosePixelFormat(attrs, &pixelFormat, &num) != kCGLNoError) {
+2 -1
View File
@@ -41,7 +41,8 @@ static const char* wglHandlePixelFormat(WGLData* wglData, FFOpenGLResult* result
.iPixelType = PFD_TYPE_RGBA,
.cColorBits = 32,
.cDepthBits = 24,
.iLayerType = PFD_MAIN_PLANE};
.iLayerType = PFD_MAIN_PLANE
};
int pixelFormat = ChoosePixelFormat(hdc, &pfd);
if (pixelFormat == 0) {
ReleaseDC(hWnd, hdc);
+2 -1
View File
@@ -128,7 +128,8 @@ static uint32_t getNixPackagesImpl(char* path) {
FFstrbuf line = {
.allocated = 0,
.length = lineLength,
.chars = output.chars + i - lineLength};
.chars = output.chars + i - lineLength
};
if (isValidNixPkg(&line)) {
count++;
}
+6 -4
View File
@@ -668,11 +668,13 @@ typedef unsigned short oss_peaks_t[MAX_PEAK_CHANNELS];
* Again, DO NOT USE the following two macros. They are here for SOURCE
* COMPATIBILITY ONLY.
*/
#define SOUND_DEVICE_LABELS { \
"Vol ", "Bass ", "Treble", "Synth", "Pcm ", "Speaker ", "Line ", "Mic ", "CD ", "Mix ", "Pcm2 ", "Rec ", "IGain", "OGain", "Aux1", "Aux2", "Aux3", "Digital1", "Digital2", "Digital3", "Phone", "Mono", "Video", "Radio", "Depth", "Rear", "Center", "Side"}
#define SOUND_DEVICE_LABELS { \
"Vol ", "Bass ", "Treble", "Synth", "Pcm ", "Speaker ", "Line ", "Mic ", "CD ", "Mix ", "Pcm2 ", "Rec ", "IGain", "OGain", "Aux1", "Aux2", "Aux3", "Digital1", "Digital2", "Digital3", "Phone", "Mono", "Video", "Radio", "Depth", "Rear", "Center", "Side" \
}
#define SOUND_DEVICE_NAMES { \
"vol", "bass", "treble", "synth", "pcm", "speaker", "line", "mic", "cd", "mix", "pcm2", "rec", "igain", "ogain", "aux1", "aux2", "aux3", "dig1", "dig2", "dig3", "phone", "mono", "video", "radio", "depth", "rear", "center", "side"}
#define SOUND_DEVICE_NAMES { \
"vol", "bass", "treble", "synth", "pcm", "speaker", "line", "mic", "cd", "mix", "pcm2", "rec", "igain", "ogain", "aux1", "aux2", "aux3", "dig1", "dig2", "dig3", "phone", "mono", "video", "radio", "depth", "rear", "center", "side" \
}
#define MIXER_READ(dev) __OSSIOR('M', dev, int)
#define MIXER_WRITE(dev) __OSSIOWR('M', dev, int)
+1 -1
View File
@@ -13,7 +13,7 @@ const char* ffDetectSwap(FFlist* result) {
if (xsw.xsu_total == 0) {
if (!__builtin_available(macOS 26.0, *)) {
if (ffSysctlGetInt("vm.compressor_mode", 4) <= 2) { // No longer available in macOS 26.0
return NULL; // Swap is disabled
return NULL; // Swap is disabled
}
}
}
+4 -2
View File
@@ -99,12 +99,14 @@ static const char* detectVulkan(FFVulkanResult* result) {
.engineVersion = projectVersion,
// We need to request 1.1 to get physicalDeviceDriverProperties
.apiVersion = instanceVersion.minor >= 1 ? VK_API_VERSION_1_1 : VK_API_VERSION_1_0},
.apiVersion = instanceVersion.minor >= 1 ? VK_API_VERSION_1_1 : VK_API_VERSION_1_0
},
.enabledLayerCount = 0,
.ppEnabledLayerNames = NULL,
.enabledExtensionCount = 0,
.ppEnabledExtensionNames = NULL,
.flags = 0},
.flags = 0
},
NULL,
&vkInstance);
if (res != VK_SUCCESS) {
+2 -1
View File
@@ -5383,7 +5383,8 @@ static const FFlogo X[] = {
FF_COLOR_FG_BLACK,
FF_COLOR_FG_BLUE,
FF_COLOR_FG_YELLOW,
}},
}
},
// Xenia
{
.names = {"Xenia"},
+2 -1
View File
@@ -564,7 +564,8 @@ static bool logoTryKnownType(void) {
"/bin/sh", "-c",
#endif
options->source.chars,
NULL});
NULL
});
if (error) {
if (instance.config.display.showErrors) {
+2 -1
View File
@@ -273,4 +273,5 @@ FFModuleBaseInfo ffBatteryModuleInfo = {
{"Battery time remaining minutes", "time-minutes"},
{"Battery time remaining seconds", "time-seconds"},
{"Battery time remaining (formatted)", "time-formatted"},
}))};
}))
};
+2 -1
View File
@@ -144,4 +144,5 @@ FFModuleBaseInfo ffBiosModuleInfo = {
{"Bios vendor", "vendor"},
{"Bios version", "version"},
{"Firmware type", "type"},
}))};
}))
};
+2 -1
View File
@@ -174,4 +174,5 @@ FFModuleBaseInfo ffBluetoothModuleInfo = {
{"Battery percentage number", "battery-percentage"},
{"Is connected", "connected"},
{"Battery percentage bar", "battery-percentage-bar"},
}))};
}))
};
+2 -1
View File
@@ -205,4 +205,5 @@ FFModuleBaseInfo ffBluetoothRadioModuleInfo = {
{"Vendor", "vendor"},
{"Discoverable", "discoverable"},
{"Connectable / Pairable", "connectable"},
}))};
}))
};
+2 -1
View File
@@ -121,4 +121,5 @@ FFModuleBaseInfo ffBoardModuleInfo = {
{"Board vendor", "vendor"},
{"Board version", "version"},
{"Board serial number", "serial"},
}))};
}))
};
+2 -1
View File
@@ -117,4 +117,5 @@ FFModuleBaseInfo ffBootmgrModuleInfo = {
{"Firmware file name", "firmware-name"},
{"Is secure boot enabled", "secure-boot"},
{"Boot order", "order"},
}))};
}))
};
+2 -1
View File
@@ -198,4 +198,5 @@ FFModuleBaseInfo ffBrightnessModuleInfo = {
{"Current brightness value", "current"},
{"Screen brightness (percentage bar)", "percentage-bar"},
{"Is built-in screen", "is-builtin"},
}))};
}))
};
+2 -1
View File
@@ -220,4 +220,5 @@ FFModuleBaseInfo ffBtrfsModuleInfo = {
{"Allocated percentage bar", "allocated-percentage-bar"},
{"Node size", "node-size"},
{"Sector size", "sector-size"},
}))};
}))
};
+2 -1
View File
@@ -130,4 +130,5 @@ FFModuleBaseInfo ffCameraModuleInfo = {
{"Identifier", "id"},
{"Width (in px)", "width"},
{"Height (in px)", "height"},
}))};
}))
};
+2 -1
View File
@@ -163,4 +163,5 @@ FFModuleBaseInfo ffCommandModuleInfo = {
.generateJsonConfig = (void*) ffGenerateCommandJsonConfig,
.formatArgs = FF_FORMAT_ARG_LIST(((FFModuleFormatArg[]) {
{"Command result", "result"},
}))};
}))
};
+2 -1
View File
@@ -256,4 +256,5 @@ FFModuleBaseInfo ffCPUModuleInfo = {
{"Processor package count", "packages"},
{"CPU microarchitecture", "march"},
{"NUMA node count", "numa-nodes"},
}))};
}))
};
+2 -1
View File
@@ -234,4 +234,5 @@ FFModuleBaseInfo ffCPUCacheModuleInfo = {
.formatArgs = FF_FORMAT_ARG_LIST(((FFModuleFormatArg[]) {
{"Separate result", "result"},
{"Sum result", "sum"},
}))};
}))
};
+2 -1
View File
@@ -198,4 +198,5 @@ FFModuleBaseInfo ffCPUUsageModuleInfo = {
{"CPU usage (percentage bar, average)", "avg-bar"},
{"CPU usage (percentage bar, maximum)", "max-bar"},
{"CPU usage (percentage bar, minimum)", "min-bar"},
}))};
}))
};
+2 -1
View File
@@ -176,4 +176,5 @@ FFModuleBaseInfo ffDateTimeModuleInfo = {
{"Offset from UTC in the ISO 8601 format", "offset-from-utc"},
{"Locale-dependent timezone name or abbreviation", "timezone-name"},
{"Day in month with leading zero", "day-pretty"},
}))};
}))
};
+2 -1
View File
@@ -94,4 +94,5 @@ FFModuleBaseInfo ffDEModuleInfo = {
{"DE process name", "process-name"},
{"DE pretty name", "pretty-name"},
{"DE version", "version"},
}))};
}))
};
+2 -1
View File
@@ -486,4 +486,5 @@ FFModuleBaseInfo ffDiskModuleInfo = {
{"Years fraction after creation", "years-fraction"},
{"Size free", "size-free"},
{"Size available", "size-available"},
}))};
}))
};
+2 -1
View File
@@ -189,4 +189,5 @@ FFModuleBaseInfo ffDiskIOModuleInfo = {
{"Size of data written [per second] (in bytes)", "bytes-written"},
{"Number of reads", "read-count"},
{"Number of writes", "write-count"},
}))};
}))
};
+2 -1
View File
@@ -453,4 +453,5 @@ FFModuleBaseInfo ffDisplayModuleInfo = {
{"Screen preferred height (in pixels)", "preferred-height"},
{"Screen preferred refresh rate (in Hz)", "preferred-refresh-rate"},
{"DPI", "dpi"},
}))};
}))
};
+2 -1
View File
@@ -144,4 +144,5 @@ FFModuleBaseInfo ffDNSModuleInfo = {
.generateJsonConfig = (void*) ffGenerateDNSJsonConfig,
.formatArgs = FF_FORMAT_ARG_LIST(((FFModuleFormatArg[]) {
{"DNS result", "result"},
}))};
}))
};
+2 -1
View File
@@ -117,4 +117,5 @@ FFModuleBaseInfo ffEditorModuleInfo = {
{"Exe name of real path", "exe-name"},
{"Full path of real path", "path"},
{"Version", "version"},
}))};
}))
};
+2 -1
View File
@@ -109,4 +109,5 @@ FFModuleBaseInfo ffFontModuleInfo = {
{"Font 3", "font3"},
{"Font 4", "font4"},
{"Combined fonts for display", "combined"},
}))};
}))
};
+2 -1
View File
@@ -202,4 +202,5 @@ FFModuleBaseInfo ffGamepadModuleInfo = {
{"Serial number", "serial"},
{"Battery percentage num", "battery-percentage"},
{"Battery percentage bar", "battery-percentage-bar"},
}))};
}))
};
+2 -1
View File
@@ -152,4 +152,5 @@ FFModuleBaseInfo ffHostModuleInfo = {
{"Product vendor", "vendor"},
{"Product serial number", "serial"},
{"Product uuid", "uuid"},
}))};
}))
};
+4 -2
View File
@@ -64,7 +64,8 @@ bool ffGenerateIconsJsonResult(FF_MAYBE_UNUSED FFIconsOptions* options, yyjson_m
bool success = false;
FFIconsResult result = {
.icons1 = ffStrbufCreate(),
.icons2 = ffStrbufCreate()};
.icons2 = ffStrbufCreate()
};
const char* error = ffDetectIcons(&result);
if (error) {
@@ -104,4 +105,5 @@ FFModuleBaseInfo ffIconsModuleInfo = {
.formatArgs = FF_FORMAT_ARG_LIST(((FFModuleFormatArg[]) {
{"Icons part 1", "icons1"},
{"Icons part 2", "icons2"},
}))};
}))
};
+2 -1
View File
@@ -116,4 +116,5 @@ FFModuleBaseInfo ffInitSystemModuleInfo = {
{"Init system exe path", "exe"},
{"Init system version path", "version"},
{"Init system pid", "pid"},
}))};
}))
};
+2 -1
View File
@@ -77,4 +77,5 @@ FFModuleBaseInfo ffKernelModuleInfo = {
{"Architecture", "arch"},
{"Display version", "display-version"},
{"Page size", "page-size"},
}))};
}))
};
+2 -1
View File
@@ -160,4 +160,5 @@ FFModuleBaseInfo ffKeyboardModuleInfo = {
.formatArgs = FF_FORMAT_ARG_LIST(((FFModuleFormatArg[]) {
{"Name", "name"},
{"Serial number", "serial"},
}))};
}))
};
+2 -1
View File
@@ -118,4 +118,5 @@ FFModuleBaseInfo ffLMModuleInfo = {
{"LM service", "service"},
{"LM type", "type"},
{"LM version", "version"},
}))};
}))
};
+2 -1
View File
@@ -160,4 +160,5 @@ FFModuleBaseInfo ffLoadavgModuleInfo = {
{"Load average over 1min", "loadavg1"},
{"Load average over 5min", "loadavg2"},
{"Load average over 15min", "loadavg3"},
}))};
}))
};
+2 -1
View File
@@ -77,4 +77,5 @@ FFModuleBaseInfo ffLocaleModuleInfo = {
.generateJsonConfig = (void*) ffGenerateLocaleJsonConfig,
.formatArgs = FF_FORMAT_ARG_LIST(((FFModuleFormatArg[]) {
{"Locale code", "result"},
}))};
}))
};
+2 -1
View File
@@ -439,4 +439,5 @@ FFModuleBaseInfo ffLocalIPModuleInfo = {
{"MTU size in bytes", "mtu"},
{"Link speed (formatted)", "speed"},
{"Interface flags", "flags"},
}))};
}))
};
+2 -1
View File
@@ -195,4 +195,5 @@ FFModuleBaseInfo ffMediaModuleInfo = {
{"Artist name", "artist"},
{"Album name", "album"},
{"Status", "status"},
}))};
}))
};
+2 -1
View File
@@ -131,4 +131,5 @@ FFModuleBaseInfo ffMemoryModuleInfo = {
{"Total size", "total"},
{"Percentage used (num)", "percentage"},
{"Percentage used (bar)", "percentage-bar"},
}))};
}))
};
+2 -1
View File
@@ -133,4 +133,5 @@ FFModuleBaseInfo ffMonitorModuleInfo = {
{"Serial number", "serial"},
{"Maximum refresh rate in Hz", "refresh-rate"},
{"True if the display is HDR compatible", "hdr-compatible"},
}))};
}))
};
+2 -1
View File
@@ -163,4 +163,5 @@ FFModuleBaseInfo ffMouseModuleInfo = {
.formatArgs = FF_FORMAT_ARG_LIST(((FFModuleFormatArg[]) {
{"Mouse name", "name"},
{"Mouse serial number", "serial"},
}))};
}))
};
+2 -1
View File
@@ -220,4 +220,5 @@ FFModuleBaseInfo ffNetIOModuleInfo = {
{"Number of errors sent [per second]", "tx-errors"},
{"Number of packets dropped when receiving [per second]", "rx-drops"},
{"Number of packets dropped when sending [per second]", "tx-drops"},
}))};
}))
};
+2 -1
View File
@@ -132,4 +132,5 @@ FFModuleBaseInfo ffOpenCLModuleInfo = {
{"Platform version", "version"},
{"Platform name", "name"},
{"Platform vendor", "vendor"},
}))};
}))
};
+2 -1
View File
@@ -141,4 +141,5 @@ FFModuleBaseInfo ffOpenGLModuleInfo = {
{"OpenGL vendor", "vendor"},
{"OpenGL shading language version", "slv"},
{"OpenGL library used", "library"},
}))};
}))
};
+2 -1
View File
@@ -193,4 +193,5 @@ FFModuleBaseInfo ffOSModuleInfo = {
{"Version codename of the OS", "codename"},
{"Build ID of the OS", "build-id"},
{"Architecture of the OS", "arch"},
}))};
}))
};
+2 -1
View File
@@ -520,4 +520,5 @@ FFModuleBaseInfo ffPackagesModuleInfo = {
{"Total number of all brew packages", "brew-all"},
{"Total number of all guix packages", "guix-all"},
{"Total number of all hpkg packages", "hpkg-all"},
}))};
}))
};
+2 -1
View File
@@ -249,4 +249,5 @@ FFModuleBaseInfo ffPhysicalDiskModuleInfo = {
{"Device kind (Read-only or Read-write)", "readonly-type"},
{"Product revision", "revision"},
{"Device temperature (formatted)", "temperature"},
}))};
}))
};
+2 -1
View File
@@ -192,4 +192,5 @@ FFModuleBaseInfo ffPhysicalMemoryModuleInfo = {
{"Part number", "part-number"},
{"True if ECC enabled", "is-ecc-enabled"},
{"True if a memory module is installed in the slot", "is-installed"},
}))};
}))
};
+2 -1
View File
@@ -122,4 +122,5 @@ FFModuleBaseInfo ffPlayerModuleInfo = {
{"Player name", "name"},
{"Player Identifier", "id"},
{"URL name", "url"},
}))};
}))
};
+2 -1
View File
@@ -125,4 +125,5 @@ FFModuleBaseInfo ffPowerAdapterModuleInfo = {
{"Power adapter model", "model"},
{"Power adapter description", "description"},
{"Power adapter serial number", "serial"},
}))};
}))
};
+3 -1
View File
@@ -72,4 +72,6 @@ FFModuleBaseInfo ffProcessesModuleInfo = {
.generateJsonResult = (void*) ffGenerateProcessesJsonResult,
.generateJsonConfig = (void*) ffGenerateProcessesJsonConfig,
.formatArgs = FF_FORMAT_ARG_LIST(((FFModuleFormatArg[]) {
{"Process count", "result"}}))};
{"Process count", "result"}
}))
};
+2 -1
View File
@@ -121,4 +121,5 @@ FFModuleBaseInfo ffPublicIPModuleInfo = {
.formatArgs = FF_FORMAT_ARG_LIST(((FFModuleFormatArg[]) {
{"Public IP address", "ip"},
{"Location", "location"},
}))};
}))
};
+2 -1
View File
@@ -106,4 +106,5 @@ FFModuleBaseInfo ffShellModuleInfo = {
{"Shell pretty name", "pretty-name"},
{"Shell full exe path", "exe-path"},
{"Shell tty used", "tty"},
}))};
}))
};
+2 -1
View File
@@ -230,4 +230,5 @@ FFModuleBaseInfo ffSoundModuleInfo = {
{"Identifier", "identifier"},
{"Volume (in percentage bar)", "volume-percentage-bar"},
{"Platform API used", "platform-api"},
}))};
}))
};
+2 -1
View File
@@ -196,4 +196,5 @@ FFModuleBaseInfo ffSwapModuleInfo = {
{"Percentage used (num)", "percentage"},
{"Percentage used (bar)", "percentage-bar"},
{"Name", "name"},
}))};
}))
};
+2 -1
View File
@@ -100,4 +100,5 @@ FFModuleBaseInfo ffTerminalModuleInfo = {
{"Terminal version", "version"},
{"Terminal full exe path", "exe-path"},
{"Terminal tty / pts used", "tty"},
}))};
}))
};
+2 -1
View File
@@ -106,4 +106,5 @@ FFModuleBaseInfo ffTerminalThemeModuleInfo = {
{"Terminal foreground type (Dark / Light)", "fg-type"},
{"Terminal background color", "bg-color"},
{"Terminal background type (Dark / Light)", "bg-type"},
}))};
}))
};
+6 -3
View File
@@ -7,7 +7,8 @@
bool ffPrintTheme(FFThemeOptions* options) {
FFThemeResult result = {
.theme1 = ffStrbufCreate(),
.theme2 = ffStrbufCreate()};
.theme2 = ffStrbufCreate()
};
const char* error = ffDetectTheme(&result);
if (error) {
@@ -58,7 +59,8 @@ void ffGenerateThemeJsonConfig(FFThemeOptions* options, yyjson_mut_doc* doc, yyj
bool ffGenerateThemeJsonResult(FF_MAYBE_UNUSED FFThemeOptions* options, yyjson_mut_doc* doc, yyjson_mut_val* module) {
FFThemeResult result = {
.theme1 = ffStrbufCreate(),
.theme2 = ffStrbufCreate()};
.theme2 = ffStrbufCreate()
};
const char* error = ffDetectTheme(&result);
if (error) {
@@ -96,4 +98,5 @@ FFModuleBaseInfo ffThemeModuleInfo = {
.formatArgs = FF_FORMAT_ARG_LIST(((FFModuleFormatArg[]) {
{"Theme part 1", "theme1"},
{"Theme part 2", "theme2"},
}))};
}))
};
+2 -1
View File
@@ -197,4 +197,5 @@ FFModuleBaseInfo ffTitleModuleInfo = {
{"UID (*nix) / SID (Windows)", "user-id"},
{"PID of current process", "pid"},
{"CWD with home dir replaced by `~`", "cwd"},
}))};
}))
};
+6 -3
View File
@@ -7,7 +7,8 @@
bool ffPrintTPM(FFTPMOptions* options) {
FFTPMResult result = {
.version = ffStrbufCreate(),
.description = ffStrbufCreate()};
.description = ffStrbufCreate()
};
const char* error = ffDetectTPM(&result);
if (error) {
@@ -54,7 +55,8 @@ void ffGenerateTPMJsonConfig(FFTPMOptions* options, yyjson_mut_doc* doc, yyjson_
bool ffGenerateTPMJsonResult(FF_MAYBE_UNUSED FFTPMOptions* options, yyjson_mut_doc* doc, yyjson_mut_val* module) {
FFTPMResult result = {
.version = ffStrbufCreate(),
.description = ffStrbufCreate()};
.description = ffStrbufCreate()
};
const char* error = ffDetectTPM(&result);
if (error) {
@@ -92,4 +94,5 @@ FFModuleBaseInfo ffTPMModuleInfo = {
.formatArgs = FF_FORMAT_ARG_LIST(((FFModuleFormatArg[]) {
{"TPM device version", "version"},
{"TPM general description", "description"},
}))};
}))
};
+2 -1
View File
@@ -102,4 +102,5 @@ FFModuleBaseInfo ffUptimeModuleInfo = {
{"Days of year after boot", "days-of-year"},
{"Years fraction after boot", "years-fraction"},
{"Formatted uptime", "formatted"},
}))};
}))
};
+2 -1
View File
@@ -202,4 +202,5 @@ FFModuleBaseInfo ffUsersModuleInfo = {
{"Years integer after login", "years"},
{"Days of year after login", "days-of-year"},
{"Years fraction after login", "years-fraction"},
}))};
}))
};
+2 -1
View File
@@ -113,4 +113,5 @@ FFModuleBaseInfo ffVersionModuleInfo = {
{"Date time when compiling", "compile-time"},
{"Compiler used when compiling", "compiler"},
{"Libc used when compiling", "libc"},
}))};
}))
};
+2 -1
View File
@@ -145,4 +145,5 @@ FFModuleBaseInfo ffVulkanModuleInfo = {
{"API version", "api-version"},
{"Conformance version", "conformance-version"},
{"Instance version", "instance-version"},
}))};
}))
};
+2 -1
View File
@@ -86,4 +86,5 @@ FFModuleBaseInfo ffWallpaperModuleInfo = {
.formatArgs = FF_FORMAT_ARG_LIST(((FFModuleFormatArg[]) {
{"File name", "file-name"},
{"Full path", "full-path"},
}))};
}))
};
+2 -1
View File
@@ -101,4 +101,5 @@ FFModuleBaseInfo ffWeatherModuleInfo = {
.generateJsonConfig = (void*) ffGenerateWeatherJsonConfig,
.formatArgs = FF_FORMAT_ARG_LIST(((FFModuleFormatArg[]) {
{"Weather result", "result"},
}))};
}))
};
+2 -1
View File
@@ -236,4 +236,5 @@ FFModuleBaseInfo ffWifiModuleInfo = {
{"Connection signal quality (percentage bar)", "signal-quality-bar"},
{"Connection channel number", "channel"},
{"Connection channel band in GHz", "band"},
}))};
}))
};
+2 -1
View File
@@ -134,4 +134,5 @@ FFModuleBaseInfo ffWMModuleInfo = {
{"WM protocol name", "protocol-name"},
{"WM plugin name", "plugin-name"},
{"WM version", "version"},
}))};
}))
};
+2 -1
View File
@@ -71,4 +71,5 @@ FFModuleBaseInfo ffWMThemeModuleInfo = {
.generateJsonConfig = (void*) ffGenerateWMThemeJsonConfig,
.formatArgs = FF_FORMAT_ARG_LIST(((FFModuleFormatArg[]) {
{"WM theme", "result"},
}))};
}))
};
+2 -1
View File
@@ -214,4 +214,5 @@ FFModuleBaseInfo ffZpoolModuleInfo = {
{"Size allocated percentage bar", "allocated-percentage-bar"},
{"Fragmentation percentage bar", "fragmentation-percentage-bar"},
{"Is read-only", "is-readonly"},
}))};
}))
};
+1 -1
View File
@@ -7,7 +7,7 @@
static void verify(const char* format, const char* arg, const char* expected, int lineNo) {
FF_STRBUF_AUTO_DESTROY result = ffStrbufCreate();
FF_STRBUF_AUTO_DESTROY formatter = ffStrbufCreateStatic(format);
const FFformatarg arguments[] = { {.type = FF_ARG_TYPE_STRING, arg}};
const FFformatarg arguments[] = {{.type = FF_ARG_TYPE_STRING, arg}};
ffParseFormatString(&result, &formatter, 1, arguments);
if (!ffStrbufEqualS(&result, expected)) {
fprintf(stderr, FASTFETCH_TEXT_MODIFIER_ERROR "[%d] %s: expected \"%s\", got \"%s\"\n" FASTFETCH_TEXT_MODIFIER_RESET, lineNo, format, expected, result.chars);