delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2001/02/26/10:22:17

From: Bruno Haible <haible AT ilog DOT fr>
MIME-Version: 1.0
Message-ID: <15002.29723.880411.704219@honolulu.ilog.fr>
Date: Mon, 26 Feb 2001 16:19:55 +0100 (CET)
To: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
Cc: ST001906 AT HRZ1 DOT HRZ DOT TU-Darmstadt DOT De, djgpp-workers AT delorie DOT com
Subject: Re: gettext pretest available
In-Reply-To: <2110-Fri23Feb2001094452+0200-eliz@is.elta.co.il>
References: <29F40F30739 AT HRZ1 DOT hrz DOT tu-darmstadt DOT de>
<2BBB1E41683 AT HRZ1 DOT hrz DOT tu-darmstadt DOT de>
<2110-Fri23Feb2001094452+0200-eliz AT is DOT elta DOT co DOT il>
X-Mailer: VM 6.72 under 21.1 (patch 8) "Bryce Canyon" XEmacs Lucid
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

Eli Zaretskii writes:

> I'm not aware of any real activity to add a working, non-trivial
> setlocale to DJGPP, apart of someone who posted a partial-solution
> code that was not reviewed yet.  Since adding working locales is a
> huge job, it is IMHO prudent to assume that DJGPP doesn't yet support
> locales and won't support them for an observable future.

Thanks for the info.

> One caveat: can the files that are read as text have unprintable
> characters, such as lone CRs or ^Z?  If they can, text mode is not
> reliable enough to be used with such files.

It is safe to assume the files don't contain such characters, because
the gettext tools warn if a control character other than '\n' and '\t'
occurs.

> > > Then the setmode() macro should take care of it.
> > I will assume you are makeing reference to setmode() macro defined in lib/system.h.
> > I will add a setmode() macro to system.h for djgpp:
> > 1) DJGPP:
> > # define setmode(fd, mode)      do { \
> >                                   if (!isatty ((fd))) \
> >                                     setmode ((fd), mode); \
> >                                 } while (0)
> 
> This will only DTRT if this macro is called _only_ for switching
> stdin/stdout to binary mode and back.  If you ever call the macro on a
> handle other than 0 or 1, it might silently do nothing without a good
> reason.

Does this mean your isatty() function is broken? Note that the real
test, namely INT 44,00 and checking two bits, is not found in your code.

    #define get_handle_info(handle)  \
      ({ uint16_t __info;                                                   \
         __asm__ (                                                          \
                  " pushl %%ebx ;"                                          \
                  " movw %1,%%bx ; movw $0x4400,%%ax ; int $0x21 ;"         \
                  " popl %%ebx "                                            \
                  : "=d" /* %dx */ (__info)                                 \
                  : "ri" ((uint16_t)(handle))                               \
                  : "ax","cx","si","di" /* %eax,%ecx,%esi,%edi */           \
                 );                                                         \
         __info;                                                            \
       })

   if ((get_handle_info(0) & 0x81) == 0x81)

   if ((get_handle_info(1) & 0x82) == 0x82)

Bruno

- Raw text -


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