stuff
This commit is contained in:
parent
e42fbd69d7
commit
ce100d4c7f
4 changed files with 33 additions and 18 deletions
|
|
@ -6,7 +6,7 @@
|
|||
/* By: jhalford <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2016/11/07 13:49:04 by jhalford #+# #+# */
|
||||
/* Updated: 2017/03/26 17:07:15 by jhalford ### ########.fr */
|
||||
/* Updated: 2017/03/28 10:58:15 by jhalford ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -21,6 +21,7 @@
|
|||
# include <sys/xattr.h>
|
||||
# include <sys/acl.h>
|
||||
|
||||
# include "types.h"
|
||||
# include "error.h"
|
||||
# include "color.h"
|
||||
# include "cliopts.h"
|
||||
|
|
@ -36,12 +37,6 @@
|
|||
# include "get_next_line.h"
|
||||
# include "sys.h"
|
||||
|
||||
typedef struct s_stos t_stos;
|
||||
typedef struct s_stof t_stof;
|
||||
typedef struct s_itof t_itof;
|
||||
typedef long long t_type;
|
||||
typedef long long t_flag;
|
||||
|
||||
struct s_stos
|
||||
{
|
||||
char *key;
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
/* By: jhalford <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2016/11/07 13:27:46 by jhalford #+# #+# */
|
||||
/* Updated: 2017/03/26 17:08:28 by jhalford ### ########.fr */
|
||||
/* Updated: 2017/03/28 20:34:27 by jhalford ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -31,7 +31,7 @@ t_list *ft_lstnew(void const *content, size_t content_size);
|
|||
void ft_lstdel(t_list **alst, void (*del)(void *, size_t));
|
||||
void ft_lstdelone(t_list **alst, void (*del)(void *, size_t));
|
||||
void ft_lstadd(t_list **alst, t_list *new);
|
||||
int ft_lstiter(t_list *lst, int (*f)());
|
||||
int ft_lstiter(t_list *lst, int (*f)(), void *data);
|
||||
t_list *ft_lstmap(t_list *lst, void *(*f)(void *));
|
||||
|
||||
t_list *ft_lstnew_range(int a, int b);
|
||||
|
|
|
|||
22
libft/includes/types.h
Normal file
22
libft/includes/types.h
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* types.h :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: jhalford <jack@crans.org> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2017/03/28 10:57:17 by jhalford #+# #+# */
|
||||
/* Updated: 2017/03/28 10:57:34 by jhalford ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifndef TYPES_H
|
||||
# define TYPES_H
|
||||
|
||||
typedef struct s_stos t_stos;
|
||||
typedef struct s_stof t_stof;
|
||||
typedef struct s_itof t_itof;
|
||||
typedef long long t_type;
|
||||
typedef long long t_flag;
|
||||
|
||||
#endif
|
||||
|
|
@ -6,19 +6,17 @@
|
|||
/* By: jhalford <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2016/11/03 14:57:19 by jhalford #+# #+# */
|
||||
/* Updated: 2017/03/11 16:17:43 by jhalford ### ########.fr */
|
||||
/* Updated: 2017/03/28 11:27:45 by jhalford ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "libft.h"
|
||||
|
||||
int ft_lstiter(t_list *lst, int (*f)())
|
||||
int ft_lstiter(t_list *lst, int (*f)(), void *data)
|
||||
{
|
||||
while (lst)
|
||||
{
|
||||
if ((*f)(lst->content))
|
||||
return (1);
|
||||
lst = lst->next;
|
||||
}
|
||||
if (!lst)
|
||||
return (0);
|
||||
if ((*f)(lst->content, data))
|
||||
return (1);
|
||||
return (ft_lstiter(lst->next, f, data));
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue