Projet de l'école 42 : Printf
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.

46 lines
1.3 KiB

3 years ago
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_print_strings.c :+: :+: :+: */
3 years ago
/* +:+ +:+ +:+ */
/* 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 */
3 years ago
/* */
/* ************************************************************************** */
#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)
3 years ago
{
return list;
}
3 years ago
t_dlist *get_first(void)
{
t_dlist *tmp = list;
while (tmp->previous)
tmp = tmp->previous;
return tmp;
3 years ago
}
void clean_list(void)
3 years ago
{
while (list)
{
free(list->content);
free(list);
list = list->previous;
}
list = NULL;
3 years ago
}