ft_str_is
This commit is contained in:
parent
3f9f6a05f7
commit
8488e6b582
2 changed files with 23 additions and 1 deletions
|
|
@ -6,7 +6,7 @@
|
|||
/* By: jhalford <jack@crans.org> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* 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);
|
||||
|
||||
char *ft_path_notdir(char *path);
|
||||
int ft_stris(char *str, (*f)(char *str));
|
||||
|
||||
#endif
|
||||
|
|
|
|||
21
libft/src/str/ft_stris.c
Normal file
21
libft/src/str/ft_stris.c
Normal 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);
|
||||
}
|
||||
Loading…
Reference in a new issue