Go to the source code of this file.
|  | 
| #define | GTG_LIST_INIT(ptr) | 
|  | initialize a list.  More... 
 | 
|  | 
| #define | GTG_LIST(name) | 
|  | declare and initialize a list.  More... 
 | 
|  | 
| #define | gtg_list_entry(ptr, type, member)   ((type *)((char *)(ptr) - (char *)(&((type *)0)->member))) | 
|  | get the structure corresponding to a list entry  More... 
 | 
|  | 
| #define | gtg_list_for_each(pos, head)   for (pos = (head)->next; pos != (head); pos = pos->next) | 
|  | 
| #define | gtg_list_for_each_reverse(pos, head)   for (pos = (head)->prev; pos != (head); pos = pos->prev) | 
|  | 
| #define | gtg_list_for_each_safe(pos, n, head) | 
|  | 
| #define | gtg_list_for_each_entry(pos, head, member) | 
|  | iterate over list of given type  More... 
 | 
|  | 
| #define | gtg_list_for_each_entry_safe(pos, n, head, member) | 
|  | iterate over list of given type safe against removal of list entry  More... 
 | 
|  | 
Value:
#define GTG_LIST_INIT(ptr)
initialize a list. 
Definition: GTGList.h:16
 
declare and initialize a list. 
- Parameters
- 
  
  
 
 
      
        
          | gtg_list_entry | ( |  | ptr, | 
        
          |  |  |  | type, | 
        
          |  |  |  | member | 
        
          |  | ) |  | ((type *)((char *)(ptr) - (char *)(&((type *)0)->member))) | 
      
 
get the structure corresponding to a list entry 
- Parameters
- 
  
    | ptr | pointer to the list entry (gtg_list_t) |  | type | the type of the struct this is embedded in. |  | member | the name of the struct gtg_list member within the struct. |  
 
 
 
      
        
          | #define gtg_list_for_each | ( |  | pos, | 
        
          |  |  |  | head | 
        
          |  | ) |  | for (pos = (head)->next; pos != (head); pos = pos->next) | 
      
 
 
      
        
          | #define gtg_list_for_each_entry | ( |  | pos, | 
        
          |  |  |  | head, | 
        
          |  |  |  | member | 
        
          |  | ) |  |  | 
      
 
Value:
       &pos->member != (head);                                          \
#define gtg_list_entry(ptr, type, member)
get the structure corresponding to a list entry 
Definition: GTGList.h:39
struct gtg_list * next
Definition: GTGList.h:6
 
iterate over list of given type 
gtg_list_for_each_entry(pos, head, member) 
- Parameters
- 
  
    | pos | the type * to use as a loop counter. |  | head | the head for the list. |  | member | the name of the struct gtg_list member within the struct. |  
 
 
 
      
        
          | #define gtg_list_for_each_entry_safe | ( |  | pos, | 
        
          |  |  |  | n, | 
        
          |  |  |  | head, | 
        
          |  |  |  | member | 
        
          |  | ) |  |  | 
      
 
Value:
       &pos->member != (head);                                          \
#define gtg_list_entry(ptr, type, member)
get the structure corresponding to a list entry 
Definition: GTGList.h:39
struct gtg_list * next
Definition: GTGList.h:6
 
iterate over list of given type safe against removal of list entry 
gtg_list_for_each_entry_safe(pos, n, head, member) 
- Parameters
- 
  
    | pos | the type * to use as a loop counter. |  | n | another type * to use as temporary storage |  | head | the head for the list. |  | member | the name of the struct gtg_list member within the struct. |  
 
 
 
      
        
          | #define gtg_list_for_each_reverse | ( |  | pos, | 
        
          |  |  |  | head | 
        
          |  | ) |  | for (pos = (head)->prev; pos != (head); pos = pos->prev) | 
      
 
 
      
        
          | #define gtg_list_for_each_safe | ( |  | pos, | 
        
          |  |  |  | n, | 
        
          |  |  |  | head | 
        
          |  | ) |  |  | 
      
 
Value:for (pos = (head)->
next, n = pos->
next; pos != (head);  \
 
struct gtg_list * next
Definition: GTGList.h:6
 
 
Value:do {                                            \
  } while(0)
struct gtg_list * prev
Definition: GTGList.h:5
struct gtg_list * next
Definition: GTGList.h:6
initialize a list. 
- Parameters
- 
  
    | ptr | pointer to the list (gtg_list_t). |  
 
 
 
Delete a list entry by making the prev/next entries point to each other.
This is only for internal list manipulation where we know the prev/next entries already! 
 
 
Insert a new entry after the specified head. 
- Parameters
- 
  
    | lnew | new entry to be added |  | head | list head to add it after |  
 
 
 
Insert a new entry before the specified head (ie. at the tail of the list). 
- Parameters
- 
  
    | lnew | new entry to be added |  | head | list head to add it after |  
 
 
 
delete an entry from its list and reinitialize it. 
- Parameters
- 
  
    | entry | the element to delete from the list. |