-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_chr.c
49 lines (40 loc) · 1.38 KB
/
ft_chr.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_chr.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: lgillot- <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2015/11/19 01:28:19 by lgillot- #+# #+# */
/* Updated: 2015/11/19 01:35:38 by lgillot- ### ########.fr */
/* */
/* ************************************************************************** */
#include <stdbool.h>
#include <ft_chr.h>
int ft_isspace(int c)
{
unsigned char uc;
bool r;
uc = (unsigned char)c;
r = uc == '\t' || uc == '\n' || uc == '\v' || uc == '\f'
|| uc == '\r' || uc == ' ';
return (r);
}
int ft_isdigit(int c)
{
unsigned char uc;
uc = (unsigned char)c;
return (uc >= '0' && uc <= '9');
}
int ft_islower(int c)
{
return (c >= 'a' && c <= 'z');
}
int ft_isupper(int c)
{
return (c >= 'A' && c <= 'Z');
}
int ft_isalpha(int c)
{
return (ft_islower(c) || ft_isupper(c));
}