diff options
| author | Sri Mohana Singamsetty <srimohans@gmail.com> | 2019-05-17 11:39:27 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-05-17 11:39:27 -0700 |
| commit | 7cfaf4b3394de78bc1a48b22d84f118a80f88b98 (patch) | |
| tree | 87ddfdf3ed07c95ca01c470b49dfaa46b26ea2ce /lib/linklist.h | |
| parent | 02f4c3ab5b33f5f17b592ef7787797a0e43d0785 (diff) | |
| parent | 53ca01e52c487954f68ab7a76f163cf465fb9209 (diff) | |
Merge pull request #4168 from qlyoung/vrrp
VRRP
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 c30d8d314a..c2b289596d 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. |
