diff options
Diffstat (limited to 'content/handlers/html/box_inspect.h')
-rw-r--r-- | content/handlers/html/box_inspect.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/content/handlers/html/box_inspect.h b/content/handlers/html/box_inspect.h index b9161f148..a218326d8 100644 --- a/content/handlers/html/box_inspect.h +++ b/content/handlers/html/box_inspect.h @@ -139,5 +139,17 @@ static inline bool box_is_first_child(struct box *b) return (b->parent == NULL || b == b->parent->children); } +static inline unsigned box_count_children(const struct box *b) +{ + const struct box *c = b->children; + unsigned count = 0; + + while (c != NULL) { + count++; + c = c->next; + } + + return count; +} #endif |