libft
Functions
ft_lstdelone.c File Reference
#include "libft.h"
#include <stdlib.h>
+ Include dependency graph for ft_lstdelone.c:

Go to the source code of this file.

Functions

void ft_lstdelone (t_list **alst, void(*del)(void *, size_t))
 Deletes one link of a list. More...
 

Function Documentation

◆ ft_lstdelone()

void ft_lstdelone ( t_list **  alst,
void(*)(void *, size_t)  del 
)

Deletes one link of a list.

Takes as a parameter a link’s pointer address and frees the memory of the link’s content using the function del given as a parameter, then frees the link’s memory using free. The memory of next must not be freed under any circumstance. Finally, the pointer to the link that was just freed must be set to NULL (quite similar to the function memdel).

Parameters
alstThe adress of a pointer to a link that needs to be freed.
delThe address of a function to apply to each link of a list.

Definition at line 29 of file ft_lstdelone.c.