[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: lynx-dev New patch for DJGPP and SLANG
From: |
Bill Schiavo |
Subject: |
Re: lynx-dev New patch for DJGPP and SLANG |
Date: |
Fri, 15 May 1998 00:39:33 -0400 (EDT) |
Hello Everyone.
On Wed, 13 May 1998, Doug Kaufman wrote:
> I cleaned up my original patch to use the DJGPP keyhandler with
> SLANG and have integrated it with Bill's patch, so that this will be
> controlled by the new define "DJGPP_KEYHANDLER". As far as I can tell,
> the SLANG keyhandler doesn't work with the ALT keys (or at least I
> haven't been able to find how to do it in the documentation). With the
> DJGPP_KEYHANDLER, remapping of ALT keys should be possible under SLANG.
> Since the version 2.8.1dev.10 had some problems, this is a resubmission
> of a patch against 2.8.1dev.9. I also noted that I accidentally included
> some features in the makefile that were specific to my system, so two
> makefiles are appended. Makefile.wsl is for Bill's version with the
> SLkp_getkey function as keyhandler, and makefile.dsl has the DJGPP
> function getxkey as the keyhandler.
>
> Bill's patch also had a change that I didn't understand to LYUtils.c,
> where the SLtt_get_screen_size was ifdef'd for UNIX or VMS only. At
When I originally wrote the patch, this function didn't exist for the DOS
port of Slang version 0.99.38 so it was necessary to #ifdef it out. I do
agree though that we should say
#ifdef __DJGPP__ instead of #if defined(unix) || defined(VMS) as this
would ensure that we exclude DJGPP only. Apparently this function now
exists for version 1.2.2.
Bill
> least with the version 1.2.2 of SLANG
that I used, this didn't seem
> necessary. I couldn't see any difference compiling with or without this.
> If we do need to exclude it for DJGPP, should we really do it as
> "#ifdef UNIX || VMS", or would it be better to do "#ifndef __DJGPP__"?
> I don't know how many systems are excluded by the first method.
>
> The patch follows. The two makefiles are attached.
> Doug
>
> *** lynx2-8/src/LYCurses.c Sat May 2 16:39:12 1998
> --- lynx2-8/src/LYCurses.c.new Wed May 13 05:56:58 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)
> ***************
> *** 655,660 ****
> --- 655,664 ----
>
> if (slinit == 0) {
> SLtt_get_terminfo();
> + #if defined(__DJGPP__) && !defined(DJGPP_KEYHANDLER)
> + SLkp_init ();
> + #endif /* __DJGPP__ && !DJGPP_KEYHANDLER */
> +
> #ifdef UNIX
> #if SLANG_VERSION >= 9935
> SLang_TT_Read_FD = fileno(stdin);
> ***************
> *** 691,696 ****
> --- 695,702 ----
> }
> size_change(0);
>
> + #ifndef __DJGPP__
> + #if defined(VMS) || defined(UNIX)
> SLtt_add_color_attribute(4, SLTT_ULINE_MASK);
> SLtt_add_color_attribute(5, SLTT_ULINE_MASK);
> /*
> ***************
> *** 702,709 ****
> --- 708,722 ----
> } else {
> SLtt_Blink_Mode = 0;
> }
> + #endif /* VMS || UNIX */
> + #endif /* __DJGPP__ */
> }
> + #ifdef __DJGPP__
> + else sock_init();
> + #endif /* __DJGPP__ */
> +
> slinit = 1;
> +
> Current_Attr = 0;
> #ifndef VMS
> #if SLANG_VERSION > 9929
> ***************
> *** 719,725 ****
> scrollok(0,0);
> SLsmg_Backspace_Moves = 1;
> #ifndef VMS
> ! #ifndef _WINDOWS
> SLtty_set_suspend_state(1);
> #endif /* !_WINDOWS */
> #ifdef SIGTSTP
> --- 732,738 ----
> 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 Sun May 10 13:14:46 1998
> ***************
> *** 34,39 ****
> --- 34,43 ----
> #include <HTDOS.h>
> #endif
>
> + #ifdef __DJGPP__
> + #include <dos.h>
> + #endif /* __DJGPP__ */
> +
> #ifndef VMS
> #ifdef SYSLOG_REQUESTED_URLS
> #include <syslog.h>
> ***************
> *** 400,408 ****
> #endif
>
> #ifdef __DJGPP__
> void reset_break()
> {
> ! PDC_set_ctrl_break(init_ctrl_break[0]);
> }
> #endif /* __DJGPP__ */
>
> --- 404,428 ----
> #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, ®s, ®s);
> + 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);
> --- 575,582 ----
> #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 Tue May 12 00:10:38 1998
> ***************
> *** 15,20 ****
> --- 15,25 ----
> #include <LYCharSets.h>
> #include <HTString.h>
>
> + #ifdef DJGPP_KEYHANDLER
> + #include <pc.h>
> + #include <keys.h>
> + #endif /* DJGPP_KEYHANDLER */
> +
> #include <ctype.h>
>
> #include <LYLeaks.h>
> ***************
> *** 232,238 ****
> --- 237,251 ----
> #ifdef VMS
> #define GetChar() ttgetc()
> #else
> + #ifdef __DJGPP__
> + #ifdef DJGPP_KEYHANDLER
> + #define GetChar getxkey
> + #else
> + #define GetChar SLkp_getkey
> + #endif /* DJGPP_KEYHANDLER */
> + #else
> #define GetChar (int)SLang_getkey
> + #endif /* __DJGPP__ */
> #endif /* VMS */
> #endif /* USE_SLANG */
>
> ***************
> *** 554,559 ****
> --- 567,640 ----
> if (isdigit(a) && (b == '[' || c == 155) && d != -1 && d != '~')
> d = GetChar();
> }
> + #if defined(__DJGPP__) && defined(USE_SLANG)
> + #ifdef DJGPP_KEYHANDLER
> + else { /* DJGPP keypad interface (see file "keys.h" for definitions) */
> + switch (c) {
> + case K_Up: c = UPARROW; break; /* up arrow */
> + case K_EUp: c = UPARROW; break; /* up arrow */
> + case K_Down: c = DNARROW; break; /* down arrow */
> + case K_EDown: c = DNARROW; break; /* down arrow */
> + case K_Right: c = RTARROW; break; /* right arrow */
> + case K_ERight: c = RTARROW; break; /* right arrow */
> + case K_Left: c = LTARROW; break; /* left arrow */
> + case K_ELeft: c = LTARROW; break; /* left arrow */
> + case K_PageDown: c = PGDOWN; break; /* page down */
> + case K_EPageDown: c = PGDOWN; break; /* page down */
> + case K_PageUp: c = PGUP; break; /* page up */
> + case K_EPageUp: c = PGUP; break; /* page up */
> + case K_Home: c = HOME; break; /* HOME */
> + case K_EHome: c = HOME; break; /* HOME */
> + case K_End: c = END_KEY; break; /* END */
> + case K_EEnd: c = END_KEY; break; /* END */
> + case K_F1: c = F1; break; /* F1 */
> + case K_Alt_X: c = 4; break; /* alt x */
> + }
> + }
> + #else
> + else { /* SLang keypad interface (see file "slang.h" for definitions) */
> + switch (c) {
> + case SL_KEY_UP:
> + c = UPARROW;
> + break;
> + case SL_KEY_DOWN:
> + c = DNARROW;
> + break;
> + case SL_KEY_RIGHT:
> + c = RTARROW;
> + break;
> + case SL_KEY_B2:
> + c = DO_NOTHING;
> + break;
> + case SL_KEY_LEFT:
> + c = LTARROW;
> + break;
> + case SL_KEY_PPAGE:
> + case SL_KEY_A3:
> + c = PGUP;
> + break;
> + case SL_KEY_NPAGE:
> + case SL_KEY_C3:
> + c = PGDOWN;
> + break;
> + case SL_KEY_HOME:
> + case SL_KEY_A1:
> + c = HOME;
> + break;
> + case SL_KEY_END:
> + case SL_KEY_C1:
> + c = END_KEY;
> + break;
> + case SL_KEY_F(1):
> + c = F1;
> + break;
> + case SL_KEY_BACKSPACE:
> + c = 127;
> + break;
> + }
> + }
> + #endif /* DJGPP_KEYHANDLER */
> + #endif /* __DJGPP__ && USE_SLANG */
> #if HAVE_KEYPAD
> else {
> /*
>
> __
> Doug Kaufman
> Internet: address@hidden (preferred)
> address@hidden
>