Added memorybook to parsing and cleaned most of the files

This commit is contained in:
Philippe BLAGOJEVIC
2022-05-04 14:38:34 +02:00
parent e564e7c8e9
commit 362668fe35
231 changed files with 11474 additions and 405 deletions

View File

@@ -0,0 +1,31 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_lsterase.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: simplonco <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/03/24 15:31:16 by simplonco #+# #+# */
/* Updated: 2022/05/04 14:17:57 by pblagoje ### ########.fr */
/* */
/* ************************************************************************** */
/*
* erase an element in two-way list
* and rejoin the list
*/
#include "libft.h"
void ft_lsterase(t_list *lst, void (*del)(void *))
{
if (!lst || !del)
return ;
del(lst->content);
if (lst->prev)
lst->prev->next = lst->next;
if (lst->next)
lst->next->prev = lst->prev;
free(lst);
lst = NULL;
}