qblist.h.3   qblist.h.3 
qblist.h(3) libqb qblist .h(3) qblist.h(3) libqb qblist .h(3)
NAME NAME
qblist.h - qblist.h -
This is a kernel style list implementation. This is a kernel style list implementation'.
SYNOPSIS SYNOPSIS
#include <stdint.h> #include <stdint.h>
#include <qb/qbdefs.h>
Data Structures Data Structures
struct qb_list_head struct qb_list_head
Defines Defines
#define QB_LIST_DECLARE(name) struct qb_list_head name = { &(name) , &(name) } #define QB_LIST_DECLARE(name) struct qb_list_head name = { &(name) , &(name) }
Declare and initialize a list head. Declare and initialize a list head'.
#define QB_INIT_LIST_HEAD(ptr) #define QB_INIT_LIST_HEAD(ptr)
#define qb_list_entry(ptr, type, member) ((type *)((char *)(ptr)-( char*)(&((type *)0)->member))) #define qb_list_entry(ptr, type, member) ((type *)((char *)(ptr)-( char*)(&((type *)0)->member)))
Get the struct for this entry. Get the struct for this entry'.
#define qb_list_for_each(pos, head) for (pos = (head)->next; pos ! = (head); pos = pos->next) #define qb_list_for_each(pos, head) for (pos = (head)->next; pos ! = (head); pos = pos->next)
Iterate over a list. Iterate over a list'.
#define qb_list_for_each_reverse(pos, head) for (pos = (head)->pre v; pos != (head); pos = pos->prev) #define qb_list_for_each_reverse(pos, head) for (pos = (head)->pre v; pos != (head); pos = pos->prev)
Iterate over a list backwards. Iterate over a list backwards'.
#define qb_list_for_each_safe(pos, n, head) #define qb_list_for_each_safe(pos, n, head)
Iterate over a list safe against removal of list entry. Iterate over a list safe against removal of list entry'.
#define qb_list_for_each_entry(pos, head, member) #define qb_list_for_each_entry(pos, head, member)
Iterate over list of given type. Iterate over list of given type'.
#define qb_list_for_each_entry_reverse(pos, head, member) #define qb_list_for_each_entry_reverse(pos, head, member)
Iterate backwards over list of given type. 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 ent
ry'.
#define qb_list_for_each_entry_safe_reverse(pos, n, head, member)
Iterate backwards over list safe against removal'.
Functions Functions
static void qb_list_init (struct qb_list_head *head) static void qb_list_init (struct qb_list_head *head)
Initialize the list entry. Initialize the list entry'.
static void qb_list_add (struct qb_list_head *element, struct qb_lis t_head *head) static void qb_list_add (struct qb_list_head *element, struct qb_lis t_head *head)
Add this element to the list. Add this element to the list'.
static void qb_list_add_tail (struct qb_list_head *element, struct q b_list_head *head) static void qb_list_add_tail (struct qb_list_head *element, struct q b_list_head *head)
Add to the list (but at the end of the list). Add to the list (but at the end of the list)'.
static void qb_list_del (struct qb_list_head *_remove) static void qb_list_del (struct qb_list_head *_remove)
Delete an entry from the list. Delete an entry from the list'.
static int32_t qb_list_empty (const struct qb_list_head *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) . 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_lis t_head *head) static void qb_list_splice (struct qb_list_head *list, struct qb_lis t_head *head)
Join two lists. Join two lists'.
static int32_t qb_list_length (struct qb_list_head *head) static int32_t qb_list_length (struct qb_list_head *head)
Count the number of items in the list. Count the number of items in the list'.
Detailed Description Detailed Description
This is a kernel style list implementation. This is a kernel style list implementation'.
Author: Author:
Steven Dake <sdake@redhat.com> Steven Dake <sdake@redhat.com>
Define Documentation Define Documentation
#define QB_INIT_LIST_HEAD(ptr) Value: #define QB_INIT_LIST_HEAD(ptr) Value:
do { (ptr)->next = (ptr); (ptr)->prev = (ptr); } while (0) do { (ptr)->next = (ptr); (ptr)->prev = (ptr); } while (0)
#define QB_LIST_DECLARE(name) struct qb_list_head name = { &(name), &( name) } #define QB_LIST_DECLARE(name) struct qb_list_head name = { &(name), &( name) }
Declare and initialize a list head. Declare and initialize a list head'.
#define qb_list_entry(ptr, type, member) ((type *)((char *)(ptr)-(char *)(&((type *)0)->member))) #define qb_list_entry(ptr, type, member) ((type *)((char *)(ptr)-(char *)(&((type *)0)->member)))
Get the struct for this entry. Parameters: Get the struct for this entry'. Parameters:
ptr,: the &struct list_head pointer. ptr,: the &struct list_head pointer'.
type,: the type of the struct this is embedded in. type,: the type of the struct this is embedded in'.
member,: the name of the list_struct within the struct. member,: the name of the list_struct within the struct'.
#define qb_list_for_each(pos, head) for (pos = (head)->next; pos != (h ead); pos = pos->next) #define qb_list_for_each(pos, head) for (pos = (head)->next; pos != (h ead); pos = pos->next)
Iterate over a list. Parameters: Iterate over a list'. Parameters:
pos,: the &struct list_head to use as a loop counter. pos,: the &struct list_head to use as a loop counter'.
head,: the head for your list. head,: the head for your list'.
Referenced by qb_list_length(). Referenced by qb_list_length().
#define qb_list_for_each_entry(pos, head, member) Value: #define qb_list_for_each_entry(pos, head, member) Value:
for (pos = qb_list_entry((head)->next, typeof(*pos), member); &pos->member != (head); pos = qb_list_entry(pos->member.next, typeof(*pos), member)) 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: Iterate over list of given type'. Parameters:
pos,: the type * to use as a loop counter. pos,: the type * to use as a loop counter'.
head,: the head for your list. head,: the head for your list'.
member,: the name of the list_struct within the struct. member,: the name of the list_struct within the struct'.
#define qb_list_for_each_entry_reverse(pos, head, member) Value: #define qb_list_for_each_entry_reverse(pos, head, member) Value:
for (pos = qb_list_entry((head)->prev, typeof(*pos), member); &pos->member != (head); pos = qb_list_entry(pos->member.prev, typeof(*pos), member)) 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: Iterate backwards over list of given type'. Parameters:
pos,: the type to use as a loop counter. pos,: the type to use as a loop counter'.
head,: the head for your list. head,: the head for your list'.
member,: the name of the list_struct within the struct. member,: the name of the list_struct within the struct'.
#define qb_list_for_each_entry_safe(pos, n, head, member) 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, typeo
f(*n), member))
Iterate over list of given type safe against removal of list entry'.
Parameters:
pos,: the type * to use as a loop cursor'.
n,: another type * to use as temporary storage
head,: the head for your list'.
member,: the name of the list_struct within the struct'.
#define qb_list_for_each_entry_safe_reverse(pos, n, head, member) 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, typeo
f(*n), member))
Iterate backwards over list safe against removal'. Parameters:
pos,: the type * to use as a loop cursor'.
n,: another type * to use as temporary storage
head,: the head for your list'.
member,: the name of the list_struct within the struct'.
#define qb_list_for_each_reverse(pos, head) for (pos = (head)->prev; p os != (head); pos = pos->prev) #define qb_list_for_each_reverse(pos, head) for (pos = (head)->prev; p os != (head); pos = pos->prev)
Iterate over a list backwards. Parameters: Iterate over a list backwards'. Parameters:
pos,: the &struct list_head to use as a loop counter. pos,: the &struct list_head to use as a loop counter'.
head,: the head for your list. head,: the head for your list'.
#define qb_list_for_each_safe(pos, n, head) Value: #define qb_list_for_each_safe(pos, n, head) Value:
for (pos = (head)->next, n = pos->next; pos != (head); pos = n, n = pos->next) 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: Iterate over a list safe against removal of list entry'. Parameters:
pos,: the &struct list_head to use as a loop counter. pos,: the &struct list_head to use as a loop counter'.
n,: another &struct list_head to use as temporary storage n,: another &struct list_head to use as temporary storage
head,: the head for your list. head,: the head for your list'.
Function Documentation Function Documentation
static void qb_list_add (struct qb_list_head * element, struct qb_list_h static void qb_list_add (struct qb_list_head *element, struct qb_list_he
ead * head) [inline, static] ad *head) [inline, static]
Add this element to the list. Parameters: Add this element to the list'. Parameters:
element the new element to insert. element the new element to insert'.
head pointer to the list head head pointer to the list head
References qb_list_head::next, and qb_list_head::prev. References qb_list_head::next, and qb_list_head::prev.
static void qb_list_add_tail (struct qb_list_head * element, struct qb_l static void qb_list_add_tail (struct qb_list_head *element, struct qb_li
ist_head * head) [inline, static] st_head *head) [inline, static]
Add to the list (but at the end of the list). Parameters: Add to the list (but at the end of the list)'. Parameters:
element pointer to the element to add element pointer to the element to add
head pointer to the list head head pointer to the list head
See also: See also:
qb_list_add() qb_list_add()
References qb_list_head::next, and qb_list_head::prev. References qb_list_head::prev, and qb_list_head::next.
static void qb_list_del (struct qb_list_head * _remove) [inline, static] static void qb_list_del (struct qb_list_head *_remove) [inline, static]
Delete an entry from the list. Parameters: Delete an entry from the list'. Parameters:
_remove the list item to remove _remove the list item to remove
References qb_list_head::next, and qb_list_head::prev. References qb_list_head::next, and qb_list_head::prev.
static int32_t qb_list_empty (const struct qb_list_head * head) [inline, static int32_t qb_list_empty (const struct qb_list_head *head) [inline,
static] static]
A quick test to see if the list is empty (pointing to it's self). Pa A quick test to see if the list is empty (pointing to it's self)'. P
rameters: arameters:
head pointer to the list head head pointer to the list head
Returns: Returns:
boolean true/false boolean true/false
References qb_list_head::next. References qb_list_head::next.
static void qb_list_init (struct qb_list_head * head) [inline, static] static void qb_list_init (struct qb_list_head *head) [inline, static]
Initialize the list entry. Points next and prev pointers to head. Initialize the list entry'. Points next and prev pointers to head'.
Parameters: Parameters:
head pointer to the list head head pointer to the list head
References qb_list_head::next, and qb_list_head::prev. References qb_list_head::next, and qb_list_head::prev.
static int32_t qb_list_length (struct qb_list_head * head) [inline, stat static int32_t qb_list_length (struct qb_list_head *head) [inline, stati
ic] c]
Count the number of items in the list. Parameters: Count the number of items in the list'. Parameters:
head,: the head for your list. head,: the head for your list'.
Returns: Returns:
length of the list. length of the list'.
References qb_list_for_each. References qb_list_for_each.
static void qb_list_splice (struct qb_list_head * list, struct qb_list_h static void qb_list_splice (struct qb_list_head *list, struct qb_list_he
ead * head) [inline, static] ad *head) [inline, static]
Join two lists. Parameters: Join two lists'. Parameters:
list the new list to add. list the new list to add'.
head the place to add it in the first list. head the place to add it in the first list'.
Note: Note:
The 'list' is reinitialised The 'list' is reinitialised
References qb_list_head::next, and qb_list_head::prev. References qb_list_head::next, and qb_list_head::prev.
Author Author
Generated automatically by Doxygen for libqb from the source code. Generated automatically by Doxygen for libqb from the source code'.
Version 0.4.1 Mon Jan 31 2011 qblist .h(3) Version 0.8.1 Thu Jan 5 2012 qblist .h(3)
 End of changes. 37 change blocks. 
66 lines changed or deleted 99 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/