ft_lstpop

This commit is contained in:
Jack Halford 2016-09-16 03:10:41 +02:00
parent 0d10f17f9d
commit f65b74dcb3
2 changed files with 12 additions and 0 deletions

11
libft/ft_lstpop.c Normal file
View file

@ -0,0 +1,11 @@
#include "libft.h"
t_list *ft_lstpop(t_list **lst)
{
t_list *top;
top = *lst;
if (*lst)
*lst = (*lst)->next;
return (top);
}

View file

@ -96,6 +96,7 @@ void ft_lst_cfree(void *ptr, size_t size);
t_list *ft_lst_filter(t_list *lst, void const *data_ref, t_list *(*f)(t_list *elem, void const *));
t_list *ft_lst_removeif(t_list **alst, void *data_ref, int (*cmp)());
t_list *ft_lst_find(t_list *begin_list, void *data_ref, int (*cmp)());
t_list *ft_lstpop(t_list **lst);
int ft_diff(void *a, void *b);
t_list *ft_id(t_list *a);