let's go ! B)
added bfs WIP
This commit is contained in:
38
srcs/lst_ind.c
Normal file
38
srcs/lst_ind.c
Normal file
@@ -0,0 +1,38 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* lst_ind.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: tmaze <tmaze@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2019/03/27 14:56:55 by tmaze #+# #+# */
|
||||
/* Updated: 2019/03/27 17:45:17 by tmaze ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "lem_in.h"
|
||||
|
||||
t_ind *lst_indadd(t_ind **lst, int ind)
|
||||
{
|
||||
t_ind *new;
|
||||
|
||||
if ((new = (t_ind*)ft_memalloc(sizeof(t_ind))) != NULL)
|
||||
{
|
||||
new->index = ind;
|
||||
new->next = *lst;
|
||||
*lst = new;
|
||||
}
|
||||
return (new);
|
||||
}
|
||||
|
||||
void lst_inddel(t_ind **lst)
|
||||
{
|
||||
t_ind *tmp;
|
||||
|
||||
while (*lst != NULL)
|
||||
{
|
||||
tmp = *lst;
|
||||
*lst = (*lst)->next;
|
||||
ft_memdel((void**)&tmp);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user