diff options
author | 2017-09-05 03:16:13 +0000 | |
---|---|---|
committer | 2017-09-05 03:16:13 +0000 | |
commit | 3a628b46e7aaa520a6215eccabf31d313c2e7de0 (patch) | |
tree | c6543ac3a194244f09c381abe688fa69e6c8d49a /lib/libc/gen/isgraph.3 | |
parent | Add additional errno values required by POSIX. (diff) | |
download | wireguard-openbsd-3a628b46e7aaa520a6215eccabf31d313c2e7de0.tar.xz wireguard-openbsd-3a628b46e7aaa520a6215eccabf31d313c2e7de0.zip |
New POSIX xlocale implementation written from scratch.
Complete in the sense that all POSIX *locale(3) and *_l(3) functions
are included, but in OpenBSD, we of course only really care about
LC_CTYPE and we only support ASCII and UTF-8.
With important help from kettenis@, guenther@, and jca@.
Repeated testing in ports bulk builds by naddy@.
Additional testing by jca@, sebastia@, dcoppa@, and others.
OK kettenis@ dcoppa@, and guenther@ on an earlier version.
Riding guenther@'s libc/librthread major bump.
Diffstat (limited to 'lib/libc/gen/isgraph.3')
-rw-r--r-- | lib/libc/gen/isgraph.3 | 60 |
1 files changed, 49 insertions, 11 deletions
diff --git a/lib/libc/gen/isgraph.3 b/lib/libc/gen/isgraph.3 index fab5db54ccc..e27a6257d05 100644 --- a/lib/libc/gen/isgraph.3 +++ b/lib/libc/gen/isgraph.3 @@ -1,6 +1,7 @@ -.\" $OpenBSD: isgraph.3,v 1.11 2013/07/06 17:31:20 jmc Exp $ +.\" $OpenBSD: isgraph.3,v 1.12 2017/09/05 03:16:13 schwarze Exp $ .\" .\" Copyright (c) 1991 The Regents of the University of California. +.\" Copyright (c) 2017 Ingo Schwarze <schwarze@openbsd.org> .\" All rights reserved. .\" .\" This code is derived from software contributed to Berkeley by @@ -31,26 +32,49 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd $Mdocdate: July 6 2013 $ +.Dd $Mdocdate: September 5 2017 $ .Dt ISGRAPH 3 .Os .Sh NAME -.Nm isgraph -.Nd printing character test (space character exclusive) +.Nm isgraph , +.Nm isgraph_l +.Nd printing single-byte character test (space character exclusive) .Sh SYNOPSIS .In ctype.h .Ft int .Fn isgraph "int c" +.Ft int +.Fn isgraph_l "int c" "locale_t locale" .Sh DESCRIPTION The .Fn isgraph -function tests for any printing character except space +and +.Fn isgraph_l +functions tests for any printing character except space .Pq Sq \ \& . +.Pp +In the C locale, the complete list of printing characters +consists of the characters numbered 0x21\(en0x7e, which is +the union of the characters for which +.Xr isalnum 3 +or +.Xr ispunct 3 +is true. +.Ox +always uses the C locale for these functions, +ignoring the global locale, the thread-specific locale, and the +.Fa locale +argument. .Sh RETURN VALUES -The -.Fn isgraph -function returns zero if the character tests false or +These functions return zero if the character tests false or non-zero if the character tests true. +.Sh ENVIRONMENT +On systems supporting non-ASCII single-byte character encodings, +results of these functions may differ, and the results of +.Fn isgraph +may depend on the +.Ev LC_CTYPE +.Xr locale 1 . .Sh SEE ALSO .Xr isalnum 3 , .Xr isalpha 3 , @@ -63,6 +87,7 @@ non-zero if the character tests true. .Xr ispunct 3 , .Xr isspace 3 , .Xr isupper 3 , +.Xr iswgraph 3 , .Xr isxdigit 3 , .Xr stdio 3 , .Xr toascii 3 , @@ -73,10 +98,23 @@ non-zero if the character tests true. The .Fn isgraph function conforms to -.St -ansiC . -.Sh CAVEATS -The argument to +.St -ansiC , +and +.Fn isgraph_l +to +.St -p1003.1-2008 . +.Sh HISTORY +The .Fn isgraph +function first appeared in +.At III , +and +.Fn isgraph_l +has been available since +.Ox 6.2 . +.Sh CAVEATS +The argument +.Fa c must be .Dv EOF or representable as an |