-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_ldcddel_tail.c
executable file
·31 lines (28 loc) · 1.21 KB
/
ft_ldcddel_tail.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_ldcddel_tail.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: tseguier <tseguier@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2013/12/06 02:32:26 by tseguier #+# #+# */
/* Updated: 2014/03/27 18:38:31 by jcoignet ### ########.fr */
/* */
/* ************************************************************************** */
#include <stdlib.h>
#include "libft.h"
#include "ft_ldcd_cell.h"
void ft_ldcddel_tail(t_ldcd ldcd)
{
t_ldcd_cell temp;
if (!ldcd || !ldcd->tail)
return ;
if (!ldcd->tail->prev)
ldcd->head = NULL;
else
ldcd->tail->prev->next = NULL;
temp = ldcd->tail;
ldcd->tail = ldcd->tail->prev;
ft_ldcd_celldel(&temp, ft_memdel);
--(ldcd->size);
}