diff --git a/libft/includes/lst.h b/libft/includes/lst.h index 2d7fcdce..ee4926df 100644 --- a/libft/includes/lst.h +++ b/libft/includes/lst.h @@ -6,13 +6,15 @@ /* By: jhalford +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2016/11/07 13:27:46 by jhalford #+# #+# */ -/* Updated: 2016/12/07 16:54:25 by jhalford ### ########.fr */ +/* Updated: 2016/12/12 14:59:12 by jhalford ### ########.fr */ /* */ /* ************************************************************************** */ #ifndef LST_H # define LST_H +# include "libft.h" + struct s_list { void *content; @@ -73,5 +75,6 @@ void ft_lst_reverse(t_list **begin_list); int ft_diff(void *a, void *b); t_list *ft_id(t_list *a); +t_list *ft_lst_at(t_list *list, unsigned int nbr); #endif diff --git a/libft/src/color/ft_color_mk.c b/libft/src/color/ft_color_mk.c index 910748ed..db75d7cc 100644 --- a/libft/src/color/ft_color_mk.c +++ b/libft/src/color/ft_color_mk.c @@ -6,7 +6,7 @@ /* By: jhalford +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2016/11/27 11:35:18 by jhalford #+# #+# */ -/* Updated: 2016/12/03 12:16:59 by jhalford ### ########.fr */ +/* Updated: 2016/12/12 11:54:49 by jhalford ### ########.fr */ /* */ /* ************************************************************************** */ diff --git a/libft/src/color/ft_color_set.c b/libft/src/color/ft_color_set.c index 103bd39f..99d9c0d0 100644 --- a/libft/src/color/ft_color_set.c +++ b/libft/src/color/ft_color_set.c @@ -6,7 +6,7 @@ /* By: jhalford +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2016/11/25 13:53:46 by jhalford #+# #+# */ -/* Updated: 2016/12/03 12:16:38 by jhalford ### ########.fr */ +/* Updated: 2016/12/12 11:55:03 by jhalford ### ########.fr */ /* */ /* ************************************************************************** */ diff --git a/libft/src/ft_printf/ft_printf.c b/libft/src/ft_printf/ft_printf.c index 9c9c69ea..44ef8a8c 100644 --- a/libft/src/ft_printf/ft_printf.c +++ b/libft/src/ft_printf/ft_printf.c @@ -6,7 +6,7 @@ /* By: jhalford +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2016/11/07 13:33:27 by jhalford #+# #+# */ -/* Updated: 2016/12/10 16:50:26 by jhalford ### ########.fr */ +/* Updated: 2016/12/12 11:57:28 by jhalford ### ########.fr */ /* */ /* ************************************************************************** */ diff --git a/libft/src/lst/ft_lst_at.c b/libft/src/lst/ft_lst_at.c new file mode 100644 index 00000000..0013ce45 --- /dev/null +++ b/libft/src/lst/ft_lst_at.c @@ -0,0 +1,28 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_list_at.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: jhalford +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2016/08/14 13:18:48 by jhalford #+# #+# */ +/* Updated: 2016/12/12 14:58:37 by jhalford ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "lst.h" + +t_list *ft_lst_at(t_list *list, unsigned int nbr) +{ + unsigned int i; + + if (!list) + return (NULL); + i = 0; + while (i < nbr && list) + { + list = list->next; + i++; + } + return (list); +} diff --git a/libft/src/lst/ft_lst_delif.c b/libft/src/lst/ft_lst_delif.c index e67bd72a..5e51d819 100644 --- a/libft/src/lst/ft_lst_delif.c +++ b/libft/src/lst/ft_lst_delif.c @@ -6,7 +6,7 @@ /* By: jhalford +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2016/11/04 11:09:12 by jhalford #+# #+# */ -/* Updated: 2016/12/05 13:39:09 by jhalford ### ########.fr */ +/* Updated: 2016/12/12 12:40:15 by jhalford ### ########.fr */ /* */ /* ************************************************************************** */ diff --git a/libft/src/lst/ft_lst_find.c b/libft/src/lst/ft_lst_find.c index ef70f221..1b63f088 100644 --- a/libft/src/lst/ft_lst_find.c +++ b/libft/src/lst/ft_lst_find.c @@ -6,7 +6,7 @@ /* By: jhalford +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2016/11/04 11:09:20 by jhalford #+# #+# */ -/* Updated: 2016/11/04 11:09:20 by jhalford ### ########.fr */ +/* Updated: 2016/12/12 12:54:45 by jhalford ### ########.fr */ /* */ /* ************************************************************************** */ diff --git a/libft/src/lst/ft_lstiter.c b/libft/src/lst/ft_lstiter.c index 6bf86a06..06bec80f 100644 --- a/libft/src/lst/ft_lstiter.c +++ b/libft/src/lst/ft_lstiter.c @@ -6,7 +6,7 @@ /* By: jhalford +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2016/11/03 14:57:19 by jhalford #+# #+# */ -/* Updated: 2016/11/03 14:57:19 by jhalford ### ########.fr */ +/* Updated: 2016/12/12 13:31:59 by jhalford ### ########.fr */ /* */ /* ************************************************************************** */ diff --git a/libft/src/lst/ft_lstmap.c b/libft/src/lst/ft_lstmap.c index edf178d2..1cbd428e 100644 --- a/libft/src/lst/ft_lstmap.c +++ b/libft/src/lst/ft_lstmap.c @@ -6,7 +6,7 @@ /* By: jhalford +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2016/11/03 14:57:21 by jhalford #+# #+# */ -/* Updated: 2016/11/04 13:11:19 by jhalford ### ########.fr */ +/* Updated: 2016/12/12 13:04:00 by jhalford ### ########.fr */ /* */ /* ************************************************************************** */