|
libft
|
Linked list operations for libft. More...
#include "libft.h"
Include dependency graph for ft_list.c:Functions | |
| void | ft_del (void *content) |
| Deletes content pointer in a list node (utility function). | |
| void | ft_lstadd_back (t_list **lst, t_list *new) |
| Adds a node to the end of a list. | |
| void | ft_lstadd_front (t_list **lst, t_list *new) |
| Adds a node to the front of a list. | |
| void | ft_lstclear (t_list **lst, void(*del)(void *)) |
| Clears an entire list, deleting all its nodes. | |
| void | ft_lstdelone (t_list *lst, void(*del)(void *)) |
| Deletes a single node using a deletion function. | |
| void | ft_lstiter (t_list *lst, void(*f)(void *)) |
| Applies a function to each element of the list. | |
| t_list * | ft_lstlast (t_list *lst) |
| Returns the last node of the list. | |
| t_list * | ft_lstmap (t_list *lst, void *(*f)(void *), void(*del)(void *)) |
| Creates a new list by applying a function to each node. | |
| t_list * | ft_lstnew (void *content) |
| Creates a new list node. | |
| int | ft_lstsize (t_list *lst) |
| Counts the number of nodes in a list. | |
Linked list operations for libft.
This file implements singly linked list operations for the custom libft library. It includes allocation, traversal, insertion, deletion, mapping, and utility functions. The functions operate on the t_list struct which stores a void* content pointer and a pointer to the next node.
These functions provide a flexible way to manipulate generic data structures, suitable for various use cases including stack, queue, and basic graph algorithms.