Skip to content

Commit

Permalink
Added ft_lstprint.c
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew Yeow committed Apr 3, 2024
1 parent d1728af commit 6992714
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions includes/ft_lst.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/* By: myeow <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/03/28 20:38:22 by myeow #+# #+# */
/* Updated: 2024/03/31 23:26:39 by myeow ### ########.fr */
/* Updated: 2024/04/04 01:48:22 by myeow ### ########.fr */
/* */
/* ************************************************************************** */

Expand All @@ -28,7 +28,7 @@ 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_lstprint(t_list *lst);
void ft_lstprint(t_list *lst, char sep);
int ft_lstmin(t_list *lst);
int ft_lstmax(t_list *lst);
void ft_lstrotate(t_list **lst);
Expand Down
6 changes: 3 additions & 3 deletions srcs/lst_utils/ft_lstprint.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,22 @@
/* By: myeow <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/03/29 20:03:02 by myeow #+# #+# */
/* Updated: 2024/03/30 16:59:01 by myeow ### ########.fr */
/* Updated: 2024/04/03 17:22:37 by myeow ### ########.fr */
/* */
/* ************************************************************************** */

#include "../../includes/ft_lst.h"
#include "../../includes/libft.h"
#include "../../includes/ft_error.h"

void ft_lstprint(t_list *lst)
void ft_lstprint(t_list *lst, char sep)
{
if (!lst)
ft_error(NULL_ERROR);
while (lst)
{
ft_putnbr_fd(*((int *) lst->content), 1);
ft_putchar_fd('\n', 1);
ft_putchar_fd(sep, 1);
lst = lst->next;
}
}

0 comments on commit 6992714

Please sign in to comment.