[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: LYNX-DEV EBCDIC and OS/390
From: |
T.E.Dickey |
Subject: |
Re: LYNX-DEV EBCDIC and OS/390 |
Date: |
Sun, 18 Jan 1998 07:48:18 -0500 (EST) |
> As I make slow, intermittent progress with porting Lynx to OS/390,
> a number of questions occur:
>
> I'm digging out all code sensitive constructs and changing them,
> #ifdef'ing where it seems appropriate. For example, I'm
> substituting CH_ESC wherever I find '\033' (or maybe just 27).
>
> I've created a header file containing:
>
> #ifndef CH_ESC
> #ifdef EBCDIC
> #define CH_DEL '\x07'
> #define CH_ESC '\x27'
> #define CH_ESC_PAR '\x27'
what's the difference between ESC & ESC_PAR?
> #define CH_HICTL '\x3f'
> #define CH_NBSP '\x41'
> #define CH_SHY '\xca'
> #else /* EBCDIC */
> #define CH_ESC '\033'
> #define CH_DEL '\177'
> #define CH_ESC_PAR '\233'
> #define CH_HICTL '\237'
> #define CH_NBSP '\240'
> #define CH_SHY '\255'
> #endif /* EBCDIC */
> #endif /* CH_ESC */
>
> Questions:
>
> o Are the identifiers I chose suitable? I chose the "CH_"
> prefix because it's unique in a "grep" through the source code.
maybe a comment explaining the mnemonics would help (what is "SHY" ? -
signed high character ? - in that case, CH_MAX or CH_HIGH would be
easier). Probably things like HICTL are going to get you into trouble,
since the code relies on assuming that the ranges (control and
non-control) are distinct. You'd do better to look for things like
that and use the standard ctype.h macros for iscntrl, isprint, etc.
(Don't use isascii ;-).
> o Where should this header file go/what should it be called? For
> now, I'm using WWW/Library/Implementation/LYCharVals.h. Is this
> consistent with existing Lynx naming conventions?
That sounds ok to me.
> o Would it be better to incorporate the definitions in an existing
> header file, perhaps WWW/Library/Implementation/tcp.h?
no - I wouldn't (tcp.h has too much stuff that's unrelated to its purpose).
> o Will the Lynx developer community accept such pervasive changes
> to the Lynx source code?
well, if it works...
> I've had to shuffle two character attribute tables, keymap and
> EditBinding, from ASCII to EBCDIC order.
I saw that in your alpha patch - it seemed reasonable. Perhaps it
could be generated at build time, though, since there's no reason
(that I know of) to make it runtime.
> o I do this in executable code -- I believe this is more
> maintainable than static initializations. Is there a
> better way?
>
> o The shuffle code is in the initialization part of LYMain.c
> (with #ifdef's for EBCDIC only). Is there a better place?
>
> o Will I encounter other such tables that need to be shuffled?
I don't know - haven't studied that.
> o Are the recent character translation tables any use to me?
> I suspect not, since the underlying assumption is that
> whatever the external character set, Lynx itself runs
> in ASCII.
>
> Thanks for your attention,
> gil
>
--
Thomas E. Dickey
address@hidden
http://www.clark.net/pub/dickey