]> 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 1048ce915d500e56a6c8efed82a4a3b56ed43756..8c263b9c36c8317a0d3cdb0a9bc691a25ebc132a 100644 (file)
@@ -29,7 +29,7 @@
 .\" SUCH DAMAGE.
 .\"
 .\"    @(#)setlocale.3 8.1 (Berkeley) 6/9/93
-.\" $FreeBSD: src/lib/libc/locale/setlocale.3,v 1.35 2007/01/09 00:28:00 imp 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
@@ -57,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.
@@ -101,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 ;
@@ -147,6 +153,11 @@ 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.