Changeset View
Changeset View
Standalone View
Standalone View
lib/libc/locale/querylocale.3
Context not available. | |||||
.\" | .\" | ||||
.\" $FreeBSD$ | .\" $FreeBSD$ | ||||
.\" | .\" | ||||
.Dd May 3, 2013 | .Dd November 2, 2019 | ||||
.Dt QUERYLOCALE 3 | .Dt QUERYLOCALE 3 | ||||
.Os | .Os | ||||
.Sh NAME | .Sh NAME | ||||
.Nm querylocale | .Nm querylocale | ||||
.Nd Look up the locale name for a specified category | .Nd Look up the locale name or version for a specified category | ||||
.Sh LIBRARY | .Sh LIBRARY | ||||
.Lb libc | .Lb libc | ||||
.Sh SYNOPSIS | .Sh SYNOPSIS | ||||
Context not available. | |||||
.Ft const char * | .Ft const char * | ||||
.Fn querylocale "int mask" "locale_t locale" | .Fn querylocale "int mask" "locale_t locale" | ||||
.Sh DESCRIPTION | .Sh DESCRIPTION | ||||
Returns the name of the locale for the category specified by | Returns the name or version of the locale for the category specified by | ||||
.Fa mask . | .Fa mask . | ||||
This possible values for the mask are the same as those in | This possible values for the mask are the same as those in | ||||
.Xr newlocale 3 . | .Xr newlocale 3 , | ||||
If more than one bit in the mask is set, the returned value is undefined. | when requesting the locale name. | ||||
Specify the bitwise OR of | |||||
.Fa LC_VERSION_MASK | |||||
and another mask value to request a version string. | |||||
Version strings can be compared to detect changes to the locale's | |||||
definition or implementation. The structure of the version string is | |||||
kib: Do you intent to only allow to detect change, or also to define a 'newer than' relation ? | |||||
Not Done Inline ActionsI don't think 'newer than' would be very useful on its own, and it would require a complicated specification of the version string which wouldn't work well with my goal of convincing other operating systems to adopt this via a the standards process. Consider that not everyone uses CLDR, and sometimes OSes change to a different source of collation data (as we did). (A much more ambitious project would be to support multiple versions installed at the same time, and then you might want to be able to order them, but I don't have the resources to propose that; I merely want to fix the problem of silent changes that result in corrupted persistent data, because that is very arguably a "defect" in the standard). munro_ip9.org: I don't think 'newer than' would be very useful on its own, and it would require a complicated… | |||||
unspecified. | |||||
Currently, version information is only available for | |||||
.Fa LC_COLLATE_MASK , | |||||
and an empty string is returned for other categories. | |||||
If more than one bit in the mask is set, not counting | |||||
.Fa LC_VERSION_MASK , | |||||
the returned value is undefined. | |||||
.Sh SEE ALSO | .Sh SEE ALSO | ||||
.Xr duplocale 3 , | .Xr duplocale 3 , | ||||
.Xr freelocale 3 , | .Xr freelocale 3 , | ||||
Context not available. | |||||
.Xr newlocale 3 , | .Xr newlocale 3 , | ||||
.Xr uselocale 3 , | .Xr uselocale 3 , | ||||
.Xr xlocale 3 | .Xr xlocale 3 | ||||
.Sh HISTORY | |||||
The | |||||
.Fn querylocale | |||||
function first appeared in | |||||
.Fx 9.1 , | |||||
and is based on the function of the same name in Darwin. | |||||
.Fa LC_VERSION_MASK | |||||
first appeared in | |||||
.Fx 13.0 . | |||||
Context not available. |
Do you intent to only allow to detect change, or also to define a 'newer than' relation ?