dynamicArray.h
A dynamically resizing array for general use.
[詳細]
#include <stdlib.h>
#include <string.h>
ソースコードを見る。
説明
A dynamically resizing array for general use.
関数
static void * DynamicArrayDelete |
( |
DynamicArray * |
v |
) |
[inline] |
Frees memory allocated by the dynamic array.
- 引数:
-
static void * DynamicArrayGet |
( |
DynamicArray * |
v, |
|
|
int |
index | |
|
) |
| | [inline] |
Gets the entry at the supplied index.
- 引数:
-
| v | The array to get from. |
| index | The index of the data to get. |
- 戻り値:
- 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.
- 引数:
-
| v | the array to initialize |
| initialSize | the initial size to allocate |
- 戻り値:
- 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.
- 引数:
-
| 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. |