From 3c522d9f2f2b7a58952f219598d5e2df4e0e5334 Mon Sep 17 00:00:00 2001 From: Orestis Floros Date: Sun, 19 Apr 2020 09:43:48 +0200 Subject: [PATCH] Sort includes in *.c files Not enabling in .clang-format because it breaks headers files. Used: IncludeCategories: - Regex: '^ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include #include - -#include #include +#include #define SN_API_NOT_YET_FROZEN 1 #include +#include #include #include -#include /* We need SYSCONFDIR for the path to the keycode config template, so raise an * error if it’s not defined for whatever reason */ diff --git a/i3-dump-log/main.c b/i3-dump-log/main.c index ba60d396..e55f1d3c 100644 --- a/i3-dump-log/main.c +++ b/i3-dump-log/main.c @@ -9,27 +9,27 @@ */ #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - #include "libi3.h" #include "shmlog.h" + +#include +#include +#include +#include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #if !defined(__OpenBSD__) static uint32_t offset_next_write; diff --git a/i3-input/keysym2ucs.c b/i3-input/keysym2ucs.c index 52bdc044..80375099 100644 --- a/i3-input/keysym2ucs.c +++ b/i3-input/keysym2ucs.c @@ -31,9 +31,10 @@ * This software is in the public domain. Share and enjoy! */ -#include #include "keysym2ucs.h" +#include + struct codepair { unsigned short keysym; unsigned short ucs; diff --git a/i3-input/main.c b/i3-input/main.c index e495fe10..1a4cbc7d 100644 --- a/i3-input/main.c +++ b/i3-input/main.c @@ -8,17 +8,17 @@ * to i3. * */ -#include -#include -#include -#include -#include -#include -#include #include -#include +#include #include #include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -26,14 +26,12 @@ #include xcb_visualtype_t *visual_type = NULL; +#include "i3-input.h" +#include "keysym2ucs.h" #include "libi3.h" #include -#include "keysym2ucs.h" - -#include "i3-input.h" - #define MAX_WIDTH logical_px(500) #define BORDER logical_px(2) #define PADDING logical_px(2) diff --git a/i3-msg/main.c b/i3-msg/main.c index 3a897416..dd72bd56 100644 --- a/i3-msg/main.c +++ b/i3-msg/main.c @@ -16,27 +16,25 @@ */ #include "libi3.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include #include -#include +#include #include +#include #include - -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include - -#include +#include +#include /* * Having verboselog() and errorlog() is necessary when using libi3. diff --git a/i3-nagbar/main.c b/i3-nagbar/main.c index e59f5a6a..5558865b 100644 --- a/i3-nagbar/main.c +++ b/i3-nagbar/main.c @@ -8,36 +8,36 @@ * when the user has an error in their configuration file. * */ -#include -#include -#include -#include -#include -#include -#include -#include -#include #include -#include +#include +#include #include #include -#include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include -#include -#include #include +#include xcb_visualtype_t *visual_type = NULL; #include "libi3.h" #define SN_API_NOT_YET_FROZEN 1 -#include - #include "i3-nagbar.h" +#include + #define MSG_PADDING logical_px(8) #define BTN_PADDING logical_px(3) #define BTN_BORDER logical_px(3) diff --git a/i3bar/src/child.c b/i3bar/src/child.c index e56145fa..4723dbc5 100644 --- a/i3bar/src/child.c +++ b/i3bar/src/child.c @@ -10,25 +10,25 @@ #include "common.h" #include "yajl_utils.h" +#include +#include +#include +#include +#include +#include +#include +#include #include -#include +#include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include #include +#include +#include +#include +#include /* Global variables for child_*() */ i3bar_child child; diff --git a/i3bar/src/config.c b/i3bar/src/config.c index 29b0908b..48f49b89 100644 --- a/i3bar/src/config.c +++ b/i3bar/src/config.c @@ -9,15 +9,15 @@ */ #include "common.h" -#include -#include -#include #include #include -#include -#include +#include +#include +#include #include +#include +#include config_t config; static char *cur_key; diff --git a/i3bar/src/ipc.c b/i3bar/src/ipc.c index 37bdbac2..d2edfe78 100644 --- a/i3bar/src/ipc.c +++ b/i3bar/src/ipc.c @@ -9,16 +9,16 @@ */ #include "common.h" -#include -#include -#include -#include -#include #include +#include +#include +#include +#include +#include +#include #include #include -#include -#include +#include #ifdef I3_ASAN_ENABLED #include #endif diff --git a/i3bar/src/main.c b/i3bar/src/main.c index 65cb00ff..b3e23cda 100644 --- a/i3bar/src/main.c +++ b/i3bar/src/main.c @@ -7,15 +7,15 @@ */ #include "common.h" -#include -#include -#include -#include -#include #include #include #include #include +#include +#include +#include +#include +#include struct ev_loop *main_loop; diff --git a/i3bar/src/mode.c b/i3bar/src/mode.c index 97087ce0..1f0e22fa 100644 --- a/i3bar/src/mode.c +++ b/i3bar/src/mode.c @@ -9,10 +9,11 @@ */ #include "common.h" -#include -#include -#include #include +#include +#include +#include + #include #include diff --git a/i3bar/src/outputs.c b/i3bar/src/outputs.c index 6ebb7cc6..f1dab9f1 100644 --- a/i3bar/src/outputs.c +++ b/i3bar/src/outputs.c @@ -9,11 +9,12 @@ */ #include "common.h" -#include -#include -#include #include #include +#include +#include +#include + #include #include diff --git a/i3bar/src/parse_json_header.c b/i3bar/src/parse_json_header.c index 3d4c2a67..cd857d91 100644 --- a/i3bar/src/parse_json_header.c +++ b/i3bar/src/parse_json_header.c @@ -10,19 +10,20 @@ */ #include "common.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include #include +#include #include +#include +#include #include #include +#include +#include +#include +#include +#include +#include + #include #include #include diff --git a/i3bar/src/workspaces.c b/i3bar/src/workspaces.c index 68686611..51b863ca 100644 --- a/i3bar/src/workspaces.c +++ b/i3bar/src/workspaces.c @@ -9,10 +9,11 @@ */ #include "common.h" -#include -#include -#include #include +#include +#include +#include + #include #include diff --git a/i3bar/src/xcb.c b/i3bar/src/xcb.c index ecb41a60..0b0e23b0 100644 --- a/i3bar/src/xcb.c +++ b/i3bar/src/xcb.c @@ -9,26 +9,25 @@ */ #include "common.h" -#include -#include -#include -#include -#include - +#include +#include +#include +#include +#include +#include #include #include -#include -#include #include -#include -#include -#include -#include -#include +#include -#include #include +#include #include +#include +#include +#include +#include +#include #ifdef I3_ASAN_ENABLED #include diff --git a/libi3/dpi.c b/libi3/dpi.c index d15e35be..dec38bc8 100644 --- a/libi3/dpi.c +++ b/libi3/dpi.c @@ -9,6 +9,7 @@ #include #include + #include static long dpi; diff --git a/libi3/draw_util.c b/libi3/draw_util.c index 092ac967..710c536a 100644 --- a/libi3/draw_util.c +++ b/libi3/draw_util.c @@ -8,12 +8,13 @@ */ #include "libi3.h" -#include +#include #include +#include #include + #include #include -#include /* The default visual_type to use if none is specified when creating the surface. Must be defined globally. */ extern xcb_visualtype_t *visual_type; diff --git a/libi3/fake_configure_notify.c b/libi3/fake_configure_notify.c index 145f4512..e79a748b 100644 --- a/libi3/fake_configure_notify.c +++ b/libi3/fake_configure_notify.c @@ -7,8 +7,8 @@ */ #include "libi3.h" -#include #include +#include #include #include diff --git a/libi3/font.c b/libi3/font.c index 7b10edf0..e8945524 100644 --- a/libi3/font.c +++ b/libi3/font.c @@ -8,14 +8,13 @@ #include "libi3.h" #include +#include +#include +#include +#include #include #include #include -#include -#include - -#include -#include static const i3Font *savedFont = NULL; diff --git a/libi3/format_placeholders.c b/libi3/format_placeholders.c index 770e383d..99fa3055 100644 --- a/libi3/format_placeholders.c +++ b/libi3/format_placeholders.c @@ -7,8 +7,8 @@ */ #include "libi3.h" -#include #include +#include #include #ifndef CS_STARTS_WITH diff --git a/libi3/g_utf8_make_valid.c b/libi3/g_utf8_make_valid.c index b15873b3..71beafd3 100644 --- a/libi3/g_utf8_make_valid.c +++ b/libi3/g_utf8_make_valid.c @@ -19,8 +19,8 @@ #include "libi3.h" -#include #include +#include /* Copied from: * https://gitlab.gnome.org/GNOME/glib/blob/f928dfdf57bf92c883b53b16d7a9d49add504f52/glib/gutf8.c#L1752-1815 */ diff --git a/libi3/get_colorpixel.c b/libi3/get_colorpixel.c index 45931051..b60ffbac 100644 --- a/libi3/get_colorpixel.c +++ b/libi3/get_colorpixel.c @@ -6,12 +6,11 @@ * */ #include "libi3.h" - -#include -#include -#include - #include "queue.h" + +#include +#include +#include struct Colorpixel { char hex[8]; uint32_t pixel; diff --git a/libi3/get_exe_path.c b/libi3/get_exe_path.c index 430fb2e0..762b4965 100644 --- a/libi3/get_exe_path.c +++ b/libi3/get_exe_path.c @@ -7,12 +7,12 @@ */ #include "libi3.h" -#include -#include -#include -#include -#include #include +#include +#include +#include +#include +#include /* * This function returns the absolute path to the executable it is running in. diff --git a/libi3/get_mod_mask.c b/libi3/get_mod_mask.c index 98031d4c..92af456d 100644 --- a/libi3/get_mod_mask.c +++ b/libi3/get_mod_mask.c @@ -9,6 +9,7 @@ #include #include + #include #include diff --git a/libi3/get_process_filename.c b/libi3/get_process_filename.c index 7e2ecbd2..6e155ea8 100644 --- a/libi3/get_process_filename.c +++ b/libi3/get_process_filename.c @@ -8,16 +8,15 @@ #include "libi3.h" #include +#include +#include +#include #include #include #include -#include -#include #include #include -#include #include -#include /* * Returns the name of a temporary file with the specified prefix. diff --git a/libi3/ipc_connect.c b/libi3/ipc_connect.c index f659a1a4..614ccdf3 100644 --- a/libi3/ipc_connect.c +++ b/libi3/ipc_connect.c @@ -7,14 +7,14 @@ */ #include "libi3.h" -#include -#include -#include -#include #include -#include -#include #include +#include +#include +#include +#include +#include +#include /* * Connects to the i3 IPC socket and returns the file descriptor for the diff --git a/libi3/ipc_recv_message.c b/libi3/ipc_recv_message.c index 84da5aa3..6364b16d 100644 --- a/libi3/ipc_recv_message.c +++ b/libi3/ipc_recv_message.c @@ -7,15 +7,14 @@ */ #include "libi3.h" -#include -#include -#include -#include -#include #include -#include - #include +#include +#include +#include +#include +#include +#include /* * Reads a message from the given socket file descriptor and stores its length diff --git a/libi3/ipc_send_message.c b/libi3/ipc_send_message.c index c2cc0127..106db348 100644 --- a/libi3/ipc_send_message.c +++ b/libi3/ipc_send_message.c @@ -7,14 +7,13 @@ */ #include "libi3.h" -#include -#include -#include -#include #include #include - #include +#include +#include +#include +#include /* * Formats a message (payload) of the given size and type and sends it to i3 via diff --git a/libi3/is_debug_build.c b/libi3/is_debug_build.c index 52187bda..afd06237 100644 --- a/libi3/is_debug_build.c +++ b/libi3/is_debug_build.c @@ -7,8 +7,8 @@ */ #include "libi3.h" -#include #include +#include /* * Returns true if this version of i3 is a debug build (anything which is not a diff --git a/libi3/root_atom_contents.c b/libi3/root_atom_contents.c index d6394d4b..134733a2 100644 --- a/libi3/root_atom_contents.c +++ b/libi3/root_atom_contents.c @@ -7,12 +7,12 @@ */ #include "libi3.h" -#include -#include -#include #include -#include #include +#include +#include +#include +#include #include #include diff --git a/libi3/safewrappers.c b/libi3/safewrappers.c index fdea636e..d4225ffe 100644 --- a/libi3/safewrappers.c +++ b/libi3/safewrappers.c @@ -7,13 +7,13 @@ */ #include "libi3.h" -#include -#include -#include -#include -#include #include #include +#include +#include +#include +#include +#include /* * The s* functions (safe) are wrappers around malloc, strdup, …, which exits if one of diff --git a/libi3/string.c b/libi3/string.c index 9efa3690..da18c550 100644 --- a/libi3/string.c +++ b/libi3/string.c @@ -11,11 +11,10 @@ */ #include "libi3.h" +#include #include #include -#include - struct _i3String { char *utf8; xcb_char2b_t *ucs2; diff --git a/libi3/strndup.c b/libi3/strndup.c index e215a76f..533958d2 100644 --- a/libi3/strndup.c +++ b/libi3/strndup.c @@ -7,8 +7,8 @@ */ #include "libi3.h" -#include #include +#include #ifndef HAVE_strndup /* diff --git a/src/bindings.c b/src/bindings.c index 03dc2306..74d70c5c 100644 --- a/src/bindings.c +++ b/src/bindings.c @@ -8,8 +8,8 @@ */ #include "all.h" -#include #include +#include static struct xkb_context *xkb_context; static struct xkb_keymap *xkb_keymap; diff --git a/src/click.c b/src/click.c index 12e391b5..7cd32e11 100644 --- a/src/click.c +++ b/src/click.c @@ -9,12 +9,11 @@ */ #include "all.h" -#include #include - -#include +#include #include +#include typedef enum { CLICK_BORDER = 0, CLICK_DECORATION = 1, diff --git a/src/commands.c b/src/commands.c index d2024652..c96651d0 100644 --- a/src/commands.c +++ b/src/commands.c @@ -8,14 +8,13 @@ * */ #include "all.h" +#include "shmlog.h" -#include +#include #include #include +#include #include -#include - -#include "shmlog.h" // Macros to make the YAJL API a bit easier to use. #define y(x, ...) (cmd_output->json_gen != NULL ? yajl_gen_##x(cmd_output->json_gen, ##__VA_ARGS__) : 0) diff --git a/src/commands_parser.c b/src/commands_parser.c index 2fd76309..35005d0e 100644 --- a/src/commands_parser.c +++ b/src/commands_parser.c @@ -25,12 +25,12 @@ */ #include "all.h" +#include +#include #include #include #include #include -#include -#include // Macros to make the YAJL API a bit easier to use. #define y(x, ...) (command_output.json_gen != NULL ? yajl_gen_##x(command_output.json_gen, ##__VA_ARGS__) : 0) diff --git a/src/con.c b/src/con.c index 08bb7e4e..d9a79221 100644 --- a/src/con.c +++ b/src/con.c @@ -10,7 +10,6 @@ * */ #include "all.h" - #include "yajl_utils.h" static void con_on_remove_child(Con *con); diff --git a/src/config_parser.c b/src/config_parser.c index f120cfa3..f78e75f8 100644 --- a/src/config_parser.c +++ b/src/config_parser.c @@ -25,16 +25,17 @@ */ #include "all.h" +#include +#include +#include #include #include #include -#include -#include -#include +#include #include #include -#include -#include +#include + #include // Macros to make the YAJL API a bit easier to use. diff --git a/src/display_version.c b/src/display_version.c index e44540e0..1fff8b8e 100644 --- a/src/display_version.c +++ b/src/display_version.c @@ -10,12 +10,12 @@ */ #include "all.h" -#include -#include -#include -#include -#include #include +#include +#include +#include +#include +#include #include static bool human_readable_key, loaded_config_file_name_key; diff --git a/src/handlers.c b/src/handlers.c index d6d6e20b..c49ebf77 100644 --- a/src/handlers.c +++ b/src/handlers.c @@ -10,9 +10,10 @@ */ #include "all.h" -#include #include #include +#include + #include #define SN_API_NOT_YET_FROZEN 1 #include diff --git a/src/ipc.c b/src/ipc.c index 75fa8ee7..7e62b102 100644 --- a/src/ipc.c +++ b/src/ipc.c @@ -7,16 +7,17 @@ * ipc.c: UNIX domain socket IPC (initialization, client handling, protocol). * */ -#include "all.h" +#include "all.h" #include "yajl_utils.h" +#include +#include +#include #include #include #include -#include -#include -#include + #include #include diff --git a/src/log.c b/src/log.c index 31db8b33..73093da1 100644 --- a/src/log.c +++ b/src/log.c @@ -9,27 +9,27 @@ */ #include -#include -#include -#include -#include -#include -#include -#include +#include "i3.h" +#include "libi3.h" +#include "log.h" +#include "shmlog.h" +#include "util.h" + +#include #include +#include +#include +#include +#include +#include #include #include -#include +#include +#include #if !defined(__OpenBSD__) #include #endif -#include "util.h" -#include "log.h" -#include "i3.h" -#include "libi3.h" -#include "shmlog.h" - #if defined(__APPLE__) #include #endif diff --git a/src/main.c b/src/main.c index 369f2f66..c64bf43d 100644 --- a/src/main.c +++ b/src/main.c @@ -8,18 +8,18 @@ * */ #include "all.h" +#include "shmlog.h" #include #include -#include -#include -#include -#include -#include -#include -#include #include -#include "shmlog.h" +#include +#include +#include +#include +#include +#include +#include #ifdef I3_ASAN_ENABLED #include diff --git a/src/manage.c b/src/manage.c index eecba95c..da5751dc 100644 --- a/src/manage.c +++ b/src/manage.c @@ -8,7 +8,6 @@ * */ #include "all.h" - #include "yajl_utils.h" #include diff --git a/src/randr.c b/src/randr.c index b163eca7..56b0707f 100644 --- a/src/randr.c +++ b/src/randr.c @@ -12,6 +12,7 @@ #include "all.h" #include + #include /* Pointer to the result of the query for primary output */ diff --git a/src/sd-daemon.c b/src/sd-daemon.c index 28a88bfd..84761025 100644 --- a/src/sd-daemon.c +++ b/src/sd-daemon.c @@ -28,22 +28,22 @@ #define _GNU_SOURCE #endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - #include "sd-daemon.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + int sd_listen_fds(int unset_environment) { int r, fd; const char *e; diff --git a/src/sighandler.c b/src/sighandler.c index 86921b40..90e6c798 100644 --- a/src/sighandler.c +++ b/src/sighandler.c @@ -12,9 +12,8 @@ #include #include -#include - #include +#include typedef struct dialog_t { xcb_window_t id; diff --git a/src/startup.c b/src/startup.c index e994e0a8..759b373c 100644 --- a/src/startup.c +++ b/src/startup.c @@ -11,12 +11,11 @@ * */ #include "all.h" - #include "sd-daemon.h" +#include #include #include -#include #define SN_API_NOT_YET_FROZEN 1 #include diff --git a/src/util.c b/src/util.c index 3544297c..a21c7e5f 100644 --- a/src/util.c +++ b/src/util.c @@ -10,16 +10,17 @@ */ #include "all.h" -#include #include +#include #if defined(__OpenBSD__) #include #endif -#include -#include -#include -#include #include +#include +#include +#include + +#include #define SN_API_NOT_YET_FROZEN 1 #include diff --git a/src/xcursor.c b/src/xcursor.c index cffb094b..9b4996ea 100644 --- a/src/xcursor.c +++ b/src/xcursor.c @@ -9,13 +9,13 @@ */ #include -#include -#include -#include - #include "i3.h" #include "xcb.h" -#include "xcursor.h" + +#include +#include + +#include static xcb_cursor_context_t *ctx; static xcb_cursor_t cursors[XCURSOR_CURSOR_MAX]; diff --git a/testcases/inject_randr1.5.c b/testcases/inject_randr1.5.c index 819c029b..0b751228 100644 --- a/testcases/inject_randr1.5.c +++ b/testcases/inject_randr1.5.c @@ -16,15 +16,15 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include #include +#include +#include +#include +#include +#include +#include +#include +#include static void uds_connection_cb(EV_P_ ev_io *w, int revents); static void read_client_setup_request_cb(EV_P_ ev_io *w, int revents);