mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-10-29 00:03:58 +01:00
Modules: return bool to indicate whether the detection is succeeded
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
#include "modules/kernel/kernel.h"
|
||||
#include "util/stringUtils.h"
|
||||
|
||||
void ffPrintKernel(FFKernelOptions* options)
|
||||
bool ffPrintKernel(FFKernelOptions* options)
|
||||
{
|
||||
const FFPlatformSysinfo* info = &instance.state.platform.sysinfo;
|
||||
if(options->moduleArgs.outputFormat.length == 0)
|
||||
@@ -30,6 +30,8 @@ void ffPrintKernel(FFKernelOptions* options)
|
||||
FF_FORMAT_ARG(str, "page-size"),
|
||||
}));
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void ffParseKernelJsonObject(FFKernelOptions* options, yyjson_val* module)
|
||||
@@ -50,7 +52,7 @@ void ffGenerateKernelJsonConfig(FFKernelOptions* options, yyjson_mut_doc* doc, y
|
||||
ffJsonConfigGenerateModuleArgsConfig(doc, module, &options->moduleArgs);
|
||||
}
|
||||
|
||||
void ffGenerateKernelJsonResult(FF_MAYBE_UNUSED FFKernelOptions* options, yyjson_mut_doc* doc, yyjson_mut_val* module)
|
||||
bool ffGenerateKernelJsonResult(FF_MAYBE_UNUSED FFKernelOptions* options, yyjson_mut_doc* doc, yyjson_mut_val* module)
|
||||
{
|
||||
const FFPlatformSysinfo* info = &instance.state.platform.sysinfo;
|
||||
|
||||
@@ -61,6 +63,8 @@ void ffGenerateKernelJsonResult(FF_MAYBE_UNUSED FFKernelOptions* options, yyjson
|
||||
yyjson_mut_obj_add_strbuf(doc, obj, "version", &info->version);
|
||||
yyjson_mut_obj_add_strbuf(doc, obj, "displayVersion", &info->displayVersion);
|
||||
yyjson_mut_obj_add_uint(doc, obj, "pageSize", info->pageSize);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void ffInitKernelOptions(FFKernelOptions* options)
|
||||
|
||||
Reference in New Issue
Block a user