All rights reserved.
List Array is a library to handle generic type elements in a list or array.
There are function to initialize, add, delete, search and free the list.
Data Structures | |
| struct | listArray_t |
Typedefs | |
| typedef int(*) | matchFunction (void *m1, void *m2) |
Functions | |
| void | initListArray (struct listArray_t *l, int inc, int size) |
| int | addListArrayElement (struct listArray_t *l, void *element) |
| int | delListArrayElement (struct listArray_t *l, int i) |
| void * | getListArrayElementPointer (struct listArray_t *l, int i) |
| void | freeListArray (struct listArray_t *l) |
| int | getListArrayNumberOfElements (struct listArray_t *l) |
| int | findListArrayElement (struct listArray_t *l, matchFunction match, void *matchData) |
| typedef int(*) matchFunction(void *m1, void *m2) |
Function prototype for the function to use when matching elements
| m1 | Pointer to element 1 | |
| m2 | Pointer to element 2 |
0 if no match
| int addListArrayElement | ( | struct listArray_t * | l, | |
| void * | element | |||
| ) |
Add an element to the list.
| l | The list data structure. | |
| element | The element to add. It will be copied into the list. |
| int delListArrayElement | ( | struct listArray_t * | l, | |
| int | i | |||
| ) |
Remove an element from the list.
| l | The list data structure. | |
| i | Index to remove. |
| int findListArrayElement | ( | struct listArray_t * | l, | |
| matchFunction | match, | |||
| void * | matchData | |||
| ) |
Find a specific element in the lits.
| l | The list data structure. | |
| match | Function pointer to a match function of type matchFunction. | |
| matchData | The element data to compare with using the matchFunction. |
-1 on if no matching element found.
| void freeListArray | ( | struct listArray_t * | l | ) |
| void* getListArrayElementPointer | ( | struct listArray_t * | l, | |
| int | i | |||
| ) |
Get the pointer to an element.
| l | The list data structure. | |
| i | Index to get pointer for. |
| int getListArrayNumberOfElements | ( | struct listArray_t * | l | ) | [inline] |
Get number of elements in the list.
| l | The list data structure. |
| void initListArray | ( | struct listArray_t * | l, | |
| int | inc, | |||
| int | size | |||
| ) |
Initialize the list data structures.
| l | The list data structure. | |
| inc | How many extra elements to allocate when the list is full. | |
| size | Size of the data elements to be stored in the list. |
1.5.1