delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2007/09/02/04:52:18

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 <Brian DOT Inglis AT SystematicSw DOT ab DOT ca>
Subject: Re: LC_MESSAGES
In-reply-to: <200709020415.l824Fn9a027208@envy.delorie.com>
To: djgpp-workers AT delorie DOT com
Message-id: <tmpkd3h5ra1576s066imak1t9237gednl0@4ax.com>
Organization: Systematic Software
MIME-version: 1.0
X-Mailer: Forte Agent 1.93/32.576 English (American)
References: <200708281407 DOT 04617 DOT juan DOT guerrero AT gmx DOT de>
<200708281454 DOT l7SEsUc3016927 AT envy DOT delorie DOT com>
<gdakd354m7c57eotc3ua021bsacqed8qp1 AT 4ax 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

On Sun, 02 Sep 2007 00:15:49 -0400, DJ Delorie <dj AT delorie DOT com> 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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019