X-Authentication-Warning: delorie.com: mail set sender to djgpp-workers-bounces using -f Date: Sun, 02 Sep 2007 02:49:43 -0600 From: Brian Inglis Subject: Re: LC_MESSAGES In-reply-to: <200709020415.l824Fn9a027208@envy.delorie.com> To: djgpp-workers AT delorie DOT com Message-id: Organization: Systematic Software MIME-version: 1.0 X-Mailer: Forte Agent 1.93/32.576 English (American) Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7bit References: <200708281407 DOT 04617 DOT juan DOT guerrero AT gmx DOT de> <200708281454 DOT l7SEsUc3016927 AT envy DOT delorie DOT com> <200709020415 DOT l824Fn9a027208 AT envy DOT delorie DOT com> Reply-To: djgpp-workers AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp-workers AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Sun, 02 Sep 2007 00:15:49 -0400, DJ Delorie wrote: >Er, my question was "if we include the macro, but ignore it, what >happens to programs that expect the macro, and expect it to actually >do something?" > >I don't propose including a full locale support in djgpp; we've always >used dummy functions. ISTM that LC_MESSAGES is an extension to ISO C required by POSIX, so leaving it undefined is the simplest option, as it was(/is?) not supported by some BSDs. If we define it, we need some support, and my reading of POSIX (OpenGroup) implies at least adding support for locale category LC_MESSAGES, header nltypes.h http://www.opengroup.org/onlinepubs/009695399/basedefs/nl_types.h.html which includes types nl_catd and nl_item, constants NL_SETD and NL_CAT_LOCALE, and functions catopen(), catclose(), catgets(); and header langinfo.h http://www.opengroup.org/onlinepubs/009695399/basedefs/langinfo.h.html which includes all constants identifying accessible data items, function nl_langinfo(), variables for yesexpr and noexpr (possibly also yesstr and nostr for backwards compatibility, but now removed from the standard). The function catgets() can be dummied to return its final argument, catclose() can return 0, and catopen() can return a dummy non-NULL value. Function nl_langinfo() has to return the appropriate info for all constants identifying data items in the POSIX locale, and modules modified to use those values to keep the definitions consistent including those containing setlocale(), strcoll(), strxfrm(), tolower(), toupper(), is*(), printf(), scanf(), strtod(), strftime(). ISTM supporting nl_langinfo() could be simplified by defining a global locale structure, pointing to a global POSIX locale structure, containing an array of pointers to locale category structures, each of whose members are named char ptrs to the appropriate string constants for the POSIX locale. Are there any compatibly-licensed definitions we could use as a base for this level of support of LC_MESSAGES in glibc, CygWin, BSD, or other freeware products? I notice there is a DJGPP contrib/catdoc package that supports returning the DOS code page as the charset/CODESET item, CygWin/glibc supports 13 locale categories, and various DJGPP gnu ports support locales. -- Thanks. Take care, Brian Inglis Calgary, Alberta, Canada