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.
|
|
|
/* ************************************************************************** */
|
|
|
|
/* */
|
|
|
|
/* ::: :::::::: */
|
|
|
|
/* ft_print_strings.c :+: :+: :+: */
|
|
|
|
/* +:+ +:+ +:+ */
|
|
|
|
/* By: narnaud <narnaud@student.42.fr> +#+ +:+ +#+ */
|
|
|
|
/* +#+#+#+#+#+ +#+ */
|
|
|
|
/* Created: 2021/10/27 08:09:49 by narnaud #+# #+# */
|
|
|
|
/* Updated: 2023/04/11 08:07:11 by narnaud ### ########.fr */
|
|
|
|
/* */
|
|
|
|
/* ************************************************************************** */
|
|
|
|
|
|
|
|
#include "ft_printf.h"
|
|
|
|
|
|
|
|
static t_dlist *g_list = NULL;
|
|
|
|
|
|
|
|
void add_string(char *str, size_t size)
|
|
|
|
{
|
|
|
|
g_list = ft_dlst_add(g_list, str);
|
|
|
|
g_list->size = size;
|
|
|
|
}
|
|
|
|
|
|
|
|
t_dlist *get_last(void)
|
|
|
|
{
|
|
|
|
return (g_list);
|
|
|
|
}
|
|
|
|
|
|
|
|
t_dlist *get_first(void)
|
|
|
|
{
|
|
|
|
t_dlist *tmp;
|
|
|
|
|
|
|
|
tmp = g_list;
|
|
|
|
while (tmp->previous)
|
|
|
|
tmp = tmp->previous;
|
|
|
|
return (tmp);
|
|
|
|
}
|
|
|
|
|
|
|
|
void clean_list(void)
|
|
|
|
{
|
|
|
|
t_dlist *tmp;
|
|
|
|
|
|
|
|
tmp = g_list;
|
|
|
|
while (g_list)
|
|
|
|
{
|
|
|
|
tmp = g_list->previous;
|
|
|
|
free(g_list->content);
|
|
|
|
free(g_list);
|
|
|
|
g_list = tmp;
|
|
|
|
}
|
|
|
|
g_list = NULL;
|
|
|
|
}
|