dynamicArray.h File Reference
A dynamically resizing array for general use.
More...
#include <stdlib.h>
#include <string.h>
#include <nds/ndstypes.h>
Detailed Description
A dynamically resizing array for general use.
Function Documentation
Frees memory allocated by the dynamic array.
- Parameters:
-
void* DynamicArrayGet |
( |
DynamicArray * |
v, |
|
|
unsigned int |
index | |
|
) |
| | |
Gets the entry at the supplied index.
- Parameters:
-
| v | The array to get from. |
| index | The index of the data to get. |
- Returns:
- The data or NULL if v is NULL or the index is out of range.
void* DynamicArrayInit |
( |
DynamicArray * |
v, |
|
|
unsigned int |
initialSize | |
|
) |
| | |
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, or NULL on error.
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. |
- Returns:
- false if v is NULL or there isn't enough memory, true otherwise