Пример #1
0
static MuContainer*
prune_empty_containers (MuContainer *root_set)
{
	MuContainer *cur;

	mu_container_foreach (root_set,
			      (MuContainerForeachFunc)prune_maybe,
			      NULL);

	/* and prune the root_set itself... */
	for (cur = root_set; cur; cur = cur->next) {

		if (cur->flags & MU_CONTAINER_FLAG_DELETE)
			root_set = mu_container_remove_sibling (root_set, cur);

		else if (cur->flags & MU_CONTAINER_FLAG_SPLICE) {
			MuContainer *newchild;
			newchild = cur->child;
			cur->child = NULL;
			root_set = mu_container_append_siblings (root_set,
								 newchild);
		}
	}

	return root_set;
}
Пример #2
0
MuContainer*
mu_container_remove_child (MuContainer *c, MuContainer *child)
{
	g_return_val_if_fail (c, NULL);
	g_return_val_if_fail (child, NULL);

	/* g_assert (!child->child); */
	/* g_return_val_if_fail (!child->child, NULL); */
	g_return_val_if_fail (c != child, NULL);

	c->child = mu_container_remove_sibling (c->child, child);

	return c;
}