-
Notifications
You must be signed in to change notification settings - Fork 12
/
ft_lstdelone.c
31 lines (28 loc) · 1.28 KB
/
ft_lstdelone.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_lstdelone.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: apuchill <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/02/07 17:06:49 by apuchill #+# #+# */
/* Updated: 2020/02/19 14:04:07 by apuchill ### ########.fr */
/* */
/* ************************************************************************** */
/*
** LIBRARY: N/A
** SYNOPSIS: delete element from list
**
** DESCRIPTION:
** Takes as a parameter an element and frees the memory of the element’s
** content using the function ’del’ given as a parameter and free the element.
** The memory of ’next’ must not be freed.
*/
#include "libft.h"
void ft_lstdelone(t_list *lst, void (*del)(void *))
{
if (!lst)
return ;
del(lst->content);
free(lst);
}