Go to the source code of this file.
|
#define | fromlist(T, LF, LP) ((T*) ((char*)(LP) - offsetof(T, LF))) |
|
#define fromlist |
( |
|
T, |
|
|
|
LF, |
|
|
|
LP |
|
) |
| ((T*) ((char*)(LP) - offsetof(T, LF))) |
Convert to and from structures and linked lists T - type, LF - list field name, LP - list pointer
Doubly-linked list data type
Appends the source list to the target list. Returns the new head.
- Parameters
-
target | The list to append to |
source | The list to append |
Chop the given item out of the list, updating the prev and next. Returns the head of the list (may not have changed)
- Parameters
-
list | The list item to remove |
Remove all the given list items. Returns the new head
- Parameters
-
items | List of list items to remove |
Find the head of a list
- Parameters
-
Find the tail of a list
- Parameters
-
Insert an item to a list. Returns the head.
- Parameters
-
list | The list to mutate |
insert | The list item to insert |
Insert all the given items to the list. Returns the new head.
- Parameters
-
list | The list to mutate |
items | List of list items to insert |
unsigned int length |
( |
List * |
list | ) |
|
Get the length of the list
- Parameters
-
void setnext |
( |
List * |
list, |
|
|
List * |
next |
|
) |
| |
Set the next entry of a list.
- Parameters
-
list | The list to mutate |
next | The new next entry |
void setprev |
( |
List * |
list, |
|
|
List * |
prev |
|
) |
| |
Set the previous entry of a list.
- Parameters
-
list | The list to mutate |
prev | The new prev entry |