-
Notifications
You must be signed in to change notification settings - Fork 0
/
lst_utils_two.c
36 lines (32 loc) · 1.25 KB
/
lst_utils_two.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
32
33
34
35
36
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* lst_utils_two.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: llacaze <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2018/01/24 15:58:38 by llacaze #+# #+# */
/* Updated: 2018/01/24 16:00:15 by llacaze ### ########.fr */
/* */
/* ************************************************************************** */
#include "ft_ls.h"
t_info *go_end(t_info *finfo)
{
t_info *tmp;
while (finfo->next != NULL)
{
tmp = finfo;
finfo = finfo->next;
finfo->prev = tmp;
}
return (finfo);
}
t_info *add_end(t_info *finfo, t_info *recursive)
{
recursive = go_begin(recursive);
while (finfo->next != NULL)
finfo = finfo->next;
finfo->next = recursive;
recursive = finfo->next;
return (finfo);
}