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.

52 lines
1.4 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 #+# #+# */
2 years ago
/* Updated: 2023/04/11 08:07:11 by narnaud ### ########.fr */
3 years ago
/* */
/* ************************************************************************** */
#include "ft_printf.h"
2 years ago
static t_dlist *g_list = NULL;
2 years ago
void add_string(char *str, size_t size)
{
2 years ago
g_list = ft_dlst_add(g_list, str);
g_list->size = size;
}
2 years ago
t_dlist *get_last(void)
3 years ago
{
2 years ago
return (g_list);
}
3 years ago
2 years ago
t_dlist *get_first(void)
{
2 years ago
t_dlist *tmp;
tmp = g_list;
while (tmp->previous)
tmp = tmp->previous;
return (tmp);
3 years ago
}
2 years ago
void clean_list(void)
3 years ago
{
2 years ago
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;
3 years ago
}