cutils is a set of utils for C programs.
typedef struct item {
CONTENT_TYPE content;
struct item* next;
} item_t;
Previously, you have to define the macro CONTENT_TYPE
in order to determine the type of the item content. For example:
#define CONTENT_TYPE uint32_t
LIST_APPEND(head,node)
appends a new itemnode
into the list pointed byhead
.LIST_ADD(node1,node2)
addsnode2
item in the list just betweennode1
andnode1->next
. alpha...LIST_REMOVE(head,node)
remove the itemnode
from the list pointed byhead
.LIST_COUNT(head,counter)
counts incounter
the number of items contained in the list pointed byhead
. alpha...