summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornik <nik@FreeBSD.org>2002-01-09 13:43:31 +0000
committernik <nik@FreeBSD.org>2002-01-09 13:43:31 +0000
commiteea8272b9c5205a3838fa98536fbac22d916417b (patch)
tree5f4316630fe25239e094f6761f1c2722fa0140a4
parent2590927e9ef5241c7605b6aaa7c6e8d3276b5407 (diff)
downloadFreeBSD-src-eea8272b9c5205a3838fa98536fbac22d916417b.zip
FreeBSD-src-eea8272b9c5205a3838fa98536fbac22d916417b.tar.gz
From the PR:
1. ctype.h defines digittoint(), isnumber() and ishexnmber(), yet they are not documented in any of the manpages. 2. The ctype manpage references a non-existent manpage for digittoint(). 3. The isascii() manpage claims it is standards compliant, when it isn't. 4. isblank() claims it is _not_ standards compliant, when it is. Fix by including the appropriate .Nm entries, and with a new digittoint.3 page. PR: docs/26451 Submitted by: Adrian Filipi-Martin <adrian@ubergeeks.com>
-rw-r--r--lib/libc/locale/Makefile.inc2
-rw-r--r--lib/libc/locale/ctype.38
-rw-r--r--lib/libc/locale/digittoint.376
-rw-r--r--lib/libc/locale/isascii.35
-rw-r--r--lib/libc/locale/isblank.34
-rw-r--r--lib/libc/locale/isdigit.34
-rw-r--r--lib/libc/locale/isxdigit.34
-rw-r--r--lib/libc/locale/toascii.31
-rw-r--r--lib/libc/locale/tolower.31
-rw-r--r--lib/libc/locale/toupper.31
10 files changed, 98 insertions, 8 deletions
diff --git a/lib/libc/locale/Makefile.inc b/lib/libc/locale/Makefile.inc
index 50abb29..3914e1f 100644
--- a/lib/libc/locale/Makefile.inc
+++ b/lib/libc/locale/Makefile.inc
@@ -25,4 +25,6 @@ MLINKS+=rune.3 fgetrune.3 rune.3 fputrune.3 rune.3 fungetrune.3 \
rune.3 setinvalidrune.3 rune.3 setrunelocale.3 rune.3 sgetrune.3 \
rune.3 sputrune.3
MLINKS+=setlocale.3 localeconv.3
+MLINKS+=isxdigit.3 ishexnumber.3
+MLINKS+=isdigit.3 isnumber.3
.endif
diff --git a/lib/libc/locale/ctype.3 b/lib/libc/locale/ctype.3
index d1ab228..60d995d 100644
--- a/lib/libc/locale/ctype.3
+++ b/lib/libc/locale/ctype.3
@@ -55,6 +55,7 @@
.Nm isspecial ,
.Nm isupper ,
.Nm isxdigit ,
+.Nm digittoint ,
.Nm toascii ,
.Nm tolower ,
.Nm toupper
@@ -100,6 +101,8 @@
.Ft int
.Fn isxdigit "int c"
.Ft int
+.Fn digittoint "int c"
+.Ft int
.Fn toascii "int c"
.Ft int
.Fn tolower "int c"
@@ -126,6 +129,7 @@ See the specific manual pages for more information.
.Xr isspace 3 ,
.Xr isupper 3 ,
.Xr isxdigit 3 ,
+.Xr digittoint 3 ,
.Xr toascii 3 ,
.Xr tolower 3 ,
.Xr toupper 3 ,
@@ -134,7 +138,6 @@ See the specific manual pages for more information.
These functions, except for
.Fn digittoint ,
.Fn isascii ,
-.Fn isblank ,
.Fn ishexnumber ,
.Fn isideogram ,
.Fn isnumber ,
@@ -145,3 +148,6 @@ and
.Fn toascii ,
conform to
.St -isoC .
+.Fn isblank
+conforms to
+.St -isoC-99 .
diff --git a/lib/libc/locale/digittoint.3 b/lib/libc/locale/digittoint.3
new file mode 100644
index 0000000..60509f1
--- /dev/null
+++ b/lib/libc/locale/digittoint.3
@@ -0,0 +1,76 @@
+.\" Copyright (c) 1993
+.\" The Regents of the University of California. All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\" 3. All advertising materials mentioning features or use of this software
+.\" must display the following acknowledgement:
+.\" This product includes software developed by the University of
+.\" California, Berkeley and its contributors.
+.\" 4. Neither the name of the University nor the names of its contributors
+.\" may be used to endorse or promote products derived from this software
+.\" without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" @(#)digittoint.3 8.1 (Berkeley) 6/4/93
+.\" $FreeBSD$
+.\"
+.Dd April 6, 2001
+.Dt DIGITTOINT 3
+.Os
+.Sh NAME
+.Nm digittoint
+.Nd convert a numeric character to its integer value
+.Sh LIBRARY
+.Lb libc
+.Sh SYNOPSIS
+.Fd #include <ctype.h>
+.Ft int
+.Fn digittoint "int c"
+.Sh DESCRIPTION
+The
+.Fn digittoint
+function converts a numeric character to its corresponding integer value. The
+character can be any decimal digit or hexadecimal digit. With hexadecimal
+characters, the case of the values does not matter.
+.Sh RETURN VALUES
+The
+.Fn digittoint
+function always returns an integer from the range of 0 to 15. If the
+given character was not a digit as defined by
+.Xr isxdigit 3 , the function will return 0.
+.Sh SEE ALSO
+.Xr isalnum 3 ,
+.Xr isalpha 3 ,
+.Xr isascii 3 ,
+.Xr iscntrl 3 ,
+.Xr isdigit 3 ,
+.Xr isgraph 3 ,
+.Xr islower 3 ,
+.Xr isprint 3 ,
+.Xr ispunct 3 ,
+.Xr isspace 3 ,
+.Xr isupper 3 ,
+.Xr isxdigit 3 ,
+.Xr stdio 3 ,
+.Xr digittoint 3 ,
+.Xr tolower 3 ,
+.Xr toupper 3 ,
+.Xr ascii 7
diff --git a/lib/libc/locale/isascii.3 b/lib/libc/locale/isascii.3
index f30e0a8..8079d0d 100644
--- a/lib/libc/locale/isascii.3
+++ b/lib/libc/locale/isascii.3
@@ -54,8 +54,3 @@ between 0 and octal 0177 inclusive.
.Sh SEE ALSO
.Xr ctype 3 ,
.Xr ascii 7
-.Sh STANDARDS
-The
-.Fn isascii
-function conforms to
-.St -isoC .
diff --git a/lib/libc/locale/isblank.3 b/lib/libc/locale/isblank.3
index b1a2e37..59fca63 100644
--- a/lib/libc/locale/isblank.3
+++ b/lib/libc/locale/isblank.3
@@ -76,6 +76,10 @@ returns non-zero if the character tests true.
.Xr multibyte 3 ,
.Xr ascii 7
.Sh STANDARDS
+.Fn isblank
+conforms to
+.St -isoC-99 .
+.Sh STANDARDS
The
.Fn isblank
function conforms to
diff --git a/lib/libc/locale/isdigit.3 b/lib/libc/locale/isdigit.3
index 3ffc4fa..5d34e0c 100644
--- a/lib/libc/locale/isdigit.3
+++ b/lib/libc/locale/isdigit.3
@@ -40,7 +40,7 @@
.Dt ISDIGIT 3
.Os
.Sh NAME
-.Nm isdigit
+.Nm isdigit, isnumber
.Nd decimal-digit character test
.Sh LIBRARY
.Lb libc
@@ -48,6 +48,8 @@
.In ctype.h
.Ft int
.Fn isdigit "int c"
+.Ft int
+.Fn isnumber "int c"
.Sh DESCRIPTION
The
.Fn isdigit
diff --git a/lib/libc/locale/isxdigit.3 b/lib/libc/locale/isxdigit.3
index 5f5ee52..aa54ad2 100644
--- a/lib/libc/locale/isxdigit.3
+++ b/lib/libc/locale/isxdigit.3
@@ -40,7 +40,7 @@
.Dt ISXDIGIT 3
.Os
.Sh NAME
-.Nm isxdigit
+.Nm isxdigit, ishexnumber
.Nd hexadecimal-digit character test
.Sh LIBRARY
.Lb libc
@@ -48,6 +48,8 @@
.In ctype.h
.Ft int
.Fn isxdigit "int c"
+.Ft int
+.Fn ishexnumber "int c"
.Sh DESCRIPTION
The
.Fn isxdigit
diff --git a/lib/libc/locale/toascii.3 b/lib/libc/locale/toascii.3
index e9a936c..975b320 100644
--- a/lib/libc/locale/toascii.3
+++ b/lib/libc/locale/toascii.3
@@ -54,6 +54,7 @@ The
.Fn toascii
function always returns a valid ASCII character.
.Sh SEE ALSO
+.Xr digittoint 3 ,
.Xr isalnum 3 ,
.Xr isalpha 3 ,
.Xr isascii 3 ,
diff --git a/lib/libc/locale/tolower.3 b/lib/libc/locale/tolower.3
index 2c49cec..500b746 100644
--- a/lib/libc/locale/tolower.3
+++ b/lib/libc/locale/tolower.3
@@ -68,6 +68,7 @@ If the argument is an upper-case letter, the
function returns the corresponding lower-case letter if there is
one; otherwise the argument is returned unchanged.
.Sh SEE ALSO
+.Xr digittoint 3 ,
.Xr isalnum 3 ,
.Xr isalpha 3 ,
.Xr isascii 3 ,
diff --git a/lib/libc/locale/toupper.3 b/lib/libc/locale/toupper.3
index 664856c..33862f8 100644
--- a/lib/libc/locale/toupper.3
+++ b/lib/libc/locale/toupper.3
@@ -68,6 +68,7 @@ If the argument is a lower-case letter, the
function returns the corresponding upper-case letter if there is
one; otherwise the argument is returned unchanged.
.Sh SEE ALSO
+.Xr digittoint 3 ,
.Xr isalnum 3 ,
.Xr isalpha 3 ,
.Xr isascii 3 ,
OpenPOWER on IntegriCloud