static t_list *split(t_list *list, char c) { t_list *ret; t_node *node; char *tmp; void (*del)(void **); ret = ft_listcreate(); node = list->start; tmp = STR_EMPTY; del = ft_memdel; while (node) { splitnext(ret, node->content, &tmp, c); node = node->next; } ret = ft_listadd(ret, tmp); ft_listdel(&list, del); return (ret); }
void ft_listdel(t_list **alst, void (*del)(void*, size_t)) { if ((*alst)->next) ft_listdel(&(*alst)->next, del); ft_lstdelone(alst, del); }