![]() |
Tenok
A Linux-like Real-Time Operating System for Robotics and Internet of Things
|
#include <stddef.h>

Go to the source code of this file.
Data Structures | |
| struct | list_head |
Macros | |
| #define | container_of(ptr, type, member) ((type *) ((void *) ptr - offsetof(type, member))) |
| Get the object entry. More... | |
| #define | list_entry(ptr, type, member) container_of(ptr, type, member) |
| Get the object entry of a list. More... | |
| #define | list_first_entry(ptr, type, member) list_entry((ptr)->next, type, member) |
| Get the first object entry. More... | |
| #define | list_prev_entry(pos, member) list_entry((pos)->member.prev, typeof(*(pos)), member) |
| Get the previous object entry. More... | |
| #define | list_next_entry(pos, member) list_entry((pos)->member.next, typeof(*(pos)), member) |
| Get the next object entry. More... | |
| #define | list_entry_is_head(pos, head, member) (&pos->member == (head)) |
| Check if the list entry is at the end of the list. More... | |
| #define | list_for_each(pos, head) for ((pos) = (head)->next; (pos) != (head); (pos) = (pos)->next) |
| Iterate the whole list with list pointer. More... | |
| #define | list_for_each_safe(pos, _next, head) |
| Safely iterate the whole list with list pointer. More... | |
| #define | list_for_each_entry(pos, head, member) |
| Iterate the whole list with list entry. More... | |
| #define | LIST_HEAD_INIT(name) |
| Statically initialize the list head. More... | |
| #define | LIST_HEAD(name) struct list_head name = LIST_HEAD_INIT(name) |
| Declare and initialize a new list head. More... | |
| #define container_of | ( | ptr, | |
| type, | |||
| member | |||
| ) | ((type *) ((void *) ptr - offsetof(type, member))) |
Get the object entry.
| ptr | Pointer to the structure member. |
| type | Type of the object. |
| member | Name of the structure member. |
| &obj | Returning object. |
| #define list_entry | ( | ptr, | |
| type, | |||
| member | |||
| ) | container_of(ptr, type, member) |
Get the object entry of a list.
| ptr | Pointer to the list member of the object. |
| type | Type of the object. |
| member | Name of the list member in the structure. |
| &obj | Retuning object. |
| #define list_entry_is_head | ( | pos, | |
| head, | |||
| member | |||
| ) | (&pos->member == (head)) |
Check if the list entry is at the end of the list.
| pos | Position of the object in the list. |
| member | Name of the list member in the structure. |
| bool | true or false. |
| #define list_first_entry | ( | ptr, | |
| type, | |||
| member | |||
| ) | list_entry((ptr)->next, type, member) |
Get the first object entry.
| ptr | Head of the list. |
| type | Type of the object. |
| member | Name of the list member in the structure. |
| &obj | Retunring object. |
| #define list_for_each | ( | pos, | |
| head | |||
| ) | for ((pos) = (head)->next; (pos) != (head); (pos) = (pos)->next) |
Iterate the whole list with list pointer.
| pos | Current position of the object in the list. |
| head | Head of the list. |
| None |
| #define list_for_each_entry | ( | pos, | |
| head, | |||
| member | |||
| ) |
Iterate the whole list with list entry.
| pos | Current position of the object in the list. |
| head | Head of the list. |
| member | Name of the list member in the structure. |
| None |
| #define list_for_each_safe | ( | pos, | |
| _next, | |||
| head | |||
| ) |
Safely iterate the whole list with list pointer.
| pos | Current position of the object in the list. |
| head | Head of the list. |
| None |
| #define LIST_HEAD | ( | name | ) | struct list_head name = LIST_HEAD_INIT(name) |
Declare and initialize a new list head.
| name | Name of the list head variable. |
| None |
| #define LIST_HEAD_INIT | ( | name | ) |
Statically initialize the list head.
| name | Name of the list head variable. |
| None |
| #define list_next_entry | ( | pos, | |
| member | |||
| ) | list_entry((pos)->member.next, typeof(*(pos)), member) |
Get the next object entry.
| pos | Current position of the object in the list. |
| member | Name of the list member in the structure. |
| &obj | Returning object. |
| #define list_prev_entry | ( | pos, | |
| member | |||
| ) | list_entry((pos)->member.prev, typeof(*(pos)), member) |
Get the previous object entry.
| pos | Current position of the object in the list. |
| member | Name of the list member in the structure. |
| &obj | Returning object. |