diff options
author | Danny Holman <dholman@gymli.org> | 2024-10-25 23:02:31 -0500 |
---|---|---|
committer | Danny Holman <dholman@gymli.org> | 2024-10-25 23:02:31 -0500 |
commit | 6e8177dae93f592b1d39cd6d6e77c9e6f254360f (patch) | |
tree | 2735f467cec1ae73b9382ac057f817fae1f94dac /include/rune/util/list.h | |
parent | 71befd8eaf7244badb0188b751066afacb8d8ee3 (diff) |
core: add documentation comments to API functions
Add documentation comments to the functions and structures exposed
through the Rune API.
Signed-off-by: Danny Holman <dholman@gymli.org>
Diffstat (limited to 'include/rune/util/list.h')
-rw-r--r-- | include/rune/util/list.h | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/include/rune/util/list.h b/include/rune/util/list.h index ed6db5e..556e085 100644 --- a/include/rune/util/list.h +++ b/include/rune/util/list.h @@ -24,12 +24,20 @@ #include <stddef.h> -RAPI struct list_head { - struct list_head *next; - struct list_head *prev; +/** + * Linux-kernel combatible linked list implementation + */ +struct list_head { + struct list_head *next; ///< Next list element + struct list_head *prev; ///< Previous list element }; -RAPI static inline void list_add(struct list_head *new, struct list_head *head) { +/** + * \brief Add element to the end of a list + * \param[in] new Pointer to struct list_head, part of another struct + * \param[in] head Start point of the list to be added to + */ +static inline void list_add(struct list_head *new, struct list_head *head) { struct list_head *temp = head; while (temp->next != NULL) temp = temp->next; @@ -39,7 +47,11 @@ RAPI static inline void list_add(struct list_head *new, struct list_head *head) new->next = NULL; } -RAPI static inline void list_del(struct list_head *item) { +/** + * \brief Remove element from a list + * \param[in] item Pointer to struct list_head, part of another struct + */ +static inline void list_del(struct list_head *item) { struct list_head *next = item->next; struct list_head *prev = item->prev; if (next != NULL) |