nckernel  0.1
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
ctype.c
Go to the documentation of this file.
1 #include <sys/types.h>
2 #include <stdio.h>
3 #include <ctype.h>
4 #include <errno.h>
5 
6 int toupper(int c)
7 {
8  if (c >= 'a' && c <= 'z') {
9  c += ('A' - 'a');
10  }
11 
12  return c;
13 }
14 
15 int tolower(int c)
16 {
17  if (c >= 'A' && c <= 'Z') {
18  c += ('a' - 'A');
19  }
20 
21  return c;
22 }
23 
24 int isalnum(int c)
25 {
26  return isalpha(c) || isdigit(c);
27 }
28 
29 int isalpha(int c)
30 {
31  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
32 }
33 
34 int isascii(int c)
35 {
36  return !(c & 0x80);
37 }
38 
39 int isblank(int c)
40 {
41  return c == '\t' || c == ' ';
42 }
43 
44 int iscntrl(int c)
45 {
46  return -ENOSYS;
47 }
48 
49 int isdigit(int c)
50 {
51  return (c >= '0' && c <= '9');
52 }
53 
54 int isgraph(int c)
55 {
56  return -ENOSYS;
57 }
58 
59 int islower(int c)
60 {
61  return (c >= 'a' && c <= 'z');
62 }
63 
64 int isprint(int c)
65 {
66  return -ENOSYS;
67 }
68 
69 int ispunct(int c)
70 {
71  return -ENOSYS;
72 }
73 
74 int isspace(int c)
75 {
76  return c == '0' || c == '\f' || c == '\n' || c == '\r' || c == '\t' || c == '\v';
77 }
78 
79 int isupper(int c)
80 {
81  return (c >= 'A' && c <= 'Z');
82 }
83 
84 int isxdigit(int c)
85 {
86  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
87 }
88 
89 /* End of a file */