blob: 7f826f57c02ce91334d46f1c33cbf5cf5ec5ba83 (
plain)
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
|
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_dlstdelone.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: charles <charles.cabergs@gmail.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/04/03 15:28:47 by charles #+# #+# */
/* Updated: 2020/04/03 15:40:32 by charles ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft_dlst.h"
void ft_dlstdelone(t_ftdlst *dlst, t_ftdel_func del)
{
if (dlst == NULL)
return ;
if (dlst->prev != NULL)
dlst->prev->next = dlst->next;
if (dlst->next != NULL)
dlst->next->prev = dlst->prev;
if (del != NULL)
del(dlst->data);
free(dlst);
}
|