|
libdatatypes 0.3.2
Abstract datatypes for C.
|
Singly-linked list. More...
Go to the source code of this file.
Data Structures | |
| struct | SListItem |
| Structure holding a list item. More... | |
| struct | SList |
| Singly-linked list. More... | |
Macros | |
| #define | slist_item_next(item) item->next |
| #define | slist_item_get_data(item) item->data |
| #define | slist_item_set_data(item, value) item->data = value |
Functions | |
| SList * | slist_new (CompareFunc compare, FreeFunc free, Pool *pool) |
| void | slist_init (SList *list, CompareFunc compare, FreeFunc free, Pool *pool) |
| void | slist_destroy (SList *list) |
| void | slist_free (SList *list) |
| SListItem * | slist_append (SList *list, void *data) |
| SListItem * | slist_prepend (SList *list, void *data) |
| SListItem * | slist_insert_sorted (SList *list, void *data) |
| SListItem * | slist_head (const SList *list) |
| size_t | slist_count (const SList *list) |
| bool | slist_empty (const SList *list) |
| void | slist_remove (SList *list, SListItem *item) |
| void | slist_remove_by_data (SList *list, void *data, bool remove_all) |
| void * | slist_pop (SList *list) |
| bool | slist_contains (const SList *list, const void *data) |
| void | slist_clear (SList *list) |
| SListItem * | slist_find (const SList *list, SListItem *offset, void const *data) |
| void | slist_item_free_data (const SList *list, SListItem *item) |
Singly-linked list.
Definition in file slist.h.
| struct SListItem |
| struct SList |
| Data Fields | ||
|---|---|---|
| CompareFunc | compare |
Function to compare data of two list items. |
| size_t | count |
Number of stored items. |
| FreeFunc | free |
Function to free item data. |
| SListItem * | head |
Head of the list. |
| Pool * | pool |
A memory pool for creating new list items. |
| SListItem * | tail |
Tail of the list. |
| #define slist_item_get_data | ( | item | ) | item->data |
| #define slist_item_next | ( | item | ) | item->next |
| #define slist_item_set_data | ( | item, | |
| value | |||
| ) | item->data = value |
| void slist_clear | ( | SList * | list | ) |
| bool slist_contains | ( | const SList * | list, |
| const void * | data | ||
| ) |
| size_t slist_count | ( | const SList * | list | ) |
| void slist_destroy | ( | SList * | list | ) |
| bool slist_empty | ( | const SList * | list | ) |
| void slist_free | ( | SList * | list | ) |
| void slist_init | ( | SList * | list, |
| CompareFunc | compare, | ||
| FreeFunc | free, | ||
| Pool * | pool | ||
| ) |
| SList * slist_new | ( | CompareFunc | compare, |
| FreeFunc | free, | ||
| Pool * | pool | ||
| ) |
| void * slist_pop | ( | SList * | list | ) |