lynx-dev
[Top][All Lists]
Advanced

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

Re: lynx-dev SLANG for DOS port of lynx


From: Bill Schiavo
Subject: Re: lynx-dev SLANG for DOS port of lynx
Date: Mon, 4 May 1998 14:19:20 -0400 (EDT)

Hello Everyone.  I submitted a patch for slang to be used with the dos
port of Lynx but did not get any kind of reaction.  Okay, It was not the
best patch but it worked.  I will take a look at your patch and see how
well it works.  Maybe I can contribute to it in some way.

Bye the way, the patch I submitted was for slang version 0.99.38.

Bill

On Mon, 4 May 1998, Doug Kaufman wrote:

> For a while the INSTALLATION file has mentioned the possibility of using
> SLANG with the DOS port, but I don't know if anyone has actually done
> it. This patch is a first attempt at getting SLANG to work with the DOS
> port. I wasn't able to get SLang_getkey to work for the extended keys
> and instead used the DJGPP funtion getxkeys, which required further
> modification of the DOSRAWKEYHACK section. Color seems to be on at all
> times with this port, regardless of the color settings in the option
> menu.
> 
> I took out the PDCurses specific code and replaced it with the
> equivalent.
> 
> Whoever works on the keymap functions of lynx should take into account,
> if possible, that DJGPP gives key values up to 0x293 and PDCurses
> gives key values up to 0x212 (of course, these sets of values are
> incompatible).
> 
> The patch follows. I have attached the file "makefile.dsl", for
> compiling the DOS SLANG version.
>                              Doug
> 
> *** lynx2-8/src/LYCurses.c    Thu Apr 23 05:35:22 1998
> --- lynx2-8/src/LYCurses.c.new        Sat May  2 14:57:04 1998
> ***************
> *** 157,163 ****
>       SLang_init_tty(3, 0, 1);
>   #endif /* SLANG_VERSION > 9929 */
>       signal(SIGTSTP, sl_suspend);
> ! #ifndef _WINDOWS
>       SLtty_set_suspend_state(1);
>   #endif
>       if (sig == SIGTSTP)
> --- 157,163 ----
>       SLang_init_tty(3, 0, 1);
>   #endif /* SLANG_VERSION > 9929 */
>       signal(SIGTSTP, sl_suspend);
> ! #if !defined(_WINDOWS) && !defined(__DJGPP__)
>       SLtty_set_suspend_state(1);
>   #endif
>       if (sig == SIGTSTP)
> ***************
> *** 691,696 ****
> --- 691,697 ----
>       }
>       size_change(0);
>   
> + #ifndef __DJGPP__
>       SLtt_add_color_attribute(4, SLTT_ULINE_MASK);
>       SLtt_add_color_attribute(5, SLTT_ULINE_MASK);
>       /*
> ***************
> *** 702,707 ****
> --- 703,709 ----
>       } else {
>           SLtt_Blink_Mode = 0;
>       }
> + #endif /* __DJGPP__ */
>       }
>       slinit = 1;
>       Current_Attr = 0;
> ***************
> *** 719,725 ****
>       scrollok(0,0);
>       SLsmg_Backspace_Moves = 1;
>   #ifndef VMS
> ! #ifndef _WINDOWS
>      SLtty_set_suspend_state(1);
>   #endif /* !_WINDOWS */
>   #ifdef SIGTSTP
> --- 721,727 ----
>       scrollok(0,0);
>       SLsmg_Backspace_Moves = 1;
>   #ifndef VMS
> ! #if !defined(_WINDOWS) && !defined(__DJGPP__)
>      SLtty_set_suspend_state(1);
>   #endif /* !_WINDOWS */
>   #ifdef SIGTSTP
> 
> *** lynx2-8/src/LYMain.c      Sat May  2 16:39:12 1998
> --- lynx2-8/src/LYMain.c.new  Sat May  2 19:36:32 1998
> ***************
> *** 33,38 ****
> --- 33,42 ----
>   #ifdef DOSPATH
>   #include <HTDOS.h>
>   #endif
> + #ifdef __DJGPP__
> + #include <dos.h>
> + #endif /* __DJGPP__ */
> + 
>   
>   #ifndef VMS
>   #ifdef SYSLOG_REQUESTED_URLS
> ***************
> *** 400,408 ****
>   #endif
>   
>   #ifdef __DJGPP__
>   void  reset_break()
>   {
> !     PDC_set_ctrl_break(init_ctrl_break[0]);
>   }
>   #endif /* __DJGPP__ */
>   
> --- 404,429 ----
>   #endif
>   
>   #ifdef __DJGPP__
> + int LY_set_ctrl_break()    
> + {
> +     int setting;
> +     (void*)signal(SIGINT,(setting ? SIG_DFL : SIG_IGN));
> +     setcbrk(setting);
> + }
> + 
> + int LY_get_ctrl_break()
> + {
> +     typedef union REGS Regs;
> +     extern Regs regs;
> +     regs.h.ah = 0x33;
> +     regs.h.al = 0x00;
> +     int86(0x21, &regs, &regs);
> +     return ((int) regs.h.dl);
> + }
> + 
>   void  reset_break()
>   {
> !     LY_set_ctrl_break(init_ctrl_break[0]);
>   }
>   #endif /* __DJGPP__ */
>   
> ***************
> *** 555,562 ****
>   #endif /* _WINDOWS */
>   
>   #ifdef __DJGPP__
> ! if (PDC_get_ctrl_break() == 0) {
> !     PDC_set_ctrl_break(TRUE);
>       init_ctrl_break[0] = 0;}
>   else {init_ctrl_break[0] = 1;}
>       atexit(reset_break);
> --- 576,583 ----
>   #endif /* _WINDOWS */
>   
>   #ifdef __DJGPP__
> ! if (LY_get_ctrl_break() == 0) {
> !     LY_set_ctrl_break(TRUE);
>       init_ctrl_break[0] = 0;}
>   else {init_ctrl_break[0] = 1;}
>       atexit(reset_break);
> 
> *** lynx2-8/src/LYStrings.c   Sat May  2 16:39:12 1998
> --- lynx2-8/src/LYStrings.c.new       Mon May  4 07:17:00 1998
> ***************
> *** 14,19 ****
> --- 14,23 ----
>   #include <LYOptions.h>
>   #include <LYCharSets.h>
>   #include <HTString.h>
> + #ifdef __DJGPP__
> + #include <pc.h>
> + #include <keys.h>
> + #endif /* __DJGPP__ */
>   
>   #include <ctype.h>
>   
> ***************
> *** 232,238 ****
> --- 236,246 ----
>   #ifdef VMS
>   #define GetChar() ttgetc()
>   #else
> + #ifdef __DJGPP__
> + #define GetChar getxkey
> + #else
>   #define GetChar (int)SLang_getkey
> + #endif /* __DJGPP__ */
>   #endif /* VMS */
>   #endif /* USE_SLANG */
>   
> ***************
> *** 353,370 ****
> --- 361,403 ----
>      }
>   #endif /* !USE_SLANG || VMS */
>   
> + /* The RAWDOSKEYHACK takes key definitions from curses.h (when using
> +  * PDCURSES) or from the DJGPP file keys.h (when using SLANG) and maps
> +  * them to the values used by the lynx file LYKeymap.c. */
> + 
>   #ifdef RAWDOSKEYHACK
>       if (raw_dos_key_hack) {
>       if (c == 0) c = '/';
>       if (c > 255) {      /* handle raw dos keys */
>           switch (c)
>           {
> + #ifdef USE_SLANG
> +             case 328: c = 256;      break; /* up arrow */     
> +             case 584: c = 256;      break; /* up arrow */     
> +             case 336: c = 257;      break; /* down arrow */   
> +             case 592: c = 257;      break; /* down arrow */   
> +             case 331: c = 259;      break; /* left arrow */   
> +             case 587: c = 259;      break; /* left arrow */   
> +             case 333: c = 258;      break; /* right arrow */          
> +             case 589: c = 258;      break; /* right arrow */          
> +             case 337: c = 260;      break; /* page down */    
> +             case 593: c = 260;      break; /* page down */    
> +             case 329: c = 261;      break; /* page up */      
> +             case 585: c = 261;      break; /* page up */      
> +             case 327: c = 262;      break; /* HOME */         
> +             case 583: c = 262;      break; /* HOME */         
> +             case 335: c = 263;      break; /* END */          
> +             case 591: c = 263;      break; /* END */          
> +             case 315: c = 264;      break; /* F1 */   
> +             case 301: c = 4;        break;  /* alt x */
> + #else /* PDCURSES */
>               case 464: c = '-';      break;  /* keypad minus*/
>               case 465: c = '+';      break;  /* keypad plus*/
>               case 459: c = 13;       break;  /* keypad enter*/
>               case 463: c = '*';      break;  /* keypad * */
>               case 440: c = 'Q';      break;  /* alt x */
>               case 265: c = 'H';      break;  /* F1 */
> + #endif /* USE_SLANG */
>               default: break;
>           }
>       }
> 
> __
> Doug Kaufman
> Internet: address@hidden (preferred)
>         address@hidden
> 

reply via email to

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