From: Marco Schlumpp Date: Fri, 25 Mar 2022 15:07:17 +0000 (+0100) Subject: lib/nolibc: Implement isblank function X-Git-Tag: RELEASE-0.13.0~85 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=fb70e9f5e09d62cb5eca12702620047ff8e4982c;p=unikraft%2Funikraft.git lib/nolibc: Implement isblank function This function determines whether the given character is a space or tab. Signed-off-by: Marco Schlumpp Reviewed-by: Razvan Deaconescu Reviewed-by: Marc Rittinghaus Approved-by: Marc Rittinghaus Tested-by: Unikraft CI GitHub-Closes: #627 --- diff --git a/lib/nolibc/include/ctype.h b/lib/nolibc/include/ctype.h index c3bbeb67c..8172eeeb9 100644 --- a/lib/nolibc/include/ctype.h +++ b/lib/nolibc/include/ctype.h @@ -65,6 +65,8 @@ extern const unsigned char _nolibc_ctype[]; #define isascii(c) (((unsigned char)(c)) <= 0x7f) #define toascii(c) ((int)(((unsigned char)(c)) & 0x7f)) +#define isblank(c) ((c) == ' ' || (c) == '\t') + static inline int tolower(int c) { if (isupper(c))