]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Add collation version support to querylocale(3).
authortmunro <tmunro@FreeBSD.org>
Sun, 8 Nov 2020 02:50:34 +0000 (02:50 +0000)
committertmunro <tmunro@FreeBSD.org>
Sun, 8 Nov 2020 02:50:34 +0000 (02:50 +0000)
commitb454726096542e0bd1a4c389c8371e8c8473326d
tree713e7f140bcc509d153f6843f0c0c4e93cf43991
parent3d0f54ceb896353732cc92bb8e159bee00113f1b
Add collation version support to querylocale(3).

Provide a way to ask for an opaque version string for a locale_t, so
that potential changes in sort order can be detected.  Similar to
ICU's ucol_getVersion() and Windows' GetNLSVersionEx(), this API is
intended to allow databases to detect when text order-based indexes
might need to be rebuilt.

The CLDR version is extracted from CLDR source data by the Makefile
under tools/tools/locale, written into the machine-generated Makefile
under shared/colldef, passed to localedef -V, and then written into
LC_COLLATE file headers.  The initial version is 34.0.
tools/tools/locale was recently updated to pull down 35.0, but the
output hasn't been committed under share/colldef yet, so that will
provide the first observable change when it happens.  Other versioning
schemes are possible in future, because the format is unspecified.

Reviewed by: bapt, 0mp, kib, yuripv (albeit a long time ago)
Differential Revision: https://reviews.freebsd.org/D17166
14 files changed:
include/xlocale/_locale.h
lib/libc/locale/collate.c
lib/libc/locale/collate.h
lib/libc/locale/querylocale.3
lib/libc/locale/xlocale.c
lib/libc/locale/xlocale_private.h
share/colldef/Makefile
tools/tools/locale/Makefile
tools/tools/locale/tools/cldr2def.pl
usr.bin/localedef/bootstrap/bootstrap_xlocale_private.h
usr.bin/localedef/collate.c
usr.bin/localedef/localedef.1
usr.bin/localedef/localedef.c
usr.bin/localedef/localedef.h