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