diff --git a/Makefile b/Makefile index c1527fc..6c7bd58 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ # By: gbrochar +#+ +:+ +#+ # # +#+#+#+#+#+ +#+ # # Created: 2015/11/27 19:26:17 by gbrochar #+# #+# # -# Updated: 2015/12/09 16:47:26 by gbrochar ### ########.fr # +# Updated: 2024/10/13 18:44:22 by gbrochar ### ########.fr # # # # **************************************************************************** # @@ -22,7 +22,7 @@ ft_strchr.c ft_strclr.c ft_strcmp.c ft_strcpy.c ft_strdel.c ft_strdup.c \ ft_strequ.c ft_striter.c ft_striteri.c ft_strjoin.c ft_strlcat.c ft_strlen.c \ ft_strmap.c ft_strmapi.c ft_strncat.c ft_strncmp.c ft_strncpy.c ft_strnequ.c \ ft_strnew.c ft_strnstr.c ft_strrchr.c ft_strsplit.c ft_strstr.c ft_strsub.c \ -ft_strtrim.c ft_swap.c ft_tolower.c ft_toupper.c +ft_strtrim.c ft_swap.c ft_tolower.c ft_toupper.c ft_lstadd_back.c OBJ = $(SRC:.c=.o) diff --git a/ft_lstadd_back.c b/ft_lstadd_back.c new file mode 100644 index 0000000..750452d --- /dev/null +++ b/ft_lstadd_back.c @@ -0,0 +1,8 @@ +#include "libft.h" + +void ft_lstadd_back(t_list **alst, t_list *new) +{ + while ((*alst)->next) + alst = &(*alst)->next; + (*alst)->next = new; +} diff --git a/libft.h b/libft.h index 2d0d5a9..53a8fbd 100644 --- a/libft.h +++ b/libft.h @@ -6,7 +6,7 @@ /* By: gbrochar +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2015/11/24 12:52:28 by gbrochar #+# #+# */ -/* Updated: 2015/12/07 09:31:40 by gbrochar ### ########.fr */ +/* Updated: 2024/10/13 18:45:37 by gbrochar ### ########.fr */ /* */ /* ************************************************************************** */ @@ -25,6 +25,7 @@ typedef struct s_list } t_list; void ft_lstadd(t_list **alst, t_list *new); +void ft_lstadd_back(t_list **alst, t_list *new); void ft_lstdel(t_list **alst, void (*del)(void *, size_t)); void ft_lstdelone(t_list **alst, void (*del)(void *, size_t)); t_list *ft_lstnew(void const *content, size_t content_size);