From e306be411d1b43b701ebff14af03f98d4ab27556 Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Sat, 23 Feb 2002 13:42:45 +0000 Subject: Support isblank() --- libc/misc/ctype/Makefile | 2 +- libc/misc/ctype/ctype.c | 18 ++++++++++++++++++ libc/misc/ctype/ctype_C.c | 4 ++-- 3 files changed, 21 insertions(+), 3 deletions(-) (limited to 'libc/misc/ctype') diff --git a/libc/misc/ctype/Makefile b/libc/misc/ctype/Makefile index ee3bfd04e..c329c942c 100644 --- a/libc/misc/ctype/Makefile +++ b/libc/misc/ctype/Makefile @@ -27,7 +27,7 @@ include $(TOPDIR)Rules.mak MSRC=ctype.c MOBJ= isalnum.o isalpha.o isascii.o iscntrl.o isdigit.o isgraph.o \ islower.o isprint.o ispunct.o isspace.o isupper.o isxdigit.o \ - isxlower.o isxupper.o toascii.o tolower.o toupper.o + isxlower.o isxupper.o toascii.o tolower.o toupper.o isblank.o ifeq ($(HAS_LOCALE),true) MOBJ += ctype_C.o diff --git a/libc/misc/ctype/ctype.c b/libc/misc/ctype/ctype.c index 5dc35cc72..a077dbf3c 100644 --- a/libc/misc/ctype/ctype.c +++ b/libc/misc/ctype/ctype.c @@ -118,6 +118,15 @@ isspace( int c ) } #endif +#ifdef L_isblank +#undef isblank +int +isblank( int c ) +{ + return (c == ' ' || c == '\t'); +} +#endif + #ifdef L_isupper #undef isupper int @@ -266,6 +275,15 @@ isspace( int c ) } #endif +#ifdef L_isblank +#undef isblank +int +isblank( int c ) +{ + return _UC_ISCTYPE(c, ISblank); +} +#endif + #ifdef L_isupper #undef isupper int diff --git a/libc/misc/ctype/ctype_C.c b/libc/misc/ctype/ctype_C.c index 2aa2690b6..190140752 100644 --- a/libc/misc/ctype/ctype_C.c +++ b/libc/misc/ctype/ctype_C.c @@ -8,7 +8,7 @@ const unsigned char _uc_ctype_b_C[LOCALE_BUF_SIZE] = { /* 0x06, 6, 06 */ IScntrl, /* 0x07, 7, 07 */ IScntrl, /* 0x08, 8, 010 */ IScntrl, - /* 0x09, 9, 011 */ IScntrl|ISspace, + /* 0x09, 9, 011 */ IScntrl|ISspace|ISblank, /* 0x0a, 10, 012 */ IScntrl|ISspace, /* 0x0b, 11, 013 */ IScntrl|ISspace, /* 0x0c, 12, 014 */ IScntrl|ISspace, @@ -31,7 +31,7 @@ const unsigned char _uc_ctype_b_C[LOCALE_BUF_SIZE] = { /* 0x1d, 29, 035 */ IScntrl, /* 0x1e, 30, 036 */ IScntrl, /* 0x1f, 31, 037 */ IScntrl, - /* 0x20, 32, 040 */ ISprint|ISspace, + /* 0x20, 32, 040 */ ISprint|ISspace|ISblank, /* 0x21, 33, 041 */ ISprint|ISpunct, /* 0x22, 34, 042 */ ISprint|ISpunct, /* 0x23, 35, 043 */ ISprint|ISpunct, -- cgit v1.2.3