CBMC
ctype.c
Go to the documentation of this file.
1 
2 /* FUNCTION: isalnum */
3 
4 int isalnum(int c)
5 { return (c>='a' && c<='z') || (c>='A' && c<='Z') || (c>='0' && c<='9'); }
6 
7 /* FUNCTION: isalpha */
8 
9 int isalpha(int c)
10 { return (c>='a' && c<='z') || (c>='A' && c<='Z'); }
11 
12 /* FUNCTION: isblank */
13 
14 int isblank(int c)
15 { return c==' ' || c=='\t'; }
16 
17 /* FUNCTION: iscntrl */
18 
19 int iscntrl(int c)
20 { return (c>=0 && c<='\037') || c=='\177'; }
21 
22 /* FUNCTION: isdigit */
23 
24 int isdigit(int c)
25 { return c>='0' && c<='9'; }
26 
27 /* FUNCTION: isgraph */
28 
29 int isgraph(int c)
30 { return c>='!' && c<='~'; }
31 
32 /* FUNCTION: islower */
33 
34 int islower(int c)
35 { return c>='a' && c<='z'; }
36 
37 /* FUNCTION: isprint */
38 
39 int isprint(int c)
40 { return c>=' ' && c<='~'; }
41 
42 /* FUNCTION: ispunct */
43 
44 int ispunct(int c)
45 { return c=='!' ||
46  c=='"' ||
47  c=='#' ||
48  c=='$' ||
49  c=='%' ||
50  c=='&' ||
51  c=='\'' ||
52  c=='(' ||
53  c==')' ||
54  c=='*' ||
55  c=='+' ||
56  c==',' ||
57  c=='-' ||
58  c=='.' ||
59  c=='/' ||
60  c==':' ||
61  c==';' ||
62  c=='<' ||
63  c=='=' ||
64  c=='>' ||
65  c=='?' ||
66  c=='@' ||
67  c=='[' ||
68  c=='\\' ||
69  c==']' ||
70  c=='^' ||
71  c=='_' ||
72  c=='`' ||
73  c=='{' ||
74  c=='|' ||
75  c=='}' ||
76  c=='~'; }
77 
78 /* FUNCTION: isspace */
79 
80 int isspace(int c)
81 { return c=='\t' ||
82  c=='\n' ||
83  c=='\v' ||
84  c=='\f' ||
85  c=='\r' ||
86  c==' '; }
87 
88 /* FUNCTION: isupper */
89 
90 int isupper(int c)
91 { return c>='A' && c<='Z'; }
92 
93 /* FUNCTION: isxdigit */
94 
95 int isxdigit(int c)
96 { return (c>='A' && c<='F') || (c>='a' && c<='f') || (c>='0' && c<='9'); }
97 
98 /* FUNCTION: tolower */
99 
100 int tolower(int c)
101 { return (c>='A' && c<='Z')?c+('a'-'A'):c; }
102 
103 /* FUNCTION: toupper */
104 
105 int toupper(int c)
106 { return (c>='a' && c<='z')?c-('a'-'A'):c; }
int iscntrl(int c)
Definition: ctype.c:19
int isalpha(int c)
Definition: ctype.c:9
int isdigit(int c)
Definition: ctype.c:24
int isgraph(int c)
Definition: ctype.c:29
int isspace(int c)
Definition: ctype.c:80
int islower(int c)
Definition: ctype.c:34
int isprint(int c)
Definition: ctype.c:39
int toupper(int c)
Definition: ctype.c:105
int tolower(int c)
Definition: ctype.c:100
int isupper(int c)
Definition: ctype.c:90
int isxdigit(int c)
Definition: ctype.c:95
int isalnum(int c)
Definition: ctype.c:4
int isblank(int c)
Definition: ctype.c:14
int ispunct(int c)
Definition: ctype.c:44