Refactor: move terminal/shell detection to own header

This commit is contained in:
Linus Dierheimer
2022-07-26 18:06:30 +02:00
parent 5c1aa20042
commit 0c81d3e894
12 changed files with 37 additions and 23 deletions
+2
View File
@@ -3,6 +3,8 @@
#ifndef FF_INCLUDED_detection_displayserver
#define FF_INCLUDED_detection_displayserver
#include "fastfetch.h"
typedef struct FFResolutionResult
{
uint32_t width;
+1 -1
View File
@@ -3,7 +3,7 @@
#ifndef FF_INCLUDED_detection_gtk
#define FF_INCLUDED_detection_gtk
#include "util/FFstrbuf.h"
#include "fastfetch.h"
typedef struct FFGTKResult
{
+1 -1
View File
@@ -3,7 +3,7 @@
#ifndef FF_INCLUDED_detection_os
#define FF_INCLUDED_detection_os
#include "util/FFstrbuf.h"
#include "fastfetch.h"
typedef struct FFOSResult
{
+1 -1
View File
@@ -3,7 +3,7 @@
#ifndef FF_INCLUDED_detection_qt
#define FF_INCLUDED_detection_qt
#include "util/FFstrbuf.h"
#include "fastfetch.h"
typedef struct FFQtResult
{
+1
View File
@@ -1,4 +1,5 @@
#include "fastfetch.h"
#include "detection/terminalshell.h"
#include "common/io.h"
#include "common/parsing.h"
#include "common/processing.h"
+26
View File
@@ -0,0 +1,26 @@
#pragma once
#ifndef FF_INCLUDED_detection_terminalshell
#define FF_INCLUDED_detection_terminalshell
#include "fastfetch.h"
typedef struct FFTerminalShellResult
{
FFstrbuf shellProcessName;
FFstrbuf shellExe;
const char* shellExeName; //pointer to a char in shellExe
FFstrbuf shellVersion;
FFstrbuf terminalProcessName;
FFstrbuf terminalExe;
const char* terminalExeName; //pointer to a char in terminalExe
FFstrbuf userShellExe;
const char* userShellExeName; //pointer to a char in userShellExe
FFstrbuf userShellVersion;
} FFTerminalShellResult;
const FFTerminalShellResult* ffDetectTerminalShell(FFinstance* instance);
#endif
+1 -1
View File
@@ -3,7 +3,7 @@
#ifndef FF_INCLUDED_detection_title
#define FF_INCLUDED_detection_title
#include "util/FFstrbuf.h"
#include "fastfetch.h"
typedef struct FFTitleResult
{
-19
View File
@@ -173,22 +173,6 @@ typedef struct FFinstance
FFstate state;
} FFinstance;
typedef struct FFTerminalShellResult
{
FFstrbuf shellProcessName;
FFstrbuf shellExe;
const char* shellExeName; //pointer to a char in shellExe
FFstrbuf shellVersion;
FFstrbuf terminalProcessName;
FFstrbuf terminalExe;
const char* terminalExeName; //pointer to a char in terminalExe
FFstrbuf userShellExe;
const char* userShellExeName; //pointer to a char in userShellExe
FFstrbuf userShellVersion;
} FFTerminalShellResult;
typedef struct FFGPUResult
{
FFstrbuf vendor;
@@ -279,9 +263,6 @@ void ffLogoBuiltinListAutocompletion();
// Detection functions //
/////////////////////////
//detection/terminalShell.c
const FFTerminalShellResult* ffDetectTerminalShell(FFinstance* instance);
//detection/temps.c (currently unused)
const FFTempsResult* ffDetectTemps(const FFinstance* instance);
+1
View File
@@ -2,6 +2,7 @@
#include "common/io.h"
#include "common/printing.h"
#include "detection/os.h"
#include "detection/terminalshell.h"
#include <ctype.h>
#include <string.h>
+1
View File
@@ -1,5 +1,6 @@
#include "fastfetch.h"
#include "common/printing.h"
#include "detection/terminalshell.h"
#define FF_SHELL_MODULE_NAME "Shell"
#define FF_SHELL_NUM_FORMAT_ARGS 7
+1
View File
@@ -1,5 +1,6 @@
#include "fastfetch.h"
#include "common/printing.h"
#include "detection/terminalshell.h"
#include <string.h>
+1
View File
@@ -5,6 +5,7 @@
#include "common/settings.h"
#include "common/processing.h"
#include "detection/displayserver.h"
#include "detection/terminalshell.h"
#define FF_TERMFONT_MODULE_NAME "Terminal Font"
#define FF_TERMFONT_NUM_FORMAT_ARGS 5