diff options
author | David Gibson <dgibson@sneetch.(none)> | 2005-10-21 17:26:45 +1000 |
---|---|---|
committer | David Gibson <dgibson@sneetch.(none)> | 2005-10-21 17:26:45 +1000 |
commit | 740a19a81905ff04710f4a154c0c9277e72d7c74 (patch) | |
tree | 6066d95d1720623d4d0ec7bd84c2c99dbfa46bd9 /livetree.c | |
parent | cba839c728b95e97d05b228bfe12ffecfae39734 (diff) | |
download | dtc-740a19a81905ff04710f4a154c0c9277e72d7c74.zip dtc-740a19a81905ff04710f4a154c0c9277e72d7c74.tar.gz dtc-740a19a81905ff04710f4a154c0c9277e72d7c74.tar.bz2 |
Alter add_property() and add_child() functiosn to add to the end of their
respective linked lists. This means we no longer reverse the order or
properties and subnodes when in blob or fs input modes.
Diffstat (limited to 'livetree.c')
-rw-r--r-- | livetree.c | 20 |
1 files changed, 18 insertions, 2 deletions
@@ -84,12 +84,28 @@ struct node *chain_node(struct node *first, struct node *list) void add_property(struct node *node, struct property *prop) { - node->proplist = chain_property(prop, node->proplist); + struct property **p; + + prop->next = NULL; + + p = &node->proplist; + while (*p) + p = &((*p)->next); + + *p = prop; } void add_child(struct node *parent, struct node *child) { - parent->children = chain_node(child, parent->children); + struct node **p; + + child->next_sibling = NULL; + + p = &parent->children; + while (*p) + p = &((*p)->next_sibling); + + *p = child; } |