lynx-dev
[Top][All Lists]
Advanced

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

lynx-dev Lynx386 with Slang


From: Bill Schiavo
Subject: lynx-dev Lynx386 with Slang
Date: Sat, 9 May 1998 23:11:49 -0400 (EDT)

Hello everyone.  

Here is an updated version of a patch I submitted sometime in October of
1997 that allows Lynx386 to be used with Slang.  
  I use the standard Slang keyboard functions so the keymapping functions
that are already in place should work correctly without modification.
Also, you can compile this version with either makefile.  The makefile I
have attached is for slang and the original one can be used for the
PDCurses version.

The patch follows.  I have attach the makefile makefile.wsl to compile the
DOS Slang version.

Bill
diff -rc \lynx2-8\src/lycurses.c \lynxslng\src/lycurses.c
*** \lynx2-8\src/lycurses.c     Sat May  2 17:39:12 1998
--- \lynxslng\src/lycurses.c    Sat May  9 16:40:26 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();
+ #ifdef __DJGPP__
+       SLkp_init ();
+ #endif /* __DJGPP__ */
+ 
  #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
diff -rc \lynx2-8\src/lymain.c \lynxslng\src/lymain.c
*** \lynx2-8\src/lymain.c       Sat May  9 22:18:04 1998
--- \lynxslng\src/lymain.c      Sat May  9 21:45:46 1998
***************
*** 34,39 ****
--- 34,45 ----
  #include <HTDOS.h>
  #endif
  
+ #ifdef __DJGPP__
+ #ifdef USE_SLANG
+ #include <dos.h>
+ #endif /* USE_SLANG */
+ #endif /* __DJGPP__ */
+ 
  #ifndef VMS
  #ifdef SYSLOG_REQUESTED_URLS
  #include <syslog.h>
***************
*** 400,408 ****
--- 406,437 ----
  #endif
  
  #ifdef __DJGPP__
+ #ifdef USE_SLANG
+ 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);
+ }
+ #endif /* USE_SLANG */
+ 
  void  reset_break()
  {
+ #ifdef USE_SLANG
+     LY_set_ctrl_break(init_ctrl_break[0]);
+ #else
      PDC_set_ctrl_break(init_ctrl_break[0]);
+ #endif /* USE_SLANG */
  }
  #endif /* __DJGPP__ */
  
***************
*** 555,562 ****
--- 584,596 ----
  #endif /* _WINDOWS */
  
  #ifdef __DJGPP__
+ #ifdef USE_SLANG
+ if (LY_get_ctrl_break() == 0) {
+     LY_set_ctrl_break(TRUE);
+ #else
  if (PDC_get_ctrl_break() == 0) {
      PDC_set_ctrl_break(TRUE);
+ #endif /* USE_SLANG */
      init_ctrl_break[0] = 0;}
  else {init_ctrl_break[0] = 1;}
      atexit(reset_break);
Only in \lynxslng\src: lynxslng.pch
diff -rc \lynx2-8\src/lystring.c \lynxslng\src/lystring.c
*** \lynx2-8\src/lystring.c     Sat May  9 22:17:14 1998
--- \lynxslng\src/lystring.c    Sat May  9 18:39:32 1998
***************
*** 232,238 ****
--- 232,242 ----
  #ifdef VMS
  #define GetChar() ttgetc()
  #else
+ #ifdef __DJGPP__
+ #define GetChar SLkp_getkey
+ #else
  #define GetChar (int)SLang_getkey
+ #endif /* __DJGPP__ */
  #endif /* VMS */
  #endif /* USE_SLANG */
  
***************
*** 554,559 ****
--- 558,606 ----
        if (isdigit(a) && (b == '[' || c == 155) && d != -1 && d != '~')
            d = GetChar();
      }
+ #if defined(__DJGPP__) && defined(USE_SLANG)
+     else { /* SLang keypad interface */
+       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
  #if HAVE_KEYPAD
      else {
        /*
diff -rc \lynx2-8\src/lyutils.c \lynxslng\src/lyutils.c
*** \lynx2-8\src/lyutils.c      Sun May  3 17:23:44 1998
--- \lynxslng\src/lyutils.c     Sat May  9 16:40:34 1998
***************
*** 2778,2784 ****
--- 2778,2786 ----
      int old_cols = LYcols;
  
  #ifdef USE_SLANG
+ #if defined(VMS) || defined(UNIX)
      SLtt_get_screen_size();
+ #endif /* VMS || UNIX */
      LYlines = SLtt_Screen_Rows;
      LYcols  = SLtt_Screen_Cols;
  #ifdef SLANG_MBCS_HACK

OBJS= UCdomap.o UCAux.o UCAuto.o \
LYClean.o LYShowInfo.o LYEdit.o LYStrings.o \
LYMail.o HTAlert.o GridText.o LYGetFile.o \
LYMain.o LYMainLoop.o LYCurses.o LYBookmark.o LYUtils.o \
LYOptions.o LYReadCFG.o LYSearch.o LYHistory.o \
LYForms.o LYPrint.o LYrcFile.o LYDownload.o LYNews.o LYKeymap.o \
HTML.o HTFWriter.o HTInit.o DefaultStyle.o LYLocal.o LYUpload.o \
LYLeaks.o LYexit.o LYJump.o LYList.o LYCgi.o LYTraversal.o \
LYEditmap.o LYCharSets.o LYCharUtils.o LYMap.o LYCookie.o LYExtern.o \
LYStyle.o LYHash.o

CFLAGS= $(MCFLAGS) -I. -I.. $(SLANGINC)

CC = gcc
MCFLAGS = -O3 -DRAWDOSKEYHACK -DUSE_ZLIB -DUSE_EXTERNALS \
-DUSE_SLANG -DACCESS_AUTH -DNO_CUSERID \
-DNOUSERS -DDOSPATH -DNO_TTYTYPE -DNO_UTMP -I../WWW/library/implement 
-I../djgpp/tcplib/include \
-I./chrtrans -I../djgpp/tcplib/include/tcp
WWWLIB = ../WWW/library/djgpp/libwww.a ../djgpp/tcplib/obj/libtcp.a
LIBS=-lslang -lz
CHRTR= ./chrtrans/

all: lynx

lynx:   message $(OBJS) $(WWWLIB)
        @echo "Linking and creating Lynx executable"
        $(CC) $(CFLAGS) -o lynx  $(OBJS) $(WWWLIB) $(SLANGLIB) $(LIBS)
        @echo "Welcome to Lynx!"

message:
        @echo "Compiling Lynx sources"

dbg:    $(OBJS) $(WWWLIB)
        @echo "Making Lynx code"
        $(CC) $(OBJS) $(CFLAGS) $(WWWLIB) $(SLANGLIB) $(LIBS)

lint:
        lint *.c  > ../lint.out

clean:
        rm -f lynx core *.[ob]

LYMain.o: ../userdefs.h
LYMainLoop.o: LYMainLoop.c ../userdefs.h
LYReadCFG.o: LYReadCFG.c ../userdefs.h
HTFWriter.o: HTFWriter.c ../userdefs.h
LYGetFile.o: LYGetFile.c ../userdefs.h
LYOptions.o: LYOptions.c ../userdefs.h
LYReadCFG.o: LYReadCFG.c ../userdefs.h
LYTraversal.o: LYTraversal.c ../userdefs.h
LYCharSets.o: LYCharSets.c ../userdefs.h
LYShowInfo.o: LYShowInfo.c ../userdefs.h
LYStrings.o: LYStrings.c ../userdefs.h
LYBookmark.o: LYBookmark.c ../userdefs.h
LYHistory.o: LYHistory.c ../userdefs.h
LYDownload.o: LYDownload.c ../userdefs.h
DefaultStyle.o: DefaultStyle.c ../userdefs.h
LYEditmap.o: LYEditmap.c ../userdefs.h
LYCharUtils.o: LYCharUtils.c ../userdefs.h
LYExtern.o: LYExtern.c ../userdefs.h
LYCookie.o: ../userdefs.h

reply via email to

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