kern
view src/klibc/ctype.c @ 53:23abbeea4d5f
llalallalala
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Mon, 08 Aug 2011 09:53:10 +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 }