LibC: Implement isblank()

This commit is contained in:
Sergey Bugaev 2020-02-03 18:50:58 +03:00 committed by Andreas Kling
parent c600280dde
commit 4e79a60b78
Notes: sideshowbarker 2024-07-19 09:41:06 +09:00
2 changed files with 3 additions and 1 deletions

View File

@ -31,7 +31,7 @@ extern "C" {
const char _ctype_[256] = {
_C, _C, _C, _C, _C, _C, _C, _C,
_C, _C | _S, _C | _S, _C | _S, _C | _S, _C | _S, _C, _C,
_C, (char)(_C | _S | _B), _C | _S, _C | _S, _C | _S, _C | _S, _C, _C,
_C, _C, _C, _C, _C, _C, _C, _C,
_C, _C, _C, _C, _C, _C, _C, _C,
(char)(_S | _B), _P, _P, _P, _P, _P, _P, _P,

View File

@ -56,6 +56,7 @@ int isprint(int);
int isgraph(int);
int islower(int);
int isupper(int);
int isblank(int);
#define isalnum(c) (_ctype_[(int)(c)] & (_U | _L | _N))
#define isalpha(c) (_ctype_[(int)(c)] & (_U | _L))
@ -68,6 +69,7 @@ int isupper(int);
#define isgraph(c) (_ctype_[(int)(c)] & (_P | _U | _L | _N))
#define islower(c) ((_ctype_[(int)(c)] & (_U | _L)) == _L)
#define isupper(c) ((_ctype_[(int)(c)] & (_U | _L)) == _U)
#define isblank(c) ((_ctype_[(int)(c)] & (_B)))
#define isascii(c) ((unsigned)c <= 127)
#define toascii(c) ((c)&127)