dynamicArray.h File Reference

A dynamically resizing array for general use. More...

#include <stdlib.h>
#include <string.h>
#include <nds/ndstypes.h>

Data Structures

struct  DynamicArray
 A resizable array. More...

Typedefs

typedef struct DynamicArray DynamicArray
 A resizable array.

Functions

void DynamicArrayDelete (DynamicArray *v)
 Frees memory allocated by the dynamic array.
void * DynamicArrayGet (DynamicArray *v, unsigned int index)
 Gets the entry at the supplied index.
void * DynamicArrayInit (DynamicArray *v, unsigned int initialSize)
 Initializes an array with the supplied initial size.
bool DynamicArraySet (DynamicArray *v, unsigned int index, void *item)
 Sets the entry to the supplied value.

Detailed Description

A dynamically resizing array for general use.


Function Documentation

void DynamicArrayDelete ( DynamicArray v  ) 

Frees memory allocated by the dynamic array.

Parameters:
v The array to delete
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.
bool DynamicArraySet ( DynamicArray v,
unsigned int  index,
void *  item 
)

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
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines
Generated on Sat Oct 2 12:55:12 2010 for libnds by  doxygen 1.6.3