_findlocale()

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 is supported by the ARM C library as an extension.

Show/hideSyntax

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

Where:

index

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).

name

is the name of the locale to find.

Show/hideUsage

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.

Show/hideReturns

Returns a pointer to the requested data block.

Show/hideSee also

Copyright © 2010-2011 ARM. All rights reserved.ARM DUI 0492F
Non-ConfidentialID091611