Implement configuration file parsing

This commit is contained in:
Michael Stapelberg
2009-02-25 00:50:30 +01:00
parent dadace2fa3
commit e77ebb6c71
7 changed files with 183 additions and 58 deletions

14
include/config.h Normal file
View File

@ -0,0 +1,14 @@
#ifndef _CONFIG_H
#define _CONFIG_H
typedef struct Config Config;
extern Config config;
struct Config {
const char *terminal;
const char *font;
};
void load_configuration(const char *configfile);
#endif

View File

@ -60,11 +60,11 @@ enum {
BIND_NONE = 0,
BIND_SHIFT = XCB_MOD_MASK_SHIFT, /* (1 << 0) */
BIND_CONTROL = XCB_MOD_MASK_CONTROL, /* (1 << 2) */
BIND_MOD_1 = XCB_MOD_MASK_1, /* (1 << 3) */
BIND_MOD_2 = XCB_MOD_MASK_2, /* (1 << 4) */
BIND_MOD_3 = XCB_MOD_MASK_3, /* (1 << 5) */
BIND_MOD_4 = XCB_MOD_MASK_4, /* (1 << 6) */
BIND_MOD_5 = XCB_MOD_MASK_5, /* (1 << 7) */
BIND_MOD1 = XCB_MOD_MASK_1, /* (1 << 3) */
BIND_MOD2 = XCB_MOD_MASK_2, /* (1 << 4) */
BIND_MOD3 = XCB_MOD_MASK_3, /* (1 << 5) */
BIND_MOD4 = XCB_MOD_MASK_4, /* (1 << 6) */
BIND_MOD5 = XCB_MOD_MASK_5, /* (1 << 7) */
BIND_MODE_SWITCH = (1 << 8)
};

View File

@ -24,7 +24,6 @@ extern Display *xkbdpy;
extern TAILQ_HEAD(bindings_head, Binding) bindings;
extern SLIST_HEAD(stack_wins_head, Stack_Window) stack_wins;
extern xcb_event_handlers_t evenths;
extern char *pattern;
extern int num_screens;
extern xcb_atom_t atoms[NUM_ATOMS];