From a1ea7804f3bebd923ef6142776bc83d4f8e53488 Mon Sep 17 00:00:00 2001 From: Linus Dierheimer Date: Sat, 28 Jan 2023 12:40:12 +0100 Subject: [PATCH] IO: Separate platform specific implementations --- CMakeLists.txt | 6 +- src/common/io.h | 39 ---- src/common/io/io.h | 64 ++++++ src/common/{io.c => io/io_unix.c} | 196 +++--------------- src/common/io/io_windows.c | 117 +++++++++++ src/common/processing_linux.c | 2 +- src/common/settings.c | 2 +- src/detection/battery/battery_linux.c | 2 +- src/detection/bios/bios_linux.c | 2 +- src/detection/board/board_linux.c | 2 +- src/detection/brightness/brightness_linux.c | 2 +- src/detection/chassis/chassis_linux.c | 2 +- src/detection/cpu/cpu_linux.c | 2 +- src/detection/displayserver/linux/wayland.c | 2 +- src/detection/displayserver/linux/wmde.c | 2 +- src/detection/font/font_apple.m | 2 +- src/detection/host/host_linux.c | 2 +- src/detection/packages/packages_linux.c | 2 +- src/detection/temps/temps_linux.c | 2 +- src/detection/terminalfont/terminalfont.c | 2 +- .../terminalfont/terminalfont_android.c | 2 +- .../terminalfont/terminalfont_windows.c | 2 +- src/detection/terminalshell/terminalshell.c | 2 +- .../terminalshell/terminalshell_linux.c | 2 +- src/detection/vulkan.c | 2 +- src/detection/wifi/wifi_linux.c | 2 +- src/fastfetch.c | 2 +- src/logo/image/image.c | 2 +- src/logo/logo.c | 2 +- 29 files changed, 243 insertions(+), 227 deletions(-) delete mode 100644 src/common/io.h create mode 100644 src/common/io/io.h rename src/common/{io.c => io/io_unix.c} (54%) create mode 100644 src/common/io/io_windows.c diff --git a/CMakeLists.txt b/CMakeLists.txt index 927448737..a2e5c3957 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -227,7 +227,6 @@ set(LIBFASTFETCH_SRC src/common/font.c src/common/format.c src/common/init.c - src/common/io.c src/common/library.c src/common/parsing.c src/common/printing.c @@ -313,6 +312,7 @@ set(LIBFASTFETCH_SRC if(LINUX) list(APPEND LIBFASTFETCH_SRC src/common/dbus.c + src/common/io/io_unix.c src/common/networking_linux.c src/common/processing_linux.c src/detection/battery/battery_linux.c @@ -356,6 +356,7 @@ if(LINUX) ) elseif(ANDROID) list(APPEND LIBFASTFETCH_SRC + src/common/io/io_unix.c src/common/networking_linux.c src/common/processing_linux.c src/detection/battery/battery_android.c @@ -394,6 +395,7 @@ elseif(ANDROID) elseif(BSD) list(APPEND LIBFASTFETCH_SRC src/common/dbus.c + src/common/io/io_unix.c src/common/networking_linux.c src/common/processing_linux.c src/common/sysctl.c @@ -438,6 +440,7 @@ elseif(BSD) ) elseif(APPLE) list(APPEND LIBFASTFETCH_SRC + src/common/io/io_unix.c src/common/networking_linux.c src/common/processing_linux.c src/common/sysctl.c @@ -479,6 +482,7 @@ elseif(APPLE) ) elseif(WIN32) list(APPEND LIBFASTFETCH_SRC + src/common/io/io_windows.c src/common/networking_windows.c src/common/processing_windows.c src/detection/battery/battery_windows.c diff --git a/src/common/io.h b/src/common/io.h deleted file mode 100644 index c30765d9c..000000000 --- a/src/common/io.h +++ /dev/null @@ -1,39 +0,0 @@ -#pragma once - -#ifndef FF_INCLUDED_common_io -#define FF_INCLUDED_common_io - -#include "fastfetch.h" - -bool ffWriteFDBuffer(int fd, const FFstrbuf* content); -bool ffWriteFileData(const char* fileName, size_t dataSize, const void* data); -bool ffWriteFileBuffer(const char* fileName, const FFstrbuf* buffer); - -bool ffAppendFDBuffer(int fd, FFstrbuf* buffer); -ssize_t ffReadFileData(const char* fileName, size_t dataSize, void* data); -bool ffAppendFileBuffer(const char* fileName, FFstrbuf* buffer); -bool ffReadFileBuffer(const char* fileName, FFstrbuf* buffer); - -#ifdef _WIN32 -bool ffAppendHandleBuffer(HANDLE handle, FFstrbuf* buffer); -#endif - -//Bit flags, combine with | -typedef enum FFPathType -{ - FF_PATHTYPE_REGULAR = 1, - FF_PATHTYPE_LINK = 2, - FF_PATHTYPE_DIRECTORY = 4 -} FFPathType; - -#define FF_PATHTYPE_FILE (FF_PATHTYPE_REGULAR | FF_PATHTYPE_LINK) -#define FF_PATHTYPE_ANY (FF_PATHTYPE_FILE | FF_PATHTYPE_DIRECTORY) - -bool ffPathExists(const char* path, FFPathType pathType); - -// Not thread safe! -void ffSuppressIO(bool suppress); - -FF_C_SCANF(2, 3) void ffGetTerminalResponse(const char* request, const char* format, ...); - -#endif diff --git a/src/common/io/io.h b/src/common/io/io.h new file mode 100644 index 000000000..25762a51b --- /dev/null +++ b/src/common/io/io.h @@ -0,0 +1,64 @@ +#pragma once + +#ifndef FF_INCLUDED_common_io_io +#define FF_INCLUDED_common_io_io + +#include "fastfetch.h" + +#ifdef _WIN32 + #include + typedef HANDLE FFNativeFD; +#else + #include + typedef int FFNativeFD; +#endif + +static inline bool ffWriteFDBuffer(FFNativeFD fd, const FFstrbuf* content) +{ + #ifndef _WIN32 + return write(fd, content->chars, content->length) != -1; + #else + DWORD written; + return WriteFile(fd, content->chars, content->length, &written, NULL) && written == content->length; + #endif +} + +bool ffWriteFileData(const char* fileName, size_t dataSize, const void* data); + +static inline bool ffWriteFileBuffer(const char* fileName, const FFstrbuf* buffer) +{ + return ffWriteFileData(fileName, buffer->length, buffer->chars); +} + +bool ffAppendFDBuffer(FFNativeFD fd, FFstrbuf* buffer); +ssize_t ffReadFileData(const char* fileName, size_t dataSize, void* data); +bool ffAppendFileBuffer(const char* fileName, FFstrbuf* buffer); + +static inline bool ffReadFileBuffer(const char* fileName, FFstrbuf* buffer) +{ + ffStrbufClear(buffer); + return ffAppendFileBuffer(fileName, buffer); +} + +//Bit flags, combine with | +typedef enum FFPathType +{ + FF_PATHTYPE_REGULAR = 1, + FF_PATHTYPE_LINK = 2, + FF_PATHTYPE_DIRECTORY = 4 +} FFPathType; + +#define FF_PATHTYPE_FILE (FF_PATHTYPE_REGULAR | FF_PATHTYPE_LINK) +#define FF_PATHTYPE_ANY (FF_PATHTYPE_FILE | FF_PATHTYPE_DIRECTORY) + +bool ffPathExists(const char* path, FFPathType pathType); + +#ifndef _WIN32 + FF_C_SCANF(2, 3) + void ffGetTerminalResponse(const char* request, const char* format, ...); +#endif + +// Not thread safe! +void ffSuppressIO(bool suppress); + +#endif // FF_INCLUDED_common_io_io diff --git a/src/common/io.c b/src/common/io/io_unix.c similarity index 54% rename from src/common/io.c rename to src/common/io/io_unix.c index 02edf5143..c4846525f 100644 --- a/src/common/io.c +++ b/src/common/io/io_unix.c @@ -1,16 +1,9 @@ -#include "fastfetch.h" -#include "common/io.h" +#include "io.h" -#include #include - -#ifdef _WIN32 - #include -#else - #include - #include - #include -#endif +#include +#include +#include static void createSubfolders(const char* fileName) { @@ -21,41 +14,15 @@ static void createSubfolders(const char* fileName) { ffStrbufAppendC(&path, *fileName); if(*fileName == '/') - { - mkdir(path.chars - #ifndef WIN32 - , S_IRWXU | S_IRGRP | S_IROTH - #endif - ); - } + mkdir(path.chars, S_IRWXU | S_IRGRP | S_IROTH); ++fileName; } ffStrbufDestroy(&path); } -bool ffWriteFDBuffer(int fd, const FFstrbuf* content) -{ - return write(fd, content->chars, content->length) != -1; -} - bool ffWriteFileData(const char* fileName, size_t dataSize, const void* data) { - #ifdef _WIN32 - HANDLE handle = CreateFileA(fileName, GENERIC_WRITE, FILE_SHARE_WRITE, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); - if(handle == INVALID_HANDLE_VALUE) - { - createSubfolders(fileName); - handle = CreateFileA(fileName, GENERIC_WRITE, FILE_SHARE_WRITE, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); - if(handle == INVALID_HANDLE_VALUE) - return false; - } - - DWORD written; - bool ret = !!WriteFile(handle, data, (DWORD)dataSize, &written, NULL); - - CloseHandle(handle); - #else int openFlagsModes = O_WRONLY | O_CREAT | O_TRUNC; int openFlagsRights = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH; @@ -71,52 +38,10 @@ bool ffWriteFileData(const char* fileName, size_t dataSize, const void* data) bool ret = write(fd, data, dataSize) != -1; close(fd); - #endif return ret; } -bool ffWriteFileBuffer(const char* fileName, const FFstrbuf* buffer) -{ - return ffWriteFileData(fileName, buffer->length, buffer->chars); -} - -#ifdef _WIN32 - -bool ffAppendHandleBuffer(HANDLE handle, FFstrbuf* buffer) -{ - DWORD readed = 0; - - LARGE_INTEGER fileSize; - if(!GetFileSizeEx(handle, &fileSize)) - fileSize.QuadPart = 0; - - ffStrbufEnsureFree(buffer, fileSize.QuadPart > 0 ? (uint32_t)fileSize.QuadPart : 31); - uint32_t free = ffStrbufGetFree(buffer); - - bool success; - while( - (success = !!ReadFile(handle, buffer->chars + buffer->length, free, &readed, NULL)) && - (uint32_t) readed == free - ) { - buffer->length += (uint32_t) readed; - ffStrbufEnsureFree(buffer, buffer->allocated - 1); // Doubles capacity every round. -1 for the null byte. - free = ffStrbufGetFree(buffer); - } - - if(readed > 0) - buffer->length += (uint32_t) readed; - - buffer->chars[buffer->length] = '\0'; - - ffStrbufTrimRight(buffer, '\n'); - ffStrbufTrimRight(buffer, ' '); - - return success; -} - -#endif - bool ffAppendFDBuffer(int fd, FFstrbuf* buffer) { ssize_t readed = 0; @@ -151,17 +76,6 @@ bool ffAppendFDBuffer(int fd, FFstrbuf* buffer) ssize_t ffReadFileData(const char* fileName, size_t dataSize, void* data) { - #ifdef _WIN32 - HANDLE handle = CreateFileA(fileName, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); - if(handle == INVALID_HANDLE_VALUE) - return false; - - DWORD readed; - if(!ReadFile(handle, data, (DWORD)dataSize, &readed, NULL)) - return -1; - - return (ssize_t)readed; - #else int fd = open(fileName, O_RDONLY); if(fd == -1) return -1; @@ -171,20 +85,10 @@ ssize_t ffReadFileData(const char* fileName, size_t dataSize, void* data) close(fd); return readed; - #endif } bool ffAppendFileBuffer(const char* fileName, FFstrbuf* buffer) { - #ifdef _WIN32 - HANDLE handle = CreateFileA(fileName, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); - if(handle == INVALID_HANDLE_VALUE) - return false; - - bool ret = ffAppendHandleBuffer(handle, buffer); - - CloseHandle(handle); - #else int fd = open(fileName, O_RDONLY); if(fd == -1) return false; @@ -192,47 +96,10 @@ bool ffAppendFileBuffer(const char* fileName, FFstrbuf* buffer) bool ret = ffAppendFDBuffer(fd, buffer); close(fd); - #endif return ret; } -bool ffReadFileBuffer(const char* fileName, FFstrbuf* buffer) -{ - ffStrbufClear(buffer); - return ffAppendFileBuffer(fileName, buffer); -} - -// Not thread safe! -void ffSuppressIO(bool suppress) -{ - static bool init = false; - static int origOut = -1; - static int origErr = -1; - static int nullFile = -1; - - if(!init) - { - if(!suppress) - return; - - origOut = dup(STDOUT_FILENO); - origErr = dup(STDERR_FILENO); - nullFile = open("/dev/null", O_WRONLY); - init = true; - } - - if(nullFile == -1) - return; - - fflush(stdout); - fflush(stderr); - - dup2(suppress ? nullFile : origOut, STDOUT_FILENO); - dup2(suppress ? nullFile : origErr, STDERR_FILENO); -} - -#ifndef _WIN32 bool ffPathExists(const char* path, FFPathType type) { struct stat fileStat; @@ -253,29 +120,8 @@ bool ffPathExists(const char* path, FFPathType type) return false; } -#else -bool ffPathExists(const char* path, FFPathType type) -{ - DWORD attr = GetFileAttributesA(path); - if(attr == INVALID_FILE_ATTRIBUTES) - return false; - - if(type & FF_PATHTYPE_REGULAR && !(attr & FILE_ATTRIBUTE_DIRECTORY)) - return true; - - if(type & FF_PATHTYPE_DIRECTORY && (attr & FILE_ATTRIBUTE_DIRECTORY)) - return true; - - if(type & FF_PATHTYPE_LINK && (attr & FILE_ATTRIBUTE_REPARSE_POINT)) - return true; - - return false; -} -#endif - void ffGetTerminalResponse(const char* request, const char* format, ...) { - #ifndef WIN32 struct termios oldTerm, newTerm; if(tcgetattr(STDIN_FILENO, &oldTerm) == -1) return; @@ -314,8 +160,32 @@ void ffGetTerminalResponse(const char* request, const char* format, ...) va_start(args, format); vsscanf(buffer, format, args); va_end(args); - #else - //Unimplemented - FF_UNUSED(request, format); - #endif +} + +void ffSuppressIO(bool suppress) +{ + static bool init = false; + static int origOut = -1; + static int origErr = -1; + static int nullFile = -1; + + if(!init) + { + if(!suppress) + return; + + origOut = dup(STDOUT_FILENO); + origErr = dup(STDERR_FILENO); + nullFile = open("/dev/null", O_WRONLY); + init = true; + } + + if(nullFile == -1) + return; + + fflush(stdout); + fflush(stderr); + + dup2(suppress ? nullFile : origOut, STDOUT_FILENO); + dup2(suppress ? nullFile : origErr, STDERR_FILENO); } diff --git a/src/common/io/io_windows.c b/src/common/io/io_windows.c new file mode 100644 index 000000000..7ac79c392 --- /dev/null +++ b/src/common/io/io_windows.c @@ -0,0 +1,117 @@ +#include "io.h" + +static void createSubfolders(const char* fileName) +{ + FFstrbuf path; + ffStrbufInit(&path); + + while(*fileName != '\0') + { + ffStrbufAppendC(&path, *fileName); + if(*fileName == '/') + CreateDirectoryA(path.chars, NULL); + ++fileName; + } + + ffStrbufDestroy(&path); +} + +bool ffWriteFileData(const char* fileName, size_t dataSize, const void* data) +{ + HANDLE handle = CreateFileA(fileName, GENERIC_WRITE, FILE_SHARE_WRITE, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); + if(handle == INVALID_HANDLE_VALUE) + { + createSubfolders(fileName); + handle = CreateFileA(fileName, GENERIC_WRITE, FILE_SHARE_WRITE, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); + if(handle == INVALID_HANDLE_VALUE) + return false; + } + + DWORD written; + bool ret = !!WriteFile(handle, data, (DWORD)dataSize, &written, NULL); + + CloseHandle(handle); + + return ret; +} + +bool ffAppendFDBuffer(HANDLE handle, FFstrbuf* buffer) +{ + DWORD readed = 0; + + LARGE_INTEGER fileSize; + if(!GetFileSizeEx(handle, &fileSize)) + fileSize.QuadPart = 0; + + ffStrbufEnsureFree(buffer, fileSize.QuadPart > 0 ? (uint32_t)fileSize.QuadPart : 31); + uint32_t free = ffStrbufGetFree(buffer); + + bool success; + while( + (success = !!ReadFile(handle, buffer->chars + buffer->length, free, &readed, NULL)) && + (uint32_t) readed == free + ) { + buffer->length += (uint32_t) readed; + ffStrbufEnsureFree(buffer, buffer->allocated - 1); // Doubles capacity every round. -1 for the null byte. + free = ffStrbufGetFree(buffer); + } + + if(readed > 0) + buffer->length += (uint32_t) readed; + + buffer->chars[buffer->length] = '\0'; + + ffStrbufTrimRight(buffer, '\n'); + ffStrbufTrimRight(buffer, ' '); + + return success; +} + +ssize_t ffReadFileData(const char* fileName, size_t dataSize, void* data) +{ + HANDLE handle = CreateFileA(fileName, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + if(handle == INVALID_HANDLE_VALUE) + return false; + + DWORD readed; + if(!ReadFile(handle, data, (DWORD)dataSize, &readed, NULL)) + return -1; + + return (ssize_t)readed; +} + +bool ffAppendFileBuffer(const char* fileName, FFstrbuf* buffer) +{ + HANDLE handle = CreateFileA(fileName, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + if(handle == INVALID_HANDLE_VALUE) + return false; + + bool ret = ffAppendFDBuffer(handle, buffer); + + CloseHandle(handle); + + return ret; +} + +bool ffPathExists(const char* path, FFPathType type) +{ + DWORD attr = GetFileAttributesA(path); + if(attr == INVALID_FILE_ATTRIBUTES) + return false; + + if(type & FF_PATHTYPE_REGULAR && !(attr & FILE_ATTRIBUTE_DIRECTORY)) + return true; + + if(type & FF_PATHTYPE_DIRECTORY && (attr & FILE_ATTRIBUTE_DIRECTORY)) + return true; + + if(type & FF_PATHTYPE_LINK && (attr & FILE_ATTRIBUTE_REPARSE_POINT)) + return true; + + return false; +} + +void ffSuppressIO(bool suppress) +{ + FF_UNUSED(suppress); +} diff --git a/src/common/processing_linux.c b/src/common/processing_linux.c index a628aeb3d..74502ef52 100644 --- a/src/common/processing_linux.c +++ b/src/common/processing_linux.c @@ -1,6 +1,6 @@ #include "fastfetch.h" #include "common/processing.h" -#include "common/io.h" +#include "common/io/io.h" #include #include diff --git a/src/common/settings.c b/src/common/settings.c index 6c2725692..280557358 100644 --- a/src/common/settings.c +++ b/src/common/settings.c @@ -2,7 +2,7 @@ #include "common/settings.h" #include "common/library.h" #include "common/thread.h" -#include "common/io.h" +#include "common/io/io.h" #include diff --git a/src/detection/battery/battery_linux.c b/src/detection/battery/battery_linux.c index 756dd9c8a..b78a6cf7f 100644 --- a/src/detection/battery/battery_linux.c +++ b/src/detection/battery/battery_linux.c @@ -1,5 +1,5 @@ #include "fastfetch.h" -#include "common/io.h" +#include "common/io/io.h" #include "battery.h" #include diff --git a/src/detection/bios/bios_linux.c b/src/detection/bios/bios_linux.c index 10bbab589..ce23edf89 100644 --- a/src/detection/bios/bios_linux.c +++ b/src/detection/bios/bios_linux.c @@ -1,5 +1,5 @@ #include "bios.h" -#include "common/io.h" +#include "common/io/io.h" #include diff --git a/src/detection/board/board_linux.c b/src/detection/board/board_linux.c index 8e92eec4e..8f5bcd2ff 100644 --- a/src/detection/board/board_linux.c +++ b/src/detection/board/board_linux.c @@ -1,5 +1,5 @@ #include "board.h" -#include "common/io.h" +#include "common/io/io.h" #include diff --git a/src/detection/brightness/brightness_linux.c b/src/detection/brightness/brightness_linux.c index 0f2a9d5fd..97f3ea4f9 100644 --- a/src/detection/brightness/brightness_linux.c +++ b/src/detection/brightness/brightness_linux.c @@ -1,5 +1,5 @@ #include "brightness.h" -#include "common/io.h" +#include "common/io/io.h" #include diff --git a/src/detection/chassis/chassis_linux.c b/src/detection/chassis/chassis_linux.c index 192747e7d..0898fa4b8 100644 --- a/src/detection/chassis/chassis_linux.c +++ b/src/detection/chassis/chassis_linux.c @@ -1,5 +1,5 @@ #include "chassis.h" -#include "common/io.h" +#include "common/io/io.h" #include diff --git a/src/detection/cpu/cpu_linux.c b/src/detection/cpu/cpu_linux.c index b06569b9d..202317033 100644 --- a/src/detection/cpu/cpu_linux.c +++ b/src/detection/cpu/cpu_linux.c @@ -1,5 +1,5 @@ #include "cpu.h" -#include "common/io.h" +#include "common/io/io.h" #include "common/properties.h" #include "detection/temps/temps_linux.h" diff --git a/src/detection/displayserver/linux/wayland.c b/src/detection/displayserver/linux/wayland.c index 27a5c09d3..71dd0b07b 100644 --- a/src/detection/displayserver/linux/wayland.c +++ b/src/detection/displayserver/linux/wayland.c @@ -5,7 +5,7 @@ #ifdef FF_HAVE_WAYLAND #include "common/library.h" -#include "common/io.h" +#include "common/io/io.h" #include "common/thread.h" #include #include diff --git a/src/detection/displayserver/linux/wmde.c b/src/detection/displayserver/linux/wmde.c index b45c06cf9..779e296d9 100644 --- a/src/detection/displayserver/linux/wmde.c +++ b/src/detection/displayserver/linux/wmde.c @@ -1,5 +1,5 @@ #include "displayserver_linux.h" -#include "common/io.h" +#include "common/io/io.h" #include "common/properties.h" #include "common/parsing.h" #include "common/processing.h" diff --git a/src/detection/font/font_apple.m b/src/detection/font/font_apple.m index 773c7705b..6f26803b0 100644 --- a/src/detection/font/font_apple.m +++ b/src/detection/font/font_apple.m @@ -1,5 +1,5 @@ #include "common/font.h" -#include "common/io.h" +#include "common/io/io.h" #include "font.h" #import diff --git a/src/detection/host/host_linux.c b/src/detection/host/host_linux.c index e4e7dfef1..04ae3aa27 100644 --- a/src/detection/host/host_linux.c +++ b/src/detection/host/host_linux.c @@ -1,5 +1,5 @@ #include "host.h" -#include "common/io.h" +#include "common/io/io.h" #include "common/processing.h" #include diff --git a/src/detection/packages/packages_linux.c b/src/detection/packages/packages_linux.c index 9b8243f3f..c3cd1381d 100644 --- a/src/detection/packages/packages_linux.c +++ b/src/detection/packages/packages_linux.c @@ -1,5 +1,5 @@ #include "packages.h" -#include "common/io.h" +#include "common/io/io.h" #include "common/parsing.h" #include "common/processing.h" #include "common/properties.h" diff --git a/src/detection/temps/temps_linux.c b/src/detection/temps/temps_linux.c index 913e6f037..0ade8180f 100644 --- a/src/detection/temps/temps_linux.c +++ b/src/detection/temps/temps_linux.c @@ -1,5 +1,5 @@ #include "fastfetch.h" -#include "common/io.h" +#include "common/io/io.h" #include "common/thread.h" #include "temps_linux.h" diff --git a/src/detection/terminalfont/terminalfont.c b/src/detection/terminalfont/terminalfont.c index 002169f82..1d3503da2 100644 --- a/src/detection/terminalfont/terminalfont.c +++ b/src/detection/terminalfont/terminalfont.c @@ -182,7 +182,7 @@ exit: } #ifdef _WIN32 - #include "common/io.h" + #include "common/io/io.h" #include #endif diff --git a/src/detection/terminalfont/terminalfont_android.c b/src/detection/terminalfont/terminalfont_android.c index 55e74ea6b..f3f6a38d6 100644 --- a/src/detection/terminalfont/terminalfont_android.c +++ b/src/detection/terminalfont/terminalfont_android.c @@ -1,7 +1,7 @@ #include "fastfetch.h" #include "terminalfont.h" #include "detection/terminalshell/terminalshell.h" -#include "common/io.h" +#include "common/io/io.h" #ifdef FF_HAVE_FREETYPE #include "common/library.h" diff --git a/src/detection/terminalfont/terminalfont_windows.c b/src/detection/terminalfont/terminalfont_windows.c index 060108290..e84d73d9e 100644 --- a/src/detection/terminalfont/terminalfont_windows.c +++ b/src/detection/terminalfont/terminalfont_windows.c @@ -1,5 +1,5 @@ #include "common/properties.h" -#include "common/io.h" +#include "common/io/io.h" #include "detection/terminalshell/terminalshell.h" #include "terminalfont.h" #include "util/windows/unicode.h" diff --git a/src/detection/terminalshell/terminalshell.c b/src/detection/terminalshell/terminalshell.c index aa9d221f3..435885329 100644 --- a/src/detection/terminalshell/terminalshell.c +++ b/src/detection/terminalshell/terminalshell.c @@ -1,5 +1,5 @@ #include "fastfetch.h" -#include "common/io.h" +#include "common/io/io.h" #include "common/processing.h" #include "common/properties.h" diff --git a/src/detection/terminalshell/terminalshell_linux.c b/src/detection/terminalshell/terminalshell_linux.c index 1f30866c2..e6b765ba9 100644 --- a/src/detection/terminalshell/terminalshell_linux.c +++ b/src/detection/terminalshell/terminalshell_linux.c @@ -1,5 +1,5 @@ #include "fastfetch.h" -#include "common/io.h" +#include "common/io/io.h" #include "common/parsing.h" #include "common/processing.h" #include "common/thread.h" diff --git a/src/detection/vulkan.c b/src/detection/vulkan.c index dbda127bb..c61e6f8f8 100644 --- a/src/detection/vulkan.c +++ b/src/detection/vulkan.c @@ -5,7 +5,7 @@ #ifdef FF_HAVE_VULKAN #include "common/library.h" -#include "common/io.h" +#include "common/io/io.h" #include "common/parsing.h" #include #include diff --git a/src/detection/wifi/wifi_linux.c b/src/detection/wifi/wifi_linux.c index 2db259ecb..5bc789cdb 100644 --- a/src/detection/wifi/wifi_linux.c +++ b/src/detection/wifi/wifi_linux.c @@ -200,7 +200,7 @@ static const char* detectWifiWithLibnm(const FFinstance* instance, FFlist* resul #endif -#include "common/io.h" +#include "common/io/io.h" #include #include diff --git a/src/fastfetch.c b/src/fastfetch.c index cd48b0540..f62205616 100644 --- a/src/fastfetch.c +++ b/src/fastfetch.c @@ -2,7 +2,7 @@ #include "util/FFvaluestore.h" #include "common/printing.h" #include "common/parsing.h" -#include "common/io.h" +#include "common/io/io.h" #include "common/time.h" #include diff --git a/src/logo/image/image.c b/src/logo/image/image.c index 5f81782cc..25df0e9ff 100644 --- a/src/logo/image/image.c +++ b/src/logo/image/image.c @@ -1,5 +1,5 @@ #include "image.h" -#include "common/io.h" +#include "common/io/io.h" #include "common/printing.h" #ifdef __APPLE__ diff --git a/src/logo/logo.c b/src/logo/logo.c index f64f7187f..43d39bc97 100644 --- a/src/logo/logo.c +++ b/src/logo/logo.c @@ -1,5 +1,5 @@ #include "logo.h" -#include "common/io.h" +#include "common/io/io.h" #include "common/printing.h" #include "detection/os/os.h" #include "detection/terminalshell/terminalshell.h"