about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/HTAlert.c14
-rw-r--r--src/LYCgi.c4
-rw-r--r--src/LYCurses.c51
-rw-r--r--src/LYGlobalDefs.h10
-rw-r--r--src/LYIcon.rc1
-rw-r--r--src/LYMain.c12
-rw-r--r--src/LYPrettySrc.c6
-rw-r--r--src/LYPrettySrc.h7
-rw-r--r--src/LYStrings.c4
-rw-r--r--src/LYexit.c5
-rw-r--r--src/UCAux.c7
-rw-r--r--src/Xsystem.c18
-rw-r--r--src/makefile.in5
13 files changed, 85 insertions, 59 deletions
diff --git a/src/HTAlert.c b/src/HTAlert.c
index e0e3a581..ee83f3af 100644
--- a/src/HTAlert.c
+++ b/src/HTAlert.c
@@ -1,5 +1,5 @@
 /*
- * $LynxId: HTAlert.c,v 1.83 2009/01/03 00:43:04 tom Exp $
+ * $LynxId: HTAlert.c,v 1.84 2009/03/10 15:22:07 tom Exp $
  *
  *	Displaying messages and getting input for Lynx Browser
  *	==========================================================
@@ -178,15 +178,15 @@ static const char *sprint_bytes(char *s, off_t n, const char *was_units)
 
     if (LYTransferRate == rateKB || LYTransferRate == rateEtaKB_maybe) {
 	if (n >= 10 * kb_units) {
-	    sprintf(s, "%" PRI_off_t, n / kb_units);
+	    sprintf(s, "%" PRI_off_t, CAST_off_t(n / kb_units));
 	} else if (n > 999) {	/* Avoid switching between 1016b/s and 1K/s */
 	    sprintf(s, "%.2g", ((double) n) / kb_units);
 	} else {
-	    sprintf(s, "%" PRI_off_t, n);
+	    sprintf(s, "%" PRI_off_t, CAST_off_t(n));
 	    u = HTProgressUnits(rateBYTES);
 	}
     } else {
-	sprintf(s, "%" PRI_off_t, n);
+	sprintf(s, "%" PRI_off_t, CAST_off_t(n));
     }
 
     if (!was_units || was_units != u)
@@ -864,11 +864,11 @@ BOOL HTConfirmCookie(domain_entry * de, const char *server,
 	space_free = (LYcolLimit
 		      - (LYstrCells(prompt)
 			 - 10)	/* %s and %.*s and %.*s chars */
-		      - (int) strlen(server));
+		      -(int) strlen(server));
 	if (space_free < 0)
 	    space_free = 0;
-	namelen =  (int) strlen(name);
-	valuelen =  (int) strlen(value);
+	namelen = (int) strlen(name);
+	valuelen = (int) strlen(value);
 	if ((namelen + valuelen) > space_free) {
 	    /*
 	     * Argh...  there isn't enough space on our single line for
diff --git a/src/LYCgi.c b/src/LYCgi.c
index 2274234c..fbd4822e 100644
--- a/src/LYCgi.c
+++ b/src/LYCgi.c
@@ -1,5 +1,5 @@
 /*
- * $LynxId: LYCgi.c,v 1.54 2009/01/01 22:39:06 tom Exp $
+ * $LynxId: LYCgi.c,v 1.55 2009/03/10 00:05:59 tom Exp $
  *                   Lynx CGI support                              LYCgi.c
  *                   ================
  *
@@ -58,7 +58,7 @@ static unsigned envc_size = 0;	/* Slots in environment array */
 static unsigned envc = 0;	/* Slots used so far */
 static HTList *alloced = NULL;
 
-#ifdef LYNXCGI_LINKS
+#if defined(LYNXCGI_LINKS) && !defined(__MINGW32__)
 static char *user_agent = NULL;
 static char *server_software = NULL;
 static char *accept_language = NULL;
diff --git a/src/LYCurses.c b/src/LYCurses.c
index 8edde2fe..e272269e 100644
--- a/src/LYCurses.c
+++ b/src/LYCurses.c
@@ -1,4 +1,4 @@
-/* $LynxId: LYCurses.c,v 1.138 2009/01/20 01:03:02 tom Exp $ */
+/* $LynxId: LYCurses.c,v 1.140 2009/03/10 15:33:34 tom Exp $ */
 #include <HTUtils.h>
 #include <HTAlert.h>
 
@@ -8,6 +8,10 @@
 #endif /* UNIX */
 #endif /* __MINGW32__ */
 
+#ifdef __DJGPP__
+#include <pc.h>
+#endif /* __DJGPP__ */
+
 #include <LYCurses.h>
 #include <LYStyle.h>
 #include <LYUtils.h>
@@ -578,14 +582,14 @@ static BOOL lynx_called_initscr = FALSE;
 static struct {
     int fg, dft_fg, bg, dft_bg;
 } lynx_color_cfg[] = {
-    /*0*/ { COLOR_CFG(DEFAULT_FG),     COLOR_CFG(DEFAULT_BG)},
-    /*1*/ { COLOR_CFG(COLOR_BLUE),     COLOR_CFG(DEFAULT_BG)},
-    /*2*/ { COLOR_CFG(COLOR_YELLOW+8), COLOR_CFG(COLOR_BLUE)},
-    /*3*/ { COLOR_CFG(COLOR_GREEN),    COLOR_CFG(DEFAULT_BG)},
-    /*4*/ { COLOR_CFG(COLOR_MAGENTA),  COLOR_CFG(DEFAULT_BG)},
-    /*5*/ { COLOR_CFG(COLOR_BLUE),     COLOR_CFG(DEFAULT_BG)},
-    /*6*/ { COLOR_CFG(COLOR_RED),      COLOR_CFG(DEFAULT_BG)},
-    /*7*/ { COLOR_CFG(COLOR_MAGENTA),  COLOR_CFG(COLOR_CYAN)}
+    /*0*/ { COLOR_CFG(DEFAULT_FG),       COLOR_CFG(DEFAULT_BG)},
+    /*1*/ { COLOR_CFG(COLOR_BLUE),       COLOR_CFG(DEFAULT_BG)},
+    /*2*/ { COLOR_CFG((COLOR_YELLOW)+8), COLOR_CFG(COLOR_BLUE)},
+    /*3*/ { COLOR_CFG(COLOR_GREEN),      COLOR_CFG(DEFAULT_BG)},
+    /*4*/ { COLOR_CFG(COLOR_MAGENTA),    COLOR_CFG(DEFAULT_BG)},
+    /*5*/ { COLOR_CFG(COLOR_BLUE),       COLOR_CFG(DEFAULT_BG)},
+    /*6*/ { COLOR_CFG(COLOR_RED),        COLOR_CFG(DEFAULT_BG)},
+    /*7*/ { COLOR_CFG(COLOR_MAGENTA),    COLOR_CFG(COLOR_CYAN)}
 };
 /* *INDENT-ON* */
 
@@ -1460,21 +1464,32 @@ void stop_curses(void)
     _eth_release();
 #endif /* __DJGPP__ */
 
-#if defined(DOSPATH) && !(defined(USE_SLANG) || defined(_WIN_CC))
+/* ifdef's for non-Unix curses or slang */
+#if defined(__MINGW32__)
+    chtype bb;
+
+    bb = getbkgd(stdscr);
+    bkgdset(0);
+    clear();
+    refresh();
+    bkgdset(bb);
+#if defined(PDCURSES)
+    endwin();
+#endif /* PDCURSES */
+
+#elif defined(DOSPATH) && !(defined(USE_SLANG) || defined(_WIN_CC))
+
 #if defined(PDCURSES)
     endwin();
-#else /* !PDCURSES */
+#endif /* PDCURSES */
+
 #ifdef __DJGPP__
     ScreenClear();
 #else /* some flavor of win32?  */
-#ifdef __MINGW32__
-    clear();
-#else
     clrscr();
-#endif
 #endif /* win32 */
-#endif /* PDCURSES */
-#else
+
+#else /* Unix, etc */
 
     if (LYCursesON == TRUE) {
 	lynx_nl2crlf(TRUE);
@@ -1494,7 +1509,7 @@ void stop_curses(void)
     }
 
     fflush(stdout);
-#endif /* defined(DOSPATH) && !(defined(USE_SLANG) || defined(_WIN_CC)) */
+#endif /* ifdef's for non-Unix curses or slang */
     fflush(stderr);
 
     LYCursesON = FALSE;
diff --git a/src/LYGlobalDefs.h b/src/LYGlobalDefs.h
index a989b365..b8d7fea3 100644
--- a/src/LYGlobalDefs.h
+++ b/src/LYGlobalDefs.h
@@ -1,5 +1,5 @@
 /*
- * $LynxId: LYGlobalDefs.h,v 1.115 2008/12/26 18:25:27 tom Exp $
+ * $LynxId: LYGlobalDefs.h,v 1.117 2009/03/11 00:29:55 tom Exp $
  *
  * global variable definitions
  */
@@ -562,7 +562,7 @@ extern "C" {
 #endif
 
 #ifdef EXP_JUSTIFY_ELTS
-    extern BOOL ok_justify;
+    extern BOOLEAN ok_justify;
     extern int justify_max_void_percent;
 #endif
 
@@ -585,13 +585,13 @@ extern "C" {
 #endif
     extern BOOLEAN LYUseTraceLog;	/* Use a TRACE log?              */
 
-    extern BOOL force_empty_hrefless_a;
+    extern BOOLEAN force_empty_hrefless_a;
     extern int connect_timeout;
     extern int reading_timeout;
 
 #ifdef TEXTFIELDS_MAY_NEED_ACTIVATION
     extern BOOL textfields_need_activation;
-    extern BOOL textfields_activation_option;
+    extern BOOLEAN textfields_activation_option;
 
 #ifdef INACTIVE_INPUT_STYLE_VH
     extern BOOL textinput_redrawn;
@@ -629,6 +629,8 @@ extern "C" {
     extern BOOLEAN system_is_NT;
     extern char windows_drive[4];
     extern int lynx_timeout;
+    CRITICAL_SECTION critSec_DNS;
+    CRITICAL_SECTION critSec_READ;
 #endif				/* _WINDOWS */
 
     extern BOOLEAN show_cfg;
diff --git a/src/LYIcon.rc b/src/LYIcon.rc
new file mode 100644
index 00000000..9b6054c1
--- /dev/null
+++ b/src/LYIcon.rc
@@ -0,0 +1 @@
+100	ICON	"../samples/lynx.ico"
diff --git a/src/LYMain.c b/src/LYMain.c
index 9cd31114..83c879a4 100644
--- a/src/LYMain.c
+++ b/src/LYMain.c
@@ -1,5 +1,5 @@
 /*
- * $LynxId: LYMain.c,v 1.196 2009/01/25 18:46:17 tom Exp $
+ * $LynxId: LYMain.c,v 1.198 2009/03/11 00:29:55 tom Exp $
  */
 #include <HTUtils.h>
 #include <HTTP.h>
@@ -57,7 +57,7 @@
 #include <io.h>
 #endif
 
-#ifdef LOCALE
+#if defined(LOCALE) && !defined(HAVE_LIBINTL_H)
 #undef gettext			/* Solaris locale.h prototypes gettext() */
 #include <locale.h>
 #ifndef HAVE_GETTEXT
@@ -530,7 +530,7 @@ int LYHiddenLinks = HIDDENLINKS_SEPARATE;	/* Show hidden links? */
 char *SSL_cert_file = NULL;	/* Default CA CERT file */
 
 int Old_DTD = NO;
-static BOOL DTD_recovery = NO;
+static BOOLEAN DTD_recovery = NO;
 
 #ifndef NO_LYNX_TRACE
 FILE *LYTraceLogFP = NULL;	/* Pointer for TRACE log  */
@@ -559,7 +559,7 @@ int connect_timeout = 18000; /*=180000*0.1 - used in HTDoConnect.*/
 int reading_timeout = 18000; /*=180000*0.1 - used in HTDoConnect.*/
 
 #ifdef EXP_JUSTIFY_ELTS
-BOOL ok_justify = FALSE;
+BOOLEAN ok_justify = FALSE;
 int justify_max_void_percent = 35;
 #endif
 
@@ -576,11 +576,11 @@ int scrsize_x = 0;
 int scrsize_y = 0;
 #endif
 
-BOOL force_empty_hrefless_a = FALSE;
+BOOLEAN force_empty_hrefless_a = FALSE;
 
 #ifdef TEXTFIELDS_MAY_NEED_ACTIVATION
 BOOL textfields_need_activation = FALSE;
-BOOL textfields_activation_option = FALSE;
+BOOLEAN textfields_activation_option = FALSE;
 #endif
 
 BOOLEAN textfield_prompt_at_left_edge = FALSE;
diff --git a/src/LYPrettySrc.c b/src/LYPrettySrc.c
index c2228745..744d96cc 100644
--- a/src/LYPrettySrc.c
+++ b/src/LYPrettySrc.c
@@ -1,5 +1,5 @@
 /*
- * $LynxId: LYPrettySrc.c,v 1.19 2009/01/01 22:20:25 tom Exp $
+ * $LynxId: LYPrettySrc.c,v 1.20 2009/03/11 00:30:39 tom Exp $
  *
  * HTML source syntax highlighting
  * by Vlad Harchev <hvv@hippo.ru>
@@ -20,7 +20,7 @@ BOOL psrc_convert_string = FALSE;
 BOOL psrc_view = FALSE;		/* this is read by SGML_put_character - TRUE
 
 				   when viewing pretty source */
-BOOL LYpsrc = FALSE;		/* this tells what will be shown on '\':
+BOOLEAN LYpsrc = FALSE;		/* this tells what will be shown on '\':
 
 				   if TRUE, then pretty source, normal source view otherwise. Toggled by
 				   -prettysrc commandline option.  */
@@ -32,7 +32,7 @@ BOOL mark_htext_as_source = FALSE;
   /* tagspecs from lynx.cfg are read here. After .lss file is read (is with lss
      support), the style cache and markup are created before entering the
      mainloop. */
-BOOL psrcview_no_anchor_numbering = FALSE;
+BOOLEAN psrcview_no_anchor_numbering = FALSE;
 static const char *HTL_tagspecs_defaults[HTL_num_lexemes] =
 {
  /* these values are defaults. They are also listed in comments of distibution's
diff --git a/src/LYPrettySrc.h b/src/LYPrettySrc.h
index 9886a49d..0031eb7c 100644
--- a/src/LYPrettySrc.h
+++ b/src/LYPrettySrc.h
@@ -1,3 +1,6 @@
+/*
+ * $LynxId: LYPrettySrc.h,v 1.10 2009/03/11 00:40:00 tom Exp $
+ */
 #ifndef LYPrettySrc_H
 #define LYPrettySrc_H
 
@@ -13,7 +16,7 @@ extern "C" {
     /*whether HTML_put_string should convert string passed with 
        TRANSLATE_AND_UNESCAPE_TO_STD */
     extern BOOL psrc_view;
-    extern BOOL LYpsrc;
+    extern BOOLEAN LYpsrc;
 
 /*
  * This is used for tracking down whether the SGML engine was initialized
@@ -80,7 +83,7 @@ extern "C" {
     extern int tagname_transform;
     extern int attrname_transform;
 
-    extern BOOL psrcview_no_anchor_numbering;
+    extern BOOLEAN psrcview_no_anchor_numbering;
 
 #ifdef __cplusplus
 }
diff --git a/src/LYStrings.c b/src/LYStrings.c
index 17ed7311..943a2eba 100644
--- a/src/LYStrings.c
+++ b/src/LYStrings.c
@@ -1,4 +1,4 @@
-/* $LynxId: LYStrings.c,v 1.163 2009/01/25 22:06:08 tom Exp $ */
+/* $LynxId: LYStrings.c,v 1.164 2009/03/11 00:31:09 tom Exp $ */
 #include <HTUtils.h>
 #include <HTCJK.h>
 #include <UCAux.h>
@@ -5299,7 +5299,7 @@ int LYscanFloat2(const char **source, float *result)
 
 	if (*src != '.') {
 	    temp = NULL;
-	    *result = strtol(src, &temp, 10);
+	    *result = (float) strtol(src, &temp, 10);
 	    src = temp;
 	}
 	if (src != 0 && *src == '.') {
diff --git a/src/LYexit.c b/src/LYexit.c
index 37d7b519..296f61f7 100644
--- a/src/LYexit.c
+++ b/src/LYexit.c
@@ -1,5 +1,5 @@
 /*
- * $LynxId: LYexit.c,v 1.34 2008/12/29 01:03:20 tom Exp $
+ * $LynxId: LYexit.c,v 1.35 2009/03/10 00:12:52 tom Exp $
  *
  *	Copyright (c) 1994, University of Kansas, All Rights Reserved
  *	(most of this file was rewritten in 1996 and 2004).
@@ -87,9 +87,6 @@ void LYexit(int status)
 {
 #ifndef VMS			/*  On VMS, the VMSexit() handler does these. - FM */
 #ifdef _WINDOWS
-    extern CRITICAL_SECTION critSec_DNS;	/* 1998/09/03 (Thu) 22:01:56 */
-    extern CRITICAL_SECTION critSec_READ;	/* 1998/09/03 (Thu) 22:01:56 */
-
     DeleteCriticalSection(&critSec_DNS);
     DeleteCriticalSection(&critSec_READ);
 
diff --git a/src/UCAux.c b/src/UCAux.c
index 3a8e9158..597d680d 100644
--- a/src/UCAux.c
+++ b/src/UCAux.c
@@ -1,5 +1,5 @@
 /*
- * $LynxId: UCAux.c,v 1.39 2009/01/03 18:46:33 tom Exp $
+ * $LynxId: UCAux.c,v 1.40 2009/03/10 21:13:12 tom Exp $
  */
 #include <HTUtils.h>
 
@@ -172,6 +172,11 @@ void UCSetTransParams(UCTransParams * pT, int cs_in,
     pT->transp = (BOOL) (!strcmp(p_in->MIMEname, "x-transparent") ||
 			 !strcmp(p_out->MIMEname, "x-transparent"));
 
+    /*
+     * UCS-2 is handled as a special case in SGML_write().
+     */
+    pT->ucs_mode = 0;
+
     if (pT->transp) {
 	/*
 	 * Set up the structure for "transparent".  - FM
diff --git a/src/Xsystem.c b/src/Xsystem.c
index 16509db0..fa3e6b96 100644
--- a/src/Xsystem.c
+++ b/src/Xsystem.c
@@ -1,4 +1,4 @@
-/* $LynxId: Xsystem.c,v 1.22 2009/02/01 21:22:55 tom Exp $
+/* $LynxId: Xsystem.c,v 1.23 2009/03/10 15:21:42 tom Exp $
  *	like system("cmd") but return with exit code of "cmd"
  *	for Turbo-C/MS-C/LSI-C
  *  This code is in the public domain.
@@ -26,6 +26,7 @@
  */
 #include <LYUtils.h>
 #include <LYStrings.h>
+#include <LYGlobalDefs.h>
 
 #ifdef DOSPATH
 #include <io.h>
@@ -100,10 +101,6 @@ static char *NEAR xrealloc(void *p, size_t n)
 
 static int NEAR is_builtin_command(char *s)
 {
-#ifdef WIN_EX
-    extern int system_is_NT;	/* 1997/11/05 (Wed) 22:10:35 */
-#endif
-
     static char *cmdtab[] =
     {
 	"dir", "type", "rem", "ren", "rename", "erase", "del",
@@ -172,7 +169,7 @@ static PRO *NEAR pars1c(char *s)
     int q;
 
     pp = (PRO *) xmalloc(sizeof(PRO));
-    for (q = 0; q < TABLESIZE(pp->ored); q++)
+    for (q = 0; q < (int) TABLESIZE(pp->ored); q++)
 	pp->ored[q] = q;
     while (isspc(*s))
 	s++;
@@ -430,7 +427,7 @@ static void NEAR redswitch(PRO * p)
 {
     int d;
 
-    for (d = 0; d < TABLESIZE(p->ored); d++) {
+    for (d = 0; d < (int) TABLESIZE(p->ored); d++) {
 	if (d != p->ored[d]) {
 	    p->sred[d] = dup(d);
 	    dup2(p->ored[d], d);
@@ -442,7 +439,7 @@ static void NEAR redunswitch(PRO * p)
 {
     int d;
 
-    for (d = 0; d < TABLESIZE(p->ored); d++) {
+    for (d = 0; d < (int) TABLESIZE(p->ored); d++) {
 	if (d != p->ored[d]) {
 	    dup2(p->sred[d], d);
 	    close(p->sred[d]);
@@ -457,7 +454,10 @@ int xsystem(char *cmd)
     int psstdin, psstdout;
     int rdstdin, rdstdout;
     int rc = 0;
+
+#if USECMDLINE
     static char *cmdline = 0;
+#endif
 
 #ifdef SH_EX			/* 1997/11/01 (Sat) 10:04:03 add by JH7AYN */
     pif = cmd;
@@ -528,7 +528,7 @@ int xsystem(char *cmd)
     return rc < 0 ? 0xFF00 : rc;
 }
 
-int exec_command(char *cmd, int wait_flag)
+int exec_command(char *cmd, int wait_flag GCC_UNUSED)
 {
     int rc;
 
diff --git a/src/makefile.in b/src/makefile.in
index fc4bf7b5..4183bf08 100644
--- a/src/makefile.in
+++ b/src/makefile.in
@@ -1,4 +1,4 @@
-# $LynxId: makefile.in,v 1.58 2008/12/30 01:18:43 tom Exp $
+# $LynxId: makefile.in,v 1.59 2009/03/09 22:43:29 Doug.Kaufman Exp $
 # template-makefile for Lynx src directory
 
 SHELL		= @CONFIG_SHELL@
@@ -149,6 +149,9 @@ LYUtils$o :		$(top_srcdir)/userdefs.h
 LYmktime$o :		$(top_srcdir)/userdefs.h
 LYrcFile$o :		$(top_srcdir)/userdefs.h
 
+LYIcon$o:
+	windres -i LYIcon.rc -o LYIcon$o -O coff
+
 CHRTR= chrtrans/
 
 TABLES= \