Got it to build.

This commit is contained in:
Scott Anderson 2017-05-13 00:22:49 +12:00
parent 46a53704ad
commit a2896f33a4
55 changed files with 822 additions and 797 deletions

View file

@ -28,10 +28,41 @@ list_t *list_new(size_t memb_size, size_t capacity);
void list_free(list_t *list);
/*
* Adds an element to the end of the list.
* Frees a list, calling a function on each element before doing so.
* If list is null, no action is taken.
* DO NOT pass free as the callback. Use list_elem_free if
* you want to do that.
*/
void list_free_with(list_t *list, void callback(void *item));
/*
* This is a convinience function designed to be used with
* list_free_with or list_foreach.
* It calls the stdlib free function on each element.
* We can't pass in free directly, as each pointer needs to be
* dereferenced first.
* This should only be used on lists of pointers that were
* allocated using malloc (or similar).
*/
void list_elem_free(void *item);
/*
* Adds an element at the end of the list.
*/
void list_add(list_t *list, const void *data);
/*
* Adds an uninitialized element at the end of the list,
* and returns a pointer to it.
*/
void *list_alloc(list_t *list);
/*
* Deletes the last element of the list.
* If the list is empty, no action is taken.
*/
void list_remove(list_t *list);
/*
* Adds an element at an arbitrary position in the list, moving
* the elements past index to make space.