diff options
author | tjr <tjr@FreeBSD.org> | 2004-03-30 07:02:04 +0000 |
---|---|---|
committer | tjr <tjr@FreeBSD.org> | 2004-03-30 07:02:04 +0000 |
commit | 9d08058845ab4b9016dedfa1bf6bcf9cc8ab53ef (patch) | |
tree | 5e5b78d3553e9abbe794f410c00dd09527be7245 | |
parent | 0d09dc88d557ec14b185499ac6c4e9d508092b60 (diff) | |
download | FreeBSD-src-9d08058845ab4b9016dedfa1bf6bcf9cc8ab53ef.zip FreeBSD-src-9d08058845ab4b9016dedfa1bf6bcf9cc8ab53ef.tar.gz |
Document the isnumber() and ishexnumber() functions, and explain how they
differ (at least in theory) from isdigit() and isxdigit().
-rw-r--r-- | lib/libc/locale/isdigit.3 | 23 | ||||
-rw-r--r-- | lib/libc/locale/isxdigit.3 | 24 |
2 files changed, 34 insertions, 13 deletions
diff --git a/lib/libc/locale/isdigit.3 b/lib/libc/locale/isdigit.3 index bb7dd72..42503ad 100644 --- a/lib/libc/locale/isdigit.3 +++ b/lib/libc/locale/isdigit.3 @@ -36,7 +36,7 @@ .\" @(#)isdigit.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd October 6, 2002 +.Dd March 30, 2004 .Dt ISDIGIT 3 .Os .Sh NAME @@ -53,15 +53,21 @@ .Sh DESCRIPTION The .Fn isdigit -function tests for any decimal-digit character. -For any locale, -this includes the following characters only: +function tests for a decimal digit character. +Regardless of locale, this includes the following characters only: .Pp .Bl -column \&``0''______ \&``0''______ \&``0''______ \&``0''______ \&``0''______ .It "\&``0''\t``1''\t``2''\t``3''\t``4''" .It "\&``5''\t``6''\t``7''\t``8''\t``9''" .El .Pp +The +.Fn isnumber +function behaves similarly to +.Fn isdigit , +but may recognize additional characters, depending on the current locale +setting. +.Pp For single C .Va char Ns s locales (see @@ -74,7 +80,9 @@ or the value of .Sh RETURN VALUES The .Fn isdigit -function returns zero if the character tests false and +and +.Fn isnumber +functions return zero if the character tests false and returns non-zero if the character tests true. .Sh COMPATIBILITY Although @@ -97,3 +105,8 @@ The .Fn isdigit function conforms to .St -isoC . +.Sh HISTORY +The +.Fn isnumber +function appeared in +.Bx 4.4 . diff --git a/lib/libc/locale/isxdigit.3 b/lib/libc/locale/isxdigit.3 index 661b7fb..df50744 100644 --- a/lib/libc/locale/isxdigit.3 +++ b/lib/libc/locale/isxdigit.3 @@ -36,7 +36,7 @@ .\" @(#)isxdigit.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd October 6, 2002 +.Dd March 30, 2004 .Dt ISXDIGIT 3 .Os .Sh NAME @@ -54,7 +54,7 @@ The .Fn isxdigit function tests for any hexadecimal-digit character. -For any locale, this includes the following characters only: +Regardless of locale, this includes the following characters only: .Pp .Bl -column \&``0''______ \&``0''______ \&``0''______ \&``0''______ \&``0''______ .It "\&``0''\t``1''\t``2''\t``3''\t``4''" @@ -64,6 +64,13 @@ For any locale, this includes the following characters only: .It "\&``e''\t``f''" .El .Pp +The +.Fn ishexnumber +function behaves similarly to +.Fn isxdigit , +but may recognize additional characters, +depennding on the current locale setting. +.Pp For single C .Va char Ns s locales (see @@ -81,18 +88,14 @@ returns non-zero if the character tests true. .Sh COMPATIBILITY Although .Fn isxdigit -and -.Fn ishexnumber -accept arguments outside of the range of the +accepts arguments outside of the range of the .Vt "unsigned char" type in locales with large character sets, this is a .Bx 4.4 extension and the .Fn isxwdigit -and -.Fn iswhexnumber -functions should be used instead for maximum portability. +function should be used instead for maximum portability. .Sh SEE ALSO .Xr ctype 3 , .Xr iswxdigit 3 , @@ -103,3 +106,8 @@ The .Fn isxdigit function conforms to .St -isoC . +.Sh HISTORY +The +.Fn ishexnumber +function appeared in +.Bx 4.4 . |