#include <stdlib.h>
Go to the source code of this file.
|
#define | LIST_APPEND(prList, data) ListInsertNext((prList), LIST_TAIL(prList), (data)) |
|
#define | LIST_PREPEND(prList, data) ListInsertNext((prList), CLUSTALO_LIST_HEAD(prList), (data)) |
|
#define | LIST_SIZE(prList) ((prList)->size) |
|
#define | CLUSTALO_LIST_HEAD(prList) ((prList)->head) |
|
#define | LIST_TAIL(prList) ((prList)->tail) |
|
#define | LIST_IS_HEAD(prList, prElement) ((prElement) == (prList)->head ? 1 : 0) |
|
#define | LIST_IS_TAIL(prElement) ((prElement)->next == NULL ? 1 : 0) |
|
#define | LIST_DATA(prElement) ((prElement)->data) |
|
#define | LIST_NEXT(prElement) ((prElement)->next) |
|
#define | INT_LIST_INIT(prList) ListInit((prList), free) |
|
#define | INT_LIST_DESTROY(prList) ListDestroy((prList)); |
|
#define | INT_LIST_APPEND(prList, data) IntListInsertNext((prList), LIST_TAIL(prList), (data)) |
|
#define | INT_LIST_PREPEND(prList, data) IntListInsertNext((prList), CLUSTALO_LIST_HEAD(prList), (data)) |
|
#define | INT_LIST_SIZE(prList) LIST_SIZE(prList) |
|
#define | INT_CLUSTALO_LIST_HEAD(prList) CLUSTALO_LIST_HEAD_INT((prList)) |
|
#define | INT_LIST_TAIL(prList) LIST_TAIL_INT((prList) ) |
|
#define | INT_LIST_IS_HEAD(prList, prElement) LIST_IS_HEAD(prList, prElement) |
|
#define | INT_LIST_IS_TAIL(prElement) LIST_IS_TAIL((prElement)) |
|
#define | INT_LIST_DATA(prElement) LIST_DATA((prElement)) |
|
#define | INT_LIST_NEXT(prElement) LIST_NEXT((prElement)) |
|
◆ CLUSTALO_LIST_HEAD
#define CLUSTALO_LIST_HEAD |
( |
|
prList | ) |
((prList)->head) |
◆ INT_CLUSTALO_LIST_HEAD
#define INT_CLUSTALO_LIST_HEAD |
( |
|
prList | ) |
CLUSTALO_LIST_HEAD_INT((prList)) |
◆ INT_LIST_APPEND
◆ INT_LIST_DATA
#define INT_LIST_DATA |
( |
|
prElement | ) |
LIST_DATA((prElement)) |
◆ INT_LIST_DESTROY
#define INT_LIST_DESTROY |
( |
|
prList | ) |
ListDestroy((prList)); |
◆ INT_LIST_INIT
#define INT_LIST_INIT |
( |
|
prList | ) |
ListInit((prList), free) |
◆ INT_LIST_IS_HEAD
#define INT_LIST_IS_HEAD |
( |
|
prList, |
|
|
|
prElement |
|
) |
| LIST_IS_HEAD(prList, prElement) |
◆ INT_LIST_IS_TAIL
#define INT_LIST_IS_TAIL |
( |
|
prElement | ) |
LIST_IS_TAIL((prElement)) |
◆ INT_LIST_NEXT
#define INT_LIST_NEXT |
( |
|
prElement | ) |
LIST_NEXT((prElement)) |
◆ INT_LIST_PREPEND
◆ INT_LIST_SIZE
#define INT_LIST_SIZE |
( |
|
prList | ) |
LIST_SIZE(prList) |
◆ INT_LIST_TAIL
#define INT_LIST_TAIL |
( |
|
prList | ) |
LIST_TAIL_INT((prList) ) |
◆ LIST_APPEND
◆ LIST_DATA
#define LIST_DATA |
( |
|
prElement | ) |
((prElement)->data) |
◆ LIST_IS_HEAD
#define LIST_IS_HEAD |
( |
|
prList, |
|
|
|
prElement |
|
) |
| ((prElement) == (prList)->head ? 1 : 0) |
◆ LIST_IS_TAIL
#define LIST_IS_TAIL |
( |
|
prElement | ) |
((prElement)->next == NULL ? 1 : 0) |
◆ LIST_NEXT
#define LIST_NEXT |
( |
|
prElement | ) |
((prElement)->next) |
◆ LIST_PREPEND
◆ LIST_SIZE
#define LIST_SIZE |
( |
|
prList | ) |
((prList)->size) |
◆ LIST_TAIL
#define LIST_TAIL |
( |
|
prList | ) |
((prList)->tail) |
◆ int_list_t
◆ list_elem_t
◆ IntListInsertNext()
Insert int next to given element.
- Parameters
-
[in] | prList | List into which to insert |
[in] | prElement | Current position/element. Element after which to insert. If NULL head is used. |
[in] | data | int to store |
- Returns
- Non-zero on failure
◆ IntListRemoveNext()
Remove next element from current element/position.
- Parameters
-
[in] | prList | List from which an element is to be removed. |
[in] | prElement | Current element/position. Next item will be removed. If NULL head is used. |
[out] | iData_p | Will be pointed to removed elements data. |
- Returns
- Non-zero on failure
◆ ListDestroy()
void ListDestroy |
( |
list_t * |
prList | ) |
|
Calls user defined function to free data in list and resets the list to NULL. Call even if your destroy function is NULL.
- Parameters
-
[in] | prList | The list to destroy |
◆ ListInit()
void ListInit |
( |
list_t * |
prList, |
|
|
void(*)(void *data) |
destroy |
|
) |
| |
Initialise data members of a list.
- Parameters
-
[in] | prList | List to initialise |
[in] | destroy | A function to be called with pointer to data when destroying the list. NULL if in doubt, free in most other cases. Note: doxygen will always fail to parse this... |
◆ ListInsertNext()
Insert data next to given element.
- Parameters
-
[in] | prList | List into which to insert |
[in] | prElement | Current position/element. Element after which to insert. If NULL head is used. |
[in] | pvData | Pointer to data to store |
- Returns
- Non-zero on failure
◆ ListRemoveNext()
Remove next element from current element/position.
- Parameters
-
[in] | prList | List from which an element is to be removed. |
[in] | prElement | Current element/position. Next item will be removed. If NULL head is used. |
[out] | pvData_p | Will be pointed to removed elements data. |
- Returns
- Non-zero on failure