Skip to content

Commit 99415a3

Browse files
committed
Networking: move files to a sub folder
1 parent 244625d commit 99415a3

File tree

8 files changed

+20
-21
lines changed

8 files changed

+20
-21
lines changed

CMakeLists.txt

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ set(LIBFASTFETCH_SRC
364364
src/common/library.c
365365
src/common/modules.c
366366
src/common/netif/netif.c
367-
src/common/networking_common.c
367+
src/common/networking/networking_common.c
368368
src/common/option.c
369369
src/common/parsing.c
370370
src/common/printing.c
@@ -493,7 +493,7 @@ if(LINUX)
493493
src/common/dbus.c
494494
src/common/io/io_unix.c
495495
src/common/netif/netif_linux.c
496-
src/common/networking_linux.c
496+
src/common/networking/networking_linux.c
497497
src/common/processing_linux.c
498498
src/detection/battery/battery_linux.c
499499
src/detection/bios/bios_linux.c
@@ -574,7 +574,7 @@ elseif(ANDROID)
574574
list(APPEND LIBFASTFETCH_SRC
575575
src/common/io/io_unix.c
576576
src/common/netif/netif_linux.c
577-
src/common/networking_linux.c
577+
src/common/networking/networking_linux.c
578578
src/common/processing_linux.c
579579
src/detection/battery/battery_android.c
580580
src/detection/bios/bios_android.c
@@ -640,7 +640,7 @@ elseif(FreeBSD)
640640
src/common/dbus.c
641641
src/common/io/io_unix.c
642642
src/common/netif/netif_bsd.c
643-
src/common/networking_linux.c
643+
src/common/networking/networking_linux.c
644644
src/common/processing_linux.c
645645
src/common/sysctl.c
646646
src/detection/battery/battery_bsd.c
@@ -731,7 +731,7 @@ elseif(NetBSD)
731731
src/common/dbus.c
732732
src/common/io/io_unix.c
733733
src/common/netif/netif_bsd.c
734-
src/common/networking_linux.c
734+
src/common/networking/networking_linux.c
735735
src/common/processing_linux.c
736736
src/common/sysctl.c
737737
src/detection/battery/battery_nbsd.c
@@ -813,7 +813,7 @@ elseif(OpenBSD)
813813
src/common/dbus.c
814814
src/common/io/io_unix.c
815815
src/common/netif/netif_bsd.c
816-
src/common/networking_linux.c
816+
src/common/networking/networking_linux.c
817817
src/common/processing_linux.c
818818
src/common/sysctl.c
819819
src/detection/battery/battery_obsd.c
@@ -894,7 +894,7 @@ elseif(APPLE)
894894
list(APPEND LIBFASTFETCH_SRC
895895
src/common/io/io_unix.c
896896
src/common/netif/netif_bsd.c
897-
src/common/networking_linux.c
897+
src/common/networking/networking_linux.c
898898
src/common/processing_linux.c
899899
src/common/sysctl.c
900900
src/detection/battery/battery_apple.c
@@ -965,7 +965,7 @@ elseif(WIN32)
965965
list(APPEND LIBFASTFETCH_SRC
966966
src/common/io/io_windows.c
967967
src/common/netif/netif_windows.c
968-
src/common/networking_windows.c
968+
src/common/networking/networking_windows.c
969969
src/common/processing_windows.c
970970
src/detection/battery/battery_windows.c
971971
src/detection/bios/bios_windows.c
@@ -1040,7 +1040,7 @@ elseif(SunOS)
10401040
src/common/dbus.c
10411041
src/common/io/io_unix.c
10421042
src/common/netif/netif_bsd.c
1043-
src/common/networking_linux.c
1043+
src/common/networking/networking_linux.c
10441044
src/common/processing_linux.c
10451045
src/detection/battery/battery_nosupport.c
10461046
src/detection/bios/bios_windows.c
@@ -1121,7 +1121,7 @@ elseif(Haiku)
11211121
src/common/dbus.c
11221122
src/common/io/io_unix.c
11231123
src/common/netif/netif_haiku.c
1124-
src/common/networking_linux.c
1124+
src/common/networking/networking_linux.c
11251125
src/common/processing_linux.c
11261126
src/detection/battery/battery_haiku.c
11271127
src/detection/bios/bios_windows.c
File renamed without changes.

src/common/networking_common.c renamed to src/common/networking/networking_common.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#include "fastfetch.h"
22
#include "common/library.h"
3-
#include "common/networking.h"
3+
#include "common/networking/networking.h"
44
#include "util/stringUtils.h"
55
#include "util/debug.h"
66

src/common/networking_linux.c renamed to src/common/networking/networking_linux.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#include "fastfetch.h"
2-
#include "common/networking.h"
2+
#include "common/networking/networking.h"
33
#include "common/time.h"
44
#include "common/library.h"
55
#include "util/stringUtils.h"
@@ -331,9 +331,8 @@ const char* ffNetworkingRecvHttpResponse(FFNetworkingState* state, FFstrbuf* buf
331331
char* headerEnd = NULL;
332332

333333
do {
334-
size_t availSpace = ffStrbufGetFree(buffer);
335-
FF_DEBUG("Data reception loop #%d, current buffer size: %u, available space: %zu",
336-
++recvCount, buffer->length, availSpace);
334+
FF_DEBUG("Data reception loop #%d, current buffer size: %u, available space: %u",
335+
++recvCount, buffer->length, ffStrbufGetFree(buffer));
337336

338337
ssize_t received = recv(state->sockfd, buffer->chars + buffer->length, ffStrbufGetFree(buffer), 0);
339338

src/common/networking_windows.c renamed to src/common/networking/networking_windows.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
//Must be included after <mswsock.h>
55
#include "fastfetch.h"
6-
#include "common/networking.h"
6+
#include "common/networking/networking.h"
77
#include "util/stringUtils.h"
88
#include "util/debug.h"
99

@@ -225,9 +225,8 @@ const char* ffNetworkingRecvHttpResponse(FFNetworkingState* state, FFstrbuf* buf
225225
char* headerEnd = NULL;
226226

227227
do {
228-
size_t availSpace = ffStrbufGetFree(buffer);
229-
FF_DEBUG("Data reception loop #%d, current buffer size: %u, available space: %zu",
230-
++recvCount, buffer->length, availSpace);
228+
FF_DEBUG("Data reception loop #%d, current buffer size: %u, available space: %u",
229+
++recvCount, buffer->length, ffStrbufGetFree(buffer));
231230

232231
ssize_t received = recv(state->sockfd, buffer->chars + buffer->length, (int)ffStrbufGetFree(buffer), 0);
233232

src/detection/publicip/publicip.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#include "publicip.h"
2-
#include "common/networking.h"
2+
#include "common/networking/networking.h"
33

44
#define FF_UNITIALIZED ((const char*)(uintptr_t) -1)
55
static FFNetworkingState states[2];

src/detection/weather/weather.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#include "weather.h"
2+
#include "common/networking/networking.h"
23

34
#define FF_UNITIALIZED ((const char*)(uintptr_t) -1)
45
static FFNetworkingState state;

src/detection/weather/weather.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#pragma once
22

3-
#include "common/networking.h"
3+
#include "fastfetch.h"
44

55
void ffPrepareWeather(FFWeatherOptions* options);
66
const char* ffDetectWeather(FFWeatherOptions* options, FFstrbuf* result);

0 commit comments

Comments
 (0)