diff options
author | zeusk <shans95g@gmail.com> | 2012-11-12 17:50:41 +0530 |
---|---|---|
committer | Travis Geiselbrecht <geist@foobox.com> | 2012-11-29 22:18:15 -0800 |
commit | 807b5f2f3530824257ec0e2a25be2ab3cb3d4105 (patch) | |
tree | 8c4a1f80280d6f01a32b85d153ef1ab439563f78 /lib/libc/ctype.c | |
parent | cc7dcb7ccd3372fa6f8c588e9228f3bac79af492 (diff) | |
download | common-807b5f2f3530824257ec0e2a25be2ab3cb3d4105.tar.gz |
[libc] Add implementation for isgraph and iscntrl
Diffstat (limited to 'lib/libc/ctype.c')
-rw-r--r-- | lib/libc/ctype.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/libc/ctype.c b/lib/libc/ctype.c index 845440e9..06f12557 100644 --- a/lib/libc/ctype.c +++ b/lib/libc/ctype.c @@ -24,8 +24,6 @@ #if 0 /* XXX unimplemented for now */ -int iscntrl(int c); -int isgraph(int c); int ispunct(int c); #endif @@ -69,6 +67,16 @@ int isxdigit(int c) return isdigit(c) || ((c >= 'a') && (c <= 'f')) || ((c >= 'A') && (c <= 'F')); } +int isgraph(int c) +{ + return ((c > ' ') && (c < 0x7f)); +} + +int iscntrl(int c) +{ + return ((c < ' ') || (c == 0x7f)); +} + int isprint(int c) { return ((c >= 0x20) && (c < 0x7f)); |