httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ovies Brabson <ovi...@us.ibm.com>
Subject OS/390 Translation (Was: [PATCH]Apache 1.3.9 Port to OS/390 Unix System Services)
Date Wed, 01 Dec 1999 00:27:58 GMT
> > const unsigned char os_toebcdic[256] = {
> >     0x00, 0x01, 0x02, 0x03, 0x37, 0x2d, 0x2e, 0x2f, /* 00-0f:           */
> >
> I've been testing doing this at runtime with:
>
>     +#ifdef   OS390
>     +/* Use OS/390's built-in translation function to initialize tables.
>     + */
>     +static void InitTables()
>     +{
>     +    register int i, j;
>     +
>     +    for (i = 0; i<256; i++) os_toebcdic[i] = i;
>     +
>     +    __atoe_l((char *) os_toebcdic, 256);
>     +    for (i = 0; i<256; i++) {
>     +        j = os_toebcdic[i];
>     +        os_toascii_strictly[j] = os_toascii[j] = i;
>     +    }
>     +    os_toascii[012] = 012;
>     +    os_toascii[015] = 015;
>     +
>     +    Initted = 1;
>     +}
>     +#endif /*OS390*/
>
> Advantages:
>
> o Shorter source code; less exposure to typos.
>
> o Adapts automatically to user's LOCALE.
>
> Disadvantages:
>
> o If user executes with LOCALE different from when tarball was
>   extracted, results are unpredictable.
>
> o If LOCALE specifies a degenerate (non-bijective) translation,
>   results are likely to be chaotic.
>
> o Tables must occupy writeable, as opposed to shared, memory.
>
> -- gil
>
There are many issues related to translation that we did not deal with in this initial port.
 We chose to copy what the other ebcdic systems had done for now.  It works pretty well for
most cases in the US.  We felt this was good enough for people to get some experience with
Apache on OS/390.  Eventually, we'd like to submit another patch which deals with all the
translation issues.


Mime
View raw message