From 56e7673cc083b52e0d68354b28f360fe4d1791f3 Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Sun, 10 Aug 2025 04:32:47 -0400 Subject: lib: libc: Add isascii() in ctype.h Signed-off-by: Ian Moffett --- lib/libc/include/ctype.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/libc/include/ctype.h b/lib/libc/include/ctype.h index 0ff9a43..2a827e3 100644 --- a/lib/libc/include/ctype.h +++ b/lib/libc/include/ctype.h @@ -35,6 +35,12 @@ __BEGIN_DECLS +__always_inline static inline int +__isascii(int c) +{ + return c >= 0 && c <= 127; +} + __always_inline static inline int __tolower(int c) { @@ -92,4 +98,7 @@ __END_DECLS /* Is a space? */ #define isspace(C) __isspace((C)) +/* Is ascii? */ +#define isascii(C) __isascii((C)) + #endif /* _CTYPE_H */ -- cgit v1.2.3