diff --git a/src/linked_list.h b/src/linked_list.h index f0e002b..3642b44 100644 --- a/src/linked_list.h +++ b/src/linked_list.h @@ -3,32 +3,37 @@ #include -/* elem_t: 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 - @next Pointer to the next element in the linked list */ +/** + * @brief Element struct for linked lists. + * This struct is the base for storing data. + * + * @param data Raw pointer to any type of data + * @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 { void *data; struct elem_t *prev; struct elem_t *next; } elem_t; -/* deleter_t: 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. - 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); - - 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. */ +/** + * @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. + * You can pass NULL to the initialisation to use the default deleter (kfree(elem->data)). + * Your deleter_t function declaration must look like this : + * + * @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. +*/ 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. 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 */ void linked_list_for_each(const linked_list_t *linked_list, const action_t action, ...); -#endif // LINKED_LIST_H \ No newline at end of file +#endif // LINKED_LIST_H