Modules: return bool to indicate whether the detection is succeeded

This commit is contained in:
李通洲
2025-08-18 13:38:30 +08:00
parent a9aaa36b2c
commit 3b5e9c74d6
147 changed files with 869 additions and 538 deletions
+6 -2
View File
@@ -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)
+1 -1
View File
@@ -4,7 +4,7 @@
#define FF_KERNEL_MODULE_NAME "Kernel"
void ffPrintKernel(FFKernelOptions* options);
bool ffPrintKernel(FFKernelOptions* options);
void ffInitKernelOptions(FFKernelOptions* options);
void ffDestroyKernelOptions(FFKernelOptions* options);