Skip to content

vexe/List.h

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

List.h

STB-style inspired dynamic array. Builds on Sean Barrett's awesome stb stretchy_buffer adding more functionality. The idea is to store the count and capacity as two integers in the first two slots of the list memory block from malloc/realloc, and then return to the user base pointer + 2 for the rest of the list stroage.

See Example.cpp for usage code

Public API:

ListLast(List)
ListCount(List)
ListCapacity(List)
ListFree(List)
ListClear(List)
ListPush(List, Item)
ListInsert(List, Item, Index)
ListAdd(List, Amount)
ListFor(List)
ListForeach(List)
ListIndexOf(List, Item, Index, Compare)
ListIfItemExists(List, Item, Index, Compare)
ListIfItemDoesntExist(List, Item, Index, Compare)
ListSort(List, Compare)
ListInsertAscending(List, Item, Compare)
ListInsertDescending(List, Item, Compare)
ListRemoveAt(List, Index)
ListRemove(List, Item, Compare)

About

stb-style dynamic/resizable buffer

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages