diff options
Diffstat (limited to 'src/xml/xml.c')
-rw-r--r-- | src/xml/xml.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/xml/xml.c b/src/xml/xml.c index ee3c879..7f101ee 100644 --- a/src/xml/xml.c +++ b/src/xml/xml.c @@ -58,3 +58,15 @@ char *kai_tag_attr_to_dup(struct kai_tag_t *t, const char *attr) return strdup(val); } } + + +int kai_tag_num_children(struct kai_tag_t *t) +{ + int count = 0; + struct kai_tag_t *child = t->children; + while (child != NULL) { + count += 1; + child = child->next; + } + return count; +} |