summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOrestis Floros <orestisflo@gmail.com>2020-01-25 16:26:54 +0100
committerOrestis Floros <orestisflo@gmail.com>2020-02-01 17:33:53 +0100
commitd14e59b3a766b17ade2d09afcb5c5d572d85a20c (patch)
treeec4a9882d4322cdca2b6ccb7031fd17a0fa1e293
parente9f011397a508b4e3d75fd5fb46e06a87d84348e (diff)
downloadi3-d14e59b3a766b17ade2d09afcb5c5d572d85a20c.tar.gz
i3-d14e59b3a766b17ade2d09afcb5c5d572d85a20c.zip
i3bar: Make header declarations extern
See #3914
-rw-r--r--i3bar/include/common.h6
-rw-r--r--i3bar/include/configuration.h2
-rw-r--r--i3bar/include/outputs.h2
-rw-r--r--i3bar/include/xcb.h2
-rw-r--r--i3bar/src/config.c1
-rw-r--r--i3bar/src/main.c2
-rw-r--r--i3bar/src/outputs.c1
-rw-r--r--i3bar/src/xcb.c3
8 files changed, 13 insertions, 6 deletions
diff --git a/i3bar/include/common.h b/i3bar/include/common.h
index fe7444a3..222f42dd 100644
--- a/i3bar/include/common.h
+++ b/i3bar/include/common.h
@@ -17,7 +17,7 @@
typedef struct rect_t rect;
-struct ev_loop *main_loop;
+extern struct ev_loop *main_loop;
struct rect_t {
int x;
@@ -82,8 +82,8 @@ struct status_block {
blocks;
};
-TAILQ_HEAD(statusline_head, status_block)
-statusline_head;
+extern TAILQ_HEAD(statusline_head, status_block)
+ statusline_head;
#include "child.h"
#include "ipc.h"
diff --git a/i3bar/include/configuration.h b/i3bar/include/configuration.h
index aeb7db19..70167247 100644
--- a/i3bar/include/configuration.h
+++ b/i3bar/include/configuration.h
@@ -74,7 +74,7 @@ typedef struct config_t {
S_SHOW = 1 } hidden_state;
} config_t;
-config_t config;
+extern config_t config;
/**
* Start parsing the received bar configuration JSON string
diff --git a/i3bar/include/outputs.h b/i3bar/include/outputs.h
index 29a7bcd3..5bb19c40 100644
--- a/i3bar/include/outputs.h
+++ b/i3bar/include/outputs.h
@@ -19,7 +19,7 @@
typedef struct i3_output i3_output;
SLIST_HEAD(outputs_head, i3_output);
-struct outputs_head* outputs;
+extern struct outputs_head* outputs;
/*
* Start parsing the received JSON string
diff --git a/i3bar/include/xcb.h b/i3bar/include/xcb.h
index 760ebcdb..0e3ca22d 100644
--- a/i3bar/include/xcb.h
+++ b/i3bar/include/xcb.h
@@ -53,7 +53,7 @@ struct xcb_color_strings_t {
typedef struct xcb_colors_t xcb_colors_t;
/* Cached width of the custom separator if one was set */
-int separator_symbol_width;
+extern int separator_symbol_width;
/*
* Early initialization of the connection to X11: Everything which does not
diff --git a/i3bar/src/config.c b/i3bar/src/config.c
index 26004071..29b0908b 100644
--- a/i3bar/src/config.c
+++ b/i3bar/src/config.c
@@ -19,6 +19,7 @@
#include <X11/Xlib.h>
+config_t config;
static char *cur_key;
static bool parsing_bindings;
static bool parsing_tray_outputs;
diff --git a/i3bar/src/main.c b/i3bar/src/main.c
index aa6bdbea..65cb00ff 100644
--- a/i3bar/src/main.c
+++ b/i3bar/src/main.c
@@ -17,6 +17,8 @@
#include <getopt.h>
#include <glob.h>
+struct ev_loop *main_loop;
+
/*
* Having verboselog(), errorlog() and debuglog() is necessary when using libi3.
*
diff --git a/i3bar/src/outputs.c b/i3bar/src/outputs.c
index 4c9ce651..2fa3195c 100644
--- a/i3bar/src/outputs.c
+++ b/i3bar/src/outputs.c
@@ -252,6 +252,7 @@ static yajl_callbacks outputs_callbacks = {
.yajl_end_map = outputs_end_map_cb,
};
+struct outputs_head *outputs;
/*
* Initiate the outputs list
*
diff --git a/i3bar/src/xcb.c b/i3bar/src/xcb.c
index 6b135e44..7b97beea 100644
--- a/i3bar/src/xcb.c
+++ b/i3bar/src/xcb.c
@@ -140,6 +140,9 @@ static const int tray_loff_px = 2;
/* Vertical offset between the bar and a separator */
static const int sep_voff_px = 4;
+/* Cached width of the custom separator if one was set */
+int separator_symbol_width;
+
int _xcb_request_failed(xcb_void_cookie_t cookie, char *err_msg, int line) {
xcb_generic_error_t *err;
if ((err = xcb_request_check(xcb_connection, cookie)) != NULL) {