libft/sources/libft_srcs/ft_lstdel.c
void	ft_lstdel(t_list **alst, void (*del)(void *, size_t))
{
	t_list *temp;

	if (!del)
		return ;
	while (*alst)
	{
		temp = (*alst)->next;
		del((*alst)->content, (*alst)->content_size);
		free(*alst);
		*alst = temp;
	}
	free(*alst);
	*alst = NULL;
}
/*
** Takes as a parameter the adress of a pointer to a link and
** frees the memory of this link and every successors of that link
** using the functions del and free(3). Finally the pointer to
** the link that was just freed must be set to NULL (quite similar
** to the function ft_memdel from the mandatory part).
*/
Takes as a parameter the adress of a pointer to a link and
frees the memory of this link and every successors of that link
using the functions del and free(3). Finally the pointer to
the link that was just freed must be set to NULL (quite similar
to the function ft_memdel from the mandatory part).
Takes as a parameter the adress of a pointer to a link and frees the memory of this link and every successors of that link using the functions del and free ( 3 ) . Finally the pointer to the link that was just freed must be set to NULL ( quite similar to the function ft_memdel from the mandatory part ) .
void	ft_lstdel(t_list **alst, void (*del)(void *, size_t))
{
	t_list *temp;
	if (!del)
		return ;
	while (*alst)
	{
		temp = (*alst)->next;
		del((*alst)->content, (*alst)->content_size);
		free(*alst);
		*alst = temp;
	}
	free(*alst);
	*alst = NULL;
}
void ft_lstdel ( t_list * * alst , void ( * del ) ( void * , size_t ) ) { t_list * temp ; if ( ! del ) return ; while ( * alst ) { temp = ( * alst ) -> next ; del ( ( * alst ) -> content , ( * alst ) -> content_size ) ; free ( * alst ) ; * alst = temp ; } free ( * alst ) ; * alst = NULL ; }
Takes as a parameter the adress of a pointer to a link and
frees the memory of this link and every successors of that link
using the functions del and free(3).
Takes as a parameter the adress of a pointer to a link and frees the memory of this link and every successors of that link using the functions del and free ( 3 ) .