diff options
author | Ryan Dwyer <RyanDwyer@users.noreply.github.com> | 2018-12-09 21:50:19 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-09 21:50:19 +1000 |
commit | b61a936c8060bc4ac4320a5f76fd98b5042e5e41 (patch) | |
tree | 279a5554686d6e862282c943bda50787b69711e1 /include/list.h | |
parent | Merge pull request #3264 from ianyfan/resize-list (diff) | |
parent | list.c: rename free_flat_list to list_free_items_and_destroy (diff) | |
download | sway-b61a936c8060bc4ac4320a5f76fd98b5042e5e41.tar.gz sway-b61a936c8060bc4ac4320a5f76fd98b5042e5e41.tar.zst sway-b61a936c8060bc4ac4320a5f76fd98b5042e5e41.zip |
Merge pull request #3271 from ianyfan/list-cleanup
list.c: Remove list_foreach
Diffstat (limited to 'include/list.h')
-rw-r--r-- | include/list.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/include/list.h b/include/list.h index 03851a82..895f6cc0 100644 --- a/include/list.h +++ b/include/list.h | |||
@@ -9,7 +9,6 @@ typedef struct { | |||
9 | 9 | ||
10 | list_t *create_list(void); | 10 | list_t *create_list(void); |
11 | void list_free(list_t *list); | 11 | void list_free(list_t *list); |
12 | void list_foreach(list_t *list, void (*callback)(void* item)); | ||
13 | void list_add(list_t *list, void *item); | 12 | void list_add(list_t *list, void *item); |
14 | void list_insert(list_t *list, int index, void *item); | 13 | void list_insert(list_t *list, int index, void *item); |
15 | void list_del(list_t *list, int index); | 14 | void list_del(list_t *list, int index); |
@@ -27,4 +26,10 @@ void list_stable_sort(list_t *list, int compare(const void *a, const void *b)); | |||
27 | void list_swap(list_t *list, int src, int dest); | 26 | void list_swap(list_t *list, int src, int dest); |
28 | // move item to end of list | 27 | // move item to end of list |
29 | void list_move_to_end(list_t *list, void *item); | 28 | void list_move_to_end(list_t *list, void *item); |
29 | |||
30 | /* Calls `free` for each item in the list, then frees the list. | ||
31 | * Do not use this to free lists of primitives or items that require more | ||
32 | * complicated deallocation code. | ||
33 | */ | ||
34 | void list_free_items_and_destroy(list_t *list); | ||
30 | #endif | 35 | #endif |