about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--CHANGES48
-rw-r--r--LYMessages_en.h2
-rw-r--r--WWW/Library/Implementation/HTAABrow.c1
-rw-r--r--WWW/Library/Implementation/HTAABrow.h4
-rw-r--r--WWW/Library/Implementation/HTAAFile.c6
-rw-r--r--WWW/Library/Implementation/HTAAFile.h3
-rw-r--r--WWW/Library/Implementation/HTAAProt.c1
-rw-r--r--WWW/Library/Implementation/HTAAProt.h3
-rw-r--r--WWW/Library/Implementation/HTAAServ.c2
-rw-r--r--WWW/Library/Implementation/HTAAServ.h3
-rw-r--r--WWW/Library/Implementation/HTAAUtil.c3
-rw-r--r--WWW/Library/Implementation/HTAAUtil.h44
-rw-r--r--WWW/Library/Implementation/HTACL.c3
-rw-r--r--WWW/Library/Implementation/HTACL.h3
-rw-r--r--WWW/Library/Implementation/HTAccess.c24
-rw-r--r--WWW/Library/Implementation/HTAccess.h4
-rw-r--r--WWW/Library/Implementation/HTAnchor.c8
-rw-r--r--WWW/Library/Implementation/HTAssoc.c3
-rw-r--r--WWW/Library/Implementation/HTAssoc.h4
-rw-r--r--WWW/Library/Implementation/HTAtom.c15
-rw-r--r--WWW/Library/Implementation/HTAtom.h3
-rw-r--r--WWW/Library/Implementation/HTAuth.c1
-rw-r--r--WWW/Library/Implementation/HTAuth.h3
-rw-r--r--WWW/Library/Implementation/HTBTree.c88
-rw-r--r--WWW/Library/Implementation/HTBTree.h9
-rw-r--r--WWW/Library/Implementation/HTCJK.h2
-rw-r--r--WWW/Library/Implementation/HTChunk.c2
-rw-r--r--WWW/Library/Implementation/HTChunk.h8
-rw-r--r--WWW/Library/Implementation/HTDOS.c4
-rw-r--r--WWW/Library/Implementation/HTFTP.c3
-rw-r--r--WWW/Library/Implementation/HTFTP.h3
-rw-r--r--WWW/Library/Implementation/HTFWriter.c2
-rw-r--r--WWW/Library/Implementation/HTFWriter.h3
-rw-r--r--WWW/Library/Implementation/HTFile.c16
-rw-r--r--WWW/Library/Implementation/HTFinger.c3
-rw-r--r--WWW/Library/Implementation/HTFormat.c3
-rw-r--r--WWW/Library/Implementation/HTFormat.h3
-rw-r--r--WWW/Library/Implementation/HTGopher.c5
-rw-r--r--WWW/Library/Implementation/HTGroup.c3
-rw-r--r--WWW/Library/Implementation/HTGroup.h3
-rw-r--r--WWW/Library/Implementation/HTHistory.c1
-rw-r--r--WWW/Library/Implementation/HTInit.h10
-rw-r--r--WWW/Library/Implementation/HTLex.c1
-rw-r--r--WWW/Library/Implementation/HTLex.h7
-rw-r--r--WWW/Library/Implementation/HTList.c3
-rw-r--r--WWW/Library/Implementation/HTList.h4
-rw-r--r--WWW/Library/Implementation/HTMIME.c2
-rw-r--r--WWW/Library/Implementation/HTMLDTD.h3
-rw-r--r--WWW/Library/Implementation/HTMLGen.c3
-rw-r--r--WWW/Library/Implementation/HTNews.c5
-rw-r--r--WWW/Library/Implementation/HTParse.c3
-rw-r--r--WWW/Library/Implementation/HTParse.h2
-rw-r--r--WWW/Library/Implementation/HTPasswd.c4
-rw-r--r--WWW/Library/Implementation/HTPasswd.h3
-rw-r--r--WWW/Library/Implementation/HTPlain.c4
-rw-r--r--WWW/Library/Implementation/HTRules.c5
-rw-r--r--WWW/Library/Implementation/HTRules.h2
-rw-r--r--WWW/Library/Implementation/HTStream.h2
-rw-r--r--WWW/Library/Implementation/HTString.c5
-rw-r--r--WWW/Library/Implementation/HTString.h2
-rw-r--r--WWW/Library/Implementation/HTStyle.c3
-rw-r--r--WWW/Library/Implementation/HTStyle.h3
-rw-r--r--WWW/Library/Implementation/HTTCP.c3
-rw-r--r--WWW/Library/Implementation/HTTCP.h6
-rw-r--r--WWW/Library/Implementation/HTTP.c2
-rw-r--r--WWW/Library/Implementation/HTTelnet.c3
-rw-r--r--WWW/Library/Implementation/HTUU.h5
-rw-r--r--WWW/Library/Implementation/HTUtils.h36
-rw-r--r--WWW/Library/Implementation/HTVMSUtils.c10
-rw-r--r--WWW/Library/Implementation/HTVMSUtils.h8
-rw-r--r--WWW/Library/Implementation/HTVMS_WaisProt.c81
-rw-r--r--WWW/Library/Implementation/HTVMS_WaisProt.h124
-rw-r--r--WWW/Library/Implementation/HTVMS_WaisUI.c534
-rw-r--r--WWW/Library/Implementation/HTVMS_WaisUI.h230
-rw-r--r--WWW/Library/Implementation/HTWAIS.c3
-rw-r--r--WWW/Library/Implementation/HTWAIS.h3
-rw-r--r--WWW/Library/Implementation/HTWSRC.c3
-rw-r--r--WWW/Library/Implementation/HTWSRC.h4
-rw-r--r--WWW/Library/Implementation/HTWriter.c4
-rw-r--r--WWW/Library/Implementation/LYLeaks.h1
-rw-r--r--WWW/Library/Implementation/LYexit.h1
-rw-r--r--WWW/Library/Implementation/SGML.c4
-rw-r--r--WWW/Library/Implementation/SGML.h3
-rw-r--r--WWW/Library/Implementation/UCAux.h2
-rw-r--r--WWW/Library/Implementation/UCDefs.h2
-rw-r--r--WWW/Library/Implementation/UCMap.h4
-rw-r--r--WWW/Library/Implementation/crypt.c2
-rw-r--r--WWW/Library/Implementation/crypt_util.c2
-rw-r--r--WWW/Library/Implementation/entities.h8
-rw-r--r--WWW/Library/Implementation/getline.c3
-rw-r--r--WWW/Library/Implementation/tcp.h19
-rw-r--r--aclocal.m43
-rw-r--r--config.hin1
-rwxr-xr-xconfigure650
-rw-r--r--lynx.cfg25
-rw-r--r--lynx.hlp27
-rw-r--r--lynx.man12
-rw-r--r--lynx_help/Lynx_users_guide.html17
-rw-r--r--src/DefaultStyle.c1
-rw-r--r--src/GridText.c4
-rw-r--r--src/HTAlert.c8
-rw-r--r--src/HTAlert.h3
-rw-r--r--src/HTFWriter.c10
-rw-r--r--src/HTInit.c7
-rw-r--r--src/HTML.c3
-rw-r--r--src/HTSaveToFile.h4
-rw-r--r--src/LYBookmark.c3
-rw-r--r--src/LYCgi.c2
-rw-r--r--src/LYCgi.h3
-rw-r--r--src/LYCharSets.c1
-rw-r--r--src/LYCharSets.h4
-rw-r--r--src/LYCharUtils.c3
-rw-r--r--src/LYClean.c3
-rw-r--r--src/LYClean.h2
-rw-r--r--src/LYCookie.c107
-rw-r--r--src/LYCookie.h7
-rw-r--r--src/LYCurses.c10
-rw-r--r--src/LYCurses.h1
-rw-r--r--src/LYDownload.c17
-rw-r--r--src/LYEdit.c3
-rw-r--r--src/LYEdit.h3
-rw-r--r--src/LYEditmap.c1
-rw-r--r--src/LYExtern.c5
-rw-r--r--src/LYForms.c24
-rw-r--r--src/LYGetFile.c11
-rw-r--r--src/LYGetFile.h3
-rw-r--r--src/LYGlobalDefs.h8
-rw-r--r--src/LYHash.h2
-rw-r--r--src/LYHistory.c3
-rw-r--r--src/LYJump.c3
-rw-r--r--src/LYJump.h3
-rw-r--r--src/LYKeymap.c1
-rw-r--r--src/LYKeymap.h2
-rw-r--r--src/LYLeaks.c4
-rw-r--r--src/LYList.c11
-rw-r--r--src/LYList.h3
-rw-r--r--src/LYLocal.c64
-rw-r--r--src/LYLocal.h5
-rw-r--r--src/LYMail.c3
-rw-r--r--src/LYMain.c15
-rw-r--r--src/LYMainLoop.c16
-rw-r--r--src/LYMainLoop.h3
-rw-r--r--src/LYMap.c3
-rw-r--r--src/LYMap.h5
-rw-r--r--src/LYNews.c3
-rw-r--r--src/LYOptions.c188
-rw-r--r--src/LYOptions.h9
-rw-r--r--src/LYPrint.c20
-rw-r--r--src/LYReadCFG.c22
-rw-r--r--src/LYSearch.c3
-rw-r--r--src/LYShowInfo.c19
-rw-r--r--src/LYStrings.c34
-rw-r--r--src/LYStrings.h3
-rw-r--r--src/LYStyle.c6
-rw-r--r--src/LYTraversal.c1
-rw-r--r--src/LYUpload.c14
-rw-r--r--src/LYUtils.c127
-rw-r--r--src/LYUtils.h1
-rw-r--r--src/LYexit.c3
-rw-r--r--src/LYrcFile.c41
-rw-r--r--src/UCAuto.c3
-rw-r--r--src/UCAuto.h3
-rw-r--r--src/UCAux.c1
-rw-r--r--src/UCdomap.c3
-rw-r--r--src/UCdomap.h4
-rw-r--r--src/makefile.dos2
-rw-r--r--src/makefile.dsl2
-rw-r--r--src/makefile.wsl2
-rw-r--r--userdefs.h58
169 files changed, 1656 insertions, 1596 deletions
diff --git a/CHANGES b/CHANGES
index 4051ad77..fff18965 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,50 @@
 Changes since Lynx 2.8 release
 ================================================================================
 
+1998-08-06 (2.8.1dev.20)
+* rename eat_all_cookies to accept_all_cookies everywhere - BJP
+* added ACCEPT_ALL_COOKIES lines to the dist lynx.cfg -- this conflicts with
+  LP's "2.8.1dev.19 typo & lynx.man/lynx.hlp/ lynx.cfg fix" patch -- his adds
+  the EAT_ALL_COOKIES option to lynx.cfg (with the appropriate description),
+  this should be the only problem there - BJP
+* added COOKIE_ACCEPT_DOMAINS and COOKIE_REJECT_DOMAINS to lynx.cfg.  These are
+  comma delimited lists of the domains to handle - BJP
+* added cookie_add_acceptlist and cookie_add_rejectlist to LYCookie.c, which
+  are passed the list of domains from lynx.cfg and add them to the global
+  cookie list.  These may be subject to change, as I might not be handling the
+  LYstrsep() right -- it works with dev19's LYstrsep(), but hasn't been tested
+  with Bela's...  - BJP
+* added a big ugly ifdef'd out section to LYrcFile.c with what I have so far on
+  the .lynxrc handling of COOKIE_{ACCEPT,REJECT}_DOMAINS.  Don't use it.  Makes
+  nasty segfaults - BJP (Brian J Pardy)
+* fix a bug where the DJGPP_KEYHANDLER version doesn't allow movement by arrow
+  keys within a text area.  Undo previous patch to LYGetFile.c, with LYgetch
+  now changed where it is defined in LYStrings.c, rather than at each place
+  where it is used.  The patch in LYStrings.c regarding Windows should fix the
+  problem with keymapping that occurred when we got rid of RAWDOSKEYHACK - DK
+* turn on DISP_PARTIAL in makefile.dos - DK
+* correct typo in LYOptions.c - BL
+* corrected logic of LYstrsep - BL
+* Few minor typos and forgotten notes in man/hlp/cfg files; also quote Bela's
+  note on lynx.cfg INCLUDE facility - LP
+* correct typos in makefile.wsl, makefile.dsl - LP
+* correct typos, misuse of character set in LYOptions.c for preferred_doc_char
+  - LP
+* move include for socks.h past tcp.h, to allow for redefinition of some
+  symbols on AIX (report by Brian Hauber) - TD
+* adjust headers so that each can be compiled separately, eliminating order
+  dependencies - TD
+* include tcp.h always from within HTUtils.h, to enforce ordering of headers
+  needed for socks5 definitions - TD
+* use S_ISREG, S_ISDIR macros to reduce clutter - TD
+* make test for OpenHiddenFile to overwrite user's file more stringent by
+  ensuring that the given pathname is not a link from a world-writable
+  directory (reported by BL, with suggested patch) - TD
+* add/use LYPathLeaf() function to reduce clutter of pathname-leaf parsing - TD
+* eliminate redundant definition of 'FREE() - TD
+* ifdef'd LYOptions.c to reduce unneeded code wrt --enable-forms-options - TD
+* check in OpenHiddenFile to ensure that we overwrite only regular files,
+  since we also force the file's permissions to 0600 - TD
 1998-07-31 (2.8.1dev.19)
 * modify OpenHiddenFile so that it can overwrite files owned by the real
   user if the O_EXCL open fails because the file already exists - TD
@@ -8,11 +52,11 @@ Changes since Lynx 2.8 release
   with EXP_FORMS_OPTIONS and configured with --enable-forms-options.
 * add option -eat_all_cookies and corresponding config variable
   EAT_ALL_COOKIES (Brian J Pardy <posterkid@psnw.com>).
-* correct spurious 'Content' string versus newline after X-URL in LYMain.c
+* correct spurious 'Content' string versus newline after X-URL in LYMail.c
   (Bela Lubkin and Larry Virden).
 * updated versions of config.guess and config.sub based on automake 1.3 - TD
 * updated experimental persistent-cookie support based on RP's patch:  Replaced
-  the call to strsep with a home-rolled one for those people who don't have it. 
+  the call to strsep with a home-rolled one for those people who don't have it.
   (Reported by Bela Lubkin, Mon, 27 Jul 1998 16:51:14 -0700 on the mailing
   list.) Bela's modification to make some character arrays static is also
   included.
diff --git a/LYMessages_en.h b/LYMessages_en.h
index b3cb4e47..7b16dd5f 100644
--- a/LYMessages_en.h
+++ b/LYMessages_en.h
@@ -625,7 +625,7 @@
 #define DOMAIN_COOKIES_EATEN "All cookies in the domain have been eaten!"
 #define ALWAYS_ALLOWING_COOKIES "'A'lways allowing from domain '%s'."
 #define NEVER_ALLOWING_COOKIES "ne'V'er allowing from domain '%s'."
-#define PROMTING_TO_ALLOW_COOKIES "'P'rompting to allow from domain '%s'."
+#define PROMPTING_TO_ALLOW_COOKIES "'P'rompting to allow from domain '%s'."
 #define DELETE_ALL_COOKIES_IN_DOMAIN "Delete all cookies in this domain?"
 #define ALL_COOKIES_EATEN "All of the cookies in the jar have been eaten!"
 #define PORT_NINETEEN_INVALID "Port 19 not permitted in URLs."
diff --git a/WWW/Library/Implementation/HTAABrow.c b/WWW/Library/Implementation/HTAABrow.c
index 3bba7f3f..f4a00dca 100644
--- a/WWW/Library/Implementation/HTAABrow.c
+++ b/WWW/Library/Implementation/HTAABrow.c
@@ -51,7 +51,6 @@
 */
 
 #include <HTUtils.h>
-#include <string.h>		/* strchr() */
 #include <HTString.h>
 #include <HTParse.h>		/* URL parsing function		*/
 #include <HTList.h>		/* HTList object		*/
diff --git a/WWW/Library/Implementation/HTAABrow.h b/WWW/Library/Implementation/HTAABrow.h
index c62a3c4c..49351cd2 100644
--- a/WWW/Library/Implementation/HTAABrow.h
+++ b/WWW/Library/Implementation/HTAABrow.h
@@ -31,12 +31,8 @@
 #ifndef HTAABROW_H
 #define HTAABROW_H
 
-#ifndef HTUTILS_H
-#include <HTUtils.h>            /* BOOL, PARAMS, ARGS */
-#endif /* HTUTILS_H */
 #include <HTAAUtil.h>           /* Common parts of AA */
 
-
 #ifdef SHORT_NAMES
 #define HTAAcoAu        HTAA_composeAuth
 #define HTAAsRWA        HTAA_shouldRetryWithAuth
diff --git a/WWW/Library/Implementation/HTAAFile.c b/WWW/Library/Implementation/HTAAFile.c
index 53dde21a..82da7af9 100644
--- a/WWW/Library/Implementation/HTAAFile.c
+++ b/WWW/Library/Implementation/HTAAFile.c
@@ -1,4 +1,3 @@
-
 /* MODULE							HTAAFile.c
 **		FILE ROUTINES FOR AUTHENTICATION
 **		(PASSWD AND GROUP FILES) AND
@@ -14,13 +13,8 @@
 **
 */
 
-
-#ifndef HTUTILS_H
 #include <HTUtils.h>
-#endif /* HTUTILS_H */
 
-#include <tcp.h>		/* Macro FROMASCII() */
-#include <string.h>
 #include <HTAAUtil.h>		/* Common utilities used in AA */
 #include <HTAAFile.h>		/* Implemented here */
 
diff --git a/WWW/Library/Implementation/HTAAFile.h b/WWW/Library/Implementation/HTAAFile.h
index 8549f89f..8986b593 100644
--- a/WWW/Library/Implementation/HTAAFile.h
+++ b/WWW/Library/Implementation/HTAAFile.h
@@ -15,9 +15,6 @@
 #ifndef HTAAFILE_H
 #define HTAAFILE_H
 
-#ifndef HTUTILS_H
-#include <HTUtils.h>            /* BOOL, PARAMS, ARGS */
-#endif /* HTUTILS_H */
 #include <HTList.h>             /* HTList */
 
 #ifdef SHORT_NAMES
diff --git a/WWW/Library/Implementation/HTAAProt.c b/WWW/Library/Implementation/HTAAProt.c
index 0c8dac86..773474a9 100644
--- a/WWW/Library/Implementation/HTAAProt.c
+++ b/WWW/Library/Implementation/HTAAProt.c
@@ -19,7 +19,6 @@
 
 #include <HTUtils.h>
 
-#include <string.h>
 #ifndef VMS
 #ifndef NOUSERS
 #include <pwd.h>	/* Unix password file routine: getpwnam()	*/
diff --git a/WWW/Library/Implementation/HTAAProt.h b/WWW/Library/Implementation/HTAAProt.h
index b4d00f49..ed36f656 100644
--- a/WWW/Library/Implementation/HTAAProt.h
+++ b/WWW/Library/Implementation/HTAAProt.h
@@ -5,9 +5,6 @@
 #ifndef HTAAPROT_H
 #define HTAAPROT_H
 
-#ifndef HTUTILS_H
-#include <HTUtils.h>
-#endif /* HTUTILS_H */
 #include <HTGroup.h>
 #include <HTAssoc.h>
 
diff --git a/WWW/Library/Implementation/HTAAServ.c b/WWW/Library/Implementation/HTAAServ.c
index 674c6dc3..c081a3fa 100644
--- a/WWW/Library/Implementation/HTAAServ.c
+++ b/WWW/Library/Implementation/HTAAServ.c
@@ -43,8 +43,6 @@
 
 #include <HTUtils.h>
 
-#include <string.h>		/* strchr() */
-
 #include <HTString.h>
 #include <HTAccess.h>		/* HTSecure			*/
 #include <HTFile.h>		/* HTLocalName			*/
diff --git a/WWW/Library/Implementation/HTAAServ.h b/WWW/Library/Implementation/HTAAServ.h
index 6e300032..a2946ec4 100644
--- a/WWW/Library/Implementation/HTAAServ.h
+++ b/WWW/Library/Implementation/HTAAServ.h
@@ -31,9 +31,6 @@
 #ifndef HTAASERV_H
 #define HTAASERV_H
 
-#ifndef HTUTILS_H
-#include <HTUtils.h>            /* BOOL, PARAMS, ARGS   */
-#endif /* HTUTILS_H */
 #include <HTRules.h>            /* This module interacts with rule system */
 #include <HTAAUtil.h>           /* Common parts of AA   */
 #include <HTAuth.h>             /* Authentication       */
diff --git a/WWW/Library/Implementation/HTAAUtil.c b/WWW/Library/Implementation/HTAAUtil.c
index 7653c312..05726a8e 100644
--- a/WWW/Library/Implementation/HTAAUtil.c
+++ b/WWW/Library/Implementation/HTAAUtil.c
@@ -44,8 +44,7 @@
 */
 
 #include <HTUtils.h>
-#include <tcp.h>	/* NETREAD() etc.	*/
-#include <string.h>
+
 #include <HTAAUtil.h>	/* Implemented here	*/
 #include <HTAssoc.h>	/* Assoc list		*/
 #include <HTTCP.h>
diff --git a/WWW/Library/Implementation/HTAAUtil.h b/WWW/Library/Implementation/HTAAUtil.h
index de6878e6..059d5b03 100644
--- a/WWW/Library/Implementation/HTAAUtil.h
+++ b/WWW/Library/Implementation/HTAAUtil.h
@@ -1,39 +1,35 @@
 /*                                            Utilities for the Authorization parts of libwww
              COMMON PARTS OF AUTHORIZATION MODULE TO BOTH SERVER AND BROWSER
-                                             
+
    This module is the interface to the common parts of Access Authorization (AA) package
    for both server and browser. Important to know about memory allocation:
-   
+
    Routines in this module use dynamic allocation, but free automatically all the memory
    reserved by them.
-   
+
    Therefore the caller never has to (and never should) free() any object returned by
    these functions.
-   
+
    Therefore also all the strings returned by this package are only valid until the next
    call to the same function is made. This approach is selected, because of the nature of
    access authorization: no string returned by the package needs to be valid longer than
    until the next call.
-   
+
    This also makes it easy to plug the AA package in: you don't have to ponder whether to
    free() something here or is it done somewhere else (because it is always done somewhere
    else).
-   
+
    The strings that the package needs to store are copied so the original strings given as
    parameters to AA functions may be freed or modified with no side effects.
-   
+
    Also note: The AA package does not free() anything else than what it has itself
    allocated.
-   
+
  */
 
 #ifndef HTAAUTIL_H
 #define HTAAUTIL_H
 
-#ifndef HTUTILS_H
-#include <HTUtils.h>            /* BOOL, PARAMS, ARGS */
-#endif /* HTUTILS_H */
-#include <tcp.h>
 #include <HTList.h>
 
 #ifdef SHORT_NAMES
@@ -76,22 +72,17 @@ Default filenames
 #define MAX_FIELDNAME_LEN       16      /* @@ Longest field name in       */
                                         /* protection setup file          */
 #define MAX_PATHNAME_LEN        80      /* @@ Longest passwd/group file   */
-                                        /* patname to allow               */
-
-/*
-** Helpful macros
-*/
-#define FREE(x) if (x) {free(x); x = NULL;}
+                                        /* pathname to allow               */
 
 /*
 
 Datatype definitions
 
   HTAASCHEME
-  
+
    The enumeration HTAAScheme represents the possible authentication schemes used by the
    WWW Access Authorization.
-   
+
  */
 
 typedef enum {
@@ -107,7 +98,7 @@ typedef enum {
 /*
 
   ENUMERATION TO REPRESENT HTTP METHODS
-  
+
  */
 
 typedef enum {
@@ -206,11 +197,11 @@ Match Template Against Filename
 **
 ** ON ENTRY:
 **      template        is a template string to match the file name
-**                      agaist, may contain a single wildcard
+**                      against, may contain a single wildcard
 **                      character * which matches zero or more
 **                      arbitrary characters.
 **      filename        is the filename (or pathname) to be matched
-**                      agaist the template.
+**                      against the template.
 **
 ** ON EXIT:
 **      returns         YES, if filename matches the template.
@@ -232,11 +223,11 @@ PUBLIC BOOL HTAA_templateMatch PARAMS((CONST char * template,
 **
 ** ON ENTRY:
 **      template        is a template string to match the file name
-**                      agaist, may contain a single wildcard
+**                      against, may contain a single wildcard
 **                      character * which matches zero or more
 **                      arbitrary characters.
 **      filename        is the filename (or pathname) to be matched
-**                      agaist the template.
+**                      against the template.
 **
 ** ON EXIT:
 **      returns         YES, if filename matches the template.
@@ -355,6 +346,3 @@ PUBLIC void HTAA_setupReader PARAMS((char *     start_of_headers,
 PUBLIC char *HTAA_getUnfoldedLine NOPARAMS;
 
 #endif  /* NOT HTAAUTIL_H */
-/*
-
-   End of file HTAAUtil.h. */
diff --git a/WWW/Library/Implementation/HTACL.c b/WWW/Library/Implementation/HTACL.c
index ad6ff3e0..cca7753f 100644
--- a/WWW/Library/Implementation/HTACL.c
+++ b/WWW/Library/Implementation/HTACL.c
@@ -17,9 +17,6 @@
 
 
 #include <HTUtils.h>
-
-#include <string.h>
-
 #include <HTAAFile.h>	/* File routines	*/
 #include <HTGroup.h>	/* GroupDef		*/
 #include <HTACL.h>	/* Implemented here	*/
diff --git a/WWW/Library/Implementation/HTACL.h b/WWW/Library/Implementation/HTACL.h
index 3dfef27c..d1431b34 100644
--- a/WWW/Library/Implementation/HTACL.h
+++ b/WWW/Library/Implementation/HTACL.h
@@ -5,9 +5,6 @@
 #ifndef HTACL_H
 #define HTACL_H
 
-#ifndef HTUTILS_H
-#include <HTUtils.h>
-#endif /* HTUTILS_H */
 #include <HTAAUtil.h>
 #include <HTGroup.h>
 
diff --git a/WWW/Library/Implementation/HTAccess.c b/WWW/Library/Implementation/HTAccess.c
index 0380bd9e..f98a14bf 100644
--- a/WWW/Library/Implementation/HTAccess.c
+++ b/WWW/Library/Implementation/HTAccess.c
@@ -63,8 +63,6 @@
 #include <LYexit.h>
 #include <LYLeaks.h>
 
-#define FREE(x) if (x) {free(x); x = NULL;}
-
 extern HTCJKlang HTCJK;
 
 /*
@@ -331,10 +329,10 @@ PUBLIC BOOL override_proxy ARGS1(
 **
 **  On entry,
 **	addr		must point to the fully qualified hypertext reference.
-**	anchor		a pareent anchor with whose address is addr
+**	anchor		a parent anchor with whose address is addr
 **
 **  On exit,
-**	returns 	HT_NO_ACCESS		Error has occured.
+**	returns 	HT_NO_ACCESS		Error has occurred.
 **			HT_OK			Success
 */
 PRIVATE int get_physical ARGS2(
@@ -578,13 +576,13 @@ PRIVATE int LYUCPopAssumed NOARGS
 **
 **  On entry,
 **	addr		must point to the fully qualified hypertext reference.
-**	anchor		a pareent anchor with whose address is addr
+**	anchor		a parent anchor with whose address is addr
 **
 **  On exit,
-**	returns 	<0		Error has occured.
+**	returns 	<0		Error has occurred.
 **			HT_LOADED	Success
 **			HT_NO_DATA	Success, but no document loaded.
-**					(telnet sesssion started etc)
+**					(telnet session started etc)
 */
 PRIVATE int HTLoad ARGS4(
 	CONST char *,		addr,
@@ -775,12 +773,12 @@ PRIVATE BOOL HTLoadDocument ARGS4(
 	*    If DONT_TRACK_INTERNAL_LINKS is defined, HText_AreDifferent()
 	*    is used to determine whether (3) applies.	If the target address
 	*    differs from that of the current document only by a fragment
-	*    and the taget address has an appended fragment, repositioning
+	*    and the target address has an appended fragment, repositioning
 	*    without reloading is always assumed.
 	*    Note that HText_AreDifferent() currently always returns TRUE
 	*    if the target has a LYNXIMGMAP URL, so that an internally
 	*    generated pseudo-document will normally not be re-used unless
-	*    condition (2) appplies. (Condition (1) cannot apply since in
+	*    condition (2) applies. (Condition (1) cannot apply since in
 	*    LYMap.c, no_cache is always set in the anchor object).  This
 	*    doesn't guarantee that the resource from which the MAP element
 	*    is taken will be read again (reloaded) when the list of links
@@ -971,7 +969,7 @@ PRIVATE BOOL HTLoadDocument ARGS4(
     if (status > 0) {
 	/*
 	**	If you get this, then please find which routine is returning
-	**	a positive unrecognised error code!
+	**	a positive unrecognized error code!
 	*/
 	fprintf(stderr,
  "**** HTAccess: socket or file number returned by obsolete load routine!\n");
@@ -1089,7 +1087,7 @@ PUBLIC BOOL HTLoadRelative ARGS2(
 **	----------------------------------------
 **
 **  On Entry,
-**	  destination		    The child or parenet anchor to be loaded.
+**	  destination		    The child or parent anchor to be loaded.
 **
 **  On Exit,
 **	  returns    YES     Success
@@ -1105,7 +1103,7 @@ PUBLIC BOOL HTLoadAnchor ARGS1(
 
     parent = HTAnchor_parent(destination);
 
-    if (HTAnchor_document(parent) == NULL) {	/* If not alread loaded */
+    if (HTAnchor_document(parent) == NULL) {	/* If not already loaded */
 						/* TBL 921202 */
 	BOOL result;
 	char * address = HTAnchor_address((HTAnchor*) parent);
@@ -1258,7 +1256,7 @@ PUBLIC BOOL HTSearchAbsolute ARGS2(
 **	As it involves file access, this should only be done once
 **	when the program first runs.
 **	This is a default algorithm -- browser don't HAVE to use this.
-**	But consistency betwen browsers is STRONGLY recommended!
+**	But consistency between browsers is STRONGLY recommended!
 **
 **  Priority order is:
 **		1	WWW_HOME environment variable (logical name, etc)
diff --git a/WWW/Library/Implementation/HTAccess.h b/WWW/Library/Implementation/HTAccess.h
index b168dfba..32d8e562 100644
--- a/WWW/Library/Implementation/HTAccess.h
+++ b/WWW/Library/Implementation/HTAccess.h
@@ -15,10 +15,6 @@ extern char * use_this_url_instead;
 
 /*      Definition uses:
 */
-#ifndef HTUTILS_H
-#include <HTUtils.h>
-#endif /* HTUTILS_H */
-#include <tcp.h>
 #include <HTAnchor.h>
 #include <HTFormat.h>
 
diff --git a/WWW/Library/Implementation/HTAnchor.c b/WWW/Library/Implementation/HTAnchor.c
index 9adf69ce..ef76ee1b 100644
--- a/WWW/Library/Implementation/HTAnchor.c
+++ b/WWW/Library/Implementation/HTAnchor.c
@@ -7,7 +7,7 @@
 ** History
 **
 **	   Nov 1990  Written in Objective-C for the NeXT browser (TBL)
-**	24-Oct-1991 (JFG), written in C, browser-independant
+**	24-Oct-1991 (JFG), written in C, browser-independent
 **	21-Nov-1991 (JFG), first complete version
 **
 **	(c) Copyright CERN 1991 - See Copyright.html
@@ -16,8 +16,6 @@
 #define HASH_SIZE 101		/* Arbitrary prime. Memory/speed tradeoff */
 
 #include <HTUtils.h>
-#include <tcp.h>
-#include <ctype.h>
 #include <HTAnchor.h>
 #include <HTParse.h>
 #include <UCAux.h>
@@ -26,8 +24,6 @@
 #include <LYCharSets.h>
 #include <LYLeaks.h>
 
-#define FREE(x) if (x) {free(x); x = NULL;}
-
 #ifdef NOT_DEFINED
 /*
  *	This is the hashing function used to determine which list in the
@@ -84,7 +80,7 @@ PRIVATE HTParentAnchor * HTParentAnchor_new NOARGS
     newAnchor->no_cache = FALSE;	/* no-cache? - FM */
     newAnchor->content_type = NULL;	/* Content-Type. - FM */
     newAnchor->content_language = NULL; /* Content-Language. - FM */
-    newAnchor->content_encoding = NULL; /* Compression algorith. - FM */
+    newAnchor->content_encoding = NULL; /* Compression algorithm. - FM */
     newAnchor->content_base = NULL;	/* Content-Base. - FM */
     newAnchor->content_disposition = NULL; /* Content-Disposition. - FM */
     newAnchor->content_location = NULL; /* Content-Location. - FM */
diff --git a/WWW/Library/Implementation/HTAssoc.c b/WWW/Library/Implementation/HTAssoc.c
index dff739be..f5dcbf11 100644
--- a/WWW/Library/Implementation/HTAssoc.c
+++ b/WWW/Library/Implementation/HTAssoc.c
@@ -16,11 +16,8 @@
 **
 */
 
-
 #include <HTUtils.h>
 
-#include <string.h>
-
 #include <HTAAUtil.h>
 #include <HTAssoc.h>
 #include <HTString.h>
diff --git a/WWW/Library/Implementation/HTAssoc.h b/WWW/Library/Implementation/HTAssoc.h
index 79cbe557..93183302 100644
--- a/WWW/Library/Implementation/HTAssoc.h
+++ b/WWW/Library/Implementation/HTAssoc.h
@@ -7,12 +7,8 @@
 #ifndef HTASSOC_H
 #define HTASSOC_H
 
-#ifndef HTUTILS_H
-#include <HTUtils.h>
-#endif /* HTUTILS_H */
 #include <HTList.h>
 
-
 #ifdef SHORT_NAMES
 #define HTAL_new        HTAssocList_new
 #define HTAL_del        HTAssocList_delete
diff --git a/WWW/Library/Implementation/HTAtom.c b/WWW/Library/Implementation/HTAtom.c
index 48823651..e4af2962 100644
--- a/WWW/Library/Implementation/HTAtom.c
+++ b/WWW/Library/Implementation/HTAtom.c
@@ -12,20 +12,17 @@
 **	(c) Copyright CERN 1991 - See Copyright.html
 **
 */
+
 #include <HTUtils.h>
 
 #define HASH_SIZE	101		/* Tunable */
 #include <HTAtom.h>
 
-#include <string.h>
-
 #include <HTList.h>
 
 #include <LYexit.h>
 #include <LYLeaks.h>
 
-#define FREE(x) if (x) {free(x); x = NULL;}
-
 PRIVATE HTAtom * hash_table[HASH_SIZE];
 PRIVATE BOOL initialised = NO;
 
@@ -43,7 +40,7 @@ PUBLIC HTAtom * HTAtom_for ARGS1(CONST char *, string)
 {
     int hash;
     HTAtom * a;
-    
+
     /*		First time around, clear hash table
     */
     /*
@@ -57,11 +54,11 @@ PUBLIC HTAtom * HTAtom_for ARGS1(CONST char *, string)
 	initialised = YES;
 	atexit(free_atoms);
     }
-    
+
     /*		Generate hash function
     */
     hash = HASH_FUNCTION(string);
-    
+
     /*		Search for the string in the list
     */
     for (a = hash_table[hash]; a; a = a->next) {
@@ -70,7 +67,7 @@ PUBLIC HTAtom * HTAtom_for ARGS1(CONST char *, string)
 	    return a;				/* Found: return it */
 	}
     }
-    
+
     /*		Generate a new entry
     */
     a = (HTAtom *)malloc(sizeof(*a));
@@ -144,7 +141,7 @@ PRIVATE BOOL mime_match ARGS2(CONST char *, name,
     }
     return NO;
 }
-	
+
 
 PUBLIC HTList *HTAtom_templateMatches ARGS1(CONST char *, templ)
 {
diff --git a/WWW/Library/Implementation/HTAtom.h b/WWW/Library/Implementation/HTAtom.h
index c3319a3d..fda46b86 100644
--- a/WWW/Library/Implementation/HTAtom.h
+++ b/WWW/Library/Implementation/HTAtom.h
@@ -21,9 +21,6 @@
 #ifndef HTATOM_H
 #define HTATOM_H
 
-#ifndef HTUTILS_H
-#include <HTUtils.h>
-#endif /* HTUTILS_H */
 #include <HTList.h>
 
 #ifdef SHORT_NAMES
diff --git a/WWW/Library/Implementation/HTAuth.c b/WWW/Library/Implementation/HTAuth.c
index 9f2185c7..f1e7efd5 100644
--- a/WWW/Library/Implementation/HTAuth.c
+++ b/WWW/Library/Implementation/HTAuth.c
@@ -14,7 +14,6 @@
 */
 
 #include <HTUtils.h>
-#include <string.h>
 #include <HTPasswd.h>	/* Password file routines	*/
 #include <HTAssoc.h>
 #include <HTAuth.h>	/* Implemented here		*/
diff --git a/WWW/Library/Implementation/HTAuth.h b/WWW/Library/Implementation/HTAuth.h
index f81eb1eb..0e88131c 100644
--- a/WWW/Library/Implementation/HTAuth.h
+++ b/WWW/Library/Implementation/HTAuth.h
@@ -8,9 +8,6 @@
 #ifndef HTAUTH_H
 #define HTAUTH_H
 
-#ifndef HTUTILS_H
-#include <HTUtils.h>
-#endif /* HTUTILS_H */
 #include <HTAAUtil.h>
 #include <HTAAProt.h>
 
diff --git a/WWW/Library/Implementation/HTBTree.c b/WWW/Library/Implementation/HTBTree.c
index 986dfc8b..c545eb0e 100644
--- a/WWW/Library/Implementation/HTBTree.c
+++ b/WWW/Library/Implementation/HTBTree.c
@@ -12,18 +12,14 @@
 #ifndef __STRICT_BSD__
 #include <stdlib.h>
 #endif
-#include <string.h>
 
 #define MAXIMUM(a,b) ((a)>(b)?(a):(b))
 
 #include <LYLeaks.h>
 
-#define FREE(x) if (x) {free(x); x = NULL;}
-
-
 PUBLIC HTBTree * HTBTree_new ARGS1(HTComparer, comp)
     /*********************************************************
-    ** This function returns an HTBTree with memory allocated 
+    ** This function returns an HTBTree with memory allocated
     ** for it when given a mean to compare things
     */
 {
@@ -73,7 +69,7 @@ PRIVATE void HTBTElementAndObject_free ARGS1(HTBTElement*, element)
     if (element) {     /* Just in case nothing was in the tree anyway */
         if (element->left != NULL)
 	    HTBTElementAndObject_free(element->left);
-	if (element->right != NULL)    
+	if (element->right != NULL)
 	    HTBTElementAndObject_free(element->right);
 	FREE(element->object);
 	FREE(element);
@@ -110,12 +106,12 @@ PUBLIC void HTBTree_add ARGS2(
     int depth,depth2,corrections;
         /* father_of_element is a pointer to the structure that is the father of the
         ** new object "object".
-        ** added_element is a pointer to the structure that contains or will contain 
+        ** added_element is a pointer to the structure that contains or will contain
         ** the new object "object".
         ** father_of_forefather and forefather_of_element are pointers that are used
         ** to modify the depths of upper elements, when needed.
         **
-        ** father_found indicates by a value NO when the future father of "object" 
+        ** father_found indicates by a value NO when the future father of "object"
         ** is found.
         ** top_found indicates by a value NO when, in case of a difference of depths
         **  < 2, the top of the tree is encountered and forbids any further try to
@@ -146,24 +142,24 @@ PUBLIC void HTBTree_add ARGS2(
         tree->top->right_depth = 0;
     }
     else
-    {   
+    {
         father_found = YES;
         father_of_element = tree->top;
         added_element = NULL;
         father_of_forefather = NULL;
-        forefather_of_element = NULL;      
+        forefather_of_element = NULL;
         while (father_found)
         {
             if (tree->compare(object,father_of_element->object)<0)
 	    {
                 if (father_of_element->left != NULL)
                     father_of_element = father_of_element->left;
-                else 
+                else
 	        {
                     father_found = NO;
-                    father_of_element->left = 
+                    father_of_element->left =
                         (HTBTElement *)malloc(sizeof(HTBTElement));
-                    if (father_of_element->left==NULL) 
+                    if (father_of_element->left==NULL)
                         outofmem(__FILE__, "HTBTree_add");
                     added_element = father_of_element->left;
                     added_element->up = father_of_element;
@@ -176,14 +172,14 @@ PUBLIC void HTBTree_add ARGS2(
    	    }
             if (tree->compare(object,father_of_element->object)>=0)
             {
-                if (father_of_element->right != NULL) 
+                if (father_of_element->right != NULL)
                     father_of_element = father_of_element->right;
-                else 
-                {  
+                else
+                {
                     father_found = NO;
-                    father_of_element->right = 
+                    father_of_element->right =
                         (HTBTElement *)malloc(sizeof(HTBTElement));
-                    if (father_of_element->right==NULL) 
+                    if (father_of_element->right==NULL)
                         outofmem(__FILE__, "HTBTree_add");
                     added_element = father_of_element->right;
                     added_element->up = father_of_element;
@@ -191,7 +187,7 @@ PUBLIC void HTBTree_add ARGS2(
                     added_element->left = NULL;
                     added_element->left_depth = 0;
                     added_element->right = NULL;
-                    added_element->right_depth = 0;       
+                    added_element->right_depth = 0;
     	        }
             }
 	}
@@ -205,7 +201,7 @@ PUBLIC void HTBTree_add ARGS2(
             if (father_of_forefather->left == forefather_of_element)
             {
                 depth = father_of_forefather->left_depth;
-                father_of_forefather->left_depth = 1 
+                father_of_forefather->left_depth = 1
                             + MAXIMUM(forefather_of_element->right_depth,
                                   forefather_of_element->left_depth);
                 depth2 = father_of_forefather->left_depth;
@@ -221,7 +217,7 @@ PUBLIC void HTBTree_add ARGS2(
             forefather_of_element = father_of_forefather;
             father_of_forefather = father_of_forefather->up;
         } while ((depth != depth2) && (father_of_forefather != NULL));
-        
+
 
 
             /*
@@ -234,7 +230,7 @@ PUBLIC void HTBTree_add ARGS2(
             if ((abs(father_of_element->left_depth
                       - father_of_element->right_depth)) < 2)
 	    {
-                if (father_of_element->up != NULL) 
+                if (father_of_element->up != NULL)
                     father_of_element = father_of_element->up;
                 else top_found = NO;
 	    }
@@ -242,8 +238,8 @@ PUBLIC void HTBTree_add ARGS2(
  	    {                /* We start the process of balancing */
 
                 corrections = corrections + 1;
-                    /* 
-                    ** corrections is an integer used to avoid infinite 
+                    /*
+                    ** corrections is an integer used to avoid infinite
                     ** loops in cases such as:
                     **
                     **             3                        3
@@ -251,22 +247,22 @@ PUBLIC void HTBTree_add ARGS2(
                     **           5                            5
                     **
                     ** 3 is used to show that it need not be the top of the tree
-		    ** But let's avoid these two exceptions anyhow 
+		    ** But let's avoid these two exceptions anyhow
 		    ** with the two following conditions (4 March 94 - AS)
                     */
 
-		if ((father_of_element->left == NULL) 
-		    && (father_of_element->right->right == NULL) 
-		    && (father_of_element->right->left->left == NULL) 
-		    && (father_of_element->right->left->right == NULL)) 
+		if ((father_of_element->left == NULL)
+		    && (father_of_element->right->right == NULL)
+		    && (father_of_element->right->left->left == NULL)
+		    && (father_of_element->right->left->right == NULL))
 		    corrections = 7;
 
-		if ((father_of_element->right == NULL) 
-		    && (father_of_element->left->left == NULL) 
-		    && (father_of_element->left->right->right == NULL) 
+		if ((father_of_element->right == NULL)
+		    && (father_of_element->left->left == NULL)
+		    && (father_of_element->left->right->right == NULL)
 		    && (father_of_element->left->right->left == NULL))
 		    corrections = 7;
- 
+
 
                 if (father_of_element->left_depth > father_of_element->right_depth)
 	        {
@@ -283,7 +279,7 @@ PUBLIC void HTBTree_add ARGS2(
                         father_of_forefather = father_of_element->up;
                         forefather_of_element = added_element;
 			first_time = YES;
-                        do 
+                        do
                         {
                             if (father_of_forefather->left
                                  == forefather_of_element->up)
@@ -312,7 +308,7 @@ PUBLIC void HTBTree_add ARGS2(
 				      + MAXIMUM(forefather_of_element->left_depth,
 					       forefather_of_element->right_depth);
 				    first_time = NO;
-				}				
+				}
 				else
 				    father_of_forefather->right_depth = 1
 				      + MAXIMUM(forefather_of_element->up->left_depth,
@@ -321,7 +317,7 @@ PUBLIC void HTBTree_add ARGS2(
 			    }
                             forefather_of_element = forefather_of_element->up;
                             father_of_forefather = father_of_forefather->up;
-			} while ((depth != depth2) && 
+			} while ((depth != depth2) &&
 				 (father_of_forefather != NULL));
                         father_of_forefather = father_of_element->up;
                         if (father_of_forefather->left == father_of_element)
@@ -334,7 +330,7 @@ PUBLIC void HTBTree_add ARGS2(
                             **
                             ** 3 is used to show that it may not be the top of the
                             ** tree.
-                            */ 
+                            */
                             father_of_forefather->left = added_element;
                             father_of_element->left = added_element->right;
                             added_element->right = father_of_element;
@@ -364,7 +360,7 @@ PUBLIC void HTBTree_add ARGS2(
                         ** When tree   2   3        becomes    4    1
                         **            4 5                          5 3
                         **
-                        ** 1 is used to show that it is the top of the tree    
+                        ** 1 is used to show that it is the top of the tree
                         */
                         added_element->up = NULL;
                         father_of_element->left = added_element->right;
@@ -378,7 +374,7 @@ PUBLIC void HTBTree_add ARGS2(
 	        {
                     added_element = father_of_element->right;
                     father_of_element->right_depth = added_element->left_depth;
-                    added_element->left_depth = 1 + 
+                    added_element->left_depth = 1 +
                             MAXIMUM(father_of_element->right_depth,
                                 father_of_element->left_depth);
                     if (father_of_element->up != NULL)
@@ -389,9 +385,9 @@ PUBLIC void HTBTree_add ARGS2(
                         father_of_forefather = father_of_element->up;
                         forefather_of_element = added_element;
 			first_time = YES;
-                        do 
+                        do
                         {
-                            if (father_of_forefather->left 
+                            if (father_of_forefather->left
 				== forefather_of_element->up)
                             {
                                 depth = father_of_forefather->left_depth;
@@ -426,7 +422,7 @@ PUBLIC void HTBTree_add ARGS2(
 			    }
                             father_of_forefather = father_of_forefather->up;
                             forefather_of_element = forefather_of_element->up;
-			} while ((depth != depth2) && 
+			} while ((depth != depth2) &&
 				 (father_of_forefather != NULL));
                         father_of_forefather = father_of_element->up;
                         if (father_of_forefather->left == father_of_element)
@@ -496,7 +492,7 @@ PUBLIC HTBTElement * HTBTree_next ARGS2(
                                HTBTElement*,   ele)
     /**************************************************************************
     ** this function returns a pointer to the leftmost element if ele is NULL,
-    ** and to the next object to the right otherways.
+    ** and to the next object to the right otherwise.
     ** If no elements left, returns a pointer to NULL.
     */
 {
@@ -522,7 +518,7 @@ PUBLIC HTBTElement * HTBTree_next ARGS2(
         else
 	{
             father_of_forefather = father_of_element->up;
-	        while (father_of_forefather && 
+	        while (father_of_forefather &&
 		       (father_of_forefather->right == father_of_element))
       	        {
                     father_of_element = father_of_forefather;
@@ -544,7 +540,7 @@ PUBLIC HTBTElement * HTBTree_next ARGS2(
         else printf("Pas de Pere\n");
         if (father_of_element->left != NULL)
             printf("Objet du fils gauche = %s\t",
-		   (char *)father_of_element->left->object); 
+		   (char *)father_of_element->left->object);
         else printf("Pas de fils gauche\t");
         if (father_of_element->right != NULL)
             printf("Objet du fils droit = %s\n",
@@ -567,7 +563,7 @@ main ()
 {
     HTBTree * tree;
     HTBTElement * next_element;
-    
+
     tree = HTBTree_new((HTComparer)strcasecomp);
     HTBTree_add(tree,"hypertext");
     HTBTree_add(tree,"Addressing");
diff --git a/WWW/Library/Implementation/HTBTree.h b/WWW/Library/Implementation/HTBTree.h
index 55bfe6ab..6facd048 100644
--- a/WWW/Library/Implementation/HTBTree.h
+++ b/WWW/Library/Implementation/HTBTree.h
@@ -9,6 +9,11 @@
    part of libWWW
    
  */
+#ifndef HTBTREE_H
+#define HTBTREE_H 1
+
+#include <HTUtils.h>
+
 #ifdef SHORT_NAMES
 #define HTBTree_new             HTBTNew
 #define HTBTree_free            HTBTFree
@@ -99,6 +104,4 @@ Find next element in depth-first order
  */
 extern HTBTElement * HTBTree_next PARAMS((HTBTree* tree, HTBTElement * ele));
 
-/*
-
-   end  */
+#endif /* HTBTREE_H */
diff --git a/WWW/Library/Implementation/HTCJK.h b/WWW/Library/Implementation/HTCJK.h
index 19c8fa66..bc2c3aac 100644
--- a/WWW/Library/Implementation/HTCJK.h
+++ b/WWW/Library/Implementation/HTCJK.h
@@ -11,6 +11,8 @@
 #ifndef HTCJK_H
 #define HTCJK_H
 
+#include <HTUtils.h>
+
 /*
 **	STATUS CHANGE CODES
 */
diff --git a/WWW/Library/Implementation/HTChunk.c b/WWW/Library/Implementation/HTChunk.c
index 5a741a54..7cab693c 100644
--- a/WWW/Library/Implementation/HTChunk.c
+++ b/WWW/Library/Implementation/HTChunk.c
@@ -8,8 +8,6 @@
 
 #include <LYLeaks.h>
 
-#define FREE(x) if (x) {free(x); x = NULL;}
-
 /*	Create a chunk with a certain allocation unit
 **	--------------
 */
diff --git a/WWW/Library/Implementation/HTChunk.h b/WWW/Library/Implementation/HTChunk.h
index 84c12de7..2afcdd9d 100644
--- a/WWW/Library/Implementation/HTChunk.h
+++ b/WWW/Library/Implementation/HTChunk.h
@@ -7,6 +7,10 @@
    automatically reallocating them as necessary.
    
  */
+#ifndef HTCHUNK_H
+#define HTCHUNK_H 1
+
+#include <HTUtils.h>
 #include <UCMap.h>
 
 typedef struct {
@@ -166,6 +170,4 @@ Append a zero character to a  chunk
 
 extern void HTChunkTerminate PARAMS((HTChunk * ch));
 
-/*
-
-   end */
+#endif /* HTCHUNK_H */
diff --git a/WWW/Library/Implementation/HTDOS.c b/WWW/Library/Implementation/HTDOS.c
index 37e15962..c946d0c4 100644
--- a/WWW/Library/Implementation/HTDOS.c
+++ b/WWW/Library/Implementation/HTDOS.c
@@ -2,9 +2,7 @@
 
  */
 
-#include <mem.h>
-#include <dos.h>
-
+#include <HTUtils.h>
 
 /* PUBLIC							HTDOS_wwwName()
 **		CONVERTS DOS Name into WWW Name
diff --git a/WWW/Library/Implementation/HTFTP.c b/WWW/Library/Implementation/HTFTP.c
index 8e581838..bd5a2ce7 100644
--- a/WWW/Library/Implementation/HTFTP.c
+++ b/WWW/Library/Implementation/HTFTP.c
@@ -76,7 +76,6 @@ BUGS:	@@@	Limit connection cache size!
 #endif
 
 #include <HTUtils.h>
-#include <tcp.h>
 
 #include <HTAlert.h>
 
@@ -140,8 +139,6 @@ struct _HTStructured {
 	/* ... */
 };
 
-#define FREE(x) if (x) {free(x); x = NULL;}
-
 /*	Global Variables
 **	---------------------
 */
diff --git a/WWW/Library/Implementation/HTFTP.h b/WWW/Library/Implementation/HTFTP.h
index db26104a..7b857076 100644
--- a/WWW/Library/Implementation/HTFTP.h
+++ b/WWW/Library/Implementation/HTFTP.h
@@ -10,9 +10,6 @@
 #ifndef HTFTP_H
 #define HTFTP_H
 
-#ifndef HTUTILS_H
-#include <HTUtils.h>
-#endif /* HTUTILS_H */
 #include <HTAnchor.h>
 #include <HTStream.h>
 #include <HTParse.h>
diff --git a/WWW/Library/Implementation/HTFWriter.c b/WWW/Library/Implementation/HTFWriter.c
index 74d09866..f30461c9 100644
--- a/WWW/Library/Implementation/HTFWriter.c
+++ b/WWW/Library/Implementation/HTFWriter.c
@@ -18,8 +18,6 @@
 
 #include <LYLeaks.h>
 
-#define FREE(x) if (x) {free(x); x = NULL;}
-
 /*		Stream Object
 **		------------
 */
diff --git a/WWW/Library/Implementation/HTFWriter.h b/WWW/Library/Implementation/HTFWriter.h
index 4dd9bb0a..089ad0fb 100644
--- a/WWW/Library/Implementation/HTFWriter.h
+++ b/WWW/Library/Implementation/HTFWriter.h
@@ -8,9 +8,6 @@
 #ifndef HTFWRITE_H
 #define HTFWRITE_H
 
-#ifndef HTUTILS_H
-#include <HTUtils.h>
-#endif /* HTUTILS_H */
 #include <HTStream.h>
 #include <HTFormat.h>
 
diff --git a/WWW/Library/Implementation/HTFile.c b/WWW/Library/Implementation/HTFile.c
index a703fd45..c530db85 100644
--- a/WWW/Library/Implementation/HTFile.c
+++ b/WWW/Library/Implementation/HTFile.c
@@ -20,6 +20,8 @@
 **			 the device or top directory.
 */
 
+#include <HTUtils.h>
+
 #ifndef VMS
 /* #define LONG_LIST */ /* Define this for long style unix listings (ls -l) */
 /* #define NO_PARENT_DIR_REFERENCE */ /* Define this for no parent links */
@@ -31,8 +33,6 @@
 #include <HTDOS.h>
 #endif /* DOSPATH */
 
-#include <HTUtils.h>
-#include <tcp.h>
 #include <HTFile.h>		/* Implemented here */
 #ifdef VMS
 #include <stat.h>
@@ -54,8 +54,6 @@
 
 #define HT_EM_SPACE ((char)2)
 
-#define FREE(x) if (x) {free(x); x = NULL;}
-
 #ifdef VMS
 #include <HTVMSUtils.h>
 #endif /* VMS */
@@ -237,7 +235,7 @@ PRIVATE void LYListFmtParse ARGS5(
 			PUTS(buf);
 			END(HTML_A);
 #ifdef S_IFLNK
-			if (c != 'A' && (st.st_mode & S_IFMT) == S_IFLNK &&
+			if (c != 'A' && S_ISLNK(st.st_mode) &&
 			    (len = readlink(file, buf, sizeof(buf))) >= 0) {
 				PUTS(" -> ");
 				buf[len] = '\0';
@@ -271,7 +269,7 @@ PRIVATE void LYListFmtParse ARGS5(
 			break;
 
 		case 'K':	/* size in Kilobytes but not for directories */
-			if ((st.st_mode & S_IFMT) == S_IFDIR) {
+			if (S_ISDIR(st.st_mode)) {
 				sprintf(fmt, "%%%ss ", start);
 				sprintf(buf, fmt, "");
 				break;
@@ -1532,7 +1530,7 @@ PUBLIC int HTLoadFile ARGS4(
     if (HTStat(filename, &stat_info) == -1) {
 	CTRACE(tfp, "HTLoadFile: Can't stat %s\n", filename);
     } else {
-	if (((stat_info.st_mode) & S_IFMT) == S_IFDIR) {
+	if (S_ISDIR(stat_info.st_mode)) {
 	    if (HTDirAccess == HT_DIR_FORBID) {
 		FREE(filename);
 		FREE(nodename);
@@ -1896,7 +1894,7 @@ PUBLIC int HTLoadFile ARGS4(
 	    if (stat(localname,&dir_info) == -1) dir_info.st_mode = S_IFDIR;
 #endif
 
-	    if (((dir_info.st_mode) & S_IFMT) == S_IFDIR) {
+	    if (S_ISDIR(dir_info.st_mode)) {
 		/*
 		**  If localname is a directory.
 		*/
@@ -2058,7 +2056,7 @@ PUBLIC int HTLoadFile ARGS4(
 
 			StrAllocCat(tmpfilename, dirbuf->d_name);
 			stat(tmpfilename, &file_info);
-			if (((file_info.st_mode) & S_IFMT) == S_IFDIR)
+			if (S_ISDIR(file_info.st_mode))
 #ifndef DIRED_SUPPORT
 			    sprintf((char *)dirname, "D%s",dirbuf->d_name);
 			else
diff --git a/WWW/Library/Implementation/HTFinger.c b/WWW/Library/Implementation/HTFinger.c
index 89c5540c..0932b4d2 100644
--- a/WWW/Library/Implementation/HTFinger.c
+++ b/WWW/Library/Implementation/HTFinger.c
@@ -26,7 +26,6 @@
 */
 
 #include <HTUtils.h>
-#include <tcp.h>
 #include <HTAlert.h>
 #include <HTML.h>
 #include <HTParse.h>
@@ -40,8 +39,6 @@
 #define FINGER_PORT 79		/* See rfc742 */
 #define BIG 1024		/* Bug */
 
-#define FREE(x) if (x) {free(x); x = NULL;}
-
 #define PUTC(c) (*targetClass.put_character)(target, c)
 #define PUTS(s) (*targetClass.put_string)(target, s)
 #define START(e) (*targetClass.start_element)(target, e, 0, 0, -1, 0)
diff --git a/WWW/Library/Implementation/HTFormat.c b/WWW/Library/Implementation/HTFormat.c
index 4b69e1d4..3c20fc0a 100644
--- a/WWW/Library/Implementation/HTFormat.c
+++ b/WWW/Library/Implementation/HTFormat.c
@@ -11,7 +11,6 @@
 */
 
 #include <HTUtils.h>
-#include <tcp.h>
 #include <HTAccess.h>
 
 /* Implements:
@@ -52,8 +51,6 @@ PUBLIC long int HTMaxBytes  = 0;	/* No effective limit */
 #include <LYGlobalDefs.h>
 #include <LYLeaks.h>
 
-#define FREE(x) if (x) {free(x); x = NULL;}
-
 PUBLIC	BOOL HTOutputSource = NO;	/* Flag: shortcut parser to stdout */
 /* extern  BOOL interactive; LJM */
 
diff --git a/WWW/Library/Implementation/HTFormat.h b/WWW/Library/Implementation/HTFormat.h
index 866174a9..0e5c4634 100644
--- a/WWW/Library/Implementation/HTFormat.h
+++ b/WWW/Library/Implementation/HTFormat.h
@@ -14,9 +14,6 @@ Preamble
 #ifndef HTFORMAT_H
 #define HTFORMAT_H
 
-#ifndef HTUTILS_H
-#include <HTUtils.h>
-#endif /* HTUTILS_H */
 #include <HTStream.h>
 #include <HTAtom.h>
 #include <HTList.h>
diff --git a/WWW/Library/Implementation/HTGopher.c b/WWW/Library/Implementation/HTGopher.c
index 734b6f2f..9bfac99c 100644
--- a/WWW/Library/Implementation/HTGopher.c
+++ b/WWW/Library/Implementation/HTGopher.c
@@ -16,7 +16,6 @@
 */
 
 #include <HTUtils.h>		/* Coding convention macros */
-#include <tcp.h>
 #include <HTAlert.h>
 #include <HTParse.h>
 #include <HTTCP.h>
@@ -61,14 +60,10 @@
 #define GOPHER_PLUS_SOUND	'<'
 #define GOPHER_PLUS_PDF 	'P'
 
-#include <ctype.h>
-
 #include <HTParse.h>
 #include <HTFormat.h>
 #include <HTTCP.h>
 
-#define FREE(x) if (x) {free(x); x = NULL;}
-
 /*
 **  Hypertext object building machinery.
 */
diff --git a/WWW/Library/Implementation/HTGroup.c b/WWW/Library/Implementation/HTGroup.c
index 71fd1445..a1b6fa4a 100644
--- a/WWW/Library/Implementation/HTGroup.c
+++ b/WWW/Library/Implementation/HTGroup.c
@@ -42,9 +42,8 @@
 */
 
 
-
 #include <HTUtils.h>
-#include <string.h>
+
 #include <HTAAUtil.h>
 #include <HTLex.h>	/* Lexical analysor	*/
 #include <HTGroup.h>	/* Implemented here	*/
diff --git a/WWW/Library/Implementation/HTGroup.h b/WWW/Library/Implementation/HTGroup.h
index 398aa0bf..c578d3c3 100644
--- a/WWW/Library/Implementation/HTGroup.h
+++ b/WWW/Library/Implementation/HTGroup.h
@@ -5,9 +5,6 @@
 #ifndef HTGROUP_H
 #define HTGROUP_H
 
-#ifndef HTUTILS_H
-#include <HTUtils.h>
-#endif /* HTUTILS_H */
 #include <HTList.h>
 
 #ifdef SHORT_NAMES
diff --git a/WWW/Library/Implementation/HTHistory.c b/WWW/Library/Implementation/HTHistory.c
index bbb87d0a..fab1edc5 100644
--- a/WWW/Library/Implementation/HTHistory.c
+++ b/WWW/Library/Implementation/HTHistory.c
@@ -1,5 +1,4 @@
 #include <HTUtils.h>
-#include <tcp.h>		/* for standard io */
 
 #include <HTHistory.h>
 
diff --git a/WWW/Library/Implementation/HTInit.h b/WWW/Library/Implementation/HTInit.h
index a003a6b5..4785f3e8 100644
--- a/WWW/Library/Implementation/HTInit.h
+++ b/WWW/Library/Implementation/HTInit.h
@@ -10,14 +10,14 @@
    Implemented by HTInit.c by default.
    
  */
-#ifndef HTUTILS_H
+
+#ifndef HTINIT_H
+#define HTINIT_H 1
+
 #include <HTUtils.h>
-#endif /* HTUTILS_H */
 
 extern void HTFormatInit NOPARAMS;
 extern void HTPreparsedFormatInit NOPARAMS;
 extern void HTFileInit NOPARAMS;
 
-/*
-
-    */
+#endif /* HTINIT_H */
diff --git a/WWW/Library/Implementation/HTLex.c b/WWW/Library/Implementation/HTLex.c
index 56b1fdae..e7568ea6 100644
--- a/WWW/Library/Implementation/HTLex.c
+++ b/WWW/Library/Implementation/HTLex.c
@@ -14,6 +14,7 @@
 */
 
 #include <HTUtils.h>
+
 #include <HTAAUtil.h>
 #include <HTLex.h>	/* Implemented here */
 
diff --git a/WWW/Library/Implementation/HTLex.h b/WWW/Library/Implementation/HTLex.h
index dd02c3ae..205d6b19 100644
--- a/WWW/Library/Implementation/HTLex.h
+++ b/WWW/Library/Implementation/HTLex.h
@@ -5,16 +5,12 @@
 #ifndef HTLEX_H
 #define HTLEX_H
 
-#ifndef HTUTILS_H
 #include <HTUtils.h>
-#endif /* HTUTILS_H */
-
 
 #ifdef SHORT_NAMES
 #define lex_verb        lex_verbose
 #endif /*SHORT_NAMES*/
 
-
 typedef enum {
     LEX_NONE,		/* Internally used      */
     LEX_EOF,		/* End of file          */
@@ -59,6 +55,3 @@ PUBLIC char *lex_verbose PARAMS((LexItem lex_item));
  */
 
 #endif /* not HTLEX_H */
-/*
-
-   End of file HTLex.h.  */
diff --git a/WWW/Library/Implementation/HTList.c b/WWW/Library/Implementation/HTList.c
index 2cb89389..939af95b 100644
--- a/WWW/Library/Implementation/HTList.c
+++ b/WWW/Library/Implementation/HTList.c
@@ -11,9 +11,6 @@
 
 #include <LYLeaks.h>
 
-#define FREE(x) if (x) {free(x); x = NULL;}
-
-
 /*	Create list.
 */
 PUBLIC HTList * HTList_new NOARGS
diff --git a/WWW/Library/Implementation/HTList.h b/WWW/Library/Implementation/HTList.h
index 095308c1..c02c58af 100644
--- a/WWW/Library/Implementation/HTList.h
+++ b/WWW/Library/Implementation/HTList.h
@@ -7,9 +7,7 @@
 #ifndef HTLIST_H
 #define HTLIST_H
 
-#ifndef HTUTILS_H
-#include <HTUtils.h>  /* for BOOL type and PARAMS and ARGS*/
-#endif /* HTUTILS_H */
+#include <HTUtils.h>
 
 typedef struct _HTList HTList;
 
diff --git a/WWW/Library/Implementation/HTMIME.c b/WWW/Library/Implementation/HTMIME.c
index 21b865ec..82c0c8f1 100644
--- a/WWW/Library/Implementation/HTMIME.c
+++ b/WWW/Library/Implementation/HTMIME.c
@@ -23,8 +23,6 @@
 #include <LYStrings.h>
 #include <LYLeaks.h>
 
-#define FREE(x) if (x) {free(x); x = NULL;}
-
 extern CONST char *LYchar_set_names[];
 extern BOOLEAN LYRawMode;
 extern BOOL HTPassEightBitRaw;
diff --git a/WWW/Library/Implementation/HTMLDTD.h b/WWW/Library/Implementation/HTMLDTD.h
index 87c2bb76..a112b7e5 100644
--- a/WWW/Library/Implementation/HTMLDTD.h
+++ b/WWW/Library/Implementation/HTMLDTD.h
@@ -12,9 +12,6 @@
 #ifndef HTMLDTD_H
 #define HTMLDTD_H
 
-#ifndef HTUTILS_H
-#include <HTUtils.h>
-#endif /* HTUTILS_H */
 #include <SGML.h>
 
 /*
diff --git a/WWW/Library/Implementation/HTMLGen.c b/WWW/Library/Implementation/HTMLGen.c
index f1f89173..9581081f 100644
--- a/WWW/Library/Implementation/HTMLGen.c
+++ b/WWW/Library/Implementation/HTMLGen.c
@@ -13,7 +13,6 @@
 */
 
 #include <HTUtils.h>
-#include <tcp.h>
 
 #define BUFFER_SIZE    200	/* Line buffer attempts to make neat breaks */
 #define MAX_CLEANNESS	20
@@ -29,8 +28,6 @@
 
 #include <LYLeaks.h>
 
-#define FREE(x) if (x) {free(x); x = NULL;}
-
 #define PUTC(c) (*me->targetClass.put_character)(me->target, c)
 /* #define PUTS(s) (*me->targetClass.put_string)(me->target, s) */
 #define PUTB(s,l) (*me->targetClass.put_block)(me->target, s, l)
diff --git a/WWW/Library/Implementation/HTNews.c b/WWW/Library/Implementation/HTNews.c
index d450d901..2b547783 100644
--- a/WWW/Library/Implementation/HTNews.c
+++ b/WWW/Library/Implementation/HTNews.c
@@ -7,7 +7,6 @@
 */
 
 #include <HTUtils.h>		/* Coding convention macros */
-#include <tcp.h>
 
 /* Implements:
 */
@@ -17,8 +16,6 @@
 #include <HTMIME.h>
 #include <HTTCP.h>
 
-#define FREE(x) if (x) {free(x); x = NULL;}
-
 /* this define should be in HTFont.h :( */
 #define HT_NON_BREAK_SPACE ((char)1)   /* For now */
 
@@ -39,8 +36,6 @@ PUBLIC int HTNewsMaxChunk = 40; /* Largest number of articles in one window */
 #define NEWS_NETCLOSE  NETCLOSE
 #define NEXT_CHAR HTGetCharacter()
 
-#include <ctype.h>
-
 #include <HTML.h>
 #include <HTParse.h>
 #include <HTFormat.h>
diff --git a/WWW/Library/Implementation/HTParse.c b/WWW/Library/Implementation/HTParse.c
index d75b1fde..d25157b3 100644
--- a/WWW/Library/Implementation/HTParse.c
+++ b/WWW/Library/Implementation/HTParse.c
@@ -3,13 +3,10 @@
 */
 
 #include <HTUtils.h>
-#include <tcp.h>
 #include <HTParse.h>
 
 #include <LYLeaks.h>
 
-#define FREE(x) if (x) {free(x); x = NULL;}
-
 #define HEX_ESCAPE '%'
 
 struct struct_parts {
diff --git a/WWW/Library/Implementation/HTParse.h b/WWW/Library/Implementation/HTParse.h
index cf42d97b..bea789d0 100644
--- a/WWW/Library/Implementation/HTParse.h
+++ b/WWW/Library/Implementation/HTParse.h
@@ -8,9 +8,7 @@
 #ifndef HTPARSE_H
 #define HTPARSE_H
 
-#ifndef HTUTILS_H
 #include <HTUtils.h>
-#endif /* HTUTILS_H */
 
 /*
 **  The following are flag bits which may be ORed together to form
diff --git a/WWW/Library/Implementation/HTPasswd.c b/WWW/Library/Implementation/HTPasswd.c
index 27efb02f..764882d4 100644
--- a/WWW/Library/Implementation/HTPasswd.c
+++ b/WWW/Library/Implementation/HTPasswd.c
@@ -15,10 +15,8 @@
 **
 */
 
-
 #include <HTUtils.h>
-#include <tcp.h>	/* FROMASCII()		*/
-#include <string.h>
+
 #include <HTAAUtil.h>	/* Common parts of AA	*/
 #include <HTAAFile.h>	/* File routines	*/
 #include <HTAAServ.h>	/* Server routines	*/
diff --git a/WWW/Library/Implementation/HTPasswd.h b/WWW/Library/Implementation/HTPasswd.h
index b82d1d4e..09007192 100644
--- a/WWW/Library/Implementation/HTPasswd.h
+++ b/WWW/Library/Implementation/HTPasswd.h
@@ -5,9 +5,6 @@
 #ifndef HTPASSWD_H
 #define HTPASSWD_H
 
-#ifndef HTUTILS_H
-#include <HTUtils.h>
-#endif /* HTUTILS_H */
 #include <HTList.h>
 
 #ifdef SHORT_NAMES
diff --git a/WWW/Library/Implementation/HTPlain.c b/WWW/Library/Implementation/HTPlain.c
index b7b457d7..2744b7df 100644
--- a/WWW/Library/Implementation/HTPlain.c
+++ b/WWW/Library/Implementation/HTPlain.c
@@ -7,8 +7,8 @@
 **	Bugs:
 **		strings written must be less than buffer size.
 */
+
 #include <HTUtils.h>
-#include <tcp.h>
 
 #include <HTPlain.h>
 
@@ -31,8 +31,6 @@
 #include <LYCharSets.h>
 #include <LYLeaks.h>
 
-#define FREE(x) if (x) {free(x); x = NULL;}
-
 extern BOOL HTPassEightBitRaw;
 extern BOOL HTPassHighCtrlRaw;
 extern HTCJKlang HTCJK;
diff --git a/WWW/Library/Implementation/HTRules.c b/WWW/Library/Implementation/HTRules.c
index 91596190..e666618f 100644
--- a/WWW/Library/Implementation/HTRules.c
+++ b/WWW/Library/Implementation/HTRules.c
@@ -18,11 +18,11 @@
 **
 */
 
+#include <HTUtils.h>
+
 /* (c) CERN WorldWideWeb project 1990,91. See Copyright.html for details */
 #include <HTRules.h>
 
-#include <HTUtils.h>
-#include <tcp.h>
 #include <HTFile.h>
 #include <HTAAServ.h>	/* Access Authorization */
 
@@ -284,7 +284,6 @@ char * HTTranslate(required)
 		CTRACE(tfp, "HTRule: *** FAIL `%s'\n",
 			    current);
 		return (char *)0;
-
 	} /* if tail matches ... switch operation */
 
     } /* loop over rules */
diff --git a/WWW/Library/Implementation/HTRules.h b/WWW/Library/Implementation/HTRules.h
index d19b8a4b..3eb37169 100644
--- a/WWW/Library/Implementation/HTRules.h
+++ b/WWW/Library/Implementation/HTRules.h
@@ -16,9 +16,7 @@
 #ifndef HTRULE_H
 #define HTRULE_H
 
-#ifndef HTUTILS_H
 #include <HTUtils.h>
-#endif /* HTUTILS_H */
 
 typedef enum _HTRuleOp {
         HT_Invalid,
diff --git a/WWW/Library/Implementation/HTStream.h b/WWW/Library/Implementation/HTStream.h
index 5892a1a1..4588568e 100644
--- a/WWW/Library/Implementation/HTStream.h
+++ b/WWW/Library/Implementation/HTStream.h
@@ -13,9 +13,7 @@
 #ifndef HTSTREAM_H
 #define HTSTREAM_H
 
-#ifndef HTUTILS_H
 #include <HTUtils.h>
-#endif /* HTUTILS_H */
 
 typedef struct _HTStream HTStream;
 
diff --git a/WWW/Library/Implementation/HTString.c b/WWW/Library/Implementation/HTString.c
index b669c379..00f70a6c 100644
--- a/WWW/Library/Implementation/HTString.c
+++ b/WWW/Library/Implementation/HTString.c
@@ -6,15 +6,12 @@
 **	23 Jan 92 (TBL) Changed strallocc* to 8 char HTSAC* for VM and suchlike
 **	 6 Oct 92 (TBL) Moved WWW_TraceFlag in here to be in library
 */
-#include <ctype.h>
+
 #include <HTUtils.h>
-#include <tcp.h>
 
 #include <LYLeaks.h>
 #include <LYStrings.h>
 
-#define FREE(x) if (x) {free(x); x = NULL;}
-
 PUBLIC int WWW_TraceFlag = 0;	/* Global trace flag for ALL W3 code */
 
 #ifndef VC
diff --git a/WWW/Library/Implementation/HTString.h b/WWW/Library/Implementation/HTString.h
index 25c57002..0609cb00 100644
--- a/WWW/Library/Implementation/HTString.h
+++ b/WWW/Library/Implementation/HTString.h
@@ -7,9 +7,7 @@
 #ifndef HTSTRING_H
 #define HTSTRING_H
 
-#ifndef HTUTILS_H
 #include <HTUtils.h>
-#endif /* HTUTILS_H */
 
 extern int WWW_TraceFlag;       /* Global flag for all W3 trace */
 
diff --git a/WWW/Library/Implementation/HTStyle.c b/WWW/Library/Implementation/HTStyle.c
index 963303d9..3469e44a 100644
--- a/WWW/Library/Implementation/HTStyle.c
+++ b/WWW/Library/Implementation/HTStyle.c
@@ -8,13 +8,12 @@
 **	translation necessary to
 **	represent a document. It is a linked list of styles.
 */
+
 #include <HTUtils.h>
 #include <HTStyle.h>
 
 #include <LYLeaks.h>
 
-#define FREE(x) if (x) {free(x); x = NULL;}
-
 /*	Create a new style
 */
 PUBLIC HTStyle* HTStyleNew NOARGS
diff --git a/WWW/Library/Implementation/HTStyle.h b/WWW/Library/Implementation/HTStyle.h
index ae3e5d54..b4fcedaa 100644
--- a/WWW/Library/Implementation/HTStyle.h
+++ b/WWW/Library/Implementation/HTStyle.h
@@ -32,9 +32,6 @@ Overriding this module
 #ifndef HTStyle_H
 #define HTStyle_H
 
-#ifndef HTUTILS_H
-#include <HTUtils.h>
-#endif /* HTUTILS_H */
 #include <HTAnchor.h>
 
 typedef long int HTFont;        /* Dummy definition instead */
diff --git a/WWW/Library/Implementation/HTTCP.c b/WWW/Library/Implementation/HTTCP.c
index 0cd62330..2eb3b458 100644
--- a/WWW/Library/Implementation/HTTCP.c
+++ b/WWW/Library/Implementation/HTTCP.c
@@ -17,7 +17,6 @@
 */
 
 #include <HTUtils.h>
-#include <tcp.h>		/* Defines SHORT_NAMES if necessary */
 #include <HTAccess.h>
 #include <HTParse.h>
 #include <HTAlert.h>
@@ -29,8 +28,6 @@
 #include <sys/wait.h>
 #endif /* NSL_FORK */
 
-#define FREE(x) if (x) {free(x); x = NULL;}
-
 #define OK_HOST(p) ((p) != 0 && (p->h_length) != 0)
 
 #ifdef SVR4_BSDSELECT
diff --git a/WWW/Library/Implementation/HTTCP.h b/WWW/Library/Implementation/HTTCP.h
index c7f16dcc..05e8278f 100644
--- a/WWW/Library/Implementation/HTTCP.h
+++ b/WWW/Library/Implementation/HTTCP.h
@@ -7,10 +7,7 @@
 #ifndef HTTCP_H
 #define HTTCP_H
 
-#ifndef HTUTILS_H
 #include <HTUtils.h>
-#endif /* HTUTILS_H */
-#include <tcp.h>
 
 #ifdef SHORT_NAMES
 #define HTInetStatus            HTInStat
@@ -115,6 +112,3 @@ extern int HTDoRead PARAMS((
 	unsigned 	nbyte));
 
 #endif   /* HTTCP_H */
-/*
-
-   End.  */
diff --git a/WWW/Library/Implementation/HTTP.c b/WWW/Library/Implementation/HTTP.c
index bee88b13..026d6c31 100644
--- a/WWW/Library/Implementation/HTTP.c
+++ b/WWW/Library/Implementation/HTTP.c
@@ -7,7 +7,6 @@
 */
 
 #include <HTUtils.h>
-#include <tcp.h>
 
 #include <HTTP.h>
 
@@ -25,7 +24,6 @@
 #include <HTTCP.h>
 #include <HTFormat.h>
 #include <HTFile.h>
-#include <ctype.h>
 #include <HTAlert.h>
 #include <HTMIME.h>
 #include <HTML.h>
diff --git a/WWW/Library/Implementation/HTTelnet.c b/WWW/Library/Implementation/HTTelnet.c
index 2ee009b9..6ed9a738 100644
--- a/WWW/Library/Implementation/HTTelnet.c
+++ b/WWW/Library/Implementation/HTTelnet.c
@@ -14,7 +14,6 @@
 */
 
 #include <HTUtils.h>
-#include <tcp.h>
 
 /* Implements:
 */
@@ -34,8 +33,6 @@
 
 #include <LYLeaks.h>
 
-#define FREE(x) if (x) {free(x); x = NULL;}
-
 #define HT_NO_DATA -9999
 
 
diff --git a/WWW/Library/Implementation/HTUU.h b/WWW/Library/Implementation/HTUU.h
index 9c72a115..3594b276 100644
--- a/WWW/Library/Implementation/HTUU.h
+++ b/WWW/Library/Implementation/HTUU.h
@@ -11,9 +11,7 @@
 #ifndef HTUU_H
 #define HTUU_H
 
-#ifndef HTUTILS_H
 #include <HTUtils.h>
-#endif /* HTUTILS_H */
 
 PUBLIC int HTUU_encode PARAMS((unsigned char *bufin,
                                unsigned int nbytes,
@@ -24,6 +22,3 @@ PUBLIC int HTUU_decode PARAMS((char *bufcoded,
                                int outbufsize));
 
 #endif
-/*
-
-   End of file.  */
diff --git a/WWW/Library/Implementation/HTUtils.h b/WWW/Library/Implementation/HTUtils.h
index 5b9ad930..d1cdf51f 100644
--- a/WWW/Library/Implementation/HTUtils.h
+++ b/WWW/Library/Implementation/HTUtils.h
@@ -1,9 +1,7 @@
-/*                                                    Utitlity macros for the W3 code library
+/*                                       Utility macros for the W3 code library
                                   MACROS FOR GENERAL USE
                                              
-   Generates: HTUtils.h
-   
-   See also: the system dependent file "tcp.h"
+   See also: the system dependent file "tcp.h", which is included here.
    
  */
 
@@ -19,18 +17,6 @@
 #include <sys/types.h>
 #include <stdio.h>
 
-/*
- * We force this include-ordering since socks.h contains redefinitions of
- * functions that probably are prototyped via other includes.  The socks.h
- * definitions have to be included everywhere, since they're making wrappers
- * for the stdio functions as well as the network functions.
- */
-#if defined(USE_SOCKS5) && !defined(DONT_USE_SOCKS5)
-#define SOCKS4TO5
-#define SHORTENED_RBIND
-#include <socks.h>
-#endif /* USE_SOCKS5 */
-
 #else
 
 #include <stdio.h>
@@ -183,7 +169,6 @@ Standard C library for malloc() etc
 
 #include <stdlib.h>
 #include <unixlib.h>
-#include <ctype.h>
 #if defined(VAXC) && !defined(__DECC)
 #define malloc	VAXC$MALLOC_OPT
 #define calloc	VAXC$CALLOC_OPT
@@ -322,6 +307,7 @@ Sucess (>=0) and failure (<0) codes
 
 #define HT_ERROR                -1      /* Generic failure */
 
+#define HT_CANNOT_TRANSLATE -4
 #define HT_NO_ACCESS    -10             /* Access not available */
 #define HT_FORBIDDEN    -11             /* Access forbidden */
 #define HT_INTERNAL     -12             /* Weird -- should never happen. */
@@ -370,6 +356,8 @@ Upper- and Lowercase macros
 #define TOUPPER(c) (islower((unsigned char)c) ? toupper((unsigned char)c) : ((unsigned char)c))
 #endif /* TOLOWER */
 
+#define FREE(x) if (x) {free(x); x = NULL;}
+
 /*
 
 The local equivalents of CR and LF
@@ -387,8 +375,18 @@ The local equivalents of CR and LF
 
 extern FILE *TraceFP NOPARAMS;
 
-#endif /* HTUTILS_H */
+#include <tcp.h>
 
 /*
+ * We force this include-ordering since socks.h contains redefinitions of
+ * functions that probably are prototyped via other includes.  The socks.h
+ * definitions have to be included everywhere, since they're making wrappers
+ * for the stdio functions as well as the network functions.
+ */
+#if defined(USE_SOCKS5) && !defined(DONT_USE_SOCKS5)
+#define SOCKS4TO5
+#define SHORTENED_RBIND
+#include <socks.h>
+#endif /* USE_SOCKS5 */
 
-   end of utilities */
+#endif /* HTUTILS_H */
diff --git a/WWW/Library/Implementation/HTVMSUtils.c b/WWW/Library/Implementation/HTVMSUtils.c
index a8ec136b..d2e981a9 100644
--- a/WWW/Library/Implementation/HTVMSUtils.c
+++ b/WWW/Library/Implementation/HTVMSUtils.c
@@ -14,7 +14,6 @@
 */
 
 #include <HTUtils.h>
-#include <tcp.h>
 #include <HTFormat.h>
 #include <HTStream.h>
 #include <UCDefs.h>
@@ -377,7 +376,7 @@ PUBLIC char * HTVMS_name ARGS2(
 */
 PUBLIC int HTStat ARGS2(
 	CONST char *, filename, 
-	stat_t *, info)
+	struct stat *, info)
 {
    /* 
       the following stuff does not work in VMS with a normal stat...
@@ -473,9 +472,6 @@ char Name[256];
    return(Result);
 }
 
-/*** "dirent.h" ***/
-/* #include <types.h>	already in tcp.h */
-
 #ifndef	_POSIX_SOURCE
 #define	d_ino	d_fileno	/* compatability */
 #ifndef	NULL
@@ -1107,7 +1103,7 @@ PUBLIC int HTVMSBrowseDir ARGS4(
 	    StrAllocCopy(entry_info->type, cp);
 
 	    StrAllocCopy(entry_info->filename, dirbuf->d_name);
-	    if ((file_info.st_mode & S_IFMT) == S_IFDIR) {
+	    if (S_ISDIR(file_info.st_mode)) {
 	        /* strip .DIR part... */
                 char *dot;
                 dot = strstr(entry_info->filename, ".DIR");
@@ -1157,7 +1153,7 @@ PUBLIC int HTVMSBrowseDir ARGS4(
 	    }
 
 	    /* Get the size */
-	    if ((file_info.st_mode & S_IFMT) != S_IFDIR)
+	    if (!S_ISDIR(file_info.st_mode))
 	        entry_info->size = (unsigned int)file_info.st_size;
 	    else
 	        entry_info->size = 0;
diff --git a/WWW/Library/Implementation/HTVMSUtils.h b/WWW/Library/Implementation/HTVMSUtils.h
index e055d672..da6b9432 100644
--- a/WWW/Library/Implementation/HTVMSUtils.h
+++ b/WWW/Library/Implementation/HTVMSUtils.h
@@ -5,7 +5,8 @@
 #ifndef HTVMSUTIL_H
 #define HTVMSUTIL_H
 
-#include <stat.h>
+#include <HTUtils.h>
+#include <HTAnchor.h>
 
 extern BOOL HTVMSFileVersions;	/* Include version numbers in listing? */
 
@@ -102,7 +103,7 @@ PUBLIC char * HTVMS_name PARAMS((
 
 PUBLIC int HTStat PARAMS((
 	CONST char * filename,
-        stat_t * info));
+        struct stat * info));
 
 PUBLIC int HTVMSBrowseDir PARAMS((
 	CONST char * address,
@@ -111,6 +112,3 @@ PUBLIC int HTVMSBrowseDir PARAMS((
 	HTStream * sink));
 
 #endif /* not HTVMSUTIL_H */
-/*
-
-   End of file HTVMSUtil.h.  */
diff --git a/WWW/Library/Implementation/HTVMS_WaisProt.c b/WWW/Library/Implementation/HTVMS_WaisProt.c
index 543de7ad..76081407 100644
--- a/WWW/Library/Implementation/HTVMS_WaisProt.c
+++ b/WWW/Library/Implementation/HTVMS_WaisProt.c
@@ -32,7 +32,6 @@
 */
 
 #include <HTUtils.h>
-#include <tcp.h>
 #include <HTVMS_WaisUI.h>
 #include <HTVMS_WaisProt.h>
 
@@ -58,7 +57,7 @@
 
 /*----------------------------------------------------------------------*/
 
-static unsigned long userInfoTagSize _AP((data_tag tag,
+static unsigned long userInfoTagSize PARAMS((data_tag tag,
 					  unsigned long length));
 
 static unsigned long
@@ -80,7 +79,7 @@ unsigned long length;
 
 /*----------------------------------------------------------------------*/
 
-static char* writeUserInfoHeader _AP((data_tag tag,long infoSize,	
+static char* writeUserInfoHeader PARAMS((data_tag tag,long infoSize,	
 				      long estHeaderSize,char* buffer,
 				      long* len));
 
@@ -127,7 +126,7 @@ long* len;
 
 /*----------------------------------------------------------------------*/
 
-static char* readUserInfoHeader _AP((data_tag* tag,unsigned long* num,
+static char* readUserInfoHeader PARAMS((data_tag* tag,unsigned long* num,
 				     char* buffer));
 
 static char*
@@ -228,8 +227,8 @@ char* buffer;
   char* buf = buffer;
   unsigned long size; 
   unsigned long headerSize;
-  data_tag tag;
   long chunkCode,chunkIDLen;
+  data_tag tag1;
   char* chunkMarker = NULL;
   char* highlightMarker = NULL;
   char* deHighlightMarker = NULL;
@@ -237,7 +236,7 @@ char* buffer;
   
   chunkCode = chunkIDLen = UNUSED;
   
-  buf = readUserInfoHeader(&tag,&size,buf);
+  buf = readUserInfoHeader(&tag1,&size,buf);
   headerSize = buf - buffer;
     
   while (buf < (buffer + size + headerSize))
@@ -436,7 +435,7 @@ DocObj* doc;
 
 /*----------------------------------------------------------------------*/
 
-static char* writeDocObj _AP((DocObj* doc,char* buffer,long* len));
+static char* writeDocObj PARAMS((DocObj* doc,char* buffer,long* len));
 
 static char*
 writeDocObj(doc,buffer,len)
@@ -483,7 +482,7 @@ long* len;
 
 /*----------------------------------------------------------------------*/
 
-static char* readDocObj _AP((DocObj** doc,char* buffer));
+static char* readDocObj PARAMS((DocObj** doc,char* buffer));
 
 static char*
 readDocObj(doc,buffer)
@@ -610,7 +609,7 @@ char* buffer;
     { char* buf = buffer;
       unsigned long size; 
       unsigned long headerSize;
-      data_tag tag;
+      data_tag tag1;
       char* seedWords = NULL;
       char* beginDateRange = NULL;
       char* endDateRange = NULL;
@@ -624,7 +623,7 @@ char* buffer;
 
       dateFactor = maxDocsRetrieved = UNUSED;
   
-      buf = readUserInfoHeader(&tag,&size,buf);
+      buf = readUserInfoHeader(&tag1,&size,buf);
       headerSize = buf - buffer;
   
       while (buf < (buffer + size + headerSize))
@@ -769,7 +768,7 @@ long* len;
   unsigned long header_len = userInfoTagSize(DT_DocumentHeaderGroup ,
 					     DefWAISDocHeaderSize);
   char* buf = buffer + header_len;
-  unsigned long size;
+  unsigned long size1;
   
   RESERVE_SPACE_FOR_WAIS_HEADER(len);
    
@@ -800,8 +799,8 @@ long* len;
   buf = writeString(header->OriginCity,DT_OriginCity,buf,len);
   
   /* now write the header and size */
-  size = buf - buffer; 
-  buf = writeUserInfoHeader(DT_DocumentHeaderGroup,size,header_len,buffer,len);
+  size1 = buf - buffer; 
+  buf = writeUserInfoHeader(DT_DocumentHeaderGroup,size1,header_len,buffer,len);
 
   return(buf);
 }
@@ -814,9 +813,9 @@ WAISDocumentHeader** header;
 char* buffer;
 {
   char* buf = buffer;
-  unsigned long size; 
+  unsigned long size1; 
   unsigned long headerSize;
-  data_tag tag;
+  data_tag tag1;
   any* docID = NULL;
   long versionNumber,score,bestMatch,docLength,lines;
   char** types = NULL;
@@ -827,10 +826,10 @@ char* buffer;
   
   versionNumber = score = bestMatch = docLength = lines = UNUSED;
   
-  buf = readUserInfoHeader(&tag,&size,buf);
+  buf = readUserInfoHeader(&tag1,&size1,buf);
   headerSize = buf - buffer;
     
-  while (buf < (buffer + size + headerSize))
+  while (buf < (buffer + size1 + headerSize))
     { data_tag tag = peekTag(buf);
       switch (tag)
 	{ case DT_DocumentID:
@@ -977,13 +976,13 @@ char* buffer;
   char* buf = buffer;
   unsigned long size; 
   unsigned long headerSize;
-  data_tag tag;
+  data_tag tag1;
   any* docID = NULL;
   long versionNumber,score,bestMatch,docLength,lines;
   
   versionNumber = score = bestMatch = docLength = lines = UNUSED;
   
-  buf = readUserInfoHeader(&tag,&size,buf);
+  buf = readUserInfoHeader(&tag1,&size,buf);
   headerSize = buf - buffer;
     
   while (buf < (buffer + size + headerSize))
@@ -1105,7 +1104,7 @@ long* len;
   unsigned long header_len = userInfoTagSize(DT_DocumentLongHeaderGroup ,
 					     DefWAISLongHeaderSize);
   char* buf = buffer + header_len;
-  unsigned long size;
+  unsigned long size1;
   
   RESERVE_SPACE_FOR_WAIS_HEADER(len);
    
@@ -1139,8 +1138,8 @@ long* len;
   buf = writeString(header->IndustryCodes,DT_IndustryCodes,buf,len);
   
   /* now write the header and size */
-  size = buf - buffer; 
-  buf = writeUserInfoHeader(DT_DocumentLongHeaderGroup,size,header_len,buffer,len);
+  size1 = buf - buffer; 
+  buf = writeUserInfoHeader(DT_DocumentLongHeaderGroup,size1,header_len,buffer,len);
 
   return(buf);
 }
@@ -1153,9 +1152,9 @@ WAISDocumentLongHeader** header;
 char* buffer;
 {
   char* buf = buffer;
-  unsigned long size; 
+  unsigned long size1; 
   unsigned long headerSize;
-  data_tag tag;
+  data_tag tag1;
   any* docID;
   long versionNumber,score,bestMatch,docLength,lines;
   char **types;
@@ -1166,10 +1165,10 @@ char* buffer;
   types = NULL;
   source = date = headline = originCity = stockCodes = companyCodes = industryCodes = NULL;
   
-  buf = readUserInfoHeader(&tag,&size,buf);
+  buf = readUserInfoHeader(&tag1,&size1,buf);
   headerSize = buf - buffer;
     
-  while (buf < (buffer + size + headerSize))
+  while (buf < (buffer + size1 + headerSize))
     { data_tag tag = peekTag(buf);
       switch (tag)
 	{ case DT_DocumentID:
@@ -1396,7 +1395,7 @@ long* len;
 /*----------------------------------------------------------------------*/
 
 static void
-cleanUpWaisSearchResponse _AP((char* buf,char* seedWordsUsed,
+cleanUpWaisSearchResponse PARAMS((char* buf,char* seedWordsUsed,
 			       WAISDocumentHeader** docHeaders,
 			       WAISDocumentShortHeader** shortHeaders,
 			       WAISDocumentLongHeader** longHeaders,
@@ -1474,7 +1473,7 @@ char* buffer;
   char* buf = buffer;
   unsigned long size; 
   unsigned long headerSize;
-  data_tag tag;
+  data_tag tag1;
   void* header = NULL;
   WAISDocumentHeader** docHeaders = NULL;
   WAISDocumentShortHeader** shortHeaders = NULL;
@@ -1491,7 +1490,7 @@ char* buffer;
   
   numDocHeaders = numLongHeaders = numShortHeaders = numText = numHeadlines = numCodes = 0;
   
-  buf = readUserInfoHeader(&tag,&size,buf);
+  buf = readUserInfoHeader(&tag1,&size,buf);
   headerSize = buf - buffer;
     
   while (buf < (buffer + size + headerSize))
@@ -1672,14 +1671,14 @@ char* buffer;
   char* buf = buffer;
   unsigned long size; 
   unsigned long headerSize;
-  data_tag tag;
+  data_tag tag1;
   any *docID,*documentText;
   long versionNumber;
   
   docID = documentText = NULL;
   versionNumber = UNUSED;
   
-  buf = readUserInfoHeader(&tag,&size,buf);
+  buf = readUserInfoHeader(&tag1,&size,buf);
   headerSize = buf - buffer;
     
   while (buf < (buffer + size + headerSize))
@@ -1788,7 +1787,7 @@ char* buffer;
   char* buf = buffer;
   unsigned long size; 
   unsigned long headerSize;
-  data_tag tag;
+  data_tag tag1;
   any* docID;
   long versionNumber;
   char *source,*date,*headline,*originCity;
@@ -1797,7 +1796,7 @@ char* buffer;
   versionNumber = UNUSED;
   source = date = headline = originCity = NULL;
   
-  buf = readUserInfoHeader(&tag,&size,buf);
+  buf = readUserInfoHeader(&tag1,&size,buf);
   headerSize = buf - buffer;
     
   while (buf < (buffer + size + headerSize))
@@ -1913,7 +1912,7 @@ char* buffer;
   char* buf = buffer;
   unsigned long size; 
   unsigned long headerSize;
-  data_tag tag;
+  data_tag tag1;
   any* docID;
   long versionNumber;
   char *stockCodes,*companyCodes,*industryCodes;
@@ -1922,7 +1921,7 @@ char* buffer;
   versionNumber = UNUSED;
   stockCodes = companyCodes = industryCodes = NULL;
   
-  buf = readUserInfoHeader(&tag,&size,buf);
+  buf = readUserInfoHeader(&tag1,&size,buf);
   headerSize = buf - buffer;
     
   while (buf < (buffer + size + headerSize))
@@ -1962,9 +1961,9 @@ char* buffer;
 
 char* 
 writePresentInfo(present,buffer,len)
-PresentAPDU* present;
+PresentAPDU* present GCC_UNUSED;
 char* buffer;
-long* len;
+long* len GCC_UNUSED;
 {
   /* The WAIS protocol doesn't use present info */
   return(buffer);
@@ -1986,9 +1985,9 @@ char* buffer;
 
 char* 
 writePresentResponseInfo(response,buffer,len)
-PresentResponseAPDU* response;
+PresentResponseAPDU* response GCC_UNUSED;
 char* buffer;
-long* len;
+long* len GCC_UNUSED;
 {
   /* The WAIS protocol doesn't use presentResponse info */
   return(buffer);
@@ -2045,7 +2044,7 @@ char* buffer;
         ( XXX return type could be in the element set)
 */
 
-static query_term** makeWAISQueryTerms _AP((DocObj** docs));
+static query_term** makeWAISQueryTerms PARAMS((DocObj** docs));
    
 static query_term**
 makeWAISQueryTerms(docs)
@@ -2164,7 +2163,7 @@ DocObj** docs;
 
 /*----------------------------------------------------------------------*/
 
-static DocObj** makeWAISQueryDocs _AP((query_term** terms));
+static DocObj** makeWAISQueryDocs PARAMS((query_term** terms));
 
 static DocObj** 
 makeWAISQueryDocs(terms)
diff --git a/WWW/Library/Implementation/HTVMS_WaisProt.h b/WWW/Library/Implementation/HTVMS_WaisProt.h
index 1a4e83d5..1b2329b1 100644
--- a/WWW/Library/Implementation/HTVMS_WaisProt.h
+++ b/WWW/Library/Implementation/HTVMS_WaisProt.h
@@ -29,9 +29,11 @@
 */
 
 #ifndef _H_WAIS_protocol_
-
 #define _H_WAIS_protocol_
 
+#include <HTUtils.h>
+#include <HTVMS_WaisUI.h>
+
 /*----------------------------------------------------------------------*/
 /* Data types / constants */
 
@@ -218,88 +220,97 @@ typedef struct WAISSearchResponse {
 /*----------------------------------------------------------------------*/
 /* Functions */
 
-DocObj* makeDocObjUsingWholeDocument _AP((any* aDocID,char* type));
-DocObj* makeDocObjUsingBytes _AP((any* aDocID,char* type,long start,long end));
-DocObj* makeDocObjUsingLines _AP((any* aDocID,char* type,long start,long end));
-DocObj* makeDocObjUsingParagraphs _AP((any* aDocID,char* type,any* start,any* end));
-void freeDocObj _AP((DocObj* doc));
-
-WAISInitResponse* makeWAISInitResponse _AP((long chunkCode,long chunkIDLen,
+char *
+generate_search_apdu PARAMS((char* buff,  /* buffer to hold the apdu */
+			  long *buff_len, /* number of bytes written to the buffer */
+			  char *seed_words, /* string of the seed words */
+			  char *database_name,
+			  DocObj** docobjs,
+			  long maxDocsRetrieved
+			  ));
+
+DocObj* makeDocObjUsingWholeDocument PARAMS((any* aDocID,char* type));
+DocObj* makeDocObjUsingBytes PARAMS((any* aDocID,char* type,long start,long end));
+DocObj* makeDocObjUsingLines PARAMS((any* aDocID,char* type,long start,long end));
+DocObj* makeDocObjUsingParagraphs PARAMS((any* aDocID,char* type,any* start,any* end));
+void freeDocObj PARAMS((DocObj* doc));
+
+WAISInitResponse* makeWAISInitResponse PARAMS((long chunkCode,long chunkIDLen,
 					    char* chunkMarker,char* highlightMarker,
 					    char* deHighlightMarker,char* newLineChars));
-void freeWAISInitResponse _AP((WAISInitResponse* init));
+void freeWAISInitResponse PARAMS((WAISInitResponse* init));
 
-WAISSearch* makeWAISSearch _AP((
+WAISSearch* makeWAISSearch PARAMS((
 	char* seedWords,DocObj** docs,char** textList,
 	long dateFactor,char* beginDateRange,char* endDateRange,
 	long maxDocsRetrieved));
-void freeWAISSearch _AP((WAISSearch* query));
+void freeWAISSearch PARAMS((WAISSearch* query));
 
-WAISDocumentHeader* makeWAISDocumentHeader _AP((
+WAISDocumentHeader* makeWAISDocumentHeader PARAMS((
 	any* aDocID,long versionNumber,long score,long bestMatch,long docLen,
 	long lines,char** types,char* source,char* date,char* headline,char* originCity));
-void freeWAISDocumentHeader _AP((WAISDocumentHeader* header));
-char* writeWAISDocumentHeader _AP((WAISDocumentHeader* header,char* buffer,long* len));
-char* readWAISDocumentHeader _AP((WAISDocumentHeader** header,char* buffer));
+void freeWAISDocumentHeader PARAMS((WAISDocumentHeader* header));
+char* writeWAISDocumentHeader PARAMS((WAISDocumentHeader* header,char* buffer,long* len));
+char* readWAISDocumentHeader PARAMS((WAISDocumentHeader** header,char* buffer));
 
-WAISDocumentShortHeader* makeWAISDocumentShortHeader _AP((
+WAISDocumentShortHeader* makeWAISDocumentShortHeader PARAMS((
 	any* aDocID,long versionNumber,long score,long bestMatch,long docLen,long lines));
-void freeWAISDocumentShortHeader _AP((WAISDocumentShortHeader* header));
-char* writeWAISDocumentShortHeader _AP((WAISDocumentShortHeader* header,
+void freeWAISDocumentShortHeader PARAMS((WAISDocumentShortHeader* header));
+char* writeWAISDocumentShortHeader PARAMS((WAISDocumentShortHeader* header,
                                    char* buffer,long* len));
-char* readWAISDocumentShortHeader _AP((WAISDocumentShortHeader** header,char* buffer));
+char* readWAISDocumentShortHeader PARAMS((WAISDocumentShortHeader** header,char* buffer));
 
-WAISDocumentLongHeader* makeWAISDocumentLongHeader _AP((
+WAISDocumentLongHeader* makeWAISDocumentLongHeader PARAMS((
 	any* aDocID,long versionNumber,long score,long bestMatch,long docLen,
 	long lines,char** types,char* source,char* date, char* headline,char* originCity,
 	char* stockCodes,char* companyCodes,char* industryCodes));
-void freeWAISDocumentLongHeader _AP((WAISDocumentLongHeader* header));
-char* writeWAISDocumentLongHeader _AP((WAISDocumentLongHeader* header,char* buffer,long* len));
-char* readWAISDocumentLongHeader _AP((WAISDocumentLongHeader** header,char* buffer));
+void freeWAISDocumentLongHeader PARAMS((WAISDocumentLongHeader* header));
+char* writeWAISDocumentLongHeader PARAMS((WAISDocumentLongHeader* header,char* buffer,long* len));
+char* readWAISDocumentLongHeader PARAMS((WAISDocumentLongHeader** header,char* buffer));
 
-WAISSearchResponse* makeWAISSearchResponse _AP((
+WAISSearchResponse* makeWAISSearchResponse PARAMS((
 	char* seedWordsUsed,WAISDocumentHeader** docHeaders,
 	WAISDocumentShortHeader** shortHeaders,
 	WAISDocumentLongHeader** longHeaders,
 	WAISDocumentText** text,WAISDocumentHeadlines** headlines,
 	WAISDocumentCodes** codes,
 	diagnosticRecord** diagnostics));
-void freeWAISSearchResponse _AP((WAISSearchResponse* response));
+void freeWAISSearchResponse PARAMS((WAISSearchResponse* response));
 
-WAISDocumentText* makeWAISDocumentText _AP((any* aDocID,long versionNumber,
+WAISDocumentText* makeWAISDocumentText PARAMS((any* aDocID,long versionNumber,
 				       any* documentText));
-void freeWAISDocumentText _AP((WAISDocumentText* docText));
-char* writeWAISDocumentText _AP((WAISDocumentText* docText,char* buffer,long* len));
-char* readWAISDocumentText _AP((WAISDocumentText** docText,char* buffer));
+void freeWAISDocumentText PARAMS((WAISDocumentText* docText));
+char* writeWAISDocumentText PARAMS((WAISDocumentText* docText,char* buffer,long* len));
+char* readWAISDocumentText PARAMS((WAISDocumentText** docText,char* buffer));
 
-WAISDocumentHeadlines* makeWAISDocumentHeadlines _AP((
+WAISDocumentHeadlines* makeWAISDocumentHeadlines PARAMS((
 	any* aDocID,long versionNumber,char* source,char* date,char* headline,
 	char* originCity));
-void freeWAISDocumentHeadlines _AP((WAISDocumentHeadlines* docHeadline));
-char* writeWAISDocumentHeadlines _AP((WAISDocumentHeadlines* docHeadline,char* buffer,long* len));
-char* readWAISDocumentHeadlines _AP((WAISDocumentHeadlines** docHeadline,char* buffer));
+void freeWAISDocumentHeadlines PARAMS((WAISDocumentHeadlines* docHeadline));
+char* writeWAISDocumentHeadlines PARAMS((WAISDocumentHeadlines* docHeadline,char* buffer,long* len));
+char* readWAISDocumentHeadlines PARAMS((WAISDocumentHeadlines** docHeadline,char* buffer));
 
-WAISDocumentCodes* makeWAISDocumentCodes _AP((
+WAISDocumentCodes* makeWAISDocumentCodes PARAMS((
 	any* aDocID,long versionNumber,char* stockCodes,char* companyCodes,
 	char* industryCodes));
-void freeWAISDocumentCodes _AP((WAISDocumentCodes* docCodes));
-char* writeWAISDocumentCodes _AP((WAISDocumentCodes* docCodes,char* buffer,long* len));
-char* readWAISDocumentCodes _AP((WAISDocumentCodes** docCodes,char* buffer));
-
-any* makeWAISTextQuery _AP((DocObj** docs));
-DocObj** readWAISTextQuery _AP((any* terms));
-
-void CSTFreeWAISInitResponse _AP((WAISInitResponse* init));
-void CSTFreeWAISSearch _AP((WAISSearch* query));
-void CSTFreeDocObj _AP((DocObj* doc));
-void CSTFreeWAISDocumentHeader _AP((WAISDocumentHeader* header));
-void CSTFreeWAISDocumentShortHeader _AP((WAISDocumentShortHeader* header));
-void CSTFreeWAISDocumentLongHeader _AP((WAISDocumentLongHeader* header));
-void CSTFreeWAISSearchResponse _AP((WAISSearchResponse* response));
-void CSTFreeWAISDocumentText _AP((WAISDocumentText* docText));
-void CSTFreeWAISDocHeadlines _AP((WAISDocumentHeadlines* docHeadline));
-void CSTFreeWAISDocumentCodes _AP((WAISDocumentCodes* docCodes));
-void CSTFreeWAISTextQuery _AP(( any* query));
+void freeWAISDocumentCodes PARAMS((WAISDocumentCodes* docCodes));
+char* writeWAISDocumentCodes PARAMS((WAISDocumentCodes* docCodes,char* buffer,long* len));
+char* readWAISDocumentCodes PARAMS((WAISDocumentCodes** docCodes,char* buffer));
+
+any* makeWAISTextQuery PARAMS((DocObj** docs));
+DocObj** readWAISTextQuery PARAMS((any* terms));
+
+void CSTFreeWAISInitResponse PARAMS((WAISInitResponse* init));
+void CSTFreeWAISSearch PARAMS((WAISSearch* query));
+void CSTFreeDocObj PARAMS((DocObj* doc));
+void CSTFreeWAISDocumentHeader PARAMS((WAISDocumentHeader* header));
+void CSTFreeWAISDocumentShortHeader PARAMS((WAISDocumentShortHeader* header));
+void CSTFreeWAISDocumentLongHeader PARAMS((WAISDocumentLongHeader* header));
+void CSTFreeWAISSearchResponse PARAMS((WAISSearchResponse* response));
+void CSTFreeWAISDocumentText PARAMS((WAISDocumentText* docText));
+void CSTFreeWAISDocHeadlines PARAMS((WAISDocumentHeadlines* docHeadline));
+void CSTFreeWAISDocumentCodes PARAMS((WAISDocumentCodes* docCodes));
+void CSTFreeWAISTextQuery PARAMS(( any* query));
 
 /*----------------------------------------------------------------------*/
 
@@ -334,6 +345,9 @@ void CSTFreeWAISTextQuery _AP(( any* query));
 #ifndef WMESSAGE_H
 #define WMESSAGE_H
 
+#include <HTUtils.h>
+#include <HTVMS_WaisUI.h>
+
 typedef struct wais_header {
         char    msg_len[10];    /* length in bytes of following message */
         char    msg_type;       /* type of message: 'z'=Z39.50 APDU,
@@ -367,9 +381,9 @@ typedef struct wais_header {
 #define UUENCODE		'u'  
 
 
-void readWAISPacketHeader _AP((char* msgBuffer,WAISMessage *header_struct));
-long getWAISPacketLength _AP((WAISMessage* header));
-void writeWAISPacketHeader _AP((char* header,long dataLen,long type,
+void readWAISPacketHeader PARAMS((char* msgBuffer,WAISMessage *header_struct));
+long getWAISPacketLength PARAMS((WAISMessage* header));
+void writeWAISPacketHeader PARAMS((char* header,long dataLen,long type,
 				char* server,long compression,	
 				long encoding,long version));
 
diff --git a/WWW/Library/Implementation/HTVMS_WaisUI.c b/WWW/Library/Implementation/HTVMS_WaisUI.c
index f8f88da3..6551bc60 100644
--- a/WWW/Library/Implementation/HTVMS_WaisUI.c
+++ b/WWW/Library/Implementation/HTVMS_WaisUI.c
@@ -17,10 +17,10 @@
    Brewster@think.com
 */
 
-/* 
+/*
  * this is a simple ui toolkit for building other ui's on top.
  * -brewster
- * 
+ *
  * top level functions:
  *   generate_search_apdu
  *   generate_retrieval_apdu
@@ -32,26 +32,22 @@
  *   generate multiple queries for long documents.
  *     this will crash if the file being retrieved is larger than 100k.
  *   do log_write()
- *   
+ *
  */
 
 #include <HTUtils.h>
-#include <tcp.h>
 #include <HTVMS_WaisUI.h>
 #include <HTVMS_WaisProt.h>
 #include <HTTCP.h>
-/*#include <stdio> included by HTUtils.h -- FM */
-#include <string.h>
-#include <ctype.h>
+
+#undef MAXINT	/* we don't need it here, and tcp.h may conflict */
 #include <math.h>
-#include <stdarg.h>
 
 #include <LYexit.h>
 #include <LYLeaks.h>
 
 void
-log_write(s)
-char *s;
+log_write(char *s GCC_UNUSED)
 {
     return;
 }
@@ -59,7 +55,7 @@ char *s;
 /*----------------------------------------------------------------------*/
 
 /* returns a pointer in the buffer of the first free byte.
-   if it overflows, then NULL is returned 
+   if it overflows, then NULL is returned
  */
 char *
 generate_search_apdu(buff,
@@ -95,12 +91,12 @@ long maxDocsRetrieved;
                          maxDocsRetrieved
                          );
 
-  search3 = makeSearchAPDU(30, 
+  search3 = makeSearchAPDU(30,
 			   5000, /* should be large */
 			   30,
                            1,	/* replace indicator */
                            "",	/* result set name */
-                           database_names, /* database name */   
+                           database_names, /* database name */
                            QT_RelevanceFeedbackQuery, /* query_type */
                            0,   /* element name */
                            NULL, /* reference ID */
@@ -159,9 +155,9 @@ char *database_name;
 
   refID.size = 1;
   refID.bytes = "3";
-  
+
   switch(chunk_type){
-  case CT_line: 
+  case CT_line:
     DocObjs[0] = makeDocObjUsingLines(docID, type, start, end);
     break;
   case CT_byte:
@@ -170,11 +166,11 @@ char *database_name;
   }
   DocObjs[1] = NULL;
 
-  query = makeWAISTextQuery(DocObjs);   
-  search = makeSearchAPDU( 10, 16, 15, 
+  query = makeWAISTextQuery(DocObjs);
+  search = makeSearchAPDU( 10, 16, 15,
 			  1,	/* replace indicator */
 			  "FOO", /* result set name */
-			  database_names, /* database name */   
+			  database_names, /* database name */
 			  QT_TextRetrievalQuery, /* query_type */
 			  element_names, /* element name */
 			  &refID, /* reference ID */
@@ -192,10 +188,7 @@ char *database_name;
  * to those trying to modify the transport code to use non-UNIX streams:
  *  This is the function to modify!
  */
-long read_from_stream(d,buf,nbytes)
-int d;				/* this is the stream */
-char *buf;
-long nbytes;
+PRIVATE long read_from_stream(int d, char *buf, long nbytes)
 {
   long didRead;
   long toRead = nbytes;
@@ -214,7 +207,7 @@ long nbytes;
     totalRead += didRead;
   }
   if(totalRead != nbytes)	/* we overread for some reason */
-    return(- totalRead);	/* bad news */    
+    return(- totalRead);	/* bad news */
   return(totalRead);
 }
 
@@ -222,25 +215,21 @@ long nbytes;
 
 /* returns the length of the response, 0 if an error */
 
-long 
-transport_message(connection,
-		  request_message,
-		  request_length,
-		  response_message,
-		  response_buffer_length)
-int connection;
-char *request_message;
-long request_length;
-char *response_message;
-long response_buffer_length;
+PRIVATE long
+transport_message(
+	long connection,
+	char *request_message,
+	long request_length,
+	char *response_message,
+	long response_buffer_length)
 {
   WAISMessage header;
   long response_length;
   int rv;
 
-  
+
   /* Write out message. Read back header. Figure out response length. */
-  
+
   if( request_length + HEADER_LENGTH !=
       NETWRITE(connection,request_message,
    		  (int)( request_length +HEADER_LENGTH)) )
@@ -272,7 +261,7 @@ long response_buffer_length;
     response_length = atol(length_array);
     /*
       if(verbose){
-      printf("WAIS header: '%s' length_array: '%s'\n", 
+      printf("WAIS header: '%s' length_array: '%s'\n",
       response_message, length_array);
       }
       */
@@ -281,7 +270,7 @@ long response_buffer_length;
 	 and return 0 */
       long i;
       for(i = 0; i < response_length; i++){
-	rv = read_from_stream(connection, 
+	rv = read_from_stream(connection,
 			      response_message + HEADER_LENGTH,
 			      1);
 	if (rv == HT_INTERRUPTED)
@@ -292,7 +281,7 @@ long response_buffer_length;
       return(0);
     }
   }
-  rv = read_from_stream(connection, 
+  rv = read_from_stream(connection,
 			response_message + HEADER_LENGTH,
 			response_length);
   if (rv == HT_INTERRUPTED)
@@ -304,19 +293,15 @@ long response_buffer_length;
 
 /*----------------------------------------------------------------------*/
 
-/* returns the number of bytes writen.  0 if an error */
+/* returns the number of bytes written.  0 if an error */
 long
-interpret_message(request_message,request_length,
-		  response_message,
-		  response_buffer_length,
-		  connection,
-		  verbose)
-char *request_message;
-long request_length; /* length of the buffer */
-char *response_message;
-long response_buffer_length;
-int connection;
-boolean verbose;
+interpret_message(
+	char *request_message,
+	long request_length, /* length of the buffer */
+	char *response_message,
+	long response_buffer_length,
+	long connection,
+	boolean verbose GCC_UNUSED)
 {
   long response_length;
 
@@ -328,7 +313,7 @@ boolean verbose;
     if(service_name && strlen(service_name) > 0)
       printf(" for service %s", service_name);
     printf("\n");
-    twais_dsply_rsp_apdu(request_message + HEADER_LENGTH, 
+    twais_dsply_rsp_apdu(request_message + HEADER_LENGTH,
 			 request_length);
   }
 
@@ -358,9 +343,7 @@ boolean verbose;
 
 /* modifies the string to exclude all seeker codes. sets length to
    the new length. */
-char *delete_seeker_codes(string,length)
-char *string;
-long *length;
+PRIVATE char *delete_seeker_codes(char *string, long *length)
 {
   long original_count; /* index into the original string */
   long new_count = 0; /* index into the collapsed string */
@@ -378,7 +361,7 @@ long *length;
   *length = new_count;
   return(string);
 }
-  
+
 /*----------------------------------------------------------------------*/
 
 #if defined(VMS) && defined(__GNUC__)			/* 10-AUG-1995 [pr] */
@@ -402,7 +385,7 @@ char *trim_junk(headline)
 char *headline;
 {
   long length = strlen(headline) + 1; /* include the trailing null */
-  long i;
+  size_t i;
   headline = delete_seeker_codes(headline, &length);
   /* delete leading spaces */
   for(i=0; i < strlen(headline); i++){
@@ -430,8 +413,8 @@ char *headline;
 **----------------------------------------------------------------------*/
 /* WIDE AREA INFORMATION SERVER SOFTWARE:`
    No guarantees or restrictions.  See the readme file for the full standard
-   disclaimer.	
-  
+   disclaimer.
+
    3.26.90	Harry Morris, morris@think.com
    3.30.90  Harry Morris - Changed any->bits to any->bytes
    4.11.90  HWM - generalized conditional includes (see c-dialect.h)
@@ -439,14 +422,14 @@ char *headline;
 
 #define RESERVE_SPACE_FOR_HEADER(spaceLeft)		\
 	*spaceLeft -= HEADER_LEN;
-	
+
 #define RELEASE_HEADER_SPACE(spaceLeft)			\
 	if (*spaceLeft > 0)				\
 	  *spaceLeft += HEADER_LEN;
-	
+
 /*----------------------------------------------------------------------*/
 
-InitResponseAPDU* 
+InitResponseAPDU*
 makeInitResponseAPDU(result,
 		     search,
 		     present,
@@ -476,7 +459,7 @@ char* version;
 any* refID;
 void* userInfo;
 /* build an initResponse APDU with user specified information */
-{ 
+{
   InitResponseAPDU* init = (InitResponseAPDU*)s_malloc((size_t)sizeof(InitResponseAPDU));
 
   init->PDUType = initResponseAPDU;
@@ -494,13 +477,13 @@ void* userInfo;
   init->ImplementationVersion = s_strdup(version);
   init->ReferenceID = duplicateAny(refID);
   init->UserInformationField = userInfo; /* not copied! */
-  
+
   return(init);
 }
 
 /*----------------------------------------------------------------------*/
 
-void 
+void
 freeInitResponseAPDU(init)
 InitResponseAPDU* init;
 /* free an initAPDU */
@@ -515,23 +498,23 @@ InitResponseAPDU* init;
 
 /*----------------------------------------------------------------------*/
 
-char* 
+char*
 writeInitResponseAPDU(init,buffer,len)
 InitResponseAPDU* init;
 char* buffer;
 long* len;
 /* write the initResponse to a buffer, adding system information */
-{ 
+{
   char* buf = buffer + HEADER_LEN; /* leave room for the header-length-indicator */
   long size;
   bit_map* optionsBM = NULL;
 
   RESERVE_SPACE_FOR_HEADER(len);
-  
+
   buf = writePDUType(init->PDUType,buf,len);
   buf = writeBoolean(init->Result,buf,len);
   buf = writeProtocolVersion(buf,len);
-  
+
   optionsBM = makeBitMap((unsigned long)5,init->willSearch,init->willPresent,
                          init->willDelete,init->supportAccessControl,
                          init->supportResourceControl);
@@ -545,21 +528,21 @@ long* len;
   buf = writeString(init->ImplementationName,DT_ImplementationName,buf,len);
   buf = writeString(init->ImplementationVersion,DT_ImplementationVersion,buf,len);
   buf = writeAny(init->ReferenceID,DT_ReferenceID,buf,len);
-  
+
   /* go back and write the header-length-indicator */
   RELEASE_HEADER_SPACE(len);
-  size = buf - buffer - HEADER_LEN; 
+  size = buf - buffer - HEADER_LEN;
   writeBinaryInteger(size,HEADER_LEN,buffer,len);
 
   if (init->UserInformationField != NULL)
-    buf = writeInitResponseInfo(init,buf,len);   
-    
+    buf = writeInitResponseInfo(init,buf,len);
+
   return(buf);
 }
 
 /*----------------------------------------------------------------------*/
 
-char* 
+char*
 readInitResponseAPDU(init,buffer)
 InitResponseAPDU** init;
 char* buffer;
@@ -568,35 +551,35 @@ char* buffer;
   boolean search,present,delete,accessControl,resourceControl;
   long prefSize,maxMsgSize;
   char *auth,*id,*name,*version;
-  long size; 
+  long size;
   pdu_type pduType;
   bit_map* versionBM = NULL;
   bit_map* optionsBM = NULL;
   boolean result;
   any *refID = NULL;
   void* userInfo = NULL;
-  
+
   auth = id = name = version = NULL;
   refID = NULL;
-  
+
   /* read required part */
-  buf = readBinaryInteger(&size,HEADER_LEN,buf); 
+  buf = readBinaryInteger(&size,HEADER_LEN,buf);
   buf = readPDUType(&pduType,buf);
   buf = readBoolean(&result,buf);
-  buf = readBitMap(&versionBM,buf); 
+  buf = readBitMap(&versionBM,buf);
   buf = readBitMap(&optionsBM,buf);
   buf = readNum(&prefSize,buf);
   buf = readNum(&maxMsgSize,buf);
-  
+
   /* decode optionsBM */
   search = bitAtPos(0,optionsBM);
   present = bitAtPos(1,optionsBM);
   delete = bitAtPos(2,optionsBM);
   accessControl = bitAtPos(3,optionsBM);
   resourceControl = bitAtPos(4,optionsBM);
-  
+
   /* read optional part */
-  while (buf < (buffer + size + HEADER_LEN)) 
+  while (buf < (buffer + size + HEADER_LEN))
     { data_tag tag = peekTag(buf);
       switch (tag)
 	{ case DT_IDAuthentication:
@@ -638,12 +621,12 @@ char* buffer;
       freeAny(refID);
     }
   RETURN_ON_NULL(buf);
-  
+
   /* construct the basic init object */
   *init = makeInitResponseAPDU(result,
 			       search,present,delete,accessControl,resourceControl,
 			       prefSize,maxMsgSize,auth,id,name,version,refID,userInfo);
-			 	 			        	
+
   freeBitMap(versionBM);
   freeBitMap(optionsBM);
   s_free(auth);
@@ -651,19 +634,19 @@ char* buffer;
   s_free(name);
   s_free(version);
   freeAny(refID);
-  
+
   return(buf);
 }
 
 /*----------------------------------------------------------------------*/
 
-InitResponseAPDU* 
+InitResponseAPDU*
 replyToInitAPDU(init,result,userInfo)
 InitAPDU* init;
 boolean result;
 void* userInfo;
 /* respond to an init message in the default way - echoing back
-   the init info 
+   the init info
  */
 {
   InitResponseAPDU* initResp;
@@ -679,7 +662,7 @@ void* userInfo;
 
 /*----------------------------------------------------------------------*/
 
-SearchAPDU* 
+SearchAPDU*
 makeSearchAPDU(small,
 	       large,
 	       medium,
@@ -710,7 +693,7 @@ void* queryInfo;
   query->MediumSetPresentNumber = medium;
   query->ReplaceIndicator = replace;
   query->ResultSetName = s_strdup(name);
-  query->DatabaseNames = NULL; 
+  query->DatabaseNames = NULL;
   if (databases != NULL)
     { for (i = 0, ptr = databases[i]; ptr != NULL; ptr = databases[++i])
 	{ if (query->DatabaseNames == NULL)
@@ -723,7 +706,7 @@ void* queryInfo;
 	  }
       }
   query->QueryType = s_strdup(type);
-  query->ElementSetNames = NULL; 
+  query->ElementSetNames = NULL;
   if (elements != NULL)
     { for (i = 0, ptr = elements[i]; ptr != NULL; ptr = elements[++i])
 	{ if (query->ElementSetNames == NULL)
@@ -742,7 +725,7 @@ void* queryInfo;
 
 /*----------------------------------------------------------------------*/
 
-void 
+void
 freeSearchAPDU(query)
 SearchAPDU* query;
 {
@@ -762,19 +745,19 @@ SearchAPDU* query;
 #define ES_DELIMITER_1 	"\037" 	/* separates database name from element name */
 #define ES_DELIMITER_2 	"\036" 	/* hex 1E separates <db,es> groups from one another */
 
-char* 
+char*
 writeSearchAPDU(query,buffer,len)
 SearchAPDU* query;
 char* buffer;
 long* len;
-{ 
+{
   char* buf = buffer + HEADER_LEN; /* leave room for the header-length-indicator */
   long size,i;
   char* ptr = NULL;
   char* scratch = NULL;
 
   RESERVE_SPACE_FOR_HEADER(len);
-  
+
   buf = writePDUType(query->PDUType,buf,len);
   buf = writeBinaryInteger(query->SmallSetUpperBound,(size_t)3,buf,len);
   buf = writeBinaryInteger(query->LargeSetLowerBound,(size_t)3,buf,len);
@@ -812,7 +795,7 @@ long* len;
 		ptr = query->ElementSetNames[++i]; /* the element set name */
 		scratch = (char*)s_realloc(scratch,newScratchSize);
 		s_strncat(scratch,ES_DELIMITER_1,2,newScratchSize);
-		s_strncat(scratch,ptr,strlen(ptr) + 1,newScratchSize); 
+		s_strncat(scratch,ptr,strlen(ptr) + 1,newScratchSize);
 	      }
 	      }
         else
@@ -822,28 +805,28 @@ long* len;
 	    s_strncat(scratch,ES_DELIMITER_2,2,newScratchSize);
 	    s_strncat(scratch,ptr,strlen(ptr) + 1,newScratchSize);
 	    s_strncat(scratch,ES_DELIMITER_1,2,newScratchSize);
-	    s_strncat(scratch,esPtr,strlen(esPtr) + 1,newScratchSize); 
+	    s_strncat(scratch,esPtr,strlen(esPtr) + 1,newScratchSize);
 	  }
 	  }
 	buf = writeString(scratch,DT_ElementSetNames,buf,len);
 	s_free(scratch);
-      }						
+      }
   buf = writeAny(query->ReferenceID,DT_ReferenceID,buf,len);
-    
+
   /* go back and write the header-length-indicator */
   RELEASE_HEADER_SPACE(len);
-  size = buf - buffer - HEADER_LEN; 
+  size = buf - buffer - HEADER_LEN;
   writeBinaryInteger(size,HEADER_LEN,buffer,len);
 
   if (query->Query != NULL)
-    buf = writeSearchInfo(query,buf,len);    
-    
+    buf = writeSearchInfo(query,buf,len);
+
   return(buf);
 }
 
 /*----------------------------------------------------------------------*/
 
-SearchResponseAPDU* 
+SearchResponseAPDU*
 makeSearchResponseAPDU(result,count,recordsReturned,nextPos,resultStatus,
 		       presentStatus,refID,records)
 long result;
@@ -865,12 +848,12 @@ void* records;
   query->PresentStatus = presentStatus;
   query->ReferenceID = duplicateAny(refID);
   query->DatabaseDiagnosticRecords = records;
-  return(query);  
+  return(query);
 }
 
 /*----------------------------------------------------------------------*/
 
-void 
+void
 freeSearchResponseAPDU(queryResponse)
 SearchResponseAPDU* queryResponse;
 {
@@ -880,7 +863,7 @@ SearchResponseAPDU* queryResponse;
 
 /*----------------------------------------------------------------------*/
 
-char* 
+char*
 writeSearchResponseAPDU(queryResponse,buffer,len)
 SearchResponseAPDU* queryResponse;
 char* buffer;
@@ -890,7 +873,7 @@ long* len;
   long size;
 
   RESERVE_SPACE_FOR_HEADER(len);
-  
+
   buf = writePDUType(queryResponse->PDUType,buf,len);
   buf = writeBinaryInteger(queryResponse->SearchStatus,(size_t)1,buf,len);
   buf = writeBinaryInteger(queryResponse->ResultCount,(size_t)3,buf,len);
@@ -899,21 +882,21 @@ long* len;
   buf = writeNum(queryResponse->ResultSetStatus,DT_ResultSetStatus,buf,len);
   buf = writeNum(queryResponse->PresentStatus,DT_PresentStatus,buf,len);
   buf = writeAny(queryResponse->ReferenceID,DT_ReferenceID,buf,len);
-    
+
   /* go back and write the header-length-indicator */
   RELEASE_HEADER_SPACE(len);
-  size = buf - buffer - HEADER_LEN; 
+  size = buf - buffer - HEADER_LEN;
   writeBinaryInteger(size,HEADER_LEN,buffer,len);
 
   if (queryResponse->DatabaseDiagnosticRecords != NULL)
-    buf = writeSearchResponseInfo(queryResponse,buf,len);    
-    
+    buf = writeSearchResponseInfo(queryResponse,buf,len);
+
   return(buf);
 }
 
 /*----------------------------------------------------------------------*/
 
-char* 
+char*
 readSearchResponseAPDU(queryResponse,buffer)
 SearchResponseAPDU** queryResponse;
 char* buffer;
@@ -925,20 +908,20 @@ char* buffer;
   long resultStatus,presentStatus;
   any *refID = NULL;
   void* userInfo = NULL;
-  
+
   /* read required part */
-  buf = readBinaryInteger(&size,HEADER_LEN,buf); 
+  buf = readBinaryInteger(&size,HEADER_LEN,buf);
   buf = readPDUType(&pduType,buf);
   buf = readBinaryInteger(&result,(size_t)1,buf);
   buf = readBinaryInteger(&count,(size_t)3,buf);
   buf = readBinaryInteger(&recordsReturned,(size_t)3,buf);
   buf = readBinaryInteger(&nextPos,(size_t)3,buf);
-  
+
   resultStatus = presentStatus = UNUSED;
   refID = NULL;
 
   /* read optional part */
-  while (buf < (buffer + size + HEADER_LEN)) 
+  while (buf < (buffer + size + HEADER_LEN))
     { data_tag tag = peekTag(buf);
       switch (tag)
 	{ case DT_ResultSetStatus:
@@ -956,18 +939,18 @@ char* buffer;
 	    break;
 	  }
     }
-  
+
   buf = readSearchResponseInfo(&userInfo,buf);
   if (buf == NULL)
     freeAny(refID);
   RETURN_ON_NULL(buf);
-  
+
   /* construct the search object */
   *queryResponse = makeSearchResponseAPDU(result,count,recordsReturned,nextPos,
 					  (long)resultStatus,(long)presentStatus,refID,userInfo);
 
   freeAny(refID);
-  
+
   return(buf);
 }
 
@@ -978,11 +961,11 @@ char* buffer;
 **----------------------------------------------------------------------*/
 /* WIDE AREA INFORMATION SERVER SOFTWARE:
    No guarantees or restrictions.  See the readme file for the full standard
-   disclaimer.	
-  
+   disclaimer.
+
    3.26.90	Harry Morris, morris@think.com
    3.30.90  Harry Morris - Changed any->bits to any->bytes
-   4.11.90  HWM - fixed include file names, changed 
+   4.11.90  HWM - fixed include file names, changed
    				- writeCompressedIntegerWithPadding() to
                   writeCompressedIntWithPadding()
                 - generalized conditional includes (see c-dialect.h)
@@ -992,43 +975,43 @@ char* buffer;
 char* readErrorPosition = NULL; /* pos where buf stoped making sense */
 
 /*----------------------------------------------------------------------*/
-/* A note on error handling 
+/* A note on error handling
    read - these are low level routines, they do not check the type tags
    which (sometimes) preceed the data (this is done by the higher
-   level functions which call these functions).  There is no 
+   level functions which call these functions).  There is no
    attempt made to check that the reading does not exceed the read
-   buffer.  Such cases should be very rare and usually will be 
-   caught by the calling functions. (note - it is unlikely that 
+   buffer.  Such cases should be very rare and usually will be
+   caught by the calling functions. (note - it is unlikely that
    a series of low level reads will go far off the edge without
    triggering a type error.  However, it is possible for a single
-   bad read in an array function (eg. readAny) to attempt to read a 
+   bad read in an array function (eg. readAny) to attempt to read a
    large ammount, possibly causing a segmentation violation or out
    of memory condition.
  */
 /*----------------------------------------------------------------------*/
 
-diagnosticRecord* 
+diagnosticRecord*
 makeDiag(surrogate,code,addInfo)
 boolean surrogate;
 char* code;
 char* addInfo;
 {
-  diagnosticRecord* diag = 
+  diagnosticRecord* diag =
     (diagnosticRecord*)s_malloc((size_t)sizeof(diagnosticRecord));
-  
+
   diag->SURROGATE = surrogate;
   memcpy(diag->DIAG,code,DIAGNOSTIC_CODE_SIZE);
-  diag->ADDINFO = s_strdup(addInfo); 
+  diag->ADDINFO = s_strdup(addInfo);
 
   return(diag);
 }
 
 /*----------------------------------------------------------------------*/
 
-void 
+void
 freeDiag(diag)
 diagnosticRecord* diag;
-{ 
+{
   if (diag != NULL)
     { if (diag->ADDINFO != NULL)
 	s_free(diag->ADDINFO);
@@ -1040,7 +1023,7 @@ diagnosticRecord* diag;
 
 #define END_OF_RECORD	0x1D
 
-char* 
+char*
 writeDiag(diag,buffer,len)
 diagnosticRecord* diag;
 char* buffer;
@@ -1051,42 +1034,42 @@ long* len;
 {
   char* buf = buffer;
   long  length;
-  
+
   if (diag == NULL)		/* handle unspecified optional args */
     return(buf);
 
   buf = writeTag(DT_DatabaseDiagnosticRecords,buf,len);
   CHECK_FOR_SPACE_LEFT(0,len);
-  
-  length = 3; 
+
+  length = 3;
   if (diag->ADDINFO != NULL)
     length += strlen(diag->ADDINFO);
-    
+
   if (length >= 0xFFFF )	/* make sure the length is reasonable */
     { length = 0xFFFF - 1;
       diag->ADDINFO[0xFFFF - 3 - 1] = '\0';
     }
-   
+
   buf = writeBinaryInteger(length,2,buf,len);
 
   CHECK_FOR_SPACE_LEFT(1,len);
-  buf[0] = diag->DIAG[0]; 
+  buf[0] = diag->DIAG[0];
   buf++;
-  
+
   CHECK_FOR_SPACE_LEFT(1,len);
   buf[0] = diag->DIAG[1];
   buf++;
-  
+
   if (length > 3)
     { CHECK_FOR_SPACE_LEFT(3,len);
       memcpy(buf,diag->ADDINFO,(size_t)length - 3);
       buf += length - 3;
     }
-   
+
   CHECK_FOR_SPACE_LEFT(1,len);
   buf[0] = diag->SURROGATE;
   buf++;
-  
+
   CHECK_FOR_SPACE_LEFT(1,len);
   buf[0] = END_OF_RECORD;
   buf++;
@@ -1096,25 +1079,25 @@ long* len;
 
 /*----------------------------------------------------------------------*/
 
-char* 
+char*
 readDiag(diag,buffer)
 diagnosticRecord** diag;
 char* buffer;
 {
   char* buf = buffer;
-  diagnosticRecord* d 
+  diagnosticRecord* d
     = (diagnosticRecord*)s_malloc((size_t)sizeof(diagnosticRecord));
   data_tag tag;
   long len;
-  
+
   buf = readTag(&tag,buf);
-  
+
   buf = readBinaryInteger(&len,2,buf);
-  
+
   d->DIAG[0] = buf[0];
   d->DIAG[1] = buf[1];
   d->DIAG[2] = '\0';
-    
+
   if (len > 3)
     { d->ADDINFO = (char*)s_malloc((size_t)(len - 3 + 1));
       memcpy(d->ADDINFO,(char*)(buf + 2),(size_t)(len - 3));
@@ -1122,9 +1105,9 @@ char* buffer;
     }
   else
     d->ADDINFO = NULL;
-    
+
   d->SURROGATE = buf[len - 1];
-  
+
   *diag = d;
 
   return(buf + len + 1);
@@ -1142,26 +1125,26 @@ unsigned long num;
 char* buf;
 long* len;
 /* write a binary integer in the format described on p. 40.
-   this might be sped up 
+   this might be sped up
 */
 {
   char byte;
-  long i;
+  unsigned long i;
   unsigned long size;
-  
+
   size = writtenCompressedIntSize(num);
   CHECK_FOR_SPACE_LEFT(size,len);
-  
-  for (i = size - 1; i >= 0; i--)
+
+  for (i = size - 1; i != 0; i--)
     { byte = num & dataMask;
       if (i != (size-1))	/* turn on continue bit */
 	byte = (char)(byte | continueBit);
       buf[i] = byte;
       num = num >> dataBits;	/* don't and here */
     }
-   
+
   return(buf + size);
-} 
+}
 
 /*----------------------------------------------------------------------*/
 
@@ -1170,15 +1153,15 @@ readCompressedInteger(num,buf)
 unsigned long *num;
 char* buf;
 /* read a binary integer in the format described on p. 40.
-   this might be sped up 
+   this might be sped up
 */
 {
   long i = 0;
   unsigned char byte;
 
   *num = 0;
-  
-  do 
+
+  do
     { byte = buf[i++];
       *num = *num << dataBits;
       *num += (byte & dataMask);
@@ -1186,7 +1169,7 @@ char* buf;
   while (byte & continueBit);
 
   return(buf + i);
-} 
+}
 
 /*----------------------------------------------------------------------*/
 
@@ -1199,16 +1182,16 @@ unsigned long size;
 char* buffer;
 long* len;
 /* Like writeCompressedInteger, except writes padding (128) to make
-   sure that size bytes are used.  This can be read correctly by 
+   sure that size bytes are used.  This can be read correctly by
    readCompressedInteger()
 */
 {
   char* buf = buffer;
   unsigned long needed,padding;
   long i;
-    
+
   CHECK_FOR_SPACE_LEFT(size,len);
-  
+
   needed = writtenCompressedIntSize(num);
   padding = size - needed;
   i = padding - 1;
@@ -1216,11 +1199,11 @@ long* len;
   for (i = padding - 1;i >= 0;i--)
     { buf[i] = pad;
     }
-  
+
   buf = writeCompressedInteger(num,buf + padding,len);
-  
+
   return(buf);
-} 
+}
 
 /*----------------------------------------------------------------------*/
 
@@ -1231,14 +1214,14 @@ unsigned long num;
    compressed format.  curently limited to 4 bytes
  */
 {
-  if (num < CompressedInt1Byte) 
+  if (num < CompressedInt1Byte)
     return(1);
-  else if (num < CompressedInt2Byte) 
+  else if (num < CompressedInt2Byte)
     return(2);
   else if (num < CompressedInt3Byte)
     return(3);
   else
-    return(4);    
+    return(4);
 }
 
 /*----------------------------------------------------------------------*/
@@ -1249,9 +1232,9 @@ data_tag tag;
 char* buf;
 long* len;
 /* write out a data tag */
-{ 
+{
   return(writeCompressedInteger(tag,buf,len));
-} 
+}
 
 /*----------------------------------------------------------------------*/
 
@@ -1260,16 +1243,16 @@ readTag(tag,buf)
 data_tag* tag;
 char* buf;
 /* read a data tag */
-{ 
+{
   return(readCompressedInteger(tag,buf));
-} 
+}
 
 /*----------------------------------------------------------------------*/
 
-unsigned long 
+unsigned long
 writtenTagSize(tag)
 data_tag tag;
-{ 
+{
   return(writtenCompressedIntSize(tag));
 }
 
@@ -1283,11 +1266,11 @@ char* buf;
   data_tag tag;
   readTag(&tag,buf);
   return(tag);
-} 
+}
 
 /*----------------------------------------------------------------------*/
 
-any* 
+any*
 makeAny(size,data)
 unsigned long size;
 char* data;
@@ -1304,7 +1287,7 @@ void
 freeAny(a)
 any* a;
 /* destroy an any and its associated data. Assumes a->bytes was
-   allocated using the s_malloc family of libraries 
+   allocated using the s_malloc family of libraries
  */
 {
   if (a != NULL)
@@ -1316,7 +1299,7 @@ any* a;
 
 /*----------------------------------------------------------------------*/
 
-any* 
+any*
 duplicateAny(a)
 any* a;
 {
@@ -1338,7 +1321,7 @@ any* a;
 
 /*----------------------------------------------------------------------*/
 
-char* 
+char*
 writeAny(a,tag,buffer,len)
 any* a;
 data_tag tag;
@@ -1350,7 +1333,7 @@ long* len;
 
   if (a == NULL)		/* handle unspecified optional args */
     return(buf);
-  
+
   /* write the tags */
   buf = writeTag(tag,buf,len);
   buf = writeCompressedInteger(a->size,buf,len);
@@ -1379,9 +1362,9 @@ char* buffer;
 a=(any*)s_malloc((size_t)sizeof(any));
 
   buf=buffer;
-  
+
   buf = readTag(&tag,buf);
-  
+
   buf = readCompressedInteger(&a->size,buf);
 
   /* now simply copy the bytes */
@@ -1394,7 +1377,7 @@ a=(any*)s_malloc((size_t)sizeof(any));
 
 /*----------------------------------------------------------------------*/
 
-unsigned long 
+unsigned long
 writtenAnySize(tag,a)
 data_tag tag;
 any* a;
@@ -1417,10 +1400,10 @@ stringToAny(s)
 char* s;
 {
   any* a = NULL;
-  
+
   if (s == NULL)
     return(NULL);
-    
+
   a = (any*)s_malloc((size_t)sizeof(any));
   a->size = strlen(s);
   a->bytes = (char*)s_malloc((size_t)a->size);
@@ -1435,10 +1418,10 @@ anyToString(a)
 any* a;
 {
   char* s = NULL;
-  
+
   if (a == NULL)
     return(NULL);
-    
+
   s = s_malloc((size_t)(a->size + 1));
   memcpy(s,a->bytes,(size_t)a->size);
   s[a->size] = '\0';
@@ -1447,15 +1430,15 @@ any* a;
 
 /*----------------------------------------------------------------------*/
 
-char* 
+char*
 writeString(s,tag,buffer,len)
 char* s;
 data_tag tag;
 char* buffer;
 long* len;
-/* Write a C style string.  The terminating null is not written. 
+/* Write a C style string.  The terminating null is not written.
    This function is not part of the Z39.50 spec.  It is provided
-   for the convienience of those wishing to pass C strings in 
+   for the convienience of those wishing to pass C strings in
    the place of an any.
  */
 {
@@ -1463,7 +1446,7 @@ long* len;
   any* data = NULL;
   if (s == NULL)
     return(buffer);		/* handle unused optional item before making an any */
-  data = (any*)s_malloc((size_t)sizeof(any)); 
+  data = (any*)s_malloc((size_t)sizeof(any));
   data->size = strlen(s);
   data->bytes = s;		/* save a copy here by not using stringToAny() */
   buf = writeAny(data,tag,buf,len);
@@ -1473,14 +1456,14 @@ long* len;
 
 /*----------------------------------------------------------------------*/
 
-char* 
+char*
 readString(s ,buffer)
 char** s ;
 char* buffer;
 /* Read an any and convert it into a C style string.
    This function is not part of the Z39.50 spec.  It is provided
-   for the convienience of those wishing to pass C strings in 
-   the place of an any. 
+   for the convienience of those wishing to pass C strings in
+   the place of an any.
  */
 {
   any* data = NULL;
@@ -1492,7 +1475,7 @@ char* buffer;
 
 /*----------------------------------------------------------------------*/
 
-unsigned long 
+unsigned long
 writtenStringSize(tag,s)
 data_tag tag;
 char* s;
@@ -1510,7 +1493,7 @@ char* s;
 
 /*----------------------------------------------------------------------*/
 
-any* 
+any*
 longToAny(num)
 long num;
 /* a convienience function */
@@ -1518,7 +1501,7 @@ long num;
   char s[40];
 
   sprintf(s,"%ld",num);
-  
+
   return(stringToAny(s));
 }
 
@@ -1537,7 +1520,7 @@ any* a;
   s_free(str);
   return(num);
 }
- 
+
 /*----------------------------------------------------------------------*/
 
 #define bitsPerByte	8
@@ -1551,18 +1534,18 @@ makeBitMap(unsigned long numBits, ...)
   bit_map* bm = NULL;
 
   va_start(ap,numBits);
-  
+
   bm = (bit_map*)s_malloc((size_t)sizeof(bit_map));
-  bm->size = (unsigned long)ceil((double)numBits / bitsPerByte); 
+  bm->size = (unsigned long)(ceil((double)numBits / bitsPerByte));
   bm->bytes = (char*)s_malloc((size_t)bm->size);
-  
+
   /* fill up the bits */
   for (i = 0; i < bm->size; i++) /* iterate over bytes */
     { char byte = 0;
       for (j = 0; j < bitsPerByte; j++) /* iterate over bits */
 	{ if ((i * bitsPerByte + j) < numBits)
 	    { boolean bit = false;
-	      bit = (boolean)va_arg(ap,boolean); 
+	      bit = (boolean)va_arg(ap,boolean);
 	      if (bit)
 	        { byte = byte | (1 << (bitsPerByte - j - 1));
 	        }
@@ -1589,8 +1572,8 @@ bit_map* bm;
 
 /*----------------------------------------------------------------------*/
 
-/* use this routine to interpret a bit map.  pos specifies the bit 
-   number.  bit 0 is the Leftmost bit of the first byte.  
+/* use this routine to interpret a bit map.  pos specifies the bit
+   number.  bit 0 is the Leftmost bit of the first byte.
    Could do bounds checking.
  */
 
@@ -1602,7 +1585,7 @@ bit_map* bm;
   if (pos > bm->size*bitsPerByte)
     return false;
   else
-    return((bm->bytes[(pos / bitsPerByte)] & 
+    return((bm->bytes[(pos / bitsPerByte)] &
 	    (0x80>>(pos % bitsPerByte))) ?
 	   true : false);
 }
@@ -1616,7 +1599,7 @@ data_tag tag;
 char* buffer;
 long* len;
 /* write a bitmap + type and size info */
-{ 
+{
   return(writeAny((any*)bm,tag,buffer,len));
 }
 
@@ -1639,7 +1622,7 @@ c=readAny((any**)bm,buffer);
 
 /*----------------------------------------------------------------------*/
 
-char* 
+char*
 writeByte(byte,buf,len)
 unsigned long byte;
 char* buf;
@@ -1652,7 +1635,7 @@ long* len;
 
 /*----------------------------------------------------------------------*/
 
-char* 
+char*
 readByte(byte,buf)
 unsigned char* byte;
 char* buf;
@@ -1663,7 +1646,7 @@ char* buf;
 
 /*----------------------------------------------------------------------*/
 
-char* 
+char*
 writeBoolean(flag,buf,len)
 boolean flag;
 char* buf;
@@ -1674,7 +1657,7 @@ long* len;
 
 /*----------------------------------------------------------------------*/
 
-char* 
+char*
 readBoolean(flag,buffer)
 boolean* flag;
 char* buffer;
@@ -1695,7 +1678,7 @@ long* len;
 /* PDUType is a single byte */
 {
   return(writeBinaryInteger((long)pduType,(unsigned long)1,buf,len));
-} 
+}
 
 /*----------------------------------------------------------------------*/
 
@@ -1706,14 +1689,14 @@ char* buf;
 /* PDUType is a single byte */
 {
   return(readBinaryInteger((long*)pduType,(unsigned long)1,buf));
-} 
+}
 
 /*----------------------------------------------------------------------*/
 
 pdu_type
 peekPDUType(buf)
 char* buf;
-/* read the next pdu without advancing the buffer, Note that this 
+/* read the next pdu without advancing the buffer, Note that this
    function is to be used on a buffer that is known to contain an
    APDU.  The pdu_type is written HEADER_LEN bytes into the buffer
  */
@@ -1781,11 +1764,11 @@ char* buf;
 
 /*----------------------------------------------------------------------*/
 
-unsigned long 
+unsigned long
 writtenCompressedBinIntSize(num)
 long num;
 /* return the number of bytes needed to represent the value num.
-   currently limited to max of 4 bytes 
+   currently limited to max of 4 bytes
    Only compresses for positive nums - negatives get whole 4 bytes
  */
 {
@@ -1800,7 +1783,7 @@ long num;
   else
     return(4);
 }
- 
+
 /*----------------------------------------------------------------------*/
 
 char*
@@ -1813,13 +1796,13 @@ long* len;
 {
   char* buf = buffer;
   long size = writtenCompressedBinIntSize(num);
-  
+
   if (num == UNUSED)
     return(buffer);
-    
+
   buf = writeTag(tag,buf,len);
-  buf = writeCompressedInteger(size,buf,len); 
-  buf = writeBinaryInteger(num,(unsigned long)size,buf,len); 
+  buf = writeCompressedInteger(size,buf,len);
+  buf = writeBinaryInteger(num,(unsigned long)size,buf,len);
   return(buf);
 }
 
@@ -1835,7 +1818,7 @@ char* buffer;
   data_tag tag;
   unsigned long size;
   unsigned long val;
-  
+
   buf = readTag(&tag,buf);
   buf = readCompressedInteger(&val,buf);
   size = (unsigned long)val;
@@ -1845,24 +1828,24 @@ char* buffer;
 
 /*----------------------------------------------------------------------*/
 
-unsigned long 
+unsigned long
 writtenNumSize(tag,num)
 data_tag tag;
 long num;
 {
   long dataSize = writtenCompressedBinIntSize(num);
   long size;
-  
+
   size = writtenTagSize(tag); /* space for the tag */
   size += writtenCompressedIntSize(dataSize); /* space for the size */
   size += dataSize; /* space for the data */
-  
+
   return(size);
 }
 
 /*----------------------------------------------------------------------*/
 
-typedef void (voidfunc)();
+typedef void (voidfunc)(void *);
 
 void
 doList(list,func)
@@ -1880,7 +1863,7 @@ voidfunc *func;
 
 /*----------------------------------------------------------------------*/
 
-char* 
+char*
 writeProtocolVersion(buf,len)
 char* buf;
 long* len;
@@ -1891,7 +1874,7 @@ long* len;
   if (version == NULL)
    { version = makeBitMap((unsigned long)1,true); /* version 1! */
    }
-    
+
   return(writeBitMap(version,DT_ProtocolVersion,buf,len));
 }
 
@@ -1931,8 +1914,8 @@ defaultImplementationVersion()
 **----------------------------------------------------------------------*/
 /* WIDE AREA INFORMATION SERVER SOFTWARE:
    No guarantees or restrictions.  See the readme file for the full standard
-   disclaimer.	
-  
+   disclaimer.
+
    3.26.90	Harry Morris, morris@think.com
    4.11.90  HWM - generalized conditional includes (see c-dialect.h)
 */
@@ -1978,7 +1961,7 @@ any* term;
 query_term*
 makeResultSetTerm(resultSet)
 any* resultSet;
-{ 
+{
   query_term* qt = (query_term*)s_malloc((size_t)sizeof(query_term));
 
   qt->TermType = TT_ResultSetID;
@@ -1986,13 +1969,13 @@ any* resultSet;
   qt->ResultSetID = duplicateAny(resultSet);
 
   qt->Term = NULL;
-  
+
   return(qt);
 }
 
 /*----------------------------------------------------------------------*/
 
-query_term* 
+query_term*
 makeOperatorTerm(operatorCode)
 char* operatorCode;
 {
@@ -2010,10 +1993,11 @@ char* operatorCode;
 
 /*----------------------------------------------------------------------*/
 
-void 
-freeTerm(qt)
-query_term* qt;
+void
+freeTerm(param)
+void* param;
 {
+  query_term* qt = (query_term*)param;
   switch (qt->TermType)
     { case TT_Attribute:
 	freeAny(qt->Term);
@@ -2037,7 +2021,7 @@ query_term* qt;
 #define ATTRIBUTE_LIST_SIZE	ATTRIBUTE_SIZE * 6
 #define AT_DELIMITER	" "
 
-char* 
+char*
 writeQueryTerm(qt,buffer,len)
 query_term* qt;
 char* buffer;
@@ -2048,15 +2032,15 @@ long* len;
 
   switch (qt->TermType)
     { case TT_Attribute:
-	strncpy(attributes,qt->Use,ATTRIBUTE_LIST_SIZE); 
+	strncpy(attributes,qt->Use,ATTRIBUTE_LIST_SIZE);
 	s_strncat(attributes,AT_DELIMITER,sizeof(AT_DELIMITER) + 1,ATTRIBUTE_LIST_SIZE);
-	s_strncat(attributes,qt->Relation,ATTRIBUTE_SIZE,ATTRIBUTE_LIST_SIZE); 
+	s_strncat(attributes,qt->Relation,ATTRIBUTE_SIZE,ATTRIBUTE_LIST_SIZE);
 	s_strncat(attributes,AT_DELIMITER,sizeof(AT_DELIMITER) + 1,ATTRIBUTE_LIST_SIZE);
-	s_strncat(attributes,qt->Position,ATTRIBUTE_SIZE,ATTRIBUTE_LIST_SIZE); 
+	s_strncat(attributes,qt->Position,ATTRIBUTE_SIZE,ATTRIBUTE_LIST_SIZE);
 	s_strncat(attributes,AT_DELIMITER,sizeof(AT_DELIMITER) + 1,ATTRIBUTE_LIST_SIZE);
-	s_strncat(attributes,qt->Structure,ATTRIBUTE_SIZE,ATTRIBUTE_LIST_SIZE); 
+	s_strncat(attributes,qt->Structure,ATTRIBUTE_SIZE,ATTRIBUTE_LIST_SIZE);
 	s_strncat(attributes,AT_DELIMITER,sizeof(AT_DELIMITER) + 1,ATTRIBUTE_LIST_SIZE);
-	s_strncat(attributes,qt->Truncation,ATTRIBUTE_SIZE,ATTRIBUTE_LIST_SIZE); 
+	s_strncat(attributes,qt->Truncation,ATTRIBUTE_SIZE,ATTRIBUTE_LIST_SIZE);
 	s_strncat(attributes,AT_DELIMITER,sizeof(AT_DELIMITER) + 1,ATTRIBUTE_LIST_SIZE);
 	s_strncat(attributes,qt->Completeness,ATTRIBUTE_SIZE,ATTRIBUTE_LIST_SIZE);
 	buf = writeString(attributes,DT_AttributeList,buf,len);
@@ -2079,7 +2063,7 @@ long* len;
 
 /*----------------------------------------------------------------------*/
 
-char* 
+char*
 readQueryTerm(qt,buffer)
 query_term** qt;
 char* buffer;
@@ -2097,7 +2081,7 @@ char* buffer;
   any*	resultSetID = NULL;
   data_tag tag;
 
-  
+
   tag = peekTag(buffer);
 
   switch(tag)
@@ -2117,7 +2101,7 @@ char* buffer;
 	break;
       case DT_ResultSetID:
 	buf = readAny(&resultSetID,buf);
-	*qt = makeResultSetTerm(resultSetID);	
+	*qt = makeResultSetTerm(resultSetID);
 	freeAny(resultSetID);
 	break;
       case DT_Operator:
@@ -2129,21 +2113,21 @@ char* buffer;
 	REPORT_READ_ERROR(buf);
 	break;
       }
-  
+
   return(buf);
 }
 
 /*----------------------------------------------------------------------*/
 
-static unsigned long getQueryTermSize _AP((query_term* qt));
+static unsigned long getQueryTermSize PARAMS((query_term* qt));
 
 static unsigned long
 getQueryTermSize(qt)
 query_term* qt;
 /* figure out how many bytes it will take to write this query */
 {
-  unsigned long size;
-  static char attributes[] = "11 22 33 44 55 66"; /* we just need this to 
+  unsigned long size = 0;
+  static char attributes[] = "11 22 33 44 55 66"; /* we just need this to
 						     calculate its written
 						     size */
 
@@ -2169,7 +2153,7 @@ query_term* qt;
 
 /*----------------------------------------------------------------------*/
 
-/* A query is simply a null terminated list of query terms. For 
+/* A query is simply a null terminated list of query terms. For
    transmission, a query is written into an any which is sent as
    the user information field. */
 
@@ -2227,7 +2211,7 @@ log_write(tmp);
 	{ terms = (query_term**)s_malloc((size_t)(sizeof(query_term*)*2));
 	}
       else
-	{ terms = 
+	{ terms =
 	    (query_term**)s_realloc((char*)terms,
 				    (size_t)(sizeof(query_term*)*(numTerms+2)));
 	  }
@@ -2258,14 +2242,13 @@ if(qt==NULL)
  * up a little window to explain the problem.
  * On a unix box, it will print out the error and call perror()
  */
- 
+
 /*----------------------------------------------------------------------*/
 
-static void exitAction _AP((long error));
+static void exitAction PARAMS((long error));
 
 static void
-exitAction(error)
-long error;
+exitAction(long error GCC_UNUSED)
 {
   long i;
   for (i = 0; i < 100000; i++)
@@ -2287,7 +2270,7 @@ panic(char *format, ...)
   vfprintf(stderr,format,ap);	/* print the contents */
   va_end(ap);			/* free ap */
   fflush(stderr);
-  
+
   exitAction(0);
 }
 
@@ -2298,24 +2281,21 @@ panic(char *format, ...)
 **	Routines originally from cutil.c -- FM
 **
 **----------------------------------------------------------------------*/
-/* Wide AREA INFORMATION SERVER SOFTWARE	
+/* Wide AREA INFORMATION SERVER SOFTWARE
    No guarantees or restrictions.  See the readme file for the full standard
-   disclaimer.  
-  
+   disclaimer.
+
    3.26.90	Harry Morris, morris@think.com
    4.11.90  HWM - generalized conditional includes (see c-dialect.h)
 */
 
-#include <varargs.h>
-
-
 /*----------------------------------------------------------------------*/
 
 void
 fs_checkPtr(ptr)
 void* ptr;
 /* If the ptr is NULL, give an error */
-{ 
+{
   if (ptr == NULL)
     panic("checkPtr found a NULL pointer");
 }
@@ -2326,12 +2306,12 @@ void*
 fs_malloc(size)
 size_t size;
 /* does safety checks and optional accounting */
-{ 
+{
   register void* ptr = NULL;
 
   ptr = (void*)calloc((size_t)size,(size_t)1);
   s_checkPtr(ptr);
-  
+
   return(ptr);
 }
 
@@ -2341,19 +2321,19 @@ void*
 fs_realloc(ptr,size)
 void* ptr;
 size_t size;
-/* does safety checks and optional accounting 
+/* does safety checks and optional accounting
    note - we don't know how big ptr's memory is, so we can't ensure
    that any new memory allocated is NULLed!
  */
-{ 
+{
   register void* nptr = NULL;
-  
+
   if (ptr == NULL)		/* this is really a malloc */
     return(s_malloc(size));
-    
+
   nptr = (void*)realloc(ptr,size);
   s_checkPtr(ptr);
-   
+
   return(nptr);
 }
 
@@ -2378,16 +2358,16 @@ s_strdup(s)
 char* s;
 
 /* return a copy of s.  This is identical to the standard library routine
-   strdup(), except that it is safe.  If s == NULL or malloc fails, 
+   strdup(), except that it is safe.  If s == NULL or malloc fails,
    appropriate action is taken.
  */
 {
   unsigned long len;
   char* copy = NULL;
-  
+
   if (s == NULL)		/* saftey check to postpone stupid errors */
     return(NULL);
-    
+
   len = strlen(s);		/* length of string - terminator */
   copy = (char*)s_malloc((size_t)(sizeof(char)*(len + 1)));
   strncpy(copy,s,len + 1);
@@ -2403,13 +2383,13 @@ char* dst;
    size_t maxToAdd;
    size_t maxTotal;
 
-/* like strncat, except the fourth argument limits the maximum total 
+/* like strncat, except the fourth argument limits the maximum total
    length of the resulting string
  */
 {
   size_t dstSize = strlen(dst);
   size_t srcSize = strlen(src);
-  
+
   if (dstSize + srcSize < maxTotal) /* use regular old strncat */
     return(strncat(dst,src,maxToAdd));
   else
diff --git a/WWW/Library/Implementation/HTVMS_WaisUI.h b/WWW/Library/Implementation/HTVMS_WaisUI.h
index 6f492b87..fbb9278f 100644
--- a/WWW/Library/Implementation/HTVMS_WaisUI.h
+++ b/WWW/Library/Implementation/HTVMS_WaisUI.h
@@ -8,13 +8,9 @@
 #ifndef HTVMSWAIS_H
 #define HTVMSWAIS_H
 
-#ifndef __STDLIB_LOADED
-#include <stdlib.h>
-#endif /* __STDLIB_LOADED */
+#include <HTUtils.h>
 
-#define _AP(args) ()
-
-void	log_write _AP((char *));
+void	log_write PARAMS((char *));
 
 /*
 **	Routines originally from Panic.h -- FM
@@ -59,11 +55,11 @@ void	panic (char* format,...);
 
 /* enhanced memory handling functions - don't call them directly, use the
    macros below */
-void	fs_checkPtr _AP((void* ptr));
-void*	fs_malloc _AP((size_t size));
-void*	fs_realloc _AP((void* ptr,size_t size));
-void	fs_free _AP((void* ptr));
-char* 	fs_strncat _AP((char* dst,char* src,size_t maxToAdd,size_t maxTotal));
+void	fs_checkPtr PARAMS((void* ptr));
+void*	fs_malloc PARAMS((size_t size));
+void*	fs_realloc PARAMS((void* ptr,size_t size));
+void	fs_free PARAMS((void* ptr));
+char* 	fs_strncat PARAMS((char* dst,char* src,size_t maxToAdd,size_t maxTotal));
 
 /* macros for memory functions.  call these in your program.  */
 #define s_checkPtr(ptr) 	fs_checkPtr(ptr)
@@ -72,13 +68,13 @@ char* 	fs_strncat _AP((char* dst,char* src,size_t maxToAdd,size_t maxTotal));
 #define s_free(ptr)		{ fs_free((char*)ptr); ptr = NULL; }
 #define s_strncat(dst,src,maxToAdd,maxTotal)	fs_strncat((dst),(src),(maxToAdd),(maxTotal))
 
-char* 	s_strdup _AP((char* s));
+char* 	s_strdup PARAMS((char* s));
 
 #define IS_DELIMITER	1
 #define	NOT_DELIMITER	!IS_DELIMITER
 
-char char_downcase _AP((unsigned long ch));
-char *string_downcase _AP((char* word));
+char char_downcase PARAMS((unsigned long ch));
+char *string_downcase PARAMS((char* word));
 
 /*----------------------------------------------------------------------*/
 
@@ -283,71 +279,71 @@ extern char* readErrorPosition; 	/* pos where buf stoped making sense */
 
 /*----------------------------------------------------------------------*/
 
-diagnosticRecord* makeDiag _AP((boolean surrogate,char* code,char* addInfo));
-void freeDiag _AP((diagnosticRecord* diag));
-char* writeDiag _AP((diagnosticRecord* diag,char* buffer,long* len));
-char* readDiag _AP((diagnosticRecord** diag,char* buffer));
+diagnosticRecord* makeDiag PARAMS((boolean surrogate,char* code,char* addInfo));
+void freeDiag PARAMS((diagnosticRecord* diag));
+char* writeDiag PARAMS((diagnosticRecord* diag,char* buffer,long* len));
+char* readDiag PARAMS((diagnosticRecord** diag,char* buffer));
 
-char* writeCompressedInteger _AP((unsigned long num,char* buf,long* len));
-char* readCompressedInteger _AP((unsigned long *num,char* buf));
-char* writeCompressedIntWithPadding _AP((unsigned long num,unsigned long size,
+char* writeCompressedInteger PARAMS((unsigned long num,char* buf,long* len));
+char* readCompressedInteger PARAMS((unsigned long *num,char* buf));
+char* writeCompressedIntWithPadding PARAMS((unsigned long num,unsigned long size,
 					 char* buffer,long* len));
-unsigned long writtenCompressedIntSize _AP((unsigned long num));
+unsigned long writtenCompressedIntSize PARAMS((unsigned long num));
 
-char* writeTag _AP((data_tag tag,char* buf,long* len));
-char* readTag _AP((data_tag* tag,char* buf));
-data_tag peekTag _AP((char* buf));
-unsigned long writtenTagSize _AP((data_tag tag));
+char* writeTag PARAMS((data_tag tag,char* buf,long* len));
+char* readTag PARAMS((data_tag* tag,char* buf));
+data_tag peekTag PARAMS((char* buf));
+unsigned long writtenTagSize PARAMS((data_tag tag));
 
-any* makeAny _AP((unsigned long size,char* data));
-void freeAny _AP((any* a));
-any* duplicateAny _AP((any* a));
-char* writeAny _AP((any* a,data_tag tag,char* buffer,long* len));
-char* readAny _AP((any** anAny,char* buffer));
-unsigned long writtenAnySize _AP((data_tag tag,any* a));
+any* makeAny PARAMS((unsigned long size,char* data));
+void freeAny PARAMS((any* a));
+any* duplicateAny PARAMS((any* a));
+char* writeAny PARAMS((any* a,data_tag tag,char* buffer,long* len));
+char* readAny PARAMS((any** anAny,char* buffer));
+unsigned long writtenAnySize PARAMS((data_tag tag,any* a));
 
-any* stringToAny _AP((char* s));
-char* anyToString _AP((any* a));
-unsigned long writtenStringSize _AP((data_tag tag,char* s));
+any* stringToAny PARAMS((char* s));
+char* anyToString PARAMS((any* a));
+unsigned long writtenStringSize PARAMS((data_tag tag,char* s));
 
-any* longToAny _AP((long Num));
-long anyToLong _AP((any* a));
+any* longToAny PARAMS((long Num));
+long anyToLong PARAMS((any* a));
 
-char* writeString _AP((char* s,data_tag tag,char* buffer,long* len));
-char* readString _AP((char** s,char* buffer));
+char* writeString PARAMS((char* s,data_tag tag,char* buffer,long* len));
+char* readString PARAMS((char** s,char* buffer));
 
 bit_map* makeBitMap (unsigned long numBits,...);
 
-void freeBitMap _AP((bit_map* bm));
-boolean bitAtPos _AP((long pos,bit_map* bm));
-char* writeBitMap _AP((bit_map* bm,data_tag tag,char* buffer,long* len));
-char* readBitMap _AP((bit_map** bm,char* buffer));
+void freeBitMap PARAMS((bit_map* bm));
+boolean bitAtPos PARAMS((long pos,bit_map* bm));
+char* writeBitMap PARAMS((bit_map* bm,data_tag tag,char* buffer,long* len));
+char* readBitMap PARAMS((bit_map** bm,char* buffer));
 
-char* writeByte _AP((unsigned long byte,char* buf,long* len));
-char* readByte _AP((unsigned char* byte,char* buf));
+char* writeByte PARAMS((unsigned long byte,char* buf,long* len));
+char* readByte PARAMS((unsigned char* byte,char* buf));
 
-char* writeBoolean _AP((boolean flag,char* buf,long* len));
-char* readBoolean _AP((boolean* flag,char* buf));
+char* writeBoolean PARAMS((boolean flag,char* buf,long* len));
+char* readBoolean PARAMS((boolean* flag,char* buf));
 
-char* writePDUType _AP((pdu_type pduType,char* buf,long* len));
-char* readPDUType _AP((pdu_type* pduType,char* buf));
-pdu_type peekPDUType _AP((char* buf));
+char* writePDUType PARAMS((pdu_type pduType,char* buf,long* len));
+char* readPDUType PARAMS((pdu_type* pduType,char* buf));
+pdu_type peekPDUType PARAMS((char* buf));
 
-char* writeBinaryInteger _AP((long num,unsigned long size,
+char* writeBinaryInteger PARAMS((long num,unsigned long size,
 			      char* buf,long* len));
-char* readBinaryInteger _AP((long* num,unsigned long size,char* buf));
-unsigned long writtenCompressedBinIntSize _AP((long num));
+char* readBinaryInteger PARAMS((long* num,unsigned long size,char* buf));
+unsigned long writtenCompressedBinIntSize PARAMS((long num));
 
-char* writeNum _AP((long num,data_tag tag,char* buffer,long* len));
-char* readNum _AP((long* num,char* buffer));
-unsigned long  writtenNumSize _AP((data_tag tag,long num));
+char* writeNum PARAMS((long num,data_tag tag,char* buffer,long* len));
+char* readNum PARAMS((long* num,char* buffer));
+unsigned long  writtenNumSize PARAMS((data_tag tag,long num));
 
-void doList _AP((void** list,void (*func)()));
+void doList PARAMS((void** list,void (*func)(void *)));
 
-char* writeProtocolVersion _AP((char* buf,long* len));
-char* defaultImplementationID _AP((void));
-char* defaultImplementationName _AP((void));
-char* defaultImplementationVersion _AP((void));
+char* writeProtocolVersion PARAMS((char* buf,long* len));
+char* defaultImplementationID PARAMS((void));
+char* defaultImplementationName PARAMS((void));
+char* defaultImplementationVersion PARAMS((void));
 
 /*----------------------------------------------------------------------*/
 
@@ -462,16 +458,16 @@ typedef struct query_term {
 /*----------------------------------------------------------------------*/
 /* functions */
 
-query_term* makeAttributeTerm _AP((
+query_term* makeAttributeTerm PARAMS((
         char* use,char* relation,char* position,char* structure,
 	char* truncation,char* completeness,any* term));
-query_term* makeResultSetTerm _AP((any* resultSet));
-query_term* makeOperatorTerm _AP((char* operatorCode));
-void freeTerm _AP((query_term* qt));
-char* writeQueryTerm _AP((query_term* qt,char* buffer,long* len));
-char* readQueryTerm _AP((query_term** qt,char* buffer));
-any* writeQuery _AP((query_term** terms));
-query_term** readQuery _AP((any* info));
+query_term* makeResultSetTerm PARAMS((any* resultSet));
+query_term* makeOperatorTerm PARAMS((char* operatorCode));
+void freeTerm PARAMS((void* qt));
+char* writeQueryTerm PARAMS((query_term* qt,char* buffer,long* len));
+char* readQueryTerm PARAMS((query_term** qt,char* buffer));
+any* writeQuery PARAMS((query_term** terms));
+query_term** readQuery PARAMS((any* info));
 
 /*----------------------------------------------------------------------*/
 
@@ -482,16 +478,7 @@ query_term** readQuery _AP((any* info));
 **----------------------------------------------------------------------*/
 
 char *
-generate_search_apdu _AP((char* buff,  /* buffer to hold the apdu */
-			  long *buff_len, /* number of bytes written to the buffer */
-			  char *seed_words, /* string of the seed words */
-			  char *database_name,
-			  DocObj** docobjs,
-			  long maxDocsRetrieved
-			  ));
-
-char *
-generate_retrieval_apdu _AP((char *buff, 
+generate_retrieval_apdu PARAMS((char *buff, 
 			     long *buff_len, 
 			     any *docID,
 			     long chunk_type,
@@ -501,19 +488,14 @@ generate_retrieval_apdu _AP((char *buff,
 
 
 long
-interpret_message _AP((char *request_message,
+interpret_message PARAMS((char *request_message,
 		       long request_length,
 		       char *response_message,
 		       long response_buffer_length, /* length of the buffer (modified)*/
-		       FILE *connection,
+		       long connection,
 		       boolean verbose));
 
-
-void
-display_text_record_completely _AP((WAISDocumentText *record, 
-			       boolean quote_string_quotes));
-
-char *trim_junk _AP((char *headline));
+char *trim_junk PARAMS((char *headline));
 
 
 
@@ -601,74 +583,74 @@ typedef struct PresentResponseAPDU {
 /*----------------------------------------------------------------------*/
 /* Functions */
 
-InitAPDU* makeInitAPDU _AP((boolean search,boolean present,boolean deleteIt,
+InitAPDU* makeInitAPDU PARAMS((boolean search,boolean present,boolean deleteIt,
 			    boolean accessControl,boolean resourceControl,
 			    long prefMsgSize,long maxMsgSize,
 			    char* auth,char* id,char* name, char* version,
 			    any* refID,void* userInfo));
-void freeInitAPDU _AP((InitAPDU* init));
-char* writeInitAPDU _AP((InitAPDU* init,char* buffer,long* len));
-char* readInitAPDU _AP((InitAPDU** init,char* buffer));
+void freeInitAPDU PARAMS((InitAPDU* init));
+char* writeInitAPDU PARAMS((InitAPDU* init,char* buffer,long* len));
+char* readInitAPDU PARAMS((InitAPDU** init,char* buffer));
 
-InitResponseAPDU* makeInitResponseAPDU _AP((boolean result,
+InitResponseAPDU* makeInitResponseAPDU PARAMS((boolean result,
 					    boolean search,boolean present,boolean deleteIt,
 					    boolean accessControl,boolean resourceControl,
 					    long prefMsgSize,long maxMsgSize,
 					    char* auth,char* id,char* name, char* version,
 					    any* refID,void* userInfo));
-void freeInitResponseAPDU _AP((InitResponseAPDU* init));
-char* writeInitResponseAPDU _AP((InitResponseAPDU* init,char* buffer,long* len));
-char* readInitResponseAPDU _AP((InitResponseAPDU** init,char* buffer));
-InitResponseAPDU* replyToInitAPDU _AP((InitAPDU* init,boolean result,void* userInfo));
+void freeInitResponseAPDU PARAMS((InitResponseAPDU* init));
+char* writeInitResponseAPDU PARAMS((InitResponseAPDU* init,char* buffer,long* len));
+char* readInitResponseAPDU PARAMS((InitResponseAPDU** init,char* buffer));
+InitResponseAPDU* replyToInitAPDU PARAMS((InitAPDU* init,boolean result,void* userInfo));
 
-SearchAPDU* makeSearchAPDU _AP((long small,long large, long medium,
+SearchAPDU* makeSearchAPDU PARAMS((long small,long large, long medium,
 				boolean replace,char* name,char** databases,
 				char* type,char** elements,any* refID,void* queryInfo));
-void freeSearchAPDU _AP((SearchAPDU* query));
-char* writeSearchAPDU _AP((SearchAPDU* query,char* buffer,long* len));
-char* readSearchAPDU _AP((SearchAPDU** query,char* buffer));
+void freeSearchAPDU PARAMS((SearchAPDU* query));
+char* writeSearchAPDU PARAMS((SearchAPDU* query,char* buffer,long* len));
+char* readSearchAPDU PARAMS((SearchAPDU** query,char* buffer));
 
-SearchResponseAPDU* makeSearchResponseAPDU _AP((long result,long count,
+SearchResponseAPDU* makeSearchResponseAPDU PARAMS((long result,long count,
 						long recordsReturned,long nextPos,
 						long resultStatus,long presentStatus,
 						any* refID,void* records));
-void freeSearchResponseAPDU _AP((SearchResponseAPDU* queryResponse));
-char* writeSearchResponseAPDU _AP((SearchResponseAPDU* queryResponse,char* buffer,long* len));
-char* readSearchResponseAPDU _AP((SearchResponseAPDU** queryResponse,char* buffer));
+void freeSearchResponseAPDU PARAMS((SearchResponseAPDU* queryResponse));
+char* writeSearchResponseAPDU PARAMS((SearchResponseAPDU* queryResponse,char* buffer,long* len));
+char* readSearchResponseAPDU PARAMS((SearchResponseAPDU** queryResponse,char* buffer));
 
-PresentAPDU* makePresentAPDU _AP((long recsReq, long startPos,
+PresentAPDU* makePresentAPDU PARAMS((long recsReq, long startPos,
 				  char* resultID,any* refID,void* info));
-void freePresentAPDU _AP((PresentAPDU* present));
-char* writePresentAPDU _AP((PresentAPDU* present,char* buffer,long* len));
-char* readPresentAPDU _AP((PresentAPDU** present,char* buffer));
+void freePresentAPDU PARAMS((PresentAPDU* present));
+char* writePresentAPDU PARAMS((PresentAPDU* present,char* buffer,long* len));
+char* readPresentAPDU PARAMS((PresentAPDU** present,char* buffer));
 
-PresentResponseAPDU* makePresentResponseAPDU _AP((boolean status,long recsRet,
+PresentResponseAPDU* makePresentResponseAPDU PARAMS((boolean status,long recsRet,
 						  long nextPos,any* refID,
 						  void* records));
-void freePresentResponseAPDU _AP((PresentResponseAPDU* present));
-char* writePresentResponseAPDU _AP((PresentResponseAPDU* present,char* buffer,long* len));
-char* readPresentResponseAPDU _AP((PresentResponseAPDU** present,char* buffer));
+void freePresentResponseAPDU PARAMS((PresentResponseAPDU* present));
+char* writePresentResponseAPDU PARAMS((PresentResponseAPDU* present,char* buffer,long* len));
+char* readPresentResponseAPDU PARAMS((PresentResponseAPDU** present,char* buffer));
 
 /*----------------------------------------------------------------------*/
 /* user extension hooks: */
 
-extern char* writeInitInfo _AP((InitAPDU* init,char* buffer,long* len));
-extern char* readInitInfo _AP((void** info,char* buffer));
+extern char* writeInitInfo PARAMS((InitAPDU* init,char* buffer,long* len));
+extern char* readInitInfo PARAMS((void** info,char* buffer));
 
-extern char* writeInitResponseInfo _AP((InitResponseAPDU* init,char* buffer,long* len));
-extern char* readInitResponseInfo _AP((void** info,char* buffer));
+extern char* writeInitResponseInfo PARAMS((InitResponseAPDU* init,char* buffer,long* len));
+extern char* readInitResponseInfo PARAMS((void** info,char* buffer));
 
-extern char* writeSearchInfo _AP((SearchAPDU* query,char* buffer,long* len));
-extern char* readSearchInfo _AP((void** info,char* buffer));
+extern char* writeSearchInfo PARAMS((SearchAPDU* query,char* buffer,long* len));
+extern char* readSearchInfo PARAMS((void** info,char* buffer));
 
-extern char* writeSearchResponseInfo _AP((SearchResponseAPDU* query,char* buffer,long* len));
-extern char* readSearchResponseInfo _AP((void** info,char* buffer));
+extern char* writeSearchResponseInfo PARAMS((SearchResponseAPDU* query,char* buffer,long* len));
+extern char* readSearchResponseInfo PARAMS((void** info,char* buffer));
 
-extern char* writePresentInfo _AP((PresentAPDU* present,char* buffer,long* len));
-extern char* readPresentInfo _AP((void** info,char* buffer));
+extern char* writePresentInfo PARAMS((PresentAPDU* present,char* buffer,long* len));
+extern char* readPresentInfo PARAMS((void** info,char* buffer));
 
-extern char* writePresentResponseInfo _AP((PresentResponseAPDU* present,char* buffer,long* len));
-extern char* readPresentResponseInfo _AP((void** info,char* buffer));
+extern char* writePresentResponseInfo PARAMS((PresentResponseAPDU* present,char* buffer,long* len));
+extern char* readPresentResponseInfo PARAMS((void** info,char* buffer));
 
 
 #endif /* HTVMSWAIS_H */
diff --git a/WWW/Library/Implementation/HTWAIS.c b/WWW/Library/Implementation/HTWAIS.c
index cd11af57..81d7239a 100644
--- a/WWW/Library/Implementation/HTWAIS.c
+++ b/WWW/Library/Implementation/HTWAIS.c
@@ -49,7 +49,6 @@
 */
 
 #include <HTUtils.h>
-#include <tcp.h>
 #include <HTParse.h>
 #include <HTAccess.h>		/* We implement a protocol */
 #include <HTML.h>		/* The object we will generate */
@@ -78,8 +77,6 @@
 */
 #include <LYLeaks.h>
 
-#define FREE(x) if (x) {free(x); x = NULL;}
-
 #define DIRECTORY "/cnidr.org:210/directory-of-servers"
 /* #define DIRECTORY "/quake.think.com:210/directory-of-servers" */
 
diff --git a/WWW/Library/Implementation/HTWAIS.h b/WWW/Library/Implementation/HTWAIS.h
index fe203ef9..e8a6b7f2 100644
--- a/WWW/Library/Implementation/HTWAIS.h
+++ b/WWW/Library/Implementation/HTWAIS.h
@@ -25,9 +25,6 @@
 #ifndef HTWAIS_H
 #define HTWAIS_H
 
-#ifndef HTUTILS_H
-#include <HTUtils.h>
-#endif /* HTUTILS_H */
 #include <HTAccess.h>
 
 #ifdef GLOBALREF_IS_MACRO
diff --git a/WWW/Library/Implementation/HTWSRC.c b/WWW/Library/Implementation/HTWSRC.c
index e5a7f830..8b764a73 100644
--- a/WWW/Library/Implementation/HTWSRC.c
+++ b/WWW/Library/Implementation/HTWSRC.c
@@ -9,7 +9,6 @@
 */
 
 #include <HTUtils.h>
-#include <tcp.h>
 
 #include <HTWSRC.h>
 
@@ -19,8 +18,6 @@
 
 #include <LYLeaks.h>
 
-#define FREE(x) if (x) {free(x); x = NULL;}
-
 #define BIG 10000		/* Arbitrary limit to value length */
 #define PARAM_MAX BIG
 #define CACHE_PERIOD (7*86400)	/* Time to keep .src file in seconds */
diff --git a/WWW/Library/Implementation/HTWSRC.h b/WWW/Library/Implementation/HTWSRC.h
index cde25467..62617022 100644
--- a/WWW/Library/Implementation/HTWSRC.h
+++ b/WWW/Library/Implementation/HTWSRC.h
@@ -11,10 +11,6 @@
 #ifndef HTWSRC_H
 #define HTWSRC_H
 
-#ifndef HTUTILS_H
-#include <HTUtils.h>
-#endif /* HTUTILS_H */
-
 #include <HTFormat.h>
 
 extern  char from_hex PARAMS((char c));
diff --git a/WWW/Library/Implementation/HTWriter.c b/WWW/Library/Implementation/HTWriter.c
index c6c88638..c4dba35b 100644
--- a/WWW/Library/Implementation/HTWriter.c
+++ b/WWW/Library/Implementation/HTWriter.c
@@ -2,8 +2,8 @@
 **		===========
 **
 */
+
 #include <HTUtils.h>
-#include <tcp.h>
 
 #include <HTWriter.h>
 
@@ -11,8 +11,6 @@
 
 #include <LYLeaks.h>
 
-#define FREE(x) if (x) {free(x); x = NULL;}
-
 /*		HTML Object
 **		-----------
 */
diff --git a/WWW/Library/Implementation/LYLeaks.h b/WWW/Library/Implementation/LYLeaks.h
index 91bfbaac..19fc69f4 100644
--- a/WWW/Library/Implementation/LYLeaks.h
+++ b/WWW/Library/Implementation/LYLeaks.h
@@ -41,7 +41,6 @@
 /*
 **  Required includes
 */
-#include <stdlib.h>
 #include <HTUtils.h>
 
 /*
diff --git a/WWW/Library/Implementation/LYexit.h b/WWW/Library/Implementation/LYexit.h
index 93bc8070..f53561a4 100644
--- a/WWW/Library/Implementation/LYexit.h
+++ b/WWW/Library/Implementation/LYexit.h
@@ -19,7 +19,6 @@
 /*
  *	Required includes
  */
-#include <stdlib.h>
 #include <HTUtils.h>
 
 /*
diff --git a/WWW/Library/Implementation/SGML.c b/WWW/Library/Implementation/SGML.c
index 051885e0..884f6d79 100644
--- a/WWW/Library/Implementation/SGML.c
+++ b/WWW/Library/Implementation/SGML.c
@@ -10,7 +10,6 @@
 */
 
 #include <HTUtils.h>
-#include <tcp.h>		/* For FROMASCII */
 
 /* Remove the following to disable the experimental HTML DTD parsing.
    Currently only used in this source file. - kw */
@@ -26,7 +25,6 @@
 #include <UCDefs.h>
 #include <UCAux.h>
 
-#include <ctype.h>
 #include <HTChunk.h>
 
 #include <LYCharSets.h>
@@ -35,8 +33,6 @@
 
 #define INVALID (-1)
 
-#define FREE(x) if (x) {free(x); x = NULL;}
-
 PUBLIC HTCJKlang HTCJK = NOCJK; 	/* CJK enum value.		*/
 PUBLIC BOOL HTPassEightBitRaw = FALSE;	/* Pass 161-172,174-255 raw.	*/
 PUBLIC BOOL HTPassEightBitNum = FALSE;	/* Pass ^ numeric entities raw. */
diff --git a/WWW/Library/Implementation/SGML.h b/WWW/Library/Implementation/SGML.h
index fd0bf759..22f4bded 100644
--- a/WWW/Library/Implementation/SGML.h
+++ b/WWW/Library/Implementation/SGML.h
@@ -20,9 +20,6 @@
 #ifndef SGML_H
 #define SGML_H
 
-#ifndef HTUTILS_H
-#include <HTUtils.h>
-#endif /* HTUTILS_H */
 #include <HTStream.h>
 #include <HTAnchor.h>
 
diff --git a/WWW/Library/Implementation/UCAux.h b/WWW/Library/Implementation/UCAux.h
index a1e3df46..3b1df229 100644
--- a/WWW/Library/Implementation/UCAux.h
+++ b/WWW/Library/Implementation/UCAux.h
@@ -1,6 +1,8 @@
 #ifndef UCAUX_H
 #define UCAUX_H
 
+#include <HTUtils.h>
+
 extern BOOL UCCanUniTranslateFrom PARAMS((int from));
 extern BOOL UCCanTranslateUniTo PARAMS((int to));
 extern BOOL UCCanTranslateFromTo PARAMS((int from, int to));
diff --git a/WWW/Library/Implementation/UCDefs.h b/WWW/Library/Implementation/UCDefs.h
index ac2dc3bc..8c370338 100644
--- a/WWW/Library/Implementation/UCDefs.h
+++ b/WWW/Library/Implementation/UCDefs.h
@@ -3,6 +3,8 @@
 #ifndef UCDEFS_H
 #define UCDEFS_H
 
+#include <HTUtils.h>
+
 typedef struct _LYUCcharset {
     int UChndl;
     CONST char * MIMEname;
diff --git a/WWW/Library/Implementation/UCMap.h b/WWW/Library/Implementation/UCMap.h
index e634f760..5a8c1210 100644
--- a/WWW/Library/Implementation/UCMap.h
+++ b/WWW/Library/Implementation/UCMap.h
@@ -2,6 +2,8 @@
 #ifndef UCMAP_H
 #define UCMAP_H
 
+#include <HTUtils.h>
+
 typedef long UCode_t;
 
 extern int UCTransUniChar PARAMS((
@@ -43,6 +45,4 @@ extern int UCLYhndl_HTFile_for_unrec;
 
 #define UCTRANS_NOTFOUND (-4)
 
-#define HT_CANNOT_TRANSLATE -4	/* could go into HTUtils.h */
-
 #endif /* UCMAP_H */
diff --git a/WWW/Library/Implementation/crypt.c b/WWW/Library/Implementation/crypt.c
index 1a01711c..3645f63e 100644
--- a/WWW/Library/Implementation/crypt.c
+++ b/WWW/Library/Implementation/crypt.c
@@ -23,9 +23,7 @@
  *
  */
 
-#ifndef HTUTILS_H
 #include <HTUtils.h>
-#endif
 
 #include <ufc-crypt.h>
 
diff --git a/WWW/Library/Implementation/crypt_util.c b/WWW/Library/Implementation/crypt_util.c
index 5d8c710a..91868b75 100644
--- a/WWW/Library/Implementation/crypt_util.c
+++ b/WWW/Library/Implementation/crypt_util.c
@@ -23,9 +23,7 @@
  *
  */
 
-#ifndef HTUTILS_H
 #include <HTUtils.h>
-#endif
 
 #ifndef STATIC
 #define STATIC static
diff --git a/WWW/Library/Implementation/entities.h b/WWW/Library/Implementation/entities.h
index 55ce977b..a6ca7c1d 100644
--- a/WWW/Library/Implementation/entities.h
+++ b/WWW/Library/Implementation/entities.h
@@ -15,6 +15,12 @@
 *	Why keep two structures for entities?  Backward compatibility..
 */
 
+#ifndef ENTITIES_H
+#define ENTITIES_H 1
+
+#include <HTUtils.h>
+#include <SGML.h>
+
 /* UC_entity_info structure is defined in SGML.h.
    This has to be sorted alphabetically (case-sensitive),
    bear this in mind when you add some more entities..  */
@@ -1082,3 +1088,5 @@ static CONST UC_entity_info unicode_entities[] = {
 /* {"scnap",	0x????},  succeeds, not approximately equal to	 # ISOamsn */
 /* {"smid",	0x????},  shortmid				 # ISOamsr */
 };
+
+#endif /* ENTITIES_H */
diff --git a/WWW/Library/Implementation/getline.c b/WWW/Library/Implementation/getline.c
index 4ee2e744..3168b9ec 100644
--- a/WWW/Library/Implementation/getline.c
+++ b/WWW/Library/Implementation/getline.c
@@ -17,14 +17,11 @@ not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
 /* CHANGED FOR VMS */
-
 /*
  * <getline.c>
  */
 
 #include <HTUtils.h>
-#include <tcp.h>
-#include <stddef.h>
 
 #include <LYLeaks.h>
 
diff --git a/WWW/Library/Implementation/tcp.h b/WWW/Library/Implementation/tcp.h
index 6d4eae6f..5df279ef 100644
--- a/WWW/Library/Implementation/tcp.h
+++ b/WWW/Library/Implementation/tcp.h
@@ -29,10 +29,6 @@
 #ifndef TCP_H
 #define TCP_H
 
-#ifndef HTUTILS_H
-#include <HTUtils.h>
-#endif /* !HTUTILS_H */
-
 /*
 
 Default values
@@ -97,10 +93,11 @@ typedef struct sockaddr_in SockA;  /* See netinet/in.h */
 # endif
 #endif
 
-#ifdef _AIX
+#if defined(_AIX) && !defined(AIX)
 #define AIX
 #endif /* _AIX */
-#ifdef AIX
+
+#if defined(AIX) && !defined(unix)
 #define unix
 #endif /* AIX */
 
@@ -525,8 +522,16 @@ typedef unsigned short mode_t;
 typedef int pid_t;
 #endif /* !pid_t */
 
+#ifndef S_ISLNK
+#define S_ISLNK(m)	(((m) & S_IFMT) == S_IFLNK)
+#endif /* S_ISLNK */
+
+#ifndef S_ISDIR
+#define S_ISDIR(m)	(((m) & S_IFMT) == S_IFDIR)
+#endif /* S_ISDIR */
+
 #ifndef S_ISREG
-#define S_ISREG(m) (((m) & 0170000) == 0100000)
+#define S_ISREG(m)	(((m) & S_IFMT) == S_IFREG)
 #endif /* S_ISREG */
 
 #ifndef WEXITSTATUS
diff --git a/aclocal.m4 b/aclocal.m4
index 9b98298a..4c9b5ee5 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -1367,7 +1367,8 @@ AC_MSG_CHECKING(if the socks library uses socks4 prefix)
 AC_TRY_LINK([
 #include <socks.h>],[
 	Rinit((char *)0)],
-	[cf_use_socks4=yes],
+	[AC_DEFINE(USE_SOCKS4_PREFIX)
+	 cf_use_socks4=yes],
 	[AC_TRY_LINK([#include <socks.h>],
 		[SOCKSinit((char *)0)],
 		[cf_use_socks4=no],
diff --git a/config.hin b/config.hin
index 131df923..c64801f7 100644
--- a/config.hin
+++ b/config.hin
@@ -107,6 +107,7 @@
 #undef USE_HASH			/* see USE_COLOR_STYLE */
 #undef USE_SIZECHANGEHACK	/* FIXME: find a case where this works! */
 #undef USE_SLANG		/* AC_ARG_WITH(screen=slang) */
+#undef USE_SOCKS4_PREFIX	/* CF_SOCKS5 */
 #undef USE_SOCKS5		/* CF_SOCKS5 */
 #undef USE_ZLIB			/* AC_ARG_WITH(zlib) */
 #undef UTMPX_FOR_UTMP		/* use <utmpx.h> since <utmp.h> not found */
diff --git a/configure b/configure
index 4738148b..87f11bc3 100755
--- a/configure
+++ b/configure
@@ -2941,20 +2941,24 @@ int main() {
 EOF
 if { (eval echo configure:2943: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
-  cf_use_socks4=yes
+  cat >> confdefs.h <<\EOF
+#define USE_SOCKS4_PREFIX 1
+EOF
+
+	 cf_use_socks4=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
   cat > conftest.$ac_ext <<EOF
-#line 2951 "configure"
+#line 2955 "configure"
 #include "confdefs.h"
 #include <socks.h>
 int main() {
 SOCKSinit((char *)0)
 ; return 0; }
 EOF
-if { (eval echo configure:2958: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2962: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   cf_use_socks4=no
 else
@@ -3023,7 +3027,7 @@ else
 	
 cf_test_netlibs=no
 echo $ac_n "checking for network libraries""... $ac_c" 1>&6
-echo "configure:3027: checking for network libraries" >&5
+echo "configure:3031: checking for network libraries" >&5
 if eval "test \"`echo '$''{'cf_cv_netlibs'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3034,12 +3038,12 @@ cf_test_netlibs=yes
 for ac_func in gethostname
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3038: checking for $ac_func" >&5
+echo "configure:3042: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3043 "configure"
+#line 3047 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -3062,7 +3066,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:3066: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3070: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -3085,7 +3089,7 @@ else
   echo "$ac_t""no" 1>&6
 
 echo $ac_n "checking for gethostname in -lnsl""... $ac_c" 1>&6
-echo "configure:3089: checking for gethostname in -lnsl" >&5
+echo "configure:3093: checking for gethostname in -lnsl" >&5
 ac_lib_var=`echo nsl'_'gethostname | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3093,7 +3097,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lnsl $cf_cv_netlibs $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3097 "configure"
+#line 3101 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3104,7 +3108,7 @@ int main() {
 gethostname()
 ; return 0; }
 EOF
-if { (eval echo configure:3108: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3112: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3137,7 +3141,7 @@ else
 	
 		
 echo $ac_n "checking for gethostname in -lsocket""... $ac_c" 1>&6
-echo "configure:3141: checking for gethostname in -lsocket" >&5
+echo "configure:3145: checking for gethostname in -lsocket" >&5
 ac_lib_var=`echo socket'_'gethostname | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3145,7 +3149,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lsocket $cf_cv_netlibs $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3149 "configure"
+#line 3153 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3156,7 +3160,7 @@ int main() {
 gethostname()
 ; return 0; }
 EOF
-if { (eval echo configure:3160: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3164: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3200,21 +3204,21 @@ done
 # FIXME:  sequent needs this library (i.e., -lsocket -linet -lnsl), but
 # I don't know the entrypoints - 97/7/22 TD
 echo $ac_n "checking for -linet""... $ac_c" 1>&6
-echo "configure:3204: checking for -linet" >&5
+echo "configure:3208: checking for -linet" >&5
 if eval "test \"`echo '$''{'ac_cv_lib_inet'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_save_LIBS="$LIBS"
 LIBS="-linet  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3211 "configure"
+#line 3215 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:3218: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3222: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   ac_cv_lib_inet=yes
 else
@@ -3237,12 +3241,12 @@ if test "$ac_cv_func_lsocket" != no ; then
 for ac_func in socket
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3241: checking for $ac_func" >&5
+echo "configure:3245: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3246 "configure"
+#line 3250 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -3265,7 +3269,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:3269: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3273: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -3288,7 +3292,7 @@ else
   echo "$ac_t""no" 1>&6
 
 echo $ac_n "checking for socket in -lsocket""... $ac_c" 1>&6
-echo "configure:3292: checking for socket in -lsocket" >&5
+echo "configure:3296: checking for socket in -lsocket" >&5
 ac_lib_var=`echo socket'_'socket | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3296,7 +3300,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lsocket $cf_cv_netlibs $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3300 "configure"
+#line 3304 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3307,7 +3311,7 @@ int main() {
 socket()
 ; return 0; }
 EOF
-if { (eval echo configure:3311: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3315: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3340,7 +3344,7 @@ else
 	
 		
 echo $ac_n "checking for socket in -lbsd""... $ac_c" 1>&6
-echo "configure:3344: checking for socket in -lbsd" >&5
+echo "configure:3348: checking for socket in -lbsd" >&5
 ac_lib_var=`echo bsd'_'socket | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3348,7 +3352,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lbsd $cf_cv_netlibs $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3352 "configure"
+#line 3356 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3359,7 +3363,7 @@ int main() {
 socket()
 ; return 0; }
 EOF
-if { (eval echo configure:3363: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3367: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3404,12 +3408,12 @@ fi
 for ac_func in gethostbyname
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3408: checking for $ac_func" >&5
+echo "configure:3412: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3413 "configure"
+#line 3417 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -3432,7 +3436,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:3436: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3440: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -3455,7 +3459,7 @@ else
   echo "$ac_t""no" 1>&6
 
 echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
-echo "configure:3459: checking for gethostbyname in -lnsl" >&5
+echo "configure:3463: checking for gethostbyname in -lnsl" >&5
 ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3463,7 +3467,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lnsl $cf_cv_netlibs $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3467 "configure"
+#line 3471 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3474,7 +3478,7 @@ int main() {
 gethostbyname()
 ; return 0; }
 EOF
-if { (eval echo configure:3478: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3482: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3515,12 +3519,12 @@ done
 for ac_func in strcasecmp
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3519: checking for $ac_func" >&5
+echo "configure:3523: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3524 "configure"
+#line 3528 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -3543,7 +3547,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:3547: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3551: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -3566,7 +3570,7 @@ else
   echo "$ac_t""no" 1>&6
 
 echo $ac_n "checking for strcasecmp in -lresolv""... $ac_c" 1>&6
-echo "configure:3570: checking for strcasecmp in -lresolv" >&5
+echo "configure:3574: checking for strcasecmp in -lresolv" >&5
 ac_lib_var=`echo resolv'_'strcasecmp | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3574,7 +3578,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lresolv $cf_cv_netlibs $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3578 "configure"
+#line 3582 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3585,7 +3589,7 @@ int main() {
 strcasecmp()
 ; return 0; }
 EOF
-if { (eval echo configure:3589: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3593: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3631,7 +3635,7 @@ test $cf_test_netlibs = no && echo "$cf_cv_netlibs" >&6
 fi
 
 echo $ac_n "checking for screen type""... $ac_c" 1>&6
-echo "configure:3635: checking for screen type" >&5
+echo "configure:3639: checking for screen type" >&5
 if eval "test \"`echo '$''{'cf_cv_screen'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3666,12 +3670,12 @@ case $cf_cv_screen in
 curses)
 	
 echo $ac_n "checking for initscr""... $ac_c" 1>&6
-echo "configure:3670: checking for initscr" >&5
+echo "configure:3674: checking for initscr" >&5
 if eval "test \"`echo '$''{'ac_cv_func_initscr'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3675 "configure"
+#line 3679 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char initscr(); below.  */
@@ -3694,7 +3698,7 @@ initscr();
 
 ; return 0; }
 EOF
-if { (eval echo configure:3698: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3702: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_initscr=yes"
 else
@@ -3715,7 +3719,7 @@ else
 case $host_os in #(vi
 freebsd*) #(vi
 	echo $ac_n "checking for tgoto in -lmytinfo""... $ac_c" 1>&6
-echo "configure:3719: checking for tgoto in -lmytinfo" >&5
+echo "configure:3723: checking for tgoto in -lmytinfo" >&5
 ac_lib_var=`echo mytinfo'_'tgoto | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3723,7 +3727,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lmytinfo  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3727 "configure"
+#line 3731 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3734,7 +3738,7 @@ int main() {
 tgoto()
 ; return 0; }
 EOF
-if { (eval echo configure:3738: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3742: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3757,7 +3761,7 @@ fi
 	;;
 hpux10.*)
 	echo $ac_n "checking for initscr in -lcur_colr""... $ac_c" 1>&6
-echo "configure:3761: checking for initscr in -lcur_colr" >&5
+echo "configure:3765: checking for initscr in -lcur_colr" >&5
 ac_lib_var=`echo cur_colr'_'initscr | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3765,7 +3769,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lcur_colr  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3769 "configure"
+#line 3773 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3776,7 +3780,7 @@ int main() {
 initscr()
 ; return 0; }
 EOF
-if { (eval echo configure:3780: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3784: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3800,7 +3804,7 @@ else
   echo "$ac_t""no" 1>&6
 
 	echo $ac_n "checking for initscr in -lHcurses""... $ac_c" 1>&6
-echo "configure:3804: checking for initscr in -lHcurses" >&5
+echo "configure:3808: checking for initscr in -lHcurses" >&5
 ac_lib_var=`echo Hcurses'_'initscr | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3808,7 +3812,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lHcurses  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3812 "configure"
+#line 3816 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3819,7 +3823,7 @@ int main() {
 initscr()
 ; return 0; }
 EOF
-if { (eval echo configure:3823: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3827: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3865,12 +3869,12 @@ if test ".$ac_cv_func_initscr" != .yes ; then
 	# Check for library containing tgoto.  Do this before curses library
 	# because it may be needed to link the test-case for initscr.
 	echo $ac_n "checking for tgoto""... $ac_c" 1>&6
-echo "configure:3869: checking for tgoto" >&5
+echo "configure:3873: checking for tgoto" >&5
 if eval "test \"`echo '$''{'ac_cv_func_tgoto'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3874 "configure"
+#line 3878 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char tgoto(); below.  */
@@ -3893,7 +3897,7 @@ tgoto();
 
 ; return 0; }
 EOF
-if { (eval echo configure:3897: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3901: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_tgoto=yes"
 else
@@ -3914,7 +3918,7 @@ else
 		for cf_term_lib in termcap termlib unknown
 		do
 			echo $ac_n "checking for tgoto in -l$cf_term_lib""... $ac_c" 1>&6
-echo "configure:3918: checking for tgoto in -l$cf_term_lib" >&5
+echo "configure:3922: checking for tgoto in -l$cf_term_lib" >&5
 ac_lib_var=`echo $cf_term_lib'_'tgoto | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3922,7 +3926,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-l$cf_term_lib  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3926 "configure"
+#line 3930 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3933,7 +3937,7 @@ int main() {
 tgoto()
 ; return 0; }
 EOF
-if { (eval echo configure:3937: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3941: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3963,7 +3967,7 @@ fi
 	for cf_curs_lib in cursesX curses ncurses xcurses jcurses unknown
 	do
 		echo $ac_n "checking for initscr in -l$cf_curs_lib""... $ac_c" 1>&6
-echo "configure:3967: checking for initscr in -l$cf_curs_lib" >&5
+echo "configure:3971: checking for initscr in -l$cf_curs_lib" >&5
 ac_lib_var=`echo $cf_curs_lib'_'initscr | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3971,7 +3975,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-l$cf_curs_lib  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3975 "configure"
+#line 3979 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3982,7 +3986,7 @@ int main() {
 initscr()
 ; return 0; }
 EOF
-if { (eval echo configure:3986: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3990: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4008,16 +4012,16 @@ fi
 	LIBS="-l$cf_curs_lib $cf_save_LIBS"
 	if test "$cf_term_lib" = unknown ; then
 		echo $ac_n "checking if we can link with $cf_curs_lib library""... $ac_c" 1>&6
-echo "configure:4012: checking if we can link with $cf_curs_lib library" >&5
+echo "configure:4016: checking if we can link with $cf_curs_lib library" >&5
 		cat > conftest.$ac_ext <<EOF
-#line 4014 "configure"
+#line 4018 "configure"
 #include "confdefs.h"
 #include <${cf_cv_ncurses_header-curses.h}>
 int main() {
 initscr()
 ; return 0; }
 EOF
-if { (eval echo configure:4021: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4025: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   cf_result=yes
 else
@@ -4031,16 +4035,16 @@ rm -f conftest*
 		test $cf_result = no && { echo "configure: error: Cannot link curses library" 1>&2; exit 1; }
 	elif test "$cf_term_lib" != predefined ; then
 		echo $ac_n "checking if we need both $cf_curs_lib and $cf_term_lib libraries""... $ac_c" 1>&6
-echo "configure:4035: checking if we need both $cf_curs_lib and $cf_term_lib libraries" >&5
+echo "configure:4039: checking if we need both $cf_curs_lib and $cf_term_lib libraries" >&5
 		cat > conftest.$ac_ext <<EOF
-#line 4037 "configure"
+#line 4041 "configure"
 #include "confdefs.h"
 #include <${cf_cv_ncurses_header-curses.h}>
 int main() {
 initscr(); tgoto((char *)0, 0, 0);
 ; return 0; }
 EOF
-if { (eval echo configure:4044: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4048: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   cf_result=no
 else
@@ -4050,14 +4054,14 @@ else
   
 			LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
 			cat > conftest.$ac_ext <<EOF
-#line 4054 "configure"
+#line 4058 "configure"
 #include "confdefs.h"
 #include <${cf_cv_ncurses_header-curses.h}>
 int main() {
 initscr()
 ; return 0; }
 EOF
-if { (eval echo configure:4061: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4065: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   cf_result=yes
 else
@@ -4079,14 +4083,14 @@ fi
 
 	
 echo $ac_n "checking for curses performance tradeoff""... $ac_c" 1>&6
-echo "configure:4083: checking for curses performance tradeoff" >&5
+echo "configure:4087: checking for curses performance tradeoff" >&5
 if eval "test \"`echo '$''{'cf_cv_curs_performance'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
     cf_cv_curs_performance=no
     cat > conftest.$ac_ext <<EOF
-#line 4090 "configure"
+#line 4094 "configure"
 #include "confdefs.h"
 
 #include <${cf_cv_ncurses_header-curses.h}>
@@ -4100,11 +4104,11 @@ int main() {
 	
 ; return 0; }
 EOF
-if { (eval echo configure:4104: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4108: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   
 	cat > conftest.$ac_ext <<EOF
-#line 4108 "configure"
+#line 4112 "configure"
 #include "confdefs.h"
 
 #define CURS_PERFORMANCE
@@ -4119,7 +4123,7 @@ int main() {
 	
 ; return 0; }
 EOF
-if { (eval echo configure:4123: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4127: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cf_cv_curs_performance=yes
 else
@@ -4144,13 +4148,13 @@ EOF
 ncurses)
 	
 echo $ac_n "checking for ncurses header file""... $ac_c" 1>&6
-echo "configure:4148: checking for ncurses header file" >&5
+echo "configure:4152: checking for ncurses header file" >&5
 if eval "test \"`echo '$''{'cf_cv_ncurses_header'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 	cat > conftest.$ac_ext <<EOF
-#line 4154 "configure"
+#line 4158 "configure"
 #include "confdefs.h"
 #include <curses.h>
 int main() {
@@ -4167,7 +4171,7 @@ make an error
 	
 ; return 0; }
 EOF
-if { (eval echo configure:4171: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4175: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cf_cv_ncurses_header=predefined
 else
@@ -4253,7 +4257,7 @@ done
 	;;
 esac
 echo $ac_n "checking for ncurses version""... $ac_c" 1>&6
-echo "configure:4257: checking for ncurses version" >&5
+echo "configure:4261: checking for ncurses version" >&5
 if eval "test \"`echo '$''{'cf_cv_ncurses_version'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4278,7 +4282,7 @@ Autoconf "old"
 #endif
 EOF
 	cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
-	{ (eval echo configure:4282: \"$cf_try\") 1>&5; (eval $cf_try) 2>&5; }
+	{ (eval echo configure:4286: \"$cf_try\") 1>&5; (eval $cf_try) 2>&5; }
 	if test -f conftest.out ; then
 		cf_out=`cat conftest.out | sed -e 's@^Autoconf @@' -e 's@^[^"]*"@@' -e 's@".*@@'`
 		test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
@@ -4287,7 +4291,7 @@ EOF
 
 else
   cat > conftest.$ac_ext <<EOF
-#line 4291 "configure"
+#line 4295 "configure"
 #include "confdefs.h"
 
 #include <${cf_cv_ncurses_header-curses.h}>
@@ -4310,7 +4314,7 @@ int main()
 	exit(0);
 }
 EOF
-if { (eval echo configure:4314: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:4318: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   
 	cf_cv_ncurses_version=`cat $cf_tempfile`
@@ -4335,7 +4339,7 @@ echo "$ac_t""$cf_cv_ncurses_version" 1>&6
 cf_ncurses_LIBS=""
 cf_ncurses_SAVE="$LIBS"
 echo $ac_n "checking for Gpm_Open in -lgpm""... $ac_c" 1>&6
-echo "configure:4339: checking for Gpm_Open in -lgpm" >&5
+echo "configure:4343: checking for Gpm_Open in -lgpm" >&5
 ac_lib_var=`echo gpm'_'Gpm_Open | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4343,7 +4347,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lgpm  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4347 "configure"
+#line 4351 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4354,7 +4358,7 @@ int main() {
 Gpm_Open()
 ; return 0; }
 EOF
-if { (eval echo configure:4358: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4362: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4370,7 +4374,7 @@ fi
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
   echo $ac_n "checking for initscr in -lgpm""... $ac_c" 1>&6
-echo "configure:4374: checking for initscr in -lgpm" >&5
+echo "configure:4378: checking for initscr in -lgpm" >&5
 ac_lib_var=`echo gpm'_'initscr | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4378,7 +4382,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lgpm  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4382 "configure"
+#line 4386 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4389,7 +4393,7 @@ int main() {
 initscr()
 ; return 0; }
 EOF
-if { (eval echo configure:4393: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4397: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4420,7 +4424,7 @@ freebsd*)
 	# This is only necessary if you are linking against an obsolete
 	# version of ncurses (but it should do no harm, since it's static).
 	echo $ac_n "checking for tgoto in -lmytinfo""... $ac_c" 1>&6
-echo "configure:4424: checking for tgoto in -lmytinfo" >&5
+echo "configure:4428: checking for tgoto in -lmytinfo" >&5
 ac_lib_var=`echo mytinfo'_'tgoto | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4428,7 +4432,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lmytinfo  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4432 "configure"
+#line 4436 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4439,7 +4443,7 @@ int main() {
 tgoto()
 ; return 0; }
 EOF
-if { (eval echo configure:4443: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4447: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4467,12 +4471,12 @@ LIBS="$cf_ncurses_LIBS $LIBS"
 	cf_cv_have_lib_ncurses=no
 	cf_libdir=""
 	echo $ac_n "checking for initscr""... $ac_c" 1>&6
-echo "configure:4471: checking for initscr" >&5
+echo "configure:4475: checking for initscr" >&5
 if eval "test \"`echo '$''{'ac_cv_func_initscr'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4476 "configure"
+#line 4480 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char initscr(); below.  */
@@ -4495,7 +4499,7 @@ initscr();
 
 ; return 0; }
 EOF
-if { (eval echo configure:4499: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4503: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_initscr=yes"
 else
@@ -4515,17 +4519,17 @@ else
 
 		cf_save_LIBS="$LIBS"
 		echo $ac_n "checking for initscr in -lncurses""... $ac_c" 1>&6
-echo "configure:4519: checking for initscr in -lncurses" >&5
+echo "configure:4523: checking for initscr in -lncurses" >&5
 		LIBS="-lncurses $LIBS"
 		cat > conftest.$ac_ext <<EOF
-#line 4522 "configure"
+#line 4526 "configure"
 #include "confdefs.h"
 #include <${cf_cv_ncurses_header-curses.h}>
 int main() {
 initscr()
 ; return 0; }
 EOF
-if { (eval echo configure:4529: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4533: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6
 			 cf_cv_have_lib_ncurses=yes
@@ -4552,17 +4556,17 @@ test "$prefix" != /usr           && cf_search="$cf_search /usr/lib /usr/lib/ncur
 			for cf_libdir in $cf_search
 			do
 				echo $ac_n "checking for -lncurses in $cf_libdir""... $ac_c" 1>&6
-echo "configure:4556: checking for -lncurses in $cf_libdir" >&5
+echo "configure:4560: checking for -lncurses in $cf_libdir" >&5
 				LIBS="-L$cf_libdir -lncurses $cf_save_LIBS"
 				cat > conftest.$ac_ext <<EOF
-#line 4559 "configure"
+#line 4563 "configure"
 #include "confdefs.h"
 #include <${cf_cv_ncurses_header-curses.h}>
 int main() {
 initscr()
 ; return 0; }
 EOF
-if { (eval echo configure:4566: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4570: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6
 			 		 cf_cv_have_lib_ncurses=yes
@@ -4594,7 +4598,7 @@ esac
 
 if test -n "$cf_ncurses_LIBS" ; then
 	echo $ac_n "checking if we can link ncurses without $cf_ncurses_LIBS""... $ac_c" 1>&6
-echo "configure:4598: checking if we can link ncurses without $cf_ncurses_LIBS" >&5
+echo "configure:4602: checking if we can link ncurses without $cf_ncurses_LIBS" >&5
 	cf_ncurses_SAVE="$LIBS"
 	for p in $cf_ncurses_LIBS ; do
 		q=`echo $LIBS | sed -e 's/'$p' //' -e 's/'$p'$//'`
@@ -4603,14 +4607,14 @@ echo "configure:4598: checking if we can link ncurses without $cf_ncurses_LIBS"
 		fi
 	done
 	cat > conftest.$ac_ext <<EOF
-#line 4607 "configure"
+#line 4611 "configure"
 #include "confdefs.h"
 #include <${cf_cv_ncurses_header-curses.h}>
 int main() {
 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
 ; return 0; }
 EOF
-if { (eval echo configure:4614: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4618: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6
 else
@@ -4627,20 +4631,20 @@ fi
 slang)
 	
 echo $ac_n "checking for slang header file""... $ac_c" 1>&6
-echo "configure:4631: checking for slang header file" >&5
+echo "configure:4635: checking for slang header file" >&5
 if eval "test \"`echo '$''{'cf_cv_slang_header'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 	cat > conftest.$ac_ext <<EOF
-#line 4637 "configure"
+#line 4641 "configure"
 #include "confdefs.h"
 #include <slang.h>
 int main() {
 printf("%s\n", SLANG_VERSION)
 ; return 0; }
 EOF
-if { (eval echo configure:4644: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4648: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cf_cv_slang_header=predefined
 else
@@ -4724,7 +4728,7 @@ cf_cv_lib_termcap=none
 # HP-UX 9.x terminfo has setupterm, but no tigetstr.
 if test "$termlib" = none; then
 	echo $ac_n "checking for tigetstr in -ltermlib""... $ac_c" 1>&6
-echo "configure:4728: checking for tigetstr in -ltermlib" >&5
+echo "configure:4732: checking for tigetstr in -ltermlib" >&5
 ac_lib_var=`echo termlib'_'tigetstr | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4732,7 +4736,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ltermlib  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4736 "configure"
+#line 4740 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4743,7 +4747,7 @@ int main() {
 tigetstr()
 ; return 0; }
 EOF
-if { (eval echo configure:4747: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4751: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4766,7 +4770,7 @@ fi
 fi
 if test "$cf_cv_lib_termcap" = none; then
 	echo $ac_n "checking for tgoto in -ltermlib""... $ac_c" 1>&6
-echo "configure:4770: checking for tgoto in -ltermlib" >&5
+echo "configure:4774: checking for tgoto in -ltermlib" >&5
 ac_lib_var=`echo termlib'_'tgoto | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4774,7 +4778,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ltermlib  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4778 "configure"
+#line 4782 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4785,7 +4789,7 @@ int main() {
 tgoto()
 ; return 0; }
 EOF
-if { (eval echo configure:4789: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4793: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4809,7 +4813,7 @@ fi
 if test "$cf_cv_lib_termcap" = none; then
 	# allow curses library for broken AIX system.
 	echo $ac_n "checking for initscr in -lcurses""... $ac_c" 1>&6
-echo "configure:4813: checking for initscr in -lcurses" >&5
+echo "configure:4817: checking for initscr in -lcurses" >&5
 ac_lib_var=`echo curses'_'initscr | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4817,7 +4821,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lcurses  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4821 "configure"
+#line 4825 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4828,7 +4832,7 @@ int main() {
 initscr()
 ; return 0; }
 EOF
-if { (eval echo configure:4832: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4836: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4849,7 +4853,7 @@ else
 fi
 
 	echo $ac_n "checking for tgoto in -ltermcap""... $ac_c" 1>&6
-echo "configure:4853: checking for tgoto in -ltermcap" >&5
+echo "configure:4857: checking for tgoto in -ltermcap" >&5
 ac_lib_var=`echo termcap'_'tgoto | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4857,7 +4861,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ltermcap  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4861 "configure"
+#line 4865 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4868,7 +4872,7 @@ int main() {
 tgoto()
 ; return 0; }
 EOF
-if { (eval echo configure:4872: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4876: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4891,7 +4895,7 @@ fi
 fi
 if test "$cf_cv_lib_termcap" = none; then
 	echo $ac_n "checking for tgoto in -ltermcap""... $ac_c" 1>&6
-echo "configure:4895: checking for tgoto in -ltermcap" >&5
+echo "configure:4899: checking for tgoto in -ltermcap" >&5
 ac_lib_var=`echo termcap'_'tgoto | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4899,7 +4903,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ltermcap  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4903 "configure"
+#line 4907 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4910,7 +4914,7 @@ int main() {
 tgoto()
 ; return 0; }
 EOF
-if { (eval echo configure:4914: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4918: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4933,7 +4937,7 @@ fi
 fi
 if test "$cf_cv_lib_termcap" = none; then
 	echo $ac_n "checking for tgoto in -lncurses""... $ac_c" 1>&6
-echo "configure:4937: checking for tgoto in -lncurses" >&5
+echo "configure:4941: checking for tgoto in -lncurses" >&5
 ac_lib_var=`echo ncurses'_'tgoto | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4941,7 +4945,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lncurses  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4945 "configure"
+#line 4949 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4952,7 +4956,7 @@ int main() {
 tgoto()
 ; return 0; }
 EOF
-if { (eval echo configure:4956: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4960: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4982,12 +4986,12 @@ fi
 
 cf_slang_LIBS2="$LIBS"
 echo $ac_n "checking for acos""... $ac_c" 1>&6
-echo "configure:4986: checking for acos" >&5
+echo "configure:4990: checking for acos" >&5
 if eval "test \"`echo '$''{'ac_cv_func_acos'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4991 "configure"
+#line 4995 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char acos(); below.  */
@@ -5010,7 +5014,7 @@ acos();
 
 ; return 0; }
 EOF
-if { (eval echo configure:5014: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5018: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_acos=yes"
 else
@@ -5029,7 +5033,7 @@ else
   echo "$ac_t""no" 1>&6
 
 echo $ac_n "checking for acos in -lm""... $ac_c" 1>&6
-echo "configure:5033: checking for acos in -lm" >&5
+echo "configure:5037: checking for acos in -lm" >&5
 ac_lib_var=`echo m'_'acos | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -5037,7 +5041,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lm $LIBS $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5041 "configure"
+#line 5045 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -5048,7 +5052,7 @@ int main() {
 acos()
 ; return 0; }
 EOF
-if { (eval echo configure:5052: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5056: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5088,12 +5092,12 @@ fi
 	cf_cv_have_lib_slang=no
 	cf_libdir=""
 	echo $ac_n "checking for SLtt_get_screen_size""... $ac_c" 1>&6
-echo "configure:5092: checking for SLtt_get_screen_size" >&5
+echo "configure:5096: checking for SLtt_get_screen_size" >&5
 if eval "test \"`echo '$''{'ac_cv_func_SLtt_get_screen_size'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5097 "configure"
+#line 5101 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char SLtt_get_screen_size(); below.  */
@@ -5116,7 +5120,7 @@ SLtt_get_screen_size();
 
 ; return 0; }
 EOF
-if { (eval echo configure:5120: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5124: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_SLtt_get_screen_size=yes"
 else
@@ -5136,17 +5140,17 @@ else
 
 		cf_save_LIBS="$LIBS"
 		echo $ac_n "checking for SLtt_get_screen_size in -lslang""... $ac_c" 1>&6
-echo "configure:5140: checking for SLtt_get_screen_size in -lslang" >&5
+echo "configure:5144: checking for SLtt_get_screen_size in -lslang" >&5
 		LIBS="-lslang $LIBS"
 		cat > conftest.$ac_ext <<EOF
-#line 5143 "configure"
+#line 5147 "configure"
 #include "confdefs.h"
 #include <slang.h>
 int main() {
 SLtt_get_screen_size()
 ; return 0; }
 EOF
-if { (eval echo configure:5150: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5154: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6
 			 cf_cv_have_lib_slang=yes
@@ -5173,17 +5177,17 @@ test "$prefix" != /usr           && cf_search="$cf_search /usr/lib /usr/lib/slan
 			for cf_libdir in $cf_search
 			do
 				echo $ac_n "checking for -lslang in $cf_libdir""... $ac_c" 1>&6
-echo "configure:5177: checking for -lslang in $cf_libdir" >&5
+echo "configure:5181: checking for -lslang in $cf_libdir" >&5
 				LIBS="-L$cf_libdir -lslang $cf_save_LIBS"
 				cat > conftest.$ac_ext <<EOF
-#line 5180 "configure"
+#line 5184 "configure"
 #include "confdefs.h"
 #include <slang.h>
 int main() {
 SLtt_get_screen_size()
 ; return 0; }
 EOF
-if { (eval echo configure:5187: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5191: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6
 			 		 cf_cv_have_lib_slang=yes
@@ -5214,7 +5218,7 @@ esac
 
 cf_slang_LIBS3="$LIBS"
 echo $ac_n "checking if we can link slang without termcap""... $ac_c" 1>&6
-echo "configure:5218: checking if we can link slang without termcap" >&5
+echo "configure:5222: checking if we can link slang without termcap" >&5
 if test -n "`echo $cf_slang_LIBS1 | sed -e 's/ //g'`" ; then
 	cf_exclude=`echo ".$cf_slang_LIBS2" | sed -e "s@$cf_slang_LIBS1@@" -e 's@^.@@'`
 else
@@ -5222,14 +5226,14 @@ else
 fi
 LIBS=`echo ".$cf_slang_LIBS3" | sed -e "s@$cf_exclude@@" -e 's@^.@@'`
 cat > conftest.$ac_ext <<EOF
-#line 5226 "configure"
+#line 5230 "configure"
 #include "confdefs.h"
 #include <slang.h>
 int main() {
 SLtt_get_screen_size()
 ; return 0; }
 EOF
-if { (eval echo configure:5233: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5237: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   cf_result=yes
 else
@@ -5249,7 +5253,7 @@ eval cf_libdir=$libdir
 cf_libdir=`echo $cf_libdir | sed -e s@'^NONE/'@$prefix/@ -e s@'^NONE/'@$ac_default_prefix/@`
 
 echo $ac_n "checking for location of config-file""... $ac_c" 1>&6
-echo "configure:5253: checking for location of config-file" >&5
+echo "configure:5257: checking for location of config-file" >&5
 LYNX_CFG_FILE=$cf_libdir/lynx.cfg
 cat >> confdefs.h <<EOF
 #define LYNX_CFG_FILE "$LYNX_CFG_FILE"
@@ -5259,12 +5263,12 @@ echo "$ac_t""$LYNX_CFG_FILE" 1>&6
 
 
 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:5263: checking for ANSI C header files" >&5
+echo "configure:5267: checking for ANSI C header files" >&5
 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5268 "configure"
+#line 5272 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <stdarg.h>
@@ -5272,7 +5276,7 @@ else
 #include <float.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5276: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5280: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -5289,7 +5293,7 @@ rm -f conftest*
 if test $ac_cv_header_stdc = yes; then
   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 5293 "configure"
+#line 5297 "configure"
 #include "confdefs.h"
 #include <string.h>
 EOF
@@ -5307,7 +5311,7 @@ fi
 if test $ac_cv_header_stdc = yes; then
   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 5311 "configure"
+#line 5315 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 EOF
@@ -5328,7 +5332,7 @@ if test "$cross_compiling" = yes; then
   :
 else
   cat > conftest.$ac_ext <<EOF
-#line 5332 "configure"
+#line 5336 "configure"
 #include "confdefs.h"
 #include <ctype.h>
 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -5339,7 +5343,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
 exit (0); }
 
 EOF
-if { (eval echo configure:5343: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:5347: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   :
 else
@@ -5363,12 +5367,12 @@ EOF
 fi
 
 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-echo "configure:5367: checking whether time.h and sys/time.h may both be included" >&5
+echo "configure:5371: checking whether time.h and sys/time.h may both be included" >&5
 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5372 "configure"
+#line 5376 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/time.h>
@@ -5377,7 +5381,7 @@ int main() {
 struct tm *tp;
 ; return 0; }
 EOF
-if { (eval echo configure:5381: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5385: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_header_time=yes
 else
@@ -5402,12 +5406,12 @@ for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
-echo "configure:5406: checking for $ac_hdr that defines DIR" >&5
+echo "configure:5410: checking for $ac_hdr that defines DIR" >&5
 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5411 "configure"
+#line 5415 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <$ac_hdr>
@@ -5415,7 +5419,7 @@ int main() {
 DIR *dirp = 0;
 ; return 0; }
 EOF
-if { (eval echo configure:5419: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5423: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval "ac_cv_header_dirent_$ac_safe=yes"
 else
@@ -5440,7 +5444,7 @@ done
 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
 if test $ac_header_dirent = dirent.h; then
 echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
-echo "configure:5444: checking for opendir in -ldir" >&5
+echo "configure:5448: checking for opendir in -ldir" >&5
 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -5448,7 +5452,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ldir  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5452 "configure"
+#line 5456 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -5459,7 +5463,7 @@ int main() {
 opendir()
 ; return 0; }
 EOF
-if { (eval echo configure:5463: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5467: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5481,7 +5485,7 @@ fi
 
 else
 echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
-echo "configure:5485: checking for opendir in -lx" >&5
+echo "configure:5489: checking for opendir in -lx" >&5
 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -5489,7 +5493,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lx  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5493 "configure"
+#line 5497 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -5500,7 +5504,7 @@ int main() {
 opendir()
 ; return 0; }
 EOF
-if { (eval echo configure:5504: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5508: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5539,17 +5543,17 @@ for ac_hdr in \
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5543: checking for $ac_hdr" >&5
+echo "configure:5547: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5548 "configure"
+#line 5552 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5553: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5557: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -5577,13 +5581,13 @@ done
 
 
 echo $ac_n "checking termio.h and termios.h""... $ac_c" 1>&6
-echo "configure:5581: checking termio.h and termios.h" >&5
+echo "configure:5585: checking termio.h and termios.h" >&5
 if eval "test \"`echo '$''{'cf_cv_termio_and_termios'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
     cat > conftest.$ac_ext <<EOF
-#line 5587 "configure"
+#line 5591 "configure"
 #include "confdefs.h"
 
 #if HAVE_TERMIO_H
@@ -5596,7 +5600,7 @@ int main() {
 putchar (0x0a)
 ; return 0; }
 EOF
-if { (eval echo configure:5600: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5604: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cf_cv_termio_and_termios=yes
 else
@@ -5619,17 +5623,17 @@ for ac_hdr in sys/wait.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5623: checking for $ac_hdr" >&5
+echo "configure:5627: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5628 "configure"
+#line 5632 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5633: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5637: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -5666,17 +5670,17 @@ for ac_hdr in wait.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5670: checking for $ac_hdr" >&5
+echo "configure:5674: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5675 "configure"
+#line 5679 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5680: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5684: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -5706,17 +5710,17 @@ for ac_hdr in waitstatus.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5710: checking for $ac_hdr" >&5
+echo "configure:5714: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5715 "configure"
+#line 5719 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5720: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5724: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -5757,13 +5761,13 @@ fi
 
 
 echo $ac_n "checking for union wait""... $ac_c" 1>&6
-echo "configure:5761: checking for union wait" >&5
+echo "configure:5765: checking for union wait" >&5
 if eval "test \"`echo '$''{'cf_cv_type_unionwait'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 	cat > conftest.$ac_ext <<EOF
-#line 5767 "configure"
+#line 5771 "configure"
 #include "confdefs.h"
 $cf_wait_headers
 int main() {
@@ -5774,7 +5778,7 @@ int x;
 	
 ; return 0; }
 EOF
-if { (eval echo configure:5778: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5782: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   cf_cv_type_unionwait=no
 	 echo compiles ok w/o union wait 1>&5
@@ -5785,7 +5789,7 @@ else
   rm -rf conftest*
   
 	cat > conftest.$ac_ext <<EOF
-#line 5789 "configure"
+#line 5793 "configure"
 #include "confdefs.h"
 $cf_wait_headers
 int main() {
@@ -5800,7 +5804,7 @@ union wait x;
 	
 ; return 0; }
 EOF
-if { (eval echo configure:5804: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5808: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   cf_cv_type_unionwait=yes
 	 echo compiles ok with union wait and possibly macros too 1>&5
@@ -5827,20 +5831,20 @@ EOF
 if test $cf_cv_type_unionwait = yes; then
 
 	echo $ac_n "checking if union wait can be used as wait-arg""... $ac_c" 1>&6
-echo "configure:5831: checking if union wait can be used as wait-arg" >&5
+echo "configure:5835: checking if union wait can be used as wait-arg" >&5
 	if eval "test \"`echo '$''{'cf_cv_arg_union_wait'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 		cat > conftest.$ac_ext <<EOF
-#line 5837 "configure"
+#line 5841 "configure"
 #include "confdefs.h"
 $cf_wait_headers
 int main() {
 union wait x; wait(&x)
 ; return 0; }
 EOF
-if { (eval echo configure:5844: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5848: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cf_cv_arg_union_wait=yes
 else
@@ -5860,20 +5864,20 @@ EOF
 
 
 	echo $ac_n "checking if union wait can be used as waitpid-arg""... $ac_c" 1>&6
-echo "configure:5864: checking if union wait can be used as waitpid-arg" >&5
+echo "configure:5868: checking if union wait can be used as waitpid-arg" >&5
 	if eval "test \"`echo '$''{'cf_cv_arg_union_waitpid'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 		cat > conftest.$ac_ext <<EOF
-#line 5870 "configure"
+#line 5874 "configure"
 #include "confdefs.h"
 $cf_wait_headers
 int main() {
 union wait x; waitpid(0, &x, 0)
 ; return 0; }
 EOF
-if { (eval echo configure:5877: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5881: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cf_cv_arg_union_waitpid=yes
 else
@@ -5895,12 +5899,12 @@ EOF
 fi
 
 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
-echo "configure:5899: checking for uid_t in sys/types.h" >&5
+echo "configure:5903: checking for uid_t in sys/types.h" >&5
 if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5904 "configure"
+#line 5908 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 EOF
@@ -5929,7 +5933,7 @@ EOF
 fi
 
 echo $ac_n "checking type of array argument to getgroups""... $ac_c" 1>&6
-echo "configure:5933: checking type of array argument to getgroups" >&5
+echo "configure:5937: checking type of array argument to getgroups" >&5
 if eval "test \"`echo '$''{'ac_cv_type_getgroups'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -5937,7 +5941,7 @@ else
   ac_cv_type_getgroups=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 5941 "configure"
+#line 5945 "configure"
 #include "confdefs.h"
 
 /* Thanks to Mike Rendell for this test.  */
@@ -5962,7 +5966,7 @@ main()
 }
 
 EOF
-if { (eval echo configure:5966: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:5970: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
     ac_cv_type_getgroups=gid_t
 else
@@ -5976,7 +5980,7 @@ fi
 
 if test $ac_cv_type_getgroups = cross; then
         cat > conftest.$ac_ext <<EOF
-#line 5980 "configure"
+#line 5984 "configure"
 #include "confdefs.h"
 #include <unistd.h>
 EOF
@@ -6000,12 +6004,12 @@ EOF
 
 
 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
-echo "configure:6004: checking for pid_t" >&5
+echo "configure:6008: checking for pid_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6009 "configure"
+#line 6013 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -6033,12 +6037,12 @@ EOF
 fi
 
 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
-echo "configure:6037: checking for uid_t in sys/types.h" >&5
+echo "configure:6041: checking for uid_t in sys/types.h" >&5
 if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6042 "configure"
+#line 6046 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 EOF
@@ -6067,12 +6071,12 @@ EOF
 fi
 
 echo $ac_n "checking for mode_t""... $ac_c" 1>&6
-echo "configure:6071: checking for mode_t" >&5
+echo "configure:6075: checking for mode_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_mode_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6076 "configure"
+#line 6080 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -6103,17 +6107,17 @@ fi
 
 ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for vfork.h""... $ac_c" 1>&6
-echo "configure:6107: checking for vfork.h" >&5
+echo "configure:6111: checking for vfork.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6112 "configure"
+#line 6116 "configure"
 #include "confdefs.h"
 #include <vfork.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6117: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6121: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -6138,18 +6142,18 @@ else
 fi
 
 echo $ac_n "checking for working vfork""... $ac_c" 1>&6
-echo "configure:6142: checking for working vfork" >&5
+echo "configure:6146: checking for working vfork" >&5
 if eval "test \"`echo '$''{'ac_cv_func_vfork_works'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test "$cross_compiling" = yes; then
   echo $ac_n "checking for vfork""... $ac_c" 1>&6
-echo "configure:6148: checking for vfork" >&5
+echo "configure:6152: checking for vfork" >&5
 if eval "test \"`echo '$''{'ac_cv_func_vfork'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6153 "configure"
+#line 6157 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char vfork(); below.  */
@@ -6172,7 +6176,7 @@ vfork();
 
 ; return 0; }
 EOF
-if { (eval echo configure:6176: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6180: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_vfork=yes"
 else
@@ -6193,7 +6197,7 @@ fi
 
 else
   cat > conftest.$ac_ext <<EOF
-#line 6197 "configure"
+#line 6201 "configure"
 #include "confdefs.h"
 /* Thanks to Paul Eggert for this test.  */
 #include <stdio.h>
@@ -6288,7 +6292,7 @@ main() {
   }
 }
 EOF
-if { (eval echo configure:6292: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:6296: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   ac_cv_func_vfork_works=yes
 else
@@ -6312,13 +6316,13 @@ fi
 
 
 echo $ac_n "checking if we should use fcntl or ioctl""... $ac_c" 1>&6
-echo "configure:6316: checking if we should use fcntl or ioctl" >&5
+echo "configure:6320: checking if we should use fcntl or ioctl" >&5
 if eval "test \"`echo '$''{'cf_cv_fionbio'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 cat > conftest.$ac_ext <<EOF
-#line 6322 "configure"
+#line 6326 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
@@ -6330,7 +6334,7 @@ int main() {
 	
 ; return 0; }
 EOF
-if { (eval echo configure:6334: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6338: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   cf_cv_fionbio=ioctl
 else
@@ -6339,7 +6343,7 @@ else
   rm -rf conftest*
   
 cat > conftest.$ac_ext <<EOF
-#line 6343 "configure"
+#line 6347 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
@@ -6356,7 +6360,7 @@ int main() {
 	
 ; return 0; }
 EOF
-if { (eval echo configure:6360: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6364: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   cf_cv_fionbio=fcntl
 else
@@ -6379,20 +6383,20 @@ EOF
 
 
 echo $ac_n "checking for broken/missing definition of remove""... $ac_c" 1>&6
-echo "configure:6383: checking for broken/missing definition of remove" >&5
+echo "configure:6387: checking for broken/missing definition of remove" >&5
 if eval "test \"`echo '$''{'cf_cv_baddef_remove'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 cat > conftest.$ac_ext <<EOF
-#line 6389 "configure"
+#line 6393 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 int main() {
 remove("dummy")
 ; return 0; }
 EOF
-if { (eval echo configure:6396: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6400: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   cf_cv_baddef_remove=no
 else
@@ -6400,7 +6404,7 @@ else
   cat conftest.$ac_ext >&5
   rm -rf conftest*
   cat > conftest.$ac_ext <<EOF
-#line 6404 "configure"
+#line 6408 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 		int __unlink(name) { return unlink(name); } 
@@ -6408,7 +6412,7 @@ int main() {
 remove("dummy")
 ; return 0; }
 EOF
-if { (eval echo configure:6412: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6416: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   cf_cv_baddef_remove=yes
 else
@@ -6432,13 +6436,13 @@ EOF
 
 
 echo $ac_n "checking for lstat""... $ac_c" 1>&6
-echo "configure:6436: checking for lstat" >&5
+echo "configure:6440: checking for lstat" >&5
 if eval "test \"`echo '$''{'ac_cv_func_lstat'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 cat > conftest.$ac_ext <<EOF
-#line 6442 "configure"
+#line 6446 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
@@ -6447,7 +6451,7 @@ int main() {
 lstat(".", (struct stat *)0)
 ; return 0; }
 EOF
-if { (eval echo configure:6451: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6455: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   ac_cv_func_lstat=yes
 else
@@ -6479,12 +6483,12 @@ for ac_func in \
 
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6483: checking for $ac_func" >&5
+echo "configure:6487: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6488 "configure"
+#line 6492 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -6507,7 +6511,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:6511: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6515: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -6537,12 +6541,12 @@ for ac_func in \
 
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6541: checking for $ac_func" >&5
+echo "configure:6545: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6546 "configure"
+#line 6550 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -6565,7 +6569,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:6569: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6573: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -6596,12 +6600,12 @@ for ac_func in strstr
 do
 
 echo $ac_n "checking for $ac_func declaration""... $ac_c" 1>&6
-echo "configure:6600: checking for $ac_func declaration" >&5
+echo "configure:6604: checking for $ac_func declaration" >&5
 if eval "test \"`echo '$''{'ac_cv_func_decl_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6605 "configure"
+#line 6609 "configure"
 #include "confdefs.h"
 #include <string.h>
 int main() {
@@ -6610,11 +6614,11 @@ extern	int	${ac_func}();
 #endif
 ; return 0; }
 EOF
-if { (eval echo configure:6614: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6618: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   
 cat > conftest.$ac_ext <<EOF
-#line 6618 "configure"
+#line 6622 "configure"
 #include "confdefs.h"
 #include <string.h>
 int main() {
@@ -6623,7 +6627,7 @@ int	(*p)() = ${ac_func};
 #endif
 ; return 0; }
 EOF
-if { (eval echo configure:6627: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6631: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   
 eval "ac_cv_func_decl_$ac_func=yes"
@@ -6665,12 +6669,12 @@ for ac_func in getgrgid getgrnam
 do
 
 echo $ac_n "checking for $ac_func declaration""... $ac_c" 1>&6
-echo "configure:6669: checking for $ac_func declaration" >&5
+echo "configure:6673: checking for $ac_func declaration" >&5
 if eval "test \"`echo '$''{'ac_cv_func_decl_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6674 "configure"
+#line 6678 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -6681,11 +6685,11 @@ extern	int	${ac_func}();
 #endif
 ; return 0; }
 EOF
-if { (eval echo configure:6685: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6689: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   
 cat > conftest.$ac_ext <<EOF
-#line 6689 "configure"
+#line 6693 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -6696,7 +6700,7 @@ int	(*p)() = ${ac_func};
 #endif
 ; return 0; }
 EOF
-if { (eval echo configure:6700: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6704: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   
 eval "ac_cv_func_decl_$ac_func=yes"
@@ -6738,13 +6742,13 @@ done
 
 
 echo $ac_n "checking if TRUE/FALSE are defined""... $ac_c" 1>&6
-echo "configure:6742: checking if TRUE/FALSE are defined" >&5
+echo "configure:6746: checking if TRUE/FALSE are defined" >&5
 if eval "test \"`echo '$''{'cf_cv_bool_defs'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 cat > conftest.$ac_ext <<EOF
-#line 6748 "configure"
+#line 6752 "configure"
 #include "confdefs.h"
 
 #include <${cf_cv_ncurses_header-curses.h}>
@@ -6753,7 +6757,7 @@ int main() {
 int x = TRUE, y = FALSE
 ; return 0; }
 EOF
-if { (eval echo configure:6757: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6761: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cf_cv_bool_defs=yes
 else
@@ -6780,13 +6784,13 @@ fi
 
 
 echo $ac_n "checking declaration of errno""... $ac_c" 1>&6
-echo "configure:6784: checking declaration of errno" >&5
+echo "configure:6788: checking declaration of errno" >&5
 if eval "test \"`echo '$''{'cf_cv_dcl_errno'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
     cat > conftest.$ac_ext <<EOF
-#line 6790 "configure"
+#line 6794 "configure"
 #include "confdefs.h"
 
 #if HAVE_STDLIB_H
@@ -6799,7 +6803,7 @@ int main() {
 long x = (long) errno
 ; return 0; }
 EOF
-if { (eval echo configure:6803: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6807: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval 'cf_cv_dcl_'errno'=yes'
 else
@@ -6829,9 +6833,9 @@ cf_result=`echo $cf_result | tr '[a-z]' '[A-Z]'`
 EOF
 
     echo $ac_n "checking existence of errno""... $ac_c" 1>&6
-echo "configure:6833: checking existence of errno" >&5
+echo "configure:6837: checking existence of errno" >&5
         cat > conftest.$ac_ext <<EOF
-#line 6835 "configure"
+#line 6839 "configure"
 #include "confdefs.h"
 
 #undef errno
@@ -6841,7 +6845,7 @@ int main() {
 errno = 2
 ; return 0; }
 EOF
-if { (eval echo configure:6845: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6849: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval 'cf_cv_have_'errno'=yes'
 else
@@ -6871,20 +6875,20 @@ EOF
 
 
 echo $ac_n "checking for setlocale()""... $ac_c" 1>&6
-echo "configure:6875: checking for setlocale()" >&5
+echo "configure:6879: checking for setlocale()" >&5
 if eval "test \"`echo '$''{'cf_cv_locale'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 cat > conftest.$ac_ext <<EOF
-#line 6881 "configure"
+#line 6885 "configure"
 #include "confdefs.h"
 #include <locale.h>
 int main() {
 setlocale(LC_ALL, "")
 ; return 0; }
 EOF
-if { (eval echo configure:6888: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6892: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   cf_cv_locale=yes
 else
@@ -6905,13 +6909,13 @@ EOF
 
 
 echo $ac_n "checking if NGROUPS is defined""... $ac_c" 1>&6
-echo "configure:6909: checking if NGROUPS is defined" >&5
+echo "configure:6913: checking if NGROUPS is defined" >&5
 if eval "test \"`echo '$''{'cf_cv_ngroups'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 cat > conftest.$ac_ext <<EOF
-#line 6915 "configure"
+#line 6919 "configure"
 #include "confdefs.h"
 
 #if HAVE_SYS_PARAM_H
@@ -6925,7 +6929,7 @@ int main() {
 int x = NGROUPS
 ; return 0; }
 EOF
-if { (eval echo configure:6929: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6933: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cf_cv_ngroups=yes
 else
@@ -6933,7 +6937,7 @@ else
   cat conftest.$ac_ext >&5
   rm -rf conftest*
   cat > conftest.$ac_ext <<EOF
-#line 6937 "configure"
+#line 6941 "configure"
 #include "confdefs.h"
 
 #if HAVE_SYS_PARAM_H
@@ -6947,7 +6951,7 @@ int main() {
 int x = NGROUPS_MAX
 ; return 0; }
 EOF
-if { (eval echo configure:6951: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6955: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cf_cv_ngroups=NGROUPS_MAX
 else
@@ -6981,13 +6985,13 @@ for cf_name in sys_nerr sys_errlist
 do
     
 echo $ac_n "checking declaration of $cf_name""... $ac_c" 1>&6
-echo "configure:6985: checking declaration of $cf_name" >&5
+echo "configure:6989: checking declaration of $cf_name" >&5
 if eval "test \"`echo '$''{'cf_cv_dcl_$cf_name'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
     cat > conftest.$ac_ext <<EOF
-#line 6991 "configure"
+#line 6995 "configure"
 #include "confdefs.h"
 
 #if HAVE_STDLIB_H
@@ -7000,7 +7004,7 @@ int main() {
 long x = (long) $cf_name
 ; return 0; }
 EOF
-if { (eval echo configure:7004: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7008: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval 'cf_cv_dcl_'$cf_name'=yes'
 else
@@ -7030,9 +7034,9 @@ cf_result=`echo $cf_result | tr '[a-z]' '[A-Z]'`
 EOF
 
     echo $ac_n "checking existence of $cf_name""... $ac_c" 1>&6
-echo "configure:7034: checking existence of $cf_name" >&5
+echo "configure:7038: checking existence of $cf_name" >&5
         cat > conftest.$ac_ext <<EOF
-#line 7036 "configure"
+#line 7040 "configure"
 #include "confdefs.h"
 
 #undef $cf_name
@@ -7042,7 +7046,7 @@ int main() {
 $cf_name = 2
 ; return 0; }
 EOF
-if { (eval echo configure:7046: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7050: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval 'cf_cv_have_'$cf_name'=yes'
 else
@@ -7073,13 +7077,13 @@ done
 
 
 echo $ac_n "checking if struct utmp is declared""... $ac_c" 1>&6
-echo "configure:7077: checking if struct utmp is declared" >&5
+echo "configure:7081: checking if struct utmp is declared" >&5
 if eval "test \"`echo '$''{'cf_cv_have_utmp'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 	cat > conftest.$ac_ext <<EOF
-#line 7083 "configure"
+#line 7087 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
@@ -7088,7 +7092,7 @@ int main() {
 struct utmp x; char *y = &x.ut_host[0]
 ; return 0; }
 EOF
-if { (eval echo configure:7092: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7096: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cf_cv_have_utmp=yes
 else
@@ -7096,14 +7100,14 @@ else
   cat conftest.$ac_ext >&5
   rm -rf conftest*
   cat > conftest.$ac_ext <<EOF
-#line 7100 "configure"
+#line 7104 "configure"
 #include "confdefs.h"
 #include <utmpx.h>
 int main() {
 struct utmpx x; char *y = &x.ut_host[0]
 ; return 0; }
 EOF
-if { (eval echo configure:7107: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7111: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cf_cv_have_utmp=utmpx
 else
@@ -7134,7 +7138,7 @@ EOF
 if test $cf_cv_screen != slang ; then
 	
 echo $ac_n "checking if curses supports alternate-character set""... $ac_c" 1>&6
-echo "configure:7138: checking if curses supports alternate-character set" >&5
+echo "configure:7142: checking if curses supports alternate-character set" >&5
 if eval "test \"`echo '$''{'cf_cv_alt_char_set'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -7142,7 +7146,7 @@ else
 for mapname in acs_map _acs_map
 do
 	cat > conftest.$ac_ext <<EOF
-#line 7146 "configure"
+#line 7150 "configure"
 #include "confdefs.h"
 
 #include <${cf_cv_ncurses_header-curses.h}>
@@ -7151,7 +7155,7 @@ int main() {
 chtype x = $mapname['l']; $mapname['m'] = 0
 ; return 0; }
 EOF
-if { (eval echo configure:7155: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7159: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   cf_cv_alt_char_set=$mapname
 	 break
@@ -7174,13 +7178,13 @@ EOF
 
 	
 echo $ac_n "checking if curses supports fancy attributes""... $ac_c" 1>&6
-echo "configure:7178: checking if curses supports fancy attributes" >&5
+echo "configure:7182: checking if curses supports fancy attributes" >&5
 if eval "test \"`echo '$''{'cf_cv_fancy_curses'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 	cat > conftest.$ac_ext <<EOF
-#line 7184 "configure"
+#line 7188 "configure"
 #include "confdefs.h"
 
 #include <${cf_cv_ncurses_header-curses.h}>
@@ -7193,7 +7197,7 @@ attrset(A_UNDERLINE|A_BOLD|A_REVERSE);
 	
 ; return 0; }
 EOF
-if { (eval echo configure:7197: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7201: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   cf_cv_fancy_curses=yes
 else
@@ -7213,7 +7217,7 @@ EOF
 
 
 	echo $ac_n "checking for ncurses version""... $ac_c" 1>&6
-echo "configure:7217: checking for ncurses version" >&5
+echo "configure:7221: checking for ncurses version" >&5
 if eval "test \"`echo '$''{'cf_cv_ncurses_version'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -7238,7 +7242,7 @@ Autoconf "old"
 #endif
 EOF
 	cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
-	{ (eval echo configure:7242: \"$cf_try\") 1>&5; (eval $cf_try) 2>&5; }
+	{ (eval echo configure:7246: \"$cf_try\") 1>&5; (eval $cf_try) 2>&5; }
 	if test -f conftest.out ; then
 		cf_out=`cat conftest.out | sed -e 's@^Autoconf @@' -e 's@^[^"]*"@@' -e 's@".*@@'`
 		test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
@@ -7247,7 +7251,7 @@ EOF
 
 else
   cat > conftest.$ac_ext <<EOF
-#line 7251 "configure"
+#line 7255 "configure"
 #include "confdefs.h"
 
 #include <${cf_cv_ncurses_header-curses.h}>
@@ -7270,7 +7274,7 @@ int main()
 	exit(0);
 }
 EOF
-if { (eval echo configure:7274: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:7278: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   
 	cf_cv_ncurses_version=`cat $cf_tempfile`
@@ -7290,13 +7294,13 @@ echo "$ac_t""$cf_cv_ncurses_version" 1>&6
 
 if test "$cf_cv_ncurses_version" != no ; then
 echo $ac_n "checking for obsolete/broken version of ncurses""... $ac_c" 1>&6
-echo "configure:7294: checking for obsolete/broken version of ncurses" >&5
+echo "configure:7298: checking for obsolete/broken version of ncurses" >&5
 if eval "test \"`echo '$''{'cf_cv_ncurses_broken'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 cat > conftest.$ac_ext <<EOF
-#line 7300 "configure"
+#line 7304 "configure"
 #include "confdefs.h"
 
 #include <${cf_cv_ncurses_header-curses.h}>
@@ -7310,7 +7314,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:7314: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7318: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cf_cv_ncurses_broken=no
 else
@@ -7335,13 +7339,13 @@ fi
 
 	
 echo $ac_n "checking if curses supports color attributes""... $ac_c" 1>&6
-echo "configure:7339: checking if curses supports color attributes" >&5
+echo "configure:7343: checking if curses supports color attributes" >&5
 if eval "test \"`echo '$''{'cf_cv_color_curses'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 	cat > conftest.$ac_ext <<EOF
-#line 7345 "configure"
+#line 7349 "configure"
 #include "confdefs.h"
 
 #include <${cf_cv_ncurses_header-curses.h}>
@@ -7356,7 +7360,7 @@ chtype x = COLOR_BLUE;
 	
 ; return 0; }
 EOF
-if { (eval echo configure:7360: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7364: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   cf_cv_color_curses=yes
 else
@@ -7383,7 +7387,7 @@ fi
 
 	
 echo $ac_n "checking declaration of size-change""... $ac_c" 1>&6
-echo "configure:7387: checking declaration of size-change" >&5
+echo "configure:7391: checking declaration of size-change" >&5
 if eval "test \"`echo '$''{'cf_cv_sizechange'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -7397,7 +7401,7 @@ do
     CFLAGS="$cf_save_CFLAGS"
     test -n "$cf_opts" && CFLAGS="$CFLAGS -D$cf_opts"
     cat > conftest.$ac_ext <<EOF
-#line 7401 "configure"
+#line 7405 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if HAVE_TERMIOS_H
@@ -7436,7 +7440,7 @@ int main() {
 	
 ; return 0; }
 EOF
-if { (eval echo configure:7440: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7444: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cf_cv_sizechange=yes
 else
@@ -7468,20 +7472,20 @@ EOF
 
 	
 echo $ac_n "checking if ttytype is declared in curses library""... $ac_c" 1>&6
-echo "configure:7472: checking if ttytype is declared in curses library" >&5
+echo "configure:7476: checking if ttytype is declared in curses library" >&5
 if eval "test \"`echo '$''{'cf_cv_have_ttytype'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 	cat > conftest.$ac_ext <<EOF
-#line 7478 "configure"
+#line 7482 "configure"
 #include "confdefs.h"
 #include <${cf_cv_ncurses_header-curses.h}>
 int main() {
 char *x = &ttytype[1]; *x = 1
 ; return 0; }
 EOF
-if { (eval echo configure:7485: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7489: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   cf_cv_have_ttytype=yes
 else
@@ -7508,12 +7512,12 @@ EOF
 	
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:7512: checking for $ac_func" >&5
+echo "configure:7516: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 7517 "configure"
+#line 7521 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -7536,7 +7540,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:7540: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7544: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -7566,7 +7570,7 @@ fi
 
 
 echo $ac_n "checking if experimental 8-bit case-conversion should be used""... $ac_c" 1>&6
-echo "configure:7570: checking if experimental 8-bit case-conversion should be used" >&5
+echo "configure:7574: checking if experimental 8-bit case-conversion should be used" >&5
 
 # Check whether --enable-8bit-toupper or --disable-8bit-toupper was given.
 if test "${enable_8bit_toupper+set}" = set; then
@@ -7590,7 +7594,7 @@ EOF
 
 
 echo $ac_n "checking if experimental forms-based options screen should be used""... $ac_c" 1>&6
-echo "configure:7594: checking if experimental forms-based options screen should be used" >&5
+echo "configure:7598: checking if experimental forms-based options screen should be used" >&5
 
 # Check whether --enable-forms-options or --disable-forms-options was given.
 if test "${enable_forms_options+set}" = set; then
@@ -7614,7 +7618,7 @@ EOF
 
 
 echo $ac_n "checking if experimental persistent-cookie logic should be used""... $ac_c" 1>&6
-echo "configure:7618: checking if experimental persistent-cookie logic should be used" >&5
+echo "configure:7622: checking if experimental persistent-cookie logic should be used" >&5
 
 # Check whether --enable-persistent-cookies or --disable-persistent-cookies was given.
 if test "${enable_persistent_cookies+set}" = set; then
@@ -7638,7 +7642,7 @@ EOF
 
 
 echo $ac_n "checking if color-style code should be used""... $ac_c" 1>&6
-echo "configure:7642: checking if color-style code should be used" >&5
+echo "configure:7646: checking if color-style code should be used" >&5
 
 # Check whether --enable-color-style or --disable-color-style was given.
 if test "${enable_color_style+set}" = set; then
@@ -7686,7 +7690,7 @@ EOF
 	echo "$ac_t""yes" 1>&6
 
 	echo $ac_n "checking for location of style-sheet file""... $ac_c" 1>&6
-echo "configure:7690: checking for location of style-sheet file" >&5
+echo "configure:7694: checking for location of style-sheet file" >&5
 	LYNX_LSS_FILE=$cf_libdir/lynx.lss
 	cat >> confdefs.h <<EOF
 #define LYNX_LSS_FILE "$LYNX_LSS_FILE"
@@ -7699,7 +7703,7 @@ esac
 
 
 echo $ac_n "checking if partial-display should be used""... $ac_c" 1>&6
-echo "configure:7703: checking if partial-display should be used" >&5
+echo "configure:7707: checking if partial-display should be used" >&5
 
 # Check whether --enable-partial or --disable-partial was given.
 if test "${enable_partial+set}" = set; then
@@ -7728,7 +7732,7 @@ test ".$ac_cv_func_use_default_colors" = ".yes" && use_dft_colors=maybe
 
 if test "$use_dft_colors" != no ; then
 echo $ac_n "checking if you want to use default-colors""... $ac_c" 1>&6
-echo "configure:7732: checking if you want to use default-colors" >&5
+echo "configure:7736: checking if you want to use default-colors" >&5
 
 # Check whether --enable-default-colors or --disable-default-colors was given.
 if test "${enable_default_colors+set}" = set; then
@@ -7753,7 +7757,7 @@ EOF
 fi
 
 echo $ac_n "checking if you want to use extended HTML DTD logic""... $ac_c" 1>&6
-echo "configure:7757: checking if you want to use extended HTML DTD logic" >&5
+echo "configure:7761: checking if you want to use extended HTML DTD logic" >&5
 
 # Check whether --enable-extended-dtd or --disable-extended-dtd was given.
 if test "${enable_extended_dtd+set}" = set; then
@@ -7777,7 +7781,7 @@ EOF
 
 
 echo $ac_n "checking if you want to use external commands""... $ac_c" 1>&6
-echo "configure:7781: checking if you want to use external commands" >&5
+echo "configure:7785: checking if you want to use external commands" >&5
 
 # Check whether --enable-externs or --disable-externs was given.
 if test "${enable_externs+set}" = set; then
@@ -7801,7 +7805,7 @@ EOF
 
 
 echo $ac_n "checking if you want to use setfont support""... $ac_c" 1>&6
-echo "configure:7805: checking if you want to use setfont support" >&5
+echo "configure:7809: checking if you want to use setfont support" >&5
 
 # Check whether --enable-font-switch or --disable-font-switch was given.
 if test "${enable_font_switch+set}" = set; then
@@ -7825,7 +7829,7 @@ EOF
 
 
 echo $ac_n "checking if you want internal-links feature""... $ac_c" 1>&6
-echo "configure:7829: checking if you want internal-links feature" >&5
+echo "configure:7833: checking if you want internal-links feature" >&5
 
 # Check whether --enable-internal-links or --disable-internal-links was given.
 if test "${enable_internal_links+set}" = set; then
@@ -7849,7 +7853,7 @@ EOF
 
 
 echo $ac_n "checking if you want to fork NSL requests""... $ac_c" 1>&6
-echo "configure:7853: checking if you want to fork NSL requests" >&5
+echo "configure:7857: checking if you want to fork NSL requests" >&5
 
 # Check whether --enable-nsl-fork or --disable-nsl-fork was given.
 if test "${enable_nsl_fork+set}" = set; then
@@ -7873,7 +7877,7 @@ EOF
 
 
 echo $ac_n "checking if you want to log URL requests via syslog""... $ac_c" 1>&6
-echo "configure:7877: checking if you want to log URL requests via syslog" >&5
+echo "configure:7881: checking if you want to log URL requests via syslog" >&5
 
 # Check whether --enable-syslog or --disable-syslog was given.
 if test "${enable_syslog+set}" = set; then
@@ -7897,7 +7901,7 @@ EOF
 
 
 echo $ac_n "checking if you want to underline links""... $ac_c" 1>&6
-echo "configure:7901: checking if you want to underline links" >&5
+echo "configure:7905: checking if you want to underline links" >&5
 
 # Check whether --enable-underlines or --disable-underlines was given.
 if test "${enable_underlines+set}" = set; then
@@ -7921,7 +7925,7 @@ EOF
 
 
 echo $ac_n "checking if you want to use zlib for decompression of some gzip files""... $ac_c" 1>&6
-echo "configure:7925: checking if you want to use zlib for decompression of some gzip files" >&5
+echo "configure:7929: checking if you want to use zlib for decompression of some gzip files" >&5
 
 # Check whether --with-zlib or --without-zlib was given.
 if test "${with_zlib+set}" = set; then
@@ -7938,12 +7942,12 @@ if test ".$use_zlib" != ".no" ; then
 	cf_cv_have_lib_z=no
 	cf_libdir=""
 	echo $ac_n "checking for gzopen""... $ac_c" 1>&6
-echo "configure:7942: checking for gzopen" >&5
+echo "configure:7946: checking for gzopen" >&5
 if eval "test \"`echo '$''{'ac_cv_func_gzopen'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 7947 "configure"
+#line 7951 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char gzopen(); below.  */
@@ -7966,7 +7970,7 @@ gzopen();
 
 ; return 0; }
 EOF
-if { (eval echo configure:7970: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7974: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_gzopen=yes"
 else
@@ -7986,17 +7990,17 @@ else
 
 		cf_save_LIBS="$LIBS"
 		echo $ac_n "checking for gzopen in -lz""... $ac_c" 1>&6
-echo "configure:7990: checking for gzopen in -lz" >&5
+echo "configure:7994: checking for gzopen in -lz" >&5
 		LIBS="-lz $LIBS"
 		cat > conftest.$ac_ext <<EOF
-#line 7993 "configure"
+#line 7997 "configure"
 #include "confdefs.h"
 #include <zlib.h>
 int main() {
 gzopen("name","mode")
 ; return 0; }
 EOF
-if { (eval echo configure:8000: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:8004: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6
 			 cf_cv_have_lib_z=yes
@@ -8023,17 +8027,17 @@ test "$prefix" != /usr           && cf_search="$cf_search /usr/lib /usr/lib/z"
 			for cf_libdir in $cf_search
 			do
 				echo $ac_n "checking for -lz in $cf_libdir""... $ac_c" 1>&6
-echo "configure:8027: checking for -lz in $cf_libdir" >&5
+echo "configure:8031: checking for -lz in $cf_libdir" >&5
 				LIBS="-L$cf_libdir -lz $cf_save_LIBS"
 				cat > conftest.$ac_ext <<EOF
-#line 8030 "configure"
+#line 8034 "configure"
 #include "confdefs.h"
 #include <zlib.h>
 int main() {
 gzopen("name","mode")
 ; return 0; }
 EOF
-if { (eval echo configure:8037: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:8041: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6
 			 		 cf_cv_have_lib_z=yes
@@ -8074,7 +8078,7 @@ fi
 # All DirEd functions that were enabled on compilation can be disabled
 # or modified at run time via DIRED_MENU symbols in lynx.cfg.
 echo $ac_n "checking if directory-editor code should be used""... $ac_c" 1>&6
-echo "configure:8078: checking if directory-editor code should be used" >&5
+echo "configure:8082: checking if directory-editor code should be used" >&5
 
 # Check whether --enable-dired or --disable-dired was given.
 if test "${enable_dired+set}" = set; then
@@ -8100,7 +8104,7 @@ EOF
 
 
 	echo $ac_n "checking if you wish to allow extracting from archives via DirEd""... $ac_c" 1>&6
-echo "configure:8104: checking if you wish to allow extracting from archives via DirEd" >&5
+echo "configure:8108: checking if you wish to allow extracting from archives via DirEd" >&5
 	
 # Check whether --enable-dired-archive or --disable-dired-archive was given.
 if test "${enable_dired_archive+set}" = set; then
@@ -8119,7 +8123,7 @@ fi
 	echo "$ac_t""$enableval" 1>&6
 
 	echo $ac_n "checking if you wish to allow users to redefine DirEd keys""... $ac_c" 1>&6
-echo "configure:8123: checking if you wish to allow users to redefine DirEd keys" >&5
+echo "configure:8127: checking if you wish to allow users to redefine DirEd keys" >&5
 	
 # Check whether --enable-dired-override or --disable-dired-override was given.
 if test "${enable_dired_override+set}" = set; then
@@ -8145,7 +8149,7 @@ fi
 	echo "$ac_t""$enableval" 1>&6
 
 	echo $ac_n "checking if you wish to allow permissions commands via DirEd""... $ac_c" 1>&6
-echo "configure:8149: checking if you wish to allow permissions commands via DirEd" >&5
+echo "configure:8153: checking if you wish to allow permissions commands via DirEd" >&5
 	
 # Check whether --enable-dired-permit or --disable-dired-permit was given.
 if test "${enable_dired_permit+set}" = set; then
@@ -8171,7 +8175,7 @@ fi
 	echo "$ac_t""$enableval" 1>&6
 
 	echo $ac_n "checking if you wish to allow executable-permission commands via DirEd""... $ac_c" 1>&6
-echo "configure:8175: checking if you wish to allow executable-permission commands via DirEd" >&5
+echo "configure:8179: checking if you wish to allow executable-permission commands via DirEd" >&5
 	
 # Check whether --enable-dired-xpermit or --disable-dired-xpermit was given.
 if test "${enable_dired_xpermit+set}" = set; then
@@ -8190,7 +8194,7 @@ fi
 	echo "$ac_t""$enableval" 1>&6
 
 	echo $ac_n "checking if you wish to allow "tar" commands from DirEd""... $ac_c" 1>&6
-echo "configure:8194: checking if you wish to allow "tar" commands from DirEd" >&5
+echo "configure:8198: checking if you wish to allow "tar" commands from DirEd" >&5
 	
 # Check whether --enable-dired-tar or --disable-dired-tar was given.
 if test "${enable_dired_tar+set}" = set; then
@@ -8216,7 +8220,7 @@ fi
 	echo "$ac_t""$enableval" 1>&6
 
 	echo $ac_n "checking if you wish to allow "uudecode" commands from DirEd""... $ac_c" 1>&6
-echo "configure:8220: checking if you wish to allow "uudecode" commands from DirEd" >&5
+echo "configure:8224: checking if you wish to allow "uudecode" commands from DirEd" >&5
 	
 # Check whether --enable-dired-uudecode or --disable-dired-uudecode was given.
 if test "${enable_dired_uudecode+set}" = set; then
@@ -8242,7 +8246,7 @@ fi
 	echo "$ac_t""$enableval" 1>&6
 
 	echo $ac_n "checking if you wish to allow "zip" and "unzip" commands from DirEd""... $ac_c" 1>&6
-echo "configure:8246: checking if you wish to allow "zip" and "unzip" commands from DirEd" >&5
+echo "configure:8250: checking if you wish to allow "zip" and "unzip" commands from DirEd" >&5
 	
 # Check whether --enable-dired-zip or --disable-dired-zip was given.
 if test "${enable_dired_zip+set}" = set; then
@@ -8268,7 +8272,7 @@ fi
 	echo "$ac_t""$enableval" 1>&6
 
 	echo $ac_n "checking if you wish to allow "gzip" and "gunzip" commands from DirEd""... $ac_c" 1>&6
-echo "configure:8272: checking if you wish to allow "gzip" and "gunzip" commands from DirEd" >&5
+echo "configure:8276: checking if you wish to allow "gzip" and "gunzip" commands from DirEd" >&5
 	
 # Check whether --enable-dired-gzip or --disable-dired-gzip was given.
 if test "${enable_dired_gzip+set}" = set; then
@@ -8295,7 +8299,7 @@ fi
 fi
 
 echo $ac_n "checking if you want long-directory listings""... $ac_c" 1>&6
-echo "configure:8299: checking if you want long-directory listings" >&5
+echo "configure:8303: checking if you want long-directory listings" >&5
 
 # Check whether --enable-long-list or --disable-long-list was given.
 if test "${enable_long_list+set}" = set; then
@@ -8321,7 +8325,7 @@ fi
 echo "$ac_t""$enableval" 1>&6
 
 echo $ac_n "checking if parent-directory references are permitted""... $ac_c" 1>&6
-echo "configure:8325: checking if parent-directory references are permitted" >&5
+echo "configure:8329: checking if parent-directory references are permitted" >&5
 
 # Check whether --enable-parent-dir-refs or --disable-parent-dir-refs was given.
 if test "${enable_parent_dir_refs+set}" = set; then
diff --git a/lynx.cfg b/lynx.cfg
index 9e407055..c78197f0 100644
--- a/lynx.cfg
+++ b/lynx.cfg
@@ -2,6 +2,7 @@
 # The default placement for this file is /usr/local/lib/lynx.cfg (Unix)
 #                                     or Lynx_Dir:lynx.cfg (VMS)
 #
+#
 # Definition pairs are of the form  VARIABLE:DEFINITION
 # NO spaces are allowed between the pair items.
 #
@@ -15,6 +16,24 @@
 # All definitions must be flush left and have NO spaces.!!!
 #
 #
+# Starting with Lynx 2.8.1dev.1, the lynx.cfg file has a crude "include"
+# facility.  This means that you can take advantage of the global lynx.cfg
+# while also supplying your own tweaks.
+#
+# You can use a command-line argument (-cfg /where/is/lynx.cfg) or an
+# environment variable (LYNX_CFG=/where/is/lynx.cfg).
+# For instance, put in your .profile or .login:
+#
+#   LYNX_CFG=~/lynx.cfg; export LYNX_CFG   # in .profile for sh/ksh/bash/etc.
+#   setenv LYNX_CFG ~/lynx.cfg             # in .login for [t]csh
+#
+# Then in ~/lynx.cfg:
+#
+#INCLUDE:/usr/local/lib/lynx.cfg
+#       ^^^^^^^^^^^^^^^^^^^^^^^ or whatever's appropriate on your system
+#and now your own tweaks.
+
+#
 # STARTFILE is the default URL if none is specified on the command line
 # or via a WWW_HOME environment variable.
 # note: these files can be remote (http://www.w3.org/default.html)
@@ -735,6 +754,12 @@ DEFAULT_INDEX_FILE:http://www.ncsa.uiuc.edu/SDG/Software/Mosaic/MetaIndex.html
 #
 #SET_COOKIES:TRUE
 
+# If ACCEPT_ALL_COOKIES is set TRUE, Lynx will accept cookies from all
+# domains with no user interaction.
+# The default is defined in userdefs.h and can be overridden here,
+# and/or toggled via the -accept_all_cookies command line switch.
+#ACCEPT_ALL_COOKIES:FALSE
+
 # VMS:
 #=====
 # The mail command and qualifiers are defined in userdefs.h.  Lynx
diff --git a/lynx.hlp b/lynx.hlp
index eac39165..04c1597d 100644
--- a/lynx.hlp
+++ b/lynx.hlp
@@ -1,6 +1,6 @@
 1 LYNX
  NAME
- lynx - a general purpose distributed information browser for the World 
+ lynx - a general purpose distributed information browser for the World
  Wide Web
 
 2 SYNOPSIS
@@ -23,7 +23,7 @@
  addition, Lynx can be used to build systems isolated within a single LAN.
 
 2 OPTIONS
- At start up, Lynx will load any local file or remote URL specified at 
+ At start up, Lynx will load any local file or remote URL specified at
  the command line.  For help with URLs, press "?" or "h" while running
  Lynx.  Then follow the link titled, "Help on URLs."
 
@@ -34,6 +34,9 @@
        -get_data or -post_data arguments (see below).  Encase it
        in double-quotes ("-").
 
+  -accept_all_cookies
+       accept all cookies.
+
   -anonymous
        used to specify the anonymous account.
 
@@ -108,9 +111,6 @@
        following way:
            lynx -dump http://www.crl.com/~subir/lynx.html
 
-  -eat_all_cookies
-       accept all cookies.
-
   -editor=EDITOR
        enable edit mode using the specified EDITOR. (vi, ed, emacs, etc.)
 
@@ -136,7 +136,7 @@
   -from
        toggles transmissions of From headers.
 
-  -ftp 
+  -ftp
        disable ftp access.
 
   -get_data
@@ -233,6 +233,9 @@
   -number_links
        force numbering of links.
 
+  -partial
+       display partial pages while downloading.
+
   -pauth=ID:PASSWD
        set authorization ID and password for a protected proxy
        server at startup.  Be sure to protect any script files
@@ -409,8 +412,12 @@
        accept only http URLs (for validation).  Complete security
        restrictions also are implemented.
 
+  -verbose
+       taggles [LINK], [IMAGE] and [INLINE] comments
+       with filenames of these images.
+
   -version
-       print version information
+       print version information.
 
   -vikeys
        enable vi-like key movement.
@@ -444,10 +451,10 @@
  Lynx has incorporated code from a variety of sources along the way.
  The earliest versions of Lynx included code from Earl Fogel of Computing
  Services at the University of Saskatchewan, who implemented HYPERREZ
- in the Unix environment.  HYPERREZ was developed by Niel Larson of 
+ in the Unix environment.  HYPERREZ was developed by Niel Larson of
  Think.com and served as the model for the early versions of Lynx.
  Those versions also incorporated libraries from the Unix Gopher clients
- developed at the University of Minnesota, and the later versions of 
+ developed at the University of Minnesota, and the later versions of
  Lynx rely on the WWW client library code developed by Tim Berners-Lee
  and the WWW community.  Also a special thanks to Foteos Macrides who
  ported much of Lynx to VMS and did or organized most of its development
@@ -462,7 +469,7 @@
  Academic Computing Services
  University of Kansas
  Lawrence, Kansas 66047
- 
+
  Foteos Macrides
  Worcester Foundation for Biomedical Research
  Shrewsbury, Massachusetts 01545
diff --git a/lynx.man b/lynx.man
index d65a6de3..aa351161 100644
--- a/lynx.man
+++ b/lynx.man
@@ -60,6 +60,9 @@ the arguments from stdin.  This is to allow for the
 potentially very long command line that can be associated
 with the -get_data or -post_data arguments (see below).
 .TP
+.B -accept_all_cookies
+accept all cookies.
+.TP
 .B -anonymous
 used to specify the anonymous account.
 .TP
@@ -139,9 +142,6 @@ specified on the command line to standard out.
 This can be used in the following way:
 lynx -dump http://www.crl.com/~subir/lynx.html.
 .TP
-.B -eat_all_cookies
-accept all cookies.
-.TP
 .B -editor\fR=\fIEDITOR
 enable edit mode using the specified
 EDITOR. (vi, ed, emacs, etc.)
@@ -281,6 +281,9 @@ disable the retrieval status messages.
 .TP
 .B -number_links
 force numbering of links.
+.B -partial 
+display partial pages while downloading. 
+.TP 
 .TP
 .B -pauth\fR=\fIID\fR:\fIPASSWD
 set authorization ID and password for a protected proxy
@@ -493,6 +496,9 @@ set alternate Lynx User-Agent header.
 .B -validate
 accept only http URLs (for validation).  Complete security
 restrictions also are implemented.
+.TP 
+.B -verbose 
+taggles [LINK], [IMAGE] and [INLINE] comments with filenames of these images. 
 .TP
 .B -version
 print version information.
diff --git a/lynx_help/Lynx_users_guide.html b/lynx_help/Lynx_users_guide.html
index 69fd6517..7acc581a 100644
--- a/lynx_help/Lynx_users_guide.html
+++ b/lynx_help/Lynx_users_guide.html
@@ -1780,9 +1780,9 @@ This support can be disabled by default via the SET_COOKIES symbol in the
 compilation (<em>userdefs.h</em>) and/or run time (<em>lynx.cfg</em>)
 configuration files, and that default setting can be toggled via the
 <em>-cookies</em> command line switch.
-The SET_COOKIES symbol can be further modified by the EAT_ALL_COOKIES mode.
-If EAT_ALL_COOKIES is set TRUE, and SET_COOKIES is TRUE, Lynx will accept 
-all cookies. 
+The SET_COOKIES symbol can be further modified by the ACCEPT_ALL_COOKIES mode.
+If ACCEPT_ALL_COOKIES is set TRUE, and SET_COOKIES is TRUE, Lynx will accept
+all cookies.
 
 <p>When cookie support is enabled, <em>Set-Cookie</em> MIME headers
 received from an http server invoke confirmation prompts with possible
@@ -1867,6 +1867,8 @@ where
 		    command file input terminated by a line that begins
 		    with '<em>$</em>'.	On Unix, the keyboard input terminator
 		    is <em>Control-D</em>.  On Win32, [???].
+	     <dt><code>-accept_all_cookies</code>
+		<dd>accept all cookies.
 	     <dt><code>-anonymous</code>
 		<dd>used to specify the anonymous account.
 	     <dt><code>-assume_charset=MIMEname</code>
@@ -1931,8 +1933,6 @@ where
 		    or one specified on the command line to standard out.
 		    This can be used in the following way:<br>
 		    <em>lynx -dump http://www.w3.org/</em>
-	     <dt><code>-eat_all_cookies</code>
-		<dd>accept all cookies.
 	     <dt><code>-editor=EDITOR</code>
 		<dd>enable edit mode using the specified
 		    <em>EDITOR</em>. (vi, ed, emacs, etc.)
@@ -2032,6 +2032,8 @@ where
 		<dd>disable the retrieval status messages.
 	     <dt><code>-number_links</code>
 		<dd>force numbering of links.
+	     <dt><code>-partial</code>
+		<dd>display partial pages while downloading.
 	     <dt><code>-pauth=ID:PW</code>
 		<dd>set authorization ID and password for a protected proxy
 		    server at startup.	Be sure to protect any script files
@@ -2218,8 +2220,11 @@ where
 	     <dt><code>-validate</code>
 		<dd>accept only http URLs (for validation).  Complete
 		    security restrictions also are implemented.
+	     <dt><code>-verbose</code>
+		<dd>toggles [LINK], [IMAGE] and [INLINE] comments
+		    with filenames of these images.
 	     <dt><code>-version</code>
-		<dd>print version information
+		<dd>print version information.
 	     <dt><code>-vikeys</code>
 		<dd>enable vi-like key movement.
 	     <dt><code>-width=NUMBER</code>
diff --git a/src/DefaultStyle.c b/src/DefaultStyle.c
index bff1b11d..2e00ba62 100644
--- a/src/DefaultStyle.c
+++ b/src/DefaultStyle.c
@@ -4,7 +4,6 @@
 */
 
 #include <HTUtils.h>
-#include <tcp.h>
 #include <HTStyle.h>
 #include <HTFont.h>
 
diff --git a/src/GridText.c b/src/GridText.c
index bff01ebd..192b9d21 100644
--- a/src/GridText.c
+++ b/src/GridText.c
@@ -3,7 +3,6 @@
 */
 
 #include <HTUtils.h>
-#include <tcp.h>
 #include <HTString.h>
 #include <HTFont.h>
 #include <HTAccess.h>
@@ -16,7 +15,6 @@
 #include <UCAux.h>
 
 #include <assert.h>
-#include <ctype.h>
 #ifndef VMS
 #ifdef SYSLOG_REQUESTED_URLS
 #include <syslog.h>
@@ -72,8 +70,6 @@ struct _HTStream {                      /* only know it as object */
 #define IS_UTF_EXTRA(ch) (text->T.output_utf8 && \
 			  ((unsigned char)(ch)&0xc0) == 0x80)
 
-#define FREE(x) if (x) {free(x); x = NULL;}
-
 extern BOOL HTPassHighCtrlRaw;
 extern HTkcode kanji_code;
 extern HTCJKlang HTCJK;
diff --git a/src/HTAlert.c b/src/HTAlert.c
index 3a160ca5..fd5440d2 100644
--- a/src/HTAlert.c
+++ b/src/HTAlert.c
@@ -10,7 +10,6 @@
 */
 
 #include <HTUtils.h>
-#include <tcp.h>
 #include <HTAlert.h>
 #include <LYGlobalDefs.h>
 #include <LYCurses.h>
@@ -22,9 +21,6 @@
 
 #include <LYLeaks.h>
 
-#define FREE(x) if (x) {free(x); x = NULL;}
-
-
 /*	Issue a message about a problem.		HTAlert()
 **	--------------------------------
 */
@@ -435,13 +431,13 @@ PUBLIC BOOL HTConfirmCookie ARGS4(
 	namelen = (int)(percentage*(float)namelen);
 	valuelen = (int)(percentage*(float)valuelen);
     }
-    if(!LYEatAllCookies) {
+    if(!LYAcceptAllCookies) {
 	sprintf(message, ADVANCED_COOKIE_CONFIRMATION,
 		server, namelen, name, valuelen, value);
 	_statusline(message);
     }
     while (1) {
-	if(!LYEatAllCookies) {
+	if(!LYAcceptAllCookies) {
 	    ch = LYgetch();
 	} else {
 	    ch = 'A';
diff --git a/src/HTAlert.h b/src/HTAlert.h
index 77be4315..9327bb2d 100644
--- a/src/HTAlert.h
+++ b/src/HTAlert.h
@@ -8,10 +8,7 @@
 #ifndef HTALERT_H
 #define HTALERT_H 1
 
-#ifndef HTUTILS_H
 #include <HTUtils.h>
-#endif /* HTUTILS_H */
-#include <tcp.h>
 
 /*      Display a message and get the input
 **
diff --git a/src/HTFWriter.c b/src/HTFWriter.c
index fd35802e..49884d79 100644
--- a/src/HTFWriter.c
+++ b/src/HTFWriter.c
@@ -9,7 +9,6 @@
 */
 
 #include <HTUtils.h>
-#include <tcp.h>
 #include <LYCurses.h>
 #include <HTFWriter.h>
 #include <HTSaveToFile.h>
@@ -58,9 +57,6 @@ PUBLIC HTStream* HTSaveToFile PARAMS((
 	HTParentAnchor *       anchor,
 	HTStream *	       sink));
 
-#define FREE(x) if (x) {free(x); x = NULL;}
-
-
 /*	Stream Object
 **	-------------
 */
@@ -301,7 +297,7 @@ PRIVATE void HTFWriter_free ARGS1(HTStream *, me)
 			 *  (or even the same!).  We can skip this
 			 *  needless duplication by using the
 			 *  viewer_command which has already been
-			 *  determind when the HTCompressed stream was
+			 *  determined when the HTCompressed stream was
 			 *  created. - kw
 			 */
 			FREE(me->end_command);
@@ -869,7 +865,7 @@ PUBLIC HTStream* HTCompressed ARGS3(
     FILE *fp = NULL;
 
     /*
-     *	Deal with any inappropriate invokations of this function,
+     *	Deal with any inappropriate invocations of this function,
      *	or a download request, in which case we won't bother to
      *	uncompress the file. - FM
      */
@@ -1162,7 +1158,7 @@ PUBLIC unsigned long LYVMS_FixedLengthRecords ARGS1(char *, filename)
     /* RMS supplies a user-mode channel (see FAB$L_FOP FAB$V_UFO doc) */
     channel = (unsigned short) fab.fab$l_stv;
 
-    /* set up ACP interface strutures */
+    /* set up ACP interface structures */
     /* file information block, passed by descriptor; it's okay to start with
        an empty FIB after RMS has accessed the file for us */
     fib_dsc.len = sizeof fib;
diff --git a/src/HTInit.c b/src/HTInit.c
index b9e0c4c6..4d7227ec 100644
--- a/src/HTInit.c
+++ b/src/HTInit.c
@@ -1,4 +1,4 @@
-/*		Configuration-specific Initialialization	HTInit.c
+/*		Configuration-specific Initialization		HTInit.c
 **		----------------------------------------
 */
 
@@ -7,7 +7,6 @@
 */
 
 #include <HTUtils.h>
-#include <tcp.h>
 
 /* Implements:
 */
@@ -32,8 +31,6 @@
 #include <LYexit.h>
 #include <LYLeaks.h>
 
-#define FREE(x) if (x) {free(x); x = NULL;}
-
 #ifdef VMS
 #define DISPLAY "DECW$DISPLAY"
 #else
@@ -658,7 +655,7 @@ PUBLIC void HTFileInit NOARGS
 
 #ifdef EXEC_SCRIPTS
     /*
-     *  define these extentions for exec scripts.
+     *  define these extensions for exec scripts.
      */
 #ifndef VMS
     /* for csh exec links */
diff --git a/src/HTML.c b/src/HTML.c
index 8513ff44..39ed1ae8 100644
--- a/src/HTML.c
+++ b/src/HTML.c
@@ -14,7 +14,6 @@
 #define DICKEY_TEST
 
 #include <HTUtils.h>
-#include <tcp.h>
 
 #define Lynx_HTML_Handler
 #include <HTChunk.h>
@@ -65,8 +64,6 @@ char Style_className[16384];
 #include <LYexit.h>
 #include <LYLeaks.h>
 
-#define FREE(x) if (x) {free(x); x = NULL;}
-
 #define STACKLEVEL(me) ((me->stack + MAX_NESTING - 1) - me->sp)
 
 extern BOOL HTPassEightBitRaw;
diff --git a/src/HTSaveToFile.h b/src/HTSaveToFile.h
index a13ad78a..4374f7a4 100644
--- a/src/HTSaveToFile.h
+++ b/src/HTSaveToFile.h
@@ -1,6 +1,10 @@
 #ifndef HTSAVETOFILE_H
 #define HTSAVETOFILE_H
 
+#include <HTUtils.h>
+#include <HTStream.h>
+#include <HTFormat.h>
+
 extern HTStream * HTSaveToFile PARAMS((
         HTPresentation *        pres,
         HTParentAnchor *        anchor,
diff --git a/src/LYBookmark.c b/src/LYBookmark.c
index 5d1774d2..b08ea97f 100644
--- a/src/LYBookmark.c
+++ b/src/LYBookmark.c
@@ -1,5 +1,4 @@
 #include <HTUtils.h>
-#include <tcp.h>
 #include <HTAlert.h>
 #include <LYUtils.h>
 #include <LYStrings.h>
@@ -23,8 +22,6 @@ extern BOOLEAN HadVMSInterrupt; /* Flag from cleanup_sig() AST */
 
 #include <LYLeaks.h>
 
-#define FREE(x) if (x) {free(x); x = NULL;}
-
 PUBLIC char *MBM_A_subbookmark[MBM_V_MAXFILES+1];
 PUBLIC char *MBM_A_subdescript[MBM_V_MAXFILES+1];
 
diff --git a/src/LYCgi.c b/src/LYCgi.c
index e30d53f7..c70db2d4 100644
--- a/src/LYCgi.c
+++ b/src/LYCgi.c
@@ -24,7 +24,6 @@
 */ 
 
 #include <HTUtils.h>
-#include <tcp.h>
 #include <HTTP.h>
 #include <HTParse.h>
 #include <HTTCP.h>
@@ -41,7 +40,6 @@
 #include <LYGetFile.h>
 #include <LYBookmark.h>
 #include <GridText.h>
-#include <ctype.h>
 #include <LYCgi.h>
 #include <LYSignal.h>
 #include <LYLocal.h>
diff --git a/src/LYCgi.h b/src/LYCgi.h
index 56a8d15d..b0e1cd63 100644
--- a/src/LYCgi.h
+++ b/src/LYCgi.h
@@ -1,7 +1,8 @@
-
 #ifndef LYCGI_H
 #define LYCGI_H
 
+#include <HTUtils.h>
+
 extern void add_lynxcgi_environment PARAMS((CONST char *variable_name));
 
 #endif /* LYGETFILE_H */
diff --git a/src/LYCharSets.c b/src/LYCharSets.c
index d6609a99..81cfa9af 100644
--- a/src/LYCharSets.c
+++ b/src/LYCharSets.c
@@ -1,5 +1,4 @@
 #include <HTUtils.h>
-#include <tcp.h>
 #include <HTCJK.h>
 #include <HTMLDTD.h>
 
diff --git a/src/LYCharSets.h b/src/LYCharSets.h
index cd9e4ccc..746f84c2 100644
--- a/src/LYCharSets.h
+++ b/src/LYCharSets.h
@@ -1,7 +1,9 @@
-
 #ifndef LYCHARSETS_H
 #define LYCHARSETS_H
 
+#include <HTUtils.h>
+#include <UCDefs.h>
+
 #ifndef UCMAP_H
 #include <UCMap.h>
 #endif /* !UCMAP_H */
diff --git a/src/LYCharUtils.c b/src/LYCharUtils.c
index ed4722f7..572da3cb 100644
--- a/src/LYCharUtils.c
+++ b/src/LYCharUtils.c
@@ -3,7 +3,6 @@
 **  ==========================================================================
 */
 #include <HTUtils.h>
-#include <tcp.h>
 #include <SGML.h>
 
 #define Lynx_HTML_Handler
@@ -48,8 +47,6 @@
 #include <LYexit.h>
 #include <LYLeaks.h>
 
-#define FREE(x) if (x) {free(x); x = NULL;}
-
 extern BOOL HTPassEightBitRaw;
 extern BOOL HTPassEightBitNum;
 extern BOOL HTPassHighCtrlRaw;
diff --git a/src/LYClean.c b/src/LYClean.c
index 0c79b9e6..1f65bbae 100644
--- a/src/LYClean.c
+++ b/src/LYClean.c
@@ -1,5 +1,4 @@
 #include <HTUtils.h>
-#include <tcp.h>
 #include <LYCurses.h>
 #include <LYUtils.h>
 #include <LYSignal.h>
@@ -13,8 +12,6 @@
 #include <LYexit.h>
 #include <LYLeaks.h>
 
-#define FREE(x) if (x) {free(x); x = NULL;}
-
 #ifdef VMS
 BOOLEAN HadVMSInterrupt = FALSE;
 #endif /* VMS */
diff --git a/src/LYClean.h b/src/LYClean.h
index ec5ee39b..dbd6a5ad 100644
--- a/src/LYClean.h
+++ b/src/LYClean.h
@@ -1,6 +1,8 @@
 #ifndef LYCLEAN_H
 #define LYCLEAN_H
 
+#include <HTUtils.h>
+
 #ifdef VMS
 extern BOOLEAN HadVMSInterrupt;
 #endif
diff --git a/src/LYCookie.c b/src/LYCookie.c
index c1979941..4d7d496b 100644
--- a/src/LYCookie.c
+++ b/src/LYCookie.c
@@ -22,7 +22,7 @@
       * Hex escaping isn't considered at all.  Any semi-colons, commas,
 	or spaces actually in cookie names or values (i.e., not serving
 	as punctuation for the overall Set-Cookie value) should be hex
-	escaped if not quoted, but presumeably the server is expecting
+	escaped if not quoted, but presumably the server is expecting
 	them to be hex escaped in our Cookie request header as well, so
 	in theory we need not unescape them.  We'll see how this works
 	out in practice.
@@ -40,12 +40,11 @@
 	of use.
       * If a cookie has the secure flag set, we presently treat only SSL
 	connections as secure.	This may need to be expanded for other
-	secure communication protocols that become standarized.
+	secure communication protocols that become standardized.
       * Cookies could be optionally stored in a file from session to session.
 */
 
 #include <HTUtils.h>
-#include <tcp.h>
 #include <HTAccess.h>
 #include <HTParse.h>
 #include <HTAlert.h>
@@ -65,8 +64,6 @@
 
 #include <LYLeaks.h>
 
-#define FREE(x) if (x) {free(x); x = NULL;}
-
 /*
 **  The first level of the cookie list is a list indexed by the domain
 **  string; cookies with the same domain will be placed in the same
@@ -2017,7 +2014,7 @@ PRIVATE int LYHandleCookies ARGS4 (
     extern BOOLEAN HadVMSInterrupt;
 #endif /* VMS */
 
-#ifdef EXP_PERSISTENT_COOKIES 
+#ifdef EXP_PERSISTENT_COOKIES
     /* rjp - this can go here for now */
     LYStoreCookies ("j");
 #endif
@@ -2212,11 +2209,11 @@ Delete_all_cookies_in_domain:
 
 			    case 'P':
 				/*
-				 *  Set to prompt for cookie acceptence
+				 *  Set to prompt for cookie acceptance
 				 *  from this domain. - FM
 				 */
 				de->bv = QUERY_USER;
-				_user_message(PROMTING_TO_ALLOW_COOKIES,
+				_user_message(PROMPTING_TO_ALLOW_COOKIES,
 					      de->domain);
 				sleep(MessageSecs);
 				return(HT_NO_DATA);
@@ -2435,6 +2432,100 @@ Delete_all_cookies_in_domain:
     return(HT_LOADED);
 }
 
+/* cookie_add_acceptlist
+ *   is passed a comma delimited string of domains (with leading '.')
+ *   to add to the "always accept" list for cookies.
+ */
+
+PUBLIC void cookie_add_acceptlist ARGS1(
+	char *,		acceptdomains)
+{
+    domain_entry *de = NULL;
+    char **domain1 = 0;
+    char **origstr = 0;
+
+    if (domain_list == NULL) {
+	atexit(LYCookieJar_free);
+	domain_list = HTList_new();
+	total_cookies = 0;
+    }
+
+    *origstr = (char *)acceptdomains;
+
+    for(; (*domain1 = LYstrsep(origstr, ",")) != NULL;) {
+	if(**domain1 != '\0') {
+	    de = (domain_entry *)calloc(1, sizeof(domain_entry));
+
+	    if (de == NULL)
+		    outofmem(__FILE__, "cookie_accept_domains");
+
+	    de->bv = ACCEPT_ALWAYS;
+
+	    StrAllocCopy(de->domain, *domain1);
+	    HTList_addObject(domain_list, de);
+	}
+    }
+
+    /* then one last one, cos that's how LYstrsep() works */
+
+    de = (domain_entry *)calloc(1, sizeof(domain_entry));
+
+    if (de == NULL)
+	    outofmem(__FILE__, "cookie_accept_domains");
+
+    de->bv = ACCEPT_ALWAYS;
+
+    StrAllocCopy(de->domain, *origstr);
+    HTList_addObject(domain_list, de);
+}
+
+/* cookie_add_rejectlist
+ *   is passed a comma delimited string of domains (with leading '.')
+ *   to add to the "always reject" list for cookies.
+ */
+
+PUBLIC void cookie_add_rejectlist ARGS1(
+	char *,		rejectdomains)
+{
+    domain_entry *de = NULL;
+    char **domain1 = 0;
+    char **origstr = 0;
+
+    if (domain_list == NULL) {
+	atexit(LYCookieJar_free);
+	domain_list = HTList_new();
+	total_cookies = 0;
+    }
+
+    *origstr = rejectdomains;
+
+    for(; (*domain1 = LYstrsep(origstr, ",")) != NULL;) {
+	if(**domain1 != '\0') {
+	    de = (domain_entry *)calloc(1, sizeof(domain_entry));
+
+	    if (de == NULL)
+		    outofmem(__FILE__, "cookie_reject_domains");
+
+	    de->bv = REJECT_ALWAYS;
+
+	    StrAllocCopy(de->domain, *domain1);
+	    HTList_addObject(domain_list, de);
+	}
+    }
+
+    /* then one last one, cos that's how LYstrsep() works */
+
+    de = (domain_entry *)calloc(1, sizeof(domain_entry));
+
+    if (de == NULL)
+	    outofmem(__FILE__, "cookie_reject_domains");
+
+    de->bv = REJECT_ALWAYS;
+
+    StrAllocCopy(de->domain, *origstr);
+    HTList_addObject(domain_list, de);
+}
+
 #ifdef GLOBALDEF_IS_MACRO
 #define _LYCOOKIE_C_GLOBALDEF_1_INIT { "LYNXCOOKIE",LYHandleCookies,0}
 GLOBALDEF (HTProtocol,LYLynxCookies,_LYCOOKIE_C_GLOBALDEF_1_INIT);
diff --git a/src/LYCookie.h b/src/LYCookie.h
index e1e4ad1a..62ea77a4 100644
--- a/src/LYCookie.h
+++ b/src/LYCookie.h
@@ -1,6 +1,9 @@
 #ifndef LYCOOKIES_H
 #define LYCOOKIES_H
 
+#include <HTUtils.h>
+#include <HTList.h>
+
 extern void LYSetCookie PARAMS((
 	CONST char *	SetCookie,
 	CONST char *	SetCookie2,
@@ -12,6 +15,10 @@ extern char *LYCookie PARAMS((
 	BOOL		secure));
 extern void LYLoadCookies PARAMS((
 	CONST char * 	cookie_file));
+extern void cookie_add_acceptlist PARAMS((
+	char *		acceptdomains));
+extern void cookie_add_rejectlist PARAMS((
+	char *		rejectdomains));
 
 typedef enum {ACCEPT_ALWAYS, REJECT_ALWAYS, QUERY_USER, FROM_FILE} behaviour;
 
diff --git a/src/LYCurses.c b/src/LYCurses.c
index 03d5aba7..8bf79563 100644
--- a/src/LYCurses.c
+++ b/src/LYCurses.c
@@ -1,5 +1,4 @@
 #include <HTUtils.h>
-#include <tcp.h>
 #include <LYCurses.h>
 #include <LYStyle.h>
 #include <LYUtils.h>
@@ -15,8 +14,6 @@
 #include <LYexit.h>
 #include <LYLeaks.h>
 
-#define FREE(x) if (x) {free(x); x = NULL;}
-
 #ifdef VMS
 #define DISPLAY "DECW$DISPLAY"
 #else
@@ -652,9 +649,9 @@ PUBLIC void start_curses NOARGS
 
     if (slinit == 0) {
 	SLtt_get_terminfo();
-#if defined(__DJGPP__) && !defined(DJGPP_KEYHANDLER) 
+#if defined(__DJGPP__) && !defined(DJGPP_KEYHANDLER)
 	SLkp_init ();
-#endif /* __DJGPP__ && !DJGPP_KEYHANDLER */ 
+#endif /* __DJGPP__ && !DJGPP_KEYHANDLER */
 
 #ifdef UNIX
 #if SLANG_VERSION >= 9935
@@ -726,7 +723,7 @@ PUBLIC void start_curses NOARGS
     scrollok(0,0);
     SLsmg_Backspace_Moves = 1;
 #ifndef VMS
-#if !defined(_WINDOWS) && !defined(__DJGPP__) 
+#if !defined(_WINDOWS) && !defined(__DJGPP__)
     SLtty_set_suspend_state(1);
 #endif /* !_WINDOWS */
 #ifdef SIGTSTP
@@ -1231,7 +1228,6 @@ PUBLIC void LYstopTargetEmphasis NOARGS
 #include <descrip.h>
 #include <iodef.h>
 #include <ssdef.h>
-#include <stdlib.h>
 #include <msgdef.h>
 #include <ttdef.h>
 #include <tt2def.h>
diff --git a/src/LYCurses.h b/src/LYCurses.h
index 38545cd7..cd658287 100644
--- a/src/LYCurses.h
+++ b/src/LYCurses.h
@@ -1,6 +1,7 @@
 #ifndef LYCURSES_H
 #define LYCURSES_H
 
+#include <HTUtils.h>
 #include <userdefs.h>
 
 /*
diff --git a/src/LYDownload.c b/src/LYDownload.c
index edc79d0c..33e81896 100644
--- a/src/LYDownload.c
+++ b/src/LYDownload.c
@@ -1,5 +1,4 @@
 #include <HTUtils.h>
-#include <tcp.h>
 #include <HTParse.h>
 #include <HTList.h>
 #include <HTAlert.h>
@@ -22,8 +21,6 @@
 #include <LYexit.h>
 #include <LYLeaks.h>
 
-#define FREE(x) if (x) {free(x); x = NULL;}
-
 /*
  *  LYDownload takes a URL and downloads it using a user selected
  *  download program
@@ -215,12 +212,7 @@ check_recall:
 	}
 
 	if (no_dotfiles || !show_dotfiles) {
-	  if (*buffer == '.' ||
-#ifdef VMS
-	      ((cp = strrchr(buffer, ':')) && *(cp+1) == '.') ||
-	      ((cp = strrchr(buffer, ']')) && *(cp+1) == '.') ||
-#endif /* VMS */
-	      ((cp = strrchr(buffer, '/')) && *(cp+1) == '.')) {
+	  if (*LYPathLeaf(buffer) == '.') {
 		HTAlert(FILENAME_CANNOT_BE_DOT);
 		_statusline(NEW_FILENAME_PROMPT);
 		FirstRecall = TRUE;
@@ -500,12 +492,7 @@ check_recall:
 		}
 
 		if (no_dotfiles || !show_dotfiles) {
-		    if (*buffer == '.' ||
-#ifdef VMS
-		       ((cp = strrchr(buffer, ':')) && *(cp+1) == '.') ||
-		       ((cp = strrchr(buffer, ']')) && *(cp+1) == '.') ||
-#endif /* VMS */
-		       ((cp = strrchr(buffer, '/')) && *(cp+1) == '.')) {
+		    if (*LYPathLeaf(buffer) == '.') {
 			HTAlert(FILENAME_CANNOT_BE_DOT);
 			_statusline(NEW_FILENAME_PROMPT);
 			goto again;
diff --git a/src/LYEdit.c b/src/LYEdit.c
index 75f0521e..36da56c2 100644
--- a/src/LYEdit.c
+++ b/src/LYEdit.c
@@ -1,5 +1,4 @@
 #include <HTUtils.h>
-#include <tcp.h>
 #include <HTParse.h>
 #include <HTAlert.h>
 #include <LYCurses.h>
@@ -20,8 +19,6 @@
 
 #include <LYLeaks.h>
 
-#define FREE(x) if (x) {free(x); x = NULL;}
-
 /*
  *  In edit mode invoke either emacs, vi, pico, jove, jed sedt or the
  *  default editor to display and edit the current file.
diff --git a/src/LYEdit.h b/src/LYEdit.h
index 08c07625..f8ee515d 100644
--- a/src/LYEdit.h
+++ b/src/LYEdit.h
@@ -1,7 +1,8 @@
-
 #ifndef LYEDIT_H
 #define LYEDIT_H
 
+#include <HTUtils.h>
+
 extern int edit_current_file PARAMS((char *newfile, int cur, int lineno));
 
 #endif /* LYEDIT_H */
diff --git a/src/LYEditmap.c b/src/LYEditmap.c
index 290a47d1..cf8cc312 100644
--- a/src/LYEditmap.c
+++ b/src/LYEditmap.c
@@ -3,7 +3,6 @@
 */
 
 #include <HTUtils.h>
-#include <tcp.h>
 #include <LYStrings.h>
 
 PUBLIC int current_lineedit = 0;  /* Index into LYLineEditors[]   */
diff --git a/src/LYExtern.c b/src/LYExtern.c
index 9701d576..fb52cea7 100644
--- a/src/LYExtern.c
+++ b/src/LYExtern.c
@@ -15,17 +15,14 @@
  See lynx.cfg for other info.
 */
 
-#include <tcp.h>
-#include <LYGlobalDefs.h>
 #include <LYUtils.h>
+#include <LYGlobalDefs.h>
 #include <LYExtern.h>
 #include <LYCurses.h>
 
 #include <LYLeaks.h>
 
 #ifdef USE_EXTERNALS
-#define FREE(x) if (x) {free(x); x = NULL;}
-
 void run_external ARGS1(char *, c)
 {
 	char command[1024];
diff --git a/src/LYForms.c b/src/LYForms.c
index 3f572bc2..4935e2f1 100644
--- a/src/LYForms.c
+++ b/src/LYForms.c
@@ -1,5 +1,4 @@
 #include <HTUtils.h>
-#include <tcp.h>
 #include <HTCJK.h>
 #include <HTTP.h>
 #include <HTAlert.h>
@@ -13,6 +12,9 @@
 #include <LYGlobalDefs.h>
 #include <LYKeymap.h>
 #include <LYSignal.h>
+#ifdef DJGPP_KEYHANDLER
+#include <keys.h>
+#endif /* DJGPP_KEYHANDLER */
 
 #include <LYLeaks.h>
 
@@ -381,6 +383,20 @@ again:
 	if (keymap[ch + 1] == LYK_REFRESH)
 	    break;
 	switch (ch) {
+#ifdef DJGPP_KEYHANDLER
+	    case K_Down:
+	    case K_EDown:
+	    case K_Up:
+	    case K_EUp:
+	    case K_PageUp:
+	    case K_EPageUp:
+	    case K_PageDown:
+	    case K_EPageDown:
+	    case K_Home:
+	    case K_EHome:
+	    case K_End:
+	    case K_EEnd:
+#else
 	    case DNARROW:
 	    case UPARROW:
 	    case PGUP:
@@ -391,13 +407,19 @@ again:
 	    case FIND_KEY:
 	    case SELECT_KEY:
 #endif /* NOTDEFINED */
+#endif /* DJGPP_KEYHANDLER */
 		goto breakfor;
 
 	    /*
 	     *  Left arrrow in column 0 deserves special treatment here,
 	     *  else you can get trapped in a form without submit button!
 	     */
+#ifdef DJGPP_KEYHANDLER
+	    case K_Left:
+	    case K_ELeft:
+#else
 	    case LTARROW:
+#endif /* DJGPP_KEYHANDLER */
 		if (MyEdit.pos == 0) {
 		    int c = 'Y';    /* Go back immediately if no changes */
 		    if (strcmp(MyEdit.buffer, value)) {
diff --git a/src/LYGetFile.c b/src/LYGetFile.c
index 28bac09e..7d40e685 100644
--- a/src/LYGetFile.c
+++ b/src/LYGetFile.c
@@ -1,5 +1,4 @@
 #include <HTUtils.h>
-#include <tcp.h>
 #include <HTTP.h>
 #include <HTAnchor.h>	    /* Anchor class */
 #include <HTAccess.h>
@@ -45,8 +44,6 @@
 #endif /* SYSLOG_REQUESTED_URLS */
 #endif /* !VMS */
 
-#define FREE(x) if (x) {free(x); x = NULL;}
-
 PRIVATE int fix_http_urls PARAMS((document *doc));
 extern char * WWW_Download_File;
 #ifdef VMS
@@ -286,8 +283,10 @@ Try_Redirected_URL:
 		} else if (url_type == LYNXPRINT_URL_TYPE) {
 		    return(printfile(doc));
 
+#ifdef EXP_FORMS_OPTIONS
 		} else if (url_type == LYNXOPTIONS_URL_TYPE) {
 		    return(postoptions(doc));
+#endif /* EXP_FORMS_OPTIONS */
 
 		} else if (url_type == NEWSPOST_URL_TYPE ||
 			   url_type == NEWSREPLY_URL_TYPE ||
@@ -452,11 +451,7 @@ Try_Redirected_URL:
 #endif /* !VMS */
 			    printf("\n%s", RETURN_TO_LYNX);
 			    fflush(stdout);
-#ifdef DJGPP_KEYHANDLER
-			    getxkey();
-#else
 			    LYgetch();
-#endif /* DJGPP_KEYHANDLER */
 #ifdef VMS
 			    {
 			      extern BOOLEAN HadVMSInterrupt;
@@ -909,7 +904,7 @@ Try_Redirected_URL:
 			    HTMLSetCharacterHandling(current_char_set);
 			    /*
 			     *	Check for a suggested filename from
-			     *	the Content-Dispostion header. - FM
+			     *	the Content-Disposition header. - FM
 			     */
 			    if (((tmpanchor = HTAnchor_parent(
 						HTAnchor_findAddress(&WWWDoc)
diff --git a/src/LYGetFile.h b/src/LYGetFile.h
index 8ddfb999..93239e83 100644
--- a/src/LYGetFile.h
+++ b/src/LYGetFile.h
@@ -1,7 +1,8 @@
-
 #ifndef LYGETFILE_H
 #define LYGETFILE_H
 
+#include <LYStructs.h>
+
 #define NOT_FOUND 0
 #define NORMAL 1
 #define NULLFILE 3
diff --git a/src/LYGlobalDefs.h b/src/LYGlobalDefs.h
index a66dc1af..3dcb7e2f 100644
--- a/src/LYGlobalDefs.h
+++ b/src/LYGlobalDefs.h
@@ -285,10 +285,12 @@ extern BOOLEAN LYMBMAdvanced;		/* MBM statusline for ADVANCED?	 */
 extern int LYStatusLine;		/* Line for statusline() or -1   */
 extern BOOLEAN LYCollapseBRs;		/* Collapse serial BRs?		 */
 extern BOOLEAN LYSetCookies;		/* Process Set-Cookie headers?	 */
-extern BOOLEAN LYEatAllCookies;         /* accept ALL cookies?          */
+extern BOOLEAN LYAcceptAllCookies;      /* accept ALL cookies?          */
+extern char *LYCookieAcceptDomains;     /* domains to accept all cookies */
+extern char *LYCookieRejectDomains;     /* domains to reject all cookies */
 extern char *XLoadImageCommand;		/* Default image viewer for X	 */
 #ifdef USE_EXTERNALS
-extern BOOLEAN no_externals; /* don't allow the use of externals */
+extern BOOLEAN no_externals; 		/* don't allow the use of externals */
 #endif
 extern BOOLEAN LYNoISMAPifUSEMAP;	/* Omit ISMAP link if MAP present? */
 extern int LYHiddenLinks;
@@ -297,7 +299,7 @@ extern BOOL New_DTD;
 
 #define BOOKMARK_TITLE "Bookmark file"
 #define MOSAIC_BOOKMARK_TITLE "Converted Mosaic Hotlist"
-#define MBM_V_MAXFILES  25	/* Max number of sub-bookmark files */
+#define MBM_V_MAXFILES  25		/* Max number of sub-bookmark files */
 /*
  *  Arrays that holds the names of sub-bookmark files
  *  and their descriptions.
diff --git a/src/LYHash.h b/src/LYHash.h
index 00f8066c..c76ae994 100644
--- a/src/LYHash.h
+++ b/src/LYHash.h
@@ -1,6 +1,8 @@
 #if !defined(_LYHASH_H_)
 #define _LYHASH_H_ 1
 
+#include <HTUtils.h>
+
 struct _hashbucket {
 	char *name; /* name of this item */
 	int	code; /* code of this item */
diff --git a/src/LYHistory.c b/src/LYHistory.c
index 38522586..9355d979 100644
--- a/src/LYHistory.c
+++ b/src/LYHistory.c
@@ -1,5 +1,4 @@
 #include <HTUtils.h>
-#include <tcp.h>
 #include <HTTP.h>
 #include <HTAlert.h>
 #include <HText.h>
@@ -23,8 +22,6 @@
 #include <LYexit.h>
 #include <LYLeaks.h>
 
-#define FREE(x) if (x) {free(x); x = NULL;}
-
 PUBLIC HTList * Visited_Links = NULL;	/* List of safe popped docs. */
 
 /*
diff --git a/src/LYJump.c b/src/LYJump.c
index ec211f02..aab39263 100644
--- a/src/LYJump.c
+++ b/src/LYJump.c
@@ -1,5 +1,4 @@
 #include <HTUtils.h>
-#include <tcp.h>
 #include <HTAlert.h>
 #include <LYUtils.h>
 #include <LYStrings.h>
@@ -15,8 +14,6 @@
 #include <fab.h>
 #endif /* VMS */
 
-#define FREE(x) if (x) {free(x); x = NULL;}
-
 struct JumpTable *JThead = NULL;
 
 PRIVATE int LYCompare PARAMS ((CONST void *e1, CONST void *e2));
diff --git a/src/LYJump.h b/src/LYJump.h
index 5da8f885..3a82b075 100644
--- a/src/LYJump.h
+++ b/src/LYJump.h
@@ -1,7 +1,8 @@
-
 #ifndef LYJUMP_H
 #define LYJUMP_H
 
+#include <HTList.h>
+
 typedef struct _JumpDatum {
     char *key;
     char *url;
diff --git a/src/LYKeymap.c b/src/LYKeymap.c
index 3e087687..4386ebde 100644
--- a/src/LYKeymap.c
+++ b/src/LYKeymap.c
@@ -1,5 +1,4 @@
 #include <HTUtils.h>
-#include <tcp.h>
 #include <LYUtils.h>
 #include <LYKeymap.h>
 #include <LYGlobalDefs.h>
diff --git a/src/LYKeymap.h b/src/LYKeymap.h
index 406d3660..1c02cd61 100644
--- a/src/LYKeymap.h
+++ b/src/LYKeymap.h
@@ -1,6 +1,8 @@
 #ifndef LYKEYMAP_H
 #define LYKEYMAP_H
 
+#include <HTUtils.h>
+
 extern BOOLEAN LYisNonAlnumKeyname PARAMS((int ch, int key_name));
 extern char *key_for_func PARAMS((int func));
 extern int LYReverseKeymap PARAMS((int key_name));
diff --git a/src/LYLeaks.c b/src/LYLeaks.c
index 222b48aa..bb41b9ad 100644
--- a/src/LYLeaks.c
+++ b/src/LYLeaks.c
@@ -10,13 +10,9 @@
 #define NO_MEMORY_TRACKING
 
 #include <HTUtils.h>
-#include <tcp.h>
 #include <LYexit.h>
 #include <LYLeaks.h>
 #include <LYUtils.h>
-#include <ctype.h>
-
-#define FREE(x) if (x) {free(x); x = NULL;}
 
 PRIVATE AllocationList *ALp_RunTimeAllocations = NULL;
 
diff --git a/src/LYList.c b/src/LYList.c
index f7b31e4c..54a78b7b 100644
--- a/src/LYList.c
+++ b/src/LYList.c
@@ -6,7 +6,6 @@
 */
 
 #include <HTUtils.h>
-#include <tcp.h>
 #include <LYUtils.h>
 #include <GridText.h>
 #include <LYList.h>
@@ -22,8 +21,6 @@
 #include <LYexit.h>
 #include <LYLeaks.h>
 
-#define FREE(x) if (x) {free(x); x = NULL;}
-
 /*	showlist - F.Macrides (macrides@sci.wfeb.edu)
 **	--------
 **	Create a temporary text/html file with a list of links to
@@ -164,8 +161,8 @@ PUBLIC int showlist ARGS2(
 	    /*
 	     *	Set flag to note that we had at least one internal link,
 	     *	if the document from which we are generating the list
-	     *	has assosiated POST data; after an extra check that the
-	     *	link destination really has hthe same POST data so that
+	     *	has associated POST data; after an extra check that the
+	     *	link destination really has the same POST data so that
 	     *	we can believe it is an internal link.
 	     */
 	    intern_w_post = TRUE;
@@ -226,7 +223,7 @@ PUBLIC int showlist ARGS2(
      *	Make necessary changes to newdoc before returning to caller.
      *	If the intern_w_post flag is set, we keep the POST data in
      *	newdoc that have been passed in.  They should be the same as
-     *	in the loaded locument for which we generated the list.
+     *	in the loaded document for which we generated the list.
      *	In that case the file we have written will be associated with
      *	the same POST data when it is loaded after we are done here,
      *	so that following one of the links we have marked as "internal
@@ -289,7 +286,7 @@ PUBLIC void printlist ARGS2(
 	    if (child == 0) {
 		/*
 		 *  child should not be 0 unless form field numbering is on
-		 *  and cnt is the number of a form intput field.
+		 *  and cnt is the number of a form input field.
 		 *  HText_FormDescNumber() will set desc to a description
 		 *  of what type of input field this is.  We'll create a
 		 *  within-document link to ensure that the link numbers on
diff --git a/src/LYList.h b/src/LYList.h
index 4a717284..f0071d49 100644
--- a/src/LYList.h
+++ b/src/LYList.h
@@ -1,7 +1,8 @@
-
 #ifndef LYLIST_H
 #define LYLIST_H
 
+#include <LYStructs.h>
+
 extern char * LYlist_temp_url NOPARAMS;
 extern int showlist PARAMS((document *newdoc, BOOLEAN titles));
 extern void printlist PARAMS((FILE *fp, BOOLEAN titles));
diff --git a/src/LYLocal.c b/src/LYLocal.c
index d85be6e3..c22c6b79 100644
--- a/src/LYLocal.c
+++ b/src/LYLocal.c
@@ -29,7 +29,6 @@
 */
 
 #include <HTUtils.h>
-#include <tcp.h>
 #include <HTAlert.h>
 #include <HTParse.h>
 #include <LYCurses.h>
@@ -72,9 +71,6 @@
 
 #include <LYLeaks.h>
 
-#define FREE(x) if (x) {free(x); x = NULL;}
-
-
 PRIVATE int LYExecv PARAMS((
 	char *		path,
 	char ** 	argv,
@@ -265,7 +261,7 @@ PRIVATE BOOLEAN remove_tagged NOARGS
     count = 0;
     tag = tagged;
     while (ans == 'Y' && (cp = (char *)HTList_nextObject(tag)) != NULL) {
-	if (is_url(cp) == FILE_URL_TYPE) { /* unecessary check */
+	if (is_url(cp) == FILE_URL_TYPE) { /* unnecessary check */
 	    tp = cp;
 	    if (!strncmp(tp, "file://localhost", 16)) {
 		tp += 16;
@@ -447,7 +443,7 @@ PRIVATE BOOLEAN modify_tagged ARGS1(
 	 *  Make sure the target location is a directory which is owned
 	 * by the same uid as the owner of the current location.
 	 */
-	if ((dir_info.st_mode & S_IFMT) == S_IFDIR) {
+	if (S_ISDIR(dir_info.st_mode)) {
 	    if (dir_info.st_uid == owner) {
 		count = 0;
 		tag = tagged;
@@ -525,9 +521,9 @@ PRIVATE BOOLEAN modify_name ARGS1(
 	/*
 	 *  Change the name of the file or directory.
 	 */
-	if ((dir_info.st_mode & S_IFMT) == S_IFDIR) {
+	if (S_ISDIR(dir_info.st_mode)) {
 	     cp = "Enter new name for directory: ";
-	} else if ((dir_info.st_mode & S_IFMT) == S_IFREG) {
+	} else if (S_ISREG(dir_info.st_mode)) {
 	     cp = "Enter new name for file: ";
 	} else {
 	     _statusline(
@@ -570,11 +566,11 @@ PRIVATE BOOLEAN modify_name ARGS1(
 			return (-1);
 		    return 1;
 		}
-	    } else if ((dir_info.st_mode & S_IFMT) == S_IFDIR) {
+	    } else if (S_ISDIR(dir_info.st_mode)) {
 		_statusline(
 	    "There is already a directory with that name! Request ignored.");
 		sleep(AlertSecs);
-	    } else if ((dir_info.st_mode & S_IFMT) == S_IFREG) {
+	    } else if (S_ISREG(dir_info.st_mode)) {
 		_statusline(
 		 "There is already a file with that name! Request ignored.");
 		sleep(AlertSecs);
@@ -620,9 +616,9 @@ PRIVATE BOOLEAN modify_location ARGS1(
     /*
      *	Change the location of the file or directory.
      */
-    if ((dir_info.st_mode & S_IFMT) == S_IFDIR) {
+    if (S_ISDIR(dir_info.st_mode)) {
 	cp = "Enter new location for directory: ";
-    } else if ((dir_info.st_mode & S_IFMT) == S_IFREG) {
+    } else if (S_ISREG(dir_info.st_mode)) {
 	cp = "Enter new location for file: ";
     } else {
 	_statusline(
@@ -670,7 +666,7 @@ PRIVATE BOOLEAN modify_location ARGS1(
 	    sleep(AlertSecs);
 	    return 0;
 	}
-	if ((dir_info.st_mode & S_IFMT) != S_IFDIR) {
+	if (S_ISDIR(dir_info.st_mode)) {
 	    _statusline(
 		"Destination is not a valid directory! Request denied.");
 	    sleep(AlertSecs);
@@ -838,11 +834,11 @@ PRIVATE BOOLEAN create_file ARGS1(
 	    if (LYExecv(TOUCH_PATH, args, tmpbuf) <= 0)
 		return (-1);
 	    return 1;
-	} else if ((dir_info.st_mode & S_IFMT) == S_IFDIR) {
+	} else if (S_ISDIR(dir_info.st_mode)) {
 	    _statusline(
 	   "There is already a directory with that name! Request ignored.");
 	    sleep(AlertSecs);
-	} else if ((dir_info.st_mode & S_IFMT) == S_IFREG) {
+	} else if (S_ISREG(dir_info.st_mode)) {
 	    _statusline(
 		"There is already a file with that name! Request ignored.");
 	    sleep(AlertSecs);
@@ -904,11 +900,11 @@ PRIVATE BOOLEAN create_directory ARGS1(
 	    if (LYExecv(MKDIR_PATH, args, tmpbuf) <= 0)
 		return (-1);
 	    return 1;
-	} else if ((dir_info.st_mode & S_IFMT) == S_IFDIR) {
+	} else if (S_ISDIR(dir_info.st_mode)) {
 	    _statusline(
 	   "There is already a directory with that name! Request ignored.");
 	    sleep(AlertSecs);
-	} else if ((dir_info.st_mode & S_IFMT) == S_IFREG) {
+	} else if (S_ISREG(dir_info.st_mode)) {
 	    _statusline(
 		"There is already a file with that name! Request ignored.");
 	    sleep(AlertSecs);
@@ -985,7 +981,7 @@ PRIVATE BOOLEAN remove_single ARGS1(
     } else {
 	cp = testpath;
     }
-    if ((dir_info.st_mode & S_IFMT) == S_IFDIR) {
+    if (S_ISDIR(dir_info.st_mode)) {
 	if (strlen(cp) < 37) {
 	    sprintf(tmpbuf,
 		    "Remove '%s' and all of its contents (y or n): ", cp);
@@ -993,14 +989,14 @@ PRIVATE BOOLEAN remove_single ARGS1(
 	    sprintf(tmpbuf,
 		    "Remove directory and all of its contents (y or n): ");
 	}
-    } else if ((dir_info.st_mode & S_IFMT) == S_IFREG) {
+    } else if (S_ISREG(dir_info.st_mode)) {
 	if (strlen(cp) < 60) {
 	    sprintf(tmpbuf, "Remove file '%s' (y or n): ", cp);
 	} else {
 	    sprintf(tmpbuf, "Remove file (y or n): ");
 	}
 #ifdef S_IFLNK
-    } else if ((dir_info.st_mode & S_IFMT) == S_IFLNK) {
+    } else if (S_ISLNK(dir_info.st_mode)) {
 	if (strlen(cp) < 50) {
 	    sprintf(tmpbuf, "Remove symbolic link '%s' (y or n): ", cp);
 	} else {
@@ -1102,10 +1098,6 @@ static struct {
 				   use shell access for that. */
 };
 
-#ifndef S_ISDIR
-#define S_ISDIR(mode)   ((mode&0xF000) == 0x4000)
-#endif /* !S_ISDIR */
-
 PRIVATE char LYValidPermitFile[256] = "\0";
 
 /*
@@ -1146,8 +1138,8 @@ PRIVATE BOOLEAN permit_location ARGS3(
 	    _statusline(tmpbuf);
 	    sleep(AlertSecs);
 	    return 0;
-	} else if ((dir_info.st_mode & S_IFMT) != S_IFDIR &&
-	    (dir_info.st_mode & S_IFMT) != S_IFREG) {
+	} else if (!S_ISDIR(dir_info.st_mode) &&
+	           !S_ISREG(dir_info.st_mode)) {
 	    _statusline(
 	"The specified item is not a file nor a directory - request ignored.");
 	    sleep(AlertSecs);
@@ -1249,7 +1241,7 @@ PRIVATE BOOLEAN permit_location ARGS3(
 	fprintf(fp0,
 "<Br>\n<Li><Input Type=\"submit\" Value=\"Submit\"> \
 form to permit %s %s.\n</Ol>\n</Form>\n",
-		(dir_info.st_mode & S_IFMT) == S_IFDIR ? "directory" : "file",
+		S_ISDIR(dir_info.st_mode) ? "directory" : "file",
 		user_filename);
 	fprintf(fp0, "</Body></Html>");
 	LYCloseTempFP(fp0);
@@ -1312,8 +1304,8 @@ form to permit %s %s.\n</Ol>\n</Form>\n",
 	    _statusline(tmpbuf);
 	    sleep(AlertSecs);
 	    return 0;
-	} else if ((dir_info.st_mode & S_IFMT) != S_IFDIR &&
-	    (dir_info.st_mode & S_IFMT) != S_IFREG) {
+	} else if (!S_ISDIR(dir_info.st_mode) &&
+	           !S_ISREG(dir_info.st_mode)) {
 	    _statusline(
 	"The specified item is not a file nor a directory - request ignored.");
 	    sleep(AlertSecs);
@@ -1823,14 +1815,14 @@ PUBLIC int dired_options ARGS2(
 	if (mp->cond == DE_TAG && nothing_tagged)
 	    continue;
 	if (mp->cond == DE_DIR &&
-	    (!*path || (dir_info.st_mode & S_IFMT) != S_IFDIR))
+	    (!*path || !S_ISDIR(dir_info.st_mode)))
 	    continue;
 	if (mp->cond == DE_FILE &&
-	    (!*path || (dir_info.st_mode & S_IFMT) != S_IFREG))
+	    (!*path || !S_ISREG(dir_info.st_mode)))
 	    continue;
 #ifdef S_IFLNK
 	if (mp->cond == DE_SYMLINK &&
-	    (!*path || (dir_info.st_mode & S_IFMT) != S_IFLNK))
+	    (!*path || !S_ISLNK(dir_info.st_mode)))
 	    continue;
 #endif
 	if (*mp->sfx &&
@@ -1931,8 +1923,8 @@ PUBLIC BOOLEAN local_install ARGS3(
 	    _statusline(tmpbuf);
 	    sleep(AlertSecs);
 	    return 0;
-	} else if ((dir_info.st_mode & S_IFMT) != S_IFDIR &&
-		   (dir_info.st_mode & S_IFMT) != S_IFREG) {
+	} else if (!S_ISDIR(dir_info.st_mode) &&
+		   !S_ISREG(dir_info.st_mode)) {
 	    _statusline(
 	  "The selected item is not a file or a directory! Request ignored.");
 	    sleep(AlertSecs);
@@ -1954,12 +1946,12 @@ PUBLIC BOOLEAN local_install ARGS3(
 	_statusline(tmpbuf);
 	sleep(AlertSecs);
 	return 0;
-    } else if ((dir_info.st_mode & S_IFMT) != S_IFDIR) {
+    } else if (!S_ISDIR(dir_info.st_mode)) {
 	_statusline(
 		"The selected item is not a directory! Request ignored.");
 	sleep(AlertSecs);
 	return 0;
-    } else if (0 /*directory not writeable*/) {
+    } else if (0 /*directory not writable*/) {
 	_statusline("Install in the selected directory not permitted.");
 	sleep(AlertSecs);
 	return 0;
diff --git a/src/LYLocal.h b/src/LYLocal.h
index 47fff5c0..48f9509a 100644
--- a/src/LYLocal.h
+++ b/src/LYLocal.h
@@ -6,11 +6,6 @@
 #ifdef VMS
 #include <types.h>
 #include <stat.h>
-#else
-#if 0 /* already included in tcp.h */
-#include <sys/types.h>
-#include <sys/stat.h>
-#endif
 #endif /* VMS */
 
 #ifndef S_IRWXU 
diff --git a/src/LYMail.c b/src/LYMail.c
index 50c78f19..3557907f 100644
--- a/src/LYMail.c
+++ b/src/LYMail.c
@@ -9,7 +9,6 @@
  */
 
 #include <HTUtils.h>
-#include <tcp.h>
 #include <HTParse.h>
 #include <LYGlobalDefs.h>
 #include <HTAlert.h>
@@ -25,8 +24,6 @@
 
 #include <LYLeaks.h>
 
-#define FREE(x) if (x) {free(x); x = NULL;}
-
 BOOLEAN term_letter;	/* Global variable for async i/o. */
 PRIVATE void terminate_letter  PARAMS((int sig));
 PRIVATE void remove_tildes PARAMS((char *string));
diff --git a/src/LYMain.c b/src/LYMain.c
index 3651f0cc..ea5584d0 100644
--- a/src/LYMain.c
+++ b/src/LYMain.c
@@ -1,5 +1,4 @@
 #include <HTUtils.h>
-#include <tcp.h>
 #include <HTTP.h>
 #include <HTParse.h>
 #include <HTAccess.h>
@@ -52,8 +51,6 @@
 #include <LYexit.h>
 #include <LYLeaks.h>
 
-#define FREE(x) if (x) {free(x); x = NULL;}
-
 #ifdef VMS
 #define DISPLAY "DECW$DISPLAY"
 #else
@@ -336,7 +333,9 @@ PUBLIC BOOLEAN LYMBMAdvanced = TRUE;
 PUBLIC int LYStatusLine = -1;		 /* Line for statusline() if > -1 */
 PUBLIC BOOLEAN LYCollapseBRs = COLLAPSE_BR_TAGS;  /* Collapse serial BRs? */
 PUBLIC BOOLEAN LYSetCookies = SET_COOKIES; /* Process Set-Cookie headers? */
-PUBLIC BOOLEAN LYEatAllCookies = EAT_ALL_COOKIES; /* take all cookies?    */
+PUBLIC BOOLEAN LYAcceptAllCookies = ACCEPT_ALL_COOKIES; /* take all cookies? */
+PUBLIC char *LYCookieAcceptDomains = NULL; /* domains to accept all cookies */
+PUBLIC char *LYCookieRejectDomains = NULL; /* domains to reject all cookies */
 PUBLIC char *XLoadImageCommand = NULL;	/* Default image viewer for X */
 PUBLIC BOOLEAN LYNoISMAPifUSEMAP = FALSE; /* Omit ISMAP link if MAP present? */
 PUBLIC int LYHiddenLinks = HIDDENLINKS_SEPARATE; /* Show hidden links? */
@@ -2525,6 +2524,10 @@ static int width_fun ARGS3(
 
 static Parse_Args_Type Arg_Table [] =
 {
+   PARSE_SET(
+      "accept_all_cookies", SET_ARG,		&LYAcceptAllCookies,
+      "accepts all cookies"
+   ),
    PARSE_FUN(
       "anonymous",	FUNCTION_ARG,	anonymous_fun,
       "used to specify the anonymous account"
@@ -2608,10 +2611,6 @@ with -dump, format output as with -traversal, but to stdout"
       "dump",		FUNCTION_ARG,		dump_output_fun,
       "dump the first file to stdout and exit"
    ),
-   PARSE_SET(
-      "eat_all_cookies", SET_ARG,		&LYEatAllCookies,
-      "accepts all cookies"
-   ),
    PARSE_FUN(
       "editor", 	NEED_FUNCTION_ARG,	editor_fun,
       "=EDITOR\nenable edit mode with specified editor"
diff --git a/src/LYMainLoop.c b/src/LYMainLoop.c
index a232be02..b00b039b 100644
--- a/src/LYMainLoop.c
+++ b/src/LYMainLoop.c
@@ -1,5 +1,4 @@
 #include <HTUtils.h>
-#include <tcp.h>
 #include <HTAccess.h>
 #include <HTParse.h>
 #include <HTList.h>
@@ -84,8 +83,6 @@ PRIVATE int sametext ARGS2(
 }
 #endif /* FASTTAB */
 
-#define FREE(x) if (x) {free(x); x = NULL;}
-
 PUBLIC	HTList * Goto_URLs = NULL;  /* List of Goto URLs */
 
 PUBLIC char * LYRequestTitle = NULL; /* newdoc.title in calls to getfile() */
@@ -234,7 +231,9 @@ int mainloop NOARGS
     char *temp = NULL;
     BOOLEAN ForcePush = FALSE;
     BOOLEAN override_LYresubmit_posts = FALSE;
+#ifdef EXP_FORMS_OPTIONS
     BOOLEAN was_in_options = FALSE;
+#endif
     unsigned int len;
     int i;
 
@@ -382,11 +381,12 @@ try_again:
 		     *	under case NORMAL.  - FM
 		     */
 #ifndef EXP_FORMS_OPTIONS
-		    if (strncmp(newdoc.address, "LYNXDOWNLOAD:", 13)) {
+		    if (strncmp(newdoc.address, "LYNXDOWNLOAD:", 13))
 #else /* EXP_FORMS_OPTIONS */
 		    if (strncmp(newdoc.address, "LYNXDOWNLOAD:", 13) &&
-			strncmp(newdoc.address, "LYNXOPTIONS:", 12)) {
+			strncmp(newdoc.address, "LYNXOPTIONS:", 12))
 #endif /* EXP_FORMS_OPTIONS */
+		    {
 			LYpush(&curdoc, ForcePush);
 		    }
 		} else if (!newdoc.address) {
@@ -3818,7 +3818,7 @@ check_goto_URL:
 	    c = dir_list_style;
 #endif /* DIRED_SUPPORT */
 #ifndef EXP_FORMS_OPTIONS
-	    options(); /* do the options stuff */
+	    LYoptions(); /* do the options stuff */
 
 	    if (keypad_mode_flag != keypad_mode ||
 		(user_mode_flag != user_mode &&
@@ -4302,7 +4302,7 @@ check_goto_URL:
 			    _statusline(NO_STATUS);
 			    sleep(AlertSecs);
 			} else {
-			    if (((dir_info.st_mode) & S_IFMT) == S_IFREG) {
+			    if (S_ISREG(dir_info.st_mode)) {
 				StrAllocCopy(tp, cp);
 				HTUnEscapeSome(tp, "/");
 				if (edit_current_file(tp,
@@ -4616,7 +4616,7 @@ check_goto_URL:
 		} else {
 		    char *VMSdir = NULL;
 
-		    if (((stat_info.st_mode) & S_IFMT) == S_IFDIR) {
+		    if (S_ISDIR(stat_info.st_mode)) {
 			/*
 			 *  We're viewing a local directory.  Make
 			 *  that the CSwing argument. - FM
diff --git a/src/LYMainLoop.h b/src/LYMainLoop.h
index 8a501234..25d7b133 100644
--- a/src/LYMainLoop.h
+++ b/src/LYMainLoop.h
@@ -1,7 +1,8 @@
-
 #ifndef LYMAINLOOP_H
 #define LYMAINLOOP_H
 
+#include <HTUtils.h>
+
 extern void LYCloseTracelog NOPARAMS;
 extern int mainloop NOPARAMS;
 
diff --git a/src/LYMap.c b/src/LYMap.c
index 1e1ba24d..75527572 100644
--- a/src/LYMap.c
+++ b/src/LYMap.c
@@ -6,7 +6,6 @@
 */
 
 #include <HTUtils.h>
-#include <tcp.h>
 #include <HTTP.h>
 #include <HTAnchor.h>
 #include <HTAccess.h>
@@ -29,8 +28,6 @@
 #include <LYexit.h>
 #include <LYLeaks.h>
 
-#define FREE(x) if (x) {free(x); x=NULL;}
-
 typedef struct _LYMapElement {
    char * address;
    char * title;
diff --git a/src/LYMap.h b/src/LYMap.h
index ae0f9d69..0ce31797 100644
--- a/src/LYMap.h
+++ b/src/LYMap.h
@@ -1,7 +1,10 @@
-
 #ifndef LYMAP_H
 #define LYMAP_H
 
+#include <HTUtils.h>
+#include <HTList.h>
+#include <HTAnchor.h>
+
 extern BOOL LYMapsOnly;
 
 extern void ImageMapList_free PARAMS((HTList * list));
diff --git a/src/LYNews.c b/src/LYNews.c
index 3237a0ea..91c6fc3d 100644
--- a/src/LYNews.c
+++ b/src/LYNews.c
@@ -1,5 +1,4 @@
 #include <HTUtils.h>
-#include <tcp.h>
 #include <HTParse.h>
 #include <HTAccess.h>
 #include <HTCJK.h>
@@ -21,8 +20,6 @@
 
 #include <LYLeaks.h>
 
-#define FREE(x) if (x) {free(x); x = NULL;}
-
 /*
 **  Global variable for async i/o.
 */
diff --git a/src/LYOptions.c b/src/LYOptions.c
index 62f1c367..267d8770 100644
--- a/src/LYOptions.c
+++ b/src/LYOptions.c
@@ -1,5 +1,4 @@
 #include <HTUtils.h>
-#include <tcp.h>
 #include <HTFTP.h>
 #include <HTML.h>
 #include <LYCurses.h>
@@ -22,18 +21,17 @@
 
 #include <LYLeaks.h>
 
-#define FREE(x) if (x) {free(x); x = NULL;}
-
 #ifdef VMS
 #define DISPLAY "DECW$DISPLAY"
 #else
 #define DISPLAY "DISPLAY"
 #endif /* VMS */
 
-#define COL_OPTION_VALUES 36  /* display column where option values start */
-
 BOOLEAN term_options;
+
 PRIVATE void terminate_options	PARAMS((int sig));
+
+#ifndef EXP_FORMS_OPTIONS
 PRIVATE int boolean_choice PARAMS((
 	int		status,
 	int		line,
@@ -46,9 +44,12 @@ PRIVATE int popup_choice PARAMS((
 	char ** 	choices,
 	int		i_length,
 	int		disabled));
+#endif /* EXP_FORMS_OPTIONS */
 
 #define MAXCHOICES 10
 
+#define COL_OPTION_VALUES 36  /* display column where option values start */
+
 #define L_Bool_A (use_assume_charset ? L_BOOL_A + 1 : L_BOOL_A)
 #define L_Bool_B (use_assume_charset ? L_BOOL_B + 1 : L_BOOL_B)
 #define L_Exec (use_assume_charset ? L_EXEC + 1 : L_EXEC)
@@ -84,6 +85,7 @@ PRIVATE void option_statusline ARGS1(
     LYStatusLine = -1;
 }
 
+#ifndef EXP_FORMS_OPTIONS
 PRIVATE void option_user_message ARGS2(
 	CONST char *,		message,
 	char *, 		argument)
@@ -108,7 +110,7 @@ PRIVATE void option_user_message ARGS2(
     LYStatusLine = -1;
 }
 
-PUBLIC void options NOARGS
+PUBLIC void LYoptions NOARGS
 {
 #ifdef ALLOW_USERS_TO_CHANGE_EXEC_WITHIN_OPTIONS
     int itmp;
@@ -300,7 +302,7 @@ draw_options:
     } else {
 	switch (LYChosenShowColor) {
 	case SHOW_COLOR_NEVER:
-                addstr("NEVER     ");
+		addstr("NEVER	  ");
 		break;
 	case SHOW_COLOR_OFF:
 		addstr("OFF");
@@ -830,9 +832,9 @@ draw_options:
 		    }
 
 		    /*
-		 *  Set the raw 8-bit or CJK mode defaults and
-		 *  character set if changed. - FM
-		 */
+		     *  Set the raw 8-bit or CJK mode defaults and
+		     *  character set if changed. - FM
+		     */
 		    if (CurrentAssumeCharSet != UCLYhndl_for_unspec ||
 			UCLYhndl_for_unspec != curval) {
 			if (UCLYhndl_for_unspec != CurrentAssumeCharSet) {
@@ -841,7 +843,7 @@ draw_options:
 			}
 			LYRawMode = (UCLYhndl_for_unspec == current_char_set);
 			HTMLSetUseDefaultRawMode(current_char_set, LYRawMode);
-			HTMLUseCharacterSet(current_char_set);
+			HTMLSetCharacterHandling(current_char_set);
 			CurrentAssumeCharSet = UCLYhndl_for_unspec;
 			CurrentAssumeLocalCharSet = UCLYhndl_HTFile_for_unspec;
 			CurrentRawMode = LYRawMode;
@@ -1754,6 +1756,7 @@ PRIVATE int boolean_choice ARGS4(
 	}
     }
 }
+#endif /* EXP_FORMS_OPTIONS */
 
 PRIVATE void terminate_options ARGS1(
 	int,		sig GCC_UNUSED)
@@ -2060,6 +2063,7 @@ draw_bookmark_list:
     signal(SIGINT, cleanup_sig);
 }
 
+#ifndef EXP_FORMS_OPTIONS
 /*
 **  This function prompts for a choice or page number.
 **  If a 'g' or 'p' suffix is included, that will be
@@ -3106,6 +3110,8 @@ restore_popup_statusline:
     }
 }
 
+#else /* EXP_FORMS_OPTIONS */
+
 /*
  * I'm paranoid about mistyping strings.  Also, this way they get combined
  * so we don't have to worry about the intelligence of the compiler.
@@ -3141,9 +3147,9 @@ static char * search_type_string = "search_type";
 static char * search_case_insensitive_string = "case_insensitive";
 static char * search_case_sensitive_string = "case_sensitive";
 
-static char * prefered_doc_lang_string = "prefered_doc_lang";
+static char * preferred_doc_lang_string = "preferred_doc_lang";
 
-static char * prefered_doc_char_string = "prefered_doc_char";
+static char * preferred_doc_char_string = "preferred_doc_char";
 
 static char * assume_char_set_string = "assume_char_set";
 
@@ -3240,6 +3246,13 @@ PRIVATE struct post_pair * break_data ARGS1(
  * Handle options from the pseudo-post.  I think we really only need
  * post_data here, but bring along everything just in case.  It's only a
  * pointer.  MRC
+ *
+ * By changing the certain options value (like preferred language or
+ * fake browser name) we need to inform the remote server and reload (uncache)
+ * the document which was active just before the Options menu was invoked.
+ * Another values (like display_char_set or assume_char_set) used by lynx
+ * initial rendering stages and can be changed only after reloading :-(
+ * So we introduce boolean flag 'need_reload' (currently dummy).
  */
 
 PUBLIC int postoptions ARGS1(
@@ -3248,6 +3261,7 @@ PUBLIC int postoptions ARGS1(
     struct post_pair *data;
     int i;
     BOOLEAN save_all = FALSE;
+    BOOLEAN need_reload = FALSE;
 
     data = break_data(newdoc->post_data);
 
@@ -3321,22 +3335,36 @@ PUBLIC int postoptions ARGS1(
 	}
 
 	/*
-	 * prefered_doc_lang
+	 * preferred_doc_lang
 	 */
-	if (!strcmp(data[i].tag, prefered_doc_lang_string)) {
+	if (!strcmp(data[i].tag, preferred_doc_lang_string)) {
 	    FREE(language);
 	    StrAllocCopy(language, data[i].value);
 	}
 
 	/*
-	 * prefered_doc_char
+	 * preferred_doc_char
 	 */
-	if (!strcmp(data[i].tag, prefered_doc_lang_string)) {
+	if (!strcmp(data[i].tag, preferred_doc_char_string)) {
 	    FREE(pref_charset);
 	    StrAllocCopy(pref_charset, data[i].value);
 	}
 
 	/*
+	 * raw_mode
+	 */
+	if (!strcmp(data[i].tag, raw_mode_string)) {
+	    BOOLEAN newmode;
+	    newmode = (!strcmp(data[i].value, on_string));
+	    if (newmode != LYRawMode) {
+		LYRawMode = newmode;
+		HTMLSetUseDefaultRawMode(current_char_set, LYRawMode);
+		HTMLSetCharacterHandling(current_char_set);
+		need_reload = TRUE;
+	    }
+	}
+
+	/*
 	 * assume_char_set
 	 */
 	if (!strcmp(data[i].tag, assume_char_set_string)) {
@@ -3360,16 +3388,13 @@ PUBLIC int postoptions ARGS1(
 		StrAllocCopy(UCAssume_MIMEcharset, data[i].value);
 		LYRawMode = (UCLYhndl_for_unspec == current_char_set);
 		HTMLSetUseDefaultRawMode(current_char_set, LYRawMode);
-		HTMLUseCharacterSet(current_char_set);
+		HTMLSetCharacterHandling(current_char_set);
 	    }
 	}
 
 	/*
 	 * display_char_set
 	 */
-	/*
-	 * FIXME: This needs validation.  - MRC
-	 */
 	if (!strcmp(data[i].tag, display_char_set_string)) {
 	    int newval;
 
@@ -3383,6 +3408,7 @@ PUBLIC int postoptions ARGS1(
 		HTMLSetRawModeDefault(current_char_set);
 		LYUseDefaultRawMode = TRUE;
 		HTMLUseCharacterSet(current_char_set);
+		need_reload = TRUE;
 	    }
 	}
 
@@ -3403,19 +3429,6 @@ PUBLIC int postoptions ARGS1(
 	}
 
 	/*
-	 * raw_mode
-	 */
-	if (!strcmp(data[i].tag, raw_mode_string)) {
-	    BOOLEAN newmode;
-	    newmode = (!strcmp(data[i].value, on_string));
-	    if (newmode != LYRawMode) {
-		LYRawMode = newmode;
-		HTMLSetUseDefaultRawMode(current_char_set, LYRawMode);
-		HTMLSetCharacterHandling(current_char_set);
-	    }
-	}
-
-	/*
 	 * vi_keys
 	 */
 	if (!strcmp(data[i].tag, vi_keys_string)) {
@@ -3535,6 +3548,9 @@ PUBLIC int postoptions ARGS1(
 	    HTAlert(OPTIONS_NOT_SAVED);
 	}
     }
+    if (need_reload == TRUE)  {
+        /* FIXME: currently dummy */
+    }
     return(NULLFILE);
 }
 
@@ -3545,6 +3561,10 @@ PUBLIC int postoptions ARGS1(
  * Basic Strategy:  For each option, throw up the appropriate type of
  * control, giving defaults as appropriate.  If nothing else, we're
  * probably going to test every control there is.  MRC
+ *
+ * Each option from this form will be processed whether it was changed or not.
+ * The order may be important for some fields (like RawMode)
+ * unless we add a special flag in postoptions()
  */
 PUBLIC int gen_options ARGS1(
 	char **,	newfile)
@@ -3567,10 +3587,10 @@ PUBLIC int gen_options ARGS1(
     StrAllocCopy(*newfile, print_filename);
     LYforce_no_cache = TRUE;
 
-    fprintf(fp0, "<head>\n<title>%s</title>\n</head>\n<body>\n",
+    fprintf(fp0, "<html><head>\n<title>%s</title>\n</head>\n<body>\n",
 	    OPTIONS_TITLE);
 
-    fprintf(fp0,"<h1>Options Menu (%s Version %s)</h1><pre>\n",
+    fprintf(fp0,"<h1>Options Menu (%s Version %s)</h1>\n",
 	    LYNX_NAME, LYNX_VERSION);
 
     /*
@@ -3588,6 +3608,18 @@ PUBLIC int gen_options ARGS1(
 	    secure_string, secure_value);
 
     /*
+     * visible preformated text begins here
+     */
+    fprintf(fp0,"<pre>\n\n");
+
+    /*
+     * save/reset
+     */
+    fprintf(fp0,"<input type=\"submit\" value=\"Accept Changes\">");
+    fprintf(fp0," <input type=\"reset\" value=\"Reset\">");
+    fprintf(fp0," Use the back key to cancel changes.\n\n");
+
+    /*
      * editor
      */
     fprintf(fp0,"<%s>Editor:</%s> ", label_string, label_string);
@@ -3645,24 +3677,51 @@ PUBLIC int gen_options ARGS1(
     fprintf(fp0,"</select>\n");
 
     /*
-     * prefered_doc_lang
+     * preferred_doc_lang
      */
-    fprintf(fp0,"<%s>Prefered document language</%s> ", label_string,
+    fprintf(fp0,"<%s>Preferred document language</%s> ", label_string,
 	    label_string);
     fprintf(fp0,"<input type=\"text\" name=\"%s\" value=\"%s\">\n",
-	    prefered_doc_lang_string,
+	    preferred_doc_lang_string,
 	    (language && language[0])?language:empty_string);
 
     /*
-     * prefered_doc_char
+     * preferred_doc_char
      */
-    fprintf(fp0,"<%s>Prefered document character set</%s> ", label_string,
+    fprintf(fp0,"<%s>Preferred document character set</%s> ", label_string,
 	    label_string);
     fprintf(fp0,"<input type=\"text\" name=\"%s\" value=\"%s\">\n",
-	    prefered_doc_char_string,
+	    preferred_doc_char_string,
 	    (pref_charset && pref_charset[0])?pref_charset:empty_string);
 
     /*
+     * display_char_set
+     */
+    fprintf(fp0,"<%s>Display character set:</%s> ", label_string,
+	   label_string);
+    fprintf(fp0,"<select name=\"%s\">\n", display_char_set_string);
+    for (i = 0; LYchar_set_names[i]; i++) {
+        fprintf(fp0,"<option %s value=\"%d\">%s</options>\n",
+	        (i==current_char_set)?selected_string:empty_string,
+		i, LYchar_set_names[i]);
+    }
+    fprintf(fp0,"</select>\n");
+
+    /*
+     * raw_mode
+     */
+    fprintf(fp0,"<%s>Raw 8-bit or CJK mode:</%s> ", label_string,
+	   label_string);
+    fprintf(fp0,"<select name=\"%s\">\n", raw_mode_string);
+    fprintf(fp0,"<option %s value=\"%s\">%s</option>\n",
+	   (LYRawMode)?empty_string:selected_string,
+	   off_string, off_string);
+    fprintf(fp0,"<option %s value=\"%s\">%s</option>\n",
+	   (LYRawMode)?selected_string:empty_string,
+	   on_string, on_string);
+    fprintf(fp0,"</select>\n");
+
+    /*
      * assume_char_set
      */
     /*
@@ -3692,33 +3751,6 @@ PUBLIC int gen_options ARGS1(
     }
 
     /*
-     * display_char_set
-     */
-    fprintf(fp0,"<%s>Display character set:</%s> ", label_string,
-	    label_string);
-    fprintf(fp0,"<select name=\"%s\">\n", display_char_set_string);
-    for (i = 0; LYchar_set_names[i]; i++) {
-	fprintf(fp0,"<option %s value=\"%d\">%s</options>\n",
-		(i==current_char_set)?selected_string:empty_string,
-		i, LYchar_set_names[i]);
-    }
-    fprintf(fp0,"</select>\n");
-
-    /*
-     * raw_mode
-     */
-    fprintf(fp0,"<%s>Raw 8-bit or CJK mode:</%s> ", label_string,
-	    label_string);
-    fprintf(fp0,"<select name=\"%s\">\n", raw_mode_string);
-    fprintf(fp0,"<option %s value=\"%s\">%s</option>\n",
-	    (LYRawMode)?empty_string:selected_string,
-	    off_string, off_string);
-    fprintf(fp0,"<option %s value=\"%s\">%s</option>\n",
-	    (LYRawMode)?selected_string:empty_string,
-	    on_string, on_string);
-    fprintf(fp0,"</select>\n");
-
-    /*
      * show_color
      */
 #if defined(USE_SLANG) || defined(COLOR_CURSES)
@@ -3868,7 +3900,7 @@ PUBLIC int gen_options ARGS1(
     /*
      * dired_sort
      */
-    fprintf(fp0,"<%s>User Mode:</%s> ", label_string, label_string);
+    fprintf(fp0,"<%s>Local directory sort criteria:</%s> ", label_string, label_string); 
     fprintf(fp0,"<select name=\"%s\">\n", dired_sort_string);
     fprintf(fp0,"<option %s value=\"%s\">Directories first</option>\n",
 	    (dir_list_style==0)?selected_string:empty_string,
@@ -3902,21 +3934,27 @@ PUBLIC int gen_options ARGS1(
      * save options
      */
     if (!no_option_save) {
-        fprintf(fp0,"<%s>Save options to disk: </%s> ", label_string,
+	fprintf(fp0,"<%s>Save options to disk: </%s> ", label_string,
 		label_string);
-        fprintf(fp0,"<input type=\"checkbox\" name=\"%s\">\n",
+	fprintf(fp0,"<input type=\"checkbox\" name=\"%s\">\n",
 		save_options_string);
     }
 
     /*
      * save/reset
      */
-    fprintf(fp0,"<p>Use the back key to cancel changes.\n");
+    fprintf(fp0,"\n"); 
     fprintf(fp0,"<input type=\"submit\" value=\"Accept Changes\">");
-    fprintf(fp0," <input type=\"reset\" value=\"Reset\">\n");
-    fprintf(fp0,"</p>");
+    fprintf(fp0," <input type=\"reset\" value=\"Reset\">"); 
+    fprintf(fp0," Use the back key to cancel changes.\n"); 
+ 
+    /* 
+     * close HTML 
+     */ 
+    fprintf(fp0,"</pre>\n"); 
     fprintf(fp0,"</body>\n");
 
     fclose(fp0);
     return(0);
 }
+#endif /* EXP_FORMS_OPTIONS */
diff --git a/src/LYOptions.h b/src/LYOptions.h
index 973901a3..fc7f528a 100644
--- a/src/LYOptions.h
+++ b/src/LYOptions.h
@@ -1,12 +1,17 @@
 #ifndef LYOPTIONS_H
 #define LYOPTIONS_H
 
+#include <LYStructs.h>
+
 extern BOOLEAN term_options;
 
-extern void options NOPARAMS;
 extern void edit_bookmarks NOPARAMS;
+
+#ifdef EXP_FORMS_OPTIONS
 extern int postoptions PARAMS((document *newdoc));
 extern int gen_options PARAMS((char **newfile));
+#else
+extern void LYoptions NOPARAMS;
 
 /*
  *  Values for the options menu. - FM
@@ -64,6 +69,8 @@ extern int gen_options PARAMS((char **newfile));
 #define L_EXEC		18
 #endif /* DIRED_SUPPORT */
 
+#endif /* EXP_FORMS_OPTIONS */
+
 #define OPTIONS_TITLE "Lynx Options Configuration"
 
 #endif /* LYOPTIONS_H */
diff --git a/src/LYPrint.c b/src/LYPrint.c
index d4005267..9a7bc90a 100644
--- a/src/LYPrint.c
+++ b/src/LYPrint.c
@@ -1,5 +1,4 @@
 #include <HTUtils.h>
-#include <tcp.h>
 #include <HTAccess.h>
 #include <HTList.h>
 #include <HTAlert.h>
@@ -26,8 +25,6 @@
 
 #include <LYLeaks.h>
 
-#define FREE(x) if (x) {free(x); x = NULL;}
-
 /*
  *  printfile prints out the current file minus the links and targets
  *  to a verity of places
@@ -351,12 +348,7 @@ PUBLIC int printfile ARGS1(
 		}
 
 		if (no_dotfiles || !show_dotfiles) {
-		    if (*filename == '.' ||
-#ifdef VMS
-			((cp = strrchr(filename, ':')) && *(cp+1) == '.') ||
-			((cp = strrchr(filename, ']')) && *(cp+1) == '.') ||
-#endif /* VMS */
-			((cp = strrchr(filename, '/')) && *(cp+1) == '.')) {
+		    if (*LYPathLeaf(filename) == '.') {
 			HTAlert(FILENAME_CANNOT_BE_DOT);
 			_statusline(NEW_FILENAME_PROMPT);
 			FirstRecall = TRUE;
@@ -1125,15 +1117,7 @@ PUBLIC int printfile ARGS1(
 			}
 
 			if (no_dotfiles || !show_dotfiles) {
-			    if (*filename == '.' ||
-#ifdef VMS
-			       ((cp = strrchr(filename, ':')) &&
-						*(cp+1) == '.') ||
-			       ((cp = strrchr(filename, ']')) &&
-						*(cp+1) == '.') ||
-#endif /* VMS */
-			       ((cp = strrchr(filename, '/')) &&
-						*(cp+1) == '.')) {
+			    if (*LYPathLeaf(filename) == '.') {
 				HTAlert(FILENAME_CANNOT_BE_DOT);
 				_statusline(NEW_FILENAME_PROMPT);
 				FirstRecall = TRUE;
diff --git a/src/LYReadCFG.c b/src/LYReadCFG.c
index a49bf7a6..0e503e1d 100644
--- a/src/LYReadCFG.c
+++ b/src/LYReadCFG.c
@@ -1,5 +1,4 @@
 #include <HTUtils.h>
-#include <tcp.h>
 #include <HTFile.h>
 #include <UCMap.h>
 
@@ -15,6 +14,7 @@
 #include <LYCurses.h>
 #include <LYSignal.h>
 #include <LYBookmark.h>
+#include <LYCookie.h>
 #include <LYReadCFG.h>
 
 #ifdef DIRED_SUPPORT
@@ -24,8 +24,6 @@
 #include <LYexit.h>
 #include <LYLeaks.h>
 
-#define FREE(x) if (x) {free(x); x = NULL;}
-
 extern int HTNewsMaxChunk;  /* Max news articles before chunking (HTNews.c) */
 extern int HTNewsChunkSize; /* Number of news articles per chunk (HTNews.c) */
 
@@ -787,6 +785,7 @@ static int viewer_fun ARGS1(
 
 static Config_Type Config_Table [] =
 {
+     PARSE_SET("accept_all_cookies", CONF_BOOL, LYAcceptAllCookies),
      PARSE_INT("alertsecs", CONF_INT, AlertSecs),
      PARSE_SET("always_resubmit_posts", CONF_BOOL, LYresubmit_posts),
 #ifdef EXEC_LINKS
@@ -806,6 +805,8 @@ static Config_Type Config_Table [] =
 #ifdef USE_COLOR_TABLE
      PARSE_FUN("color", CONF_FUN, color_fun),
 #endif
+     PARSE_STR("cookie_accept_domains", CONF_STR, LYCookieAcceptDomains),
+     PARSE_STR("cookie_reject_domains", CONF_STR, LYCookieRejectDomains),
      PARSE_ENV("cso_proxy", CONF_ENV, 0 ),
 #ifdef VMS
      PARSE_STR("CSWING_PATH", CONF_STR, LYCSwingPath),
@@ -823,7 +824,6 @@ static Config_Type Config_Table [] =
      PARSE_FUN("dired_menu", CONF_FUN, dired_menu_fun),
 #endif
      PARSE_ADD("downloader", CONF_ADD_ITEM, downloaders),
-     PARSE_SET("eat_all_cookies", CONF_BOOL, LYEatAllCookies),
      PARSE_SET("emacs_keys_always_on", CONF_BOOL, emacs_keys),
      PARSE_SET("enable_scrollback", CONF_BOOL, enable_scrollback),
 #ifdef USE_EXTERNALS
@@ -1163,4 +1163,18 @@ PUBLIC void read_cfg ARGS3(
 	    cur_download = cur_download->next;
 	}
     }
+
+    /*
+     * If any COOKIE_{ACCEPT,REJECT}_DOMAINS have been defined,
+     * process them. These are comma delimited lists of
+     * domains, with leading '.'. - BJP
+     */
+
+    if (LYCookieAcceptDomains != NULL) {
+	cookie_add_acceptlist(LYCookieAcceptDomains);
+    }
+
+    if (LYCookieRejectDomains != NULL) {
+        cookie_add_rejectlist(LYCookieRejectDomains);
+    }
 }
diff --git a/src/LYSearch.c b/src/LYSearch.c
index aed16225..6fcfa362 100644
--- a/src/LYSearch.c
+++ b/src/LYSearch.c
@@ -1,5 +1,4 @@
 #include <HTUtils.h>
-#include <tcp.h>
 #include <LYUtils.h>
 #include <LYStrings.h>
 #include <LYSearch.h>
@@ -9,8 +8,6 @@
 
 #include <LYLeaks.h>
 
-#define FREE(x) if (x) {free(x); x = NULL;}
-
 /*
  *  Search for the target string inside of the links
  *  that are currently displayed on the screen beginning
diff --git a/src/LYShowInfo.c b/src/LYShowInfo.c
index a70a1a04..54be1077 100644
--- a/src/LYShowInfo.c
+++ b/src/LYShowInfo.c
@@ -1,5 +1,4 @@
 #include <HTUtils.h>
-#include <tcp.h>
 #include <HTParse.h>
 #include <HTAlert.h>
 #include <HTTP.h>
@@ -22,8 +21,6 @@
 #include <LYLocal.h>
 #endif /* DIRED_SUPPORT */
 
-#define FREE(x) if (x) {free(x); x = NULL;}
-
 /*
  *  Showinfo prints a page of info about the current file and the link
  *  that the cursor is on.
@@ -109,14 +106,14 @@ PUBLIC int showinfo ARGS4(
 	    sleep(AlertSecs);
 	} else {
 	    char modes[80];
-	    if (((dir_info.st_mode) & S_IFMT) == S_IFDIR) {
+	    if (S_ISDIR(dir_info.st_mode)) {
 		fprintf(fp0,
 		 "\nDirectory that you have currently selected\n\n");
-	    } else if (((dir_info.st_mode) & S_IFMT) == S_IFREG) {
+	    } else if (S_ISREG(dir_info.st_mode)) {
 		fprintf(fp0,
 		      "\nFile that you have currently selected\n\n");
 #ifdef S_IFLNK
-	    } else if (((dir_info.st_mode) & S_IFMT) == S_IFLNK) {
+	    } else if (S_ISLNK(dir_info.st_mode)) {
 		fprintf(fp0,
 	     "\nSymbolic link that you have currently selected\n\n");
 #endif
@@ -126,7 +123,7 @@ PUBLIC int showinfo ARGS4(
 	    }
 	    fprintf(fp0,"       <em>Full name:</em>  %s\n", temp);
 #ifdef S_IFLNK
-	    if (((dir_info.st_mode) & S_IFMT) == S_IFLNK) {
+	    if (S_ISLNK(dir_info.st_mode)) {
 		char buf[1025];
 		int buf_size;
 
@@ -144,7 +141,7 @@ PUBLIC int showinfo ARGS4(
 	    grp = getgrgid(dir_info.st_gid);
 	    if (grp && grp->gr_name)
 		fprintf(fp0, "      <em>Group name:</em>  %s\n", grp->gr_name);
-	    if (((dir_info.st_mode) & S_IFMT) == S_IFREG) {
+	    if (S_ISREG(dir_info.st_mode)) {
 		sprintf(temp, "       <em>File size:</em>  %ld (bytes)\n",
 			      (long)dir_info.st_size);
 		fprintf(fp0, "%s", temp);
@@ -171,7 +168,7 @@ PUBLIC int showinfo ARGS4(
 	    if ((dir_info.st_mode & S_IWUSR))
 		strcat(modes, ", write");
 	    if ((dir_info.st_mode & S_IXUSR)) {
-		if (((dir_info.st_mode) & S_IFMT) == S_IFDIR)
+		if (S_ISDIR(dir_info.st_mode))
 		    strcat(modes, ", search");
 		else {
 		    strcat(modes, ", execute");
@@ -190,7 +187,7 @@ PUBLIC int showinfo ARGS4(
 	    if ((dir_info.st_mode & S_IWGRP))
 		strcat(modes, ", write");
 	    if ((dir_info.st_mode & S_IXGRP)) {
-		if (((dir_info.st_mode) & S_IFMT) == S_IFDIR)
+		if (S_ISDIR(dir_info.st_mode))
 		    strcat(modes, ", search");
 		else {
 		    strcat(modes, ", execute");
@@ -209,7 +206,7 @@ PUBLIC int showinfo ARGS4(
 	    if ((dir_info.st_mode & S_IWOTH))
 		strcat(modes, ", write");
 	    if ((dir_info.st_mode & S_IXOTH)) {
-		if (((dir_info.st_mode) & S_IFMT) == S_IFDIR)
+		if (S_ISDIR(dir_info.st_mode))
 		    strcat(modes, ", search");
 		else {
 		    strcat(modes, ", execute");
diff --git a/src/LYStrings.c b/src/LYStrings.c
index 90cb8979..73a04f8b 100644
--- a/src/LYStrings.c
+++ b/src/LYStrings.c
@@ -1,5 +1,4 @@
 #include <HTUtils.h>
-#include <tcp.h>
 #include <HTCJK.h>
 #include <LYCurses.h>
 #include <LYUtils.h>
@@ -20,12 +19,8 @@
 #include <keys.h>
 #endif /* DJGPP_KEYHANDLER */
 
-#include <ctype.h>
-
 #include <LYLeaks.h>
 
-#define FREE(x) if (x) {free(x); x = NULL;}
-
 extern BOOL HTPassHighCtrlRaw;
 extern HTCJKlang HTCJK;
 
@@ -572,7 +567,7 @@ re_read:
 #ifndef USE_SLANG
     clearerr(stdin); /* needed here for ultrix and SOCKETSHR, but why? - FM */
 #endif /* !USE_SLANG */
-#if !defined(USE_SLANG) || defined(VMS)
+#if !defined(USE_SLANG) || defined(VMS) || defined(DJGPP_KEYHANDLER)
     c = GetChar();
 #else
     if (LYCursesON) {
@@ -825,7 +820,7 @@ re_read:
 	   c = 127;		   /* backspace key (delete, not Ctrl-H) */
 	   break;
 #endif /* KEY_BACKSPACE */
-#if defined(KEY_F) && !defined(__DJGPP__)
+#if defined(KEY_F) && !defined(__DJGPP__) && !defined(_WINDOWS)
 	case KEY_F(1):
 	   c = F1;		   /* VTxxx Help */
 	   break;
@@ -894,7 +889,7 @@ re_read:
 		    c = set_clicked_link(Mouse_status.x, Mouse_status.y);
 		}
 	      }
-#endif /* _WINDOWS */
+#endif /* DOSPATH */
 	  }
 	  break;
 #endif /* NCURSES_MOUSE_VERSION */
@@ -902,11 +897,11 @@ re_read:
     }
 #endif /* HAVE_KEYPAD */
 
-#ifdef __DJGPP__
+#if (defined(__DJGPP__) || defined(_WINDOWS))
     if (c > 659)
 #else
     if (c > DO_NOTHING)
-#endif /* __DJGPP__ */
+#endif /* __DJGPP__ || _WINDOWS */
     {
 	/*
 	 *  Don't return raw values for KEYPAD symbols which we may have
@@ -1458,13 +1453,24 @@ PUBLIC char *LYstrsep ARGS2(
 	char **,	stringp,
 	CONST char *,	delim)
 {
-    char *tmp, *out = 0;
+    char *tmp, *out;
+
+    if (!stringp || !*stringp)		/* nothing to do? */
+	return 0;			/* then don't fall on our faces */
+
+    if (!**stringp) {			/* empty string: */
+	*stringp = 0;			/* let caller see he's done; */
+	return 0;			/* no tokens in an empty string */
+    }
+
+    out = *stringp;			/* save the start of the string */
     tmp = strpbrk(*stringp, delim);
     if (tmp) {
-	out = *stringp;		/* save the start of the string */
-	*tmp = '\0';		/* terminate the substring with \0 */
-	*stringp = ++tmp;	/* point at the terminator */
+	*tmp = '\0';			/* terminate the substring with \0 */
+	*stringp = ++tmp;		/* point at the next substring */
     }
+    else *stringp = 0;			/* this was the last substring: */
+					/* let caller see he's done */
     return out;
 }
 
diff --git a/src/LYStrings.h b/src/LYStrings.h
index cfb8b5eb..ccd78dee 100644
--- a/src/LYStrings.h
+++ b/src/LYStrings.h
@@ -1,8 +1,7 @@
 #ifndef LYSTRINGS_H
 #define LYSTRINGS_H
 
-#include <string.h>
-
+#include <HTUtils.h>
 
 /*  UPPER8(ch1,ch2) is an extension of (TOUPPER(ch1) - TOUPPER(ch2))  */
 extern int UPPER8  PARAMS((
diff --git a/src/LYStyle.c b/src/LYStyle.c
index af21fdd3..8a95d2b6 100644
--- a/src/LYStyle.c
+++ b/src/LYStyle.c
@@ -1,10 +1,9 @@
 /* character level styles for Lynx
  * (c) 1996 Rob Partington -- donated to the Lyncei (if they want it :-)
- * @Id: LYStyle.c 1.18 Thu, 23 Apr 1998 06:35:21 -0600 dickey @
+ * @Id: LYStyle.c 1.19 Thu, 06 Aug 1998 06:28:22 -0600 dickey @
  */
 #include <HTUtils.h>
 #include <HTML.h>
-#include <tcp.h>
 #include <LYSignal.h>
 #include <LYGlobalDefs.h>
 
@@ -50,9 +49,6 @@ PUBLIC int	s_alink  = NOSTYLE, s_a     = NOSTYLE, s_status = NOSTYLE,
 PRIVATE int colorPairs = 0;
 PRIVATE int last_fA = COLOR_WHITE, last_bA = COLOR_BLACK;
 
-
-#define FREE(x) if (x) {free(x); x = NULL;}
-
 /* icky parsing of the style options */
 PRIVATE void parse_attributes ARGS5(char*,mono,char*,fg,char*,bg,int,style,char*,element)
 {
diff --git a/src/LYTraversal.c b/src/LYTraversal.c
index c8e0df47..d92b7dcd 100644
--- a/src/LYTraversal.c
+++ b/src/LYTraversal.c
@@ -1,5 +1,4 @@
 #include <HTUtils.h>
-#include <tcp.h>
 #include <LYGlobalDefs.h>
 #include <LYUtils.h>
 #include <LYSignal.h>
diff --git a/src/LYUpload.c b/src/LYUpload.c
index f453751c..125e5dca 100644
--- a/src/LYUpload.c
+++ b/src/LYUpload.c
@@ -15,7 +15,6 @@
 */
 
 #include <HTUtils.h>
-#include <tcp.h>
 #include <HTParse.h>
 #include <HTAlert.h>
 #include <LYCurses.h>
@@ -32,8 +31,6 @@
 #include <LYexit.h>
 #include <LYLeaks.h>
 
-#define FREE(x) if (x) {free(x); x = NULL;}
-
 PUBLIC char LYUploadFileURL[256] = "\0";
 
 /*
@@ -124,14 +121,9 @@ retry:
 	sprintf(buffer, "%s/%s", directory, tmpbuf);
 
 	if (no_dotfiles || !show_dotfiles) {
-	    if (*buffer == '.' ||
-#ifdef VMS
-		((cp = strrchr(buffer, ':')) && *(cp+1) == '.') ||
-		((cp = strrchr(buffer, ']')) && *(cp+1) == '.') ||
-#endif /* VMS */
-		((cp = strrchr(buffer, '/')) && *(cp+1) == '.')) {
-		_statusline(
-		  "File name may not begin with dot. Enter a new filename: ");
+	    if (*LYPathLeaf(buffer) == '.') {
+		HTAlert(FILENAME_CANNOT_BE_DOT);
+		_statusline(NEW_FILENAME_PROMPT);
 		goto retry;
 	    }
 	}
diff --git a/src/LYUtils.c b/src/LYUtils.c
index 7f926295..9a2432a2 100644
--- a/src/LYUtils.c
+++ b/src/LYUtils.c
@@ -1,6 +1,4 @@
 #include <HTUtils.h>
-#include <tcp.h>
-#include <ctype.h>
 #include <HTParse.h>
 #include <HTAccess.h>
 #include <HTCJK.h>
@@ -59,8 +57,6 @@
 #include <LYStyle.h>
 #endif
 
-#undef hline   /* FIXME: this is a curses feature used as a variable here */
-
 #ifdef SVR4_BSDSELECT
 extern int BSDselect PARAMS((int nfds, fd_set * readfds, fd_set * writefds,
 			     fd_set * exceptfds, struct timeval * timeout));
@@ -88,8 +84,6 @@ extern int BSDselect PARAMS((int nfds, fd_set * readfds, fd_set * writefds,
 #endif /* __FreeBSD__ || __bsdi__ */
 #endif /* !UTMP_FILE */
 
-#define FREE(x) if (x) {free(x); x = NULL;}
-
 extern HTkcode kanji_code;
 extern BOOLEAN LYHaveCJKCharacterSet;
 extern HTCJKlang HTCJK;
@@ -4747,6 +4741,37 @@ PUBLIC CONST char * Home_Dir NOARGS
 }
 
 /*
+ * Return a pointer to the final leaf of the given pathname, If no pathname
+ * separators are found, returns the original pathname.  The leaf may be
+ * empty.
+ */
+PUBLIC char *LYPathLeaf ARGS1(char *, pathname)
+{
+    char *leaf;
+#ifdef UNIX
+    if ((leaf = strrchr(pathname, '/')) != 0) {
+	leaf++;
+    }
+#else
+#ifdef VMS
+    if ((leaf = strrchr(pathname, ']')) == 0)
+    	leaf = strrchr(pathname, ':');
+    if (leaf != 0)
+	leaf++;
+#else
+    int n;
+    for (leaf = 0, n = strlen(pathname)-1; n >= 0; n--) {
+	if (strchr("\\/:", pathname[n]) != 0) {
+	    leaf = pathname + n;
+	    break;
+	}
+    }
+#endif
+#endif
+    return (leaf != 0) ? leaf : pathname;
+}
+
+/*
  *  This function checks the acceptability of file paths that
  *  are intended to be off the home directory.	The file path
  *  should be passed in fbuffer, together with the size of the
@@ -5303,11 +5328,6 @@ Cambridge, MA 02139, USA.  */
 
 #include <sys/types.h>
 #include <errno.h>
-#ifdef STDC_HEADERS
-#include <stdlib.h>
-#else
-extern int errno;
-#endif /* STDC_HEADERS */
 
 #if defined(STDC_HEADERS) || defined(USG)
 #include <string.h>
@@ -5389,6 +5409,71 @@ int remove ARGS1(char *, name)
 
 #ifdef UNIX
 /*
+ * Verify if this is really a file, not accessed by a link, except for the
+ * special case of its directory being pointed to by a link from a directory
+ * owned by root and not writable by other users.
+ */
+PRIVATE BOOL IsOurFile ARGS1(char *, name)
+{
+    struct stat data;
+
+    if (lstat(name, &data) == 0
+    && S_ISREG(data.st_mode)
+    && data.st_nlink == 1
+    && data.st_uid == getuid()) {
+	int linked = 0;
+#if HAVE_LSTAT
+	char *path = 0;
+	char *leaf;
+
+	StrAllocCopy(path, name);
+	do {
+	    if ((leaf = LYPathLeaf(path)) != path)
+		*--leaf = '\0';	/* write a null on the '/' */
+	    if (lstat(*path ? path : "/", &data) != 0) {
+	    	break;
+	    }
+	    /*
+	     * If we find a symbolic link, it has to be in a directory that's
+	     * protected.  Otherwise someone could have switched it to point
+	     * to one of the real user's files.
+	     */
+	    if (S_ISLNK(data.st_mode)) {
+		if (!linked) {
+		    linked++;
+		} else {	/* a link-to-link is a little hard to digest */
+		    break;
+		}
+	    } else if (S_ISDIR(data.st_mode)) {
+		if (linked) {
+		    if (--linked == 0) {
+			/*
+			 * We assume that a properly-configured system has the
+			 * unwritable directories owned by root.  This is not
+			 * necessarily so (bin, news, etc., may), but the only
+			 * uid we can count on is 0.  It would be nice to add a
+			 * check for the gid also, but that wouldn't be
+			 * portable.
+			 */
+			if (data.st_uid != 0
+			 || data.st_mode & S_IWOTH) {
+			    linked = 1;
+			    break;
+			}
+		    }
+		}
+	    } else if (linked) {
+		break;
+	    }
+	} while (leaf != path);
+	free(path);
+#endif
+	return !linked;
+    }
+    return FALSE;
+}
+
+/*
  * Open a file that we don't want other users to see.
  */
 PRIVATE FILE *OpenHiddenFile ARGS2(char *, name, char *, mode)
@@ -5401,20 +5486,24 @@ PRIVATE FILE *OpenHiddenFile ARGS2(char *, name, char *, mode)
      * that no one has an existing file or link that they happen to own.
      */
     if (*mode == 'w') {
-	struct stat sb;
 	int fd = open(name, O_CREAT|O_EXCL|O_WRONLY, HIDE_CHMOD);
+	if (fd < 0
+	 && errno == EEXIST
+	 && IsOurFile(name)) {
+	    remove(name);
+	    /* FIXME: there's a race at this point if directory is open */
+	    fd = open(name, O_CREAT|O_EXCL|O_WRONLY, HIDE_CHMOD);
+	}
 	if (fd >= 0) {
 	    fp = fdopen(fd, mode);
 	}
-	else if (errno == EEXIST
-	 && stat(name, &sb) == 0
-	 && sb.st_uid == getuid()
-	 && chmod(name, HIDE_CHMOD) == 0
-	 && (fd = open(name, O_TRUNC|O_WRONLY, HIDE_CHMOD)) >= 0)
-	    fp = fdopen(fd, mode);
     }
     else
 #endif
+    if (*mode == 'a'
+     && IsOurFile(name)
+     && chmod(name, HIDE_CHMOD) == 0)
+	fp = fopen(name, mode);
     /*
      * This is less stringent, but reasonably portable.  For new files, the
      * umask will suffice; however if the file already exists we'll change
@@ -5424,7 +5513,7 @@ PRIVATE FILE *OpenHiddenFile ARGS2(char *, name, char *, mode)
      *
      * This won't work properly if the user is root, since the chmod succeeds.
      */
-    {
+    else if (*mode != 'a') {
 	int save = umask(HIDE_UMASK);
 	if (chmod(name, HIDE_CHMOD) == 0 || errno == ENOENT)
 	    fp = fopen(name, mode);
diff --git a/src/LYUtils.h b/src/LYUtils.h
index e7cb4cc3..67ff15cc 100644
--- a/src/LYUtils.h
+++ b/src/LYUtils.h
@@ -46,6 +46,7 @@ extern void Define_VMSLogical PARAMS((
 	char *LogicalName, char *LogicalValue));
 #endif /* VMS */
 extern CONST char *Home_Dir NOPARAMS;
+extern char *LYPathLeaf PARAMS((char * pathname));
 extern BOOLEAN LYPathOffHomeOK PARAMS((char *fbuffer, size_t fbuffer_size));
 extern void LYAddPathToHome PARAMS((
 	char *fbuffer, size_t fbuffer_size, char *fname));
diff --git a/src/LYexit.c b/src/LYexit.c
index 5c8d7d2c..0eace151 100644
--- a/src/LYexit.c
+++ b/src/LYexit.c
@@ -2,7 +2,6 @@
  *	Copyright (c) 1994, University of Kansas, All Rights Reserved
  */
 #include <HTUtils.h>
-#include <tcp.h>
 #include <LYexit.h>
 #ifndef VMS
 #include <LYGlobalDefs.h>
@@ -15,8 +14,6 @@
 #endif /* SYSLOG_REQUESTED_URLS */
 #endif /* !VMS */
 
-#define FREE(x) if (x) {free(x); x = NULL;}
-
 /*
  *  Stack of functions to call upon exit.
  */
diff --git a/src/LYrcFile.c b/src/LYrcFile.c
index 986e3942..54dafdcd 100644
--- a/src/LYrcFile.c
+++ b/src/LYrcFile.c
@@ -1,5 +1,4 @@
 #include <HTUtils.h>
-#include <tcp.h>
 #include <HTFTP.h>
 #include <LYUtils.h>
 #include <LYrcFile.h>
@@ -427,22 +426,50 @@ PUBLIC void read_rc NOPARAMS
 #endif /* DIRED_SUPPORT */
 
 	/*
-	 * eat all cookies? i think it should work user-by-user.
-	 *  -BJP
+	 *  Accept cookies from all domains?
 	 */
-	} else if ((cp = LYstrstr(line_buffer, "eat_all_cookies")) != NULL &&
+	} else if ((cp = LYstrstr(line_buffer, "accept_all_cookies")) != NULL &&
 		   cp-line_buffer < number_sign) {
 	    if((cp2 = (char *)strchr(cp,'=')) != NULL)
 		cp = cp2 + 1;
 	    while (isspace(*cp))
 		cp++; /* get rid of spaces */
 	    if (LYstrstr(cp,"TRUE") != NULL) {
-		LYEatAllCookies = TRUE;
+		LYAcceptAllCookies = TRUE;
 	    } else {
-		LYEatAllCookies = FALSE;
+		LYAcceptAllCookies = FALSE;
 	    }
-	/* BJP */
 
+#ifdef THIS_DOESNT_WORK_YET_DONT_USE_IT
+
+	/*
+	 * Accept all cookies from certain domains?
+	 */
+	} else if ((cp = LYstrstr(line_buffer, "cookie_accept_domains"))
+		!= NULL && cp-line_buffer < number_sign) {
+	    if((cp2 = (char *)strchr(cp,'=')) != NULL)
+		cp = cp2 + 1;
+	    while (isspace(*cp))
+		cp++; /* get rid of spaces */
+	    if (LYstrstr(cp,NULL) != NULL) {
+/*		   cookie_add_acceptlist(cp); */
+	    }
+
+
+	/*
+	 * Reject all cookies from certain domains?
+	 */
+	} else if ((cp = LYstrstr(line_buffer, "cookie_reject_domains"))
+		!= NULL && cp-line_buffer < number_sign) {
+	    if((cp2 = (char *)strchr(cp,'=')) != NULL)
+		cp = cp2 + 1;
+	    while (isspace(*cp))
+		cp++; /* get rid of spaces */
+	    if (LYstrstr(cp,NULL) != NULL) {
+/*		   cookie_add_rejectlist(cp); */
+	    }
+
+#endif
 
 	/*
 	 *  User mode.
diff --git a/src/UCAuto.c b/src/UCAuto.c
index 269baf35..7d910a20 100644
--- a/src/UCAuto.c
+++ b/src/UCAuto.c
@@ -15,7 +15,6 @@
 */
 
 #include <HTUtils.h>
-#include <tcp.h>
 
 #include <UCMap.h>
 #include <UCDefs.h>
@@ -105,7 +104,7 @@ PRIVATE int nonempty_file ARGS1(
     struct stat sb;
 
     return (stat(p, &sb) == 0 &&
-	    (sb.st_mode & S_IFMT) == S_IFREG &&
+	    S_ISREG(sb.st_mode) &&
 	    (sb.st_size != 0));
 }
 
diff --git a/src/UCAuto.h b/src/UCAuto.h
index b4d582c3..e9f1681e 100644
--- a/src/UCAuto.h
+++ b/src/UCAuto.h
@@ -1,7 +1,8 @@
-
 #ifndef UCAUTO_H
 #define UCAUTO_H
 
+#include <UCDefs.h>
+
 extern void UCChangeTerminalCodepage PARAMS((int newcs, LYUCcharset *p));
 
 #endif /* UCAUTO_H */
diff --git a/src/UCAux.c b/src/UCAux.c
index 3a8bc56d..01ea1593 100644
--- a/src/UCAux.c
+++ b/src/UCAux.c
@@ -1,5 +1,4 @@
 #include <HTUtils.h>
-#include <tcp.h>
 
 #include <HTCJK.h>
 #include <UCDefs.h>
diff --git a/src/UCdomap.c b/src/UCdomap.c
index ae3ac64c..0392457b 100644
--- a/src/UCdomap.c
+++ b/src/UCdomap.c
@@ -15,7 +15,6 @@
  * aeb, 950210
  */
 #include <HTUtils.h>
-#include <tcp.h>
 #include <HTMLDTD.h>
 
 #include <LYGlobalDefs.h>
@@ -67,8 +66,6 @@
 #include <mnem_suni.h>
 #endif /* NOTDEFINED */
 
-#define FREE(x) if (x) {free(x); x = NULL;}
-
 /*
  *  Some of the code below, and some of the comments, are left in for
  *  historical reasons.  Not all those tables below are currently
diff --git a/src/UCdomap.h b/src/UCdomap.h
index 1570baf0..e0160953 100644
--- a/src/UCdomap.h
+++ b/src/UCdomap.h
@@ -1,7 +1,9 @@
-
 #ifndef UCDOMAP_H
 #define UCDOMAP_H
 
+#include <HTUtils.h>
+#include <UCkd.h>
+
 /*
  *  [old comments: - KW ]
  *  consolemap.h
diff --git a/src/makefile.dos b/src/makefile.dos
index 452b6aeb..9997308b 100644
--- a/src/makefile.dos
+++ b/src/makefile.dos
@@ -12,7 +12,7 @@ LYStyle.o LYHash.o
 CFLAGS= $(MCFLAGS) -I. -I.. $(SLANGINC)

 

 CC = gcc

-MCFLAGS = -O3 -DUSE_ZLIB -DUSE_EXTERNALS -DCOLOR_CURSES -DNCURSES -DFANCY_CURSES -DACCESS_AUTH -DNO_CUSERID -DNOUSERS -DDOSPATH -DNO_TTYTYPE -DNO_UTMP -Ichrtrans -I../WWW/library/implementation -I../curses  -I../djgpp/tcplib/include -I../djgpp/tcplib/include/tcp

+MCFLAGS = -O3 -DDISP_PARTIAL -DUSE_ZLIB -DUSE_EXTERNALS -DCOLOR_CURSES -DNCURSES -DFANCY_CURSES -DACCESS_AUTH -DNO_CUSERID -DNOUSERS -DDOSPATH -DNO_TTYTYPE -DNO_UTMP -Ichrtrans -I../WWW/library/implementation -I../curses  -I../djgpp/tcplib/include -I../djgpp/tcplib/include/tcp

 WWWLIB = ../WWW/library/djgpp/libwww.a ../curses/pdcurses.a ../djgpp/tcplib/obj/libtcp.a

 LIBS=-lz

 

diff --git a/src/makefile.dsl b/src/makefile.dsl
index 542abd1b..a66349ca 100644
--- a/src/makefile.dsl
+++ b/src/makefile.dsl
@@ -58,5 +58,5 @@ DefaultStyle.o: DefaultStyle.c ../userdefs.h
 LYEditmap.o: LYEditmap.c ../userdefs.h

 LYCharUtils.o: LYCharUtils.c ../userdefs.h

 LYExtern.o: LYExtern.c ../userdefs.h

-LyUtils.o: LYUtils.c ../userdefs.h

+LYUtils.o: LYUtils.c ../userdefs.h

 LYCookie.o: ../userdefs.h

diff --git a/src/makefile.wsl b/src/makefile.wsl
index ff7d3813..8a5504d9 100644
--- a/src/makefile.wsl
+++ b/src/makefile.wsl
@@ -58,5 +58,5 @@ DefaultStyle.o: DefaultStyle.c ../userdefs.h
 LYEditmap.o: LYEditmap.c ../userdefs.h

 LYCharUtils.o: LYCharUtils.c ../userdefs.h

 LYExtern.o: LYExtern.c ../userdefs.h

-LyUtils.o: LYUtils.c ../userdefs.h

+LYUtils.o: LYUtils.c ../userdefs.h

 LYCookie.o: ../userdefs.h

diff --git a/userdefs.h b/userdefs.h
index 15c7d5f8..c65fcdce 100644
--- a/userdefs.h
+++ b/userdefs.h
@@ -76,13 +76,13 @@
  * Note that some implementations of telnet allow passing of
  * environment variables, which might be used by unscrupulous
  * people to modify the environment in anonymous accounts.  When
- * making Lynx and Web access publically available via anonymous
+ * making Lynx and Web access publicly available via anonymous
  * accounts intended to run Lynx captively, be sure the wrapper
  * uses the -cfg switch and specifies the startfile, rather than
  * relying on the LYNX_CFG, LYNX_CFG_FILE, or WWW_HOME variables.
  *
  * Note that any SUFFIX or VIEWER mappings in the configuration
- * file will be overidden by any suffix or viewer mappings
+ * file will be overridden by any suffix or viewer mappings
  * that are established as defaults in src/HTInit.c.  You can
  * override the src/HTInit.c defaults via the mime.types and
  * mailcap files (see the examples in the samples directory).
@@ -126,7 +126,7 @@
 
 /**************************
  * SYSTEM_MAIL must be defined here to your mail sending command,
- * and SYSTEM_MAIL_FLAGS to approrpriate qualifiers.  They can be
+ * and SYSTEM_MAIL_FLAGS to appropriate qualifiers.  They can be
  * changed in lynx.cfg.
  *
  * The mail command will be spawned as a subprocess of lynx
@@ -253,13 +253,13 @@
  * Note that many implementations of telnetd allow passing of
  * environment variables, which might be used by unscrupulous
  * people to modify the environment in anonymous accounts.  When
- * making Lynx and Web access publically available via anonymous
+ * making Lynx and Web access publicly available via anonymous
  * accounts intended to run Lynx captively, be sure the wrapper
  * uses the -cfg switch and specifies the startfile, rather than
  * relying on the LYNX_CFG, LYNX_CFG_FILE, or WWW_HOME variables.
  *
  * Note that any SUFFIX or VIEWER mappings in the configuration
- * file will be overidden by any suffix or viewer mappings
+ * file will be overridden by any suffix or viewer mappings
  * that are established as defaults in src/HTInit.c.  You can
  * override the src/HTInit.c defaults via the mime.types and
  * mailcap files (see the examples in the samples directory).
@@ -542,7 +542,7 @@
 
 /*********************
  * LOCAL_DOMAIN is used for a tail match with the ut_host element of
- * the utmp or utmpx structure on systems with utmp capabilites, to
+ * the utmp or utmpx structure on systems with utmp capabilities, to
  * determine if a user is local to your campus or organization when
  * handling -restrictions=inside_foo or outside_foo settings for ftp,
  * news, telnet/tn3270 and rlogin URLs.  An "inside" user is assumed
@@ -599,7 +599,7 @@
 
 /********************************
  * CHARACTER_SET defines the default character set, i.e., that assumed
- * to be installed on the user's termimal.  It determines which characters
+ * to be installed on the user's terminal.  It determines which characters
  * or strings will be used to represent 8-bit character entities within
  * HTML.  New character sets may be defined as explained in the README
  * files of the src/chrtrans directory in the Lynx source code distribution.
@@ -662,7 +662,7 @@
  * PREFERRED_LANGUAGE is the language in MIME notation (e.g., "en",
  * "fr") which will be indicated by Lynx in its Accept-Language headers
  * as the preferred language.  If available, the document will be
- * transmitted in that language.  This definition can be overriden via
+ * transmitted in that language.  This definition can be overridden via
  * lynx.cfg.  Users also can change it via the 'o'ptions menu and save
  * that preference in their RC file. This may be a comma-separated list
  * of languages in decreasing preference.
@@ -673,7 +673,7 @@
  * PREFERRED_CHARSET specifies the character set in MIME notation (e.g.,
  * "ISO-8859-2", "ISO-8859-5") which Lynx will indicate you prefer in
  * requests to http servers using an Accept-Charsets header.
- * This definition can be overriden via lynx.cfg.  Users also can change it
+ * This definition can be overridden via lynx.cfg.  Users also can change it
  * via the 'o'ptions menu and save that preference in their RC file.
  * The value should NOT include "ISO-8859-1" or "US-ASCII", since those
  * values are always assumed by default.
@@ -818,15 +818,15 @@
  */
 #define SET_COOKIES TRUE
 
-/******************************* 
- * If EAT_ALL_COOKIES is set TRUE, and SET_COOKIES is TRUE, lynx will accept 
- * all cookies. 
- * 
- * The default defined here can be changed in lynx.cfg, and .lynxrc, or 
- * specified with the -eat_all_cookies command line switch. 
- */ 
-#define EAT_ALL_COOKIES FALSE 
- 
+/*******************************
+ * If ACCEPT_ALL_COOKIES is set TRUE, and SET_COOKIES is TRUE, Lynx will
+ * accept all cookies.
+ *
+ * The default defined here can be changed in lynx.cfg, and .lynxrc, or
+ * toggled via the -accept_all_cookies command line switch.
+ */
+#define ACCEPT_ALL_COOKIES FALSE
+
 
 /****************************************************************
  *   Section 2.   Things that you probably want to change or review
@@ -878,15 +878,15 @@
 
 /******************************
 * VERBOSE_IMAGES controls whether or not Lynx replaces the [LINK], [INLINE] and
-* [IMAGE] comments (for images without ALT) with filenames of these images. 
+* [IMAGE] comments (for images without ALT) with filenames of these images.
 * This is extremely useful because now we can determine immediately what images
-* are just decorations (button.gif, line.gif) and what images are important. 
-* 
-* The default defined here can be changed in lynx.cfg. 
-*/ 
-#define VERBOSE_IMAGES FALSE 
- 
-/****************************** 
+* are just decorations (button.gif, line.gif) and what images are important.
+*
+* The default defined here can be changed in lynx.cfg.
+*/
+#define VERBOSE_IMAGES FALSE
+
+/******************************
  * BOXVERT and BOXHORI control the layout of popup menus.  Set to 0 if your
  * curses supports line-drawing characters, set to '*' or any other character
  * to not use line-drawing (e.g., '|' for vertical and '-' for horizontal).
@@ -1083,7 +1083,7 @@
  * performed if Lynx has been invoked with the -restrictions=mail switch.
  *
  *  VMS USERS !!!
- * New mail is normally broadcast as it arrives, via "unsolicitied screen
+ * New mail is normally broadcast as it arrives, via "unsolicited screen
  * broadcasts", which can be "wiped" from the Lynx display via the Ctrl-W
  * command.  You may prefer to disable the broadcasts and use CHECKMAIL
  * instead (e.g., in a public account which will be used by people who
@@ -1183,7 +1183,7 @@
 
 /********************************
  * These definitions specify files created or used in conjunction
- * with traversals.  See CRAWL.ANNOUNCE for more infomation.
+ * with traversals.  See CRAWL.ANNOUNCE for more information.
  */
 #define TRAVERSE_FILE "traverse.dat"
 #define TRAVERSE_FOUND_FILE "traverse2.dat"
@@ -1211,7 +1211,7 @@
  * the version definition with the Project Version on checkout. Just
  * ignore it. - kw */
 /* $Format: "#define LYNX_VERSION \"$ProjectVersion$\""$ */
-#define LYNX_VERSION "2.8.1dev.19"
+#define LYNX_VERSION "2.8.1dev.20"
 
 #ifndef MAXINT
 #define MAXINT 2147483647	/* max integer */