Clean up includes

This commit is contained in:
Linus Dierheimer
2022-06-18 14:25:31 +02:00
parent f35dc9f46a
commit fe71291769
45 changed files with 70 additions and 50 deletions
+2
View File
@@ -1,5 +1,7 @@
#include "fastfetch.h"
#include <stdlib.h>
#define FF_CACHE_VALUE_EXTENSION "ffcv"
#define FF_CACHE_SPLIT_EXTENSION "ffcs"
+1
View File
@@ -1,5 +1,6 @@
#include "fastfetch.h"
#include <stdlib.h>
#include <unistd.h>
#include <sys/stat.h>
#include <signal.h>
+1 -2
View File
@@ -1,9 +1,8 @@
#include "fastfetch.h"
#include <stdio.h>
#include <sys/stat.h>
#include <unistd.h>
#include <fcntl.h>
#include <stdarg.h>
#include <termios.h>
#include <poll.h>
+1
View File
@@ -1,6 +1,7 @@
#include "fastfetch.h"
#include <stdarg.h>
#include <dlfcn.h>
static void* libraryLoad(const char* path, int maxVersion)
{
-1
View File
@@ -1,6 +1,5 @@
#include "fastfetch.h"
#include <sys/types.h>
#include <unistd.h>
#include <sys/socket.h>
#include <netdb.h>
+1 -1
View File
@@ -1,6 +1,6 @@
#include "fastfetch.h"
#include <sys/types.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/wait.h>
+2
View File
@@ -1,5 +1,7 @@
#include "fastfetch.h"
#include <stdlib.h>
static bool parsePropLinePointer(const char** line, const char* start, FFstrbuf* buffer)
{
if(**line == '\0')
+1
View File
@@ -2,6 +2,7 @@
#include <pthread.h>
#include <string.h>
#include <dlfcn.h>
#define FF_LIBRARY_DATA_LOAD_INIT(dataObject, userLibraryName, ...) \
static dataObject data; \
-1
View File
@@ -1,7 +1,6 @@
#include "fastfetch.h"
#include <time.h>
#include <pthread.h>
const FFDateTimeResult* ffDetectDateTime(const FFinstance* instance)
@@ -1,4 +1,5 @@
#include "displayServer.h"
#include <pthread.h>
#include <dirent.h>
+4 -1
View File
@@ -1,9 +1,12 @@
#include "displayServer.h"
#include <stdlib.h>
#include <string.h>
#ifdef FF_HAVE_WAYLAND
#include <wayland-client.h>
#include <pthread.h>
#include <dlfcn.h>
#include <wayland-client.h>
typedef struct WaylandData
{
+4 -2
View File
@@ -1,8 +1,10 @@
#include "displayServer.h"
#include <dirent.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
#include <unistd.h>
#include <ctype.h>
#include <dirent.h>
static const char* parseEnv()
{
+3 -1
View File
@@ -1,8 +1,10 @@
#include "displayServer.h"
#ifdef FF_HAVE_XCB
#include <xcb/xcb.h>
#include <stdlib.h>
#include <string.h>
#include <dlfcn.h>
#include <xcb/xcb.h>
typedef struct XcbPropertyData
{
+1
View File
@@ -1,6 +1,7 @@
#include "displayServer.h"
#ifdef FF_HAVE_X11
#include <dlfcn.h>
#include <X11/Xlib.h>
typedef struct X11PropertyData
+1
View File
@@ -7,6 +7,7 @@
#define FF_DBUS_TIMEOUT_MILLISECONDS 35
#ifdef FF_HAVE_DBUS
#include <dlfcn.h>
#include <dbus/dbus.h>
#define FF_DBUS_ITER_CONTINUE(iterator) \
+1
View File
@@ -1,6 +1,7 @@
#include "fastfetch.h"
#include <string.h>
#include <stdlib.h>
#include <pthread.h>
#if !defined(__ANDROID__)
+1
View File
@@ -1,5 +1,6 @@
#include "fastfetch.h"
#include <stdlib.h>
#include <string.h>
#include <pthread.h>
+1 -2
View File
@@ -1,9 +1,8 @@
#include "fastfetch.h"
#include <string.h>
#include <pthread.h>
#include <dirent.h>
#include <string.h>
#include <math.h>
static bool isTempFile(const char* name)
{
+1
View File
@@ -2,6 +2,7 @@
#include <ctype.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <pthread.h>
+2
View File
@@ -3,6 +3,8 @@
#include <pthread.h>
#ifdef FF_HAVE_VULKAN
#include <stdlib.h>
#include <dlfcn.h>
#include <vulkan/vulkan.h>
static inline void applyVulkanVersion(uint32_t vulkanVersion, FFVersion* ffVersion)
+2 -4
View File
@@ -1,11 +1,9 @@
#include "fastfetch.h"
#include <stdlib.h>
#include <string.h>
#include <malloc.h>
#include <unistd.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <dirent.h>
#include <sys/stat.h>
// Things only needed by fastfetch
typedef struct FFdata
+3 -8
View File
@@ -3,20 +3,15 @@
#ifndef FASTFETCH_INCLUDED
#define FASTFETCH_INCLUDED
#include <stddef.h>
#include "fastfetch_config.h"
#include <stdint.h>
#include <stdbool.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdarg.h>
#include <pwd.h>
#include <sys/types.h>
#include <sys/utsname.h>
#include <sys/sysinfo.h>
#include <sys/stat.h>
#include <dlfcn.h>
#include "fastfetch_config.h"
#include "util/FFstrbuf.h"
#include "util/FFlist.h"
+2
View File
@@ -1,6 +1,8 @@
#ifdef FF_HAVE_IMAGEMAGICK6
#include "image.h"
#include <dlfcn.h>
#include <magick/MagickCore.h>
static FF_LIBRARY_SYMBOL(ResizeImage);
+2
View File
@@ -1,6 +1,8 @@
#ifdef FF_HAVE_IMAGEMAGICK7
#include "image.h"
#include <dlfcn.h>
#include <MagickCore/MagickCore.h>
static FF_LIBRARY_SYMBOL(ResizeImage);
+2
View File
@@ -17,6 +17,8 @@
#include <sys/ioctl.h>
#ifdef FF_HAVE_ZLIB
#include <stdlib.h>
#include <dlfcn.h>
#include <zlib.h>
static bool compressBlob(const FFinstance* instance, void** blob, size_t* length)
-3
View File
@@ -1,10 +1,7 @@
#include "fastfetch.h"
#include <unistd.h>
#include <dirent.h>
#include <inttypes.h>
#define FF_BATTERY_MODULE_NAME "Battery"
#define FF_BATTERY_NUM_FORMAT_ARGS 5
+1 -2
View File
@@ -1,7 +1,6 @@
#include "fastfetch.h"
#include <string.h>
#include <errno.h>
#include <stdlib.h>
#define FF_CPU_MODULE_NAME "CPU"
#define FF_CPU_NUM_FORMAT_ARGS 15
-1
View File
@@ -1,6 +1,5 @@
#include "fastfetch.h"
#include <stdio.h>
#include <unistd.h>
#define FF_CPU_USAGE_MODULE_NAME "CPU Usage"
+2
View File
@@ -1,5 +1,7 @@
#include "fastfetch.h"
#include <stdlib.h>
#define FF_CURSOR_MODULE_NAME "Cursor"
#define FF_CURSOR_NUM_FORMAT_ARGS 2
-2
View File
@@ -1,7 +1,5 @@
#include "fastfetch.h"
#include <string.h>
#define FF_DE_MODULE_NAME "DE"
#define FF_DE_NUM_FORMAT_ARGS 3
+3 -3
View File
@@ -1,7 +1,5 @@
#include "fastfetch.h"
#include <string.h>
#define FF_GPU_MODULE_NAME "GPU"
#define FF_GPU_NUM_FORMAT_ARGS 6
@@ -61,8 +59,10 @@ static void printGPUList(FFinstance* instance, const FFlist* list)
}
#ifdef FF_HAVE_LIBPCI
#include <pci/pci.h>
#include <string.h>
#include <unistd.h>
#include <dlfcn.h>
#include <pci/pci.h>
//see https://github.com/pciutils/pciutils/blob/5bdf63b6b1bc35b59c4b3f47f7ca83ca1868155b/ls-kernel.c#L220
static void pciGetDriver(struct pci_dev* dev, FFstrbuf* driver, char*(*ffpci_get_param)(struct pci_access*, char*))
+5 -1
View File
@@ -1,10 +1,14 @@
#include "fastfetch.h"
#include <ctype.h>
#include <stdlib.h>
#define FF_HOST_MODULE_NAME "Host"
#define FF_HOST_NUM_FORMAT_ARGS 15
#ifdef __ANDROID__
#include <ctype.h>
#endif
#ifndef __ANDROID__
static bool hostValueSet(FFstrbuf* value)
{
+2
View File
@@ -1,5 +1,7 @@
#include "fastfetch.h"
#include <stdlib.h>
#define FF_LOCALE_MODULE_NAME "Locale"
#define FF_LOCALE_NUM_FORMAT_ARGS 1
+1 -2
View File
@@ -3,10 +3,9 @@
#define FF_LOCALIP_MODULE_NAME "Local IP"
#define FF_LOCALIP_NUM_FORMAT_ARGS 1
#include <sys/types.h>
#include <string.h>
#include <ifaddrs.h>
#include <netinet/in.h>
#include <string.h>
#include <arpa/inet.h>
static void printValue(FFinstance* instance, const char* ifaName, const char* addressBuffer)
+2
View File
@@ -1,5 +1,7 @@
#include "fastfetch.h"
#include <stdlib.h>
#define FF_MEMORY_MODULE_NAME "Memory"
#define FF_MEMORY_NUM_FORMAT_ARGS 3
+2
View File
@@ -4,6 +4,8 @@
#define FF_OPENCL_NUM_FORMAT_ARGS 3
#ifdef FF_HAVE_OPENCL
#include <dlfcn.h>
#define CL_TARGET_OPENCL_VERSION 100
#include <CL/cl.h>
+1
View File
@@ -7,6 +7,7 @@
#if defined(FF_HAVE_EGL) || defined(FF_HAVE_GLX) || defined(FF_HAVE_OSMESA)
#define FF_HAVE_GL 1
#include <dlfcn.h>
#include <GL/gl.h>
#define FF_OPENGL_BUFFER_WIDTH 1
+3
View File
@@ -1,7 +1,9 @@
#include "fastfetch.h"
#include <stdlib.h>
#include <string.h>
#include <dirent.h>
#include <sys/stat.h>
#define FF_PACKAGES_MODULE_NAME "Packages"
#define FF_PACKAGES_NUM_FORMAT_ARGS 11
@@ -128,6 +130,7 @@ static uint32_t getNixPackages(char* path)
}
#ifdef FF_HAVE_RPM
#include <dlfcn.h>
#include <rpm/rpmlib.h>
#include <rpm/rpmts.h>
#include <rpm/rpmdb.h>
-3
View File
@@ -1,8 +1,5 @@
#include "fastfetch.h"
#include <string.h>
#include <ctype.h>
#define FF_SHELL_MODULE_NAME "Shell"
#define FF_SHELL_NUM_FORMAT_ARGS 7
-2
View File
@@ -1,8 +1,6 @@
#include "fastfetch.h"
#include <string.h>
#include <unistd.h>
#include <pthread.h>
#define FF_TERMINAL_MODULE_NAME "Terminal"
#define FF_TERMINAL_NUM_FORMAT_ARGS 3
+2
View File
@@ -1,4 +1,6 @@
#include "fastfetch.h"
#include <stdlib.h>
#include <string.h>
#define FF_WMTHEME_MODULE_NAME "WM Theme"
+1 -2
View File
@@ -1,7 +1,6 @@
#include "FFlist.h"
#include <malloc.h>
#include <memory.h>
#include <stdlib.h>
void ffListInit(FFlist* list, uint32_t elementSize)
{
+1 -2
View File
@@ -1,9 +1,8 @@
#include "FFstrbuf.h"
#include <malloc.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
#include <stdlib.h>
static char* CHAR_NULL_PTR = "";
+3 -4
View File
@@ -1,9 +1,8 @@
#include <stdint.h>
#include <malloc.h>
#include <string.h>
#include "FFvaluestore.h"
#include <string.h>
#include <stdlib.h>
void ffValuestoreInit(FFvaluestore* vs)
{
vs->capacity = 32;
+1
View File
@@ -4,6 +4,7 @@
#define FASTFETCH_INCLUDED_FFVALUESTORE
#include <stdbool.h>
#include <stdint.h>
typedef struct FFvaluestorePair
{