Refactor: move printing functions to own header

This commit is contained in:
Linus Dierheimer
2022-07-25 13:15:01 +02:00
parent 778856dd57
commit 536f914f3e
46 changed files with 60 additions and 9 deletions
+1
View File
@@ -1,5 +1,6 @@
#include "fastfetch.h"
#include "common/io.h"
#include "common/printing.h"
#include <stdlib.h>
+1
View File
@@ -1,4 +1,5 @@
#include "fastfetch.h"
#include "common/printing.h"
void ffPrintLogoAndKey(FFinstance* instance, const char* moduleName, uint8_t moduleIndex, const FFstrbuf* customKeyFormat)
{
+16
View File
@@ -0,0 +1,16 @@
#pragma once
#ifndef FF_INCLUDED_common_printing
#define FF_INCLUDED_common_printing
#include "fastfetch.h"
void ffPrintLogoAndKey(FFinstance* instance, const char* moduleName, uint8_t moduleIndex, const FFstrbuf* customKeyFormat);
void ffPrintFormatString(FFinstance* instance, const char* moduleName, uint8_t moduleIndex, const FFstrbuf* customKeyFormat, const FFstrbuf* format, uint32_t numArgs, const FFformatarg* arguments);
void ffPrintFormat(FFinstance* instance, const char* moduleName, uint8_t moduleIndex, const FFModuleArgs* moduleArgs, uint32_t numArgs, const FFformatarg* arguments);
void ffPrintErrorString(FFinstance* instance, const char* moduleName, uint8_t moduleIndex, const FFstrbuf* customKeyFormat, const FFstrbuf* customErrorFormat, const char* message, ...);
void ffPrintError(FFinstance* instance, const char* moduleName, uint8_t moduleIndex, const FFModuleArgs* moduleArgs, const char* message, ...);
void ffPrintColor(const FFstrbuf* colorValue);
void ffPrintCharTimes(char c, uint32_t times);
#endif
+1
View File
@@ -1,4 +1,5 @@
#include "fastfetch.h"
#include "common/printing.h"
#include <stdlib.h>
#include <string.h>
-9
View File
@@ -385,15 +385,6 @@ void ffListFeatures();
//common/threading.c
void ffStartDetectionThreads(FFinstance* instance);
//common/printing.c
void ffPrintLogoAndKey(FFinstance* instance, const char* moduleName, uint8_t moduleIndex, const FFstrbuf* customKeyFormat);
void ffPrintFormatString(FFinstance* instance, const char* moduleName, uint8_t moduleIndex, const FFstrbuf* customKeyFormat, const FFstrbuf* format, uint32_t numArgs, const FFformatarg* arguments);
void ffPrintFormat(FFinstance* instance, const char* moduleName, uint8_t moduleIndex, const FFModuleArgs* moduleArgs, uint32_t numArgs, const FFformatarg* arguments);
void ffPrintErrorString(FFinstance* instance, const char* moduleName, uint8_t moduleIndex, const FFstrbuf* customKeyFormat, const FFstrbuf* customErrorFormat, const char* message, ...);
void ffPrintError(FFinstance* instance, const char* moduleName, uint8_t moduleIndex, const FFModuleArgs* moduleArgs, const char* message, ...);
void ffPrintColor(const FFstrbuf* colorValue);
void ffPrintCharTimes(char c, uint32_t times);
//common/caching.c
void ffCacheValidate(FFinstance* instance);
+1
View File
@@ -1,5 +1,6 @@
#include "image.h"
#include "common/io.h"
#include "common/printing.h"
#if defined(FF_HAVE_IMAGEMAGICK7) || defined(FF_HAVE_IMAGEMAGICK6)
+1
View File
@@ -1,5 +1,6 @@
#include "logo.h"
#include "common/io.h"
#include "common/printing.h"
#include <ctype.h>
#include <string.h>
+1
View File
@@ -1,5 +1,6 @@
#include "fastfetch.h"
#include "common/io.h"
#include "common/printing.h"
#include <dirent.h>
+1
View File
@@ -1,4 +1,5 @@
#include "fastfetch.h"
#include "common/printing.h"
void ffPrintBreak(FFinstance* instance)
{
+1
View File
@@ -1,4 +1,5 @@
#include "fastfetch.h"
#include "common/printing.h"
void ffPrintColors(FFinstance* instance)
{
+1
View File
@@ -1,6 +1,7 @@
#include "fastfetch.h"
#include "common/io.h"
#include "common/properties.h"
#include "common/printing.h"
#include <stdlib.h>
+1
View File
@@ -1,4 +1,5 @@
#include "fastfetch.h"
#include "common/printing.h"
#include <unistd.h>
+1
View File
@@ -1,5 +1,6 @@
#include "fastfetch.h"
#include "common/properties.h"
#include "common/printing.h"
#include <stdlib.h>
+1
View File
@@ -1,4 +1,5 @@
#include "fastfetch.h"
#include "common/printing.h"
void ffPrintCustom(FFinstance* instance, const char* key, const char* value)
{
+1
View File
@@ -1,4 +1,5 @@
#include "fastfetch.h"
#include "common/printing.h"
#define FF_DATE_MODULE_NAME "Date"
+1
View File
@@ -1,4 +1,5 @@
#include "fastfetch.h"
#include "common/printing.h"
#define FF_DATETIME_MODULE_NAME "Date & Time"
#define FF_DATETIME_NUM_FORMAT_ARGS 20
+1
View File
@@ -1,4 +1,5 @@
#include "fastfetch.h"
#include "common/printing.h"
#define FF_DE_MODULE_NAME "DE"
#define FF_DE_NUM_FORMAT_ARGS 3
+1
View File
@@ -1,4 +1,5 @@
#include "fastfetch.h"
#include "common/printing.h"
#include <sys/statvfs.h>
+1
View File
@@ -1,4 +1,5 @@
#include "fastfetch.h"
#include "common/printing.h"
#define FF_FONT_MODULE_NAME "Font"
#define FF_FONT_NUM_FORMAT_ARGS 21
+1
View File
@@ -1,4 +1,5 @@
#include "fastfetch.h"
#include "common/printing.h"
#include <stdlib.h>
+1
View File
@@ -1,4 +1,5 @@
#include "fastfetch.h"
#include "common/printing.h"
#include <stdlib.h>
+1
View File
@@ -1,4 +1,5 @@
#include "fastfetch.h"
#include "common/printing.h"
#define FF_ICONS_MODULE_NAME "Icons"
#define FF_ICONS_NUM_FORMAT_ARGS 5
+1
View File
@@ -1,4 +1,5 @@
#include "fastfetch.h"
#include "common/printing.h"
#define FF_KERNEL_MODULE_NAME "Kernel"
#define FF_KERNEL_NUM_FORMAT_ARGS 3
+1
View File
@@ -1,5 +1,6 @@
#include "fastfetch.h"
#include "common/properties.h"
#include "common/printing.h"
#include <stdlib.h>
+1
View File
@@ -1,4 +1,5 @@
#include "fastfetch.h"
#include "common/printing.h"
#define FF_LOCALIP_MODULE_NAME "Local IP"
#define FF_LOCALIP_NUM_FORMAT_ARGS 1
+1
View File
@@ -1,4 +1,5 @@
#include "fastfetch.h"
#include "common/printing.h"
#include <stdlib.h>
+1
View File
@@ -1,4 +1,5 @@
#include "fastfetch.h"
#include "common/printing.h"
#define FF_OPENCL_MODULE_NAME "OpenCL"
#define FF_OPENCL_NUM_FORMAT_ARGS 3
+1
View File
@@ -1,4 +1,5 @@
#include "fastfetch.h"
#include "common/printing.h"
#include <string.h>
+1
View File
@@ -1,4 +1,5 @@
#include "fastfetch.h"
#include "common/printing.h"
#include <ctype.h>
+1
View File
@@ -1,6 +1,7 @@
#include "fastfetch.h"
#include "common/io.h"
#include "common/properties.h"
#include "common/printing.h"
#include <stdlib.h>
#include <string.h>
+1
View File
@@ -1,4 +1,5 @@
#include "fastfetch.h"
#include "common/printing.h"
#include <ctype.h>
+1
View File
@@ -1,4 +1,5 @@
#include "fastfetch.h"
#include "common/printing.h"
#define FF_PROCESSES_MODULE_NAME "Processes"
#define FF_PROCESSES_NUM_FORMAT_ARGS 1
+1
View File
@@ -1,4 +1,5 @@
#include "fastfetch.h"
#include "common/printing.h"
#define FF_PUBLICIP_MODULE_NAME "Public IP"
#define FF_PUBLICIP_NUM_FORMAT_ARGS 1
+1
View File
@@ -1,4 +1,5 @@
#include "fastfetch.h"
#include "common/printing.h"
#define FF_RESOLUTION_MODULE_NAME "Resolution"
#define FF_RESOLUTION_NUM_FORMAT_ARGS 3
+1
View File
@@ -1,4 +1,5 @@
#include "fastfetch.h"
#include "common/printing.h"
void ffPrintSeparator(FFinstance* instance)
{
+1
View File
@@ -1,4 +1,5 @@
#include "fastfetch.h"
#include "common/printing.h"
#define FF_SHELL_MODULE_NAME "Shell"
#define FF_SHELL_NUM_FORMAT_ARGS 7
+1
View File
@@ -1,4 +1,5 @@
#include "fastfetch.h"
#include "common/printing.h"
#include <ctype.h>
+1
View File
@@ -1,4 +1,5 @@
#include "fastfetch.h"
#include "common/printing.h"
#include <string.h>
+1
View File
@@ -1,5 +1,6 @@
#include "fastfetch.h"
#include "common/properties.h"
#include "common/printing.h"
#define FF_TERMFONT_MODULE_NAME "Terminal Font"
#define FF_TERMFONT_NUM_FORMAT_ARGS 5
+1
View File
@@ -1,4 +1,5 @@
#include "fastfetch.h"
#include "common/printing.h"
#define FF_THEME_MODULE_NAME "Theme"
#define FF_THEME_NUM_FORMAT_ARGS 7
+1
View File
@@ -1,4 +1,5 @@
#include "fastfetch.h"
#include "common/printing.h"
#define FF_TIME_MODULE_NAME "Time"
+1
View File
@@ -1,4 +1,5 @@
#include "fastfetch.h"
#include "common/printing.h"
static inline void printTitlePart(FFinstance* instance, const FFstrbuf* content)
{
+1
View File
@@ -1,4 +1,5 @@
#include "fastfetch.h"
#include "common/printing.h"
#define FF_UPTIME_MODULE_NAME "Uptime"
#define FF_UPTIME_NUM_FORMAT_ARGS 4
+1
View File
@@ -1,4 +1,5 @@
#include "fastfetch.h"
#include "common/printing.h"
#define FF_VULKAN_MODULE_NAME "Vulkan"
#define FF_VULKAN_NUM_FORMAT_ARGS 3
+1
View File
@@ -1,4 +1,5 @@
#include "fastfetch.h"
#include "common/printing.h"
#define FF_WM_MODULE_NAME "WM"
#define FF_WM_NUM_FORMAT_ARGS 3
+1
View File
@@ -1,5 +1,6 @@
#include "fastfetch.h"
#include "common/properties.h"
#include "common/printing.h"
#include <stdlib.h>
#include <string.h>