From 985fc132f23dbb83de76c5af9e783ef1b5900148 Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Mon, 4 Apr 2016 15:18:13 +0200 Subject: strfmon_l: Use specified locale for number formatting [BZ #19633] --- locale/localeinfo.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'locale') diff --git a/locale/localeinfo.h b/locale/localeinfo.h index 5c4e6ef..94627f3 100644 --- a/locale/localeinfo.h +++ b/locale/localeinfo.h @@ -299,6 +299,27 @@ extern __thread struct __locale_data *const *_nl_current_##category \ #endif +/* Extract CATEGORY locale's string for ITEM. */ +static inline const char * +_nl_lookup (locale_t l, int category, int item) +{ + return l->__locales[category]->values[_NL_ITEM_INDEX (item)].string; +} + +/* Extract CATEGORY locale's wide string for ITEM. */ +static inline const wchar_t * +_nl_lookup_wstr (locale_t l, int category, int item) +{ + return (wchar_t *) l->__locales[category] + ->values[_NL_ITEM_INDEX (item)].wstr; +} + +/* Extract the CATEGORY locale's word for ITEM. */ +static inline uint32_t +_nl_lookup_word (locale_t l, int category, int item) +{ + return l->__locales[category]->values[_NL_ITEM_INDEX (item)].word; +} /* Default search path if no LOCPATH environment variable. */ extern const char _nl_default_locale_path[] attribute_hidden; -- cgit v1.1