lynx-dev
[Top][All Lists]
Advanced

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

lynx-dev DJGPP port


From: Gisle Vanem
Subject: lynx-dev DJGPP port
Date: Mon, 7 Jan 2002 18:30:07 +0100 (MET)

The DJGPP port of Lynx once used to compile with DJ Delorie's tcp/ip
library. It's no longer the case; Watt-32 is required. Hence the
following diffs assumes WATT32 is defined when DJGPP (or __DJGPP__)
is defined.

Once other diff; Including <conio.h> in lycurses.c causes a parse
error. gettext is a function in <conio.h>

--- ./lynx285.d7/installa   Wed Jan  2 01:30:08 2002
+++ ./installa  Mon Jan  7 18:16:38 2002
@@ -866,7 +866,7 @@
      
     +void sig_handler_watt (int sig)
     +{
-    +  sig_handler (int sig);
+    +   sig_handler (sig);
     +}
     +
      /*

--- lynx285.d7/www/library/implemen/htftp.c       Sat Oct  6 22:02:28 2001
+++ ./www/library/implemen/htftp.c   Mon Jan  7 15:35:08 2002
@@ -57,10 +57,6 @@
 **             same time.
 */
 
-#if defined(DJGPP) && !defined(WATT32)
-#define u_long unsigned long
-#endif
-
 #include <HTUtils.h>
 
 #include <HTAlert.h>

--- lynx285.d7/www/library/implemen/httcp.c       Sat Oct  6 22:02:28 2001
+++ ./www/library/implemen/httcp.c   Mon Jan  7 15:28:32 2002
@@ -32,7 +32,7 @@
 #include <resolv.h>
 #endif
 
-#if defined(__DJGPP__) && defined (WATT32)
+#ifdef __DJGPP__
 #include <netdb.h>
 #endif /* __DJGPP__ */
 
@@ -381,8 +381,6 @@
 
 PUBLIC int lynx_nsl_status = HT_OK;
 
-#if !( defined(__DJGPP__) && !defined(WATT32) )    /* much excluded! */
-
 #define DEBUG_HOSTENT          /* disable in case of problems */
 #define DEBUG_HOSTENT_CHILD  /* for NSL_FORK, may screw up trace file */
 
@@ -1163,8 +1161,6 @@
     return NULL;
 }
 
-#endif /* from here on DJGPP without WATT32 joins us again. */
-
 
 /*     Parse a network node address and port
 **     -------------------------------------
@@ -1270,10 +1266,6 @@
     */
     if (dotcount_ip == 3)   /* Numeric node address: */
     {
-
-#if defined(__DJGPP__) && !defined(WATT32)
-       soc_in->sin_addr.s_addr = htonl(aton(host));
-#else
 #ifdef DGUX_OLD
        soc_in->sin_addr.s_addr = inet_addr(host).s_addr; /* See arpa/inet.h */
 #else
@@ -1293,7 +1285,6 @@
 #endif /* HAVE_INET_ATON */
 #endif /* GUSI */
 #endif /* DGUX_OLD */
-#endif /* __DJGPP__ && !WATT32 */
 #ifndef _WINDOWS_NSL
        FREE(host);
 #endif /* _WINDOWS_NSL */
@@ -1304,21 +1295,11 @@
        CTRACE((tfp, "HTParseInet: Calling LYGetHostByName(%s)\n", host));
 #endif /* MVS */
 
-#if defined(__DJGPP__) && !defined(WATT32)
-       if (!valid_hostname(host)) {
-           FREE(host);
-           return HT_NOT_ACCEPTABLE; /* only HTDoConnect checks this. */
-       }
-       soc_in->sin_addr.s_addr = htonl(resolve(host));
-       if (soc_in->sin_addr.s_addr == 0) {
-           goto failed;
-       }
-#else /* !(__DJGPP__ && !WATT32) */
 #ifdef _WINDOWS_NSL
        phost = LYGetHostByName(host);  /* See above */
        if (!phost) goto failed;
        memcpy((void *)&soc_in->sin_addr, phost->h_addr, phost->h_length);
-#else /* !(__DJGPP__ && !WATT32) && !_WINDOWS_NSL */
+#else /* !_WINDOWS_NSL */
        {
            struct hostent  *phost;
            phost = LYGetHostByName(host);      /* See above */
@@ -1343,7 +1324,7 @@
 #endif /* VMS && CMU_TCP */
        }
 #endif /* _WINDOWS_NSL */
-#endif /* __DJGPP__ && !WATT32 */
+
 #ifndef _WINDOWS_NSL
        FREE(host);
 #endif /* _WINDOWS_NSL */


--- lynx285.d7/www/library/implemen/httcp.h       Fri Sep 22 02:21:58 2000
+++ ./www/library/implemen/httcp.h   Mon Jan  7 15:22:54 2002
@@ -87,11 +87,7 @@
 */
 extern int lynx_nsl_status;
 
-#if defined(__DJGPP__) && !defined(WATT32)
-#define LYGetHostByName(host) resolv(host) /* we'll use it the same way */
-#else
 extern struct hostent * LYGetHostByName PARAMS((char * str));
-#endif
 
 /*      Get Name of This Machine
 **      ------------------------

--- lynx285.d7/www/library/implemen/httelnet.c    Mon Nov 19 01:37:14 2001
+++ ./www/library/implemen/httelnet.c        Mon Jan  7 15:34:24 2002
@@ -33,10 +33,6 @@
 
 #include <LYStrings.h>
 #include <LYLeaks.h>
-#ifdef __DJGPP__
-#include <sys/exceptn.h>
-#include <go32.h>
-#endif /* __DJGPP__ */
 
 PRIVATE void do_system ARGS1(char *, command)
 {
@@ -208,22 +204,7 @@
            break;
        }
 
-#ifdef __DJGPP__
-#ifdef WATT32
-       _eth_release();
-#endif /* WATT32 */
-       __djgpp_set_ctrl_c(0);
-       _go32_want_ctrl_break(1);
-#endif /* __DJGPP__ */
-       do_system(command);
-#ifdef __DJGPP__
-       __djgpp_set_ctrl_c(1);
-       _go32_want_ctrl_break(0);
-#ifdef WATT32
-       _eth_init();
-#endif /* WATT32 */
-#endif /* __DJGPP__ */
-
+        LYSystem(command);
 #define TELNET_DONE
 #endif /* unix */
 
--- lynx285.d7/www/library/implemen/http.c        Wed Jan  2 01:30:08 2002
+++ ./www/library/implemen/http.c    Mon Jan  7 15:30:14 2002
@@ -7,9 +7,6 @@
 */
 
 #include <HTUtils.h>
-#if defined(__DJGPP__) && defined (WATT32)
-#include <tcp.h>
-#endif /* __DJGPP__ */
 #include <HTTP.h>
 #include <LYUtils.h>
 
--- lynx285.d7/www/library/implemen/www_tcp.h     Sun Jan  6 19:56:18 2002
+++ ./www/library/implemen/www_tcp.h Mon Jan  7 15:22:12 2002
@@ -558,7 +558,6 @@
 #include <errno.h>
 #include <sys/types.h>
 #include <io.h>
-#ifdef WATT32
 #include <sys/socket.h>
 #include <arpa/inet.h>
 #include <tcp.h>
@@ -566,9 +565,6 @@
 #undef word
 #endif /* word */
 #define select select_s
-#else
-#include <socket.h>
-#endif /* WATT32 */
 
 #undef NETWRITE
 #define NETWRITE write_s
@@ -579,9 +575,6 @@
 #ifdef UNIX
 #undef UNIX
 #endif /* UNIX */
-#ifndef WATT32
-#define getsockname getsockname_s
-#endif /* !WATT32 */
 #ifdef HAVE_GETTEXT
 #define gettext gettext__
 #endif

--- ./lynx285.d7/src/lyclean.c      Wed Jan  2 01:30:08 2002
+++ ./src/lyclean.c Mon Jan  7 15:36:38 2002
@@ -13,9 +13,9 @@
 #include <LYexit.h>
 #include <LYLeaks.h>
 
-#ifdef WATT32
+#ifdef DJGPP
 extern void sig_handler_watt(int);
-#endif /* WATT32 */
+#endif /* DJGPP */
 
 #ifdef VMS
 BOOLEAN HadVMSInterrupt = FALSE;
@@ -33,17 +33,17 @@
        /*
         * Need to rearm the signal.
         */
-#ifdef WATT32
+#ifdef DJGPP
        if (wathndlcbrk) {
            sig_handler_watt(sig);      /* Use WATT-32 signal handler */
        }                               /* Requires patch to WATT-32 */
-#endif /* WATT32 */
+#endif /* DJGPP */
        signal(SIGINT, cleanup_sig);
        sigint = TRUE;
-#ifdef WATT32
+#ifdef DJGPP
        _eth_release();
        _eth_init();
-#endif /* WATT32 */
+#endif /* DJGPP */
        return;
     }
 #endif /* IGNORE_CTRL_C */

--- ./lynx285.d7/src/lycurses.c     Wed Jan  2 01:30:08 2002
+++ ./src/lycurses.c        Mon Jan  7 15:44:36 2002
@@ -2,7 +2,6 @@
 #include <HTAlert.h>
 
 #ifdef __DJGPP__
-#include <conio.h>
 /* The conio.h distributed with GNU gettext package may redefine gettext() to
  * _conio_gettext().  Restore our definition.
  */
@@ -874,11 +873,7 @@
 #endif /* (VMS || REAL_UNIX_SYSTEM) && !__CYGWIN__  */
     }
 #ifdef __DJGPP__
-#ifdef WATT32
     _eth_init();
-#else
-    else sock_init();
-#endif /* WATT32 */
 #endif /* __DJGPP__ */
 
     slinit = 1;
@@ -1059,11 +1054,7 @@
 #endif /* USE_COLOR_TABLE */
     }
 #ifdef __DJGPP__
-#ifdef WATT32
     _eth_init();
-#else
-    else sock_init();
-#endif /* WATT32 */
 #endif /* __DJGPP__ */
 #endif /* not VMS */
 
@@ -1256,12 +1247,9 @@
     if (LYCursesON)
        echo();
 #ifdef __DJGPP__
-#ifdef WATT32
     _eth_release();
-#else
-    sock_exit();
-#endif /* WATT32 */
 #endif /* __DJGPP__ */
+
 #if defined(DOSPATH) && !(defined(USE_SLANG) || _WIN_CC)
     clrscr();
 #else

--- ./lynx285.d7/src/lyutils.c      Wed Jan  2 01:30:08 2002
+++ ./src/lyutils.c Mon Jan  7 15:43:32 2002
@@ -4382,13 +4382,7 @@
        FREE(MsgStr);
        return GotHost;
     }
-    else if (LYCursesON &&
-#if defined(__DJGPP__) && !defined(WATT32)
-       HTCheckForInterrupt()
-#else /* normal systems */
-       (lynx_nsl_status == HT_INTERRUPTED)
-#endif
-       )
+    else if (LYCursesON && (lynx_nsl_status == HT_INTERRUPTED))
     {
        /*
         *  Give the user chance to interrupt lookup cycles. - KW & FM
@@ -4493,11 +4487,7 @@
                /*
                 *  Give the user chance to interrupt lookup cycles. - KW
                 */
-#if defined(__DJGPP__) && !defined(WATT32)
-               if (LYCursesON && HTCheckForInterrupt())
-#else /* normal systems */
                if (LYCursesON && (lynx_nsl_status == HT_INTERRUPTED))
-#endif
                {
                    CTRACE((tfp,
        "LYExpandHostForURL: Interrupted while '%s' failed to resolve.\n",
@@ -7375,7 +7365,7 @@
 PUBLIC void LYOpenlog ARGS1(
        CONST char *, banner)
 {
-#if defined(WATT32)
+#if defined(DJGPP)
     openlog("lynx", LOG_PID|LOG_NDELAY, LOG_LOCAL5);
 #else
     openlog("lynx", LOG_PID, LOG_LOCAL5);

--- ./lynx285.d7/src/lyutils.h      Wed Jan  2 01:30:08 2002
+++ ./src/lyutils.h Mon Jan  7 15:42:08 2002
@@ -284,11 +284,7 @@
  * syslog() facility
  */
 #if !defined(VMS) && defined(SYSLOG_REQUESTED_URLS)
-#ifdef WATT32
-#include <sys/syslog.h>
-#else
 #include <syslog.h>
-#endif
 
 extern void LYOpenlog  PARAMS((CONST char *banner));
 extern void LYSyslog   PARAMS((char *arg));

-------------------

Gisle V.


; To UNSUBSCRIBE: Send "unsubscribe lynx-dev" to address@hidden

reply via email to

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