/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_print_strings.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: narnaud +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* 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; }