diff options
Diffstat (limited to 'src/list.h')
-rw-r--r-- | src/list.h | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -17,7 +17,7 @@ List *new_list(); /* add an element to the end of the list */ /* upon failure return non-zero */ -unsigned char add_to_list(List *ls, void *element); +BOOL add_to_list(List *ls, void *element); /* pop an element from the end of the list, and return that element */ /* upon failure return NULL */ @@ -43,23 +43,23 @@ typedef void *(*copyer)(void *); void *copy_num(void *); /* upon failure return 1 */ -unsigned char copy_list(List *dest, List *source, copyer copyf); +BOOL copy_list(List *dest, List *source, copyer copyf); -void *list_nth(List *ls, NUM n); +void *list_nth(const List * const ls, NUM n); -NUM list_length(List *ls); +NUM list_length(const List * const restrict ls); /* Make sure the list has at least SIZE slots to use. This should only be used to create fixed capacity arrays, otherwise we risk frequently re-allocating and hence losing performance. */ /* Upon failure return non-zero. */ -unsigned char list_assure_size(List *ls, NUM size); +BOOL list_assure_size(List *ls, NUM size); /* This is mainly used to set the length of a sparse list, since only when dealing with sparse lists do we not need to care about the elements. */ /* Upon failure return non-zero. */ -unsigned char list_set_length(List *ls, NUM len); +BOOL list_set_length(List *ls, NUM len); /* Convert a list to an array. @@ -79,7 +79,7 @@ List *array_to_list(void ** array, NUM size); /* destroy the list: If ALL_FREE_P is 1, this frees every void pointers contained in the list; if it is 2, this frees the first pointer. In any case, the list is de-allocated. */ -void destroy_list(List *ls, unsigned char all_free_p); +void destroy_list(List *ls, BOOL all_free_p); void destroy_list_free_all(void *ls); void destroy_list_free_first(void *ls); |