Index: src/hid_cfg.c =================================================================== --- src/hid_cfg.c (revision 1460) +++ src/hid_cfg.c (revision 1461) @@ -37,7 +37,7 @@ lht_node_t *resource_create_menu(hid_cfg_t *hr, const char *name, const char *action, const char *mnemonic, const char *accel, const char *tip, int flags) { - /* TODO */ +#warning TODO abort(); } @@ -107,20 +107,25 @@ return hr; } -void hid_cfg_action(const lht_node_t *node) +int hid_cfg_action(const lht_node_t *node) { if (node == NULL) - return; + return -1; switch(node->type) { case LHT_TEXT: - hid_parse_actions(node->data.text.value); - break; + return hid_parse_actions(node->data.text.value); case LHT_LIST: - for(node = node->data.list.first; node != NULL; node = node->next) - if (node->type == LHT_TEXT) - hid_parse_actions(node->data.text.value); - break; + for(node = node->data.list.first; node != NULL; node = node->next) { + if (node->type == LHT_TEXT) { + if (hid_parse_actions(node->data.text.value) != 0) + return -1; + } + else + return -1; + } + return 0; } + return -1; } /************* "parsing" **************/ Index: src/hid_cfg.h =================================================================== --- src/hid_cfg.h (revision 1460) +++ src/hid_cfg.h (revision 1461) @@ -74,8 +74,9 @@ there is a submenu field with the wrong lihata type */ int hid_cfg_has_submenus(const lht_node_t *submenu); -/* Run an action node. The node is either a list of text nodes or a text node */ -void hid_cfg_action(const lht_node_t *node); +/* Run an action node. The node is either a list of text nodes or a text node; + returns non-zero on error, the first action that fails in a chain breaks the chain */ +int hid_cfg_action(const lht_node_t *node); /* Create a new hash node under parent (optional) and create a flat subtree of text nodes from name,value varargs (NULL terminated). This is a shorthand Index: src/hid_cfg_input.c =================================================================== --- src/hid_cfg_input.c (revision 1460) +++ src/hid_cfg_input.c (revision 1461) @@ -354,7 +354,5 @@ if (seq_len < 1) return -1; - hid_cfg_action(seq[seq_len-1]->action_node); -#warning TODO: - return 0; + return hid_cfg_action(seq[seq_len-1]->action_node); }