exip
Alpha 0.5.4
|
Declarations for untyped dynamic array. More...
#include "procTypes.h"
Go to the source code of this file.
Macros | |
#define | DYN_ARRAY_SIZE (sizeof(DynArray) + sizeof(void*) + sizeof(Index)) |
The size of a basic DynArray-derived structure: More... | |
#define | DEFAULT_NUMBER_CHUNK_ENTRIES 5 |
When the chunkEntries == 0 this will be used to create the new array and later extend it. More... | |
Functions | |
errorCode | createDynArray (DynArray *dynArray, size_t entrySize, uint16_t chunkSize) |
Creates fresh empty Untyped Dynamic Array This operation includes allocation of memory for DEFAULT_VALUE_ROWS_NUMBER number of value rows. More... | |
errorCode | addEmptyDynEntry (DynArray *dynArray, void **entry, Index *entryID) |
Add new empty entry into the dynamic array The pointer to the entry is passed back to be filled in. More... | |
errorCode | addDynEntry (DynArray *dynArray, void *entry, Index *entryID) |
Add new entry into the dynamic array NOTE that the new entry is shallow copied! More... | |
errorCode | delDynEntry (DynArray *dynArray, Index entryID) |
Removes an entry from the dynamic array with index elID. More... | |
void | destroyDynArray (DynArray *dynArray) |
Destroy a Dynamic Array This operation frees the allocated memory. More... | |
Definition in file dynamicArray.h.
#define DEFAULT_NUMBER_CHUNK_ENTRIES 5 |
Definition at line 40 of file dynamicArray.h.
Definition at line 35 of file dynamicArray.h.
[in,out] | dynArray | Untyped Dynamic Array |
[in] | entry | the inserted entry |
[out] | entryID | the ID of the entry inserted |
Definition at line 78 of file dynamicArray.c.
[in,out] | dynArray | Untyped Dynamic Array |
[out] | entry | the empty inserted entry to be filled in |
[out] | entryID | the ID of the entry inserted |
Definition at line 38 of file dynamicArray.c.
For every created array, destroyDynArray() must be invoked to release the allocated memory.
[in,out] | dynArray | Untyped Dynamic Array |
[in] | entrySize | The size of a single array entry in bytes |
[in] | chunkSize | Initial number of entries and the number of entries to be added each expansion time |
Definition at line 21 of file dynamicArray.c.
[in,out] | dynArray | Untyped Dynamic Array |
[in] | entryID | the ID of the entry to be deleted |
Definition at line 89 of file dynamicArray.c.
void destroyDynArray | ( | DynArray * | dynArray) |
[in,out] | dynArray | Untyped Dynamic Array to be freed |
Definition at line 118 of file dynamicArray.c.