Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 20 Jun 2026 11:53:53 +0000
From:      Jean-=?utf-8?Q?S=C3=A9bast?==?utf-8?Q?ien P=C3=A9?=dron <dumbbell@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 4831a8d792d4 - main - sys: Add `isgraph()` to <sys/ctype.h>
Message-ID:  <6a367f51.255b0.19486359@gitrepo.freebsd.org>

index | next in thread | raw e-mail

The branch main has been updated by dumbbell:

URL: https://cgit.FreeBSD.org/src/commit/?id=4831a8d792d4ac2cbf4d49d9d220947fb53e2e86

commit 4831a8d792d4ac2cbf4d49d9d220947fb53e2e86
Author:     Jean-Sébastien Pédron <dumbbell@FreeBSD.org>
AuthorDate: 2026-06-12 14:39:21 +0000
Commit:     Jean-Sébastien Pédron <dumbbell@FreeBSD.org>
CommitDate: 2026-06-20 10:34:20 +0000

    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
---
 sys/sys/ctype.h | 6 ++++++
 1 file changed, 6 insertions(+)

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
@@ -87,6 +87,12 @@ isprint(int c)
 	return (c >= ' ' && c <= '~');
 }
 
+static __inline int
+isgraph(int c)
+{
+	return (c != ' ' && isprint(c));
+}
+
 static __inline int
 toupper(int c)
 {


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6a367f51.255b0.19486359>