Libft
42 Libft library documentation
Loading...
Searching...
No Matches
ft_lstdelone.c
Go to the documentation of this file.
1/* ************************************************************************** */
2/* */
3/* ::: :::::::: */
4/* ft_lstdelone.c :+: :+: :+: */
5/* +:+ +:+ +:+ */
6/* By: raphalme <raphalme@student.42.fr> +#+ +:+ +#+ */
7/* +#+#+#+#+#+ +#+ */
8/* Created: 2025/12/29 19:20:00 by raphalme #+# #+# */
9/* Updated: 2026/04/14 10:36:21 by raphalme ### ########.fr */
10/* */
11/* ************************************************************************** */
12
13#include <stdlib.h>
14#include "../includes/types.h"
15
24void ft_lstdelone(t_list *lst, void (*del)(void*))
25{
26 if (!lst || !del)
27 return ;
28 del(lst->content);
29 free(lst);
30}
void ft_lstdelone(t_list *lst, void(*del)(void *))
Deletes and frees a single element from a linked list. This function takes an element from a linked l...
Definition types.h:4
void * content
Definition types.h:5