-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_dlstadd_circle.c
31 lines (27 loc) · 1.23 KB
/
ft_dlstadd_circle.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_dlstadd_circle.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: lrocigno <lrocigno@student.42sp.org.br> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/11/09 00:32:08 by lrocigno #+# #+# */
/* Updated: 2021/11/22 14:00:27 by lrocigno ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
/*
** Add a new item to the bottom of a circle double linked list. It consider the
** informed node as the head.
*/
void ft_dlstadd_circle(void *content, t_dlist **d_list)
{
t_dlist *tail;
t_dlist *add;
tail = (*d_list)->prev;
add = ft_dlstnew(content);
tail->next = add;
add->prev = tail;
add->next = *d_list;
(*d_list)->prev = add;
}