with lst_pop propre
This commit is contained in:
parent
97ea87ec5c
commit
a0d85d1c71
5 changed files with 29 additions and 0 deletions
|
|
@ -104,6 +104,7 @@ lst/ft_lstnew.c\
|
||||||
lst/ft_lstnew_range.c\
|
lst/ft_lstnew_range.c\
|
||||||
lst/ft_lstsort.c\
|
lst/ft_lstsort.c\
|
||||||
lst/lst_insert_sort.c\
|
lst/lst_insert_sort.c\
|
||||||
|
lst/ft_lst_pop.c\
|
||||||
lst/pop.c\
|
lst/pop.c\
|
||||||
lst/push.c\
|
lst/push.c\
|
||||||
lst/top.c\
|
lst/top.c\
|
||||||
|
|
@ -168,6 +169,7 @@ str/ft_strcspn.c\
|
||||||
str/ft_strcut.c\
|
str/ft_strcut.c\
|
||||||
str/ft_strdel.c\
|
str/ft_strdel.c\
|
||||||
str/ft_strdup.c\
|
str/ft_strdup.c\
|
||||||
|
str/ft_strndup.c\
|
||||||
str/ft_strdupchr.c\
|
str/ft_strdupchr.c\
|
||||||
str/ft_strduptr.c\
|
str/ft_strduptr.c\
|
||||||
str/ft_strequ.c\
|
str/ft_strequ.c\
|
||||||
|
|
|
||||||
|
|
@ -88,4 +88,6 @@ t_list *ft_lst_at(t_list *list, unsigned int nbr);
|
||||||
void lst_insert_sort(t_list **head,
|
void lst_insert_sort(t_list **head,
|
||||||
int (cmp)());
|
int (cmp)());
|
||||||
|
|
||||||
|
t_list *ft_lst_pop(t_list **lst);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -72,4 +72,6 @@ size_t ft_strcspn(char *s, const char *delim);
|
||||||
char *ft_path_notdir(char *path);
|
char *ft_path_notdir(char *path);
|
||||||
int ft_stris(char *str, int (*f)());
|
int ft_stris(char *str, int (*f)());
|
||||||
|
|
||||||
|
char *ft_strndup(const char *s1, size_t n);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
11
libftasm/srcs/lst/ft_lst_pop.c
Normal file
11
libftasm/srcs/lst/ft_lst_pop.c
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
#include "libft.h"
|
||||||
|
|
||||||
|
t_list *ft_lst_pop(t_list **lst)
|
||||||
|
{
|
||||||
|
t_list *top;
|
||||||
|
|
||||||
|
top = *lst;
|
||||||
|
if (lst && *lst)
|
||||||
|
*lst = (*lst)->next;
|
||||||
|
return (top);
|
||||||
|
}
|
||||||
12
libftasm/srcs/str/ft_strndup.c
Normal file
12
libftasm/srcs/str/ft_strndup.c
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
|
||||||
|
#include "libft.h"
|
||||||
|
|
||||||
|
char *ft_strndup(const char *s1, size_t n)
|
||||||
|
{
|
||||||
|
char *dup;
|
||||||
|
|
||||||
|
if (!(dup = ft_memalloc(n)))
|
||||||
|
return (NULL);
|
||||||
|
ft_strncpy(dup, s1, n);
|
||||||
|
return (dup);
|
||||||
|
}
|
||||||
Loading…
Reference in a new issue