xref: /freebsd/lib/libc/locale/querylocale.3 (revision fa9896e082a1046ff4fbc75fcba4d18d1f2efc19)
13c87aa1dSDavid Chisnall.\" Copyright (c) 2011 The FreeBSD Foundation
23c87aa1dSDavid Chisnall.\"
33c87aa1dSDavid Chisnall.\" This documentation was written by David Chisnall under sponsorship from
43c87aa1dSDavid Chisnall.\" the FreeBSD Foundation.
53c87aa1dSDavid Chisnall.\"
63c87aa1dSDavid Chisnall.\" Redistribution and use in source and binary forms, with or without
73c87aa1dSDavid Chisnall.\" modification, are permitted provided that the following conditions
83c87aa1dSDavid Chisnall.\" are met:
93c87aa1dSDavid Chisnall.\" 1. Redistributions of source code must retain the above copyright
103c87aa1dSDavid Chisnall.\"    notice, this list of conditions and the following disclaimer.
113c87aa1dSDavid Chisnall.\" 2. Redistributions in binary form must reproduce the above copyright
123c87aa1dSDavid Chisnall.\"    notice, this list of conditions and the following disclaimer in the
133c87aa1dSDavid Chisnall.\"    documentation and/or other materials provided with the distribution.
143c87aa1dSDavid Chisnall.\"
153c87aa1dSDavid Chisnall.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
163c87aa1dSDavid Chisnall.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
173c87aa1dSDavid Chisnall.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
183c87aa1dSDavid Chisnall.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
193c87aa1dSDavid Chisnall.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
203c87aa1dSDavid Chisnall.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
213c87aa1dSDavid Chisnall.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
223c87aa1dSDavid Chisnall.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
233c87aa1dSDavid Chisnall.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
243c87aa1dSDavid Chisnall.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
253c87aa1dSDavid Chisnall.\" SUCH DAMAGE.
263c87aa1dSDavid Chisnall.\"
27*cc7edd25SThomas Munro.Dd November 8, 2020
283c87aa1dSDavid Chisnall.Dt QUERYLOCALE 3
293c87aa1dSDavid Chisnall.Os
303c87aa1dSDavid Chisnall.Sh NAME
313c87aa1dSDavid Chisnall.Nm querylocale
32*cc7edd25SThomas Munro.Nd Look up the locale name or version for a specified category
333c87aa1dSDavid Chisnall.Sh LIBRARY
343c87aa1dSDavid Chisnall.Lb libc
353c87aa1dSDavid Chisnall.Sh SYNOPSIS
3658912ae7SDavid Chisnall.In locale.h
373c87aa1dSDavid Chisnall.Ft const char *
383c87aa1dSDavid Chisnall.Fn querylocale "int mask" "locale_t locale"
393c87aa1dSDavid Chisnall.Sh DESCRIPTION
40*cc7edd25SThomas MunroReturns the name or version of the locale for the category specified by
413c87aa1dSDavid Chisnall.Fa mask .
42*cc7edd25SThomas MunroThe possible values for the mask are the same as those in
43*cc7edd25SThomas Munro.Xr newlocale 3 ,
44*cc7edd25SThomas Munrowhen requesting the locale name.
45*cc7edd25SThomas MunroSpecify the bitwise OR of
46*cc7edd25SThomas Munro.Fa LC_VERSION_MASK
47*cc7edd25SThomas Munroand another mask value to request a version string.
48*cc7edd25SThomas MunroVersion strings can be compared to detect changes to the locale's definition.
49*cc7edd25SThomas MunroThe structure of the version string is unspecified.
50*cc7edd25SThomas MunroCurrently, version information is only available for
51*cc7edd25SThomas Munro.Fa LC_COLLATE_MASK ,
52*cc7edd25SThomas Munroand an empty string is returned for other categories.
53*cc7edd25SThomas MunroIf more than one bit in the mask is set, not counting
54*cc7edd25SThomas Munro.Fa LC_VERSION_MASK ,
55*cc7edd25SThomas Munrothe returned value is undefined.
563c87aa1dSDavid Chisnall.Sh SEE ALSO
573c87aa1dSDavid Chisnall.Xr duplocale 3 ,
583c87aa1dSDavid Chisnall.Xr freelocale 3 ,
593c87aa1dSDavid Chisnall.Xr localeconv 3 ,
603c87aa1dSDavid Chisnall.Xr newlocale 3 ,
613c87aa1dSDavid Chisnall.Xr uselocale 3 ,
623c87aa1dSDavid Chisnall.Xr xlocale 3
63*cc7edd25SThomas Munro.Sh HISTORY
64*cc7edd25SThomas MunroThe
65*cc7edd25SThomas Munro.Fn querylocale
66*cc7edd25SThomas Munrofunction first appeared in
67*cc7edd25SThomas Munro.Fx 9.1 ,
68*cc7edd25SThomas Munroand is based on the function of the same name in Darwin.
69*cc7edd25SThomas Munro.Fa LC_VERSION_MASK
70*cc7edd25SThomas Munrofirst appeared in
71*cc7edd25SThomas Munro.Fx 13.0 .
72