-/* Update back ptrs, etc, as required.
- * May return pointer to parent. */
-static struct tal_hdr *remove_node(struct tal_hdr *t)
-{
- struct prop_hdr **prop;
- struct tal_hdr *prev;
-
- /* Loop around to find previous node. */
- for (prev = t->next; prev->next != t; prev = prev->next);
-
- /* Unlink ourselves. */
- prev->next = t->next;
-
- /* Are we the node with the group property? */
- prop = find_property_ptr(t, GROUP);
- if (prop) {
- struct group *group = (struct group *)*prop;
-
- /* Are we the only one? */
- if (prev == t) {
- struct prop_hdr *next = (*prop)->next;
- struct children *c = group->parent_child;
- /* Is this the group embedded in the child property? */
- if (group == &c->group) {
- group->first_child = NULL;
- } else {
- /* Empty group, so free it. */
- list_del_from(&c->group.list, &group->list.n);
- freefn(group);
- }
- *prop = next;
- return c->parent;
- } else {
- /* Move property to next node. */
- group->first_child = t->next;
-
- *prop = group->hdr.next;
- group->hdr.next = t->next->prop;
- t->next->prop = &group->hdr;
- }
- }
- return NULL;
-}
-