Adding the libft
This commit is contained in:
parent
1b98b537b7
commit
c947e43e51
62 changed files with 2098 additions and 19 deletions
25
libft/list/ft_lstclear.c
Normal file
25
libft/list/ft_lstclear.c
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* ft_lstclear.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: rparodi <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2023/11/12 11:40:37 by rparodi #+# #+# */
|
||||
/* Updated: 2023/11/12 19:34:19 by rparodi ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "libft.h"
|
||||
|
||||
void ft_lstclear(t_list **lst, void (*del)(void *))
|
||||
{
|
||||
t_list *tempo;
|
||||
|
||||
while (*lst)
|
||||
{
|
||||
tempo = (*lst)->next;
|
||||
ft_lstdelone(*lst, del);
|
||||
(*lst) = tempo;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue