diff options
author | Wilmer van der Gaast <wilmer@gaast.net> | 2010-08-12 23:44:56 +0100 |
---|---|---|
committer | Wilmer van der Gaast <wilmer@gaast.net> | 2010-08-12 23:44:56 +0100 |
commit | b46769d05371e501800a4658a0faf82c4ccdb0dd (patch) | |
tree | 59958fdff715c3b8b4700e0dc813e6d6dffb8ff8 /lib/xmltree.c | |
parent | be7a180689ba5dc2b1cd1dc14f55c59246e238ed (diff) |
Some syntax checking fixups; don't make the same mistake of failing just if
the MSN server is sending a little bit *more* info.
And adding xt_insert_node() used in the ADL generation code.
Diffstat (limited to 'lib/xmltree.c')
-rw-r--r-- | lib/xmltree.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/xmltree.c b/lib/xmltree.c index b0a945ce..00b37ae6 100644 --- a/lib/xmltree.c +++ b/lib/xmltree.c @@ -549,6 +549,26 @@ void xt_add_child( struct xt_node *parent, struct xt_node *child ) } } +/* Same, but at the beginning. */ +void xt_insert_child( struct xt_node *parent, struct xt_node *child ) +{ + struct xt_node *node, *last; + + for( node = child; node; node = node->next ) + { + if( node->parent != NULL ) + { + /* ERROR CONDITION: They seem to have a parent already??? */ + } + + node->parent = parent; + last = node; + } + + last->next = parent->children; + parent->children = child; +} + void xt_add_attr( struct xt_node *node, const char *key, const char *value ) { int i; |