From 6f05aac3da050ce0fe3fd23605d0dd8faac36ac8 Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Wed, 25 Oct 2017 09:40:35 -0400 Subject: mq_tree_remove(): New macro --- (limited to 'src') 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) -- cgit v0.9.1