diff options
| author | Charles <sircharlesaze@gmail.com> | 2019-11-20 04:10:39 +0100 |
|---|---|---|
| committer | Charles <sircharlesaze@gmail.com> | 2019-11-20 04:10:39 +0100 |
| commit | fbdb3cab8614d2c81622604eb1eeb9f42a56c14f (patch) | |
| tree | 69b09a4729cedc78d097164e753089ad68509d60 /ft_lstpop_front_bonus.c | |
| parent | 9901cd05849fa0ef396f09f57b07807ebd96ca32 (diff) | |
| parent | 5bf49994b911abc2b8ff3bdb525cdc23c71f2102 (diff) | |
| download | libft-fbdb3cab8614d2c81622604eb1eeb9f42a56c14f.tar.gz libft-fbdb3cab8614d2c81622604eb1eeb9f42a56c14f.tar.bz2 libft-fbdb3cab8614d2c81622604eb1eeb9f42a56c14f.zip | |
Merge branch 'rendu'
Diffstat (limited to 'ft_lstpop_front_bonus.c')
| -rw-r--r-- | ft_lstpop_front_bonus.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/ft_lstpop_front_bonus.c b/ft_lstpop_front_bonus.c new file mode 100644 index 0000000..f81315a --- /dev/null +++ b/ft_lstpop_front_bonus.c @@ -0,0 +1,26 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_lstpop_front_bonus.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2019/10/25 03:32:51 by cacharle #+# #+# */ +/* Updated: 2019/10/25 03:35:58 by cacharle ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include <stdlib.h> +#include "libft.h" + +void ft_lstpop_front(t_list **lst, void (*del)(void *)) +{ + t_list *tmp; + + if (lst == NULL || *lst == NULL) + return ; + tmp = (*lst)->next; + del((*lst)->content); + free(*lst); + *lst = tmp; +} |
