diff -r 710f3ced8934 -r 5b0aeef8ba2a project_files/frontlib/util/list.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/project_files/frontlib/util/list.h Thu Jun 21 21:32:12 2012 +0200 @@ -0,0 +1,24 @@ +/** + * Simple dynamic array manipulation functions. + */ + +#ifndef LIST_H_ +#define LIST_H_ + +#include + +/** + * Insert element into the list and increase listSize. + * Returns a pointer to the modified list on success, NULL on failure. On success, the old + * pointer is no longer valid, and on failure the list remains unchanged (similar to realloc) + */ +void *flib_list_insert(void *list, int *listSizePtr, size_t elementSize, void *elementPtr, int pos); + +/** + * Remove an element from the list and decrease listSize. + * Returns a pointer to the modified list on success, NULL on failure. On success, the old + * pointer is no longer valid, and on failure the list remains unchanged (similar to realloc) + */ +void *flib_list_delete(void *list, int *listSizePtr, size_t elementSize, int pos); + +#endif /* LIST_H_ */