2022-07-25 13:15:01 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "fastfetch.h"
|
2022-07-25 14:26:08 +02:00
|
|
|
#include "common/format.h"
|
2022-07-25 13:15:01 +02:00
|
|
|
|
2024-11-14 10:04:57 +08:00
|
|
|
typedef enum __attribute__((__packed__)) FFPrintType {
|
2023-08-15 21:40:22 +08:00
|
|
|
FF_PRINT_TYPE_DEFAULT = 0,
|
2024-06-27 17:49:30 +08:00
|
|
|
FF_PRINT_TYPE_NO_CUSTOM_KEY = 1 << 0, // key has been formatted outside
|
2023-08-15 21:40:22 +08:00
|
|
|
FF_PRINT_TYPE_NO_CUSTOM_KEY_COLOR = 1 << 1,
|
|
|
|
|
FF_PRINT_TYPE_NO_CUSTOM_KEY_WIDTH = 1 << 2,
|
|
|
|
|
FF_PRINT_TYPE_NO_CUSTOM_OUTPUT_FORMAT = 1 << 3, // reserved
|
2024-11-14 10:04:57 +08:00
|
|
|
FF_PRINT_TYPE_FORCE_UNSIGNED = UINT8_MAX,
|
2023-08-15 21:40:22 +08:00
|
|
|
} FFPrintType;
|
|
|
|
|
|
|
|
|
|
void ffPrintLogoAndKey(const char* moduleName, uint8_t moduleIndex, const FFModuleArgs* moduleArgs, FFPrintType printType);
|
2024-03-07 10:47:28 +08:00
|
|
|
void ffPrintFormat(const char* moduleName, uint8_t moduleIndex, const FFModuleArgs* moduleArgs, FFPrintType printType, uint32_t numArgs, const FFformatarg* arguments);
|
2024-12-11 10:47:02 +08:00
|
|
|
#define FF_PRINT_FORMAT_CHECKED(moduleName, moduleIndex, moduleArgs, printType, arguments) \
|
|
|
|
|
ffPrintFormat((moduleName), (moduleIndex), (moduleArgs), (printType), (sizeof(arguments) / sizeof(*arguments)), (arguments));
|
2024-03-07 11:10:18 +08:00
|
|
|
FF_C_PRINTF(5, 6) void ffPrintError(const char* moduleName, uint8_t moduleIndex, const FFModuleArgs* moduleArgs, FFPrintType printType, const char* message, ...);
|
2022-07-25 13:15:01 +02:00
|
|
|
void ffPrintColor(const FFstrbuf* colorValue);
|
|
|
|
|
void ffPrintCharTimes(char c, uint32_t times);
|