History log of /seL4-camkes-master/projects/musllibc/src/locale/__lctrans.c
Revision Date Author Comments
# 61a3364d 27-May-2015 Rich Felker <dalias@aerifal.cx>

overhaul locale internals to treat categories roughly uniformly

previously, LC_MESSAGES was treated specially as the only category
which could be set to a locale name without a definition file, in
order to facilitate gettext message translations when no libc locale
was available. LC_NUMERIC was completely un-settable, and LC_CTYPE
stored a flag intended to be used for a possible future byte-based C
locale, instead of storing a __locale_map pointer like the other
categories use.

this patch changes all categories to be represented by pointers to
__locale_map structures, and allows locale names without definition
files to be treated as valid locales with trivial definition when used
in any category. outwardly visible functional changes should be minor,
limited mainly to the strings read back from setlocale and the way
gettext handles translations in categories other than LC_MESSAGES.

various internal refactoring has also been performed, and improvements
in const correctness have been made.


# 86876dbe 06-Sep-2014 Rich Felker <dalias@aerifal.cx>

fix non-static dummy function that slipped in with locale implementation


# 41421d6b 26-Jul-2014 Rich Felker <dalias@aerifal.cx>

implement mo file string lookup for translations

the core is based on a binary search; hash table is not used. both
native and reverse-endian mo files are supported. all offsets read
from the mapped mo file are checked against the mapping size to
prevent the possibility of reads outside the mapping.

this commit has no observable effects since there are not yet any
callers to the message translation code.