]> git.mdlowis.com Git - proto/labwc.git/commitdiff
rcxml: simplify debugging nodenames
authorJohan Malm <jgm323@gmail.com>
Tue, 30 Mar 2021 21:40:41 +0000 (22:40 +0100)
committerJohan Malm <jgm323@gmail.com>
Tue, 30 Mar 2021 21:40:41 +0000 (22:40 +0100)
include/config/rcxml.h
src/config/rcxml.c

index 985b6530c204a2e82e62400e63e601253837b31a..69beac98064ff9c68ec136be6b776cc9732f9cbf 100644 (file)
@@ -22,6 +22,5 @@ extern struct rcxml rc;
 void rcxml_parse_xml(struct buf *b);
 void rcxml_read(const char *filename);
 void rcxml_finish(void);
-void rcxml_get_nodenames(struct buf *b);
 
 #endif /* __LABWC_RCXML_H */
index 96e4aa67280be0b2f4c61dde94050e60166ef539..71a442a448d543621fd00e97a948ccae476b3f1d 100644 (file)
@@ -22,8 +22,6 @@
 
 static bool in_keybind = false;
 static bool is_attribute = false;
-static bool write_to_nodename_buffer = false;
-static struct buf *nodename_buffer;
 static struct keybind *current_keybind;
 
 enum font_place {
@@ -113,17 +111,11 @@ entry(xmlNode *node, char *nodename, char *content)
        }
        string_truncate_at_pattern(nodename, ".openbox_config");
 
-       /* for debugging */
-       if (write_to_nodename_buffer) {
+       if (getenv("LABWC_DEBUG_CONFIG_NODENAMES")) {
                if (is_attribute) {
-                       buf_add(nodename_buffer, "@");
+                       printf("@");
                }
-               buf_add(nodename_buffer, nodename);
-               if (content) {
-                       buf_add(nodename_buffer, ": ");
-                       buf_add(nodename_buffer, content);
-               }
-               buf_add(nodename_buffer, "\n");
+               printf("%s: %s\n", nodename, content);
        }
 
        if (!content) {
@@ -355,10 +347,3 @@ rcxml_finish(void)
                zfree(k);
        }
 }
-
-void
-rcxml_get_nodenames(struct buf *b)
-{
-       write_to_nodename_buffer = true;
-       nodename_buffer = b;
-}