diff options
Diffstat (limited to 'src/symlist.c')
-rw-r--r-- | src/symlist.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/symlist.c b/src/symlist.c index 4ae5f017..bdb965d3 100644 --- a/src/symlist.c +++ b/src/symlist.c @@ -64,6 +64,20 @@ symbol_list_free (symbol_list_t *list) } +/*--------------------. +| Return its length. | +`--------------------*/ + +unsigned int +symbol_list_length (symbol_list_t *list) +{ + int res = 0; + for (/* Nothing. */; list; list = list->next) + ++res; + return res; +} + + /*--------------------------------------------------------------. | Get the data type (alternative in the union) of the value for | | symbol N in rule RULE. | |