Files
fastfetch/src/modules/kernel.c
T

31 lines
1.0 KiB
C
Raw Normal View History

2021-02-18 22:25:36 +01:00
#include "fastfetch.h"
#include "common/printing.h"
2021-02-18 22:25:36 +01:00
2021-04-15 18:59:26 +02:00
#define FF_KERNEL_MODULE_NAME "Kernel"
#define FF_KERNEL_NUM_FORMAT_ARGS 3
2021-02-27 18:30:05 +01:00
void ffPrintKernel(FFinstance* instance)
2021-02-18 22:25:36 +01:00
{
2022-06-17 18:15:36 +02:00
if(instance->config.kernel.outputFormat.length == 0)
2021-03-19 20:57:07 +01:00
{
2022-06-17 18:15:36 +02:00
ffPrintLogoAndKey(instance, FF_KERNEL_MODULE_NAME, 0, &instance->config.kernel.key);
#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);
#endif
2021-03-19 20:57:07 +01:00
}
else
{
2022-06-17 18:15:36 +02:00
ffPrintFormat(instance, FF_KERNEL_MODULE_NAME, 0, &instance->config.kernel, FF_KERNEL_NUM_FORMAT_ARGS, (FFformatarg[]){
2022-10-14 16:23:37 +08:00
{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}
2021-04-15 18:59:26 +02:00
});
}
2021-03-27 18:14:19 +01:00
}