summaryrefslogtreecommitdiff
path: root/libc/misc/ctype
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2000-12-20 22:52:58 +0000
committerEric Andersen <andersen@codepoet.org>2000-12-20 22:52:58 +0000
commitc6218dbae579de0cd20f5a7f1e9877673e28225d (patch)
tree0fc8aaf54189b8ef6a2d130c12539814e0a724ee /libc/misc/ctype
parent97112ff6f4f2a1dcd4c7f8a7512e0a4a02a2a332 (diff)
A number of updates from Manuel Novoa III. Things look good...
Diffstat (limited to 'libc/misc/ctype')
-rw-r--r--libc/misc/ctype/ctype.c35
1 files changed, 34 insertions, 1 deletions
diff --git a/libc/misc/ctype/ctype.c b/libc/misc/ctype/ctype.c
index c7cceada6..fb465838f 100644
--- a/libc/misc/ctype/ctype.c
+++ b/libc/misc/ctype/ctype.c
@@ -9,106 +9,139 @@
#define USE_CTYPE_C_FUNCTIONS
#include <ctype.h>
+#ifdef L_isalnum
int
isalnum( int c )
{
return (isalpha(c) || isdigit(c));
}
+#endif
+#ifdef L_isalpha
int
isalpha( int c )
{
return (isupper(c) || islower(c));
}
+#endif
+#ifdef L_isascii
int
isascii( int c )
{
return (c > 0 && c <= 0x7f);
}
+#endif
+#ifdef L_iscntrl
int
iscntrl( int c )
{
return ((c > 0) && ((c <= 0x1f) || (c == 0x7f)));
}
+#endif
+#ifdef L_isdigit
int
isdigit( int c )
{
return (c >= '0' && c <= '9');
}
+#endif
+#ifdef L_isgraph
int
isgraph( int c )
{
return (c != ' ' && isprint(c));
}
+#endif
+#ifdef L_islower
int
islower( int c )
{
return (c >= 'a' && c <= 'z');
}
+#endif
+#ifdef L_isprint
int
isprint( int c )
{
return (c >= ' ' && c <= '~');
}
+#endif
+#ifdef L_ispunct
int
ispunct( int c )
{
return ((c > ' ' && c <= '~') && !isalnum(c));
}
+#endif
+#ifdef L_isspace
int
isspace( int c )
{
return (c == ' ' || c == '\f' || c == '\n' || c == '\r' ||
c == '\t' || c == '\v');
}
+#endif
+#ifdef L_isupper
int
isupper( int c )
{
return (c >= 'A' && c <= 'Z');
}
+#endif
+#ifdef L_isxdigit
int
isxdigit( int c )
{
return (isxupper(c) || isxlower(c));
}
+#endif
+#ifdef L_isxlower
int
isxlower( int c )
{
return (isdigit(c) || (c >= 'a' && c <= 'f'));
}
+#endif
+#ifdef L_isxupper
int
isxupper( int c )
{
return (isdigit(c) || (c >= 'A' && c <= 'F'));
}
+#endif
+#ifdef L_toascii
int
toascii( int c )
{
return (c & 0x7f);
}
+#endif
+#ifdef L_tolower
int
tolower( int c )
{
return (isupper(c) ? ( c - 'A' + 'a') : (c));
}
+#endif
+#ifdef L_toupper
int
toupper( int c )
{
return (islower(c) ? (c - 'a' + 'A') : (c));
}
-
+#endif