kern

view src/klibc/ctype.c @ 62:38f768da2f31

added a comment in the tss showing the interesting bits
author John Tsiombikas <nuclear@member.fsf.org>
date Wed, 17 Aug 2011 05:39:39 +0300
parents
children
line source
1 #include "ctype.h"
3 int isalnum(int c)
4 {
5 return isalpha(c) || isdigit(c);
6 }
8 int isalpha(int c)
9 {
10 return isupper(c) || islower(c);
11 }
13 int isblank(int c)
14 {
15 return c == ' ' || c == '\t';
16 }
18 int isdigit(int c)
19 {
20 return c >= '0' && c <= '9';
21 }
23 int isupper(int c)
24 {
25 return c >= 'A' && c <= 'Z';
26 }
28 int islower(int c)
29 {
30 return c >= 'a' && c <= 'z';
31 }
33 int isgraph(int c)
34 {
35 return c > ' ' && c <= '~';
36 }
38 int isprint(int c)
39 {
40 return isgraph(c) || c == ' ';
41 }
43 int isspace(int c)
44 {
45 return isblank(c) || c == '\f' || c == '\n' || c == '\r' || c == '\v';
46 }
48 int toupper(int c)
49 {
50 return islower(c) ? (c + ('A' - 'a')) : c;
51 }
53 int tolower(int c)
54 {
55 return isupper(c) ? (c + ('A' - 'a')) : c;
56 }