From: Ben Gras Date: Thu, 8 Apr 2010 15:00:25 +0000 (+0000) Subject: isblank() implementation. X-Git-Tag: v3.1.7~168 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/style.css?a=commitdiff_plain;h=1c8c8aa4d8ded8e8215662a5b7c3245d863df366;p=minix.git isblank() implementation. --- diff --git a/include/ctype.h b/include/ctype.h index f9d16e1fa..639388cc1 100644 --- a/include/ctype.h +++ b/include/ctype.h @@ -24,6 +24,7 @@ extern char __ctype[]; /* property array defined in chartab.c */ /* Function Prototypes (have to go before the macros). */ _PROTOTYPE( int isalnum, (int _c) ); /* alphanumeric [a-z], [A-Z], [0-9] */ _PROTOTYPE( int isalpha, (int _c) ); /* alphabetic */ +_PROTOTYPE( int isblank, (int _c) ); /* blank space */ _PROTOTYPE( int iscntrl, (int _c) ); /* control characters */ _PROTOTYPE( int isdigit, (int _c) ); /* digit [0-9] */ _PROTOTYPE( int isgraph, (int _c) ); /* graphic character */ @@ -51,6 +52,7 @@ _PROTOTYPE( int toascii, (int _c) ); /* convert to 7-bit ASCII */ #define isupper(c) ((unsigned) ((c)-'A') < 26) #define isprint(c) ((unsigned) ((c)-' ') < 95) #define isascii(c) ((unsigned) (c) < 128) +#define isblank(c) ((c) == ' ' || (c) == '\t') #define toascii(c) ((c) & 0x7f) diff --git a/lib/libc/ansi/Makefile.inc b/lib/libc/ansi/Makefile.inc index a28aad93e..4e6e7aa16 100644 --- a/lib/libc/ansi/Makefile.inc +++ b/lib/libc/ansi/Makefile.inc @@ -22,6 +22,7 @@ SRCS+= \ isalnum.c \ isalpha.c \ isascii.c \ + isblank.c \ iscntrl.c \ isdigit.c \ isgraph.c \ diff --git a/lib/libc/ansi/isblank.c b/lib/libc/ansi/isblank.c new file mode 100644 index 000000000..a3ce4649b --- /dev/null +++ b/lib/libc/ansi/isblank.c @@ -0,0 +1,5 @@ +#include + +int (isblank)(int c) { + return isblank(c); +}