diff options
| author | Jean-Sébastien Pédron <dumbbell@FreeBSD.org> | 2026-06-12 14:39:21 +0000 |
|---|---|---|
| committer | Jean-Sébastien Pédron <dumbbell@FreeBSD.org> | 2026-06-20 10:34:20 +0000 |
| commit | 4831a8d792d4ac2cbf4d49d9d220947fb53e2e86 (patch) | |
| tree | f3432d3d1f5d40d3e731e337d6f48f6270dba071 | |
| parent | 22d66952555c86a5b7d1d499b48906c3a5f4c13d (diff) | |
sys: Add `isgraph()` to <sys/ctype.h>
Quote from https://pubs.opengroup.org/onlinepubs/7908799/xbd/locale.html:
"graph": Define characters to be classified as printable characters,
not including the space character.
Reviewed by: emaste
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57578
| -rw-r--r-- | sys/sys/ctype.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/sys/ctype.h b/sys/sys/ctype.h index effb549b40f8..2e5827cc02f9 100644 --- a/sys/sys/ctype.h +++ b/sys/sys/ctype.h @@ -88,6 +88,12 @@ isprint(int c) } static __inline int +isgraph(int c) +{ + return (c != ' ' && isprint(c)); +} + +static __inline int toupper(int c) { return (c - 0x20 * ((c >= 'a') && (c <= 'z'))); |
