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> #include <endian.h>
int isdigit (int); int isdigit (int);
int isxdigit (int); int isxdigit (int);
int isspace (int);
#endif // ! (__GNUC__ && POSIX) #endif // ! (__GNUC__ && POSIX)
#endif // __MES_CTYPE_H #endif // __MES_CTYPE_H

View file

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