From 000bd37f1d5df9ef347925fb63bd04e2f31a92d9 Mon Sep 17 00:00:00 2001 From: Linus Dierheimer Date: Tue, 26 Jul 2022 17:29:09 +0200 Subject: [PATCH] Refactor: move title detection to own header --- src/detection/title.c | 1 + src/detection/title.h | 17 +++++++++++++++++ src/fastfetch.h | 11 ----------- src/modules/separator.c | 1 + src/modules/title.c | 1 + 5 files changed, 20 insertions(+), 11 deletions(-) create mode 100644 src/detection/title.h diff --git a/src/detection/title.c b/src/detection/title.c index 9961d15ba..1ea7ecc94 100644 --- a/src/detection/title.c +++ b/src/detection/title.c @@ -1,4 +1,5 @@ #include "fastfetch.h" +#include "detection/title.h" #include #include diff --git a/src/detection/title.h b/src/detection/title.h new file mode 100644 index 000000000..ee3017855 --- /dev/null +++ b/src/detection/title.h @@ -0,0 +1,17 @@ +#pragma once + +#ifndef FF_INCLUDED_detection_title +#define FF_INCLUDED_detection_title + +#include "util/FFstrbuf.h" + +typedef struct FFTitleResult +{ + FFstrbuf userName; + FFstrbuf hostname; + FFstrbuf fqdn; //Fully qualified domain name +} FFTitleResult; + +const FFTitleResult* ffDetectTitle(const FFinstance* instance); + +#endif diff --git a/src/fastfetch.h b/src/fastfetch.h index 6970076a9..7625f474d 100644 --- a/src/fastfetch.h +++ b/src/fastfetch.h @@ -173,13 +173,6 @@ typedef struct FFinstance FFstate state; } FFinstance; -typedef struct FFTitleResult -{ - FFstrbuf userName; - FFstrbuf hostname; - FFstrbuf fqdn; //Fully qualified domain name -} FFTitleResult; - typedef struct FFOSResult { FFstrbuf systemName; @@ -336,10 +329,6 @@ void ffLogoBuiltinListAutocompletion(); ///////////////////////// // Detection functions // ///////////////////////// - -//detection/title.c -const FFTitleResult* ffDetectTitle(const FFinstance* instance); - //detection/os.c const FFOSResult* ffDetectOS(const FFinstance* instance); diff --git a/src/modules/separator.c b/src/modules/separator.c index 4504aa5cc..7227f9ae4 100644 --- a/src/modules/separator.c +++ b/src/modules/separator.c @@ -1,5 +1,6 @@ #include "fastfetch.h" #include "common/printing.h" +#include "detection/title.h" void ffPrintSeparator(FFinstance* instance) { diff --git a/src/modules/title.c b/src/modules/title.c index be6d8749a..1c78f3327 100644 --- a/src/modules/title.c +++ b/src/modules/title.c @@ -1,5 +1,6 @@ #include "fastfetch.h" #include "common/printing.h" +#include "detection/title.h" static inline void printTitlePart(FFinstance* instance, const FFstrbuf* content) {