megadrive_test1
view src/libc/ctype.c @ 7:8253942b0a1a
in the middle of something
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Sun, 19 Feb 2017 14:00:26 +0200 |
parents | |
children |
line source
1 int isalpha(int c);
2 int isdigit(int c);
3 int islower(int c);
4 int isupper(int c);
7 int isalnum(int c)
8 {
9 return isalpha(c) || isdigit(c);
10 }
12 int isalpha(int c)
13 {
14 return isupper(c) || islower(c);
15 }
17 int isblank(int c)
18 {
19 return c == ' ' || c == '\t';
20 }
22 int isdigit(int c)
23 {
24 return c >= '0' && c <= '9';
25 }
27 int isupper(int c)
28 {
29 return c >= 'A' && c <= 'Z';
30 }
32 int islower(int c)
33 {
34 return c >= 'a' && c <= 'z';
35 }
37 int isgraph(int c)
38 {
39 return c > ' ' && c <= '~';
40 }
42 int isprint(int c)
43 {
44 return isgraph(c) || c == ' ';
45 }
47 int isspace(int c)
48 {
49 return isblank(c) || c == '\f' || c == '\n' || c == '\r' || c == '\v';
50 }
52 int toupper(int c)
53 {
54 return islower(c) ? (c + ('A' - 'a')) : c;
55 }
57 int tolower(int c)
58 {
59 return isupper(c) ? (c + ('A' - 'a')) : c;
60 }