core: Add isspace.

* include/ctype.h (isspace): Declare.
* lib/libc.c (isspace): New function.
This commit is contained in:
Jan Nieuwenhuizen 2018-04-10 21:51:15 +02:00
parent 45e347588c
commit 25907f514c
No known key found for this signature in database
GPG Key ID: F3C1A0D9C1D65273
2 changed files with 7 additions and 0 deletions

View File

@ -31,6 +31,7 @@
#include <endian.h>
int isdigit (int);
int isxdigit (int);
int isspace (int);
#endif // ! (__GNUC__ && POSIX)
#endif // __MES_CTYPE_H

View File

@ -41,6 +41,12 @@ isxdigit (int c)
return isdigit (c) || (c>='a') && (c<='f');
}
int
isspace (int c)
{
return (c == '\t' || c == '\n' || c == '\v' || c == '\f' || c == '\r' || c == ' ');
}
int
isnumber (int c, int base)
{