int splitline(char **argv, int max, char *line) { char *s; int i = 0; s = line; while(*s && i < max) { argv[i] = splitnext(&s); i++; } if(!argv[0]) return(0); return i; }
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); }