You copied the Doc URL to your clipboard.


Defined in rt_locale.h, _findlocale() searches a set of contiguous locale data blocks for the requested locale, and returns a pointer to that locale.

This function is not part of the C library standard, but the ARM® C library supports it as an extension.


void const *_findlocale(void const *index, const char *name);



is a pointer to a set of locale data blocks that are contiguous in memory and that end with a terminating value (set by the LC_index_end macro).


is the name of the locale to find.


You can use _findlocale() as an optional helper function when defining your own locale setup.

The _get_lc_*() functions, for example, _get_lc_ctype(), are expected to return a pointer to a locale definition created using the assembler macros. If you only want to write one locale definition, you can write an implementation of _get_lc_ctype() that always returns the same pointer. However, if you want to use different locale definitions at runtime, then the _get_lc_*() functions have to be able to return a different data block depending on the name passed to them as an argument. _findlocale() provides an easy way to do this.


Returns a pointer to the requested data block.