summaryrefslogtreecommitdiffstats
path: root/libft/ft_lstdelone_bonus.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--libft/ft_lstdelone_bonus.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/libft/ft_lstdelone_bonus.c b/libft/ft_lstdelone_bonus.c
new file mode 100644
index 0000000..42a1da8
--- /dev/null
+++ b/libft/ft_lstdelone_bonus.c
@@ -0,0 +1,25 @@
+/* ************************************************************************** */
+/* LE - / */
+/* / */
+/* ft_lstdelone.c .:: .:/ . .:: */
+/* +:+:+ +: +: +:+:+ */
+/* By: rbousset <marvin@le-101.fr> +:+ +: +: +:+ */
+/* #+# #+ #+ #+# */
+/* Created: 2019/10/13 10:11:20 by rbousset #+# ## ## #+# */
+/* Updated: 2019/10/13 10:18:40 by rbousset ### #+. /#+ ###.fr */
+/* / */
+/* / */
+/* ************************************************************************** */
+
+#include "libft.h"
+#include <stdlib.h>
+
+void
+ ft_lstdelone(t_list *lst, void (*del)(void *))
+{
+ if (lst)
+ {
+ del(lst->content);
+ free(lst);
+ }
+}