Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
WOLFIE-OG committed Jul 1, 2024
1 parent b00666a commit 5be302a
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# By: otodd <otodd@student.42london.com> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2024/02/13 17:49:05 by otodd #+# #+# #
# Updated: 2024/06/28 14:13:16 by otodd ### ########.fr #
# Updated: 2024/07/01 15:38:35 by otodd ### ########.fr #
# #
# **************************************************************************** #

Expand Down Expand Up @@ -133,6 +133,7 @@ LIST_SRCS = $(LIST_DIR)/ft_lstnew.c \
$(LIST_DIR)/ft_lstclear_rev.c \
$(LIST_DIR)/ft_lstfirst.c \
$(LIST_DIR)/ft_lstiter_rev.c \
$(LIST_DIR)/ft_lstpop.c \

UTIL_SRCS = $(UTIL_DIR)/ft_numlen.c \
$(UTIL_DIR)/ft_range.c \
Expand Down
3 changes: 2 additions & 1 deletion include/libft.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/* By: otodd <otodd@student.42london.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/11/16 18:36:11 by otodd #+# #+# */
/* Updated: 2024/06/28 14:12:06 by otodd ### ########.fr */
/* Updated: 2024/07/01 15:44:28 by otodd ### ########.fr */
/* */
/* ************************************************************************** */

Expand Down Expand Up @@ -106,6 +106,7 @@ int ft_lstsize(t_list *lst);
void ft_lstiter_rev(t_list *lst, void (*f)(void *));
t_list *ft_lstfirst(t_list *lst);
void ft_lstclear_rev(t_list **lst, void (*del)(void *));
t_list *ft_lstpop(t_list *node);

// Math Functions

Expand Down
24 changes: 24 additions & 0 deletions src/list/ft_lstpop.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_lstpop.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: otodd <otodd@student.42london.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/07/01 14:08:10 by otodd #+# #+# */
/* Updated: 2024/07/01 15:40:56 by otodd ### ########.fr */
/* */
/* ************************************************************************** */

#include "../../include/libft.h"

t_list *ft_lstpop(t_list *node)
{
if (!node)
return (NULL);
if (node->next)
node->next->previous = node->previous;
if (node->previous)
node->previous->next = node->next;
return (node);
}

0 comments on commit 5be302a

Please sign in to comment.