aboutsummaryrefslogtreecommitdiff
path: root/include/libft_lst.h
diff options
context:
space:
mode:
authorCharles <sircharlesaze@gmail.com>2020-04-01 21:51:51 +0200
committerCharles <sircharlesaze@gmail.com>2020-04-01 21:58:05 +0200
commit65c5d5157e890e9f9445a94fb2d7f660e5492d8e (patch)
tree78613f26bdc531104c3e32d76ffcaf3c2f7013f5 /include/libft_lst.h
parentc128213daa677d548bfc2905496257fe4a4faf79 (diff)
parenta1675f56b35f5521a91851bae8ca650706374ae6 (diff)
downloadlibft-65c5d5157e890e9f9445a94fb2d7f660e5492d8e.tar.gz
libft-65c5d5157e890e9f9445a94fb2d7f660e5492d8e.tar.bz2
libft-65c5d5157e890e9f9445a94fb2d7f660e5492d8e.zip
Merge branch 'minishell'
Diffstat (limited to 'include/libft_lst.h')
-rw-r--r--include/libft_lst.h27
1 files changed, 19 insertions, 8 deletions
diff --git a/include/libft_lst.h b/include/libft_lst.h
index a48c1aa..d7157a9 100644
--- a/include/libft_lst.h
+++ b/include/libft_lst.h
@@ -6,36 +6,47 @@
/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/01/31 10:36:39 by cacharle #+# #+# */
-/* Updated: 2020/02/17 03:05:36 by cacharle ### ########.fr */
+/* Updated: 2020/04/01 17:59:50 by charles ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef LIBFT_LST_H
# define LIBFT_LST_H
+/*
+** \file libft_lst.h
+** \brief Linked list Manipulation
+*/
+
# include <stdlib.h>
# include "libft_types.h"
# include "libft_algo.h"
+/*
+** \brief List struct
+** \param data Pointer to node data
+** \param next Pointer to next node or NULL if last node
+*/
+
typedef struct s_ftlst
{
- void *content;
+ void *data;
struct s_ftlst *next;
} t_ftlst;
-typedef void (*t_ftdel_func)(void *);
+typedef void (*t_ftdel_func)(void *);
-t_ftlst *ft_lstnew(void const *content);
-void ft_lstadd_front(t_ftlst **alst, t_ftlst *new);
+t_ftlst *ft_lstnew(void const *data);
int ft_lstsize(t_ftlst *lst);
+void ft_lstpush_front(t_ftlst **alst, t_ftlst *new);
+void ft_lstpush_back(t_ftlst **alst, t_ftlst *new);
+void ft_lstpop_front(t_ftlst **lst, void (*del)(void *));
t_ftlst *ft_lstlast(t_ftlst *lst);
-void ft_lstadd_back(t_ftlst **alst, t_ftlst *new);
void ft_lstdelone(t_ftlst *lst, void (*del)(void *));
-void ft_lstclear(t_ftlst **lst, void (*del)(void *));
+void ft_lstdestroy(t_ftlst **lst, void (*del)(void *));
void ft_lstiter(t_ftlst *lst, void (*f)(void *));
t_ftlst *ft_lstmap(t_ftlst *lst, void *(*f)(void *),
t_ftdel_func del);
-void ft_lstpop_front(t_ftlst **lst, void (*del)(void *));
t_ftlst *ft_lstreverse_ret(t_ftlst *lst);
void ft_lstreverse(t_ftlst **lst);
void ft_lstremove_if(t_ftlst **lst,