dynamicArray.h File Reference

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

#include <stdlib.h>
#include <string.h>

Data Structures

struct  DynamicArray
 A resizable array. More...

Functions

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


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:
v the array to delete

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.


Generated on Sun Mar 7 12:47:54 2010 for libnds by  doxygen 1.5.7.1