Mail Archives: djgpp-workers/2001/02/26/10:22:17
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 -