mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-10-28 15:53:51 +01:00
@@ -5,15 +5,13 @@
|
||||
#include "detection/diskio/diskio.h"
|
||||
#include "modules/diskio/diskio.h"
|
||||
|
||||
#define FF_DISKIO_DISPLAY_NAME "Disk IO"
|
||||
|
||||
static int sortDevices(const FFDiskIOResult* left, const FFDiskIOResult* right) {
|
||||
return ffStrbufComp(&left->name, &right->name);
|
||||
}
|
||||
|
||||
static void formatKey(const FFDiskIOOptions* options, FFDiskIOResult* dev, uint32_t index, FFstrbuf* key) {
|
||||
if (options->moduleArgs.key.length == 0) {
|
||||
ffStrbufSetF(key, FF_DISKIO_DISPLAY_NAME " (%s)", dev->name.length ? dev->name.chars : dev->devPath.chars);
|
||||
ffStrbufSetF(key, "%s (%s)", FF_MODULE_GET_DISPLAY_NAME(DiskIO), dev->name.length ? dev->name.chars : dev->devPath.chars);
|
||||
} else {
|
||||
ffStrbufClear(key);
|
||||
FF_PARSE_FORMAT_STRING_CHECKED(key, &options->moduleArgs.key, ((FFformatarg[]) {
|
||||
@@ -30,7 +28,7 @@ bool ffPrintDiskIO(FFDiskIOOptions* options) {
|
||||
const char* error = ffDetectDiskIO(&result, options);
|
||||
|
||||
if (error) {
|
||||
ffPrintError(FF_DISKIO_DISPLAY_NAME, 0, &options->moduleArgs, FF_PRINT_TYPE_NO_CUSTOM_KEY, "%s", error);
|
||||
ffPrintError(FF_MODULE_GET_DISPLAY_NAME(DiskIO), 0, &options->moduleArgs, FF_PRINT_TYPE_NO_CUSTOM_KEY, "%s", error);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -116,7 +114,7 @@ void ffParseDiskIOJsonObject(FFDiskIOOptions* options, yyjson_val* module) {
|
||||
continue;
|
||||
}
|
||||
|
||||
ffPrintError(FF_DISKIO_MODULE_NAME, 0, &options->moduleArgs, FF_PRINT_TYPE_DEFAULT, "Unknown JSON key %s", unsafe_yyjson_get_str(key));
|
||||
ffPrintError(FF_MODULE_GET_DISPLAY_NAME(DiskIO), 0, &options->moduleArgs, FF_PRINT_TYPE_DEFAULT, "Unknown JSON key %s", unsafe_yyjson_get_str(key));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -172,7 +170,7 @@ void ffDestroyDiskIOOptions(FFDiskIOOptions* options) {
|
||||
}
|
||||
|
||||
FFModuleBaseInfo ffDiskIOModuleInfo = {
|
||||
.name = FF_DISKIO_MODULE_NAME,
|
||||
.name = "DiskIO",
|
||||
.description = "Print physical disk I/O throughput",
|
||||
.displayName = {
|
||||
.en = "Disk I/O",
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
|
||||
#include "option.h"
|
||||
|
||||
#define FF_DISKIO_MODULE_NAME "DiskIO"
|
||||
|
||||
void ffPrepareDiskIO(FFDiskIOOptions* options);
|
||||
|
||||
bool ffPrintDiskIO(FFDiskIOOptions* options);
|
||||
|
||||
Reference in New Issue
Block a user