summaryrefslogtreecommitdiffstats
path: root/lib/libc/gen/isupper.3
diff options
context:
space:
mode:
authorschwarze <schwarze@openbsd.org>2017-09-05 03:16:13 +0000
committerschwarze <schwarze@openbsd.org>2017-09-05 03:16:13 +0000
commit3a628b46e7aaa520a6215eccabf31d313c2e7de0 (patch)
treec6543ac3a194244f09c381abe688fa69e6c8d49a /lib/libc/gen/isupper.3
parentAdd additional errno values required by POSIX. (diff)
downloadwireguard-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/isupper.3')
-rw-r--r--lib/libc/gen/isupper.363
1 files changed, 45 insertions, 18 deletions
diff --git a/lib/libc/gen/isupper.3 b/lib/libc/gen/isupper.3
index 364d62eb3fa..d519568ef1f 100644
--- a/lib/libc/gen/isupper.3
+++ b/lib/libc/gen/isupper.3
@@ -1,6 +1,7 @@
-.\" $OpenBSD: isupper.3,v 1.13 2013/07/17 05:42:11 schwarze Exp $
+.\" $OpenBSD: isupper.3,v 1.14 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,35 +32,52 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd $Mdocdate: July 17 2013 $
+.Dd $Mdocdate: September 5 2017 $
.Dt ISUPPER 3
.Os
.Sh NAME
-.Nm isupper
-.Nd upper-case character test
+.Nm isupper ,
+.Nm isupper_l
+.Nd upper-case singly-byte character test
.Sh SYNOPSIS
.In ctype.h
.Ft int
.Fn isupper "int c"
+.Ft int
+.Fn isupper_l "int c" "locale_t locale"
.Sh DESCRIPTION
The
.Fn isupper
-function tests for any upper-case letter or any of an
-implementation-defined set of characters for which none of
+and
+.Fn isupper_l
+functions test whether
+.Fa c
+represents an upper-case letter.
+.Pp
+In the C locale, the complete list of upper-case letters is A\(enZ.
+.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
+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,
+these functions may return non-zero for additional characters,
+and the results of
+.Fn isupper
+may depend on the
+.Ev LC_CTYPE
+.Xr locale 1 ,
+but they never return non-zero for any character for which
.Xr iscntrl 3 ,
.Xr isdigit 3 ,
.Xr ispunct 3 ,
or
.Xr isspace 3
is true.
-In the C locale,
-.Fn isupper
-returns true only for the characters defined as upper-case letters.
-.Sh RETURN VALUES
-The
-.Fn isupper
-function returns zero if the character tests false or
-non-zero if the character tests true.
.Sh SEE ALSO
.Xr isalnum 3 ,
.Xr isalpha 3 ,
@@ -72,6 +90,7 @@ non-zero if the character tests true.
.Xr isprint 3 ,
.Xr ispunct 3 ,
.Xr isspace 3 ,
+.Xr iswupper 3 ,
.Xr isxdigit 3 ,
.Xr stdio 3 ,
.Xr toascii 3 ,
@@ -82,15 +101,23 @@ non-zero if the character tests true.
The
.Fn isupper
function conforms to
-.St -ansiC .
+.St -ansiC ,
+and
+.Fn isupper_l
+to
+.St -p1003.1-2008 .
.Sh HISTORY
The
.Fn isupper
function first appeared in
-.At v7 .
+.At v7 ,
+and
+.Fn isupper_l
+has been available since
+.Ox 6.2 .
.Sh CAVEATS
-The argument to
-.Fn isupper
+The argument
+.Fa c
must be
.Dv EOF
or representable as an