Skip to content
This repository has been archived by the owner on Apr 18, 2023. It is now read-only.

Commit

Permalink
Sort includes in *.c files
Browse files Browse the repository at this point in the history
Not enabling in .clang-format because it breaks headers files.

Used:
    IncludeCategories:
      - Regex:           '^<config'
        Priority:        0
      - Regex:           '^".*"'
        Priority:        1
      - Regex:           '^<(xcb|xkb|yajl|X11)'
        Priority:        3
      - Regex:           '.*'
        Priority:        2
  • Loading branch information
orestisfl committed Apr 19, 2020
1 parent 0bce0d8 commit 3c522d9
Show file tree
Hide file tree
Showing 52 changed files with 253 additions and 258 deletions.
27 changes: 13 additions & 14 deletions i3-config-wizard/main.c
Expand Up @@ -23,37 +23,36 @@
#define _WITH_GETLINE
#endif

#include <stdio.h>
#include <sys/types.h>
#include <stdlib.h>
#include <stdbool.h>
#include <unistd.h>
#include <string.h>
#include <assert.h>
#include <ctype.h>
#include <errno.h>
#include <err.h>
#include <stdint.h>
#include <errno.h>
#include <fcntl.h>
#include <getopt.h>
#include <glob.h>
#include <limits.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <glob.h>
#include <assert.h>
#include <sys/types.h>
#include <unistd.h>

#include <xcb/xcb.h>
#include <xcb/xcb_aux.h>
#include <xcb/xcb_event.h>
#include <xcb/xcb_keysyms.h>

#include <xkbcommon/xkbcommon.h>
#include <xkbcommon/xkbcommon-x11.h>
#include <xkbcommon/xkbcommon.h>

#define SN_API_NOT_YET_FROZEN 1
#include <libsn/sn-launchee.h>

#include <X11/XKBlib.h>
#include <X11/Xlib.h>
#include <X11/keysym.h>
#include <X11/XKBlib.h>

/* We need SYSCONFDIR for the path to the keycode config template, so raise an
* error if it’s not defined for whatever reason */
Expand Down
32 changes: 16 additions & 16 deletions i3-dump-log/main.c
Expand Up @@ -9,27 +9,27 @@
*/
#include <config.h>

#include <stdio.h>
#include <stdbool.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/un.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>
#include "libi3.h"
#include "shmlog.h"

#include <err.h>
#include <stdint.h>
#include <errno.h>
#include <fcntl.h>
#include <getopt.h>
#include <i3/ipc.h>
#include <limits.h>
#include <fcntl.h>
#include <signal.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/mman.h>
#include <sys/socket.h>
#include <sys/stat.h>
#include <signal.h>

#include "libi3.h"
#include "shmlog.h"
#include <i3/ipc.h>
#include <sys/types.h>
#include <sys/un.h>
#include <unistd.h>

#if !defined(__OpenBSD__)
static uint32_t offset_next_write;
Expand Down
3 changes: 2 additions & 1 deletion i3-input/keysym2ucs.c
Expand Up @@ -31,9 +31,10 @@
* This software is in the public domain. Share and enjoy!
*/

#include <xcb/xcb.h>
#include "keysym2ucs.h"

#include <xcb/xcb.h>

struct codepair {
unsigned short keysym;
unsigned short ucs;
Expand Down
22 changes: 10 additions & 12 deletions i3-input/main.c
Expand Up @@ -8,32 +8,30 @@
* to i3.
*
*/
#include <stdio.h>
#include <sys/types.h>
#include <stdlib.h>
#include <stdbool.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>
#include <err.h>
#include <stdint.h>
#include <errno.h>
#include <getopt.h>
#include <limits.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <unistd.h>

#include <xcb/xcb.h>
#include <xcb/xcb_aux.h>
#include <xcb/xcb_event.h>
#include <xcb/xcb_keysyms.h>

xcb_visualtype_t *visual_type = NULL;
#include "i3-input.h"
#include "keysym2ucs.h"
#include "libi3.h"

#include <X11/keysym.h>

#include "keysym2ucs.h"

#include "i3-input.h"

#define MAX_WIDTH logical_px(500)
#define BORDER logical_px(2)
#define PADDING logical_px(2)
Expand Down
26 changes: 12 additions & 14 deletions i3-msg/main.c
Expand Up @@ -16,27 +16,25 @@
*/
#include "libi3.h"

#include <stdio.h>
#include <err.h>
#include <errno.h>
#include <getopt.h>
#include <i3/ipc.h>
#include <limits.h>
#include <stdbool.h>
#include <sys/types.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <sys/un.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>
#include <err.h>
#include <stdint.h>
#include <getopt.h>
#include <limits.h>

#include <yajl/yajl_parse.h>
#include <yajl/yajl_version.h>

#include <xcb/xcb.h>
#include <xcb/xcb_aux.h>

#include <i3/ipc.h>
#include <yajl/yajl_parse.h>
#include <yajl/yajl_version.h>

/*
* Having verboselog() and errorlog() is necessary when using libi3.
Expand Down
30 changes: 15 additions & 15 deletions i3-nagbar/main.c
Expand Up @@ -8,36 +8,36 @@
* when the user has an error in their configuration file.
*
*/
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/wait.h>
#include <stdlib.h>
#include <stdbool.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>
#include <err.h>
#include <stdint.h>
#include <errno.h>
#include <fcntl.h>
#include <getopt.h>
#include <limits.h>
#include <fcntl.h>
#include <paths.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>

#include <xcb/randr.h>
#include <xcb/xcb.h>
#include <xcb/xcb_aux.h>
#include <xcb/xcb_event.h>
#include <xcb/randr.h>
#include <xcb/xcb_cursor.h>
#include <xcb/xcb_event.h>

xcb_visualtype_t *visual_type = NULL;
#include "libi3.h"

#define SN_API_NOT_YET_FROZEN 1
#include <libsn/sn-launchee.h>

#include "i3-nagbar.h"

#include <libsn/sn-launchee.h>

#define MSG_PADDING logical_px(8)
#define BTN_PADDING logical_px(3)
#define BTN_BORDER logical_px(3)
Expand Down
26 changes: 13 additions & 13 deletions i3bar/src/child.c
Expand Up @@ -10,25 +10,25 @@
#include "common.h"
#include "yajl_utils.h"

#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <err.h>
#include <errno.h>
#include <ev.h>
#include <fcntl.h>
#include <paths.h>
#include <signal.h>
#include <stdio.h>
#include <stdarg.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <err.h>
#include <ev.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>

#include <xcb/xcb_keysyms.h>
#include <yajl/yajl_common.h>
#include <yajl/yajl_gen.h>
#include <yajl/yajl_parse.h>
#include <yajl/yajl_version.h>
#include <yajl/yajl_gen.h>
#include <paths.h>

#include <xcb/xcb_keysyms.h>

/* Global variables for child_*() */
i3bar_child child;
Expand Down
10 changes: 5 additions & 5 deletions i3bar/src/config.c
Expand Up @@ -9,15 +9,15 @@
*/
#include "common.h"

#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
#include <i3/ipc.h>
#include <yajl/yajl_parse.h>
#include <yajl/yajl_version.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include <X11/Xlib.h>
#include <yajl/yajl_parse.h>
#include <yajl/yajl_version.h>

config_t config;
static char *cur_key;
Expand Down
12 changes: 6 additions & 6 deletions i3bar/src/ipc.c
Expand Up @@ -9,16 +9,16 @@
*/
#include "common.h"

#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <errno.h>
#include <ev.h>
#include <i3/ipc.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <sys/socket.h>
#include <sys/un.h>
#include <i3/ipc.h>
#include <ev.h>
#include <unistd.h>
#ifdef I3_ASAN_ENABLED
#include <sanitizer/lsan_interface.h>
#endif
Expand Down
10 changes: 5 additions & 5 deletions i3bar/src/main.c
Expand Up @@ -7,15 +7,15 @@
*/
#include "common.h"

#include <stdio.h>
#include <i3/ipc.h>
#include <string.h>
#include <unistd.h>
#include <stdlib.h>
#include <errno.h>
#include <ev.h>
#include <getopt.h>
#include <glob.h>
#include <i3/ipc.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>

struct ev_loop *main_loop;

Expand Down
7 changes: 4 additions & 3 deletions i3bar/src/mode.c
Expand Up @@ -9,10 +9,11 @@
*/
#include "common.h"

#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include <yajl/yajl_parse.h>
#include <yajl/yajl_version.h>

Expand Down
7 changes: 4 additions & 3 deletions i3bar/src/outputs.c
Expand Up @@ -9,11 +9,12 @@
*/
#include "common.h"

#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
#include <i3/ipc.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include <yajl/yajl_parse.h>
#include <yajl/yajl_version.h>

Expand Down

0 comments on commit 3c522d9

Please sign in to comment.