Started to clean comments

This commit is contained in:
Ulysse Cura 2025-08-07 19:31:41 +02:00
parent 9d095a93a8
commit f88901058f
1 changed files with 24 additions and 19 deletions

View File

@ -3,32 +3,37 @@
#include <gint/defs/types.h> #include <gint/defs/types.h>
/* elem_t: Element struct for linked lists /**
This struct is the base for storing data. * @brief Element struct for linked lists.
* This struct is the base for storing data.
@data Raw pointer to any type of data *
@prev Pointer to the prev element in the linked list * @param data Raw pointer to any type of data
@next Pointer to the next element in the linked list */ * @param prev Pointer to the prev element in the linked list
* @param next Pointer to the next element in the linked list
*/
typedef struct elem_t { typedef struct elem_t {
void *data; void *data;
struct elem_t *prev; struct elem_t *prev;
struct elem_t *next; struct elem_t *next;
} elem_t; } elem_t;
/* deleter_t: A type for deleters used during the destruction of data stored in elements /**
* @brief A type for deleters used during the destruction of data stored in elements.
During the initialisation of linked lists you can pass in argument a deleter. *
It is used during the destruction of an element. * During the initialisation of linked lists you can pass in argument a deleter.
You can pass NULL to the initialisation to use the default deleter (kfree(elem->data)). * It is used during the destruction of an element.
Your deleter_t function declaration must look like this : * You can pass NULL to the initialisation to use the default deleter (kfree(elem->data)).
* Your deleter_t function declaration must look like this :
void name_of_your_deleter(void *data); *
* @example void name_of_your_deleter(void *data);
Then do what you need to destroy your data (don't forget to free the data itself...). *
You should always define your function with "inline" if it's no too long. */ * Then do what you need to destroy your data (don't forget to free the data itself...).
* You should always define your function with "inline" if it's no too long.
*/
typedef void (*deleter_t)(void *data); typedef void (*deleter_t)(void *data);
/* condition_t: A type for condition used for function like linked_list_remove_if /**
* @brief A type for condition used for function like linked_list_remove_if
For function like linked_list_remove_if you need a condition. For function like linked_list_remove_if you need a condition.
It have two argument which are "elem_t *" and "va_list", that is because it passes the element on the actual index It have two argument which are "elem_t *" and "va_list", that is because it passes the element on the actual index
@ -232,4 +237,4 @@ void linked_list_remove_if(linked_list_t *linked_list, const condition_t conditi
@... Argument to pass to the condition */ @... Argument to pass to the condition */
void linked_list_for_each(const linked_list_t *linked_list, const action_t action, ...); void linked_list_for_each(const linked_list_t *linked_list, const action_t action, ...);
#endif // LINKED_LIST_H #endif // LINKED_LIST_H