Refactor: move temps detection to own header

This commit is contained in:
Linus Dierheimer
2022-07-26 18:13:12 +02:00
parent fb6da20b0c
commit 676485ef74
5 changed files with 25 additions and 15 deletions
+1
View File
@@ -1,4 +1,5 @@
#include "fastfetch.h"
#include "detection/temps.h"
#include "common/io.h"
#include <string.h>
+22
View File
@@ -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
-15
View File
@@ -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);
+1
View File
@@ -3,6 +3,7 @@
#include "common/properties.h"
#include "common/printing.h"
#include "common/caching.h"
#include "detection/temps.h"
#include <stdlib.h>
+1
View File
@@ -2,6 +2,7 @@
#include "common/printing.h"
#include "common/caching.h"
#include "common/parsing.h"
#include "detection/temps.h"
#include <stdlib.h>