Datasheet
The C and C++ Libraries
ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 4-29
All locale blocks for a category are collected into a read-only, position-independent,
in-memory file system structure. The C library provides a set of macros to create the
blocks and the
_findlocale()
function to search the file system.
You can define a set of runtime selectable locales by using the supplied
re-implementations as a starting point. Your application will not call
_get_lc_category
functions directly.
_get_lc_category
functions are called by
setlocale()
and
__rt_lib_init()
. You implement new locales by providing new locale definition blocks
and re-implementations of
_get_lc_category
for
setlocale()
to use as in Example 4-2.
Example 4-2 get_lc_ctype
void const *_get_lc_ctype(void const *null, char const *name) {
return _findlocale(&lcctype_c_index, name);
}
4.6.3 Macros and utility functions
The macros and utility functions listed in Table 4-8 simplify the process of creating and
using locale blocks. See the
rt_locale.h
file for more information.
Table 4-8 locale macros
Function or macro Description
__LC_CTYPE_DEF
Use this macro to create a block of values for the character set.
See _get_lc_ctype() on page 4-30.
__LC_COLLATE_DEF
Use this macro to create a block of sorting values for the
character set. See _get_lc_collate() on page 4-32.
__LC_TIME_DEF
Use this macro to create a block of time formatting values. See
_get_lc_time() on page 4-38.
__LC_NUMERIC_DEF
Use this macro to create a block of numeric formatting values.
See _get_lc_numeric() on page 4-37.
__LC_MONETARY_DEF
Use this macro to create a block of monetary formatting
values. See _get_lc_monetary() on page 4-35.
__LC_INDEX_END
Use this macro to declare the end of an index of formatting
values. See Using the macros on page 4-30.
_findlocale()
Use this function to return the address of a locale block. See
_findlocale() on page 4-42.