Introduce FFPlatform

This commit is contained in:
Linus Dierheimer committed 2023-01-15 15:57:26 +01:00
1 parent dd77ebe11e
commit a1d8e3e598
39 files changed
+622 -560

No files matched your search

+10 -10
View File
@@ -2,29 +2,29 @@
#include "common/printing.h"
#define FF_KERNEL_MODULE_NAME "Kernel"
#define FF_KERNEL_NUM_FORMAT_ARGS 3
#define FF_KERNEL_NUM_FORMAT_ARGS 4
void ffPrintKernel(FFinstance* instance)
{
if(instance->config.kernel.outputFormat.length == 0)
{
ffPrintLogoAndKey(instance, FF_KERNEL_MODULE_NAME, 0, &instance->config.kernel.key);
ffStrbufWriteTo(&instance->state.platform.systemRelease, stdout);
#ifdef _WIN32
if(instance->state.utsname.version[0] != '\0')
printf("%s (%s)\n", instance->state.utsname.release, instance->state.utsname.version);
else
puts(instance->state.utsname.release);
#else
puts(instance->state.utsname.release);
if(instance->state.platform.systemVersion.length > 0)
printf(" (%s)", instance->state.platform.systemVersion.chars);
#endif
putchar('\n');
}
else
{
ffPrintFormat(instance, FF_KERNEL_MODULE_NAME, 0, &instance->config.kernel, FF_KERNEL_NUM_FORMAT_ARGS, (FFformatarg[]){
{FF_FORMAT_ARG_TYPE_STRING, instance->state.utsname.sysname},
{FF_FORMAT_ARG_TYPE_STRING, instance->state.utsname.release},
{FF_FORMAT_ARG_TYPE_STRING, instance->state.utsname.version}
{FF_FORMAT_ARG_TYPE_STRBUF, &instance->state.platform.systemName},
{FF_FORMAT_ARG_TYPE_STRBUF, &instance->state.platform.systemRelease},
{FF_FORMAT_ARG_TYPE_STRBUF, &instance->state.platform.systemVersion},
{FF_FORMAT_ARG_TYPE_STRBUF, &instance->state.platform.systemArchitecture}
});
}
}