project_files/frontlib/util/list.h
changeset 7269 5b0aeef8ba2a
child 7275 15f722e0b96f
equal deleted inserted replaced
7267:710f3ced8934 7269:5b0aeef8ba2a
       
     1 /**
       
     2  * Simple dynamic array manipulation functions.
       
     3  */
       
     4 
       
     5 #ifndef LIST_H_
       
     6 #define LIST_H_
       
     7 
       
     8 #include <stddef.h>
       
     9 
       
    10 /**
       
    11  * Insert element into the list and increase listSize.
       
    12  * Returns a pointer to the modified list on success, NULL on failure. On success, the old
       
    13  * pointer is no longer valid, and on failure the list remains unchanged (similar to realloc)
       
    14  */
       
    15 void *flib_list_insert(void *list, int *listSizePtr, size_t elementSize, void *elementPtr, int pos);
       
    16 
       
    17 /**
       
    18  * Remove an element from the list and decrease listSize.
       
    19  * Returns a pointer to the modified list on success, NULL on failure. On success, the old
       
    20  * pointer is no longer valid, and on failure the list remains unchanged (similar to realloc)
       
    21  */
       
    22 void *flib_list_delete(void *list, int *listSizePtr, size_t elementSize, int pos);
       
    23 
       
    24 #endif /* LIST_H_ */