summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPatrick McDermott <pj@pehjota.net>2017-10-25 09:40:35 (EDT)
committer Patrick McDermott <pj@pehjota.net>2017-10-25 09:40:35 (EDT)
commit6f05aac3da050ce0fe3fd23605d0dd8faac36ac8 (patch)
treec63304cd1b14bb62e28abe6ca2a0ef8ae96be07e /src
parent1cdb6e30f0feebc06d4e8afcaefa9a8a900bdb89 (diff)
downloadmarquee-6f05aac3da050ce0fe3fd23605d0dd8faac36ac8.zip
marquee-6f05aac3da050ce0fe3fd23605d0dd8faac36ac8.tar.gz
marquee-6f05aac3da050ce0fe3fd23605d0dd8faac36ac8.tar.bz2
mq_tree_remove(): New macro
Diffstat (limited to 'src')
-rw-r--r--src/tree.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/tree.h b/src/tree.h
index 656b2d4..6c4731a 100644
--- a/src/tree.h
+++ b/src/tree.h
@@ -63,6 +63,11 @@ mq_tree_remove_allocated(MqTree *node);
mq_tree_append_child_allocated(g_new0(MqTree, 1), parent, data)
#define mq_tree_append_sibling(sibling, data) \
mq_tree_append_sibling_allocated(g_new0(MqTree, 1), sibling, data)
+#define mq_tree_remove(node) \
+ G_STMT_START { \
+ mq_tree_remove_allocated(node); \
+ g_free(node); \
+ } G_STMT_END
#define mq_tree_size(node) ((node) ? (((MqTree *) (node))->size) : -1)
#define mq_tree_position(node) ((node) ? (((MqTree *) (node))->position) : -1)