mirror of
https://codeberg.org/la-chouette/minishell.git
synced 2025-12-06 07:28:09 +01:00
25 lines
1.2 KiB
C
25 lines
1.2 KiB
C
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* ft_lstdelone_bonus.c :+: :+: :+: */
|
|
/* +:+ +:+ +:+ */
|
|
/* By: jguelen <marvin@42.fr> +#+ +:+ +#+ */
|
|
/* +#+#+#+#+#+ +#+ */
|
|
/* Created: 2024/10/21 14:44:36 by jguelen #+# #+# */
|
|
/* Updated: 2024/10/23 16:33:32 by jguelen ### ########.fr */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
|
|
#include "libft.h"
|
|
#include <stdlib.h>
|
|
|
|
/*Presumes del != NULL
|
|
Allows one to delete one single element of the generic chain.
|
|
The user is responsible of the dealing with any other element.*/
|
|
void ft_lstdelone(t_list *lst, void (*del)(void *))
|
|
{
|
|
if (lst == NULL)
|
|
return ;
|
|
del(lst->content);
|
|
free(lst);
|
|
}
|