Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 13 Mar 2012 20:02:42 +0000 (UTC)
From:      David Chisnall <theraven@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r232935 - head/lib/libc/locale
Message-ID:  <201203132002.q2DK2g0K060213@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: theraven
Date: Tue Mar 13 20:02:41 2012
New Revision: 232935
URL: http://svn.freebsd.org/changeset/base/232935

Log:
  First set of xlocale man pages.  More to follow...
  
  Approved by:	dim (mentor)

Added:
  head/lib/libc/locale/ctype_l.3
     - copied, changed from r232600, head/lib/libc/locale/ctype.3
Modified:
  head/lib/libc/locale/Makefile.inc
  head/lib/libc/locale/btowc.3
  head/lib/libc/locale/ctype.3
  head/lib/libc/locale/digittoint.3
  head/lib/libc/locale/isalnum.3
  head/lib/libc/locale/isalpha.3
  head/lib/libc/locale/isblank.3
  head/lib/libc/locale/iscntrl.3
  head/lib/libc/locale/isdigit.3

Modified: head/lib/libc/locale/Makefile.inc
==============================================================================
--- head/lib/libc/locale/Makefile.inc	Tue Mar 13 19:40:56 2012	(r232934)
+++ head/lib/libc/locale/Makefile.inc	Tue Mar 13 20:02:41 2012	(r232935)
@@ -26,6 +26,7 @@ SRCS+=	ascii.c big5.c btowc.c collate.c 
 SYM_MAPS+=${.CURDIR}/locale/Symbol.map
 
 MAN+=	btowc.3 \
+	ctype_l.3 \
 	ctype.3 digittoint.3 isalnum.3 isalpha.3 isascii.3 isblank.3 iscntrl.3 \
 	isdigit.3 isgraph.3 isideogram.3 islower.3 isphonogram.3 isprint.3 \
 	ispunct.3 isrune.3 isspace.3 isspecial.3 \

Modified: head/lib/libc/locale/btowc.3
==============================================================================
--- head/lib/libc/locale/btowc.3	Tue Mar 13 19:40:56 2012	(r232934)
+++ head/lib/libc/locale/btowc.3	Tue Mar 13 20:02:41 2012	(r232935)
@@ -39,6 +39,12 @@
 .Fn btowc "int c"
 .Ft int
 .Fn wctob "wint_t c"
+.In wchar.h
+.In xlocale.h
+.Ft wint_t
+.Fn btowc "int c"
+.Ft int
+.Fn wctob "wint_t c"
 .Sh DESCRIPTION
 The
 .Fn btowc
@@ -59,6 +65,9 @@ or not able to be represented as a singl
 .Fn wctob
 returns
 .Dv EOF .
+.Pp
+The _l-suffixed versions take an explicit locale argument, while the
+non-suffixed versions use the current global or per-thread locale.
 .Sh SEE ALSO
 .Xr mbrtowc 3 ,
 .Xr multibyte 3 ,

Modified: head/lib/libc/locale/ctype.3
==============================================================================
--- head/lib/libc/locale/ctype.3	Tue Mar 13 19:40:56 2012	(r232934)
+++ head/lib/libc/locale/ctype.3	Tue Mar 13 20:02:41 2012	(r232935)
@@ -55,7 +55,7 @@
 .Nm toascii ,
 .Nm tolower ,
 .Nm toupper
-.Nd character classification macros
+.Nd character classification functions 
 .Sh LIBRARY
 .Lb libc
 .Sh SYNOPSIS

Copied and modified: head/lib/libc/locale/ctype_l.3 (from r232600, head/lib/libc/locale/ctype.3)
==============================================================================
--- head/lib/libc/locale/ctype.3	Tue Mar  6 12:20:37 2012	(r232600, copy source)
+++ head/lib/libc/locale/ctype_l.3	Tue Mar 13 20:02:41 2012	(r232935)
@@ -1,5 +1,8 @@
-.\" Copyright (c) 1991, 1993
-.\"	The Regents of the University of California.  All rights reserved.
+.\" Copyright (c) 2011 The FreeBSD Foundation
+.\" All rights reserved.
+.\"
+.\" This documentation was written by David Chisnall under sponsorship from
+.\" the FreeBSD Foundation.
 .\"
 .\" Redistribution and use in source and binary forms, with or without
 .\" modification, are permitted provided that the following conditions
@@ -9,9 +12,6 @@
 .\" 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.
-.\" 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
@@ -25,89 +25,88 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.\"     @(#)ctype.3	8.1 (Berkeley) 6/4/93
 .\" $FreeBSD$
 .\"
-.Dd March 30, 2004
-.Dt CTYPE 3
+.Dd March 6, 2012
+.Dt CTYPE_L 3
 .Os
 .Sh NAME
-.Nm digittoint ,
-.Nm isalnum ,
-.Nm isalpha ,
-.Nm isascii ,
-.Nm isblank ,
-.Nm iscntrl ,
-.Nm isdigit ,
-.Nm isgraph ,
-.Nm ishexnumber ,
-.Nm isideogram ,
-.Nm islower ,
-.Nm isnumber ,
-.Nm isphonogram ,
-.Nm isprint ,
-.Nm ispunct ,
-.Nm isrune ,
-.Nm isspace ,
-.Nm isspecial ,
-.Nm isupper ,
-.Nm isxdigit ,
-.Nm toascii ,
-.Nm tolower ,
-.Nm toupper
-.Nd character classification macros
+.Nm digittoint_l ,
+.Nm isalnum_l ,
+.Nm isalpha_l ,
+.Nm isascii_l ,
+.Nm isblank_l ,
+.Nm iscntrl_l ,
+.Nm isdigit_l ,
+.Nm isgraph_l ,
+.Nm ishexnumber_l ,
+.Nm isideogram_l ,
+.Nm islower_l ,
+.Nm isnumber_l ,
+.Nm isphonogram_l ,
+.Nm isprint_l ,
+.Nm ispunct_l ,
+.Nm isrune_l ,
+.Nm isspace_l ,
+.Nm isspecial_l ,
+.Nm isupper_l ,
+.Nm isxdigit_l ,
+.Nm tolower_l ,
+.Nm toupper_l
+.Nd character classification functions
 .Sh LIBRARY
 .Lb libc
 .Sh SYNOPSIS
 .In ctype.h
 .Ft int
-.Fn digittoint "int c"
-.Ft int
-.Fn isalnum "int c"
+.Fn digittoint_l "int c" "locale_t loc"
 .Ft int
-.Fn isalpha "int c"
+.Fn isalnum_l "int c" "locale_t loc"
 .Ft int
-.Fn isascii "int c"
+.Fn isalpha_l "int c" "locale_t loc"
 .Ft int
-.Fn iscntrl "int c"
+.Fn isascii_l "int c" "locale_t loc"
 .Ft int
-.Fn isdigit "int c"
+.Fn iscntrl_l "int c" "locale_t loc"
 .Ft int
-.Fn isgraph "int c"
+.Fn isdigit_l "int c" "locale_t loc"
 .Ft int
-.Fn ishexnumber "int c"
+.Fn isgraph_l "int c" "locale_t loc"
 .Ft int
-.Fn isideogram "int c"
+.Fn ishexnumber_l "int c" "locale_t loc"
 .Ft int
-.Fn islower "int c"
+.Fn isideogram_l "int c" "locale_t loc"
 .Ft int
-.Fn isnumber "int c"
+.Fn islower_l "int c" "locale_t loc"
 .Ft int
-.Fn isphonogram "int c"
+.Fn isnumber_l "int c" "locale_t loc"
 .Ft int
-.Fn isspecial "int c"
+.Fn isphonogram_l "int c" "locale_t loc"
 .Ft int
-.Fn isprint "int c"
+.Fn isspecial_l "int c" "locale_t loc"
 .Ft int
-.Fn ispunct "int c"
+.Fn isprint_l "int c" "locale_t loc"
 .Ft int
-.Fn isrune "int c"
+.Fn ispunct_l "int c" "locale_t loc"
 .Ft int
-.Fn isspace "int c"
+.Fn isrune_l "int c" "locale_t loc"
 .Ft int
-.Fn isupper "int c"
+.Fn isspace_l "int c" "locale_t loc"
 .Ft int
-.Fn isxdigit "int c"
+.Fn isupper_l "int c" "locale_t loc"
 .Ft int
-.Fn toascii "int c"
+.Fn isxdigit_l "int c" "locale_t loc"
 .Ft int
-.Fn tolower "int c"
+.Fn tolower_l "int c" "locale_t loc"
 .Ft int
-.Fn toupper "int c"
+.Fn toupper_l "int c" "locale_t loc"
 .Sh DESCRIPTION
 The above functions perform character tests and conversions on the integer
-.Fa c .
-They are available as macros, defined in the include file
+.Fa c 
+in the locale
+.Fa loc .
+They behave in the same way as the versions without the _l suffix, but use the
+specified locale rather than the global or per-thread locale.  
 .In ctype.h ,
 or as true functions in the C library.
 See the specific manual pages for more information.
@@ -130,22 +129,10 @@ See the specific manual pages for more i
 .Xr isspecial 3 ,
 .Xr isupper 3 ,
 .Xr isxdigit 3 ,
-.Xr toascii 3 ,
 .Xr tolower 3 ,
 .Xr toupper 3 ,
 .Xr wctype 3 ,
-.Xr ascii 7
+.Xr xlocale 3
 .Sh STANDARDS
-These functions, except for
-.Fn digittoint ,
-.Fn isascii ,
-.Fn ishexnumber ,
-.Fn isideogram ,
-.Fn isnumber ,
-.Fn isphonogram ,
-.Fn isrune ,
-.Fn isspecial
-and
-.Fn toascii ,
-conform to
-.St -isoC .
+These functions conform to
+.St -p1003.1-2008 .

Modified: head/lib/libc/locale/digittoint.3
==============================================================================
--- head/lib/libc/locale/digittoint.3	Tue Mar 13 19:40:56 2012	(r232934)
+++ head/lib/libc/locale/digittoint.3	Tue Mar 13 20:02:41 2012	(r232935)
@@ -40,12 +40,20 @@
 .In ctype.h
 .Ft int
 .Fn digittoint "int c"
+.Ft int
+.Fn digittoint_l "int c" "locale_t loc"
 .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.
+.Pp
+The 
+.Fn digittoint_l
+function takes an explicit locale argument, whereas the
+.Fn digittoint
+function use the current global or per-thread locale.
 .Sh RETURN VALUES
 The
 .Fn digittoint
@@ -56,4 +64,5 @@ the function will return 0.
 .Sh SEE ALSO
 .Xr ctype 3 ,
 .Xr isdigit 3 ,
-.Xr isxdigit 3
+.Xr isxdigit 3,
+.Xr xlocale 3

Modified: head/lib/libc/locale/isalnum.3
==============================================================================
--- head/lib/libc/locale/isalnum.3	Tue Mar 13 19:40:56 2012	(r232934)
+++ head/lib/libc/locale/isalnum.3	Tue Mar 13 20:02:41 2012	(r232935)
@@ -44,6 +44,8 @@
 .In ctype.h
 .Ft int
 .Fn isalnum "int c"
+.Ft int
+.Fn isalnum_l "int c" "locale_t loc"
 .Sh DESCRIPTION
 The
 .Fn isalnum
@@ -74,6 +76,12 @@ In the ASCII character set, this include
 .It "\&164\ ``t'' \t165\ ``u'' \t166\ ``v'' \t167\ ``w'' \t170\ ``x''"
 .It "\&171\ ``y'' \t172\ ``z''"
 .El
+.Pp
+The 
+.Fn isalnum_l
+function takes an explicit locale argument, whereas the
+.Fn isalnum
+function uses the current global or per-thread locale.
 .Sh RETURN VALUES
 The
 .Fn isalnum
@@ -94,9 +102,14 @@ function should be used instead.
 .Xr isalpha 3 ,
 .Xr isdigit 3 ,
 .Xr iswalnum 3 ,
+.Xr xlocale 3 ,
 .Xr ascii 7
 .Sh STANDARDS
 The
 .Fn isalnum
 function conforms to
 .St -isoC .
+The
+.Fn isalnum_l
+function conforms to
+.St -p1003.1-2008 .

Modified: head/lib/libc/locale/isalpha.3
==============================================================================
--- head/lib/libc/locale/isalpha.3	Tue Mar 13 19:40:56 2012	(r232934)
+++ head/lib/libc/locale/isalpha.3	Tue Mar 13 20:02:41 2012	(r232935)
@@ -44,6 +44,8 @@
 .In ctype.h
 .Ft int
 .Fn isalpha "int c"
+.Ft int
+.Fn isalpha_l "int c" "locale_t loc"
 .Sh DESCRIPTION
 The
 .Fn isalpha
@@ -72,6 +74,11 @@ In the ASCII character set, this include
 .It "\&164\ ``t'' \t165\ ``u'' \t166\ ``v'' \t167\ ``w'' \t170\ ``x''"
 .It "\&171\ ``y'' \t172\ ``z''"
 .El
+The 
+.Fn isalpha_l
+function takes an explicit locale argument, whereas the
+.Fn isalpha
+function uses the current global or per-thread locale.
 .Sh RETURN VALUES
 The
 .Fn isalpha
@@ -92,9 +99,15 @@ function should be used instead.
 .Xr islower 3 ,
 .Xr isupper 3 ,
 .Xr iswalpha 3 ,
+.Xr xlocale 3 ,
 .Xr ascii 7
 .Sh STANDARDS
 The
 .Fn isalpha
 function conforms to
 .St -isoC .
+The
+.Fn isalpha_l
+function conforms to
+.St -p1003.1-2008 .
+

Modified: head/lib/libc/locale/isblank.3
==============================================================================
--- head/lib/libc/locale/isblank.3	Tue Mar 13 19:40:56 2012	(r232934)
+++ head/lib/libc/locale/isblank.3	Tue Mar 13 20:02:41 2012	(r232935)
@@ -40,6 +40,8 @@
 .In ctype.h
 .Ft int
 .Fn isblank "int c"
+.Ft int
+.Fn isblank "int c" "locale_t loc"
 .Sh DESCRIPTION
 The
 .Fn isblank
@@ -56,6 +58,12 @@ The value of the argument must be repres
 .Vt "unsigned char"
 or the value of
 .Dv EOF .
+.Pp
+The 
+.Fn isblank_l
+function takes an explicit locale argument, whereas the
+.Fn isblank
+function uses the current global or per-thread locale.
 .Sh RETURN VALUES
 The
 .Fn isblank
@@ -74,6 +82,7 @@ function should be used instead.
 .Sh SEE ALSO
 .Xr ctype 3 ,
 .Xr iswblank 3 ,
+.Xr xlocale 3 ,
 .Xr ascii 7
 .Sh STANDARDS
 The
@@ -81,3 +90,7 @@ The
 function
 conforms to
 .St -isoC-99 .
+The
+.Fn isblank_l
+function conforms to
+.St -p1003.1-2008 .

Modified: head/lib/libc/locale/iscntrl.3
==============================================================================
--- head/lib/libc/locale/iscntrl.3	Tue Mar 13 19:40:56 2012	(r232934)
+++ head/lib/libc/locale/iscntrl.3	Tue Mar 13 20:02:41 2012	(r232935)
@@ -44,6 +44,8 @@
 .In ctype.h
 .Ft int
 .Fn iscntrl "int c"
+.Ft int
+.Fn iscntrl_l "int c" "locale_t loc"
 .Sh DESCRIPTION
 The
 .Fn iscntrl
@@ -65,6 +67,12 @@ In the ASCII character set, this include
 .It "\&031\ EM \t032\ SUB \t033\ ESC \t034\ FS \t035\ GS"
 .It "\&036\ RS \t037\ US \t177\ DEL"
 .El
+.Pp
+The 
+.Fn iscntrl_l
+function takes an explicit locale argument, whereas the
+.Fn iscntrl
+function uses the current global or per-thread locale.
 .Sh RETURN VALUES
 The
 .Fn iscntrl
@@ -83,9 +91,14 @@ function should be used instead.
 .Sh SEE ALSO
 .Xr ctype 3 ,
 .Xr iswcntrl 3 ,
+.Xr xlocale 3 ,
 .Xr ascii 7
 .Sh STANDARDS
 The
 .Fn iscntrl
 function conforms to
 .St -isoC .
+The
+.Fn iscntrl_l
+function conforms to
+.St -p1003.1-2008 .

Modified: head/lib/libc/locale/isdigit.3
==============================================================================
--- head/lib/libc/locale/isdigit.3	Tue Mar 13 19:40:56 2012	(r232934)
+++ head/lib/libc/locale/isdigit.3	Tue Mar 13 20:02:41 2012	(r232935)
@@ -46,6 +46,10 @@
 .Fn isdigit "int c"
 .Ft int
 .Fn isnumber "int c"
+.Ft int
+.Fn isdigit_l "int c" "locale_t loc"
+.Ft int
+.Fn isnumber_l "int c" "locale_t loc"
 .Sh DESCRIPTION
 The
 .Fn isdigit
@@ -68,6 +72,9 @@ The value of the argument must be repres
 .Vt "unsigned char"
 or the value of
 .Dv EOF .
+.Pp
+The _l-suffixed versions take an explicit locale argument, whereas the
+non-suffixed versions use the current global or per-thread locale.
 .Sh RETURN VALUES
 The
 .Fn isdigit
@@ -89,12 +96,17 @@ function should be used instead.
 .Xr ctype 3 ,
 .Xr iswdigit 3 ,
 .Xr multibyte 3 ,
+.Xr xlocale 3 ,
 .Xr ascii 7
 .Sh STANDARDS
 The
 .Fn isdigit
 function conforms to
 .St -isoC .
+The
+.Fn isdigit_l
+function conforms to
+.St -p1003.1-2008 .
 .Sh HISTORY
 The
 .Fn isnumber



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201203132002.q2DK2g0K060213>