drm/linux: Fix linux/dma-mapping.h compilation...
[dragonfly.git] / usr.bin / localedef / localedef.1
1 .\" Copyright (c) 1992, X/Open Company Limited  All Rights Reserved
2 .\" Portions Copyright (c) 2003, Sun Microsystems, Inc.  All Rights Reserved
3 .\" Portions Copyright 2013 DEY Storage Systems, Inc.
4 .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for
5 .\" permission to reproduce portions of its copyrighted documentation.
6 .\" Original documentation from The Open Group can be obtained online at
7 .\" http://www.opengroup.org/bookstore/.
8 .\" The Institute of Electrical and Electronics Engineers and The Open Group,
9 .\" have given us permission to reprint portions of their documentation. In
10 .\" the following statement, the phrase "this text" refers to portions of the
11 .\" system documentation. Portions of this text are reprinted and reproduced
12 .\" in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1,
13 .\" 2004 Edition, Standard for Information Technology -- Portable Operating
14 .\" System Interface (POSIX), The Open Group Base Specifications Issue 6,
15 .\" Copyright (C) 2001-2004 by the Institute of Electrical and Electronics
16 .\" Engineers, Inc and The Open Group. In the event of any discrepancy between
17 .\" these versions and the original IEEE and The Open Group Standard, the
18 .\" original IEEE and The Open Group Standard is the referee document. The
19 .\" original Standard can be obtained online at
20 .\" http://www.opengroup.org/unix/online.html.
21 .\"  This notice shall appear on any product containing this material.
22 .\" The contents of this file are subject to the terms of the Common
23 .\" Development and Distribution License (the "License").  You may not use
24 .\" this file except in compliance with the License.
25 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or
26 .\" http://www.opensolaris.org/os/licensing.  See the License for the specific
27 .\" language governing permissions and limitations under the License.
28 .\" When distributing Covered Code, include this CDDL HEADER in each file and
29 .\" include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable,
30 .\" add the following below this CDDL HEADER, with the fields enclosed by
31 .\" brackets "[]" replaced with your own identifying information:
32 .\" Portions Copyright [yyyy] [name of copyright owner]
33 .Dd July 28, 2015
34 .Dt LOCALEDEF 1
35 .Os
36 .Sh NAME
37 .Nm localedef
38 .Nd define locale environment
39 .Sh SYNOPSIS
40 .Nm
41 .Op Fl cDUv
42 .Op Fl f Ar charmap
43 .Op Fl i Ar sourcefile
44 .Op Fl u Ar codeset
45 .Op Fl w Ar widthfile
46 .Ar localename
47 .Sh DESCRIPTION
48 The
49 .Nm
50 utility converts source definitions for locale categories
51 into a format usable by the functions and utilities whose operational behavior
52 is determined by the setting of the locale environment variables; see
53 .Xr environ 7 .
54 .Pp
55 The utility reads source definitions for one or more locale categories
56 belonging to the same locale from the file named in the
57 .Fl i
58 option (if specified) or from standard input.
59 .Pp
60 Each category source definition is identified by the corresponding environment
61 variable name and terminated by an
62 .Sy END
63 .Em category-name
64 statement.
65 The following categories are supported:
66 .Bl -tag -width ".Ev LC_MONETARY"
67 .It Ev LC_CTYPE
68 Defines character classification and case conversion.
69 .It Ev LC_COLLATE
70 Defines collation rules.
71 .It Ev LC_MONETARY
72 Defines the format and symbols used in formatting of monetary information.
73 .It Ev LC_NUMERIC
74 Defines the decimal delimiter, grouping and grouping symbol for non-monetary
75 numeric editing.
76 .It Ev LC_TIME
77 Defines the format and content of date and time information.
78 .It Ev LC_MESSAGES
79 Defines the format and values of affirmative and negative responses.
80 .El
81 .Pp
82 The following options are supported:
83 .Bl -tag -width indent
84 .It Fl c
85 Creates permanent output even if warning messages have been issued.
86 .It Fl D
87 BSD-style
88 output.
89 Rather than the default of creating the
90 .Ar localename
91 directory and creating files like
92 .Pa LC_CTYPE ,
93 .Pa LC_COLLATE ,
94 etc.\& in that directory,
95 the output file names have the format
96 .Dq <localename>.<category>
97 and are dumped to the current directory.
98 .It Fl f Ar charmap
99 Specifies the pathname of a file containing a mapping of character symbols and
100 collating element symbols to actual character encodings.
101 This option must be specified if symbolic names (other than collating symbols
102 defined in a
103 .Sy collating-symbol
104 keyword) are used.
105 If the
106 .Fl f
107 option is not present, the default character mapping will be used.
108 .It Fl i Ar sourcefile
109 The path name of a file containing the source definitions.
110 If this option is not present, source definitions will be read from
111 standard input.
112 .It Fl u Ar codeset
113 Specifies the name of a codeset used as the target mapping of character symbols
114 and collating element symbols whose encoding values are defined in terms of the
115 ISO/IEC 10646-1:2000 standard position constant values.
116 See
117 .Sx NOTES .
118 .It Fl U
119 Ignore the presence of character symbols that have no matching character
120 definition.  This facilitates the use of a common locale definition file
121 to be used across multiple encodings, even when some symbols are not
122 present in a given encoding.
123 .It Fl v
124 Emit verbose debugging output on standard output.
125 .It Fl w Ar widthfile
126 The path name of the file containing character screen width definitions.
127 If not supplied, then default screen widths will be assumed, which will
128 generally not account for East Asian encodings requiring more than a single
129 character cell to display, nor for combining or accent marks that occupy
130 no additional screen width.
131 .El
132 .Pp
133 The following operands are required:
134 .Bl -tag -width ".Ar localename"
135 .It Ar localename
136 Identifies the locale.
137 If the name contains one or more slash characters,
138 .Ar localename
139 will be interpreted as a path name where the created locale
140 definitions will be stored.
141 This capability may be restricted to users with appropriate privileges.
142 (As a consequence of specifying one
143 .Ar localename ,
144 although several categories can be processed in one execution, only categories
145 belonging to the same locale can be processed.)
146 .El
147 .Sh OUTPUT
148 .Nm
149 creates a directory of files that represents the locale's data,
150 unless instructed otherwise by the
151 .Fl D (
152 BSD
153 output) option.
154 The contants of this directory should generally be copied into the
155 appropriate subdirectory of
156 .Pa /usr/share/locale
157 in order the definitions to be visible to programs linked with libc.
158 .Sh ENVIRONMENT
159 See
160 .Xr environ 7
161 for definitions of the following environment variables that affect the
162 execution of
163 .Nm :
164 .Ev LANG ,
165 .Ev LC_ALL ,
166 .Ev LC_COLLATE ,
167 .Ev LC_CTYPE ,
168 .Ev LC_MESSAGES ,
169 .Ev LC_MONETARY ,
170 .Ev LC_MUMERIC ,
171 .Ev LC_TIME ,
172 and
173 .Ev NLSPATH .
174 .Sh EXIT STATUS
175 The following exit values are returned:
176 .Bl -tag -width XX
177 .It 0
178 No errors occurred and the locales were successfully created.
179 .It 1
180 Warnings occurred and the locales were successfully created.
181 .It 2
182 The locale specification exceeded implementation limits or the coded character
183 set or sets used were not supported by the implementation, and no locale was
184 created.
185 .It >3
186 Warnings or errors occurred and no output was created.
187 .El
188 .Pp
189 If an error is detected, no permanent output will be created.
190 .Sh SEE ALSO
191 .Xr locale 1 ,
192 .Xr iconv_open 3 ,
193 .Xr nl_langinfo 3 ,
194 .Xr strftime 3 ,
195 .Xr environ 7
196 .Sh WARNINGS
197 If warnings occur, permanent output will be created if the
198 .Fl c
199 option was specified.
200 The following conditions will cause warning messages to be issued:
201 .Bl -bullet
202 .It
203 If a symbolic name not found in the
204 .Pa charmap
205 file is used for the descriptions of the
206 .Sy LC_CTYPE
207 or
208 .Sy LC_COLLATE
209 categories (for other categories, this will be an error condition).
210 .It
211 If optional keywords not supported by the implementation are present in the
212 source.
213 .El
214 .Sh NOTES
215 When the
216 .Fl u
217 option is used, the
218 .Ar codeset
219 option-argument is interpreted as a name of a codeset to which the
220 ISO/IEC 10646-1:2000 standard position constant values are converted.
221 Both the ISO/IEC 10646-1:2000 standard position constant values and
222 other formats (decimal, hexadecimal, or octal) are valid as encoding
223 values within the charmap file.
224 The
225 .Ar codeset
226 can be any codeset that is supported by the
227 .Fn iconv_open 3
228 function.
229 .Pp
230 When conflicts occur between the charmap specification of
231 .Ar codeset ,
232 .Em mb_cur_max ,
233 or
234 .Em mb_cur_min
235 and the corresponding value for the codeset represented by the
236 .Fl u
237 option-argument
238 .Ar codeset ,
239 the
240 .Nm
241 utility fails with an error.
242 .Pp
243 When conflicts occur between the charmap encoding values specified for symbolic
244 names of characters of the portable character set and the character encoding
245 values defined by the US-ASCII, the result is unspecified.
246 .Sh HISTORY
247 .Nm
248 first appeared in
249 .Dx 4.3 .
250 It was ported from Illumos from the point
251 .An Garrett D'Amore
252 .Aq Mt garrett@nexenta.com
253 added multibyte support (October 2010).
254 .An John Marino
255 .Aq Mt draco@marino.st
256 provided the alternations necessary to compile cleanly on
257 .Dx .
258 .An Baptiste Daroussin
259 .Aq Mt bapt@FreeBSD.org
260 converted it to
261 .Xr tree 3 .