VIMOS DRS Reference Manual 2.9.3
|
Functions | |
VimosTableArray * | newTableArray (int size) |
Create an empty table array of appropriate size. | |
void | deleteTableArray (VimosTableArray *array) |
Delete an table array object. | |
void | destroyTableArray (VimosTableArray *array) |
Destroy an table array object. | |
int | tblArrayIsEmpty (const VimosTableArray *array) |
Check if an table array object is empty. | |
int | tblArrayCapacity (const VimosTableArray *array) |
Get the capacity of an table array. | |
int | tblArraySize (const VimosTableArray *array) |
Get the number of tables stored in an table array. | |
const VimosTable * | tblArrayGet (const VimosTableArray *array, int index) |
The function retrieves an table from an table array object. | |
int | tblArraySet (VimosTableArray *array, int index, const VimosTable *table) |
Set an element of an table array. | |
VimosTable * | tblArrayRemove (VimosTableArray *array, int index) |
Remove an table from an table array object. | |
VimosTable ** | tblArrayGetData (const VimosTableArray *array) |
Get reference to the array objects data. |
The module VimosTableArray implements a simple, fixed size array container for tables.
void deleteTableArray | ( | VimosTableArray * | array | ) |
Delete an table array object.
array | Table array object to be deallocated. |
The function deallocates the table array object array. The array object must be empty.
NULL
nothing is done.void destroyTableArray | ( | VimosTableArray * | array | ) |
Destroy an table array object.
array | Table array object to be destroyed. |
The function works as deleteTableArray(), but any table which is stored in the array is deallocated prior to the deallocation of the array object array.
NULL
nothing is done.VimosTableArray* newTableArray | ( | int | size | ) |
Create an empty table array of appropriate size.
NULL
otherwise.size | Size of the table array. |
The function allocates the memory for an table array of size elements. All array elements are initialized to to NULL
.
int tblArrayCapacity | ( | const VimosTableArray * | array | ) |
Get the capacity of an table array.
array | Table array object. |
The function reports the capacity of the array array, i.e. the maximum number of tables which could be stored in the array.
const VimosTable* tblArrayGet | ( | const VimosTableArray * | array, |
int | index | ||
) |
The function retrieves an table from an table array object.
NULL
is returned.array | Table array object. |
index | Array element offset. |
The function returns a reference to the table stored in the array array. The offset index is the usual C array offset, i.e. the first table is accessed by passing 0 as index.
VimosTable** tblArrayGetData | ( | const VimosTableArray * | array | ) |
Get reference to the array objects data.
array | Table array object. |
The function returns a handle of the the array's data block.
int tblArrayIsEmpty | ( | const VimosTableArray * | array | ) |
Check if an table array object is empty.
VM_TRUE
if the array is empty, otherwise VM_FALSE
is returned.array | Table array object to be tested. |
The function checks if any table is stored in the array.
VimosTable* tblArrayRemove | ( | VimosTableArray * | array, |
int | index | ||
) |
Remove an table from an table array object.
array | Table array object. |
index | Array element offset. |
The function removes the table stored at the array offset index and returns a reference to the removed table. The array element is reset to NULL
. If no table was stored in the array element the function succeeds and the returned reference is NULL
.
int tblArraySet | ( | VimosTableArray * | array, |
int | index, | ||
const VimosTable * | table | ||
) |
Set an element of an table array.
EXIT_SUCCESS
if no error occurred, or EXIT_FAILURE
otherwise.array | Table array object. |
index | Array element offset. |
table | Table object. |
The functions stores the table table into the element with offset index of the table array object array. To be successfull index must be equal or larger than 0, smaller than the array's capacity and the array element must not already reference another table. If a stored table should be replaced by another table first use tableArrayRemove() to extract an table from the array object.
NULL
as table table.int tblArraySize | ( | const VimosTableArray * | array | ) |
Get the number of tables stored in an table array.
array | Table array object. |
The function retrieves the number of tables currently stored in the table array object array. The reported number is not the array objects capacity, i.e. the maximum number of tables which could be stuffed into the array.