This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: missing API for locale_t in <locale.h>
- From: Bruno Haible <bruno at clisp dot org>
- To: Roland McGrath <roland at redhat dot com>
- Cc: libc-alpha at sources dot redhat dot com
- Date: Sat, 26 Mar 2005 16:18:29 +0100
- Subject: Re: missing API for locale_t in <locale.h>
- References: <200503222226.j2MMQJPl006501@magilla.sf.frob.com>
Roland McGrath wrote:
> > In short, I'm asking for __current_locale_name to be made public. Or for
> > nl_langinfo_l to be extended to support _NL_ADDRESS_NAME, _NL_CTYPE_NAME,
> > _NL_MESSAGES_NAME, etc.
>
> I'm inclined to add to nl_langinfo for this rather than adding a new entry
> point. Perhaps:
>
> #define _NL_LOCALE(category) _NL_ITEM (category, 0xffff)
Yes, this would be OK.
Since macro names starting with an underscore are always understood as
"private" and "you shouldn't use", how about defining it as a macro called
NL_LOCALE or NL_LOCALE_NAME? As I understand from
http://www.opengroup.org/onlinepubs/009695399/functions/xsh_chap02_02.html
<langinfo.h> is not allowed to define such a macro by default, but it would
be sufficient to define it if _GNU_SOURCE was specified.
> so you use nl_langinfo (_NL_LOCALE (LC_MESSAGES)).
I would then use nl_langinfo_l (_NL_LOCALE (LC_MESSAGES)), yes.
Bruno