From 901402c99018422c994bdb297e3ba404969c88ea Mon Sep 17 00:00:00 2001 From: Charles Date: Mon, 30 Mar 2020 22:26:36 +0200 Subject: Added documentation for ht and lst --- src/lst/ft_lstremove_if.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/lst/ft_lstremove_if.c') diff --git a/src/lst/ft_lstremove_if.c b/src/lst/ft_lstremove_if.c index 03643fa..fdac710 100644 --- a/src/lst/ft_lstremove_if.c +++ b/src/lst/ft_lstremove_if.c @@ -10,9 +10,15 @@ /* */ /* ************************************************************************** */ -#include "libft.h" #include "libft_lst.h" +/** +** \brief Remove node on some condition +** \param cmp Comparison function, return 0 if equal +** \param ref Reference data passed has the first arg of `cmp` +** \param del Delete function to free removed node data +*/ + void ft_lstremove_if(t_ftlst **lst, t_ftcompar_func cmp, const void *ref, t_ftdel_func del) { @@ -20,7 +26,7 @@ void ft_lstremove_if(t_ftlst **lst, t_ftcompar_func cmp, if (lst == NULL || *lst == NULL) return ; - if (cmp(ref, (*lst)->content) == 0) + if (cmp(ref, (*lst)->data) == 0) { saved_next = (*lst)->next; ft_lstdelone(*lst, del); -- cgit