t_list *ft_lstnew(void const *content, size_t content_size) { t_list *to_return; to_return = ft_listcreate(content); content_size = 0; return (to_return); }
int ft_gnl_list(int const fd, char **line) { static t_list *all[GNL_FD_MAX]; char ret; if (!all[fd]) { all[fd] = ft_listcreate(); if ((ret = readfile(fd, all[fd])) == -1) { ft_strdel(line); *line = STR_EMPTY; RETURN_FAIL }
void ft_listpushback(t_list **list, void *data) { t_list *newn; t_list *tmp; newn = ft_listcreate(data); if (list && newn) { if (*list) { tmp = *list; while (tmp->next) tmp = tmp->next; tmp->next = newn; } else *list = newn; } }
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); }