diff options
author | Daniel Lezcano <daniel.lezcano@linaro.org> | 2011-06-08 23:30:01 +0200 |
---|---|---|
committer | Daniel Lezcano <daniel.lezcano@free.fr> | 2011-06-08 23:30:01 +0200 |
commit | cb86e1da685c1b6d77e82b8df43434045583a6bd (patch) | |
tree | b37764d81b8b07b3d7f7ddbe72e4f62c1ebf3261 /tree.c | |
parent | fabe20a77d38e1e91ad0b7bf396a9f63d62c397e (diff) |
compute the number of children for a specific node
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Diffstat (limited to 'tree.c')
-rw-r--r-- | tree.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -57,6 +57,7 @@ static inline struct tree *tree_alloc(const char *path, int depth) t->next = NULL; t->prev = NULL; t->private = NULL; + t->nrchild = 0; return t; } @@ -161,6 +162,8 @@ static int tree_scan(struct tree *tree, tree_filter_t filter) tree_add_child(tree, child); + tree->nrchild++; + ret = tree_scan(child, filter); } |