diff options
| author | Ben Fuhrmannek | 2022-02-05 12:23:04 +0100 |
|---|---|---|
| committer | Ben Fuhrmannek | 2022-02-05 12:23:04 +0100 |
| commit | 4d4ae75f0b843e06c666ea192a912316a9e1497c (patch) | |
| tree | 11ea27f7c00b0a435d806705caa966d71db8190a /src/sp_list.c | |
| parent | 323f818a6ce33d021bc0a6d34064598917e68c91 (diff) | |
sp_list length
Diffstat (limited to 'src/sp_list.c')
| -rw-r--r-- | src/sp_list.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/sp_list.c b/src/sp_list.c index 92e628d..ab752f7 100644 --- a/src/sp_list.c +++ b/src/sp_list.c | |||
| @@ -75,3 +75,9 @@ sp_list_node *sp_list_prepend(sp_list_node *list, void *data) { | |||
| 75 | new->data = data; | 75 | new->data = data; |
| 76 | return new; | 76 | return new; |
| 77 | } | 77 | } |
| 78 | |||
| 79 | size_t sp_list_len(sp_list_node *p) { | ||
| 80 | size_t num = 0; | ||
| 81 | for (; p; p = p->next) { num++; } | ||
| 82 | return num; | ||
| 83 | } | ||
