qblist.h(3) | libqb | qblist.h(3) |
qblist.h - This is a kernel style list implementation.
#include <stdint.h>
#include <qb/qbdefs.h>
struct qb_list_head
#define QB_LIST_DECLARE(name) struct qb_list_head
name = { &(name), &(name) }
Declare and initialize a list head. #define QB_INIT_LIST_HEAD(ptr)
#define qb_list_entry(ptr, type, member) ((type *)((char
*)(ptr)-(char*)(&((type *)0)->member)))
Get the struct for this entry. #define qb_list_first_entry(ptr, type,
member) qb_list_entry((ptr)->next, type, member)
Get the first element from a list. #define qb_list_for_each(pos, head)
for (pos = (head)->next; pos != (head); pos = pos->next)
Iterate over a list. #define qb_list_for_each_reverse(pos, head) for
(pos = (head)->prev; pos != (head); pos = pos->prev)
Iterate over a list backwards. #define qb_list_for_each_safe(pos, n,
head)
Iterate over a list safe against removal of list entry. #define
qb_list_for_each_entry(pos, head, member)
Iterate over list of given type. #define
qb_list_for_each_entry_reverse(pos, head, member)
Iterate backwards over list of given type. #define
qb_list_for_each_entry_safe(pos, n, head, member)
Iterate over list of given type safe against removal of list entry. #define
qb_list_for_each_entry_safe_reverse(pos, n, head, member)
Iterate backwards over list safe against removal. #define
qb_list_for_each_entry_from(pos, head, member)
Iterate over list of given type from the current point.
static void qb_list_init (struct qb_list_head *head)
Initialize the list entry. static void qb_list_add (struct
qb_list_head *element, struct qb_list_head *head)
Add this element to the list. static void qb_list_add_tail (struct
qb_list_head *element, struct qb_list_head *head)
Add to the list (but at the end of the list). static void qb_list_del
(struct qb_list_head *_remove)
Delete an entry from the list. static void qb_list_replace (struct
qb_list_head *old, struct qb_list_head *new)
Replace old entry by new one. static int qb_list_is_last (const struct
qb_list_head *list, const struct qb_list_head *head)
Tests whether list is the last entry in list head. static int32_t
qb_list_empty (const struct qb_list_head *head)
A quick test to see if the list is empty (pointing to it's self). static void
qb_list_splice (struct qb_list_head *list, struct
qb_list_head *head)
Join two lists. static void qb_list_splice_tail (struct
qb_list_head *list, struct qb_list_head *head)
Join two lists, each list being a queue. static int32_t qb_list_length
(struct qb_list_head *head)
Count the number of items in the list.
This is a kernel style list implementation.
Author:
Value:
do { (ptr)->next = (ptr); (ptr)->prev = (ptr); } while (0)
Declare and initialize a list head.
Get the struct for this entry.
Parameters:
Get the first element from a list.
Parameters:
Iterate over a list.
Parameters:
Referenced by qb_list_length().
Value:
for (pos = qb_list_entry((head)->next, typeof(*pos), member); &pos->member != (head); pos = qb_list_entry(pos->member.next, typeof(*pos), member))
Iterate over list of given type.
Parameters:
Value:
for (; &pos->member != (head); pos = qb_list_entry(pos->member.next, typeof(*pos), member))
Iterate over list of given type from the current point.
Parameters:
Value:
for (pos = qb_list_entry((head)->prev, typeof(*pos), member); &pos->member != (head); pos = qb_list_entry(pos->member.prev, typeof(*pos), member))
Iterate backwards over list of given type.
Parameters:
Value:
for (pos = qb_list_entry((head)->next, typeof(*pos), member), n = qb_list_entry(pos->member.next, typeof(*pos), member); &pos->member != (head); pos = n, n = qb_list_entry(n->member.next, typeof(*n), member))
Iterate over list of given type safe against removal of list entry.
Parameters:
Value:
for (pos = qb_list_entry((head)->prev, typeof(*pos), member), n = qb_list_entry(pos->member.prev, typeof(*pos), member); &pos->member != (head); pos = n, n = qb_list_entry(n->member.prev, typeof(*n), member))
Iterate backwards over list safe against removal.
Parameters:
Iterate over a list backwards.
Parameters:
Value:
for (pos = (head)->next, n = pos->next; pos != (head); pos = n, n = pos->next)
Iterate over a list safe against removal of list entry.
Parameters:
Add this element to the list.
Parameters:
References qb_list_head::next, and qb_list_head::prev.
Add to the list (but at the end of the list).
Parameters:
See also:
References qb_list_head::next, and qb_list_head::prev.
Delete an entry from the list.
Parameters:
References qb_list_head::next, and qb_list_head::prev.
A quick test to see if the list is empty (pointing to it's self).
Parameters:
Returns:
References qb_list_head::next.
Referenced by qb_list_splice(), and qb_list_splice_tail().
Initialize the list entry. Points next and prev pointers to head.
Parameters:
References qb_list_head::next, and qb_list_head::prev.
Tests whether list is the last entry in list head.
Parameters:
Returns:
References qb_list_head::next.
Count the number of items in the list.
Parameters:
Returns:
References qb_list_for_each.
Replace old entry by new one.
Parameters:
References qb_list_head::next, and qb_list_head::prev.
Join two lists.
Parameters:
Note:
References qb_list_head::next, qb_list_head::prev, and qb_list_empty().
Join two lists, each list being a queue.
Parameters:
References qb_list_head::next, qb_list_head::prev, and qb_list_empty().
Generated automatically by Doxygen for libqb from the source code.
Fri Apr 26 2019 | Version 1.0.5 |