ft_str_is

This commit is contained in:
ariard@student.42.fr 2017-03-02 15:31:04 +01:00
parent 3f9f6a05f7
commit 8488e6b582
2 changed files with 23 additions and 1 deletions

View file

@ -6,7 +6,7 @@
/* By: jhalford <jack@crans.org> +#+ +:+ +#+ */ /* By: jhalford <jack@crans.org> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2017/02/18 13:05:53 by jhalford #+# #+# */ /* Created: 2017/02/18 13:05:53 by jhalford #+# #+# */
/* Updated: 2017/02/18 18:47:45 by jhalford ### ########.fr */ /* Updated: 2017/03/02 15:14:08 by ariard ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -66,5 +66,6 @@ char *ft_strtok(char *s, const char *delim);
size_t ft_strcspn(char *s, const char *delim); size_t ft_strcspn(char *s, const char *delim);
char *ft_path_notdir(char *path); char *ft_path_notdir(char *path);
int ft_stris(char *str, (*f)(char *str));
#endif #endif

21
libft/src/str/ft_stris.c Normal file
View file

@ -0,0 +1,21 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_stris.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: ariard <ariard@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2017/03/02 15:11:28 by ariard #+# #+# */
/* Updated: 2017/03/02 15:13:07 by ariard ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
int ft_stris(char *str, (*f)(char *str))
{
while (*str)
if (!(f)(*str++))
return (0);
return (1);
}