You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
1.4 KiB
47 lines
1.4 KiB
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* ft_print_strings.c :+: :+: :+: */
|
|
/* +:+ +:+ +:+ */
|
|
/* By: narnaud <narnaud@student.42.fr> +#+ +:+ +#+ */
|
|
/* +#+#+#+#+#+ +#+ */
|
|
/* Created: 2021/10/27 08:09:49 by narnaud #+# #+# */
|
|
/* Updated: 2021/11/17 09:40:16 by narnaud ### ########.fr */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
|
|
#include "ft_printf.h"
|
|
|
|
static t_dlist *list = NULL;
|
|
|
|
void add_string(char *str, size_t size)
|
|
{
|
|
list = ft_dlst_add(list, str);
|
|
list->size = size;
|
|
}
|
|
|
|
t_dlist *get_last(void)
|
|
{
|
|
return list;
|
|
}
|
|
|
|
t_dlist *get_first(void)
|
|
{
|
|
t_dlist *tmp = list;
|
|
while (tmp->previous)
|
|
tmp = tmp->previous;
|
|
return tmp;
|
|
}
|
|
|
|
void clean_list(void)
|
|
{
|
|
t_dlist *tmp = list;
|
|
while (list)
|
|
{
|
|
tmp = list;
|
|
free(list->content);
|
|
free(list);
|
|
list = tmp->previous;
|
|
}
|
|
list = NULL;
|
|
}
|
|
|