* parse_file().
*
*/
-static void parse_configuration(const char *override_configpath) {
+bool parse_configuration(const char *override_configpath, bool use_nagbar) {
char *path = get_config_path(override_configpath);
LOG("Parsing configfile %s\n", path);
FREE(current_configpath);
current_configpath = path;
- parse_file(path);
+
+ /* initialize default bindings if we're just validating the config file */
+ if (!use_nagbar && bindings == NULL) {
+ bindings = scalloc(sizeof(struct bindings_head));
+ TAILQ_INIT(bindings);
+ }
+
+ return parse_file(path, use_nagbar);
}
/*
while (!TAILQ_EMPTY(bindings)) {
bind = TAILQ_FIRST(bindings);
TAILQ_REMOVE(bindings, bind, bindings);
- FREE(bind->translated_to);
- FREE(bind->command);
- FREE(bind);
+ binding_free(bind);
}
FREE(bindings);
SLIST_REMOVE(&modes, mode, Mode, modes);
if (config.workspace_urgency_timer == 0)
config.workspace_urgency_timer = 0.5;
- parse_configuration(override_configpath);
+ parse_configuration(override_configpath, true);
if (reload) {
translate_keysyms();