From 178ddc47d0823a5b246e1db8e4698f103e4b01b9 Mon Sep 17 00:00:00 2001 From: tokyo4j Date: Mon, 4 Aug 2025 12:54:29 +0900 Subject: [PATCH] Make append_actions() public Also rename it to append_parsed_actions() --- include/config/rcxml.h | 7 +++++++ src/config/rcxml.c | 18 ++++++++---------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/include/config/rcxml.h b/include/config/rcxml.h index 05f75098..14a53ed6 100644 --- a/include/config/rcxml.h +++ b/include/config/rcxml.h @@ -5,6 +5,7 @@ #include #include #include +#include #include "common/border.h" #include "common/buf.h" @@ -195,4 +196,10 @@ void rcxml_parse_xml(struct buf *b); void rcxml_read(const char *filename); void rcxml_finish(void); +/* + * Parse the child nodes and append them to the list. + * FIXME: move this function to somewhere else. + */ +void append_parsed_actions(xmlNode *node, struct wl_list *list); + #endif /* LABWC_RCXML_H */ diff --git a/src/config/rcxml.c b/src/config/rcxml.c index f545a9ef..85d3230e 100644 --- a/src/config/rcxml.c +++ b/src/config/rcxml.c @@ -253,8 +253,6 @@ set_property(const char *str, enum property *variable) *variable = ret ? LAB_PROP_TRUE : LAB_PROP_FALSE; } -static void append_actions(xmlNode *node, struct wl_list *list); - static void fill_window_rule(xmlNode *node) { @@ -315,7 +313,7 @@ fill_window_rule(xmlNode *node) } } - append_actions(node, &window_rule->actions); + append_parsed_actions(node, &window_rule->actions); } static void @@ -481,7 +479,7 @@ parse_action_args(xmlNode *node, struct action *action) action_arg_add_actionlist(action, "then"); actions = action_get_actionlist(action, "then"); } - append_actions(child, actions); + append_parsed_actions(child, actions); } else if (!strcasecmp(key, "else")) { struct wl_list *actions = action_get_actionlist(action, "else"); @@ -489,7 +487,7 @@ parse_action_args(xmlNode *node, struct action *action) action_arg_add_actionlist(action, "else"); actions = action_get_actionlist(action, "else"); } - append_actions(child, actions); + append_parsed_actions(child, actions); } else if (!strcasecmp(key, "none")) { struct wl_list *actions = action_get_actionlist(action, "none"); @@ -497,7 +495,7 @@ parse_action_args(xmlNode *node, struct action *action) action_arg_add_actionlist(action, "none"); actions = action_get_actionlist(action, "none"); } - append_actions(child, actions); + append_parsed_actions(child, actions); } else if (!strcasecmp(key, "name")) { /* Ignore */ } else if (lab_xml_node_is_leaf(child)) { @@ -529,8 +527,8 @@ parse_action(xmlNode *node) return action; } -static void -append_actions(xmlNode *node, struct wl_list *list) +void +append_parsed_actions(xmlNode *node, struct wl_list *list) { xmlNode *child; char *key, *content; @@ -575,7 +573,7 @@ fill_keybind(xmlNode *node) lab_xml_get_bool(node, "layoutDependent", &keybind->use_syms_only); lab_xml_get_bool(node, "allowWhenLocked", &keybind->allow_when_locked); - append_actions(node, &keybind->actions); + append_parsed_actions(node, &keybind->actions); } static void @@ -607,7 +605,7 @@ fill_mousebind(xmlNode *node, const char *context) mousebind->mouse_event = mousebind_event_from_str(buf); } - append_actions(node, &mousebind->actions); + append_parsed_actions(node, &mousebind->actions); } static void