]> sourceware.org Git - newlib-cygwin.git/commit
nl_langinfo: Add NL_LOCALE_NAME macro
authorEric Blake <eblake@redhat.com>
Fri, 20 Jan 2017 02:45:16 +0000 (20:45 -0600)
committerCorinna Vinschen <corinna@vinschen.de>
Fri, 20 Jan 2017 09:30:47 +0000 (10:30 +0100)
commitca3e3bc54ee4a5a27fc7721a512818255c804812
tree06a9f785db413438b0a631adfc6e25d26098327c
parentef007184874ead6f288e432eb23bfc76bf65929d
nl_langinfo: Add NL_LOCALE_NAME macro

Provide an extension NL_LOCALE_NAME() macro, with semantics
matching glibc, which can be used as:
  nl_langinfo_l(NL_LOCALE_NAME(LC_MESSAGES), locale);
to get back the locale string that locale was originally
created with during newlocale(). This in turn allows a library
(such as gettext) to determine what thread-local locale settings
it has inherited from the main program without having to be told
what parameters were passed to newlocale(), for less overall
coupling between parts of the program.

gnulib is set up to use the extension:
https://lists.gnu.org/archive/html/bug-gnulib/2017-01/msg00129.html

* libc/include/langinfo.h (NL_LOCALE_NAME): New macro
* libc/locale/nl_langinfo.c (nl_langinfo_l): Expose locale names
of a locale_t's category components.

Signed-off-by: Eric Blake <eblake@redhat.com>
newlib/libc/include/langinfo.h
newlib/libc/locale/nl_langinfo.c
This page took 0.026503 seconds and 5 git commands to generate.