Merge pull request #4028 from orestisfl/headers

Header file cleaning
This commit is contained in:
Orestis Floros 2020-04-28 08:28:00 +02:00 committed by GitHub
commit 9c2b8f8b31
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
70 changed files with 237 additions and 389 deletions

View File

@ -379,7 +379,6 @@ i3_nagbar_i3_nagbar_LDADD = \
i3_nagbar_i3_nagbar_SOURCES = \ i3_nagbar_i3_nagbar_SOURCES = \
i3-nagbar/atoms.xmacro \ i3-nagbar/atoms.xmacro \
i3-nagbar/i3-nagbar.h \
i3-nagbar/main.c i3-nagbar/main.c
i3bar_i3bar_CPPFLAGS = \ i3bar_i3bar_CPPFLAGS = \

View File

@ -117,6 +117,7 @@ my @keys = sort { (length($b) <=> length($a)) or ($a cmp $b) } keys %states;
open(my $enumfh, '>', "GENERATED_${prefix}_enums.h"); open(my $enumfh, '>', "GENERATED_${prefix}_enums.h");
my %statenum; my %statenum;
say $enumfh '#pragma once';
say $enumfh 'typedef enum {'; say $enumfh 'typedef enum {';
my $cnt = 0; my $cnt = 0;
for my $state (@keys, '__CALL') { for my $state (@keys, '__CALL') {
@ -131,6 +132,7 @@ close($enumfh);
# Third step: Generate the call function. # Third step: Generate the call function.
open(my $callfh, '>', "GENERATED_${prefix}_call.h"); open(my $callfh, '>', "GENERATED_${prefix}_call.h");
my $resultname = uc(substr($prefix, 0, 1)) . substr($prefix, 1) . 'ResultIR'; my $resultname = uc(substr($prefix, 0, 1)) . substr($prefix, 1) . 'ResultIR';
say $callfh '#pragma once';
say $callfh "static void GENERATED_call(const int call_identifier, struct $resultname *result) {"; say $callfh "static void GENERATED_call(const int call_identifier, struct $resultname *result) {";
say $callfh ' switch (call_identifier) {'; say $callfh ' switch (call_identifier) {';
my $call_id = 0; my $call_id = 0;
@ -206,6 +208,7 @@ close($callfh);
# Fourth step: Generate the token datastructures. # Fourth step: Generate the token datastructures.
open(my $tokfh, '>', "GENERATED_${prefix}_tokens.h"); open(my $tokfh, '>', "GENERATED_${prefix}_tokens.h");
say $tokfh '#pragma once';
for my $state (@keys) { for my $state (@keys) {
my $tokens = $states{$state}; my $tokens = $states{$state};

View File

@ -10,6 +10,8 @@
*/ */
#include <config.h> #include <config.h>
#include "libi3.h"
#if defined(__FreeBSD__) #if defined(__FreeBSD__)
#include <sys/param.h> #include <sys/param.h>
#endif #endif
@ -23,37 +25,31 @@
#define _WITH_GETLINE #define _WITH_GETLINE
#endif #endif
#include <stdio.h>
#include <sys/types.h>
#include <stdlib.h>
#include <stdbool.h>
#include <unistd.h>
#include <string.h>
#include <ctype.h> #include <ctype.h>
#include <errno.h>
#include <err.h> #include <err.h>
#include <stdint.h> #include <errno.h>
#include <fcntl.h>
#include <getopt.h> #include <getopt.h>
#include <limits.h> #include <limits.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <fcntl.h> #include <sys/types.h>
#include <glob.h> #include <unistd.h>
#include <assert.h>
#include <xcb/xcb.h> #include <xcb/xcb.h>
#include <xcb/xcb_aux.h> #include <xcb/xcb_aux.h>
#include <xcb/xcb_event.h> #include <xcb/xcb_event.h>
#include <xcb/xcb_keysyms.h> #include <xcb/xcb_keysyms.h>
#include <xkbcommon/xkbcommon.h>
#include <xkbcommon/xkbcommon-x11.h> #include <xkbcommon/xkbcommon-x11.h>
#include <xkbcommon/xkbcommon.h>
#define SN_API_NOT_YET_FROZEN 1 #define SN_API_NOT_YET_FROZEN 1
#include <libsn/sn-launchee.h> #include <libsn/sn-launchee.h>
#include <X11/XKBlib.h>
#include <X11/Xlib.h> #include <X11/Xlib.h>
#include <X11/keysym.h> #include <X11/keysym.h>
#include <X11/XKBlib.h>
/* We need SYSCONFDIR for the path to the keycode config template, so raise an /* We need SYSCONFDIR for the path to the keycode config template, so raise an
* error if its not defined for whatever reason */ * error if its not defined for whatever reason */
@ -69,7 +65,6 @@
#include "xcb.h" #include "xcb.h"
xcb_visualtype_t *visual_type = NULL; xcb_visualtype_t *visual_type = NULL;
#include "libi3.h"
#define TEXT_PADDING logical_px(4) #define TEXT_PADDING logical_px(4)
#define WIN_POS_X logical_px(490) #define WIN_POS_X logical_px(490)

View File

@ -9,27 +9,22 @@
*/ */
#include <config.h> #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 <err.h>
#include <stdint.h>
#include <getopt.h>
#include <limits.h>
#include <fcntl.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <signal.h>
#include "libi3.h" #include "libi3.h"
#include "shmlog.h" #include "shmlog.h"
#include <err.h>
#include <fcntl.h>
#include <getopt.h>
#include <i3/ipc.h> #include <i3/ipc.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/stat.h>
#include <unistd.h>
#if !defined(__OpenBSD__) #if !defined(__OpenBSD__)
static uint32_t offset_next_write; static uint32_t offset_next_write;

View File

@ -31,9 +31,10 @@
* This software is in the public domain. Share and enjoy! * This software is in the public domain. Share and enjoy!
*/ */
#include <xcb/xcb.h>
#include "keysym2ucs.h" #include "keysym2ucs.h"
#include <xcb/xcb.h>
struct codepair { struct codepair {
unsigned short keysym; unsigned short keysym;
unsigned short ucs; unsigned short ucs;

View File

@ -8,32 +8,26 @@
* to i3. * 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 <getopt.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.h>
#include <xcb/xcb_aux.h> #include <xcb/xcb_aux.h>
#include <xcb/xcb_event.h>
#include <xcb/xcb_keysyms.h> #include <xcb/xcb_keysyms.h>
xcb_visualtype_t *visual_type = NULL; xcb_visualtype_t *visual_type = NULL;
#include "i3-input.h"
#include "keysym2ucs.h"
#include "libi3.h" #include "libi3.h"
#include <X11/keysym.h> #include <X11/keysym.h>
#include "keysym2ucs.h"
#include "i3-input.h"
#define MAX_WIDTH logical_px(500) #define MAX_WIDTH logical_px(500)
#define BORDER logical_px(2) #define BORDER logical_px(2)
#define PADDING logical_px(2) #define PADDING logical_px(2)

View File

@ -16,27 +16,17 @@
*/ */
#include "libi3.h" #include "libi3.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 <err.h> #include <err.h>
#include <stdint.h>
#include <getopt.h> #include <getopt.h>
#include <limits.h> #include <i3/ipc.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <yajl/yajl_parse.h> #include <yajl/yajl_parse.h>
#include <yajl/yajl_version.h>
#include <xcb/xcb.h>
#include <xcb/xcb_aux.h>
#include <i3/ipc.h>
/* /*
* Having verboselog() and errorlog() is necessary when using libi3. * Having verboselog() and errorlog() is necessary when using libi3.

View File

@ -1,18 +0,0 @@
#pragma once
#include <config.h>
#include <err.h>
#define die(...) errx(EXIT_FAILURE, __VA_ARGS__);
#define FREE(pointer) \
do { \
free(pointer); \
pointer = NULL; \
} while (0)
#define xmacro(atom) xcb_atom_t A_##atom;
#include "atoms.xmacro"
#undef xmacro
extern xcb_window_t root;

View File

@ -8,36 +8,33 @@
* when the user has an error in their configuration file. * when the user has an error in their configuration file.
* *
*/ */
#include <stdio.h> #include <config.h>
#include <sys/types.h>
#include <sys/stat.h> #include "libi3.h"
#include <sys/wait.h>
#include <stdlib.h>
#include <stdbool.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>
#include <err.h> #include <err.h>
#include <stdint.h> #include <fcntl.h>
#include <getopt.h> #include <getopt.h>
#include <limits.h> #include <limits.h>
#include <fcntl.h>
#include <paths.h> #include <paths.h>
#include <stdint.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.h>
#include <xcb/xcb_aux.h> #include <xcb/xcb_aux.h>
#include <xcb/xcb_event.h>
#include <xcb/randr.h>
#include <xcb/xcb_cursor.h> #include <xcb/xcb_cursor.h>
xcb_visualtype_t *visual_type = NULL; xcb_visualtype_t *visual_type = NULL;
#include "libi3.h"
#define SN_API_NOT_YET_FROZEN 1 #define SN_API_NOT_YET_FROZEN 1
#include <libsn/sn-launchee.h> #include <libsn/sn-launchee.h>
#include "i3-nagbar.h"
#define MSG_PADDING logical_px(8) #define MSG_PADDING logical_px(8)
#define BTN_PADDING logical_px(3) #define BTN_PADDING logical_px(3)
#define BTN_BORDER logical_px(3) #define BTN_BORDER logical_px(3)
@ -45,6 +42,12 @@ xcb_visualtype_t *visual_type = NULL;
#define CLOSE_BTN_GAP logical_px(15) #define CLOSE_BTN_GAP logical_px(15)
#define BAR_BORDER logical_px(2) #define BAR_BORDER logical_px(2)
#define xmacro(atom) xcb_atom_t A_##atom;
#include "atoms.xmacro"
#undef xmacro
#define die(...) errx(EXIT_FAILURE, __VA_ARGS__);
static char *argv0 = NULL; static char *argv0 = NULL;
typedef struct { typedef struct {
@ -314,8 +317,8 @@ static xcb_rectangle_t get_window_position(void) {
goto free_resources; goto free_resources;
free_resources: free_resources:
FREE(res); free(res);
FREE(primary); free(primary);
return result; return result;
} }
@ -598,7 +601,7 @@ int main(int argc, char *argv[]) {
free(event); free(event);
} }
FREE(pattern); free(pattern);
draw_util_surface_free(conn, &bar); draw_util_surface_free(conn, &bar);
return 0; return 0;

View File

@ -9,7 +9,6 @@
#include <config.h> #include <config.h>
#include <stdbool.h>
#include <xcb/xcb.h> #include <xcb/xcb.h>
#include <xcb/xproto.h> #include <xcb/xproto.h>
#include "libi3.h" #include "libi3.h"
@ -94,5 +93,4 @@ extern TAILQ_HEAD(statusline_head, status_block)
#include "trayclients.h" #include "trayclients.h"
#include "xcb.h" #include "xcb.h"
#include "configuration.h" #include "configuration.h"
#include "libi3.h"
#include "parse_json_header.h" #include "parse_json_header.h"

View File

@ -10,25 +10,21 @@
#include "common.h" #include "common.h"
#include "yajl_utils.h" #include "yajl_utils.h"
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <signal.h>
#include <stdio.h>
#include <stdarg.h>
#include <fcntl.h>
#include <string.h>
#include <errno.h>
#include <err.h> #include <err.h>
#include <errno.h>
#include <ev.h> #include <ev.h>
#include <yajl/yajl_common.h> #include <fcntl.h>
#include <yajl/yajl_parse.h>
#include <yajl/yajl_version.h>
#include <yajl/yajl_gen.h>
#include <paths.h> #include <paths.h>
#include <signal.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/wait.h>
#include <unistd.h>
#include <xcb/xcb_keysyms.h> #include <yajl/yajl_gen.h>
#include <yajl/yajl_parse.h>
/* Global variables for child_*() */ /* Global variables for child_*() */
i3bar_child child; i3bar_child child;

View File

@ -9,15 +9,12 @@
*/ */
#include "common.h" #include "common.h"
#include <string.h>
#include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include <errno.h> #include <stdlib.h>
#include <i3/ipc.h> #include <string.h>
#include <yajl/yajl_parse.h>
#include <yajl/yajl_version.h>
#include <X11/Xlib.h> #include <X11/Xlib.h>
#include <yajl/yajl_parse.h>
config_t config; config_t config;
static char *cur_key; static char *cur_key;

View File

@ -9,16 +9,13 @@
*/ */
#include "common.h" #include "common.h"
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <stdint.h>
#include <string.h>
#include <errno.h> #include <errno.h>
#include <sys/socket.h>
#include <sys/un.h>
#include <i3/ipc.h>
#include <ev.h> #include <ev.h>
#include <i3/ipc.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#ifdef I3_ASAN_ENABLED #ifdef I3_ASAN_ENABLED
#include <sanitizer/lsan_interface.h> #include <sanitizer/lsan_interface.h>
#endif #endif

View File

@ -7,15 +7,13 @@
*/ */
#include "common.h" #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 <ev.h>
#include <getopt.h> #include <getopt.h>
#include <glob.h> #include <glob.h>
#include <i3/ipc.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
struct ev_loop *main_loop; struct ev_loop *main_loop;

View File

@ -9,12 +9,10 @@
*/ */
#include "common.h" #include "common.h"
#include <string.h>
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <string.h>
#include <errno.h>
#include <yajl/yajl_parse.h> #include <yajl/yajl_parse.h>
#include <yajl/yajl_version.h>
/* A datatype to pass through the callbacks to save the state */ /* A datatype to pass through the callbacks to save the state */
struct mode_json_params { struct mode_json_params {

View File

@ -9,13 +9,12 @@
*/ */
#include "common.h" #include "common.h"
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <errno.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_parse.h>
#include <yajl/yajl_version.h>
/* A datatype to pass through the callbacks to save the state */ /* A datatype to pass through the callbacks to save the state */
struct outputs_json_params { struct outputs_json_params {

View File

@ -10,22 +10,10 @@
*/ */
#include "common.h" #include "common.h"
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <signal.h> #include <signal.h>
#include <stdio.h>
#include <fcntl.h>
#include <string.h> #include <string.h>
#include <errno.h>
#include <err.h>
#include <ev.h>
#include <stdbool.h>
#include <stdint.h>
#include <yajl/yajl_common.h>
#include <yajl/yajl_parse.h> #include <yajl/yajl_parse.h>
#include <yajl/yajl_version.h>
static enum { static enum {
KEY_VERSION, KEY_VERSION,

View File

@ -9,12 +9,10 @@
*/ */
#include "common.h" #include "common.h"
#include <string.h>
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <string.h>
#include <errno.h>
#include <yajl/yajl_parse.h> #include <yajl/yajl_parse.h>
#include <yajl/yajl_version.h>
/* A datatype to pass through the callbacks to save the state */ /* A datatype to pass through the callbacks to save the state */
struct workspaces_json_params { struct workspaces_json_params {

View File

@ -9,26 +9,15 @@
*/ */
#include "common.h" #include "common.h"
#include <xcb/xcb.h> #include <err.h>
#include <xcb/xkb.h> #include <ev.h>
#include <xcb/xproto.h> #include <i3/ipc.h>
#include <stdlib.h>
#include <string.h>
#include <xcb/xcb_aux.h> #include <xcb/xcb_aux.h>
#include <xcb/xcb_cursor.h> #include <xcb/xcb_cursor.h>
#include <xcb/xkb.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <string.h>
#include <i3/ipc.h>
#include <ev.h>
#include <errno.h>
#include <limits.h>
#include <err.h>
#include <X11/Xlib.h>
#include <X11/XKBlib.h>
#include <X11/extensions/XKB.h>
#ifdef I3_ASAN_ENABLED #ifdef I3_ASAN_ENABLED
#include <sanitizer/lsan_interface.h> #include <sanitizer/lsan_interface.h>

View File

@ -15,31 +15,24 @@
#include <config.h> #include <config.h>
#include <assert.h> #include <assert.h>
#include <err.h>
#include <errno.h>
#include <limits.h>
#include <stdarg.h>
#include <stdbool.h> #include <stdbool.h>
#include <stdlib.h> #include <stdint.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h>
#include <string.h> #include <string.h>
#include <locale.h>
#include <getopt.h>
#include <unistd.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/types.h> #include <sys/types.h>
#include <glob.h>
#include <errno.h>
#include <err.h>
#include <stdint.h>
#include <inttypes.h>
#include <math.h>
#include <limits.h>
#include <xcb/xcb.h> #include <xcb/xcb.h>
#include <xcb/xcb_aux.h> #include <xcb/xcb_aux.h>
#include <xcb/xcb_keysyms.h>
#include <xcb/xcb_icccm.h> #include <xcb/xcb_icccm.h>
#include <xcb/xcb_keysyms.h>
#include <yajl/yajl_gen.h> #include "libi3.h"
#include <yajl/yajl_version.h>
#include "data.h" #include "data.h"
#include "util.h" #include "util.h"
#include "ipc.h" #include "ipc.h"
@ -72,7 +65,6 @@
#include "ewmh.h" #include "ewmh.h"
#include "assignments.h" #include "assignments.h"
#include "regex.h" #include "regex.h"
#include "libi3.h"
#include "startup.h" #include "startup.h"
#include "scratchpad.h" #include "scratchpad.h"
#include "commands.h" #include "commands.h"

View File

@ -12,9 +12,6 @@
*/ */
#pragma once #pragma once
#include "libi3.h"
#include <stdbool.h>
#include "queue.h" #include "queue.h"
#include "i3.h" #include "i3.h"

View File

@ -9,13 +9,10 @@
*/ */
#pragma once #pragma once
#include "libi3.h"
#define SN_API_NOT_YET_FROZEN 1 #define SN_API_NOT_YET_FROZEN 1
#include <libsn/sn-launcher.h> #include <libsn/sn-launcher.h>
#include <xcb/randr.h> #include <xcb/randr.h>
#include <stdbool.h>
#include <pcre.h> #include <pcre.h>
#include <sys/time.h> #include <sys/time.h>

View File

@ -12,7 +12,6 @@
#include <config.h> #include <config.h>
#include <ev.h> #include <ev.h>
#include <stdbool.h>
#include <yajl/yajl_gen.h> #include <yajl/yajl_gen.h>
#include <yajl/yajl_parse.h> #include <yajl/yajl_parse.h>

View File

@ -11,9 +11,6 @@
#include <config.h> #include <config.h>
#include <stdarg.h>
#include <stdbool.h>
/* We will include libi3.h which define its own version of LOG, ELOG. /* We will include libi3.h which define its own version of LOG, ELOG.
* We want *our* version, so we undef the libi3 one. */ * We want *our* version, so we undef the libi3 one. */
#if defined(LOG) #if defined(LOG)

View File

@ -12,7 +12,6 @@
#include <config.h> #include <config.h>
#include <stdint.h>
#if !defined(__OpenBSD__) #if !defined(__OpenBSD__)
#include <pthread.h> #include <pthread.h>
#endif #endif

View File

@ -13,8 +13,6 @@
#include <config.h> #include <config.h>
#include "data.h"
/** /**
* We have just established a connection to the X server and need the initial * We have just established a connection to the X server and need the initial
* Xinerama information to setup workspaces for each screen. * Xinerama information to setup workspaces for each screen.

View File

@ -9,6 +9,7 @@
#include <math.h> #include <math.h>
#include <stdlib.h> #include <stdlib.h>
#include <xcb/xcb_xrm.h> #include <xcb/xcb_xrm.h>
static long dpi; static long dpi;

View File

@ -9,11 +9,10 @@
#include "libi3.h" #include "libi3.h"
#include <stdlib.h> #include <stdlib.h>
#include <err.h>
#include <string.h> #include <string.h>
#include <xcb/xcb.h> #include <xcb/xcb.h>
#include <xcb/xcb_aux.h> #include <xcb/xcb_aux.h>
#include <cairo/cairo-xcb.h>
/* The default visual_type to use if none is specified when creating the surface. Must be defined globally. */ /* The default visual_type to use if none is specified when creating the surface. Must be defined globally. */
extern xcb_visualtype_t *visual_type; extern xcb_visualtype_t *visual_type;

View File

@ -8,7 +8,6 @@
#include "libi3.h" #include "libi3.h"
#include <stdlib.h> #include <stdlib.h>
#include <stdbool.h>
#include <xcb/xcb.h> #include <xcb/xcb.h>
#include <xcb/xproto.h> #include <xcb/xproto.h>

View File

@ -8,14 +8,12 @@
#include "libi3.h" #include "libi3.h"
#include <assert.h> #include <assert.h>
#include <cairo/cairo-xcb.h>
#include <err.h>
#include <pango/pangocairo.h>
#include <stdint.h> #include <stdint.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <stdbool.h>
#include <err.h>
#include <cairo/cairo-xcb.h>
#include <pango/pangocairo.h>
static const i3Font *savedFont = NULL; static const i3Font *savedFont = NULL;

View File

@ -8,7 +8,6 @@
#include "libi3.h" #include "libi3.h"
#include <stdlib.h> #include <stdlib.h>
#include <stdint.h>
#include <string.h> #include <string.h>
#ifndef CS_STARTS_WITH #ifndef CS_STARTS_WITH

View File

@ -19,8 +19,8 @@
#include "libi3.h" #include "libi3.h"
#include <string.h>
#include <glib.h> #include <glib.h>
#include <string.h>
/* Copied from: /* Copied from:
* https://gitlab.gnome.org/GNOME/glib/blob/f928dfdf57bf92c883b53b16d7a9d49add504f52/glib/gutf8.c#L1752-1815 */ * https://gitlab.gnome.org/GNOME/glib/blob/f928dfdf57bf92c883b53b16d7a9d49add504f52/glib/gutf8.c#L1752-1815 */

View File

@ -6,12 +6,11 @@
* *
*/ */
#include "libi3.h" #include "libi3.h"
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include "queue.h" #include "queue.h"
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
struct Colorpixel { struct Colorpixel {
char hex[8]; char hex[8];
uint32_t pixel; uint32_t pixel;

View File

@ -7,12 +7,10 @@
*/ */
#include "libi3.h" #include "libi3.h"
#include <unistd.h>
#include <string.h>
#include <stdio.h>
#include <limits.h>
#include <stdlib.h>
#include <errno.h> #include <errno.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
/* /*
* This function returns the absolute path to the executable it is running in. * This function returns the absolute path to the executable it is running in.

View File

@ -9,6 +9,7 @@
#include <stdint.h> #include <stdint.h>
#include <stdlib.h> #include <stdlib.h>
#include <xcb/xcb.h> #include <xcb/xcb.h>
#include <xcb/xcb_keysyms.h> #include <xcb/xcb_keysyms.h>

View File

@ -7,17 +7,11 @@
*/ */
#include "libi3.h" #include "libi3.h"
#include <assert.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
#include <err.h> #include <err.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <pwd.h> #include <pwd.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <unistd.h> #include <unistd.h>
#include <err.h>
/* /*
* Returns the name of a temporary file with the specified prefix. * Returns the name of a temporary file with the specified prefix.

View File

@ -7,14 +7,12 @@
*/ */
#include "libi3.h" #include "libi3.h"
#include <sys/types.h> #include <err.h>
#include <fcntl.h>
#include <stdlib.h>
#include <string.h>
#include <sys/socket.h> #include <sys/socket.h>
#include <sys/un.h> #include <sys/un.h>
#include <string.h>
#include <err.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
/* /*
* Connects to the i3 IPC socket and returns the file descriptor for the * Connects to the i3 IPC socket and returns the file descriptor for the

View File

@ -7,15 +7,12 @@
*/ */
#include "libi3.h" #include "libi3.h"
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
#include <unistd.h>
#include <errno.h> #include <errno.h>
#include <inttypes.h>
#include <i3/ipc.h> #include <i3/ipc.h>
#include <inttypes.h>
#include <stdint.h>
#include <string.h>
#include <unistd.h>
/* /*
* Reads a message from the given socket file descriptor and stores its length * Reads a message from the given socket file descriptor and stores its length

View File

@ -7,14 +7,8 @@
*/ */
#include "libi3.h" #include "libi3.h"
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <stdint.h>
#include <err.h>
#include <errno.h>
#include <i3/ipc.h> #include <i3/ipc.h>
#include <stdint.h>
/* /*
* Formats a message (payload) of the given size and type and sends it to i3 via * Formats a message (payload) of the given size and type and sends it to i3 via

View File

@ -8,7 +8,6 @@
#include "libi3.h" #include "libi3.h"
#include <string.h> #include <string.h>
#include <stdbool.h>
/* /*
* Returns true if this version of i3 is a debug build (anything which is not a * Returns true if this version of i3 is a debug build (anything which is not a

View File

@ -7,12 +7,9 @@
*/ */
#include "libi3.h" #include "libi3.h"
#include <stdio.h>
#include <string.h>
#include <stdbool.h>
#include <limits.h>
#include <stdlib.h>
#include <math.h> #include <math.h>
#include <stdlib.h>
#include <string.h>
#include <xcb/xcb.h> #include <xcb/xcb.h>
#include <xcb/xcb_aux.h> #include <xcb/xcb_aux.h>

View File

@ -7,13 +7,11 @@
*/ */
#include "libi3.h" #include "libi3.h"
#include <string.h>
#include <stdlib.h>
#include <stdarg.h>
#include <unistd.h>
#include <stdio.h>
#include <err.h> #include <err.h>
#include <errno.h> #include <errno.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
/* /*
* The s* functions (safe) are wrappers around malloc, strdup, , which exits if one of * The s* functions (safe) are wrappers around malloc, strdup, , which exits if one of

View File

@ -11,11 +11,10 @@
*/ */
#include "libi3.h" #include "libi3.h"
#include <glib.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <glib.h>
struct _i3String { struct _i3String {
char *utf8; char *utf8;
xcb_char2b_t *ucs2; xcb_char2b_t *ucs2;

View File

@ -7,7 +7,6 @@
*/ */
#include "libi3.h" #include "libi3.h"
#include <sys/types.h>
#include <string.h> #include <string.h>
#ifndef HAVE_strndup #ifndef HAVE_strndup

View File

@ -8,7 +8,6 @@
#include "libi3.h" #include "libi3.h"
#include <err.h> #include <err.h>
#include <errno.h>
#include <iconv.h> #include <iconv.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>

View File

@ -8,8 +8,10 @@
*/ */
#include "all.h" #include "all.h"
#include <xkbcommon/xkbcommon.h> #include <math.h>
#include <xkbcommon/xkbcommon-x11.h> #include <xkbcommon/xkbcommon-x11.h>
#include <xkbcommon/xkbcommon.h>
static struct xkb_context *xkb_context; static struct xkb_context *xkb_context;
static struct xkb_keymap *xkb_keymap; static struct xkb_keymap *xkb_keymap;

View File

@ -10,11 +10,6 @@
#include "all.h" #include "all.h"
#include <time.h> #include <time.h>
#include <math.h>
#include <xcb/xcb_icccm.h>
#include <X11/XKBlib.h>
typedef enum { CLICK_BORDER = 0, typedef enum { CLICK_BORDER = 0,
CLICK_DECORATION = 1, CLICK_DECORATION = 1,

View File

@ -8,15 +8,12 @@
* *
*/ */
#include "all.h" #include "all.h"
#include <stdint.h>
#include <float.h>
#include <stdarg.h>
#include <unistd.h>
#include <fcntl.h>
#include "shmlog.h" #include "shmlog.h"
#include <fcntl.h>
#include <stdint.h>
#include <unistd.h>
// Macros to make the YAJL API a bit easier to use. // 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) #define y(x, ...) (cmd_output->json_gen != NULL ? yajl_gen_##x(cmd_output->json_gen, ##__VA_ARGS__) : 0)
#define ystr(str) (cmd_output->json_gen != NULL ? yajl_gen_string(cmd_output->json_gen, (unsigned char *)str, strlen(str)) : 0) #define ystr(str) (cmd_output->json_gen != NULL ? yajl_gen_string(cmd_output->json_gen, (unsigned char *)str, strlen(str)) : 0)

View File

@ -25,13 +25,6 @@
*/ */
#include "all.h" #include "all.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <stdbool.h>
#include <stdint.h>
// Macros to make the YAJL API a bit easier to use. // 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) #define y(x, ...) (command_output.json_gen != NULL ? yajl_gen_##x(command_output.json_gen, ##__VA_ARGS__) : 0)
#define ystr(str) (command_output.json_gen != NULL ? yajl_gen_string(command_output.json_gen, (unsigned char *)str, strlen(str)) : 0) #define ystr(str) (command_output.json_gen != NULL ? yajl_gen_string(command_output.json_gen, (unsigned char *)str, strlen(str)) : 0)

View File

@ -10,7 +10,6 @@
* *
*/ */
#include "all.h" #include "all.h"
#include "yajl_utils.h" #include "yajl_utils.h"
static void con_on_remove_child(Con *con); static void con_on_remove_child(Con *con);

View File

@ -9,9 +9,6 @@
*/ */
#include "all.h" #include "all.h"
#include <float.h>
#include <stdarg.h>
/******************************************************************************* /*******************************************************************************
* Criteria functions. * Criteria functions.
******************************************************************************/ ******************************************************************************/

View File

@ -25,16 +25,17 @@
*/ */
#include "all.h" #include "all.h"
#include <fcntl.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <unistd.h> #include <sys/stat.h>
#include <stdbool.h>
#include <stdint.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/wait.h> #include <sys/wait.h>
#include <sys/stat.h> #include <unistd.h>
#include <fcntl.h>
#include <xcb/xcb_xrm.h> #include <xcb/xcb_xrm.h>
// Macros to make the YAJL API a bit easier to use. // Macros to make the YAJL API a bit easier to use.

View File

@ -10,13 +10,9 @@
*/ */
#include "all.h" #include "all.h"
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/wait.h>
#include <sys/socket.h>
#include <sys/un.h>
#include <fcntl.h> #include <fcntl.h>
#include <time.h> #include <time.h>
#include <unistd.h>
static bool human_readable_key, loaded_config_file_name_key; static bool human_readable_key, loaded_config_file_name_key;
static char *human_readable_version, *loaded_config_file_name; static char *human_readable_version, *loaded_config_file_name;

View File

@ -9,6 +9,8 @@
*/ */
#include "all.h" #include "all.h"
#include <math.h>
#ifndef MAX #ifndef MAX
#define MAX(x, y) ((x) > (y) ? (x) : (y)) #define MAX(x, y) ((x) > (y) ? (x) : (y))
#endif #endif

View File

@ -10,9 +10,9 @@
*/ */
#include "all.h" #include "all.h"
#include <time.h>
#include <float.h>
#include <sys/time.h> #include <sys/time.h>
#include <time.h>
#include <xcb/randr.h> #include <xcb/randr.h>
#define SN_API_NOT_YET_FROZEN 1 #define SN_API_NOT_YET_FROZEN 1
#include <libsn/sn-monitor.h> #include <libsn/sn-monitor.h>

View File

@ -7,16 +7,19 @@
* ipc.c: UNIX domain socket IPC (initialization, client handling, protocol). * ipc.c: UNIX domain socket IPC (initialization, client handling, protocol).
* *
*/ */
#include "all.h"
#include "all.h"
#include "yajl_utils.h" #include "yajl_utils.h"
#include <ev.h>
#include <fcntl.h>
#include <libgen.h>
#include <locale.h>
#include <stdint.h> #include <stdint.h>
#include <sys/socket.h> #include <sys/socket.h>
#include <sys/un.h> #include <sys/un.h>
#include <fcntl.h> #include <unistd.h>
#include <libgen.h>
#include <ev.h>
#include <yajl/yajl_gen.h> #include <yajl/yajl_gen.h>
#include <yajl/yajl_parse.h> #include <yajl/yajl_parse.h>

View File

@ -10,10 +10,9 @@
*/ */
#include "all.h" #include "all.h"
#include <yajl/yajl_common.h> #include <locale.h>
#include <yajl/yajl_gen.h>
#include <yajl/yajl_parse.h> #include <yajl/yajl_parse.h>
#include <yajl/yajl_version.h>
/* TODO: refactor the whole parsing thing */ /* TODO: refactor the whole parsing thing */

View File

@ -9,27 +9,24 @@
*/ */
#include <config.h> #include <config.h>
#include <stdarg.h> #include "all.h"
#include <stdio.h> #include "shmlog.h"
#include <string.h>
#include <stdbool.h> #include <errno.h>
#include <stdlib.h>
#include <sys/time.h>
#include <unistd.h>
#include <fcntl.h> #include <fcntl.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/mman.h> #include <sys/mman.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <errno.h> #include <sys/time.h>
#include <unistd.h>
#if !defined(__OpenBSD__) #if !defined(__OpenBSD__)
#include <pthread.h> #include <pthread.h>
#endif #endif
#include "util.h"
#include "log.h"
#include "i3.h"
#include "libi3.h"
#include "shmlog.h"
#if defined(__APPLE__) #if defined(__APPLE__)
#include <sys/sysctl.h> #include <sys/sysctl.h>
#endif #endif

View File

@ -8,18 +8,22 @@
* *
*/ */
#include "all.h" #include "all.h"
#include "shmlog.h"
#include <ev.h> #include <ev.h>
#include <fcntl.h> #include <fcntl.h>
#include <sys/types.h> #include <getopt.h>
#include <sys/socket.h>
#include <sys/un.h>
#include <sys/time.h>
#include <sys/resource.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <libgen.h> #include <libgen.h>
#include "shmlog.h" #include <locale.h>
#include <signal.h>
#include <sys/mman.h>
#include <sys/resource.h>
#include <sys/socket.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/un.h>
#include <unistd.h>
#ifdef I3_ASAN_ENABLED #ifdef I3_ASAN_ENABLED
#include <sanitizer/lsan_interface.h> #include <sanitizer/lsan_interface.h>

View File

@ -9,10 +9,6 @@
*/ */
#include "all.h" #include "all.h"
#include "yajl_utils.h"
#include <yajl/yajl_gen.h>
/* /*
* Match frame and window depth. This is needed because X will refuse to reparent a * Match frame and window depth. This is needed because X will refuse to reparent a
* window whose background is ParentRelative under a window with a different depth. * window whose background is ParentRelative under a window with a different depth.

View File

@ -12,6 +12,7 @@
#include "all.h" #include "all.h"
#include <time.h> #include <time.h>
#include <xcb/randr.h> #include <xcb/randr.h>
/* Pointer to the result of the query for primary output */ /* Pointer to the result of the query for primary output */

View File

@ -10,6 +10,8 @@
*/ */
#include "all.h" #include "all.h"
#include <math.h>
/* Forward declarations */ /* Forward declarations */
static int *precalculate_sizes(Con *con, render_params *p); static int *precalculate_sizes(Con *con, render_params *p);
static void render_root(Con *con, Con *fullscreen); static void render_root(Con *con, Con *fullscreen);

View File

@ -28,22 +28,22 @@
#define _GNU_SOURCE #define _GNU_SOURCE
#endif #endif
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/socket.h>
#include <sys/un.h>
#include <sys/fcntl.h>
#include <netinet/in.h>
#include <stdlib.h>
#include <errno.h>
#include <unistd.h>
#include <string.h>
#include <stdarg.h>
#include <stdio.h>
#include <stddef.h>
#include "sd-daemon.h" #include "sd-daemon.h"
#include <errno.h>
#include <netinet/in.h>
#include <stdarg.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/fcntl.h>
#include <sys/socket.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/un.h>
#include <unistd.h>
int sd_listen_fds(int unset_environment) { int sd_listen_fds(int unset_environment) {
int r, fd; int r, fd;
const char *e; const char *e;

View File

@ -7,14 +7,9 @@
*/ */
#include "all.h" #include "all.h"
#include <ev.h>
#include <iconv.h>
#include <signal.h> #include <signal.h>
#include <sys/wait.h> #include <sys/wait.h>
#include <unistd.h>
#include <xcb/xcb_event.h>
#include <X11/keysym.h>
typedef struct dialog_t { typedef struct dialog_t {
xcb_window_t id; xcb_window_t id;

View File

@ -11,12 +11,12 @@
* *
*/ */
#include "all.h" #include "all.h"
#include "sd-daemon.h" #include "sd-daemon.h"
#include <paths.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/wait.h> #include <sys/wait.h>
#include <paths.h> #include <unistd.h>
#define SN_API_NOT_YET_FROZEN 1 #define SN_API_NOT_YET_FROZEN 1
#include <libsn/sn-launcher.h> #include <libsn/sn-launcher.h>

View File

@ -10,19 +10,16 @@
*/ */
#include "all.h" #include "all.h"
#include <ctype.h>
#include <fcntl.h>
#include <inttypes.h>
#include <libgen.h>
#include <locale.h>
#include <sys/wait.h> #include <sys/wait.h>
#include <stdarg.h> #include <unistd.h>
#if defined(__OpenBSD__) #if defined(__OpenBSD__)
#include <sys/cdefs.h> #include <sys/cdefs.h>
#endif #endif
#include <fcntl.h>
#include <pwd.h>
#include <yajl/yajl_version.h>
#include <libgen.h>
#include <ctype.h>
#define SN_API_NOT_YET_FROZEN 1
#include <libsn/sn-launcher.h>
int min(int a, int b) { int min(int a, int b) {
return (a < b ? a : b); return (a < b ? a : b);

View File

@ -9,6 +9,8 @@
*/ */
#include "all.h" #include "all.h"
#include <math.h>
/* /*
* Frees an i3Window and all its members. * Frees an i3Window and all its members.
* *

View File

@ -10,6 +10,8 @@
*/ */
#include "all.h" #include "all.h"
#include <unistd.h>
#ifndef MAX #ifndef MAX
#define MAX(x, y) ((x) > (y) ? (x) : (y)) #define MAX(x, y) ((x) > (y) ? (x) : (y))
#endif #endif

View File

@ -9,13 +9,12 @@
*/ */
#include <config.h> #include <config.h>
#include "all.h"
#include <assert.h> #include <assert.h>
#include <err.h> #include <err.h>
#include <xcb/xcb_cursor.h>
#include "i3.h" #include <xcb/xcb_cursor.h>
#include "xcb.h"
#include "xcursor.h"
static xcb_cursor_context_t *ctx; static xcb_cursor_context_t *ctx;
static xcb_cursor_t cursors[XCURSOR_CURSOR_MAX]; static xcb_cursor_t cursors[XCURSOR_CURSOR_MAX];

View File

@ -16,15 +16,17 @@
#include <ev.h> #include <ev.h>
#include <fcntl.h> #include <fcntl.h>
#include <sys/types.h> #include <getopt.h>
#include <sys/socket.h>
#include <sys/un.h>
#include <sys/time.h>
#include <sys/resource.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <sys/wait.h>
#include <libgen.h> #include <libgen.h>
#include <sys/mman.h>
#include <sys/resource.h>
#include <sys/socket.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/un.h>
#include <sys/wait.h>
#include <unistd.h>
static void uds_connection_cb(EV_P_ ev_io *w, int revents); 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); static void read_client_setup_request_cb(EV_P_ ev_io *w, int revents);