A simple c99 dynamic list implementation
- Insert, Append, Remove, Get and more.
- The header file is overly commented with the usage explained in it.
- Set a initial capacity to avoid unnecessary memory reallocations.
- Control list growth once it reaches max size (linear and geometric growth).
bunlist_exe(arr, func)runs a function on all items of the list.bunlist_free(arr)destroys the list and calls callback function in each item if one is defined.- +list cloning functions that allow copying an list or creating an list of pointers to another list.
- To add to your project simply copy the headers and bunlist.c
- For examples see tests.c
- Not made with double pointers in mind, might not work.
- it also requires buntypes.h which is what i personally use for types.
- The current insert implementation does not allow inserting things that are outside of the list length. This means you should use insert only to insert between things that are already in the list.
- Consider improving inserting functionality
- Proper error handling
- Generate docs with doxygen???