Data Structures | |
struct | _ArrayList |
An ArrayList structure. More... | |
Typedefs | |
typedef _ArrayList | ArrayList |
An ArrayList structure. | |
typedef int(* | ArrayListEqualFunc )(void *data1, void *data2) |
Compare two values in an arraylist to determine if they are equal. | |
typedef int(* | ArrayListCompareFunc )(void *data1, void *data2) |
Compare two values in an arraylist. | |
Functions | |
ArrayList * | arraylist_new (int length) |
Allocate a new ArrayList for use. | |
void | arraylist_free (ArrayList *arraylist) |
Destroy an ArrayList and free back the memory it uses. | |
void | arraylist_append (ArrayList *arraylist, void *data) |
Append data to the end of an ArrayList. | |
void | arraylist_prepend (ArrayList *arraylist, void *data) |
Prepend data to the beginning of an ArrayList. | |
void | arraylist_remove (ArrayList *arraylist, int index) |
Remove the entry at the specified location in an ArrayList. | |
void | arraylist_remove_range (ArrayList *arraylist, int index, int length) |
Remove a range of entries at the specified location in an ArrayList. | |
int | arraylist_insert (ArrayList *arraylist, int index, void *data) |
Insert new data at the specified index in an ArrayList. | |
int | arraylist_index_of (ArrayList *arraylist, ArrayListEqualFunc callback, void *data) |
Find the index of a particular pointer in an ArrayList. | |
void | arraylist_clear (ArrayList *arraylist) |
Remove all entries from an ArrayList. | |
void | arraylist_sort (ArrayList *arraylist, ArrayListCompareFunc compare_func) |
Sort the values in an ArrayList. |
ArrayLists are arrays of pointers which automatically increase in size.
To create an ArrayList, use arraylist_new. To destroy an ArrayList, use arraylist_free.
To add data an ArrayList, use arraylist_prepend, arraylist_append, or arraylist_insert.
To remove data from an ArrayList, use arraylist_remove or arraylist_remove_range.
|
An ArrayList structure. New ArrayLists can be created using the arraylist_new function.
|
|
Compare two values in an arraylist. Used by arraylist_sort when sorting values.
|
|
Compare two values in an arraylist to determine if they are equal.
|
|
Append data to the end of an ArrayList.
|
|
Remove all entries from an ArrayList.
|
|
Destroy an ArrayList and free back the memory it uses.
|
|
Find the index of a particular pointer in an ArrayList.
|
|
Insert new data at the specified index in an ArrayList. The index where new data can be inserted is limited by the size of the ArrayList.
|
|
Allocate a new ArrayList for use.
|
|
Prepend data to the beginning of an ArrayList.
|
|
Remove the entry at the specified location in an ArrayList.
|
|
Remove a range of entries at the specified location in an ArrayList.
|
|
Sort the values in an ArrayList.
|