From 6e0d76a2fba4117da79c3bf76ed96755c758da4c Mon Sep 17 00:00:00 2001 From: Linus Dierheimer Date: Mon, 25 Jul 2022 14:48:59 +0200 Subject: [PATCH] Refactor: move networking functions to own header --- src/common/caching.c | 2 +- src/common/networking.c | 1 + src/common/networking.h | 10 ++++++++++ src/common/processing.c | 1 + src/fastfetch.h | 3 --- src/modules/publicip.c | 1 + 6 files changed, 14 insertions(+), 4 deletions(-) create mode 100644 src/common/networking.h diff --git a/src/common/caching.c b/src/common/caching.c index 106ec61f8..447af242d 100644 --- a/src/common/caching.c +++ b/src/common/caching.c @@ -1,7 +1,7 @@ #include "fastfetch.h" +#include "common/caching.h" #include "common/io.h" #include "common/printing.h" -#include "common/caching.h" #include diff --git a/src/common/networking.c b/src/common/networking.c index 615c5b163..27c723a9a 100644 --- a/src/common/networking.c +++ b/src/common/networking.c @@ -1,4 +1,5 @@ #include "fastfetch.h" +#include "common/networking.h" #include #include diff --git a/src/common/networking.h b/src/common/networking.h new file mode 100644 index 000000000..7f239cf84 --- /dev/null +++ b/src/common/networking.h @@ -0,0 +1,10 @@ +#pragma once + +#ifndef FF_INCLUDED_common_networking +#define FF_INCLUDED_common_networking + +#include "util/FFstrbuf.h" + +void ffNetworkingGetHttp(const char* host, const char* path, uint32_t timeout, FFstrbuf* buffer); + +#endif diff --git a/src/common/processing.c b/src/common/processing.c index e1f7b0b72..d361a63af 100644 --- a/src/common/processing.c +++ b/src/common/processing.c @@ -1,4 +1,5 @@ #include "fastfetch.h" +#include "common/processing.h" #include "common/io.h" #include diff --git a/src/fastfetch.h b/src/fastfetch.h index fd1ed0d46..49179f31c 100644 --- a/src/fastfetch.h +++ b/src/fastfetch.h @@ -324,9 +324,6 @@ void ffListFeatures(); //common/threading.c void ffStartDetectionThreads(FFinstance* instance); -//common/networking.c -void ffNetworkingGetHttp(const char* host, const char* path, uint32_t timeout, FFstrbuf* buffer); - //////////////////// // Logo functions // //////////////////// diff --git a/src/modules/publicip.c b/src/modules/publicip.c index 6a74b2af8..aacb0537c 100644 --- a/src/modules/publicip.c +++ b/src/modules/publicip.c @@ -1,5 +1,6 @@ #include "fastfetch.h" #include "common/printing.h" +#include "common/networking.h" #define FF_PUBLICIP_MODULE_NAME "Public IP" #define FF_PUBLICIP_NUM_FORMAT_ARGS 1