added page flipping/scrolling VBE calls
[dosrtxon] / libs / mikmod / include / mikmod_ctype.h
1 /* Locale insensitive ctype.h functions taken from the RPM library.
2  * RPM is Copyright (c) 1998 by Red Hat Software, Inc.
3  *
4  * This library is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU Library General Public License as
6  * published by the Free Software Foundation; either version 2 of
7  * the License, or (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU Library General Public License for more details.
13  *
14  * You should have received a copy of the GNU Library General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
17  * 02111-1307, USA.
18  */
19
20 #ifndef MIKMOD_CTYPE_H
21 #define MIKMOD_CTYPE_H
22
23 static inline int mik_isascii(int c) {
24     return ((c & ~0x7f) == 0);
25 }
26
27 static inline int mik_islower(int c) {
28     return (c >= 'a' && c <= 'z');
29 }
30
31 static inline int mik_isupper(int c) {
32     return (c >= 'A' && c <= 'Z');
33 }
34
35 static inline int mik_isalpha(int c) {
36     return (mik_islower(c) || mik_isupper(c));
37 }
38
39 static inline int mik_isdigit(int c) {
40     return (c >= '0' && c <= '9');
41 }
42
43 static inline int mik_isxdigit(int c) {
44     return (mik_isdigit(c) || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F'));
45 }
46
47 static inline int mik_isalnum(int c) {
48     return (mik_isalpha(c) || mik_isdigit(c));
49 }
50
51 static inline int mik_isblank(int c) {
52     return (c == ' ' || c == '\t');
53 }
54
55 static inline int mik_isspace(int c) {
56     switch (c) {
57     case ' ':  case '\t':
58     case '\n': case '\r':
59     case '\f': case '\v': return 1;
60     }
61     return 0;
62 }
63
64 static inline int mik_isgraph(int c) {
65     return (c > 0x20 && c <= 0x7e);
66 }
67
68 static inline int mik_isprint(int c) {
69     return (c >= 0x20 && c <= 0x7e);
70 }
71
72 static inline int mik_toascii(int c) {
73     return (c & 0x7f);
74 }
75
76 static inline int mik_tolower(int c) {
77     return ((mik_isupper(c)) ? (c | ('a' - 'A')) : c);
78 }
79
80 static inline int mik_toupper(int c) {
81     return ((mik_islower(c)) ? (c & ~('a' - 'A')) : c);
82 }
83
84 #endif /* MIKMOD_CTYPE_H */