Skip to content

vivivivianne/bunlist

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🐇BunList

A simple c99 dynamic list implementation

GitHub last commit GitHub Repo stars GitHub repo size

✅ Features:

  • 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.

💾 Usage

  • To add to your project simply copy the headers and bunlist.c
  • For examples see tests.c

⚠️ Caveats:

  • 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.

🗒️ Todo:

  • Consider improving inserting functionality
  • Proper error handling
  • Generate docs with doxygen???

About

A simple c99 dynamic array implementation

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages