diff options
author | Danny Holman <dholman@gymli.org> | 2025-03-20 14:15:38 -0500 |
---|---|---|
committer | Danny Holman <dholman@gymli.org> | 2025-03-20 14:18:49 -0500 |
commit | adaecb65eaa1abf437a24c93a08b2b7c2266c5dc (patch) | |
tree | 8b70c3f85648a12c6e6b7308489033653235aa64 /include/rune/util/list.h | |
parent | 7281fe8fdbb64a83bc0f569ef01db33a1f26ac98 (diff) |
core: refactor core API to be in proper style
Bring the rest of the core API to be in line with the project coding
style. This commit also makes the coding style change formal by updating
the coding style document in the documentation.
Signed-off-by: Danny Holman <dholman@gymli.org>
Diffstat (limited to 'include/rune/util/list.h')
-rw-r--r-- | include/rune/util/list.h | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/include/rune/util/list.h b/include/rune/util/list.h index 556e085..c011cb3 100644 --- a/include/rune/util/list.h +++ b/include/rune/util/list.h @@ -27,18 +27,18 @@ /** * Linux-kernel combatible linked list implementation */ -struct list_head { +typedef struct list_head { struct list_head *next; ///< Next list element struct list_head *prev; ///< Previous list element -}; +} list_head_t; /** * \brief Add element to the end of a list - * \param[in] new Pointer to struct list_head, part of another struct + * \param[in] new Pointer to list_head_t, 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; +static inline void list_add(list_head_t *new, list_head_t *head) { + list_head_t *temp = head; while (temp->next != NULL) temp = temp->next; @@ -49,11 +49,11 @@ static inline void list_add(struct list_head *new, struct list_head *head) { /** * \brief Remove element from a list - * \param[in] item Pointer to struct list_head, part of another struct + * \param[in] item Pointer to list_head_t, 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; +static inline void list_del(list_head_t *item) { + list_head_t *next = item->next; + list_head_t *prev = item->prev; if (next != NULL) next->prev = prev; if (prev != NULL) |