Change the indention-style
This commit is contained in:
parent
49eef0db3f
commit
8595d3bb48
|
@ -12,8 +12,8 @@ enum {
|
|||
|
||||
xcb_atom_t atoms[NUM_ATOMS];
|
||||
|
||||
xcb_connection_t* xcb_connection;
|
||||
xcb_screen_t* xcb_screens;
|
||||
xcb_connection_t *xcb_connection;
|
||||
xcb_screen_t *xcb_screens;
|
||||
xcb_window_t xcb_root;
|
||||
xcb_font_t xcb_font;
|
||||
int font_height;
|
||||
|
|
|
@ -12,11 +12,11 @@
|
|||
#include "xcb.h"
|
||||
#include "ipc.h"
|
||||
|
||||
ev_io* i3_connection;
|
||||
ev_io *i3_connection;
|
||||
|
||||
typedef void(*handler_t)(char*);
|
||||
|
||||
int get_ipc_fd(const char* socket_path) {
|
||||
int get_ipc_fd(const char *socket_path) {
|
||||
int sockfd = socket(AF_LOCAL, SOCK_STREAM, 0);
|
||||
if (sockfd == -1) {
|
||||
printf("ERROR: Could not create Socket!\n");
|
||||
|
@ -147,7 +147,7 @@ void got_data(struct ev_loop *loop, ev_io *watcher, int events) {
|
|||
FREE(buffer);
|
||||
}
|
||||
|
||||
int i3_send_msg(uint32_t type, const char* payload) {
|
||||
int i3_send_msg(uint32_t type, const char *payload) {
|
||||
uint32_t len = 0;
|
||||
if (payload != NULL) {
|
||||
len = strlen(payload);
|
||||
|
|
|
@ -12,12 +12,12 @@
|
|||
struct outputs_json_params {
|
||||
struct outputs_head *outputs;
|
||||
i3_output *outputs_walk;
|
||||
char* cur_key;
|
||||
char* json;
|
||||
char *cur_key;
|
||||
char *json;
|
||||
};
|
||||
|
||||
static int outputs_null_cb(void* params_) {
|
||||
struct outputs_json_params* params = (struct outputs_json_params*) params_;
|
||||
static int outputs_null_cb(void *params_) {
|
||||
struct outputs_json_params *params = (struct outputs_json_params*) params_;
|
||||
|
||||
if (strcmp(params->cur_key, "current_workspace")) {
|
||||
return 0;
|
||||
|
@ -28,8 +28,8 @@ static int outputs_null_cb(void* params_) {
|
|||
return 1;
|
||||
}
|
||||
|
||||
static int outputs_boolean_cb(void* params_, bool val) {
|
||||
struct outputs_json_params* params = (struct outputs_json_params*) params_;
|
||||
static int outputs_boolean_cb(void *params_, bool val) {
|
||||
struct outputs_json_params *params = (struct outputs_json_params*) params_;
|
||||
|
||||
if (strcmp(params->cur_key, "active")) {
|
||||
return 0;
|
||||
|
@ -42,8 +42,8 @@ static int outputs_boolean_cb(void* params_, bool val) {
|
|||
return 1;
|
||||
}
|
||||
|
||||
static int outputs_integer_cb(void* params_, long val) {
|
||||
struct outputs_json_params* params = (struct outputs_json_params*) params_;
|
||||
static int outputs_integer_cb(void *params_, long val) {
|
||||
struct outputs_json_params *params = (struct outputs_json_params*) params_;
|
||||
|
||||
if (!strcmp(params->cur_key, "current_workspace")) {
|
||||
params->outputs_walk->ws = (int) val;
|
||||
|
@ -78,8 +78,8 @@ static int outputs_integer_cb(void* params_, long val) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int outputs_string_cb(void* params_, const unsigned char* val, unsigned int len) {
|
||||
struct outputs_json_params* params = (struct outputs_json_params*) params_;
|
||||
static int outputs_string_cb(void *params_, const unsigned char *val, unsigned int len) {
|
||||
struct outputs_json_params *params = (struct outputs_json_params*) params_;
|
||||
|
||||
if (strcmp(params->cur_key, "name")) {
|
||||
return 0;
|
||||
|
@ -94,8 +94,8 @@ static int outputs_string_cb(void* params_, const unsigned char* val, unsigned i
|
|||
return 1;
|
||||
}
|
||||
|
||||
static int outputs_start_map_cb(void* params_) {
|
||||
struct outputs_json_params* params = (struct outputs_json_params*) params_;
|
||||
static int outputs_start_map_cb(void *params_) {
|
||||
struct outputs_json_params *params = (struct outputs_json_params*) params_;
|
||||
i3_output *new_output = NULL;
|
||||
|
||||
if (params->cur_key == NULL) {
|
||||
|
@ -118,8 +118,8 @@ static int outputs_start_map_cb(void* params_) {
|
|||
return 1;
|
||||
}
|
||||
|
||||
static int outputs_map_key_cb(void* params_, const unsigned char* keyVal, unsigned int keyLen) {
|
||||
struct outputs_json_params* params = (struct outputs_json_params*) params_;
|
||||
static int outputs_map_key_cb(void *params_, const unsigned char *keyVal, unsigned int keyLen) {
|
||||
struct outputs_json_params *params = (struct outputs_json_params*) params_;
|
||||
FREE(params->cur_key);
|
||||
|
||||
params->cur_key = malloc(sizeof(unsigned char) * (keyLen + 1));
|
||||
|
@ -143,7 +143,7 @@ yajl_callbacks outputs_callbacks = {
|
|||
NULL
|
||||
};
|
||||
|
||||
void parse_outputs_json(char* json) {
|
||||
void parse_outputs_json(char *json) {
|
||||
/* FIXME: Fasciliate stream-processing, i.e. allow starting to interpret
|
||||
* JSON in chunks */
|
||||
struct outputs_json_params params;
|
||||
|
@ -184,7 +184,7 @@ void parse_outputs_json(char* json) {
|
|||
outputs = params.outputs;
|
||||
}
|
||||
|
||||
i3_output* get_output_by_name(char* name) {
|
||||
i3_output *get_output_by_name(char *name) {
|
||||
i3_output *walk;
|
||||
SLIST_FOREACH(walk, outputs, slist) {
|
||||
if (!strcmp(walk->name, name)) {
|
||||
|
|
|
@ -16,8 +16,8 @@ struct workspaces_json_params {
|
|||
char *json;
|
||||
};
|
||||
|
||||
static int workspaces_null_cb(void* params_) {
|
||||
struct workspaces_json_params* params = (struct workspaces_json_params*) params_;
|
||||
static int workspaces_null_cb(void *params_) {
|
||||
struct workspaces_json_params *params = (struct workspaces_json_params*) params_;
|
||||
|
||||
if (strcmp(params->cur_key, "current_workspace")) {
|
||||
return 0;
|
||||
|
@ -28,8 +28,8 @@ static int workspaces_null_cb(void* params_) {
|
|||
return 1;
|
||||
}
|
||||
|
||||
static int workspaces_boolean_cb(void* params_, bool val) {
|
||||
struct workspaces_json_params* params = (struct workspaces_json_params*) params_;
|
||||
static int workspaces_boolean_cb(void *params_, bool val) {
|
||||
struct workspaces_json_params *params = (struct workspaces_json_params*) params_;
|
||||
|
||||
if (!strcmp(params->cur_key, "visible")) {
|
||||
params->workspaces_walk->visible = val;
|
||||
|
@ -54,8 +54,8 @@ static int workspaces_boolean_cb(void* params_, bool val) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int workspaces_integer_cb(void* params_, long val) {
|
||||
struct workspaces_json_params* params = (struct workspaces_json_params*) params_;
|
||||
static int workspaces_integer_cb(void *params_, long val) {
|
||||
struct workspaces_json_params *params = (struct workspaces_json_params*) params_;
|
||||
|
||||
if (!strcmp(params->cur_key, "num")) {
|
||||
params->workspaces_walk->num = (int) val;
|
||||
|
@ -91,11 +91,11 @@ static int workspaces_integer_cb(void* params_, long val) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int workspaces_string_cb(void* params_, const unsigned char* val, unsigned int len) {
|
||||
static int workspaces_string_cb(void *params_, const unsigned char *val, unsigned int len) {
|
||||
|
||||
struct workspaces_json_params* params = (struct workspaces_json_params*) params_;
|
||||
struct workspaces_json_params *params = (struct workspaces_json_params*) params_;
|
||||
|
||||
char* output_name;
|
||||
char *output_name;
|
||||
|
||||
if (!strcmp(params->cur_key, "name")) {
|
||||
params->workspaces_walk->name = malloc(sizeof(const unsigned char) * (len + 1));
|
||||
|
@ -129,8 +129,8 @@ static int workspaces_string_cb(void* params_, const unsigned char* val, unsigne
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int workspaces_start_map_cb(void* params_) {
|
||||
struct workspaces_json_params* params = (struct workspaces_json_params*) params_;
|
||||
static int workspaces_start_map_cb(void *params_) {
|
||||
struct workspaces_json_params *params = (struct workspaces_json_params*) params_;
|
||||
|
||||
i3_ws *new_workspace = NULL;
|
||||
|
||||
|
@ -151,8 +151,8 @@ static int workspaces_start_map_cb(void* params_) {
|
|||
return 1;
|
||||
}
|
||||
|
||||
static int workspaces_map_key_cb(void* params_, const unsigned char* keyVal, unsigned int keyLen) {
|
||||
struct workspaces_json_params* params = (struct workspaces_json_params*) params_;
|
||||
static int workspaces_map_key_cb(void *params_, const unsigned char *keyVal, unsigned int keyLen) {
|
||||
struct workspaces_json_params *params = (struct workspaces_json_params*) params_;
|
||||
FREE(params->cur_key);
|
||||
|
||||
params->cur_key = malloc(sizeof(unsigned char) * (keyLen + 1));
|
||||
|
@ -180,7 +180,7 @@ yajl_callbacks workspaces_callbacks = {
|
|||
NULL
|
||||
};
|
||||
|
||||
void parse_workspaces_json(char* json) {
|
||||
void parse_workspaces_json(char *json) {
|
||||
/* FIXME: Fasciliate stream-processing, i.e. allow starting to interpret
|
||||
* JSON in chunks */
|
||||
struct workspaces_json_params params;
|
||||
|
|
|
@ -102,7 +102,7 @@ int get_string_width(char *string) {
|
|||
xcb_generic_error_t *error;
|
||||
int width;
|
||||
|
||||
cookie = xcb_query_text_extents(xcb_connection, xcb_font, strlen(string), (xcb_char2b_t *)string);
|
||||
cookie = xcb_query_text_extents(xcb_connection, xcb_font, strlen(string), (xcb_char2b_t*) string);
|
||||
if ((reply= xcb_query_text_extents_reply(xcb_connection, cookie, &error)) == NULL) {
|
||||
printf("ERROR: Could not get text extents!");
|
||||
return 7;
|
||||
|
@ -158,7 +158,7 @@ void clean_xcb() {
|
|||
}
|
||||
|
||||
void get_atoms() {
|
||||
xcb_intern_atom_reply_t* reply;
|
||||
xcb_intern_atom_reply_t *reply;
|
||||
#define ATOM_DO(name) reply = xcb_intern_atom_reply(xcb_connection, atom_cookies[name], NULL); \
|
||||
atoms[name] = reply->atom; \
|
||||
free(reply);
|
||||
|
|
Loading…
Reference in New Issue