/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* lst_ind.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: tmaze +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2019/03/27 14:56:55 by tmaze #+# #+# */ /* Updated: 2019/03/27 17:45:17 by tmaze ### ########.fr */ /* */ /* ************************************************************************** */ #include "lem_in.h" t_ind *lst_indadd(t_ind **lst, int ind) { t_ind *new; if ((new = (t_ind*)ft_memalloc(sizeof(t_ind))) != NULL) { new->index = ind; new->next = *lst; *lst = new; } return (new); } void lst_inddel(t_ind **lst) { t_ind *tmp; while (*lst != NULL) { tmp = *lst; *lst = (*lst)->next; ft_memdel((void**)&tmp); } }