aboutsummaryrefslogtreecommitdiff
path: root/include/ft_lst.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/ft_lst.h')
-rw-r--r--include/ft_lst.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/include/ft_lst.h b/include/ft_lst.h
new file mode 100644
index 0000000..134df71
--- /dev/null
+++ b/include/ft_lst.h
@@ -0,0 +1,36 @@
+/* ************************************************************************** */
+/* */
+/* ::: :::::::: */
+/* ft_lst.h :+: :+: :+: */
+/* +:+ +:+ +:+ */
+/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
+/* +#+#+#+#+#+ +#+ */
+/* Created: 2020/01/17 09:58:02 by cacharle #+# #+# */
+/* Updated: 2020/01/17 09:58:45 by cacharle ### ########.fr */
+/* */
+/* ************************************************************************** */
+
+#ifndef FT_LST_H
+# define FT_LST_H
+
+typedef struct s_list
+{
+ void *content;
+ struct s_list *next;
+} t_list;
+
+t_list *ft_lstnew(void const *content);
+void ft_lstadd_front(t_list **alst, t_list *new);
+int ft_lstsize(t_list *lst);
+t_list *ft_lstlast(t_list *lst);
+void ft_lstadd_back(t_list **alst, t_list *new);
+void ft_lstdelone(t_list *lst, void (*del)(void *));
+void ft_lstclear(t_list **lst, void (*del)(void *));
+void ft_lstiter(t_list *lst, void (*f)(void *));
+t_list *ft_lstmap(t_list *lst, void *(*f)(void *),
+ void (*del)(void *));
+void ft_lstpop_front(t_list **lst, void (*del)(void *));
+t_list *ft_lstreverse_ret(t_list *lst);
+void ft_lstreverse(t_list **lst);
+
+#endif