commit 2cf4e93255e43082e777d1844cd711c5a93e3658
parent 68ac4aaed2c5ab24097f10e3c02a15e9afc14c4e
Author: Bastien Dejean <nihilhill@gmail.com>
Date: Tue, 8 Oct 2013 21:17:37 +0200
Generate header function prototypes from .c
Diffstat:
7 files changed, 42 insertions(+), 40 deletions(-)
diff --git a/grab.h b/grab.h
@@ -28,9 +28,9 @@
#include "sxhkd.h"
void grab(void);
-void grab_chord(chord_t *);
-void grab_key_button(xcb_keycode_t, xcb_button_t, uint16_t);
-void grab_key_button_checked(xcb_keycode_t, xcb_button_t, uint16_t);
+void grab_chord(chord_t *chord);
+void grab_key_button(xcb_keycode_t keycode, xcb_button_t button, uint16_t modfield);
+void grab_key_button_checked(xcb_keycode_t keycode, xcb_button_t button, uint16_t modfield);
void ungrab(void);
#endif
diff --git a/helpers.h b/helpers.h
@@ -36,12 +36,12 @@
# define PRINTF(x,...) ((void)0)
#endif
-void warn(char *, ...);
+void warn(char *fmt, ...);
__attribute__((noreturn))
-void err(char *, ...);
-void spawn(char *[]);
-void run(char *);
-char *lgraph(char *);
-char *rgraph(char *);
+void err(char *fmt, ...);
+void spawn(char *cmd[]);
+void run(char *command);
+char *lgraph(char *s);
+char *rgraph(char *s);
#endif
diff --git a/parse.c b/parse.c
@@ -2408,7 +2408,8 @@ void load_config(char *config_file)
fclose(cfg);
}
-void parse_event(xcb_generic_event_t *evt, uint8_t event_type, xcb_keysym_t *keysym, xcb_button_t *button, uint16_t *modfield) {
+void parse_event(xcb_generic_event_t *evt, uint8_t event_type, xcb_keysym_t *keysym, xcb_button_t *button, uint16_t *modfield)
+{
if (event_type == XCB_KEY_PRESS) {
xcb_key_press_event_t *e = (xcb_key_press_event_t *) evt;
xcb_keycode_t keycode = e->detail;
diff --git a/parse.h b/parse.h
@@ -55,24 +55,24 @@ struct chunk_t {
xcb_keysym_t Alt_L, Alt_R, Super_L, Super_R, Hyper_L, Hyper_R,
Meta_L, Meta_R, Mode_switch, Num_Lock, Scroll_Lock;
-void load_config(char *);
-void parse_event(xcb_generic_event_t *, uint8_t, xcb_keysym_t *, xcb_button_t *, uint16_t *);
-void process_hotkey(char *, char *);
-void render_next(chunk_t *, char *);
-chunk_t *extract_chunks(char *);
-char *get_token(char *, char *, char *, char *);
+void load_config(char *config_file);
+void parse_event(xcb_generic_event_t *evt, uint8_t event_type, xcb_keysym_t *keysym, xcb_button_t *button, uint16_t *modfield);
+void process_hotkey(char *hotkey_string, char *command_string);
+char *get_token(char *dst, char *ign, char *src, char *sep);
+void render_next(chunk_t *chunks, char *dest);
+chunk_t *extract_chunks(char *s);
chunk_t *make_chunk(void);
-void destroy_chunks(chunk_t *);
-bool parse_chain(char *, chain_t *);
-bool parse_keysym(char *, xcb_keysym_t *);
-bool parse_button(char *, xcb_button_t *);
-bool parse_modifier(char *, uint16_t *);
-bool parse_fold(char *, char *);
-uint8_t key_to_button(uint8_t);
+void destroy_chunks(chunk_t *chunk);
+bool parse_chain(char *string, chain_t *chain);
+bool parse_keysym(char *name, xcb_keysym_t *keysym);
+bool parse_button(char *name, xcb_button_t *butidx);
+bool parse_modifier(char *name, uint16_t *modfield);
+bool parse_fold(char *string, char *folded_string);
+uint8_t key_to_button(uint8_t event_type);
void get_standard_keysyms(void);
void get_lock_fields(void);
-int16_t modfield_from_keysym(xcb_keysym_t);
+int16_t modfield_from_keysym(xcb_keysym_t keysym);
int16_t modfield_from_keycode(xcb_keycode_t keycode);
-xcb_keycode_t *keycodes_from_keysym(xcb_keysym_t);
+xcb_keycode_t *keycodes_from_keysym(xcb_keysym_t keysym);
#endif
diff --git a/sxhkd.h b/sxhkd.h
@@ -63,13 +63,13 @@ uint16_t num_lock;
uint16_t caps_lock;
uint16_t scroll_lock;
-void key_button_event(xcb_generic_event_t *, uint8_t);
-void motion_notify(xcb_generic_event_t *, uint8_t);
-void mapping_notify(xcb_generic_event_t *);
+void key_button_event(xcb_generic_event_t *evt, uint8_t event_type);
+void motion_notify(xcb_generic_event_t *evt, uint8_t event_type);
+void mapping_notify(xcb_generic_event_t *evt);
void setup(void);
void cleanup(void);
void reload_cmd(void);
-void hold(int);
-void put_status(char, char *);
+void hold(int sig);
+void put_status(char c, char *s);
#endif
diff --git a/types.c b/types.c
@@ -96,7 +96,8 @@ hotkey_t *find_hotkey(xcb_keysym_t keysym, xcb_button_t button, uint16_t modfiel
return NULL;
}
-bool match_chord(chord_t *chord, uint8_t event_type, xcb_keysym_t keysym, xcb_button_t button, uint16_t modfield) {
+bool match_chord(chord_t *chord, uint8_t event_type, xcb_keysym_t keysym, xcb_button_t button, uint16_t modfield)
+{
for (chord_t *c = chord; c != NULL; c = c->more)
if (c->event_type == event_type && c->keysym == keysym && c->button == button && c->modfield == modfield)
return true;
diff --git a/types.h b/types.h
@@ -74,16 +74,16 @@ typedef struct {
xcb_keysym_t Alt_L, Alt_R, Super_L, Super_R, Hyper_L, Hyper_R,
Meta_L, Meta_R, Mode_switch, Num_Lock, Scroll_Lock;
-chord_t *make_chord(xcb_keysym_t, xcb_button_t, uint16_t, uint8_t, bool, bool);
+hotkey_t *find_hotkey(xcb_keysym_t keysym, xcb_button_t button, uint16_t modfield, uint8_t event_type, bool *replay_event);
+bool match_chord(chord_t *chord, uint8_t event_type, xcb_keysym_t keysym, xcb_button_t button, uint16_t modfield);
+chord_t *make_chord(xcb_keysym_t keysym, xcb_button_t button, uint16_t modfield, uint8_t event_type, bool replay_event, bool lock_chain);
+void add_chord(chain_t *chain, chord_t *chord);
chain_t *make_chain(void);
-cycle_t *make_cycle(int, int);
-void add_chord(chain_t *, chord_t *);
-bool match_chord(chord_t *, uint8_t, xcb_keysym_t, xcb_button_t, uint16_t);
-hotkey_t *find_hotkey(xcb_keysym_t, xcb_button_t, uint16_t, uint8_t, bool *);
-hotkey_t *make_hotkey(chain_t *, char *);
-void add_hotkey(hotkey_t *);
+cycle_t *make_cycle(int delay, int period);
+hotkey_t *make_hotkey(chain_t *chain, char *command);
+void add_hotkey(hotkey_t *hk);
void abort_chain(void);
-void destroy_chain(chain_t *);
-void destroy_chord(chord_t *);
+void destroy_chain(chain_t *chain);
+void destroy_chord(chord_t *chord);
#endif