dynamicArray.h File Reference
A dynamically resizing array for general use.
More...
#include <stdlib.h>
#include <string.h>
Detailed Description
A dynamically resizing array for general use.
Function Documentation
| static void * DynamicArrayDelete |
( |
DynamicArray * |
v |
) |
[inline] |
Frees memory allocated by the dynamic array.
- Parameters:
-
| static void * DynamicArrayGet |
( |
DynamicArray * |
v, |
|
|
int |
index | |
|
) |
| | [inline] |
Gets the entry at the supplied index.
- Parameters:
-
| v | The array to get from. |
| index | The index of the data to get. |
- Returns:
- a The data or NULL if out of range.
| static void * DynamicArrayInit |
( |
DynamicArray * |
v, |
|
|
int |
initialSize | |
|
) |
| | [inline] |
Initializes an array with the supplied initial size.
- Parameters:
-
| v | the array to initialize |
| initialSize | the initial size to allocate |
- Returns:
- a pointer to the data (0 on error)
| static void DynamicArraySet |
( |
DynamicArray * |
v, |
|
|
int |
index, |
|
|
void * |
item | |
|
) |
| | [inline] |
Sets the entry to the supplied value.
- Parameters:
-
| v | The array to set |
| index | The index of the data to set (array will be resized to fit the index). |
| item | The data to set. |