+libm
[meinos.git] / include / ctype.h
blobd5d6577a3c6b28788c9b375722ae91ef6ad20c13
1 /*
2 meinOS - A unix-like x86 microkernel operating system
3 Copyright (C) 2008 Janosch Gräf <janosch.graef@gmx.net>
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
19 #ifndef _CTYPE_H_
20 #define _CTYPE_H_
22 #define isalnum(c) (isalpha(c) || isdigit(c))
23 #define isalpha(c) (isupper(c) || islower(c))
24 #define iscntrl(c) (c<' ')
25 #define isdigit(c) (c>='0' && c<='9')
26 #define isgraph(c) (isalnum(c) && c!=' ') /** @todo please do it the right way */
27 #define islower(c) (c>='a' && c<='z')
28 #define isprint(c) (c>=' ')
29 #define ispunct(c) (isprint(c) && !isalnum(c)) /** @todo is that right? **/
30 #define isspace(c) (c==' ' || c=='\f' || c=='\n' || c=='\r' || c=='\t' || c=='\v')
31 #define isupper(c) (c>='A' && c<='Z')
32 #define isxdigit(c) (isdigit(c) || (c>='A' && c<='F') || (c>='a' && c<='f'))
34 #define tolower(c) (isupper(c)?c+('a'-'A'):c)
35 #define toupper(c) (islower(c)?c-('a'-'A'):c)
37 #endif