Defines | |
#define | LINK_HEAD_INIT(extra) |
Linked list head static initializer. More... | |
#define | ll_verify(list) |
Linked list head verification macro. More... | |
#define | ll_count(list) |
Linked list count. More... | |
#define | ll_first(list) |
First element in linked list. More... | |
#define | ll_last(list) |
Last element in a linked list. More... | |
#define | ll_extra(list) |
Extra pointer data in a linked list. More... | |
#define | LINK_ELEM_INIT(obj) |
Linked list element static initializer. More... | |
#define | le_verify(element) |
Linked list element verification macro. More... | |
#define | le_next(elem) |
Linked list element next pointer. More... | |
#define | le_prev(elem) |
Linked list element previous pointer. More... | |
#define | le_object(elem) |
Linked list element object pointer. More... | |
#define | le_head(elem) |
Linked list element head pointer. More... | |
#define | le_flags(elem) |
Linked list element flags. More... | |
Typedefs | |
typedef struct _link_head_s | link_head_t |
Linked list head. More... | |
typedef struct _link_elem_s | link_elem_t |
Linked list element. More... | |
typedef unsigned long (* | link_iter_t )(link_head_t *, link_elem_t *, void *) |
Linked list iteration callback. More... | |
typedef unsigned long (* | link_comp_t )(db_key_t *, void *) |
Linked list comparison callback. More... | |
typedef enum _link_loc_e | link_loc_t |
Linked list location. More... | |
Enumerations | |
enum | _link_loc_e { LINK_LOC_HEAD, LINK_LOC_TAIL, LINK_LOC_BEFORE, LINK_LOC_AFTER } |
Linked list location. More... | |
Functions | |
unsigned long | ll_init (link_head_t *list, void *extra) |
Dynamically initialize a linked list head. More... | |
unsigned long | ll_add (link_head_t *list, link_elem_t *new, link_loc_t loc, link_elem_t *elem) |
Add an element to a linked list. More... | |
unsigned long | ll_move (link_head_t *list, link_elem_t *new, link_loc_t loc, link_elem_t *elem) |
Move an element within a linked list. More... | |
unsigned long | ll_remove (link_head_t *list, link_elem_t *elem) |
Remove an element from a linked list. More... | |
unsigned long | ll_find (link_head_t *list, link_elem_t **elem_p, link_comp_t comp_func, link_elem_t *start, db_key_t *key) |
Find an element in a linked list. More... | |
unsigned long | ll_iter (link_head_t *list, link_iter_t iter_func, void *extra) |
Iterate over each entry in a linked list. More... | |
unsigned long | ll_flush (link_head_t *list, link_iter_t flush_func, void *extra) |
Flush a linked list. More... | |
unsigned long | le_init (link_elem_t *elem, void *object) |
Dynamically initialize a linked list element. More... |
Elements may be added at any arbitrary location in the linked list with ll_add(); moved to any other arbitrary location in the linked list with ll_move(), or removed from the list with ll_remove(). In addition, the user may search the list using a user-defined comparison function with ll_find(); iterate over every element in the list with ll_iter(); or remove all items from the list with ll_flush(), optionally executing a user-specified clean-up function.
|
This macro statically initializes a link_elem_t.
|
|
This macro statically initializes a link_head_t.
|
|
This macro retrieves a set of user-defined flags associated with the element. It may be used as an lvalue to set those flags.
|
|
This macro retrieves a pointer to the head of the linked list that the element is in.
|
|
This macro retrieves a pointer to the next element in the linked list.
|
|
This macro retrieves a pointer to the object represented by the element. It may be used as an lvalue to change the object pointed to. Care should be taken when using this feature.
|
|
This macro retrieves a pointer to the previous element in the linked list.
|
|
This macro verifies that a given pointer actually does point to a linked list element.
|
|
This macro retrieves the number of elements in a linked list.
|
|
This macro retrieves the extra pointer data associated with a particular linked list.
|
|
This macro retrieves the first element in a linked list.
|
|
This macro retrieves the last element in a linked list.
|
|
This macro verifies that a given pointer actually does point to a linked list head.
|
|
This function pointer references a callback used by ll_find(). It should return 0 if the entry passed as the second argument matches the key passed as the first argument. |
|
This structure represents a single element of a linked list. |
|
This structure is the head of all linked lists maintained by this library. |
|
This function pointer references a callback used by ll_iter() and ll_flush(). It should return 0 for success. A non-zero return value will terminate the operation and will become the return value of the ll_iter() or ll_flush() call. |
|
See the documentation for the enumeration _link_loc_e. |
|
This enumeration is used to specify where an element in a linked list should be placed. It should be referenced by the typedef link_loc_t. |
|
This function dynamically initializes a linked list element.
|
|
This function adds a given element to a specified linked list in the specified location.
|
|
This function iterates through a linked list looking for an element that matches the given
|
|
This function flushes a linked list--that is, it removes each element from the list. If a
|
|
This function dynamically initializes a linked list head.
|
|
This function iterates over a linked list, executing the given
|
|
This function moves a specified element within the linked list.
|
|
This function removes a specified element from a linked list.
|