From 676485ef74c7e62aa116291fb580c992ae534fb3 Mon Sep 17 00:00:00 2001 From: Linus Dierheimer Date: Tue, 26 Jul 2022 18:13:12 +0200 Subject: [PATCH] Refactor: move temps detection to own header --- src/detection/temps.c | 1 + src/detection/temps.h | 22 ++++++++++++++++++++++ src/fastfetch.h | 15 --------------- src/modules/cpu.c | 1 + src/modules/gpu.c | 1 + 5 files changed, 25 insertions(+), 15 deletions(-) create mode 100644 src/detection/temps.h diff --git a/src/detection/temps.c b/src/detection/temps.c index 9fb9b639a..3f5bc47d5 100644 --- a/src/detection/temps.c +++ b/src/detection/temps.c @@ -1,4 +1,5 @@ #include "fastfetch.h" +#include "detection/temps.h" #include "common/io.h" #include diff --git a/src/detection/temps.h b/src/detection/temps.h new file mode 100644 index 000000000..3f923b0ff --- /dev/null +++ b/src/detection/temps.h @@ -0,0 +1,22 @@ +#pragma once + +#ifndef FF_INCLUDED_detection_temps +#define FF_INCLUDED_detection_temps + +#include "fastfetch.h" + +typedef struct FFTempValue +{ + FFstrbuf name; + FFstrbuf deviceClass; + double value; +} FFTempValue; + +typedef struct FFTempsResult +{ + FFlist values; //List of FFTempValue +} FFTempsResult; + +const FFTempsResult* ffDetectTemps(const FFinstance* instance); + +#endif diff --git a/src/fastfetch.h b/src/fastfetch.h index 44e3a7c8b..f053e9503 100644 --- a/src/fastfetch.h +++ b/src/fastfetch.h @@ -189,18 +189,6 @@ typedef struct FFVulkanResult FFlist devices; //List of FFGPUResult } FFVulkanResult; -typedef struct FFTempValue -{ - FFstrbuf name; - FFstrbuf deviceClass; - double value; -} FFTempValue; - -typedef struct FFTempsResult -{ - FFlist values; //List of FFTempValue -} FFTempsResult; - typedef struct FFMediaResult { FFstrbuf busNameShort; //e.g. plasma-browser-integration @@ -238,9 +226,6 @@ void ffLogoBuiltinListAutocompletion(); // Detection functions // ///////////////////////// -//detection/temps.c (currently unused) -const FFTempsResult* ffDetectTemps(const FFinstance* instance); - //detection/media.c const FFMediaResult* ffDetectMedia(FFinstance* instance); diff --git a/src/modules/cpu.c b/src/modules/cpu.c index 1bf172600..8526cb0cf 100644 --- a/src/modules/cpu.c +++ b/src/modules/cpu.c @@ -3,6 +3,7 @@ #include "common/properties.h" #include "common/printing.h" #include "common/caching.h" +#include "detection/temps.h" #include diff --git a/src/modules/gpu.c b/src/modules/gpu.c index ebc77cd95..cf134b89e 100644 --- a/src/modules/gpu.c +++ b/src/modules/gpu.c @@ -2,6 +2,7 @@ #include "common/printing.h" #include "common/caching.h" #include "common/parsing.h" +#include "detection/temps.h" #include