diff options
Diffstat (limited to 'newlib/libc/include/langinfo.h')
-rw-r--r-- | newlib/libc/include/langinfo.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/newlib/libc/include/langinfo.h b/newlib/libc/include/langinfo.h index 0fbb2a8d9..193cce348 100644 --- a/newlib/libc/include/langinfo.h +++ b/newlib/libc/include/langinfo.h @@ -304,7 +304,7 @@ enum __nl_item _NL_COLLATE_CODESET, /* This MUST be the last entry since it's used to check for an array - index in nl_langinfo(). */ + index in nl_langinfo(). It also must not exceed _NL_LOCALE_NAME_BASE. */ _NL_LOCALE_EXTENDED_LAST_ENTRY #endif /* __HAVE_LOCALE_INFO_EXTENDED__ */ @@ -312,6 +312,14 @@ enum __nl_item }; +/* As an extension, nl_langinfo can retrive the name of a locale + category, with this mapping from setlocale() category (other than + LC_ALL) to nl_item. */ +#define _NL_LOCALE_NAME_BASE 100000 +#if __GNU_VISIBLE +#define NL_LOCALE_NAME(category) (_NL_LOCALE_NAME_BASE + (category)) +#endif + __BEGIN_DECLS char *nl_langinfo (nl_item); #if __POSIX_VISIBLE >= 200809 |