project_files/frontlib/util/list.h
changeset 7269 5b0aeef8ba2a
child 7275 15f722e0b96f
--- /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 <stddef.h>
+
+/**
+ * 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_ */