diff options
Diffstat (limited to 'lib/linklist.h')
| -rw-r--r-- | lib/linklist.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/linklist.h b/lib/linklist.h index 8761bc3d16..da42aa2688 100644 --- a/lib/linklist.h +++ b/lib/linklist.h @@ -240,6 +240,26 @@ extern void list_sort(struct list *list, int (*cmp)(const void **, const void **)); /* + * Convert a list to an array of void pointers. + * + * Starts from the list head and ends either on the last node of the list or + * when the provided array cannot store any more elements. + * + * list + * list to convert + * + * arr + * Pre-allocated array of void * + * + * arrlen + * Number of elements in arr + * + * Returns: + * arr + */ +void **list_to_array(struct list *list, void **arr, size_t arrlen); + +/* * Delete a list and NULL its pointer. * * If non-null, list->del is called with each data element. |
