]> git.saurik.com Git - apple/libc.git/blobdiff - locale/FreeBSD/setlocale.3
Libc-1439.100.3.tar.gz
[apple/libc.git] / locale / FreeBSD / setlocale.3
index b09dbb5548bb229d9a283a77452dbad29341dcf0..8c263b9c36c8317a0d3cdb0a9bc691a25ebc132a 100644 (file)
 .\" 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.
@@ -33,7 +29,7 @@
 .\" SUCH DAMAGE.
 .\"
 .\"    @(#)setlocale.3 8.1 (Berkeley) 6/9/93
-.\" $FreeBSD: src/lib/libc/locale/setlocale.3,v 1.33 2004/10/17 06:51:50 tjr Exp $
+.\" $FreeBSD$
 .\"
 .Dd November 21, 2003
 .Dt SETLOCALE 3
 .Sh SYNOPSIS
 .In locale.h
 .Ft char *
-.Fn setlocale "int category" "const char *locale"
+.Fo setlocale
+.Fa "int category"
+.Fa "const char *locale"
+.Fc
 .Sh DESCRIPTION
 The
 .Fn setlocale
@@ -61,7 +60,6 @@ The
 .Fn setlocale
 function recognizes several categories of routines.
 These are the categories and the sets of routines they select:
-.Pp
 .Bl -tag -width LC_MONETARY
 .It Dv LC_ALL
 Set the entire locale generically.
@@ -105,23 +103,27 @@ Set a locale for formatting dates and times using the
 function.
 .El
 .Pp
-Only three locales are defined by default,
+Only three locales are defined by default:
 the empty string
-.Li "\&""\|""
-which denotes the native environment, and the
-.Li "\&""C""
+.Li \&"\|"
+(which denotes the native environment) and the
+.Li \&"C"
 and
-.Li "\&""POSIX""
-locales, which denote the C language environment.
+.Li \&"POSIX"
+locales (which denote the C language environment).
 A
 .Fa locale
 argument of
 .Dv NULL
 causes
 .Fn setlocale
-to return the current locale.
+to return the current locale.  An argument of
+.Li \&"\|"
+will determine the name of the new locale taking into account the environment
+variables LANG and LC_*.  If these environment variables yield a locale that is
+invalid, NULL will be returned and the current locale will remain unchanged.
 By default, C programs start in the
-.Li "\&""C""
+.Li \&"C"
 locale.
 The only function in the library that sets the locale is
 .Fn setlocale ;
@@ -143,8 +145,6 @@ if the given combination of
 and
 .Fa locale
 makes no sense.
-.Sh ERRORS
-No errors are defined.
 .Sh FILES
 .Bl -tag -width /usr/share/locale/locale/category -compact
 .It Pa $PATH_LOCALE/ Ns Em locale/category
@@ -153,7 +153,14 @@ locale file for the locale
 .Em locale
 and the category
 .Em category .
+.It Pa /usr/local/share/locale/ Ns Em locale/category
+locale file for the locale
+.Em locale
+and the category
+.Em category .
 .El
+.Sh ERRORS
+No errors are defined.
 .Sh SEE ALSO
 .Xr colldef 1 ,
 .Xr mklocale 1 ,