lynx-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: lynx-dev EBCDIC events


From: pg
Subject: Re: lynx-dev EBCDIC events
Date: Mon, 22 Feb 1999 23:57:30 -0700 (MST)

In a recent note, Philip Webb said:

> Date: Tue, 23 Feb 1999 01:17:42 -0500 (EST)
> 
> 990223 pg wrote: 
> > Is there anything you can put between the #if ... #endif
> > that will cause a compilation error on IRIX as on (most) other ASCII 
> > systems?
> 
> i'll see if i can try in the next few days:
> whereabouts in the package do i find that piece of code?
>  
In the "configure" script, about 9979 lines in (dev.17) unless you're
running "autoconfigure" (another knowledge-pushing experience), in
which case it comes from aclocal.m4.  In either case, just search
for "EBCDIC".

> i'm just currently feeling a bit smug to have solved the problem
> & pushed my knowledge forward a bit as well ...
> 
Sounds like my mother telling me, "If it doesn't hurt, it's not good
for you."

But maybe the pain can be eased.  Here's a patch that does a sanity
check at compilation time and another at runtime initialization for
previous valid configuration.  I'm curious whether it detects the IRIX
configuration problem, even though it can't prevent it.  Note that
this incorporates an EBCDIC bug fix I posted yesterday.

Of course, a suitable runtime check could generate a valid Lynx with
no need for a configure-time check.  But this would further bloat the
executable and degrade performance.  As it is, the bloat is confined
to the EBCDIC platform.  :-?

-- gil
===================================================================
%%% Created Mon Feb 22 23:39:08 MST 1999 by target lynx.patch. %%%
diff -brc orig/lynx2-8-2/src/LYMain.c lynx2-8-2/src/LYMain.c
*** orig/lynx2-8-2/src/LYMain.c Wed Feb 17 07:29:33 1999
--- lynx2-8-2/src/LYMain.c      Mon Feb 22 23:25:34 1999
***************
*** 559,565 ****
      exit(code);
  }
  
! #ifdef  EBCDIC  /* S/390 -- gil -- 1958 */
        char un_IBM1047[ 256 ] = "";
  unsigned char IBM1047[ 256 ] = /* ATOE OEMVS311 */
  {
--- 559,566 ----
      exit(code);
  }
  
! #ifdef    NOT_ASCII
! #ifdef  EBCDIC
        char un_IBM1047[ 256 ] = "";
  unsigned char IBM1047[ 256 ] = /* ATOE OEMVS311 */
  {
***************
*** 584,599 ****
  static void FixCharacters(void)
  {
      int c;
!     int work[256];
  
      for (c = 0; c < 256; c++) {
        un_IBM1047[IBM1047[c]] = c;
!       work[c] = keymap[c+1];
      }
!     for (c = 0; c < 256; c++)
!       keymap[IBM1047[c]+1] = work[c];
  }
  #endif /* EBCDIC */
  
  /*
   * Wow!  Someone wants to start up Lynx.
--- 585,617 ----
  static void FixCharacters(void)
  {
      int c;
!     int work1[256],
!         work2[256];
  
+     if (               240 != '0' ||
+              FROMASCII(48) != '0' ) {
+       fprintf(stderr, gettext(
+             "\nLynx Configuration error -- unknown character set.\n"));
+       exit(-1);
+     }
+ 
      for (c = 0; c < 256; c++) {
        un_IBM1047[IBM1047[c]] = c;
!       work1[c] = keymap[c+1];
!       work2[c] = key_override[c+1];
      }
!     for (c = 0; c < 256; c++) {
!       keymap      [IBM1047[c]+1] = work1[c];
!       key_override[IBM1047[c]+1] = work2[c];
!     }
  }
+ #else  /* EBCDIC */
+     A configuration error has occurred.  The host character set
+     appears to be neither ASCII nor EBCDIC.  Find and fix the
+     configuration problem and recompile.
+ #error "Unknown character set."
  #endif /* EBCDIC */
+ #endif /* NOT_ASCII */
  
  /*
   * Wow!  Someone wants to start up Lynx.
***************
*** 610,616 ****
      char filename[LY_MAXPATH];
      BOOL LYGetStdinArgs = FALSE;
  
! #ifdef    NOT_ASCII  /* S/390 -- gil -- 2002 */
      FixCharacters();
  #endif /* NOT_ASCII */
  
--- 628,634 ----
      char filename[LY_MAXPATH];
      BOOL LYGetStdinArgs = FALSE;
  
! #ifdef    NOT_ASCII
      FixCharacters();
  #endif /* NOT_ASCII */
  

reply via email to

[Prev in Thread] Current Thread [Next in Thread]