Debian Codegraph @

templates/man3/newlocale.3.pot

raw
1 # SOME DESCRIPTIVE TITLE
2 # Copyright (C) YEAR Free Software Foundation, Inc.
3 # This file is distributed under the same license as the PACKAGE package.
4 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
5 #
6 #, fuzzy
7 msgid ""
8 msgstr ""
9 "Project-Id-Version: PACKAGE VERSION\n"
10 "POT-Creation-Date: 2026-06-05 06:32+0200\n"
11 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
12 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13 "Language-Team: LANGUAGE <[email protected]>\n"
14 "Language: \n"
15 "MIME-Version: 1.0\n"
16 "Content-Type: text/plain; charset=UTF-8\n"
17 "Content-Transfer-Encoding: 8bit\n"
18
19 #. type: TH
20 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
21 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
22 #, no-wrap
23 msgid "newlocale"
24 msgstr ""
25
26 #. type: TH
27 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
28 #: opensuse-tumbleweed
29 #, no-wrap
30 msgid "2026-02-08"
31 msgstr ""
32
33 #. type: TH
34 #: archlinux debian-unstable
35 #, no-wrap
36 msgid "Linux man-pages 6.18"
37 msgstr ""
38
39 #. type: SH
40 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
41 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
42 #, no-wrap
43 msgid "NAME"
44 msgstr ""
45
46 #. type: Plain text
47 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
48 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
49 msgid "newlocale, freelocale - create, modify, and free a locale object"
50 msgstr ""
51
52 #. type: SH
53 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
54 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
55 #, no-wrap
56 msgid "LIBRARY"
57 msgstr ""
58
59 #. type: Plain text
60 #: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron
61 #: opensuse-leap-16-1 opensuse-tumbleweed
62 msgid "Standard C library (I<libc>,\\ I<-lc>)"
63 msgstr ""
64
65 #. type: SH
66 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
67 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
68 #, no-wrap
69 msgid "SYNOPSIS"
70 msgstr ""
71
72 #. type: Plain text
73 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
74 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
75 #, no-wrap
76 msgid "B<#include E<lt>locale.hE<gt>>\n"
77 msgstr ""
78
79 #. type: Plain text
80 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
81 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
82 #, no-wrap
83 msgid ""
84 "B<locale_t newlocale(int >I<category_mask>B<, const char *>I<locale>B<,>\n"
85 "B< locale_t >I<base>B<);>\n"
86 "B<void freelocale(locale_t >I<locobj>B<);>\n"
87 msgstr ""
88
89 #. type: Plain text
90 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
91 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
92 msgid ""
93 "Feature Test Macro Requirements for glibc (see B<feature_test_macros>(7)):"
94 msgstr ""
95
96 #. type: Plain text
97 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
98 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
99 msgid "B<newlocale>(), B<freelocale>():"
100 msgstr ""
101
102 #. type: Plain text
103 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
104 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
105 #, no-wrap
106 msgid ""
107 " Since glibc 2.10:\n"
108 " _XOPEN_SOURCE E<gt>= 700\n"
109 " Before glibc 2.10:\n"
110 " _GNU_SOURCE\n"
111 msgstr ""
112
113 #. type: SH
114 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
115 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
116 #, no-wrap
117 msgid "DESCRIPTION"
118 msgstr ""
119
120 #. type: Plain text
121 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
122 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
123 msgid ""
124 "The B<newlocale>() function creates a new locale object, or modifies an "
125 "existing object, returning a reference to the new or modified object as the "
126 "function result. Whether the call creates a new object or modifies an "
127 "existing object is determined by the value of I<base>:"
128 msgstr ""
129
130 #. type: IP
131 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
132 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
133 #, no-wrap
134 msgid "\\[bu]"
135 msgstr ""
136
137 #. type: Plain text
138 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
139 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
140 msgid "If I<base> is I<(locale_t)\\ 0>, a new object is created."
141 msgstr ""
142
143 #. type: Plain text
144 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
145 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
146 msgid ""
147 "If I<base> refers to valid existing locale object (i.e., an object returned "
148 "by a previous call to B<newlocale>() or B<duplocale>(3)), then that object "
149 "is modified by the call. If the call is successful, the contents of I<base> "
150 "are unspecified (in particular, the object referred to by I<base> may be "
151 "freed, and a new object created). Therefore, the caller should ensure that "
152 "it stops using I<base> before the call to B<newlocale>(), and should "
153 "subsequently refer to the modified object via the reference returned as the "
154 "function result. If the call fails, the contents of I<base> remain valid "
155 "and unchanged."
156 msgstr ""
157
158 #. type: Plain text
159 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
160 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
161 msgid ""
162 "If I<base> is the special locale object B<LC_GLOBAL_LOCALE> (see "
163 "B<duplocale>(3)), or is not I<(locale_t)\\ 0> and is not a valid locale "
164 "object handle, the behavior is undefined."
165 msgstr ""
166
167 #. type: Plain text
168 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
169 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
170 msgid ""
171 "The I<category_mask> argument is a bit mask that specifies the locale "
172 "categories that are to be set in a newly created locale object or modified "
173 "in an existing object. The mask is constructed by a bitwise OR of the "
174 "constants B<LC_ADDRESS_MASK>, B<LC_CTYPE_MASK>, B<LC_COLLATE_MASK>, "
175 "B<LC_IDENTIFICATION_MASK>, B<LC_MEASUREMENT_MASK>, B<LC_MESSAGES_MASK>, "
176 "B<LC_MONETARY_MASK>, B<LC_NUMERIC_MASK>, B<LC_NAME_MASK>, B<LC_PAPER_MASK>, "
177 "B<LC_TELEPHONE_MASK>, and B<LC_TIME_MASK>. Alternatively, the mask can be "
178 "specified as B<LC_ALL_MASK>, which is equivalent to ORing all of the "
179 "preceding constants."
180 msgstr ""
181
182 #. type: Plain text
183 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
184 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
185 msgid ""
186 "For each category specified in I<category_mask>, the locale data from "
187 "I<locale> will be used in the object returned by B<newlocale>(). If a new "
188 "locale object is being created, data for all categories not specified in "
189 "I<category_mask> is taken from the default (\"POSIX\") locale."
190 msgstr ""
191
192 #. type: Plain text
193 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
194 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
195 msgid ""
196 "The following preset values of I<locale> are defined for all categories that "
197 "can be specified in I<category_mask>:"
198 msgstr ""
199
200 #. type: TP
201 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
202 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
203 #, no-wrap
204 msgid "POSIX"
205 msgstr ""
206
207 #. type: Plain text
208 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
209 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
210 msgid "A minimal locale environment for C language programs."
211 msgstr ""
212
213 #. type: TP
214 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
215 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
216 #, no-wrap
217 msgid "C"
218 msgstr ""
219
220 #. type: Plain text
221 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
222 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
223 msgid "Equivalent to \"POSIX\"."
224 msgstr ""
225
226 #. type: Plain text
227 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
228 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
229 msgid ""
230 "An implementation-defined native environment corresponding to the values of "
231 "the B<LC_*> and B<LANG> environment variables (see B<locale>(7))."
232 msgstr ""
233
234 #. type: SS
235 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
236 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
237 #, no-wrap
238 msgid "freelocale()"
239 msgstr ""
240
241 #. type: Plain text
242 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
243 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
244 msgid ""
245 "The B<freelocale>() function deallocates the resources associated with "
246 "I<locobj>, a locale object previously returned by a call to B<newlocale>() "
247 "or B<duplocale>(3). If I<locobj> is B<LC_GLOBAL_LOCALE> or is not valid "
248 "locale object handle, the results are undefined."
249 msgstr ""
250
251 #. type: Plain text
252 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
253 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
254 msgid ""
255 "Once a locale object has been freed, the program should make no further use "
256 "of it."
257 msgstr ""
258
259 #. type: SH
260 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
261 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
262 #, no-wrap
263 msgid "RETURN VALUE"
264 msgstr ""
265
266 #. type: Plain text
267 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
268 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
269 msgid ""
270 "On success, B<newlocale>() returns a handle that can be used in calls to "
271 "B<duplocale>(3), B<freelocale>(), and other functions that take a "
272 "I<locale_t> argument. On error, B<newlocale>() returns I<(locale_t)\\ 0>, "
273 "and sets I<errno> to indicate the error."
274 msgstr ""
275
276 #. type: SH
277 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
278 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
279 #, no-wrap
280 msgid "ERRORS"
281 msgstr ""
282
283 #. type: TP
284 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
285 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
286 #, no-wrap
287 msgid "B<EINVAL>"
288 msgstr ""
289
290 #. type: Plain text
291 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
292 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
293 msgid ""
294 "One or more bits in I<category_mask> do not correspond to a valid locale "
295 "category."
296 msgstr ""
297
298 #. type: Plain text
299 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
300 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
301 msgid "I<locale> is NULL."
302 msgstr ""
303
304 #. type: TP
305 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
306 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
307 #, no-wrap
308 msgid "B<ENOENT>"
309 msgstr ""
310
311 #. type: Plain text
312 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
313 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
314 msgid "I<locale> is not a string pointer referring to a valid locale."
315 msgstr ""
316
317 #. type: TP
318 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
319 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
320 #, no-wrap
321 msgid "B<ENOMEM>"
322 msgstr ""
323
324 #. type: Plain text
325 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
326 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
327 msgid "Insufficient memory to create a locale object."
328 msgstr ""
329
330 #. type: SH
331 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
332 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
333 #, no-wrap
334 msgid "STANDARDS"
335 msgstr ""
336
337 #. type: Plain text
338 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
339 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
340 msgid "POSIX.1-2008."
341 msgstr ""
342
343 #. type: SH
344 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
345 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
346 #, no-wrap
347 msgid "HISTORY"
348 msgstr ""
349
350 #. type: Plain text
351 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
352 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
353 msgid "glibc 2.3."
354 msgstr ""
355
356 #. type: SH
357 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
358 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
359 #, no-wrap
360 msgid "NOTES"
361 msgstr ""
362
363 #. type: Plain text
364 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
365 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
366 msgid ""
367 "Each locale object created by B<newlocale>() should be deallocated using "
368 "B<freelocale>()."
369 msgstr ""
370
371 #. type: SH
372 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
373 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
374 #, no-wrap
375 msgid "EXAMPLES"
376 msgstr ""
377
378 #. type: Plain text
379 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
380 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
381 msgid ""
382 "The program below takes up to two command-line arguments, which each "
383 "identify locales. The first argument is required, and is used to set the "
384 "B<LC_NUMERIC> category in a locale object created using B<newlocale>(). The "
385 "second command-line argument is optional; if it is present, it is used to "
386 "set the B<LC_TIME> category of the locale object."
387 msgstr ""
388
389 #. type: Plain text
390 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
391 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
392 msgid ""
393 "Having created and initialized the locale object, the program then applies "
394 "it using B<uselocale>(3), and then tests the effect of the locale changes by:"
395 msgstr ""
396
397 #. type: IP
398 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
399 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
400 #, no-wrap
401 msgid "(1)"
402 msgstr ""
403
404 #. type: Plain text
405 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
406 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
407 msgid ""
408 "Displaying a floating-point number with a fractional part. This output will "
409 "be affected by the B<LC_NUMERIC> setting. In many European-language "
410 "locales, the fractional part of the number is separated from the integer "
411 "part using a comma, rather than a period."
412 msgstr ""
413
414 #. type: IP
415 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
416 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
417 #, no-wrap
418 msgid "(2)"
419 msgstr ""
420
421 #. type: Plain text
422 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
423 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
424 msgid ""
425 "Displaying the date. The format and language of the output will be affected "
426 "by the B<LC_TIME> setting."
427 msgstr ""
428
429 #. type: Plain text
430 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
431 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
432 msgid "The following shell sessions show some example runs of this program."
433 msgstr ""
434
435 #. type: Plain text
436 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
437 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
438 msgid "Set the B<LC_NUMERIC> category to I<fr_FR> (French):"
439 msgstr ""
440
441 #. type: Plain text
442 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
443 #: opensuse-tumbleweed
444 #, no-wrap
445 msgid ""
446 "$B< ./a.out fr_FR>;\n"
447 "123456,789\n"
448 "Fri Mar 7 00:25:08 2014\n"
449 msgstr ""
450
451 #. type: Plain text
452 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
453 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
454 msgid ""
455 "Set the B<LC_NUMERIC> category to I<fr_FR> (French), and the B<LC_TIME> "
456 "category to I<it_IT> (Italian):"
457 msgstr ""
458
459 #. type: Plain text
460 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
461 #: opensuse-tumbleweed
462 #, no-wrap
463 msgid ""
464 "$B< ./a.out fr_FR it_IT>;\n"
465 "123456,789\n"
466 "ven 07 mar 2014 00:26:01 CET\n"
467 msgstr ""
468
469 #. type: Plain text
470 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
471 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
472 msgid ""
473 "Specify the B<LC_TIME> setting as an empty string, which causes the value to "
474 "be taken from environment variable settings (which, here, specify I<mi_NZ>, "
475 "New Zealand Māori):"
476 msgstr ""
477
478 #. type: Plain text
479 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
480 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
481 #, no-wrap
482 msgid ""
483 "$ LC_ALL=mi_NZ ./a.out fr_FR \"\"\n"
484 "123456,789\n"
485 "Te Paraire, te 07 o Poutū-te-rangi, 2014 00:38:44 CET\n"
486 msgstr ""
487
488 #. type: SS
489 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
490 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
491 #, no-wrap
492 msgid "Program source"
493 msgstr ""
494
495 #. type: Plain text
496 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
497 #: opensuse-tumbleweed
498 #, no-wrap
499 msgid ""
500 "#define _XOPEN_SOURCE 700\n"
501 "#include E<lt>err.hE<gt>\n"
502 "#include E<lt>locale.hE<gt>\n"
503 "#include E<lt>stdio.hE<gt>\n"
504 "#include E<lt>stdlib.hE<gt>\n"
505 "#include E<lt>time.hE<gt>\n"
506 "\\&\n"
507 "int\n"
508 "main(int argc, char *argv[])\n"
509 "{\n"
510 " char buf[100];\n"
511 " time_t t;\n"
512 " size_t s;\n"
513 " struct tm *tm;\n"
514 " locale_t loc, nloc;\n"
515 "\\&\n"
516 " if (argc E<lt> 2) {\n"
517 " fprintf(stderr, \"Usage: %s locale1 [locale2]\\[rs]n\", argv[0]);\n"
518 " exit(EXIT_FAILURE);\n"
519 " }\n"
520 "\\&\n"
521 " /* Create a new locale object, taking the LC_NUMERIC settings\n"
522 " from the locale specified in argv[1]. */\n"
523 "\\&\n"
524 " loc = newlocale(LC_NUMERIC_MASK, argv[1], (locale_t) 0);\n"
525 " if (loc == (locale_t) 0)\n"
526 " err(EXIT_FAILURE, \"newlocale\");\n"
527 "\\&\n"
528 " /* If a second command-line argument was specified, modify the\n"
529 " locale object to take the LC_TIME settings from the locale\n"
530 " specified in argv[2]. We assign the result of this newlocale()\n"
531 " call to \\[aq]nloc\\[aq] rather than \\[aq]loc\\[aq], since in some cases, we might\n"
532 " want to preserve \\[aq]loc\\[aq] if this call fails. */\n"
533 "\\&\n"
534 " if (argc E<gt> 2) {\n"
535 " nloc = newlocale(LC_TIME_MASK, argv[2], loc);\n"
536 " if (nloc == (locale_t) 0)\n"
537 " err(EXIT_FAILURE, \"newlocale\");\n"
538 " loc = nloc;\n"
539 " }\n"
540 "\\&\n"
541 " /* Apply the newly created locale to this thread. */\n"
542 "\\&\n"
543 " uselocale(loc);\n"
544 "\\&\n"
545 " /* Test effect of LC_NUMERIC. */\n"
546 "\\&\n"
547 " printf(\"%8.3f\\[rs]n\", 123456.789);\n"
548 "\\&\n"
549 " /* Test effect of LC_TIME. */\n"
550 "\\&\n"
551 " t = time(NULL);\n"
552 " tm = localtime(&t);\n"
553 " if (tm == NULL)\n"
554 " err(EXIT_FAILURE, \"time\");\n"
555 "\\&\n"
556 " s = strftime(buf, sizeof(buf), \"%c\", tm);\n"
557 " if (s == 0)\n"
558 " err(EXIT_FAILURE, \"strftime\");\n"
559 "\\&\n"
560 " printf(\"%s\\[rs]n\", buf);\n"
561 "\\&\n"
562 " /* Free the locale object. */\n"
563 "\\&\n"
564 " uselocale(LC_GLOBAL_LOCALE); /* So \\[aq]loc\\[aq] is no longer in use */\n"
565 " freelocale(loc);\n"
566 "\\&\n"
567 " exit(EXIT_SUCCESS);\n"
568 "}\n"
569 msgstr ""
570
571 #. SRC END
572 #. type: SH
573 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
574 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
575 #, no-wrap
576 msgid "SEE ALSO"
577 msgstr ""
578
579 #. type: Plain text
580 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
581 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
582 msgid ""
583 "B<locale>(1), B<duplocale>(3), B<setlocale>(3), B<uselocale>(3), "
584 "B<locale>(5), B<locale>(7)"
585 msgstr ""
586
587 #. type: TH
588 #: debian-trixie
589 #, no-wrap
590 msgid "2024-06-15"
591 msgstr ""
592
593 #. type: TH
594 #: debian-trixie
595 #, no-wrap
596 msgid "Linux man-pages 6.9.1"
597 msgstr ""
598
599 #. type: Plain text
600 #: debian-trixie
601 msgid "Standard C library (I<libc>, I<-lc>)"
602 msgstr ""
603
604 #. type: Plain text
605 #: debian-trixie fedora-44 fedora-rawhide
606 #, no-wrap
607 msgid ""
608 "$ B<./a.out fr_FR>\n"
609 "123456,789\n"
610 "Fri Mar 7 00:25:08 2014\n"
611 msgstr ""
612
613 #. type: Plain text
614 #: debian-trixie fedora-44 fedora-rawhide
615 #, no-wrap
616 msgid ""
617 "$ B<./a.out fr_FR it_IT>\n"
618 "123456,789\n"
619 "ven 07 mar 2014 00:26:01 CET\n"
620 msgstr ""
621
622 #. type: Plain text
623 #: debian-trixie fedora-44 fedora-rawhide
624 #, no-wrap
625 msgid ""
626 "#define _XOPEN_SOURCE 700\n"
627 "#include E<lt>locale.hE<gt>\n"
628 "#include E<lt>stdio.hE<gt>\n"
629 "#include E<lt>stdlib.hE<gt>\n"
630 "#include E<lt>time.hE<gt>\n"
631 "\\&\n"
632 "#define errExit(msg) do { perror(msg); exit(EXIT_FAILURE); \\[rs]\n"
633 " } while (0)\n"
634 "\\&\n"
635 "int\n"
636 "main(int argc, char *argv[])\n"
637 "{\n"
638 " char buf[100];\n"
639 " time_t t;\n"
640 " size_t s;\n"
641 " struct tm *tm;\n"
642 " locale_t loc, nloc;\n"
643 "\\&\n"
644 " if (argc E<lt> 2) {\n"
645 " fprintf(stderr, \"Usage: %s locale1 [locale2]\\[rs]n\", argv[0]);\n"
646 " exit(EXIT_FAILURE);\n"
647 " }\n"
648 "\\&\n"
649 " /* Create a new locale object, taking the LC_NUMERIC settings\n"
650 " from the locale specified in argv[1]. */\n"
651 "\\&\n"
652 " loc = newlocale(LC_NUMERIC_MASK, argv[1], (locale_t) 0);\n"
653 " if (loc == (locale_t) 0)\n"
654 " errExit(\"newlocale\");\n"
655 "\\&\n"
656 " /* If a second command-line argument was specified, modify the\n"
657 " locale object to take the LC_TIME settings from the locale\n"
658 " specified in argv[2]. We assign the result of this newlocale()\n"
659 " call to \\[aq]nloc\\[aq] rather than \\[aq]loc\\[aq], since in some cases, we might\n"
660 " want to preserve \\[aq]loc\\[aq] if this call fails. */\n"
661 "\\&\n"
662 " if (argc E<gt> 2) {\n"
663 " nloc = newlocale(LC_TIME_MASK, argv[2], loc);\n"
664 " if (nloc == (locale_t) 0)\n"
665 " errExit(\"newlocale\");\n"
666 " loc = nloc;\n"
667 " }\n"
668 "\\&\n"
669 " /* Apply the newly created locale to this thread. */\n"
670 "\\&\n"
671 " uselocale(loc);\n"
672 "\\&\n"
673 " /* Test effect of LC_NUMERIC. */\n"
674 "\\&\n"
675 " printf(\"%8.3f\\[rs]n\", 123456.789);\n"
676 "\\&\n"
677 " /* Test effect of LC_TIME. */\n"
678 "\\&\n"
679 " t = time(NULL);\n"
680 " tm = localtime(&t);\n"
681 " if (tm == NULL)\n"
682 " errExit(\"time\");\n"
683 "\\&\n"
684 " s = strftime(buf, sizeof(buf), \"%c\", tm);\n"
685 " if (s == 0)\n"
686 " errExit(\"strftime\");\n"
687 "\\&\n"
688 " printf(\"%s\\[rs]n\", buf);\n"
689 "\\&\n"
690 " /* Free the locale object. */\n"
691 "\\&\n"
692 " uselocale(LC_GLOBAL_LOCALE); /* So \\[aq]loc\\[aq] is no longer in use */\n"
693 " freelocale(loc);\n"
694 "\\&\n"
695 " exit(EXIT_SUCCESS);\n"
696 "}\n"
697 msgstr ""
698
699 #. type: TH
700 #: fedora-44 fedora-rawhide
701 #, no-wrap
702 msgid "2024-07-23"
703 msgstr ""
704
705 #. type: TH
706 #: fedora-44 fedora-rawhide
707 #, no-wrap
708 msgid "Linux man-pages 6.13"
709 msgstr ""
710
711 #. type: TH
712 #: mageia-cauldron
713 #, no-wrap
714 msgid "Linux man-pages 6.17"
715 msgstr ""
716
717 #. type: TH
718 #: opensuse-leap-16-1 opensuse-tumbleweed
719 #, no-wrap
720 msgid "Linux man-pages (unreleased)"
721 msgstr ""