about summary refs log tree commit diff stats
path: root/WWW/Library
diff options
context:
space:
mode:
Diffstat (limited to 'WWW/Library')
-rw-r--r--WWW/Library/Implementation/HTAABrow.c1144
-rw-r--r--WWW/Library/Implementation/HTAABrow.h124
-rw-r--r--WWW/Library/Implementation/HTAAProt.c736
-rw-r--r--WWW/Library/Implementation/HTAAProt.h332
-rw-r--r--WWW/Library/Implementation/HTAAUtil.c657
-rw-r--r--WWW/Library/Implementation/HTAAUtil.h396
-rw-r--r--WWW/Library/Implementation/HTAccess.c1130
-rw-r--r--WWW/Library/Implementation/HTAccess.h123
-rw-r--r--WWW/Library/Implementation/HTAnchor.c1001
-rw-r--r--WWW/Library/Implementation/HTAnchor.h514
-rw-r--r--WWW/Library/Implementation/HTAssoc.c62
-rw-r--r--WWW/Library/Implementation/HTAssoc.h19
-rw-r--r--WWW/Library/Implementation/HTAtom.c122
-rw-r--r--WWW/Library/Implementation/HTAtom.h46
-rw-r--r--WWW/Library/Implementation/HTBTree.c847
-rw-r--r--WWW/Library/Implementation/HTBTree.h40
-rw-r--r--WWW/Library/Implementation/HTCJK.h138
-rw-r--r--WWW/Library/Implementation/HTChunk.c160
-rw-r--r--WWW/Library/Implementation/HTChunk.h45
-rw-r--r--WWW/Library/Implementation/HTDOS.c114
-rw-r--r--WWW/Library/Implementation/HTDOS.h51
-rw-r--r--WWW/Library/Implementation/HTFTP.c3015
-rw-r--r--WWW/Library/Implementation/HTFTP.h49
-rw-r--r--WWW/Library/Implementation/HTFWriter.c288
-rw-r--r--WWW/Library/Implementation/HTFWriter.h16
-rw-r--r--WWW/Library/Implementation/HTFile.c2128
-rw-r--r--WWW/Library/Implementation/HTFile.h405
-rw-r--r--WWW/Library/Implementation/HTFinger.c229
-rw-r--r--WWW/Library/Implementation/HTFinger.h14
-rw-r--r--WWW/Library/Implementation/HTFormat.c1382
-rw-r--r--WWW/Library/Implementation/HTFormat.h319
-rw-r--r--WWW/Library/Implementation/HTGopher.c1362
-rw-r--r--WWW/Library/Implementation/HTGopher.h2
-rw-r--r--WWW/Library/Implementation/HTGroup.c546
-rw-r--r--WWW/Library/Implementation/HTGroup.h93
-rw-r--r--WWW/Library/Implementation/HTInit.h16
-rw-r--r--WWW/Library/Implementation/HTLex.c153
-rw-r--r--WWW/Library/Implementation/HTLex.h31
-rw-r--r--WWW/Library/Implementation/HTList.c217
-rw-r--r--WWW/Library/Implementation/HTList.h147
-rw-r--r--WWW/Library/Implementation/HTMIME.c1242
-rw-r--r--WWW/Library/Implementation/HTMIME.h85
-rw-r--r--WWW/Library/Implementation/HTMLDTD.c416
-rw-r--r--WWW/Library/Implementation/HTMLDTD.h305
-rw-r--r--WWW/Library/Implementation/HTMLGen.c539
-rw-r--r--WWW/Library/Implementation/HTMLGen.h9
-rw-r--r--WWW/Library/Implementation/HTNews.c1749
-rw-r--r--WWW/Library/Implementation/HTNews.h41
-rw-r--r--WWW/Library/Implementation/HTParse.c826
-rw-r--r--WWW/Library/Implementation/HTParse.h286
-rw-r--r--WWW/Library/Implementation/HTPlain.c540
-rw-r--r--WWW/Library/Implementation/HTPlain.h7
-rw-r--r--WWW/Library/Implementation/HTRules.c635
-rw-r--r--WWW/Library/Implementation/HTRules.h57
-rw-r--r--WWW/Library/Implementation/HTStream.h62
-rw-r--r--WWW/Library/Implementation/HTString.c804
-rw-r--r--WWW/Library/Implementation/HTString.h100
-rw-r--r--WWW/Library/Implementation/HTStyle.c328
-rw-r--r--WWW/Library/Implementation/HTStyle.h270
-rw-r--r--WWW/Library/Implementation/HTTCP.c1613
-rw-r--r--WWW/Library/Implementation/HTTCP.h130
-rw-r--r--WWW/Library/Implementation/HTTP.c3192
-rw-r--r--WWW/Library/Implementation/HTTP.h9
-rw-r--r--WWW/Library/Implementation/HTTelnet.c718
-rw-r--r--WWW/Library/Implementation/HTTelnet.h7
-rw-r--r--WWW/Library/Implementation/HTUU.c257
-rw-r--r--WWW/Library/Implementation/HTUU.h25
-rw-r--r--WWW/Library/Implementation/HTUtils.h118
-rw-r--r--WWW/Library/Implementation/HTVMSUtils.c1378
-rw-r--r--WWW/Library/Implementation/HTVMSUtils.h136
-rw-r--r--WWW/Library/Implementation/HTVMS_WaisProt.c3627
-rw-r--r--WWW/Library/Implementation/HTVMS_WaisProt.h489
-rw-r--r--WWW/Library/Implementation/HTVMS_WaisUI.c2806
-rw-r--r--WWW/Library/Implementation/HTVMS_WaisUI.h547
-rw-r--r--WWW/Library/Implementation/HTWAIS.c768
-rw-r--r--WWW/Library/Implementation/HTWAIS.h3
-rw-r--r--WWW/Library/Implementation/HTWSRC.c365
-rw-r--r--WWW/Library/Implementation/HTWSRC.h29
-rw-r--r--WWW/Library/Implementation/HText.h147
-rw-r--r--WWW/Library/Implementation/HTioctl.h6
-rw-r--r--WWW/Library/Implementation/LYLeaks.h283
-rw-r--r--WWW/Library/Implementation/LYexit.h6
-rw-r--r--WWW/Library/Implementation/SGML.c3057
-rw-r--r--WWW/Library/Implementation/SGML.h274
-rw-r--r--WWW/Library/Implementation/UCAux.h57
-rw-r--r--WWW/Library/Implementation/UCDefs.h53
-rw-r--r--WWW/Library/Implementation/UCMap.h71
-rw-r--r--WWW/Library/Implementation/www_tcp.h164
88 files changed, 23180 insertions, 23669 deletions
diff --git a/WWW/Library/Implementation/HTAABrow.c b/WWW/Library/Implementation/HTAABrow.c
index bc738e7a..38c90a29 100644
--- a/WWW/Library/Implementation/HTAABrow.c
+++ b/WWW/Library/Implementation/HTAABrow.c
@@ -1,149 +1,151 @@
 
 /* MODULE							HTAABrow.c
-**		BROWSER SIDE ACCESS AUTHORIZATION MODULE
-**
-**	Contains the code for keeping track on server hostnames,
-**	port numbers, scheme names, usernames, passwords
-**	(and servers' public keys).
-**
-** IMPORTANT:
-**	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.
-**
-**	The AA package does not free() anything else than what
-**	it has itself allocated.
-**
-** AUTHORS:
-**	AL	Ari Luotonen	luotonen@dxcern.cern.ch
-**
-** HISTORY:
-**	Oct 17	AL	Made corrections suggested by marca:
-**			Added  if (!realm->username) return NULL;
-**			Changed some ""s to NULLs.
-**			Now doing calloc() to init uuencode source;
-**			otherwise HTUU_encode() reads uninitialized memory
-**			every now and then (not a real bug but not pretty).
-**			Corrected the formula for uuencode destination size.
-**
-** 28 Apr 1997	AJL	Do Proxy Authorisation.
-**
-** BUGS:
-**
-**
-*/
+ *		BROWSER SIDE ACCESS AUTHORIZATION MODULE
+ *
+ *	Contains the code for keeping track on server hostnames,
+ *	port numbers, scheme names, usernames, passwords
+ *	(and servers' public keys).
+ *
+ * IMPORTANT:
+ *	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.
+ *
+ *	The AA package does not free() anything else than what
+ *	it has itself allocated.
+ *
+ * AUTHORS:
+ *	AL	Ari Luotonen	luotonen@dxcern.cern.ch
+ *
+ * HISTORY:
+ *	Oct 17	AL	Made corrections suggested by marca:
+ *			Added  if (!realm->username) return NULL;
+ *			Changed some ""s to NULLs.
+ *			Now doing calloc() to init uuencode source;
+ *			otherwise HTUU_encode() reads uninitialized memory
+ *			every now and then (not a real bug but not pretty).
+ *			Corrected the formula for uuencode destination size.
+ *
+ * 28 Apr 1997	AJL	Do Proxy Authorisation.
+ *
+ * BUGS:
+ *
+ *
+ */
 
 #include <HTUtils.h>
 #include <HTString.h>
-#include <HTParse.h>		/* URL parsing function		*/
-#include <HTList.h>		/* HTList object		*/
-#include <HTAlert.h>		/* HTConfirm(), HTPrompt()	*/
-#include <HTAAUtil.h>		/* AA common to both sides	*/
-#include <HTAssoc.h>		/* Assoc list			*/
+#include <HTParse.h>		/* URL parsing function         */
+#include <HTList.h>		/* HTList object                */
+#include <HTAlert.h>		/* HTConfirm(), HTPrompt()      */
+#include <HTAAUtil.h>		/* AA common to both sides      */
+#include <HTAssoc.h>		/* Assoc list                   */
 #include <HTAccess.h>		/* Are we using an HTTP gateway? */
-#include <HTAABrow.h>		/* Implemented here		*/
-#include <HTUU.h>		/* Uuencoding and uudecoding	*/
+#include <HTAABrow.h>		/* Implemented here             */
+#include <HTUU.h>		/* Uuencoding and uudecoding    */
 
 #include <LYLeaks.h>
 
 /*
-**  Local datatype definitions
-**
-**  HTAAServer contains all the information about one server.
-*/
+ *  Local datatype definitions
+ *
+ *  HTAAServer contains all the information about one server.
+ */
 typedef struct {
 
-    char *	hostname;	/* Host's name			*/
-    int		portnumber;	/* Port number			*/
-    BOOL	IsProxy;	/* Is it a proxy?		*/
-    HTList *	setups;		/* List of protection setups	*/
-				/* on this server; i.e., valid	*/
-				/* authentication schemes and	*/
-				/* templates when to use them.	*/
-				/* This is actually a list of	*/
-				/* HTAASetup objects.		*/
-    HTList *	realms;		/* Information about passwords	*/
+    char *hostname;		/* Host's name                  */
+    int portnumber;		/* Port number                  */
+    BOOL IsProxy;		/* Is it a proxy?               */
+    HTList *setups;		/* List of protection setups 
+				   on this server; i.e., valid
+				   authentication schemes and
+				   templates when to use them.
+				   This is actually a list of
+				   HTAASetup objects.           */
+    HTList *realms;		/* Information about passwords  */
 } HTAAServer;
 
 /*
-**  HTAASetup contains information about one server's one
-**  protected tree of documents.
-*/
+ *  HTAASetup contains information about one server's one
+ *  protected tree of documents.
+ */
 typedef struct {
-    HTAAServer *server;		/* Which server serves this tree	     */
-    char *	template;	/* Template for this tree		     */
-    HTList *	valid_schemes;	/* Valid authentic.schemes		     */
-    HTAssocList**scheme_specifics;/* Scheme specific params		     */
-    BOOL	retry;		/* Failed last time -- reprompt (or whatever)*/
+    HTAAServer *server;		/* Which server serves this tree             */
+    char *template;		/* Template for this tree                    */
+    HTList *valid_schemes;	/* Valid authentic.schemes                   */
+    HTAssocList **scheme_specifics;	/* Scheme specific params                  */
+    BOOL retry;			/* Failed last time -- reprompt (or whatever) */
 } HTAASetup;
 
 /*
-**  Information about usernames and passwords in
-**  Basic and Pubkey authentication schemes;
-*/
+ *  Information about usernames and passwords in
+ *  Basic and Pubkey authentication schemes;
+ */
 typedef struct {
-    char *	realmname;	/* Password domain name		*/
-    char *	username;	/* Username in that domain	*/
-    char *	password;	/* Corresponding password	*/
+    char *realmname;		/* Password domain name         */
+    char *username;		/* Username in that domain      */
+    char *password;		/* Corresponding password       */
 } HTAARealm;
 
 /*
-**  To free off all globals. - FM
-*/
-static void free_HTAAGlobals (void);
+ *  To free off all globals. - FM
+ */
+static void free_HTAAGlobals(void);
 static BOOL free_HTAAGlobalsSet = FALSE;
 static char *HTAA_composeAuthResult = NULL;
 static char *compose_auth_stringResult = NULL;	/* Uuencoded presentation */
 
 /*
-**  Module-wide global variables
-*/
-static HTList *server_table	= NULL;	/* Browser's info about servers	     */
-static char *secret_key	= NULL;	/* Browser's latest secret key       */
-static HTAASetup *current_setup= NULL;	/* The server setup we are currently */
-					/* talking to			     */
-static char *current_hostname	= NULL;	/* The server's name and portnumber  */
-static int current_portnumber	= 80;	/* where we are currently trying to  */
-					/* connect.			     */
-static char *current_docname	= NULL; /* The document's name we are	     */
-					/* trying to access.		     */
-static char *HTAAForwardAuth	= NULL;	/* Authorization: line to forward    */
-					/* (used by gateway httpds)	     */
-static HTAASetup *proxy_setup	= NULL;	/* Same as above, but for Proxy -AJL */
-static char *proxy_hostname	= NULL;
-static char *proxy_docname	= NULL;
-static int proxy_portnumber	= 80;
+ *  Module-wide global variables
+ */
+static HTList *server_table = NULL;	/* Browser's info about servers      */
+static char *secret_key = NULL;	/* Browser's latest secret key       */
+static HTAASetup *current_setup = NULL;		/* The server setup we are currently */
 
+					/* talking to                        */
+static char *current_hostname = NULL;	/* The server's name and portnumber  */
+static int current_portnumber = 80;	/* where we are currently trying to  */
+
+					/* connect.                          */
+static char *current_docname = NULL;	/* The document's name we are        */
+
+					/* trying to access.                 */
+static char *HTAAForwardAuth = NULL;	/* Authorization: line to forward    */
+
+					/* (used by gateway httpds)          */
+static HTAASetup *proxy_setup = NULL;	/* Same as above, but for Proxy -AJL */
+static char *proxy_hostname = NULL;
+static char *proxy_docname = NULL;
+static int proxy_portnumber = 80;
 
 /*** HTAAForwardAuth for enabling gateway-httpds to forward Authorization ***/
 
-void HTAAForwardAuth_set (
-	const char *	scheme_name,
-	const char *	scheme_specifics)
+void HTAAForwardAuth_set(const char *scheme_name,
+			 const char *scheme_specifics)
 {
-    int len = 20 + (scheme_name      ? strlen(scheme_name)      : 0)
-		 + (scheme_specifics ? strlen(scheme_specifics) : 0);
+    int len = 20 + (scheme_name ? strlen(scheme_name) : 0)
+    + (scheme_specifics ? strlen(scheme_specifics) : 0);
 
     FREE(HTAAForwardAuth);
     if ((HTAAForwardAuth = typecallocn(char, len)) == 0)
-	outofmem(__FILE__, "HTAAForwardAuth_set");
+	  outofmem(__FILE__, "HTAAForwardAuth_set");
 
     strcpy(HTAAForwardAuth, "Authorization: ");
     if (scheme_name) {
@@ -155,47 +157,45 @@ void HTAAForwardAuth_set (
     }
 }
 
-void HTAAForwardAuth_reset (void)
+void HTAAForwardAuth_reset(void)
 {
     FREE(HTAAForwardAuth);
 }
 
-
 /**************************** HTAAServer ***********************************/
 
-static void HTAASetup_delete (HTAASetup * killme);	/* Forward */
+static void HTAASetup_delete(HTAASetup * killme);	/* Forward */
 
 /* static						HTAAServer_new()
-**		ALLOCATE A NEW NODE TO HOLD SERVER INFO
-**		AND ADD IT TO THE LIST OF SERVERS
-** ON ENTRY:
-**	hostname	is the name of the host that the server
-**			is running in.
-**	portnumber	is the portnumber which the server listens.
-**	IsProxy		should be TRUE if this is a proxy.
-**
-** ON EXIT:
-**	returns		the newly-allocated node with all the strings
-**			duplicated.
-**			Strings will be automatically freed by
-**			the function HTAAServer_delete(), which also
-**			frees the node itself.
-*/
-static HTAAServer *HTAAServer_new (
-	const char*	hostname,
-	int		portnumber,
-	BOOL		IsProxy)
+ *		ALLOCATE A NEW NODE TO HOLD SERVER INFO
+ *		AND ADD IT TO THE LIST OF SERVERS
+ * ON ENTRY:
+ *	hostname	is the name of the host that the server
+ *			is running in.
+ *	portnumber	is the portnumber which the server listens.
+ *	IsProxy		should be TRUE if this is a proxy.
+ *
+ * ON EXIT:
+ *	returns		the newly-allocated node with all the strings
+ *			duplicated.
+ *			Strings will be automatically freed by
+ *			the function HTAAServer_delete(), which also
+ *			frees the node itself.
+ */
+static HTAAServer *HTAAServer_new(const char *hostname,
+				  int portnumber,
+				  BOOL IsProxy)
 {
     HTAAServer *server;
 
     if ((server = typecalloc(HTAAServer)) == 0)
-	outofmem(__FILE__, "HTAAServer_new");
+	  outofmem(__FILE__, "HTAAServer_new");
 
-    server->hostname	= NULL;
-    server->portnumber	= (portnumber > 0 ? portnumber : 80);
-    server->IsProxy	= IsProxy;
-    server->setups	= HTList_new();
-    server->realms	= HTList_new();
+    server->hostname = NULL;
+    server->portnumber = (portnumber > 0 ? portnumber : 80);
+    server->IsProxy = IsProxy;
+    server->setups = HTList_new();
+    server->realms = HTList_new();
 
     if (hostname)
 	StrAllocCopy(server->hostname, hostname);
@@ -203,25 +203,23 @@ static HTAAServer *HTAAServer_new (
     if (!server_table)
 	server_table = HTList_new();
 
-    HTList_addObject(server_table, (void*)server);
+    HTList_addObject(server_table, (void *) server);
 
     return server;
 }
 
-
 /* static						HTAAServer_delete()
-**
-**	DELETE THE ENTRY FOR THE SERVER FROM THE HOST TABLE,
-**	AND FREE THE MEMORY USED BY IT.
-**
-** ON ENTRY:
-**	killme		points to the HTAAServer to be freed.
-**
-** ON EXIT:
-**	returns		nothing.
-*/
-static void HTAAServer_delete (
-	HTAAServer *	killme)
+ *
+ *	DELETE THE ENTRY FOR THE SERVER FROM THE HOST TABLE,
+ *	AND FREE THE MEMORY USED BY IT.
+ *
+ * ON ENTRY:
+ *	killme		points to the HTAAServer to be freed.
+ *
+ * ON EXIT:
+ *	returns		nothing.
+ */
+static void HTAAServer_delete(HTAAServer *killme)
 {
     int n, i;
     HTAASetup *setup;
@@ -232,8 +230,8 @@ static void HTAAServer_delete (
 	if (killme->setups != NULL) {
 	    n = HTList_count(killme->setups);
 	    for (i = (n - 1); i >= 0; i--) {
-		if ((setup = (HTAASetup*)HTList_objectAt(killme->setups,
-							 i)) != NULL) {
+		if ((setup = (HTAASetup *) HTList_objectAt(killme->setups,
+							   i)) != NULL) {
 		    HTAASetup_delete(setup);
 		    setup = NULL;
 		}
@@ -243,7 +241,7 @@ static void HTAAServer_delete (
 	}
 
 	cur = killme->realms;
-	while (NULL != (realm = (HTAARealm*)HTList_nextObject(cur))) {
+	while (NULL != (realm = (HTAARealm *) HTList_nextObject(cur))) {
 	    FREE(realm->realmname);
 	    FREE(realm->username);
 	    FREE(realm->password);
@@ -254,29 +252,28 @@ static void HTAAServer_delete (
 
 	FREE(killme->hostname);
 
-	HTList_removeObject(server_table, (void*)killme);
+	HTList_removeObject(server_table, (void *) killme);
 	FREE(killme);
     }
 }
 
 /* static						HTAAServer_lookup()
-**		LOOK UP SERVER BY HOSTNAME AND PORTNUMBER
-** ON ENTRY:
-**	hostname	obvious.
-**	portnumber	if non-positive defaults to 80.
-**	IsProxy		should be TRUE if this is a proxy.
-**
-**	Looks up the server in the module-global server_table.
-**
-** ON EXIT:
-**	returns		pointer to a HTAAServer structure
-**			representing the looked-up server.
-**			NULL, if not found.
-*/
-static HTAAServer *HTAAServer_lookup (
-	const char *	hostname,
-	int		portnumber,
-	BOOL		IsProxy)
+ *		LOOK UP SERVER BY HOSTNAME AND PORTNUMBER
+ * ON ENTRY:
+ *	hostname	obvious.
+ *	portnumber	if non-positive defaults to 80.
+ *	IsProxy		should be TRUE if this is a proxy.
+ *
+ *	Looks up the server in the module-global server_table.
+ *
+ * ON EXIT:
+ *	returns		pointer to a HTAAServer structure
+ *			representing the looked-up server.
+ *			NULL, if not found.
+ */
+static HTAAServer *HTAAServer_lookup(const char *hostname,
+				     int portnumber,
+				     BOOL IsProxy)
 {
     if (hostname) {
 	HTList *cur = server_table;
@@ -285,46 +282,44 @@ static HTAAServer *HTAAServer_lookup (
 	if (portnumber <= 0)
 	    portnumber = 80;
 
-	while (NULL != (server = (HTAAServer*)HTList_nextObject(cur))) {
-	    if (server->portnumber == portnumber  &&
-		0==strcmp(server->hostname, hostname) &&
+	while (NULL != (server = (HTAAServer *) HTList_nextObject(cur))) {
+	    if (server->portnumber == portnumber &&
+		0 == strcmp(server->hostname, hostname) &&
 		server->IsProxy == IsProxy)
 		return server;
 	}
     }
-    return NULL;	/* NULL parameter, or not found */
+    return NULL;		/* NULL parameter, or not found */
 }
 
-
 /*************************** HTAASetup *******************************/
 
 /* static						HTAASetup_lookup()
-**	FIGURE OUT WHICH AUTHENTICATION SETUP THE SERVER
-**	IS USING FOR A GIVEN FILE ON A GIVEN HOST AND PORT
-**
-** ON ENTRY:
-**	hostname	is the name of the server host machine.
-**	portnumber	is the port that the server is running in.
-**	docname		is the (URL-)pathname of the document we
-**			are trying to access.
-**	IsProxy		should be TRUE if this is a proxy.
-**
-**	This function goes through the information known about
-**	all the setups of the server, and finds out if the given
-**	filename resides in one of the protected directories.
-**
-** ON EXIT:
-**	returns		NULL if no match.
-**			Otherwise, a HTAASetup structure representing
-**			the protected server setup on the corresponding
-**			document tree.
-**
-*/
-static HTAASetup *HTAASetup_lookup (
-	const char *	hostname,
-	int		portnumber,
-	const char *	docname,
-	BOOL		IsProxy)
+ *	FIGURE OUT WHICH AUTHENTICATION SETUP THE SERVER
+ *	IS USING FOR A GIVEN FILE ON A GIVEN HOST AND PORT
+ *
+ * ON ENTRY:
+ *	hostname	is the name of the server host machine.
+ *	portnumber	is the port that the server is running in.
+ *	docname		is the (URL-)pathname of the document we
+ *			are trying to access.
+ *	IsProxy		should be TRUE if this is a proxy.
+ *
+ *	This function goes through the information known about
+ *	all the setups of the server, and finds out if the given
+ *	filename resides in one of the protected directories.
+ *
+ * ON EXIT:
+ *	returns		NULL if no match.
+ *			Otherwise, a HTAASetup structure representing
+ *			the protected server setup on the corresponding
+ *			document tree.
+ *
+ */
+static HTAASetup *HTAASetup_lookup(const char *hostname,
+				   int portnumber,
+				   const char *docname,
+				   BOOL IsProxy)
 {
     HTAAServer *server;
     HTAASetup *setup;
@@ -340,56 +335,54 @@ static HTAASetup *HTAASetup_lookup (
 	HTList *cur = server->setups;
 
 	CTRACE((tfp, "%s %s (%s:%d:%s)\n",
-		    "HTAASetup_lookup: resolving setup for",
-		    (IsProxy ? "proxy" : "server"),
-		    hostname, portnumber, docname));
+		"HTAASetup_lookup: resolving setup for",
+		(IsProxy ? "proxy" : "server"),
+		hostname, portnumber, docname));
 
-	while (NULL != (setup = (HTAASetup*)HTList_nextObject(cur))) {
+	while (NULL != (setup = (HTAASetup *) HTList_nextObject(cur))) {
 	    if (HTAA_templateMatch(setup->template, docname)) {
 		CTRACE((tfp, "%s `%s' %s `%s'\n",
-			    "HTAASetup_lookup:", docname,
-			    "matched template", setup->template));
+			"HTAASetup_lookup:", docname,
+			"matched template", setup->template));
 		return setup;
 	    } else {
 		CTRACE((tfp, "%s `%s' %s `%s'\n",
-			    "HTAASetup_lookup:", docname,
-			    "did NOT match template", setup->template));
+			"HTAASetup_lookup:", docname,
+			"did NOT match template", setup->template));
 	    }
-	} /* while setups remain */
-    } /* if valid parameters and server found */
-
+	}			/* while setups remain */
+    }
+    /* if valid parameters and server found */
     CTRACE((tfp, "%s `%s' %s\n",
-		 "HTAASetup_lookup: No template matched",
-		 NONNULL(docname),
-		 "(so probably not protected)"));
+	    "HTAASetup_lookup: No template matched",
+	    NONNULL(docname),
+	    "(so probably not protected)"));
 
-    return NULL;	/* NULL in parameters, or not found */
+    return NULL;		/* NULL in parameters, or not found */
 }
 
 /* static						HTAASetup_new()
-**			CREATE A NEW SETUP NODE
-** ON ENTRY:
-**	server		is a pointer to a HTAAServer structure
-**			to which this setup belongs.
-**	template	documents matching this template
-**			are protected according to this setup.
-**	valid_schemes	a list containing all valid authentication
-**			schemes for this setup.
-**			If NULL, all schemes are disallowed.
-**	scheme_specifics is an array of assoc lists, which
-**			contain scheme specific parameters given
-**			by server in Authenticate: fields.
-**			If NULL, all scheme specifics are
-**			set to NULL.
-** ON EXIT:
-**	returns		a new HTAASetup node, and also adds it as
-**			part of the HTAAServer given as parameter.
-*/
-static HTAASetup *HTAASetup_new (
-	HTAAServer *	server,
-	char *		template,
-	HTList *	valid_schemes,
-	HTAssocList **	scheme_specifics)
+ *			CREATE A NEW SETUP NODE
+ * ON ENTRY:
+ *	server		is a pointer to a HTAAServer structure
+ *			to which this setup belongs.
+ *	template	documents matching this template
+ *			are protected according to this setup.
+ *	valid_schemes	a list containing all valid authentication
+ *			schemes for this setup.
+ *			If NULL, all schemes are disallowed.
+ *	scheme_specifics is an array of assoc lists, which
+ *			contain scheme specific parameters given
+ *			by server in Authenticate: fields.
+ *			If NULL, all scheme specifics are
+ *			set to NULL.
+ * ON EXIT:
+ *	returns		a new HTAASetup node, and also adds it as
+ *			part of the HTAAServer given as parameter.
+ */
+static HTAASetup *HTAASetup_new(HTAAServer *server, char *template,
+				HTList *valid_schemes,
+				HTAssocList **scheme_specifics)
 {
     HTAASetup *setup;
 
@@ -407,21 +400,20 @@ static HTAASetup *HTAASetup_new (
     setup->valid_schemes = valid_schemes;
     setup->scheme_specifics = scheme_specifics;
 
-    HTList_addObject(server->setups, (void*)setup);
+    HTList_addObject(server->setups, (void *) setup);
 
     return setup;
 }
 
 /* static						HTAASetup_delete()
-**			FREE A HTAASetup STRUCTURE
-** ON ENTRY:
-**	killme		is a pointer to the structure to free().
-**
-** ON EXIT:
-**	returns		nothing.
-*/
-static void HTAASetup_delete (
-	HTAASetup *	killme)
+ *			FREE A HTAASetup STRUCTURE
+ * ON ENTRY:
+ *	killme		is a pointer to the structure to free().
+ *
+ * ON EXIT:
+ *	returns		nothing.
+ */
+static void HTAASetup_delete(HTAASetup * killme)
 {
     int scheme;
 
@@ -440,21 +432,19 @@ static void HTAASetup_delete (
 }
 
 /* static					HTAASetup_updateSpecifics()
-*		COPY SCHEME SPECIFIC PARAMETERS
-**		TO HTAASetup STRUCTURE
-** ON ENTRY:
-**	setup		destination setup structure.
-**	specifics	string array containing scheme
-**			specific parameters for each scheme.
-**			If NULL, all the scheme specific
-**			parameters are set to NULL.
-**
-** ON EXIT:
-**	returns		nothing.
-*/
-static void HTAASetup_updateSpecifics (
-	HTAASetup *	setup,
-	HTAssocList **	specifics)
+ *		COPY SCHEME SPECIFIC PARAMETERS
+ *		TO HTAASetup STRUCTURE
+ * ON ENTRY:
+ *	setup		destination setup structure.
+ *	specifics	string array containing scheme
+ *			specific parameters for each scheme.
+ *			If NULL, all the scheme specific
+ *			parameters are set to NULL.
+ *
+ * ON EXIT:
+ *	returns		nothing.
+ */
+static void HTAASetup_updateSpecifics(HTAASetup * setup, HTAssocList **specifics)
 {
     int scheme;
 
@@ -470,54 +460,51 @@ static void HTAASetup_updateSpecifics (
     }
 }
 
-
 /*************************** HTAARealm **********************************/
 
 /* static						HTAARealm_lookup()
-**		LOOKUP HTAARealm STRUCTURE BY REALM NAME
-** ON ENTRY:
-**	realm_table	a list of realm objects.
-**	realmname	is the name of realm to look for.
-**
-** ON EXIT:
-**	returns		the realm.  NULL, if not found.
-*/
-static HTAARealm *HTAARealm_lookup (
-	HTList *	realm_table,
-	const char *	realmname)
+ *		LOOKUP HTAARealm STRUCTURE BY REALM NAME
+ * ON ENTRY:
+ *	realm_table	a list of realm objects.
+ *	realmname	is the name of realm to look for.
+ *
+ * ON EXIT:
+ *	returns		the realm.  NULL, if not found.
+ */
+static HTAARealm *HTAARealm_lookup(HTList *realm_table,
+				   const char *realmname)
 {
     if (realm_table && realmname) {
 	HTList *cur = realm_table;
 	HTAARealm *realm;
 
-	while (NULL != (realm = (HTAARealm*)HTList_nextObject(cur))) {
-	    if (0==strcmp(realm->realmname, realmname))
+	while (NULL != (realm = (HTAARealm *) HTList_nextObject(cur))) {
+	    if (0 == strcmp(realm->realmname, realmname))
 		return realm;
 	}
     }
-    return NULL;	/* No table, NULL param, or not found */
+    return NULL;		/* No table, NULL param, or not found */
 }
 
 /* static						HTAARealm_new()
-**		CREATE A NODE CONTAINING USERNAME AND
-**		PASSWORD USED FOR THE GIVEN REALM.
-**		IF REALM ALREADY EXISTS, CHANGE
-**		USERNAME/PASSWORD.
-** ON ENTRY:
-**	realm_table	a list of realms to where to add
-**			the new one, too.
-**	realmname	is the name of the password domain.
-**	username	and
-**	password	are what you can expect them to be.
-**
-** ON EXIT:
-**	returns		the created realm.
-*/
-static HTAARealm *HTAARealm_new (
-	HTList *	realm_table,
-	const char *	realmname,
-	const char *	username,
-	const char *	password)
+ *		CREATE A NODE CONTAINING USERNAME AND
+ *		PASSWORD USED FOR THE GIVEN REALM.
+ *		IF REALM ALREADY EXISTS, CHANGE
+ *		USERNAME/PASSWORD.
+ * ON ENTRY:
+ *	realm_table	a list of realms to where to add
+ *			the new one, too.
+ *	realmname	is the name of the password domain.
+ *	username	and
+ *	password	are what you can expect them to be.
+ *
+ * ON EXIT:
+ *	returns		the created realm.
+ */
+static HTAARealm *HTAARealm_new(HTList *realm_table,
+				const char *realmname,
+				const char *username,
+				const char *password)
 {
     HTAARealm *realm;
 
@@ -525,13 +512,14 @@ static HTAARealm *HTAARealm_new (
 
     if (!realm) {
 	if ((realm = typecalloc(HTAARealm)) == 0)
-	    outofmem(__FILE__, "HTAARealm_new");
+	      outofmem(__FILE__, "HTAARealm_new");
+
 	realm->realmname = NULL;
 	realm->username = NULL;
 	realm->password = NULL;
 	StrAllocCopy(realm->realmname, realmname);
 	if (realm_table)
-	    HTList_addObject(realm_table, (void*)realm);
+	    HTList_addObject(realm_table, (void *) realm);
     }
     if (username)
 	StrAllocCopy(realm->username, username);
@@ -541,34 +529,30 @@ static HTAARealm *HTAARealm_new (
     return realm;
 }
 
-
 /***************** Basic and Pubkey Authentication ************************/
 
 /* static						compose_auth_string()
-**
-**		COMPOSE Basic OR Pubkey AUTHENTICATION STRING;
-**		PROMPTS FOR USERNAME AND PASSWORD IF NEEDED
-**
-** ON ENTRY:
-**	scheme		is either HTAA_BASIC or HTAA_PUBKEY.
-**	setup		is the current server setup.
-**	IsProxy		should be TRUE if this is a proxy.
-**
-** ON EXIT:
-**	returns		a newly composed authorization string,
-**			(with, of course, a newly generated secret
-**			key and fresh timestamp, if Pubkey-scheme
-**			is being used).
-**			NULL, if something fails.
-** NOTE:
-**	Like throughout the entire AA package, no string or structure
-**	returned by AA package needs to (or should) be freed.
-**
-*/
-static char *compose_auth_string (
-	HTAAScheme	scheme,
-	HTAASetup *	setup,
-	BOOL		IsProxy)
+ *
+ *		COMPOSE Basic OR Pubkey AUTHENTICATION STRING;
+ *		PROMPTS FOR USERNAME AND PASSWORD IF NEEDED
+ *
+ * ON ENTRY:
+ *	scheme		is either HTAA_BASIC or HTAA_PUBKEY.
+ *	setup		is the current server setup.
+ *	IsProxy		should be TRUE if this is a proxy.
+ *
+ * ON EXIT:
+ *	returns		a newly composed authorization string,
+ *			(with, of course, a newly generated secret
+ *			key and fresh timestamp, if Pubkey-scheme
+ *			is being used).
+ *			NULL, if something fails.
+ * NOTE:
+ *	Like throughout the entire AA package, no string or structure
+ *	returned by AA package needs to (or should) be freed.
+ *
+ */
+static char *compose_auth_string(HTAAScheme scheme, HTAASetup * setup, BOOL IsProxy)
 {
     char *cleartext = NULL;	/* Cleartext presentation */
     char *ciphertext = NULL;	/* Encrypted presentation */
@@ -582,14 +566,13 @@ static char *compose_auth_string (
     char *thePort = NULL;
     HTAARealm *realm;
     char *i_net_addr = "0.0.0.0";	/* Change... @@@@ */
-    char *timestamp = "42";		/* ... these @@@@ */
-
+    char *timestamp = "42";	/* ... these @@@@ */
 
     FREE(compose_auth_stringResult);	/* From previous call */
 
     if ((scheme != HTAA_BASIC && scheme != HTAA_PUBKEY) || !setup ||
 	!setup->scheme_specifics || !setup->scheme_specifics[scheme] ||
-	!setup->server  ||  !setup->server->realms)
+	!setup->server || !setup->server->realms)
 	return NULL;
 
     realmname = HTAssocList_lookup(setup->scheme_specifics[scheme], "realm");
@@ -602,20 +585,18 @@ static char *compose_auth_string (
 	  realm->password) || setup->retry) {
 	if (!realm) {
 	    CTRACE((tfp, "%s `%s' %s\n",
-			"compose_auth_string: realm:", realmname,
-			"not found -- creating"));
+		    "compose_auth_string: realm:", realmname,
+		    "not found -- creating"));
 	    realm = HTAARealm_new(setup->server->realms,
 				  realmname, NULL, NULL);
 	}
 	/*
-	 *  The template should be either the '*' global
-	 *  for everything on the server (always true for
-	 *  proxy authorization setups), or a path for
-	 *  the start of a protected limb, with no host
-	 *  field, but we'll check for a host anyway in
-	 *  case a WWW-Protection-Template header set an
-	 *  absolute URL instead of a path.  If we do get
-	 *  a host from this, it will include the port. - FM
+	 * The template should be either the '*' global for everything on the
+	 * server (always true for proxy authorization setups), or a path for
+	 * the start of a protected limb, with no host field, but we'll check
+	 * for a host anyway in case a WWW-Protection-Template header set an
+	 * absolute URL instead of a path.  If we do get a host from this, it
+	 * will include the port.  - FM
 	 */
 	if ((!IsProxy) && using_proxy && setup->template) {
 	    proxiedHost = HTParse(setup->template, "", PARSE_HOST);
@@ -624,9 +605,8 @@ static char *compose_auth_string (
 	    }
 	}
 	/*
-	 *  If we didn't get a host field from the
-	 *  template, set up the host name and port
-	 *  from the setup->server elements. - FM
+	 * If we didn't get a host field from the template, set up the host
+	 * name and port from the setup->server elements.  - FM
 	 */
 	if (!theHost)
 	    theHost = setup->server->hostname;
@@ -635,20 +615,19 @@ static char *compose_auth_string (
 	    HTSprintf0(&thePort, ":%d", setup->server->portnumber);
 	}
 	/*
-	 *  Set up the message for the username prompt,
-	 *  and then issue the prompt.  The default
-	 *  username is included in the call to the
-	 *  prompting function, but the password is
-	 *  NULL-ed and always replaced. - FM
+	 * Set up the message for the username prompt, and then issue the
+	 * prompt.  The default username is included in the call to the
+	 * prompting function, but the password is NULL-ed and always replaced. 
+	 * - FM
 	 */
 	len = strlen(realm->realmname) +
-	      strlen(theHost ?
-		     theHost : "??") + 50;
+	    strlen(theHost ?
+		   theHost : "??") + 50;
 	HTSprintf0(&msg, gettext("Username for '%s' at %s '%s%s':"),
-		     realm->realmname,
-		     (IsProxy ? "proxy" : "server"),
-		     (theHost ? theHost : "??"),
-		     NonNull(thePort));
+		   realm->realmname,
+		   (IsProxy ? "proxy" : "server"),
+		   (theHost ? theHost : "??"),
+		   NonNull(thePort));
 	FREE(proxiedHost);
 	FREE(thePort);
 	username = realm->username;
@@ -663,12 +642,12 @@ static char *compose_auth_string (
 
 	if (!realm->username || !realm->password) {
 	    /*
-	     *  Signals to retry. - FM
+	     * Signals to retry.  - FM
 	     */
 	    return NULL;
 	} else if (*realm->username == '\0') {
 	    /*
-	     *  Signals to abort. - FM
+	     * Signals to abort.  - FM
 	     */
 	    StrAllocCopy(compose_auth_stringResult, "");
 	    return compose_auth_stringResult;
@@ -676,7 +655,7 @@ static char *compose_auth_string (
     }
 
     len = strlen(NonNull(realm->username)) +
-	  strlen(NonNull(realm->password)) + 3;
+	strlen(NonNull(realm->password)) + 3;
 
     if (scheme == HTAA_PUBKEY) {
 #ifdef PUBKEY
@@ -690,7 +669,7 @@ static char *compose_auth_string (
     }
 
     if ((cleartext = typecallocn(char, len)) == 0)
-	outofmem(__FILE__, "compose_auth_string");
+	  outofmem(__FILE__, "compose_auth_string");
 
     if (realm->username)
 	strcpy(cleartext, realm->username);
@@ -712,21 +691,22 @@ static char *compose_auth_string (
 	    strcat(cleartext, secret_key);
 
 	if (!((ciphertext = typecallocn(char, 2 * len)) &&
-	      (compose_auth_stringResult = typecallocn(char, 3 * len))))
-	    outofmem(__FILE__, "compose_auth_string");
+	        (compose_auth_stringResult = typecallocn(char, 3 * len))))
+	      outofmem(__FILE__, "compose_auth_string");
+
 #ifdef PUBKEY
 	HTPK_encrypt(cleartext, ciphertext, server->public_key);
-	HTUU_encode((unsigned char *)ciphertext, strlen(ciphertext),
+	HTUU_encode((unsigned char *) ciphertext, strlen(ciphertext),
 		    compose_auth_stringResult);
 #endif /* PUBKEY */
 	FREE(cleartext);
 	FREE(ciphertext);
-    }
-    else { /* scheme == HTAA_BASIC */
+    } else {			/* scheme == HTAA_BASIC */
 	if (!(compose_auth_stringResult =
-				typecallocn(char, (4 * ((len+2)/3)) + 1)))
-	    outofmem(__FILE__, "compose_auth_string");
-	HTUU_encode((unsigned char *)cleartext, strlen(cleartext),
+	      typecallocn(char, (4 * ((len + 2) / 3)) + 1)))
+	      outofmem(__FILE__, "compose_auth_string");
+
+	HTUU_encode((unsigned char *) cleartext, strlen(cleartext),
 		    compose_auth_stringResult);
 	FREE(cleartext);
     }
@@ -734,55 +714,54 @@ static char *compose_auth_string (
 }
 
 /* BROWSER static					HTAA_selectScheme()
-**		SELECT THE AUTHENTICATION SCHEME TO USE
-** ON ENTRY:
-**	setup	is the server setup structure which can
-**		be used to make the decision about the
-**		used scheme.
-**
-**	When new authentication methods are added to library
-**	this function makes the decision about which one to
-**	use at a given time.  This can be done by inspecting
-**	environment variables etc.
-**
-**	Currently only searches for the first valid scheme,
-**	and if nothing found suggests Basic scheme;
-**
-** ON EXIT:
-**	returns	the authentication scheme to use.
-*/
-static HTAAScheme HTAA_selectScheme (
-	HTAASetup *	setup)
+ *		SELECT THE AUTHENTICATION SCHEME TO USE
+ * ON ENTRY:
+ *	setup	is the server setup structure which can
+ *		be used to make the decision about the
+ *		used scheme.
+ *
+ *	When new authentication methods are added to library
+ *	this function makes the decision about which one to
+ *	use at a given time.  This can be done by inspecting
+ *	environment variables etc.
+ *
+ *	Currently only searches for the first valid scheme,
+ *	and if nothing found suggests Basic scheme;
+ *
+ * ON EXIT:
+ *	returns	the authentication scheme to use.
+ */
+static HTAAScheme HTAA_selectScheme(HTAASetup * setup)
 {
     HTAAScheme scheme;
 
     if (setup && setup->valid_schemes) {
 	for (scheme = HTAA_BASIC; scheme < HTAA_MAX_SCHEMES; scheme++)
-	    if (-1 < HTList_indexOf(setup->valid_schemes, (void*)scheme))
+	    if (-1 < HTList_indexOf(setup->valid_schemes, (void *) scheme))
 		return scheme;
     }
     return HTAA_BASIC;
 }
 
 /*
-**  Purpose:	Free off all module globals.
-**  Arguments:	void
-**  Return Value:	void
-**  Remarks/Portability/Dependencies/Restrictions:
-**	To be used at program exit.
-**  Revision History:
-**	06-19-96	created - FM
-*/
-static void free_HTAAGlobals (void)
+ *  Purpose:	Free off all module globals.
+ *  Arguments:	void
+ *  Return Value:	void
+ *  Remarks/Portability/Dependencies/Restrictions:
+ *	To be used at program exit.
+ *  Revision History:
+ *	06-19-96	created - FM
+ */
+static void free_HTAAGlobals(void)
 {
-    HTAAServer * server;
+    HTAAServer *server;
     int n, i;
 
     if (server_table != NULL) {
 	n = HTList_count(server_table);
 	for (i = (n - 1); i >= 0; i--) {
-	    if ((server = (HTAAServer*)HTList_objectAt(server_table,
-							i)) != NULL) {
+	    if ((server = (HTAAServer *) HTList_objectAt(server_table,
+							 i)) != NULL) {
 		HTAAServer_delete(server);
 		server = NULL;
 	    }
@@ -802,30 +781,29 @@ static void free_HTAAGlobals (void)
 }
 
 /* BROWSER PUBLIC					HTAA_composeAuth()
-**
-**	SELECT THE AUTHENTICATION SCHEME AND
-**	COMPOSE THE ENTIRE AUTHORIZATION HEADER LINE
-**	IF WE ALREADY KNOW THAT THE HOST REQUIRES AUTHENTICATION
-**
-** ON ENTRY:
-**	hostname	is the hostname of the server.
-**	portnumber	is the portnumber in which the server runs.
-**	docname		is the pathname of the document (as in URL)
-**	IsProxy		should be TRUE if this is a proxy.
-**
-** ON EXIT:
-**	returns	NULL, if no authorization seems to be needed, or
-**		if it is the entire Authorization: line, e.g.
-**
-**		   "Authorization: Basic username:password"
-**
-**		As usual, this string is automatically freed.
-*/
-char *HTAA_composeAuth (
-	const char *	hostname,
-	const int	portnumber,
-	const char *	docname,
-	BOOL		IsProxy)
+ *
+ *	SELECT THE AUTHENTICATION SCHEME AND
+ *	COMPOSE THE ENTIRE AUTHORIZATION HEADER LINE
+ *	IF WE ALREADY KNOW THAT THE HOST REQUIRES AUTHENTICATION
+ *
+ * ON ENTRY:
+ *	hostname	is the hostname of the server.
+ *	portnumber	is the portnumber in which the server runs.
+ *	docname		is the pathname of the document (as in URL)
+ *	IsProxy		should be TRUE if this is a proxy.
+ *
+ * ON EXIT:
+ *	returns	NULL, if no authorization seems to be needed, or
+ *		if it is the entire Authorization: line, e.g.
+ *
+ *		   "Authorization: Basic username:password"
+ *
+ *		As usual, this string is automatically freed.
+ */
+char *HTAA_composeAuth(const char *hostname,
+		       const int portnumber,
+		       const char *docname,
+		       BOOL IsProxy)
 {
     char *auth_string;
     BOOL retry;
@@ -833,8 +811,8 @@ char *HTAA_composeAuth (
     int len;
 
     /*
-    **  Setup atexit() freeing if not done already. - FM
-    */
+     * Setup atexit() freeing if not done already.  - FM
+     */
     if (!free_HTAAGlobalsSet) {
 #ifdef LY_FIND_LEAKS
 	atexit(free_HTAAGlobals);
@@ -843,17 +821,16 @@ char *HTAA_composeAuth (
     }
 
     /*
-    ** Make gateway httpds pass authorization field as it was received.
-    ** (This still doesn't really work because Authenticate: headers
-    **  from remote server are not forwarded to client yet so it cannot
-    **  really know that it should send authorization;  I will not
-    **  implement it yet because I feel we will soon change radically
-    **  the way requests are represented to allow multithreading
-    **  on server-side.  Life is hard.)
-    */
+     * Make gateway httpds pass authorization field as it was received.  (This
+     * still doesn't really work because Authenticate:  headers from remote
+     * server are not forwarded to client yet so it cannot really know that it
+     * should send authorization; I will not implement it yet because I feel we
+     * will soon change radically the way requests are represented to allow
+     * multithreading on server-side.  Life is hard.)
+     */
     if (HTAAForwardAuth) {
 	CTRACE((tfp, "HTAA_composeAuth: %s\n",
-		    "Forwarding received authorization"));
+		"Forwarding received authorization"));
 	StrAllocCopy(HTAA_composeAuthResult, HTAAForwardAuth);
 	HTAAForwardAuth_reset();	/* Just a precaution */
 	return HTAA_composeAuthResult;
@@ -863,15 +840,15 @@ char *HTAA_composeAuth (
 
     if (IsProxy) {
 	/*
-	**  Proxy Authorization required. - AJL
-	*/
+	 * Proxy Authorization required.  - AJL
+	 */
 
 	CTRACE((tfp, "Composing Proxy Authorization for %s:%d/%s\n",
-		    hostname, portnumber, docname));
+		hostname, portnumber, docname));
 
-	if (proxy_portnumber  != portnumber       ||
-	    !proxy_hostname   || !proxy_docname   ||
-	    !hostname         || !docname         ||
+	if (proxy_portnumber != portnumber ||
+	    !proxy_hostname || !proxy_docname ||
+	    !hostname || !docname ||
 	    0 != strcmp(proxy_hostname, hostname) ||
 	    0 != strcmp(proxy_docname, docname)) {
 
@@ -900,53 +877,55 @@ char *HTAA_composeAuth (
 	    return NULL;
 
 	switch (scheme = HTAA_selectScheme(proxy_setup)) {
-	  case HTAA_BASIC:
-	  case HTAA_PUBKEY:
+	case HTAA_BASIC:
+	case HTAA_PUBKEY:
 	    auth_string = compose_auth_string(scheme, proxy_setup, IsProxy);
 	    break;
-	  case HTAA_KERBEROS_V4:
+	case HTAA_KERBEROS_V4:
 	    /* OTHER AUTHENTICATION ROUTINES ARE CALLED HERE */
-	  default:
+	default:
 	    {
 		char *msg = NULL;
+
 		HTSprintf0(&msg, "%s `%s'",
-			gettext("This client doesn't know how to compose proxy authorization information for scheme"),
-			HTAAScheme_name(scheme));
+			   gettext("This client doesn't know how to compose proxy authorization information for scheme"),
+			   HTAAScheme_name(scheme));
 		HTAlert(msg);
 		FREE(msg);
 		auth_string = NULL;
 	    }
-	} /* switch scheme */
+	}			/* switch scheme */
 
 	proxy_setup->retry = NO;
 
 	if (!auth_string)
 	    /*
-	    **  Signal a failure. - FM
-	    */
-	    return NULL;  /* Added by marca. */
+	     * Signal a failure.  - FM
+	     */
+	    return NULL;	/* Added by marca. */
 	if (*auth_string == '\0') {
 	    /*
-	    **  Signal an abort. - FM
-	    */
+	     * Signal an abort.  - FM
+	     */
 	    StrAllocCopy(HTAA_composeAuthResult, "");
-	    return(HTAA_composeAuthResult);
+	    return (HTAA_composeAuthResult);
 	}
-	len = strlen(auth_string) + strlen((char *)HTAAScheme_name(scheme)) + 26;
+	len = strlen(auth_string) + strlen((char *) HTAAScheme_name(scheme)) + 26;
 	if ((HTAA_composeAuthResult = typecallocn(char, len)) == 0)
-	    outofmem(__FILE__, "HTAA_composeAuth");
+	      outofmem(__FILE__, "HTAA_composeAuth");
+
 	strcpy(HTAA_composeAuthResult, "Proxy-Authorization: ");
 
     } else {
 	/*
-	**  Normal WWW authorization.
-	*/
+	 * Normal WWW authorization.
+	 */
 	CTRACE((tfp, "Composing Authorization for %s:%d/%s\n",
-		    hostname, portnumber, docname));
+		hostname, portnumber, docname));
 
 	if (current_portnumber != portnumber ||
 	    !current_hostname || !current_docname ||
-	    !hostname         || !docname         ||
+	    !hostname || !docname ||
 	    0 != strcmp(current_hostname, hostname) ||
 	    0 != strcmp(current_docname, docname)) {
 
@@ -975,42 +954,44 @@ char *HTAA_composeAuth (
 	    return NULL;
 
 	switch (scheme = HTAA_selectScheme(current_setup)) {
-	  case HTAA_BASIC:
-	  case HTAA_PUBKEY:
+	case HTAA_BASIC:
+	case HTAA_PUBKEY:
 	    auth_string = compose_auth_string(scheme, current_setup, IsProxy);
 	    break;
-	  case HTAA_KERBEROS_V4:
+	case HTAA_KERBEROS_V4:
 	    /* OTHER AUTHENTICATION ROUTINES ARE CALLED HERE */
-	  default:
+	default:
 	    {
 		char *msg = 0;
+
 		HTSprintf0(&msg, "%s `%s'",
-			gettext("This client doesn't know how to compose authorization information for scheme"),
-			HTAAScheme_name(scheme));
+			   gettext("This client doesn't know how to compose authorization information for scheme"),
+			   HTAAScheme_name(scheme));
 		HTAlert(msg);
 		FREE(msg);
 		auth_string = NULL;
 	    }
-	} /* switch scheme */
+	}			/* switch scheme */
 
 	current_setup->retry = NO;
 
 	if (!auth_string)
 	    /*
-	    **  Signal a failure. - FM
-	    */
-	    return NULL;  /* Added by marca. */
+	     * Signal a failure.  - FM
+	     */
+	    return NULL;	/* Added by marca. */
 	if (*auth_string == '\0') {
 	    /*
-	    **  Signal an abort. - FM
-	    */
+	     * Signal an abort.  - FM
+	     */
 	    StrAllocCopy(HTAA_composeAuthResult, "");
-	    return(HTAA_composeAuthResult);
+	    return (HTAA_composeAuthResult);
 	}
 
-	len = strlen(auth_string) + strlen((char *)HTAAScheme_name(scheme)) + 20;
+	len = strlen(auth_string) + strlen((char *) HTAAScheme_name(scheme)) + 20;
 	if ((HTAA_composeAuthResult = typecallocn(char, len)) == 0)
-	    outofmem(__FILE__, "HTAA_composeAuth");
+	      outofmem(__FILE__, "HTAA_composeAuth");
+
 	strcpy(HTAA_composeAuthResult, "Authorization: ");
     }
 
@@ -1021,38 +1002,37 @@ char *HTAA_composeAuth (
 }
 
 /* BROWSER PUBLIC				HTAA_shouldRetryWithAuth()
-**
-**		DETERMINES IF WE SHOULD RETRY THE SERVER
-**		WITH AUTHORIZATION
-**		(OR IF ALREADY RETRIED, WITH A DIFFERENT
-**		USERNAME AND/OR PASSWORD (IF MISSPELLED))
-** ON ENTRY:
-**	start_of_headers is the first block already read from socket,
-**			but status line skipped; i.e., points to the
-**			start of the header section.
-**	length		is the remaining length of the first block.
-**	soc		is the socket to read the rest of server reply.
-**	IsProxy		should be TRUE if this is a proxy.
-**
-**			This function should only be called when
-**			server has replied with a 401 (Unauthorized)
-**			status code.
-** ON EXIT:
-**	returns		YES, if connection should be retried.
-**			     The node containing all the necessary
-**			     information is
-**				* either constructed if it does not exist
-**				* or password is reset to NULL to indicate
-**				  that username and password should be
-**				  reprompted when composing Authorization:
-**				  field (in function HTAA_composeAuth()).
-**			NO, otherwise.
-*/
-BOOL HTAA_shouldRetryWithAuth (
-	char *		start_of_headers,
-	int		length,
-	int		soc,
-	BOOL		IsProxy)
+ *
+ *		DETERMINES IF WE SHOULD RETRY THE SERVER
+ *		WITH AUTHORIZATION
+ *		(OR IF ALREADY RETRIED, WITH A DIFFERENT
+ *		USERNAME AND/OR PASSWORD (IF MISSPELLED))
+ * ON ENTRY:
+ *	start_of_headers is the first block already read from socket,
+ *			but status line skipped; i.e., points to the
+ *			start of the header section.
+ *	length		is the remaining length of the first block.
+ *	soc		is the socket to read the rest of server reply.
+ *	IsProxy		should be TRUE if this is a proxy.
+ *
+ *			This function should only be called when
+ *			server has replied with a 401 (Unauthorized)
+ *			status code.
+ * ON EXIT:
+ *	returns		YES, if connection should be retried.
+ *			     The node containing all the necessary
+ *			     information is
+ *				* either constructed if it does not exist
+ *				* or password is reset to NULL to indicate
+ *				  that username and password should be
+ *				  reprompted when composing Authorization:
+ *				  field (in function HTAA_composeAuth()).
+ *			NO, otherwise.
+ */
+BOOL HTAA_shouldRetryWithAuth(char *start_of_headers,
+			      int length,
+			      int soc,
+			      BOOL IsProxy)
 {
     HTAAScheme scheme;
     char *line = NULL;
@@ -1063,8 +1043,8 @@ BOOL HTAA_shouldRetryWithAuth (
     char *temp = NULL;
 
     /*
-    **  Setup atexit() freeing if not done already. - FM
-    */
+     * Setup atexit() freeing if not done already.  - FM
+     */
     if (!free_HTAAGlobalsSet) {
 #ifdef LY_FIND_LEAKS
 	atexit(free_HTAAGlobals);
@@ -1073,12 +1053,12 @@ BOOL HTAA_shouldRetryWithAuth (
     }
 
     /*
-    **  Read server reply header lines
-    */
+     * Read server reply header lines
+     */
     CTRACE((tfp, "Server reply header lines:\n"));
 
     HTAA_setupReader(start_of_headers, length, soc);
-    while (NULL != (line = HTAA_getUnfoldedLine())  &&  *line != '\0') {
+    while (NULL != (line = HTAA_getUnfoldedLine()) && *line != '\0') {
 	CTRACE((tfp, "%s\n", line));
 
 	if (strchr(line, ':')) {	/* Valid header line */
@@ -1089,27 +1069,28 @@ BOOL HTAA_shouldRetryWithAuth (
 	    char *args = p;
 
 	    if ((IsProxy &&
-		 0==strcasecomp(fieldname, "Proxy-Authenticate:")) ||
+		 0 == strcasecomp(fieldname, "Proxy-Authenticate:")) ||
 		(!IsProxy &&
-		 0==strcasecomp(fieldname, "WWW-Authenticate:"))) {
+		 0 == strcasecomp(fieldname, "WWW-Authenticate:"))) {
 		if (!(arg1 && *arg1 && args && *args)) {
 		    HTSprintf0(&temp, gettext("Invalid header '%s%s%s%s%s'"), line,
-				  ((arg1 && *arg1) ? " "  : ""),
-				  ((arg1 && *arg1) ? arg1 : ""),
-				  ((args && *args) ? " "  : ""),
-				  ((args && *args) ? args : ""));
+			       ((arg1 && *arg1) ? " " : ""),
+			       ((arg1 && *arg1) ? arg1 : ""),
+			       ((args && *args) ? " " : ""),
+			       ((args && *args) ? args : ""));
 		    HTAlert(temp);
 		    FREE(temp);
-		}
-		else if (HTAA_UNKNOWN != (scheme = HTAAScheme_enum(arg1))) {
-		    HTList_addObject(valid_schemes, (void*)scheme);
+		} else if (HTAA_UNKNOWN != (scheme = HTAAScheme_enum(arg1))) {
+		    HTList_addObject(valid_schemes, (void *) scheme);
 		    if (!scheme_specifics) {
 			int i;
+
 			scheme_specifics =
 			    typecallocn(HTAssocList *, HTAA_MAX_SCHEMES);
+
 			if (!scheme_specifics)
 			    outofmem(__FILE__, "HTAA_shouldRetryWithAuth");
-			for (i=0; i < HTAA_MAX_SCHEMES; i++)
+			for (i = 0; i < HTAA_MAX_SCHEMES; i++)
 			    scheme_specifics[i] = NULL;
 		    }
 		    scheme_specifics[scheme] = HTAA_parseArgList(args);
@@ -1124,44 +1105,41 @@ BOOL HTAA_shouldRetryWithAuth (
 	    }
 
 	    else if (!IsProxy &&
-		     0==strcasecomp(fieldname, "WWW-Protection-Template:")) {
+		     0 == strcasecomp(fieldname, "WWW-Protection-Template:")) {
 		CTRACE((tfp, "Protection template set to `%s'\n", arg1));
 		StrAllocCopy(template, arg1);
 	    }
 
-	} /* if a valid header line */
-	else {
+	} else {
 	    CTRACE((tfp, "Invalid header line `%s' ignored\n", line));
-	} /* else invalid header line */
+	}
 
 	FREE(line);
-    } /* while header lines remain */
+    }				/* while header lines remain */
     FREE(line);
 
-
     /*
-    **  So should we retry with authorization?
-    */
+     * So should we retry with authorization?
+     */
     if (IsProxy) {
 	if (num_schemes == 0) {
 	    /*
-	    **  No proxy authorization valid
-	    */
+	     * No proxy authorization valid
+	     */
 	    proxy_setup = NULL;
 	    return NO;
 	}
 	/*
-	**  Doing it for proxy.  -AJL
-	*/
+	 * Doing it for proxy.  -AJL
+	 */
 	if (proxy_setup && proxy_setup->server) {
 	    /*
-	    **  We have already tried with proxy authorization.
-	    **  Either we don't have access or username or
-	    **  password was misspelled.
-	    **
-	    **  Update scheme-specific parameters
-	    **  (in case they have expired by chance).
-	    */
+	     * We have already tried with proxy authorization.  Either we don't
+	     * have access or username or password was misspelled.
+	     *
+	     * Update scheme-specific parameters (in case they have expired by
+	     * chance).
+	     */
 	    HTAASetup_updateSpecifics(proxy_setup, scheme_specifics);
 
 	    if (NO == HTConfirm(AUTH_FAILED_PROMPT)) {
@@ -1169,21 +1147,21 @@ BOOL HTAA_shouldRetryWithAuth (
 		return NO;
 	    } else {
 		/*
-		**  Re-ask username+password (if misspelled).
-		*/
+		 * Re-ask username+password (if misspelled).
+		 */
 		proxy_setup->retry = YES;
 		return YES;
 	    }
 	} else {
 	    /*
-	    **  proxy_setup == NULL, i.e., we have a
-	    **  first connection to a protected server or
-	    **  the server serves a wider set of documents
-	    **  than we expected so far.
-	    */
+	     * proxy_setup == NULL, i.e., we have a first connection to a
+	     * protected server or the server serves a wider set of documents
+	     * than we expected so far.
+	     */
 	    HTAAServer *server = HTAAServer_lookup(proxy_hostname,
 						   proxy_portnumber,
 						   IsProxy);
+
 	    if (!server) {
 		server = HTAAServer_new(proxy_hostname,
 					proxy_portnumber,
@@ -1192,9 +1170,9 @@ BOOL HTAA_shouldRetryWithAuth (
 	    if (!template)	/* Proxy matches everything  -AJL */
 		StrAllocCopy(template, "*");
 	    proxy_setup = HTAASetup_new(server,
-					  template,
-					  valid_schemes,
-					  scheme_specifics);
+					template,
+					valid_schemes,
+					scheme_specifics);
 	    FREE(template);
 
 	    HTAlert(gettext("Proxy authorization required -- retrying"));
@@ -1203,24 +1181,23 @@ BOOL HTAA_shouldRetryWithAuth (
 	/* Never reached */
     }
     /*
-    **  Normal WWW authorization.
-    */
+     * Normal WWW authorization.
+     */
     if (num_schemes == 0) {
 	/*
-	**  No authorization valid.
-	*/
+	 * No authorization valid.
+	 */
 	current_setup = NULL;
 	return NO;
     }
     if (current_setup && current_setup->server) {
 	/*
-	**  So we have already tried with WWW authorization.
-	**  Either we don't have access or username or
-	**  password was misspelled.
-	**
-	**  Update scheme-specific parameters
-	**  (in case they have expired by chance).
-	*/
+	 * So we have already tried with WWW authorization.  Either we don't
+	 * have access or username or password was misspelled.
+	 *
+	 * Update scheme-specific parameters (in case they have expired by
+	 * chance).
+	 */
 	HTAASetup_updateSpecifics(current_setup, scheme_specifics);
 
 	if (NO == HTConfirm(AUTH_FAILED_PROMPT)) {
@@ -1228,21 +1205,21 @@ BOOL HTAA_shouldRetryWithAuth (
 	    return NO;
 	} else {
 	    /*
-	    **  Re-ask username+password (if misspelled).
-	    */
+	     * Re-ask username+password (if misspelled).
+	     */
 	    current_setup->retry = YES;
 	    return YES;
 	}
     } else {
 	/*
-	**  current_setup == NULL, i.e., we have a
-	**  first connection to a protected server or
-	**  the server serves a wider set of documents
-	**  than we expected so far.
-	*/
+	 * current_setup == NULL, i.e., we have a first connection to a
+	 * protected server or the server serves a wider set of documents than
+	 * we expected so far.
+	 */
 	HTAAServer *server = HTAAServer_lookup(current_hostname,
 					       current_portnumber,
 					       IsProxy);
+
 	if (!server) {
 	    server = HTAAServer_new(current_hostname,
 				    current_portnumber,
@@ -1263,26 +1240,25 @@ BOOL HTAA_shouldRetryWithAuth (
 }
 
 /*
-**  This function clears all authorization information by
-**  invoking the free_HTAAGlobals() function, which normally
-**  is invoked at exit.  It allows a browser command to do
-**  this at any time, for example, if the user is leaving
-**  the terminal for a period of time, but does not want
-**  to end the current session.  - FM
-*/
-void HTClearHTTPAuthInfo (void)
+ *  This function clears all authorization information by
+ *  invoking the free_HTAAGlobals() function, which normally
+ *  is invoked at exit.  It allows a browser command to do
+ *  this at any time, for example, if the user is leaving
+ *  the terminal for a period of time, but does not want
+ *  to end the current session.  - FM
+ */
+void HTClearHTTPAuthInfo(void)
 {
     /*
-    **  Need code to check cached documents against the
-    **  protection templates, and do something to ensure
-    **  that any protected documents no longer can be
-    **  accessed without a new retrieval. - FM
-    */
+     * Need code to check cached documents against the protection templates,
+     * and do something to ensure that any protected documents no longer can be
+     * accessed without a new retrieval.  - FM
+     */
 
     /*
-    **  Now free all of the authorization info, and
-    **  reset the free_HTAAGlobalsSet flag. - FM
-    */
+     * Now free all of the authorization info, and reset the
+     * free_HTAAGlobalsSet flag.  - FM
+     */
     free_HTAAGlobals();
     free_HTAAGlobalsSet = FALSE;
 }
diff --git a/WWW/Library/Implementation/HTAABrow.h b/WWW/Library/Implementation/HTAABrow.h
index e16019e2..f7570ae3 100644
--- a/WWW/Library/Implementation/HTAABrow.h
+++ b/WWW/Library/Implementation/HTAABrow.h
@@ -31,7 +31,7 @@
 #ifndef HTAABROW_H
 #define HTAABROW_H
 
-#include <HTAAUtil.h>           /* Common parts of AA */
+#include <HTAAUtil.h>		/* Common parts of AA */
 
 /*
 
@@ -52,68 +52,65 @@ Routines for Browser Side Recording of AA Info
  */
 
 /* PUBLIC                                               HTAA_composeAuth()
-**
-**      COMPOSE THE ENTIRE AUTHORIZATION HEADER LINE IF WE
-**      ALREADY KNOW, THAT THE HOST MIGHT REQUIRE AUTHORIZATION
-**
-** ON ENTRY:
-**      hostname        is the hostname of the server.
-**      portnumber      is the portnumber in which the server runs.
-**      docname         is the pathname of the document (as in URL)
-**
-** ON EXIT:
-**      returns NULL, if no authorization seems to be needed, or
-**              if it is the entire Authorization: line, e.g.
-**
-**                 "Authorization: basic username:password"
-**
-**              As usual, this string is automatically freed.
-*/
-extern char *HTAA_composeAuth (
-	const char *	hostname,
-	const int	portnumber,
-	const char *	docname,
-	BOOL		IsProxy);
-
+ *
+ *      COMPOSE THE ENTIRE AUTHORIZATION HEADER LINE IF WE
+ *      ALREADY KNOW, THAT THE HOST MIGHT REQUIRE AUTHORIZATION
+ *
+ * ON ENTRY:
+ *      hostname        is the hostname of the server.
+ *      portnumber      is the portnumber in which the server runs.
+ *      docname         is the pathname of the document (as in URL)
+ *
+ * ON EXIT:
+ *      returns NULL, if no authorization seems to be needed, or
+ *              if it is the entire Authorization: line, e.g.
+ *
+ *                 "Authorization: basic username:password"
+ *
+ *              As usual, this string is automatically freed.
+ */
+extern char *HTAA_composeAuth(const char *hostname,
+			      const int portnumber,
+			      const char *docname,
+			      BOOL IsProxy);
 
 /* BROWSER PUBLIC                               HTAA_shouldRetryWithAuth()
-**
-**              DETERMINES IF WE SHOULD RETRY THE SERVER
-**              WITH AUTHORIZATION
-**              (OR IF ALREADY RETRIED, WITH A DIFFERENT
-**              USERNAME AND/OR PASSWORD (IF MISSPELLED))
-** ON ENTRY:
-**      start_of_headers is the first block already read from socket,
-**                      but status line skipped; i.e., points to the
-**                      start of the header section.
-**      length          is the remaining length of the first block.
-**      soc             is the socket to read the rest of server reply.
-**
-**                      This function should only be called when
-**                      server has replied with a 401 (Unauthorized)
-**                      status code.
-** ON EXIT:
-**      returns         YES, if connection should be retried.
-**                           The node containing all the necessary
-**                           information is
-**                              * either constructed if it does not exist
-**                              * or password is reset to NULL to indicate
-**                                that username and password should be
-**                                reprompted when composing Authorization:
-**                                field (in function HTAA_composeAuth()).
-**                      NO, otherwise.
-*/
-extern BOOL HTAA_shouldRetryWithAuth (
-	char *		start_of_headers,
-	int		length,
-	int		soc,
-	BOOL		IsProxy);
+ *
+ *              DETERMINES IF WE SHOULD RETRY THE SERVER
+ *              WITH AUTHORIZATION
+ *              (OR IF ALREADY RETRIED, WITH A DIFFERENT
+ *              USERNAME AND/OR PASSWORD (IF MISSPELLED))
+ * ON ENTRY:
+ *      start_of_headers is the first block already read from socket,
+ *                      but status line skipped; i.e., points to the
+ *                      start of the header section.
+ *      length          is the remaining length of the first block.
+ *      soc             is the socket to read the rest of server reply.
+ *
+ *                      This function should only be called when
+ *                      server has replied with a 401 (Unauthorized)
+ *                      status code.
+ * ON EXIT:
+ *      returns         YES, if connection should be retried.
+ *                           The node containing all the necessary
+ *                           information is
+ *                              * either constructed if it does not exist
+ *                              * or password is reset to NULL to indicate
+ *                                that username and password should be
+ *                                reprompted when composing Authorization:
+ *                                field (in function HTAA_composeAuth()).
+ *                      NO, otherwise.
+ */
+extern BOOL HTAA_shouldRetryWithAuth(char *start_of_headers,
+				     int length,
+				     int soc,
+				     BOOL IsProxy);
 
 /*
-**  Function to allow clearing of all Authorization info
-**  via a browser command. - FM
-*/
-extern void HTClearHTTPAuthInfo (void);
+ *  Function to allow clearing of all Authorization info
+ *  via a browser command. - FM
+ */
+extern void HTClearHTTPAuthInfo(void);
 
 /*
 
@@ -126,9 +123,8 @@ Enabling Gateway httpds to Forward Authorization
 
  */
 
-extern void HTAAForwardAuth_set (
-	const char *	scheme_name,
-	const char *	scheme_specifics);
-extern void HTAAForwardAuth_reset (void);
+extern void HTAAForwardAuth_set(const char *scheme_name,
+				const char *scheme_specifics);
+extern void HTAAForwardAuth_reset(void);
 
-#endif  /* NOT HTAABROW_H */
+#endif /* NOT HTAABROW_H */
diff --git a/WWW/Library/Implementation/HTAAProt.c b/WWW/Library/Implementation/HTAAProt.c
index 516b4885..192b974c 100644
--- a/WWW/Library/Implementation/HTAAProt.c
+++ b/WWW/Library/Implementation/HTAAProt.c
@@ -1,68 +1,70 @@
 
 /* MODULE							HTAAProt.c
-**		PROTECTION FILE PARSING MODULE
-**
-** AUTHORS:
-**	AL	Ari Luotonen	luotonen@dxcern.cern.ch
-**	MD	Mark Donszelmann    duns@vxdeop.cern.ch
-**
-** HISTORY:
-**	20 Oct 93  AL	Now finds uid/gid for nobody/nogroup by name
-**			(doesn't use default 65534 right away).
-**			Also understands negative uids/gids.
-**	14 Nov 93  MD	Added VMS compatibility
-**
-** BUGS:
-**
-**
-*/
+ *		PROTECTION FILE PARSING MODULE
+ *
+ * AUTHORS:
+ *	AL	Ari Luotonen	luotonen@dxcern.cern.ch
+ *	MD	Mark Donszelmann    duns@vxdeop.cern.ch
+ *
+ * HISTORY:
+ *	20 Oct 93  AL	Now finds uid/gid for nobody/nogroup by name
+ *			(doesn't use default 65534 right away).
+ *			Also understands negative uids/gids.
+ *	14 Nov 93  MD	Added VMS compatibility
+ *
+ * BUGS:
+ *
+ *
+ */
 
 #include <HTUtils.h>
 
 #ifndef VMS
 #ifndef NOUSERS
-#include <pwd.h>	/* Unix password file routine: getpwnam()	*/
-#include <grp.h>	/* Unix group file routine: getgrnam()		*/
+#include <pwd.h>		/* Unix password file routine: getpwnam()       */
+#include <grp.h>		/* Unix group file routine: getgrnam()          */
 #endif /* NOUSERS */
 #endif /* not VMS */
 
 #include <HTAAUtil.h>
-#include <HTLex.h>	/* Lexical analysor	*/
-#include <HTAAProt.h>	/* Implemented here	*/
+#include <HTLex.h>		/* Lexical analysor     */
+#include <HTAAProt.h>		/* Implemented here     */
 
 #include <LYUtils.h>
 #include <LYLeaks.h>
 
-#define NOBODY    65534	/* -2 in 16-bit environment */
-#define NONESUCH  65533	/* -3 in 16-bit environment */
+#define NOBODY    65534		/* -2 in 16-bit environment */
+#define NONESUCH  65533		/* -3 in 16-bit environment */
 
 /*
-** Protection setup caching
-*/
+ * Protection setup caching
+ */
 typedef struct {
-    char *	prot_filename;
-    HTAAProt *	prot;
+    char *prot_filename;
+    HTAAProt *prot;
 } HTAAProtCache;
 
-static HTList *  prot_cache	= NULL;	/* Protection setup cache.	*/
-static HTAAProt *default_prot	= NULL;	/* Default protection.		*/
-static HTAAProt *current_prot	= NULL;	/* Current protection mode	*/
+static HTList *prot_cache = NULL;	/* Protection setup cache.      */
+static HTAAProt *default_prot = NULL;	/* Default protection.          */
+static HTAAProt *current_prot = NULL;	/* Current protection mode      */
+
 					/* which is set up by callbacks */
-					/* from the rule system when	*/
+					/* from the rule system when    */
 					/* a "protect" rule is matched. */
 
 #ifndef NOUSERS
 /* static							isNumber()
-**		DOES A CHARACTER STRING REPRESENT A NUMBER
-*/
-static BOOL isNumber (const char * s)
+ *		DOES A CHARACTER STRING REPRESENT A NUMBER
+ */
+static BOOL isNumber(const char *s)
 {
     const char *cur = s;
 
-    if (isEmpty(s)) return NO;
+    if (isEmpty(s))
+	return NO;
 
     if (*cur == '-')
-	cur++;		/* Allow initial minus sign in a number */
+	cur++;			/* Allow initial minus sign in a number */
 
     while (*cur) {
 	if (*cur < '0' || *cur > '9')
@@ -73,136 +75,130 @@ static BOOL isNumber (const char * s)
 }
 #endif /* !NOUSERS */
 
-
 #if defined (NOUSERS)
 /* PUBLIC							HTAA_getUidName()
-**		GET THE USER ID NAME (VMS ONLY)
-** ON ENTRY:
-**	No arguments.
-**
-** ON EXIT:
-**	returns	the user name
-**		Default is "" (nobody).
-*/
-char * HTAA_getUidName (void)
+ *		GET THE USER ID NAME (VMS ONLY)
+ * ON ENTRY:
+ *	No arguments.
+ *
+ * ON EXIT:
+ *	returns	the user name
+ *		Default is "" (nobody).
+ */
+char *HTAA_getUidName(void)
 {
     if (current_prot && current_prot->uid_name
-		  && (0 != strcmp(current_prot->uid_name,"nobody")) )
-       return(current_prot->uid_name);
+	&& (0 != strcmp(current_prot->uid_name, "nobody")))
+	return (current_prot->uid_name);
     else
-       return("");
+	return ("");
 }
 
 /* PUBLIC							HTAA_getFileName
-**		GET THE FILENAME (VMS ONLY)
-** ON ENTRY:
-**	No arguments.
-**
-** ON EXIT:
-**	returns	the filename
-*/
-char * HTAA_getFileName (void)
+ *		GET THE FILENAME (VMS ONLY)
+ * ON ENTRY:
+ *	No arguments.
+ *
+ * ON EXIT:
+ *	returns	the filename
+ */
+char *HTAA_getFileName(void)
 {
     if (current_prot && current_prot->filename)
-       return(current_prot->filename);
+	return (current_prot->filename);
     else
-       return("");
+	return ("");
 }
 
 #else /* not VMS */
 
 /* PUBLIC							HTAA_getUid()
-**		GET THE USER ID TO CHANGE THE PROCESS UID TO
-** ON ENTRY:
-**	No arguments.
-**
-** ON EXIT:
-**	returns	the uid number to give to setuid() system call.
-**		Default is 65534 (nobody).
-*/
-int HTAA_getUid (void)
+ *		GET THE USER ID TO CHANGE THE PROCESS UID TO
+ * ON ENTRY:
+ *	No arguments.
+ *
+ * ON EXIT:
+ *	returns	the uid number to give to setuid() system call.
+ *		Default is 65534 (nobody).
+ */
+int HTAA_getUid(void)
 {
     int uid;
 
-    if (current_prot  &&  current_prot->uid_name) {
+    if (current_prot && current_prot->uid_name) {
 	if (isNumber(current_prot->uid_name)) {
 	    uid = atoi(current_prot->uid_name);
-	    if ((*HTAA_UidToName (uid)) != '\0') {
+	    if ((*HTAA_UidToName(uid)) != '\0') {
 		return uid;
 	    }
-	}
-	else {	/* User name (not a number) */
-	    if ((uid = HTAA_NameToUid (current_prot->uid_name)) != NONESUCH) {
+	} else {		/* User name (not a number) */
+	    if ((uid = HTAA_NameToUid(current_prot->uid_name)) != NONESUCH) {
 		return uid;
 	    }
 	}
     }
     /*
-    ** Ok, then let's get uid for nobody.
-    */
-    if ((uid = HTAA_NameToUid ("nobody")) != NONESUCH) {
+     * Ok, then let's get uid for nobody.
+     */
+    if ((uid = HTAA_NameToUid("nobody")) != NONESUCH) {
 	return uid;
     }
     /*
-    ** Ok, then use default.
-    */
-    return NOBODY;	/* nobody */
+     * Ok, then use default.
+     */
+    return NOBODY;		/* nobody */
 }
 
-
 /* PUBLIC							HTAA_getGid()
-**		GET THE GROUP ID TO CHANGE THE PROCESS GID TO
-** ON ENTRY:
-**	No arguments.
-**
-** ON EXIT:
-**	returns	the uid number to give to setgid() system call.
-**		Default is 65534 (nogroup).
-*/
-int HTAA_getGid (void)
+ *		GET THE GROUP ID TO CHANGE THE PROCESS GID TO
+ * ON ENTRY:
+ *	No arguments.
+ *
+ * ON EXIT:
+ *	returns	the uid number to give to setgid() system call.
+ *		Default is 65534 (nogroup).
+ */
+int HTAA_getGid(void)
 {
     int gid;
 
-    if (current_prot  &&  current_prot->gid_name) {
+    if (current_prot && current_prot->gid_name) {
 	if (isNumber(current_prot->gid_name)) {
 	    gid = atoi(current_prot->gid_name);
 	    if (*HTAA_GidToName(gid) != '\0') {
 		return gid;
 	    }
-	}
-	else {	/* Group name (not number) */
-	    if ((gid = HTAA_NameToGid (current_prot->gid_name)) != NONESUCH) {
+	} else {		/* Group name (not number) */
+	    if ((gid = HTAA_NameToGid(current_prot->gid_name)) != NONESUCH) {
 		return gid;
 	    }
 	}
     }
     /*
-    ** Ok, then let's get gid for nogroup.
-    */
-    if ((gid = HTAA_NameToGid ("nogroup")) != NONESUCH) {
+     * Ok, then let's get gid for nogroup.
+     */
+    if ((gid = HTAA_NameToGid("nogroup")) != NONESUCH) {
 	return gid;
     }
     /*
-    ** Ok, then use default.
-    */
-    return NOBODY;	/* nogroup */
+     * Ok, then use default.
+     */
+    return NOBODY;		/* nogroup */
 }
 #endif /* not VMS */
 
-
 /* static							HTAA_setIds()
-**		SET UID AND GID (AS NAMES OR NUMBERS)
-**		TO HTAAProt STRUCTURE
-** ON ENTRY:
-**	prot		destination.
-**	ids		is a string like "james.www" or "1422.69" etc.
-**			giving uid and gid.
-**
-** ON EXIT:
-**	returns		nothing.
-*/
-static void HTAA_setIds (HTAAProt *	prot,
-			       const char *	ids)
+ *		SET UID AND GID (AS NAMES OR NUMBERS)
+ *		TO HTAAProt STRUCTURE
+ * ON ENTRY:
+ *	prot		destination.
+ *	ids		is a string like "james.www" or "1422.69" etc.
+ *			giving uid and gid.
+ *
+ * ON EXIT:
+ *	returns		nothing.
+ */
+static void HTAA_setIds(HTAAProt *prot, const char *ids)
 {
     if (ids) {
 	char *local_copy = NULL;
@@ -211,34 +207,30 @@ static void HTAA_setIds (HTAAProt *	prot,
 	StrAllocCopy(local_copy, ids);
 	point = strchr(local_copy, '.');
 	if (point) {
-	    *(point++) = (char)0;
+	    *(point++) = (char) 0;
 	    StrAllocCopy(prot->gid_name, point);
-	}
-	else {
+	} else {
 	    StrAllocCopy(prot->gid_name, "nogroup");
 	}
 	StrAllocCopy(prot->uid_name, local_copy);
 	FREE(local_copy);
-    }
-    else {
+    } else {
 	StrAllocCopy(prot->uid_name, "nobody");
 	StrAllocCopy(prot->gid_name, "nogroup");
     }
 }
 
-
 /* static						HTAA_parseProtFile()
-**		PARSE A PROTECTION SETUP FILE AND
-**		PUT THE RESULT IN A HTAAProt STRUCTURE
-** ON ENTRY:
-**	prot		destination structure.
-**	fp		open protection file.
-**
-** ON EXIT:
-**	returns		nothing.
-*/
-static void HTAA_parseProtFile (HTAAProt * prot,
-				      FILE *	  fp)
+ *		PARSE A PROTECTION SETUP FILE AND
+ *		PUT THE RESULT IN A HTAAProt STRUCTURE
+ * ON ENTRY:
+ *	prot		destination structure.
+ *	fp		open protection file.
+ *
+ * ON EXIT:
+ *	returns		nothing.
+ */
+static void HTAA_parseProtFile(HTAAProt *prot, FILE *fp)
 {
     if (prot && fp) {
 	LexItem lex_item;
@@ -249,7 +241,7 @@ static void HTAA_parseProtFile (HTAAProt * prot,
 	    while (lex_item == LEX_REC_SEP)	/* Ignore empty lines */
 		lex_item = lex(fp);
 
-	    if (lex_item == LEX_EOF)		/* End of file */
+	    if (lex_item == LEX_EOF)	/* End of file */
 		break;
 
 	    if (lex_item == LEX_ALPH_STR) {	/* Valid setup record */
@@ -258,112 +250,114 @@ static void HTAA_parseProtFile (HTAAProt * prot,
 
 		if (LEX_FIELD_SEP != (lex_item = lex(fp)))
 		    unlex(lex_item);	/* If someone wants to use colon */
-					/* after field name it's ok, but */
-					/* not required. Here we read it.*/
+		/* after field name it's ok, but */
+		/* not required. Here we read it. */
 
-		if (0==strncasecomp(fieldname, "Auth", 4)) {
+		if (0 == strncasecomp(fieldname, "Auth", 4)) {
 		    lex_item = lex(fp);
 		    while (lex_item == LEX_ALPH_STR) {
 			HTAAScheme scheme = HTAAScheme_enum(HTlex_buffer);
+
 			if (scheme != HTAA_UNKNOWN) {
 			    if (!prot->valid_schemes)
 				prot->valid_schemes = HTList_new();
-			    HTList_addObject(prot->valid_schemes,(void*)scheme);
+			    HTList_addObject(prot->valid_schemes, (void *) scheme);
 			    CTRACE((tfp, "%s %s `%s'\n",
-					"HTAA_parseProtFile: valid",
-					"authentication scheme:",
-					HTAAScheme_name(scheme)));
+				    "HTAA_parseProtFile: valid",
+				    "authentication scheme:",
+				    HTAAScheme_name(scheme)));
 			} else {
 			    CTRACE((tfp, "%s %s `%s'\n",
-					"HTAA_parseProtFile: unknown",
-					"authentication scheme:",
-					HTlex_buffer));
+				    "HTAA_parseProtFile: unknown",
+				    "authentication scheme:",
+				    HTlex_buffer));
 			}
 
 			if (LEX_ITEM_SEP != (lex_item = lex(fp)))
 			    break;
 			/*
-			** Here lex_item == LEX_ITEM_SEP; after item separator
-			** it is ok to have one or more newlines (LEX_REC_SEP)
-			** and they are ignored (continuation line).
-			*/
+			 * Here lex_item == LEX_ITEM_SEP; after item separator
+			 * it is ok to have one or more newlines (LEX_REC_SEP)
+			 * and they are ignored (continuation line).
+			 */
 			do {
 			    lex_item = lex(fp);
 			} while (lex_item == LEX_REC_SEP);
-		    } /* while items in list */
-		} /* if "Authenticate" */
-
-		else if (0==strncasecomp(fieldname, "mask", 4)) {
+		    }		/* while items in list */
+		}
+		/* if "Authenticate" */
+		else if (0 == strncasecomp(fieldname, "mask", 4)) {
 		    prot->mask_group = HTAA_parseGroupDef(fp);
-		    lex_item=LEX_REC_SEP; /*groupdef parser read this already*/
+		    lex_item = LEX_REC_SEP;	/*groupdef parser read this already */
 		    if (TRACE) {
 			if (prot->mask_group) {
 			    fprintf(tfp,
 				    "HTAA_parseProtFile: Mask group:\n");
 			    HTAA_printGroupDef(prot->mask_group);
-			} else fprintf(tfp, "HTAA_parseProtFile: Mask group syntax error\n");
+			} else
+			    fprintf(tfp,
+				    "HTAA_parseProtFile: Mask group syntax error\n");
 		    }
-		} /* if "Mask" */
-
-		else {	/* Just a name-value pair, put it to assoclist */
+		}
+		/* if "Mask" */
+		else {		/* Just a name-value pair, put it to assoclist */
 
 		    if (LEX_ALPH_STR == (lex_item = lex(fp))) {
 			if (!prot->values)
 			    prot->values = HTAssocList_new();
 			HTAssocList_add(prot->values, fieldname, HTlex_buffer);
-			lex_item = lex(fp);  /* Read record separator */
+			lex_item = lex(fp);	/* Read record separator */
 			CTRACE((tfp, "%s `%s' bound to value `%s'\n",
-				    "HTAA_parseProtFile: Name",
-				    fieldname, HTlex_buffer));
+				"HTAA_parseProtFile: Name",
+				fieldname, HTlex_buffer));
 		    }
-		} /* else name-value pair */
+		}		/* else name-value pair */
 
-	    } /* if valid field */
-
-	    if (lex_item != LEX_EOF  &&  lex_item != LEX_REC_SEP) {
+	    }
+	    /* if valid field */
+	    if (lex_item != LEX_EOF && lex_item != LEX_REC_SEP) {
 		CTRACE((tfp, "%s %s %d (that line ignored)\n",
-			    "HTAA_parseProtFile: Syntax error",
-			    "in protection setup file at line",
-			    HTlex_line));
+			"HTAA_parseProtFile: Syntax error",
+			"in protection setup file at line",
+			HTlex_line));
 		do {
 		    lex_item = lex(fp);
 		} while (lex_item != LEX_EOF && lex_item != LEX_REC_SEP);
-	    } /* if syntax error */
-	} /* while not end-of-file */
+	    }			/* if syntax error */
+	}			/* while not end-of-file */
 	FREE(fieldname);
-    } /* if valid parameters */
+    }				/* if valid parameters */
 }
 
-
 /* static						HTAAProt_new()
-**		ALLOCATE A NEW HTAAProt STRUCTURE AND
-**		INITIALIZE IT FROM PROTECTION SETUP FILE
-** ON ENTRY:
-**	cur_docname	current filename after rule translations.
-**	prot_filename	protection setup file name.
-**			If NULL, not an error.
-**	ids		Uid and gid names or numbers,
-**			examples:
-**				james	( <=> james.nogroup)
-**				.www	( <=> nobody.www)
-**				james.www
-**				james.69
-**				1422.69
-**				1422.www
-**
-**			May be NULL, defaults to nobody.nogroup.
-**			Should be NULL, if prot_file is NULL.
-**
-** ON EXIT:
-**	returns		returns a new and initialized protection
-**			setup structure.
-**			If setup file is already read in (found
-**			in cache), only sets uid_name and gid
-**			fields, and returns that.
-*/
-static HTAAProt *HTAAProt_new (const char *	cur_docname,
-				     const char *	prot_filename,
-				     const char *	ids)
+ *		ALLOCATE A NEW HTAAProt STRUCTURE AND
+ *		INITIALIZE IT FROM PROTECTION SETUP FILE
+ * ON ENTRY:
+ *	cur_docname	current filename after rule translations.
+ *	prot_filename	protection setup file name.
+ *			If NULL, not an error.
+ *	ids		Uid and gid names or numbers,
+ *			examples:
+ *				james	( <=> james.nogroup)
+ *				.www	( <=> nobody.www)
+ *				james.www
+ *				james.69
+ *				1422.69
+ *				1422.www
+ *
+ *			May be NULL, defaults to nobody.nogroup.
+ *			Should be NULL, if prot_file is NULL.
+ *
+ * ON EXIT:
+ *	returns		returns a new and initialized protection
+ *			setup structure.
+ *			If setup file is already read in (found
+ *			in cache), only sets uid_name and gid
+ *			fields, and returns that.
+ */
+static HTAAProt *HTAAProt_new(const char *cur_docname,
+			      const char *prot_filename,
+			      const char *ids)
 {
     HTList *cur = prot_cache;
     HTAAProtCache *cache_item = NULL;
@@ -373,28 +367,28 @@ static HTAAProt *HTAAProt_new (const char *	cur_docname,
     if (!prot_cache)
 	prot_cache = HTList_new();
 
-    while (NULL != (cache_item = (HTAAProtCache*)HTList_nextObject(cur))) {
+    while (NULL != (cache_item = (HTAAProtCache *) HTList_nextObject(cur))) {
 	if (!strcmp(cache_item->prot_filename, prot_filename))
 	    break;
     }
     if (cache_item) {
 	prot = cache_item->prot;
 	CTRACE((tfp, "%s `%s' already in cache\n",
-		    "HTAAProt_new: Protection file", prot_filename));
+		"HTAAProt_new: Protection file", prot_filename));
     } else {
 	CTRACE((tfp, "HTAAProt_new: Loading protection file `%s'\n",
-		    prot_filename));
+		prot_filename));
 
 	if ((prot = typecalloc(HTAAProt)) == 0)
-	    outofmem(__FILE__, "HTAAProt_new");
+	      outofmem(__FILE__, "HTAAProt_new");
 
-	prot->template	= NULL;
-	prot->filename	= NULL;
-	prot->uid_name	= NULL;
-	prot->gid_name	= NULL;
+	prot->template = NULL;
+	prot->filename = NULL;
+	prot->uid_name = NULL;
+	prot->gid_name = NULL;
 	prot->valid_schemes = HTList_new();
-	prot->mask_group= NULL;		/* Masking disabled by defaults */
-	prot->values	= HTAssocList_new();
+	prot->mask_group = NULL;	/* Masking disabled by defaults */
+	prot->values = HTAssocList_new();
 
 	if (prot_filename && NULL != (fp = fopen(prot_filename, TXT_R))) {
 	    HTAA_parseProtFile(prot, fp);
@@ -404,11 +398,11 @@ static HTAAProt *HTAAProt_new (const char *	cur_docname,
 	    cache_item->prot = prot;
 	    cache_item->prot_filename = NULL;
 	    StrAllocCopy(cache_item->prot_filename, prot_filename);
-	    HTList_addObject(prot_cache, (void*)cache_item);
+	    HTList_addObject(prot_cache, (void *) cache_item);
 	} else {
 	    CTRACE((tfp, "HTAAProt_new: %s `%s'\n",
-			"Unable to open protection setup file",
-			NONNULL(prot_filename)));
+		    "Unable to open protection setup file",
+		    NONNULL(prot_filename)));
 	}
     }
 
@@ -419,29 +413,28 @@ static HTAAProt *HTAAProt_new (const char *	cur_docname,
     return prot;
 }
 
-
 /* PUBLIC					HTAA_setDefaultProtection()
-**		SET THE DEFAULT PROTECTION MODE
-**		(called by rule system when a
-**		"defprot" rule is matched)
-** ON ENTRY:
-**	cur_docname	is the current result of rule translations.
-**	prot_filename	is the protection setup file (second argument
-**			for "defprot" rule, optional)
-**	ids		contains user and group names separated by
-**			a dot, corresponding to the uid
-**			gid under which the server should run,
-**			default is "nobody.nogroup" (third argument
-**			for "defprot" rule, optional; can be given
-**			only if protection setup file is also given).
-**
-** ON EXIT:
-**	returns		nothing.
-**			Sets the module-wide variable default_prot.
-*/
-void HTAA_setDefaultProtection (const char *	cur_docname,
-					    const char *	prot_filename,
-					    const char *	ids)
+ *		SET THE DEFAULT PROTECTION MODE
+ *		(called by rule system when a
+ *		"defprot" rule is matched)
+ * ON ENTRY:
+ *	cur_docname	is the current result of rule translations.
+ *	prot_filename	is the protection setup file (second argument
+ *			for "defprot" rule, optional)
+ *	ids		contains user and group names separated by
+ *			a dot, corresponding to the uid
+ *			gid under which the server should run,
+ *			default is "nobody.nogroup" (third argument
+ *			for "defprot" rule, optional; can be given
+ *			only if protection setup file is also given).
+ *
+ * ON EXIT:
+ *	returns		nothing.
+ *			Sets the module-wide variable default_prot.
+ */
+void HTAA_setDefaultProtection(const char *cur_docname,
+			       const char *prot_filename,
+			       const char *ids)
 {
     default_prot = NULL;	/* Not free()'d because this is in cache */
 
@@ -449,34 +442,33 @@ void HTAA_setDefaultProtection (const char *	cur_docname,
 	default_prot = HTAAProt_new(cur_docname, prot_filename, ids);
     } else {
 	CTRACE((tfp, "%s %s\n",
-		    "HTAA_setDefaultProtection: ERROR: Protection file",
-		    "not specified (obligatory for DefProt rule)!!\n"));
+		"HTAA_setDefaultProtection: ERROR: Protection file",
+		"not specified (obligatory for DefProt rule)!!\n"));
     }
 }
 
-
 /* PUBLIC					HTAA_setCurrentProtection()
-**		SET THE CURRENT PROTECTION MODE
-**		(called by rule system when a
-**		"protect" rule is matched)
-** ON ENTRY:
-**	cur_docname	is the current result of rule translations.
-**	prot_filename	is the protection setup file (second argument
-**			for "protect" rule, optional)
-**	ids		contains user and group names separated by
-**			a dot, corresponding to the uid
-**			gid under which the server should run,
-**			default is "nobody.nogroup" (third argument
-**			for "protect" rule, optional; can be given
-**			only if protection setup file is also given).
-**
-** ON EXIT:
-**	returns		nothing.
-**			Sets the module-wide variable current_prot.
-*/
-void HTAA_setCurrentProtection (const char *	cur_docname,
-					    const char *	prot_filename,
-					    const char *	ids)
+ *		SET THE CURRENT PROTECTION MODE
+ *		(called by rule system when a
+ *		"protect" rule is matched)
+ * ON ENTRY:
+ *	cur_docname	is the current result of rule translations.
+ *	prot_filename	is the protection setup file (second argument
+ *			for "protect" rule, optional)
+ *	ids		contains user and group names separated by
+ *			a dot, corresponding to the uid
+ *			gid under which the server should run,
+ *			default is "nobody.nogroup" (third argument
+ *			for "protect" rule, optional; can be given
+ *			only if protection setup file is also given).
+ *
+ * ON EXIT:
+ *	returns		nothing.
+ *			Sets the module-wide variable current_prot.
+ */
+void HTAA_setCurrentProtection(const char *cur_docname,
+			       const char *prot_filename,
+			       const char *ids)
 {
     current_prot = NULL;	/* Not free()'d because this is in cache */
 
@@ -487,63 +479,61 @@ void HTAA_setCurrentProtection (const char *	cur_docname,
 	    current_prot = default_prot;
 	    HTAA_setIds(current_prot, ids);
 	    CTRACE((tfp, "%s %s %s\n",
-			"HTAA_setCurrentProtection: Protection file",
-			"not specified for Protect rule",
-			"-- using default protection"));
+		    "HTAA_setCurrentProtection: Protection file",
+		    "not specified for Protect rule",
+		    "-- using default protection"));
 	} else {
 	    CTRACE((tfp, "%s %s %s\n",
-			"HTAA_setCurrentProtection: ERROR: Protection",
-			"file not specified for Protect rule, and",
-			"default protection is not set!!"));
+		    "HTAA_setCurrentProtection: ERROR: Protection",
+		    "file not specified for Protect rule, and",
+		    "default protection is not set!!"));
 	}
     }
 }
 
-
 /* PUBLIC					HTAA_getCurrentProtection()
-**		GET CURRENT PROTECTION SETUP STRUCTURE
-**		(this is set up by callbacks made from
-**		 the rule system when matching "protect"
-**		 (and "defprot") rules)
-** ON ENTRY:
-**	HTTranslate() must have been called before calling
-**	this function.
-**
-** ON EXIT:
-**	returns	a HTAAProt structure representing the
-**		protection setup of the HTTranslate()'d file.
-**		This must not be free()'d.
-*/
-HTAAProt *HTAA_getCurrentProtection (void)
+ *		GET CURRENT PROTECTION SETUP STRUCTURE
+ *		(this is set up by callbacks made from
+ *		 the rule system when matching "protect"
+ *		 (and "defprot") rules)
+ * ON ENTRY:
+ *	HTTranslate() must have been called before calling
+ *	this function.
+ *
+ * ON EXIT:
+ *	returns	a HTAAProt structure representing the
+ *		protection setup of the HTTranslate()'d file.
+ *		This must not be free()'d.
+ */
+HTAAProt *HTAA_getCurrentProtection(void)
 {
     return current_prot;
 }
 
-
 /* PUBLIC					HTAA_getDefaultProtection()
-**		GET DEFAULT PROTECTION SETUP STRUCTURE
-**		AND SET IT TO CURRENT PROTECTION
-**		(this is set up by callbacks made from
-**		 the rule system when matching "defprot"
-**		 rules)
-** ON ENTRY:
-**	HTTranslate() must have been called before calling
-**	this function.
-**
-** ON EXIT:
-**	returns	a HTAAProt structure representing the
-**		default protection setup of the HTTranslate()'d
-**		file (if HTAA_getCurrentProtection() returned
-**		NULL, i.e., if there is no "protect" rule
-**		but ACL exists, and we need to know default
-**		protection settings).
-**		This must not be free()'d.
-** IMPORTANT:
-**	As a side-effect this tells the protection system that
-**	the file is in fact protected and sets the current
-**	protection mode to default.
-*/
-HTAAProt *HTAA_getDefaultProtection (void)
+ *		GET DEFAULT PROTECTION SETUP STRUCTURE
+ *		AND SET IT TO CURRENT PROTECTION
+ *		(this is set up by callbacks made from
+ *		 the rule system when matching "defprot"
+ *		 rules)
+ * ON ENTRY:
+ *	HTTranslate() must have been called before calling
+ *	this function.
+ *
+ * ON EXIT:
+ *	returns	a HTAAProt structure representing the
+ *		default protection setup of the HTTranslate()'d
+ *		file (if HTAA_getCurrentProtection() returned
+ *		NULL, i.e., if there is no "protect" rule
+ *		but ACL exists, and we need to know default
+ *		protection settings).
+ *		This must not be free()'d.
+ * IMPORTANT:
+ *	As a side-effect this tells the protection system that
+ *	the file is in fact protected and sets the current
+ *	protection mode to default.
+ */
+HTAAProt *HTAA_getDefaultProtection(void)
 {
     if (!current_prot) {
 	current_prot = default_prot;
@@ -552,28 +542,27 @@ HTAAProt *HTAA_getDefaultProtection (void)
     return current_prot;
 }
 
-
 /* SERVER INTERNAL					HTAA_clearProtections()
-**		CLEAR DOCUMENT PROTECTION MODE
-**		(ALSO DEFAULT PROTECTION)
-**		(called by the rule system)
-** ON ENTRY:
-**	No arguments.
-**
-** ON EXIT:
-**	returns	nothing.
-**		Frees the memory used by protection information.
-*/
-void HTAA_clearProtections (void)
+ *		CLEAR DOCUMENT PROTECTION MODE
+ *		(ALSO DEFAULT PROTECTION)
+ *		(called by the rule system)
+ * ON ENTRY:
+ *	No arguments.
+ *
+ * ON EXIT:
+ *	returns	nothing.
+ *		Frees the memory used by protection information.
+ */
+void HTAA_clearProtections(void)
 {
-    current_prot = NULL;	/* These are not freed because	*/
-    default_prot = NULL;	/* they are actually in cache.	*/
+    current_prot = NULL;	/* These are not freed because  */
+    default_prot = NULL;	/* they are actually in cache.  */
 }
 
 typedef struct {
-	char *name;
-	int user;
-	} USER_DATA;
+    char *name;
+    int user;
+} USER_DATA;
 
 #ifndef NOUSERS
 static HTList *known_grp = NULL;
@@ -582,10 +571,11 @@ static BOOL uidgid_cache_inited = NO;
 #endif
 
 #ifdef LY_FIND_LEAKS
-static void clear_uidgid_cache (void)
+static void clear_uidgid_cache(void)
 {
 #ifndef NOUSERS
     USER_DATA *data;
+
     if (known_grp) {
 	while ((data = HTList_removeLastObject(known_grp)) != NULL) {
 	    FREE(data->name);
@@ -605,9 +595,10 @@ static void clear_uidgid_cache (void)
 #endif /* LY_FIND_LEAKS */
 
 #ifndef NOUSERS
-static void save_gid_info (char * name, int user)
+static void save_gid_info(char *name, int user)
 {
     USER_DATA *data = typecalloc(USER_DATA);
+
     if (!data)
 	return;
     if (!known_grp) {
@@ -621,14 +612,15 @@ static void save_gid_info (char * name, int user)
     }
     StrAllocCopy(data->name, name);
     data->user = user;
-    HTList_addObject (known_grp, data);
+    HTList_addObject(known_grp, data);
 }
 #endif /* NOUSERS */
 
 #ifndef NOUSERS
-static void save_uid_info (char * name, int user)
+static void save_uid_info(char *name, int user)
 {
     USER_DATA *data = typecalloc(USER_DATA);
+
     if (!data)
 	return;
     if (!known_pwd) {
@@ -642,36 +634,37 @@ static void save_uid_info (char * name, int user)
     }
     StrAllocCopy(data->name, name);
     data->user = user;
-    HTList_addObject (known_pwd, data);
+    HTList_addObject(known_pwd, data);
 }
 #endif /* !NOUSERS */
 
 /* PUBLIC							HTAA_UidToName
-**		GET THE USER NAME
-** ON ENTRY:
-**      The user-id
-**
-** ON EXIT:
-**      returns the user name, or an empty string if not found.
-*/
-char * HTAA_UidToName (int uid)
+ *		GET THE USER NAME
+ * ON ENTRY:
+ *      The user-id
+ *
+ * ON EXIT:
+ *      returns the user name, or an empty string if not found.
+ */
+char *HTAA_UidToName(int uid)
 {
 #ifndef NOUSERS
     struct passwd *pw;
     HTList *me = known_pwd;
 
     while (HTList_nextObject(me)) {
-	USER_DATA *data = (USER_DATA *)(me->object);
+	USER_DATA *data = (USER_DATA *) (me->object);
+
 	if (uid == data->user)
 	    return data->name;
     }
 
     if ((pw = getpwuid(uid)) != 0
-     && pw->pw_name != 0) {
+	&& pw->pw_name != 0) {
 	CTRACE((tfp, "%s(%d) returned (%s:%d:...)\n",
-		    "HTAA_UidToName: getpwuid",
-		    uid,
-		    pw->pw_name, (int) pw->pw_uid));
+		"HTAA_UidToName: getpwuid",
+		uid,
+		pw->pw_name, (int) pw->pw_uid));
 	save_uid_info(pw->pw_name, (int) pw->pw_uid);
 	return pw->pw_name;
     }
@@ -680,30 +673,31 @@ char * HTAA_UidToName (int uid)
 }
 
 /* PUBLIC							HTAA_NameToUid
-**		GET THE USER ID
-** ON ENTRY:
-**      The user-name
-**
-** ON EXIT:
-**      returns the user id, or NONESUCH if not found.
-*/
-int HTAA_NameToUid (char * name)
+ *		GET THE USER ID
+ * ON ENTRY:
+ *      The user-name
+ *
+ * ON EXIT:
+ *      returns the user id, or NONESUCH if not found.
+ */
+int HTAA_NameToUid(char *name)
 {
 #ifndef NOUSERS
     struct passwd *pw;
     HTList *me = known_pwd;
 
     while (HTList_nextObject(me)) {
-	USER_DATA *data = (USER_DATA *)(me->object);
+	USER_DATA *data = (USER_DATA *) (me->object);
+
 	if (!strcmp(name, data->name))
 	    return data->user;
     }
 
     if ((pw = getpwnam(name)) != 0) {
 	CTRACE((tfp, "%s(%s) returned (%s:%d:...)\n",
-		    "HTAA_NameToUid: getpwnam",
-		    name,
-		    pw->pw_name, (int) pw->pw_uid));
+		"HTAA_NameToUid: getpwnam",
+		name,
+		pw->pw_name, (int) pw->pw_uid));
 	save_uid_info(pw->pw_name, (int) pw->pw_uid);
 	return (int) pw->pw_uid;
     }
@@ -712,31 +706,32 @@ int HTAA_NameToUid (char * name)
 }
 
 /* PUBLIC							HTAA_GidToName
-**		GET THE GROUP NAME
-** ON ENTRY:
-**      The group-id
-**
-** ON EXIT:
-**      returns the group name, or an empty string if not found.
-*/
-char * HTAA_GidToName (int gid)
+ *		GET THE GROUP NAME
+ * ON ENTRY:
+ *      The group-id
+ *
+ * ON EXIT:
+ *      returns the group name, or an empty string if not found.
+ */
+char *HTAA_GidToName(int gid)
 {
 #ifndef NOUSERS
     struct group *gr;
     HTList *me = known_grp;
 
     while (HTList_nextObject(me)) {
-	USER_DATA *data = (USER_DATA *)(me->object);
+	USER_DATA *data = (USER_DATA *) (me->object);
+
 	if (gid == data->user)
 	    return data->name;
     }
 
     if ((gr = getgrgid(gid)) != 0
-     && gr->gr_name != 0) {
+	&& gr->gr_name != 0) {
 	CTRACE((tfp, "%s(%d) returned (%s:%d:...)\n",
-		    "HTAA_GidToName: getgrgid",
-		    gid,
-		    gr->gr_name, (int) gr->gr_gid));
+		"HTAA_GidToName: getgrgid",
+		gid,
+		gr->gr_name, (int) gr->gr_gid));
 	save_gid_info(gr->gr_name, (int) gr->gr_gid);
 	return gr->gr_name;
     }
@@ -745,30 +740,31 @@ char * HTAA_GidToName (int gid)
 }
 
 /* PUBLIC							HTAA_NameToGid
-**		GET THE GROUP ID
-** ON ENTRY:
-**      The group-name
-**
-** ON EXIT:
-**      returns the group id, or NONESUCH if not found.
-*/
-int HTAA_NameToGid (char * name)
+ *		GET THE GROUP ID
+ * ON ENTRY:
+ *      The group-name
+ *
+ * ON EXIT:
+ *      returns the group id, or NONESUCH if not found.
+ */
+int HTAA_NameToGid(char *name)
 {
 #ifndef NOUSERS
     struct group *gr;
     HTList *me = known_grp;
 
     while (HTList_nextObject(me)) {
-	USER_DATA *data = (USER_DATA *)(me->object);
+	USER_DATA *data = (USER_DATA *) (me->object);
+
 	if (!strcmp(name, data->name))
 	    return data->user;
     }
 
     if ((gr = getgrnam(name)) != 0) {
 	CTRACE((tfp, "%s(%s) returned (%s:%d:...)\n",
-		    "HTAA_NameToGid: getgrnam",
-		    name,
-		    gr->gr_name, (int) gr->gr_gid));
+		"HTAA_NameToGid: getgrnam",
+		name,
+		gr->gr_name, (int) gr->gr_gid));
 	save_gid_info(gr->gr_name, (int) gr->gr_gid);
 	return (int) gr->gr_gid;
     }
diff --git a/WWW/Library/Implementation/HTAAProt.h b/WWW/Library/Implementation/HTAAProt.h
index afcf8dc8..d083aca1 100644
--- a/WWW/Library/Implementation/HTAAProt.h
+++ b/WWW/Library/Implementation/HTAAProt.h
@@ -15,15 +15,16 @@ Server's Representation of Document (Tree) Protections
  */
 
 typedef struct {
-    char *        template;     /* Template for this protection         */
-    char *        filename;     /* Current document file                */
-    char *        uid_name;     /* Effective uid (name of it)           */
-    char *        gid_name;     /* Effective gid (name of it)           */
-    GroupDef *    mask_group;   /* Allowed users and IP addresses       */
-    HTList *      valid_schemes;/* Valid authentication schemes         */
-    HTAssocList * values;       /* Association list for scheme specific */
-                                /* parameters.                          */
+    char *template;		/* Template for this protection         */
+    char *filename;		/* Current document file                */
+    char *uid_name;		/* Effective uid (name of it)           */
+    char *gid_name;		/* Effective gid (name of it)           */
+    GroupDef *mask_group;	/* Allowed users and IP addresses       */
+    HTList *valid_schemes;	/* Valid authentication schemes         */
+    HTAssocList *values;	/* Association list for scheme specific */
+    /* parameters.                          */
 } HTAAProt;
+
 /*
 
 Callbacks for rule system
@@ -41,66 +42,64 @@ Callbacks for rule system
  */
 
 /* PUBLIC                                       HTAA_setDefaultProtection()
-**              SET THE DEFAULT PROTECTION MODE
-**              (called by rule system when a
-**              "defprot" rule is matched)
-** ON ENTRY:
-**      cur_docname     is the current result of rule translations.
-**      prot_filename   is the protection setup file (second argument
-**                      for "defprot" rule, optional)
-**      eff_ids         contains user and group names separated by
-**                      a dot, corresponding to the effective uid
-**                      gid under which the server should run,
-**                      default is "nobody.nogroup" (third argument
-**                      for "defprot" rule, optional; can be given
-**                      only if protection setup file is also given).
-**
-** ON EXIT:
-**      returns         nothing.
-**                      Sets the module-wide variable default_prot.
-*/
-extern void HTAA_setDefaultProtection (const char *      cur_docname,
-                                              const char *      prot_filename,
-                                              const char *      eff_ids);
-
-
+ *              SET THE DEFAULT PROTECTION MODE
+ *              (called by rule system when a
+ *              "defprot" rule is matched)
+ * ON ENTRY:
+ *      cur_docname     is the current result of rule translations.
+ *      prot_filename   is the protection setup file (second argument
+ *                      for "defprot" rule, optional)
+ *      eff_ids         contains user and group names separated by
+ *                      a dot, corresponding to the effective uid
+ *                      gid under which the server should run,
+ *                      default is "nobody.nogroup" (third argument
+ *                      for "defprot" rule, optional; can be given
+ *                      only if protection setup file is also given).
+ *
+ * ON EXIT:
+ *      returns         nothing.
+ *                      Sets the module-wide variable default_prot.
+ */
+extern void HTAA_setDefaultProtection(const char *cur_docname,
+				      const char *prot_filename,
+				      const char *eff_ids);
 
 /* PUBLIC                                       HTAA_setCurrentProtection()
-**              SET THE CURRENT PROTECTION MODE
-**              (called by rule system when a
-**              "protect" rule is matched)
-** ON ENTRY:
-**      cur_docname     is the current result of rule translations.
-**      prot_filename   is the protection setup file (second argument
-**                      for "protect" rule, optional)
-**      eff_ids         contains user and group names separated by
-**                      a dot, corresponding to the effective uid
-**                      gid under which the server should run,
-**                      default is "nobody.nogroup" (third argument
-**                      for "protect" rule, optional; can be given
-**                      only if protection setup file is also given).
-**
-** ON EXIT:
-**      returns         nothing.
-**                      Sets the module-wide variable current_prot.
-*/
-extern void HTAA_setCurrentProtection (const char *      cur_docname,
-                                              const char *      prot_filename,
-                                              const char *      eff_ids);
-
+ *              SET THE CURRENT PROTECTION MODE
+ *              (called by rule system when a
+ *              "protect" rule is matched)
+ * ON ENTRY:
+ *      cur_docname     is the current result of rule translations.
+ *      prot_filename   is the protection setup file (second argument
+ *                      for "protect" rule, optional)
+ *      eff_ids         contains user and group names separated by
+ *                      a dot, corresponding to the effective uid
+ *                      gid under which the server should run,
+ *                      default is "nobody.nogroup" (third argument
+ *                      for "protect" rule, optional; can be given
+ *                      only if protection setup file is also given).
+ *
+ * ON EXIT:
+ *      returns         nothing.
+ *                      Sets the module-wide variable current_prot.
+ */
+extern void HTAA_setCurrentProtection(const char *cur_docname,
+				      const char *prot_filename,
+				      const char *eff_ids);
 
 /* SERVER INTERNAL                                      HTAA_clearProtections()
-**              CLEAR DOCUMENT PROTECTION MODE
-**              (ALSO DEFAULT PROTECTION)
-**              (called by the rule system)
-** ON ENTRY:
-**      No arguments.
-**
-** ON EXIT:
-**      returns nothing.
-**              Frees the memory used by protection information.
-*/
-extern void HTAA_clearProtections (void);
+ *              CLEAR DOCUMENT PROTECTION MODE
+ *              (ALSO DEFAULT PROTECTION)
+ *              (called by the rule system)
+ * ON ENTRY:
+ *      No arguments.
+ *
+ * ON EXIT:
+ *      returns nothing.
+ *              Frees the memory used by protection information.
+ */
+extern void HTAA_clearProtections(void);
+
 /*
 
 Getting Protection Settings
@@ -115,42 +114,41 @@ Getting Protection Settings
  */
 
 /* PUBLIC                                       HTAA_getCurrentProtection()
-**              GET CURRENT PROTECTION SETUP STRUCTURE
-**              (this is set up by callbacks made from
-**               the rule system when matching "protect"
-**               (and "defprot") rules)
-** ON ENTRY:
-**      HTTranslate() must have been called before calling
-**      this function.
-**
-** ON EXIT:
-**      returns a HTAAProt structure representing the
-**              protection setup of the HTTranslate()'d file.
-**              This must not be free()'d.
-*/
-extern HTAAProt *HTAA_getCurrentProtection (void);
-
-
+ *              GET CURRENT PROTECTION SETUP STRUCTURE
+ *              (this is set up by callbacks made from
+ *               the rule system when matching "protect"
+ *               (and "defprot") rules)
+ * ON ENTRY:
+ *      HTTranslate() must have been called before calling
+ *      this function.
+ *
+ * ON EXIT:
+ *      returns a HTAAProt structure representing the
+ *              protection setup of the HTTranslate()'d file.
+ *              This must not be free()'d.
+ */
+extern HTAAProt *HTAA_getCurrentProtection(void);
 
 /* PUBLIC                                       HTAA_getDefaultProtection()
-**              GET DEFAULT PROTECTION SETUP STRUCTURE
-**              (this is set up by callbacks made from
-**               the rule system when matching "defprot"
-**               rules)
-** ON ENTRY:
-**      HTTranslate() must have been called before calling
-**      this function.
-**
-** ON EXIT:
-**      returns a HTAAProt structure representing the
-**              default protection setup of the HTTranslate()'d
-**              file (if HTAA_getCurrentProtection() returned
-**              NULL, i.e., if there is no "protect" rule
-**              but ACL exists, and we need to know default
-**              protection settings).
-**              This must not be free()'d.
-*/
-extern HTAAProt *HTAA_getDefaultProtection (void);
+ *              GET DEFAULT PROTECTION SETUP STRUCTURE
+ *              (this is set up by callbacks made from
+ *               the rule system when matching "defprot"
+ *               rules)
+ * ON ENTRY:
+ *      HTTranslate() must have been called before calling
+ *      this function.
+ *
+ * ON EXIT:
+ *      returns a HTAAProt structure representing the
+ *              default protection setup of the HTTranslate()'d
+ *              file (if HTAA_getCurrentProtection() returned
+ *              NULL, i.e., if there is no "protect" rule
+ *              but ACL exists, and we need to know default
+ *              protection settings).
+ *              This must not be free()'d.
+ */
+extern HTAAProt *HTAA_getDefaultProtection(void);
+
 /*
 
 Get User and Group IDs to Which Set to
@@ -159,27 +157,26 @@ Get User and Group IDs to Which Set to
 
 #ifndef VMS
 /* PUBLIC                                                       HTAA_getUid()
-**              GET THE USER ID TO CHANGE THE PROCESS UID TO
-** ON ENTRY:
-**      No arguments.
-**
-** ON EXIT:
-**      returns the uid number to give to setuid() system call.
-**              Default is 65534 (nobody).
-*/
-extern int HTAA_getUid (void);
-
+ *              GET THE USER ID TO CHANGE THE PROCESS UID TO
+ * ON ENTRY:
+ *      No arguments.
+ *
+ * ON EXIT:
+ *      returns the uid number to give to setuid() system call.
+ *              Default is 65534 (nobody).
+ */
+extern int HTAA_getUid(void);
 
 /* PUBLIC                                                       HTAA_getGid()
-**              GET THE GROUP ID TO CHANGE THE PROCESS GID TO
-** ON ENTRY:
-**      No arguments.
-**
-** ON EXIT:
-**      returns the uid number to give to setgid() system call.
-**              Default is 65534 (nogroup).
-*/
-extern int HTAA_getGid (void);
+ *              GET THE GROUP ID TO CHANGE THE PROCESS GID TO
+ * ON ENTRY:
+ *      No arguments.
+ *
+ * ON EXIT:
+ *      returns the uid number to give to setgid() system call.
+ *              Default is 65534 (nogroup).
+ */
+extern int HTAA_getGid(void);
 #endif /* not VMS */
 /*
 
@@ -189,62 +186,65 @@ extern int HTAA_getGid (void);
 
 #ifdef VMS
 /* PUBLIC                                                       HTAA_getUidName()
-**              GET THE USER ID NAME (VMS ONLY)
-** ON ENTRY:
-**      No arguments.
-**
-** ON EXIT:
-**      returns the user name
-**              Default is "" (nobody).
-*/
-extern char * HTAA_getUidName (void);
+ *              GET THE USER ID NAME (VMS ONLY)
+ * ON ENTRY:
+ *      No arguments.
+ *
+ * ON EXIT:
+ *      returns the user name
+ *              Default is "" (nobody).
+ */
+extern char *HTAA_getUidName(void);
 
 /* PUBLIC                                                       HTAA_getFileName
-**              GET THE FILENAME (VMS ONLY)
-** ON ENTRY:
-**      No arguments.
-**
-** ON EXIT:
-**      returns the filename
-*/
-extern char * HTAA_getFileName (void);
+ *              GET THE FILENAME (VMS ONLY)
+ * ON ENTRY:
+ *      No arguments.
+ *
+ * ON EXIT:
+ *      returns the filename
+ */
+extern char *HTAA_getFileName(void);
 #endif /* VMS */
 
 /* PUBLIC                                                       HTAA_UidToName
-**              GET THE USER NAME
-** ON ENTRY:
-**      The user-id
-**
-** ON EXIT:
-**      returns the user name
-*/
-extern char * HTAA_UidToName (int uid);
+ *              GET THE USER NAME
+ * ON ENTRY:
+ *      The user-id
+ *
+ * ON EXIT:
+ *      returns the user name
+ */
+extern char *HTAA_UidToName(int uid);
+
 /* PUBLIC                                                       HTAA_NameToUid
-**              GET THE USER ID
-** ON ENTRY:
-**      The user-name
-**
-** ON EXIT:
-**      returns the user id
-*/
-extern int HTAA_NameToUid (char *name);
+ *              GET THE USER ID
+ * ON ENTRY:
+ *      The user-name
+ *
+ * ON EXIT:
+ *      returns the user id
+ */
+extern int HTAA_NameToUid(char *name);
+
 /* PUBLIC                                                       HTAA_GidToName
-**              GET THE GROUP NAME
-** ON ENTRY:
-**      The group-id
-**
-** ON EXIT:
-**      returns the group name
-*/
-extern char * HTAA_GidToName (int gid);
+ *              GET THE GROUP NAME
+ * ON ENTRY:
+ *      The group-id
+ *
+ * ON EXIT:
+ *      returns the group name
+ */
+extern char *HTAA_GidToName(int gid);
+
 /* PUBLIC                                                       HTAA_NameToGid
-**              GET THE GROUP ID
-** ON ENTRY:
-**      The group-name
-**
-** ON EXIT:
-**      returns the group id
-*/
-extern int HTAA_NameToGid (char *name);
+ *              GET THE GROUP ID
+ * ON ENTRY:
+ *      The group-name
+ *
+ * ON EXIT:
+ *      returns the group id
+ */
+extern int HTAA_NameToGid(char *name);
 
 #endif /* not HTAAPROT_H */
diff --git a/WWW/Library/Implementation/HTAAUtil.c b/WWW/Library/Implementation/HTAAUtil.c
index 3a4d1166..98da373a 100644
--- a/WWW/Library/Implementation/HTAAUtil.c
+++ b/WWW/Library/Implementation/HTAAUtil.c
@@ -1,52 +1,52 @@
 /* MODULE							HTAAUtil.c
-**		COMMON PARTS OF ACCESS AUTHORIZATION MODULE
-**			FOR BOTH SERVER AND BROWSER
-**
-** IMPORTANT:
-**	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.
-**
-**	The AA package does not free() anything else than what
-**	it has itself allocated.
-**
-**	AA (Access Authorization) package means modules which
-**	names start with HTAA.
-**
-** AUTHORS:
-**	AL	Ari Luotonen	luotonen@dxcern.cern.ch
-**	MD	Mark Donszelmann    duns@vxdeop.cern.ch
-**
-** HISTORY:
-**	 8 Nov 93  MD	(VMS only) Added case insensitive comparison in HTAA_templateCaseMatch
-**
-**
-** BUGS:
-**
-**
-*/
+ *		COMMON PARTS OF ACCESS AUTHORIZATION MODULE
+ *			FOR BOTH SERVER AND BROWSER
+ *
+ * IMPORTANT:
+ *	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.
+ *
+ *	The AA package does not free() anything else than what
+ *	it has itself allocated.
+ *
+ *	AA (Access Authorization) package means modules which
+ *	names start with HTAA.
+ *
+ * AUTHORS:
+ *	AL	Ari Luotonen	luotonen@dxcern.cern.ch
+ *	MD	Mark Donszelmann    duns@vxdeop.cern.ch
+ *
+ * HISTORY:
+ *	 8 Nov 93  MD	(VMS only) Added case insensitive comparison in HTAA_templateCaseMatch
+ *
+ *
+ * BUGS:
+ *
+ *
+ */
 
 #include <HTUtils.h>
 
-#include <HTAAUtil.h>	/* Implemented here	*/
-#include <HTAssoc.h>	/* Assoc list		*/
+#include <HTAAUtil.h>		/* Implemented here     */
+#include <HTAssoc.h>		/* Assoc list           */
 #include <HTTCP.h>
 #include <HTTP.h>
 
@@ -54,16 +54,16 @@
 #include <LYLeaks.h>
 
 /* PUBLIC						HTAAScheme_enum()
-**		TRANSLATE SCHEME NAME INTO
-**		A SCHEME ENUMERATION
-**
-** ON ENTRY:
-**	name		is a string representing the scheme name.
-**
-** ON EXIT:
-**	returns		the enumerated constant for that scheme.
-*/
-HTAAScheme HTAAScheme_enum (const char* name)
+ *		TRANSLATE SCHEME NAME INTO
+ *		A SCHEME ENUMERATION
+ *
+ * ON ENTRY:
+ *	name		is a string representing the scheme name.
+ *
+ * ON EXIT:
+ *	returns		the enumerated constant for that scheme.
+ */
+HTAAScheme HTAAScheme_enum(const char *name)
 {
     char *upcased = NULL;
 
@@ -94,235 +94,226 @@ HTAAScheme HTAAScheme_enum (const char* name)
     }
 }
 
-
 /* PUBLIC						HTAAScheme_name()
-**			GET THE NAME OF A GIVEN SCHEME
-** ON ENTRY:
-**	scheme		is one of the scheme enum values:
-**			HTAA_NONE, HTAA_BASIC, HTAA_PUBKEY, ...
-**
-** ON EXIT:
-**	returns		the name of the scheme, i.e.
-**			"None", "Basic", "Pubkey", ...
-*/
-char *HTAAScheme_name (HTAAScheme scheme)
+ *			GET THE NAME OF A GIVEN SCHEME
+ * ON ENTRY:
+ *	scheme		is one of the scheme enum values:
+ *			HTAA_NONE, HTAA_BASIC, HTAA_PUBKEY, ...
+ *
+ * ON EXIT:
+ *	returns		the name of the scheme, i.e.
+ *			"None", "Basic", "Pubkey", ...
+ */
+char *HTAAScheme_name(HTAAScheme scheme)
 {
     switch (scheme) {
-	case HTAA_NONE:
-	    return "None";
-	case HTAA_BASIC:
-	    return "Basic";
-	case HTAA_PUBKEY:
-	    return "Pubkey";
-	case HTAA_KERBEROS_V4:
-	    return "KerberosV4";
-	case HTAA_KERBEROS_V5:
-	    return "KerberosV5";
-	case HTAA_UNKNOWN:
-	    return "UNKNOWN";
-	default:
-	    return "THIS-IS-A-BUG";
+    case HTAA_NONE:
+	return "None";
+    case HTAA_BASIC:
+	return "Basic";
+    case HTAA_PUBKEY:
+	return "Pubkey";
+    case HTAA_KERBEROS_V4:
+	return "KerberosV4";
+    case HTAA_KERBEROS_V5:
+	return "KerberosV5";
+    case HTAA_UNKNOWN:
+	return "UNKNOWN";
+    default:
+	return "THIS-IS-A-BUG";
     }
 }
 
-
 /* PUBLIC						    HTAAMethod_enum()
-**		TRANSLATE METHOD NAME INTO AN ENUMERATED VALUE
-** ON ENTRY:
-**	name		is the method name to translate.
-**
-** ON EXIT:
-**	returns		HTAAMethod enumerated value corresponding
-**			to the given name.
-*/
-HTAAMethod HTAAMethod_enum (const char * name)
+ *		TRANSLATE METHOD NAME INTO AN ENUMERATED VALUE
+ * ON ENTRY:
+ *	name		is the method name to translate.
+ *
+ * ON EXIT:
+ *	returns		HTAAMethod enumerated value corresponding
+ *			to the given name.
+ */
+HTAAMethod HTAAMethod_enum(const char *name)
 {
     if (!name)
 	return METHOD_UNKNOWN;
 
-    if (0==strcasecomp(name, "GET"))
+    if (0 == strcasecomp(name, "GET"))
 	return METHOD_GET;
-    else if (0==strcasecomp(name, "PUT"))
+    else if (0 == strcasecomp(name, "PUT"))
 	return METHOD_PUT;
     else
 	return METHOD_UNKNOWN;
 }
 
-
 /* PUBLIC						HTAAMethod_name()
-**			GET THE NAME OF A GIVEN METHOD
-** ON ENTRY:
-**	method		is one of the method enum values:
-**			METHOD_GET, METHOD_PUT, ...
-**
-** ON EXIT:
-**	returns		the name of the scheme, i.e.
-**			"GET", "PUT", ...
-*/
-char *HTAAMethod_name (HTAAMethod method)
+ *			GET THE NAME OF A GIVEN METHOD
+ * ON ENTRY:
+ *	method		is one of the method enum values:
+ *			METHOD_GET, METHOD_PUT, ...
+ *
+ * ON EXIT:
+ *	returns		the name of the scheme, i.e.
+ *			"GET", "PUT", ...
+ */
+char *HTAAMethod_name(HTAAMethod method)
 {
     switch (method) {
-      case METHOD_GET:
-	  return "GET";
-      case METHOD_PUT:
-	  return "PUT";
-      case METHOD_UNKNOWN:
-	  return "UNKNOWN";
-      default:
-	  return "THIS-IS-A-BUG";
+    case METHOD_GET:
+	return "GET";
+    case METHOD_PUT:
+	return "PUT";
+    case METHOD_UNKNOWN:
+	return "UNKNOWN";
+    default:
+	return "THIS-IS-A-BUG";
     }
 }
 
-
 /* PUBLIC						HTAAMethod_inList()
-**		IS A METHOD IN A LIST OF METHOD NAMES
-** ON ENTRY:
-**	method		is the method to look for.
-**	list		is a list of method names.
-**
-** ON EXIT:
-**	returns		YES, if method was found.
-**			NO, if not found.
-*/
-BOOL HTAAMethod_inList (HTAAMethod method,
-				    HTList *	list)
+ *		IS A METHOD IN A LIST OF METHOD NAMES
+ * ON ENTRY:
+ *	method		is the method to look for.
+ *	list		is a list of method names.
+ *
+ * ON EXIT:
+ *	returns		YES, if method was found.
+ *			NO, if not found.
+ */
+BOOL HTAAMethod_inList(HTAAMethod method, HTList *list)
 {
     HTList *cur = list;
     char *item;
 
-    while (NULL != (item = (char*)HTList_nextObject(cur))) {
+    while (NULL != (item = (char *) HTList_nextObject(cur))) {
 	CTRACE((tfp, " %s", item));
 	if (method == HTAAMethod_enum(item))
 	    return YES;
     }
 
-    return NO;	/* Not found */
+    return NO;			/* Not found */
 }
 
-
 /* PUBLIC						HTAA_templateMatch()
-**		STRING COMPARISON FUNCTION FOR FILE NAMES
-**		   WITH ONE WILDCARD * IN THE TEMPLATE
-** NOTE:
-**	This is essentially the same code as in HTRules.c, but it
-**	cannot be used because it is embedded in between other code.
-**	(In fact, HTRules.c should use this routine, but then this
-**	 routine would have to be more sophisticated... why is life
-**	 sometimes so hard...)
-**
-** ON ENTRY:
-**	template	is a template string to match the file name
-**			against, may contain a single wildcard
-**			character * which matches zero or more
-**			arbitrary characters.
-**	filename	is the filename (or pathname) to be matched
-**			against the template.
-**
-** ON EXIT:
-**	returns		YES, if filename matches the template.
-**			NO, otherwise.
-*/
-BOOL HTAA_templateMatch (const char * template,
-				     const char * filename)
+ *		STRING COMPARISON FUNCTION FOR FILE NAMES
+ *		   WITH ONE WILDCARD * IN THE TEMPLATE
+ * NOTE:
+ *	This is essentially the same code as in HTRules.c, but it
+ *	cannot be used because it is embedded in between other code.
+ *	(In fact, HTRules.c should use this routine, but then this
+ *	 routine would have to be more sophisticated... why is life
+ *	 sometimes so hard...)
+ *
+ * ON ENTRY:
+ *	template	is a template string to match the file name
+ *			against, may contain a single wildcard
+ *			character * which matches zero or more
+ *			arbitrary characters.
+ *	filename	is the filename (or pathname) to be matched
+ *			against the template.
+ *
+ * ON EXIT:
+ *	returns		YES, if filename matches the template.
+ *			NO, otherwise.
+ */
+BOOL HTAA_templateMatch(const char *template,
+			const char *filename)
 {
     const char *p = template;
     const char *q = filename;
     int m;
 
-    for (; *p  &&  *q  &&  *p == *q; p++, q++)	/* Find first mismatch */
-	; /* do nothing else */
+    for (; *p && *q && *p == *q; p++, q++)	/* Find first mismatch */
+	;			/* do nothing else */
 
     if (!*p && !*q)
-	return YES;			/* Equally long equal strings */
-    else if ('*' == *p) {		/* Wildcard */
-	p++;				/* Skip wildcard character */
+	return YES;		/* Equally long equal strings */
+    else if ('*' == *p) {	/* Wildcard */
+	p++;			/* Skip wildcard character */
 	m = strlen(q) - strlen(p);	/* Amount to match to wildcard */
 	if (m < 0)
-	    return NO;			/* No match, filename too short */
+	    return NO;		/* No match, filename too short */
 	else {			/* Skip the matched characters and compare */
-	    if (strcmp(p, q+m))
+	    if (strcmp(p, q + m))
 		return NO;	/* Tail mismatch */
 	    else
 		return YES;	/* Tail match */
 	}
-    }	/* if wildcard */
-    else
+	/* if wildcard */
+    } else
 	return NO;		/* Length or character mismatch */
 }
 
-
 /* PUBLIC						HTAA_templateCaseMatch()
-**		STRING COMPARISON FUNCTION FOR FILE NAMES
-**		   WITH ONE WILDCARD * IN THE TEMPLATE (Case Insensitive)
-** NOTE:
-**	This is essentially the same code as in HTAA_templateMatch, but
-**	it compares case insensitive (for VMS). Reason for this routine
-**	is that HTAA_templateMatch gets called from several places, also
-**	there where a case sensitive match is needed, so one cannot just
-**	change the HTAA_templateMatch routine for VMS.
-**
-** ON ENTRY:
-**	template	is a template string to match the file name
-**			against, may contain a single wildcard
-**			character * which matches zero or more
-**			arbitrary characters.
-**	filename	is the filename (or pathname) to be matched
-**			against the template.
-**
-** ON EXIT:
-**	returns		YES, if filename matches the template.
-**			NO, otherwise.
-*/
-BOOL HTAA_templateCaseMatch (const char * template,
-					 const char * filename)
+ *		STRING COMPARISON FUNCTION FOR FILE NAMES
+ *		   WITH ONE WILDCARD * IN THE TEMPLATE (Case Insensitive)
+ * NOTE:
+ *	This is essentially the same code as in HTAA_templateMatch, but
+ *	it compares case insensitive (for VMS). Reason for this routine
+ *	is that HTAA_templateMatch gets called from several places, also
+ *	there where a case sensitive match is needed, so one cannot just
+ *	change the HTAA_templateMatch routine for VMS.
+ *
+ * ON ENTRY:
+ *	template	is a template string to match the file name
+ *			against, may contain a single wildcard
+ *			character * which matches zero or more
+ *			arbitrary characters.
+ *	filename	is the filename (or pathname) to be matched
+ *			against the template.
+ *
+ * ON EXIT:
+ *	returns		YES, if filename matches the template.
+ *			NO, otherwise.
+ */
+BOOL HTAA_templateCaseMatch(const char *template,
+			    const char *filename)
 {
     const char *p = template;
     const char *q = filename;
     int m;
 
     /* Find first mismatch */
-    for (; *p  &&  *q  &&  TOUPPER(*p) == TOUPPER(*q); p++, q++)
-	; /* do nothing else */
+    for (; *p && *q && TOUPPER(*p) == TOUPPER(*q); p++, q++) ;	/* do nothing else */
 
     if (!*p && !*q)
-	return YES;			/* Equally long equal strings */
-    else if ('*' == *p) {		/* Wildcard */
-	p++;				/* Skip wildcard character */
+	return YES;		/* Equally long equal strings */
+    else if ('*' == *p) {	/* Wildcard */
+	p++;			/* Skip wildcard character */
 	m = strlen(q) - strlen(p);	/* Amount to match to wildcard */
 	if (m < 0)
-	    return NO;			/* No match, filename too short */
+	    return NO;		/* No match, filename too short */
 	else {			/* Skip the matched characters and compare */
-	    if (strcasecomp(p, q+m))
+	    if (strcasecomp(p, q + m))
 		return NO;	/* Tail mismatch */
 	    else
 		return YES;	/* Tail match */
 	}
-    }	/* if wildcard */
-    else
+	/* if wildcard */
+    } else
 	return NO;		/* Length or character mismatch */
 }
 
-
 /* PUBLIC					HTAA_makeProtectionTemplate()
-**		CREATE A PROTECTION TEMPLATE FOR THE FILES
-**		IN THE SAME DIRECTORY AS THE GIVEN FILE
-**		(Used by server if there is no fancier way for
-**		it to tell the client, and by browser if server
-**		didn't send WWW-ProtectionTemplate: field)
-** ON ENTRY:
-**	docname is the document pathname (from URL).
-**
-** ON EXIT:
-**	returns a template matching docname, and other files
-**		files in that directory.
-**
-**		E.g.  /foo/bar/x.html  =>  /foo/bar/ *
-**						    ^
-**				Space only to prevent it from
-**				being a comment marker here,
-**				there really isn't any space.
-*/
-char *HTAA_makeProtectionTemplate (const char * docname)
+ *		CREATE A PROTECTION TEMPLATE FOR THE FILES
+ *		IN THE SAME DIRECTORY AS THE GIVEN FILE
+ *		(Used by server if there is no fancier way for
+ *		it to tell the client, and by browser if server
+ *		didn't send WWW-ProtectionTemplate: field)
+ * ON ENTRY:
+ *	docname is the document pathname (from URL).
+ *
+ * ON EXIT:
+ *	returns a template matching docname, and other files
+ *		files in that directory.
+ *
+ *		E.g.  /foo/bar/x.html  =>  /foo/bar/ *
+ *						    ^
+ *				Space only to prevent it from
+ *				being a comment marker here,
+ *				there really isn't any space.
+ */
+char *HTAA_makeProtectionTemplate(const char *docname)
 {
     char *template = NULL;
     char *slash = NULL;
@@ -336,55 +327,52 @@ char *HTAA_makeProtectionTemplate (const char * docname)
 	    slash = template;
 	*slash = '\0';
 	StrAllocCat(template, "*");
-    }
-    else
+    } else
 	StrAllocCopy(template, "*");
 
     CTRACE((tfp, "make_template: made template `%s' for file `%s'\n",
-		template, docname));
+	    template, docname));
 
     return template;
 }
 
-
 /*
-** Skip leading whitespace from *s forward
-*/
+ * Skip leading whitespace from *s forward
+ */
 #define SKIPWS(s) while (*s==' ' || *s=='\t') s++;
 
 /*
-** Kill trailing whitespace starting from *(s-1) backwards
-*/
+ * Kill trailing whitespace starting from *(s-1) backwards
+ */
 #define KILLWS(s) {char *c=s-1; while (*c==' ' || *c=='\t') *(c--)='\0';}
 
-
 /* PUBLIC						HTAA_parseArgList()
-**		PARSE AN ARGUMENT LIST GIVEN IN A HEADER FIELD
-** ON ENTRY:
-**	str	is a comma-separated list:
-**
-**			item, item, item
-**		where
-**			item ::= value
-**			       | name=value
-**			       | name="value"
-**
-**		Leading and trailing whitespace is ignored
-**		everywhere except inside quotes, so the following
-**		examples are equal:
-**
-**			name=value,foo=bar
-**			 name="value",foo="bar"
-**			  name = value ,  foo = bar
-**			   name = "value" ,  foo = "bar"
-**
-** ON EXIT:
-**	returns a list of name-value pairs (actually HTAssocList*).
-**		For items with no name, just value, the name is
-**		the number of order number of that item. E.g.
-**		"1" for the first, etc.
-*/
-HTAssocList *HTAA_parseArgList (char * str)
+ *		PARSE AN ARGUMENT LIST GIVEN IN A HEADER FIELD
+ * ON ENTRY:
+ *	str	is a comma-separated list:
+ *
+ *			item, item, item
+ *		where
+ *			item ::= value
+ *			       | name=value
+ *			       | name="value"
+ *
+ *		Leading and trailing whitespace is ignored
+ *		everywhere except inside quotes, so the following
+ *		examples are equal:
+ *
+ *			name=value,foo=bar
+ *			 name="value",foo="bar"
+ *			  name = value ,  foo = bar
+ *			   name = "value" ,  foo = "bar"
+ *
+ * ON EXIT:
+ *	returns a list of name-value pairs (actually HTAssocList*).
+ *		For items with no name, just value, the name is
+ *		the number of order number of that item. E.g.
+ *		"1" for the first, etc.
+ */
+HTAssocList *HTAA_parseArgList(char *str)
 {
     HTAssocList *assoc_list = HTAssocList_new();
     char *cur = NULL;
@@ -395,55 +383,52 @@ HTAssocList *HTAA_parseArgList (char * str)
 	return assoc_list;
 
     while (*str) {
-	SKIPWS(str);				/* Skip leading whitespace */
+	SKIPWS(str);		/* Skip leading whitespace */
 	cur = str;
 	n++;
 
-	while (*cur  &&  *cur != '='  &&  *cur != ',')
-	    cur++;	/* Find end of name (or lonely value without a name) */
-	KILLWS(cur);	/* Kill trailing whitespace */
+	while (*cur && *cur != '=' && *cur != ',')
+	    cur++;		/* Find end of name (or lonely value without a name) */
+	KILLWS(cur);		/* Kill trailing whitespace */
 
-	if (*cur == '=') {			/* Name followed by a value */
-	    *(cur++) = '\0';			/* Terminate name */
+	if (*cur == '=') {	/* Name followed by a value */
+	    *(cur++) = '\0';	/* Terminate name */
 	    StrAllocCopy(name, str);
-	    SKIPWS(cur);			/* Skip WS leading the value */
+	    SKIPWS(cur);	/* Skip WS leading the value */
 	    str = cur;
-	    if (*str == '"') {			/* Quoted value */
+	    if (*str == '"') {	/* Quoted value */
 		str++;
 		cur = str;
-		while (*cur  &&  *cur != '"')
+		while (*cur && *cur != '"')
 		    cur++;
 		if (*cur == '"')
-		    *(cur++) = '\0';		/* Terminate value */
+		    *(cur++) = '\0';	/* Terminate value */
 		/* else it is lacking terminating quote */
-		SKIPWS(cur);			/* Skip WS leading comma */
+		SKIPWS(cur);	/* Skip WS leading comma */
 		if (*cur == ',')
-		    cur++;			/* Skip separating colon */
-	    }
-	    else {				/* Unquoted value */
-		while (*cur  &&  *cur != ',')
+		    cur++;	/* Skip separating colon */
+	    } else {		/* Unquoted value */
+		while (*cur && *cur != ',')
 		    cur++;
-		KILLWS(cur);			/* Kill trailing whitespace */
+		KILLWS(cur);	/* Kill trailing whitespace */
 		if (*cur == ',')
 		    *(cur++) = '\0';
 		/* else *cur already NULL */
 	    }
-	}
-	else {	/* No name, just a value */
+	} else {		/* No name, just a value */
 	    if (*cur == ',')
-		*(cur++) = '\0';		/* Terminate value */
+		*(cur++) = '\0';	/* Terminate value */
 	    /* else last value on line (already terminated by NULL) */
 	    HTSprintf0(&name, "%d", n);		/* Item order number for name */
 	}
 	HTAssocList_add(assoc_list, name, str);
 	str = cur;
-    } /* while *str */
+    }				/* while *str */
 
     FREE(name);
     return assoc_list;
 }
 
-
 /************** HEADER LINE READER -- DOES UNFOLDING *************************/
 
 #define BUFFER_SIZE	1024
@@ -455,49 +440,49 @@ static char *end_pointer;
 static int in_soc = -1;
 
 #ifdef LY_FIND_LEAKS
-static void FreeHTAAUtil (void)
+static void FreeHTAAUtil(void)
 {
     FREE(buffer);
 }
 #endif /* LY_FIND_LEAKS */
 
 /* PUBLIC						HTAA_setupReader()
-**		SET UP HEADER LINE READER, i.e., give
-**		the already-read-but-not-yet-processed
-**		buffer of text to be read before more
-**		is read from the socket.
-** ON ENTRY:
-**	start_of_headers is a pointer to a buffer containing
-**			the beginning of the header lines
-**			(rest will be read from a socket).
-**	length		is the number of valid characters in
-**			'start_of_headers' buffer.
-**	soc		is the socket to use when start_of_headers
-**			buffer is used up.
-** ON EXIT:
-**	returns		nothing.
-**			Subsequent calls to HTAA_getUnfoldedLine()
-**			will use this buffer first and then
-**			proceed to read from socket.
-*/
-void HTAA_setupReader (char *	start_of_headers,
-				   int		length,
-				   int		soc)
+ *		SET UP HEADER LINE READER, i.e., give
+ *		the already-read-but-not-yet-processed
+ *		buffer of text to be read before more
+ *		is read from the socket.
+ * ON ENTRY:
+ *	start_of_headers is a pointer to a buffer containing
+ *			the beginning of the header lines
+ *			(rest will be read from a socket).
+ *	length		is the number of valid characters in
+ *			'start_of_headers' buffer.
+ *	soc		is the socket to use when start_of_headers
+ *			buffer is used up.
+ * ON EXIT:
+ *	returns		nothing.
+ *			Subsequent calls to HTAA_getUnfoldedLine()
+ *			will use this buffer first and then
+ *			proceed to read from socket.
+ */
+void HTAA_setupReader(char *start_of_headers,
+		      int length,
+		      int soc)
 {
     if (!start_of_headers)
-	length = 0;	       /* initialize length (is this reached at all?) */
-    if (buffer == NULL) {				       /* first call? */
+	length = 0;		/* initialize length (is this reached at all?) */
+    if (buffer == NULL) {	/* first call? */
 	buffer_length = length;
-	if (buffer_length < BUFFER_SIZE)     /* would fall below BUFFER_SIZE? */
+	if (buffer_length < BUFFER_SIZE)	/* would fall below BUFFER_SIZE? */
 	    buffer_length = BUFFER_SIZE;
-	buffer = (char*)malloc((size_t)(sizeof(char)*(buffer_length + 1)));
-    }
-    else if (length > (int)buffer_length) {		  /* need more space? */
+	buffer = (char *) malloc((size_t) (sizeof(char) * (buffer_length + 1)));
+    } else if (length > (int) buffer_length) {	/* need more space? */
 	buffer_length = length;
-	buffer = (char*)realloc((char*)buffer,
-				(size_t)(sizeof(char)*(buffer_length + 1)));
+	buffer = (char *) realloc((char *) buffer,
+				  (size_t) (sizeof(char) * (buffer_length + 1)));
     }
-    if (buffer == NULL) outofmem(__FILE__, "HTAA_setupReader");
+    if (buffer == NULL)
+	outofmem(__FILE__, "HTAA_setupReader");
 #ifdef LY_FIND_LEAKS
     atexit(FreeHTAAUtil);
 #endif
@@ -506,37 +491,35 @@ void HTAA_setupReader (char *	start_of_headers,
 	strncpy(buffer, start_of_headers, length);
 	buffer[length] = '\0';
 	end_pointer = buffer + length;
-    }
-    else {
+    } else {
 	*start_pointer = '\0';
 	end_pointer = start_pointer;
     }
     in_soc = soc;
 }
 
-
 /* PUBLIC						HTAA_getUnfoldedLine()
-**		READ AN UNFOLDED HEADER LINE FROM SOCKET
-** ON ENTRY:
-**	HTAA_setupReader must absolutely be called before
-**	this function to set up internal buffer.
-**
-** ON EXIT:
-**	returns a newly-allocated character string representing
-**		the read line.	The line is unfolded, i.e.
-**		lines that begin with whitespace are appended
-**		to current line.  E.g.
-**
-**			Field-Name: Blaa-Blaa
-**			 This-Is-A-Continuation-Line
-**			 Here-Is_Another
-**
-**		is seen by the caller as:
-**
-**	Field-Name: Blaa-Blaa This-Is-A-Continuation-Line Here-Is_Another
-**
-*/
-char *HTAA_getUnfoldedLine (void)
+ *		READ AN UNFOLDED HEADER LINE FROM SOCKET
+ * ON ENTRY:
+ *	HTAA_setupReader must absolutely be called before
+ *	this function to set up internal buffer.
+ *
+ * ON EXIT:
+ *	returns a newly-allocated character string representing
+ *		the read line.	The line is unfolded, i.e.
+ *		lines that begin with whitespace are appended
+ *		to current line.  E.g.
+ *
+ *			Field-Name: Blaa-Blaa
+ *			 This-Is-A-Continuation-Line
+ *			 Here-Is_Another
+ *
+ *		is seen by the caller as:
+ *
+ *	Field-Name: Blaa-Blaa This-Is-A-Continuation-Line Here-Is_Another
+ *
+ */
+char *HTAA_getUnfoldedLine(void)
 {
     char *line = NULL;
     char *cur;
@@ -545,16 +528,16 @@ char *HTAA_getUnfoldedLine (void)
 
     if (in_soc < 0) {
 	CTRACE((tfp, "%s %s\n",
-		    "HTAA_getUnfoldedLine: buffer not initialized",
-		    "with function HTAA_setupReader()"));
+		"HTAA_getUnfoldedLine: buffer not initialized",
+		"with function HTAA_setupReader()"));
 	return NULL;
     }
 
-    for(;;) {
+    for (;;) {
 
 	/* Reading from socket */
 
-	if (start_pointer >= end_pointer) {/*Read the next block and continue*/
+	if (start_pointer >= end_pointer) {	/*Read the next block and continue */
 #ifdef USE_SSL
 	    if (SSL_handle)
 		count = SSL_read(SSL_handle, buffer, BUFFER_SIZE);
@@ -576,37 +559,33 @@ char *HTAA_getUnfoldedLine (void)
 		*cur = TOASCII(*cur);
 		cur++;
 	    }
-#endif /*NOT_ASCII*/
+#endif /*NOT_ASCII */
 	}
 	cur = start_pointer;
 
-
 	/* Unfolding */
 
 	if (peek_for_folding) {
-	    if (*cur != ' '  &&  *cur != '\t')
+	    if (*cur != ' ' && *cur != '\t')
 		return line;	/* Ok, no continuation line */
 	    else		/* So this is a continuation line, continue */
 		peek_for_folding = NO;
 	}
 
-
 	/* Finding end-of-line */
 
-	while (cur < end_pointer && *cur != '\n') /* Find the end-of-line */
-	    cur++;				  /* (or end-of-buffer).  */
-
+	while (cur < end_pointer && *cur != '\n')	/* Find the end-of-line */
+	    cur++;		/* (or end-of-buffer).  */
 
 	/* Terminating line */
 
 	if (cur < end_pointer) {	/* So *cur==LF, terminate line */
-	    *cur = '\0';		/* Overwrite LF */
-	    if (*(cur-1) == '\r')
-		*(cur-1) = '\0';	/* Overwrite CR */
+	    *cur = '\0';	/* Overwrite LF */
+	    if (*(cur - 1) == '\r')
+		*(cur - 1) = '\0';	/* Overwrite CR */
 	    peek_for_folding = YES;	/* Check for a continuation line */
 	}
 
-
 	/* Copying the result */
 
 	if (line)
@@ -614,7 +593,7 @@ char *HTAA_getUnfoldedLine (void)
 	else
 	    StrAllocCopy(line, start_pointer);	/* A new line */
 
-	start_pointer = cur+1;	/* Skip the read line */
+	start_pointer = cur + 1;	/* Skip the read line */
 
-    } /* forever */
+    }				/* forever */
 }
diff --git a/WWW/Library/Implementation/HTAAUtil.h b/WWW/Library/Implementation/HTAAUtil.h
index ff798af0..058d940c 100644
--- a/WWW/Library/Implementation/HTAAUtil.h
+++ b/WWW/Library/Implementation/HTAAUtil.h
@@ -33,16 +33,16 @@
 #include <HTList.h>
 
 /*
-** Numeric constants
-*/
-#define MAX_USERNAME_LEN        16      /* @@ Longest allowed username    */
-#define MAX_PASSWORD_LEN        3*13    /* @@ Longest allowed password    */
-                                        /* (encrypted, so really only 3*8)*/
-#define MAX_METHODNAME_LEN      12      /* @@ Longest allowed method name */
-#define MAX_FIELDNAME_LEN       16      /* @@ Longest field name in       */
-                                        /* protection setup file          */
-#define MAX_PATHNAME_LEN        80      /* @@ Longest passwd/group file   */
-                                        /* pathname to allow               */
+ * Numeric constants
+ */
+#define MAX_USERNAME_LEN        16	/* @@ Longest allowed username    */
+#define MAX_PASSWORD_LEN        3*13	/* @@ Longest allowed password    */
+					/* (encrypted, so really only 3*8) */
+#define MAX_METHODNAME_LEN      12	/* @@ Longest allowed method name */
+#define MAX_FIELDNAME_LEN       16	/* @@ Longest field name in       */
+					/* protection setup file          */
+#define MAX_PATHNAME_LEN        80	/* @@ Longest passwd/group file   */
+					/* pathname to allow               */
 
 /*
 
@@ -62,7 +62,7 @@ typedef enum {
     HTAA_PUBKEY,
     HTAA_KERBEROS_V4,
     HTAA_KERBEROS_V5,
-    HTAA_MAX_SCHEMES /* THIS MUST ALWAYS BE LAST! Number of schemes */
+    HTAA_MAX_SCHEMES		/* THIS MUST ALWAYS BE LAST! Number of schemes */
 } HTAAScheme;
 
 /*
@@ -84,27 +84,26 @@ Authentication Schemes
  */
 
 /* PUBLIC                                               HTAAScheme_enum()
-**              TRANSLATE SCHEME NAME TO A SCHEME ENUMERATION
-** ON ENTRY:
-**      name            is a string representing the scheme name.
-**
-** ON EXIT:
-**      returns         the enumerated constant for that scheme.
-*/
-extern HTAAScheme HTAAScheme_enum (const char* name);
-
+ *              TRANSLATE SCHEME NAME TO A SCHEME ENUMERATION
+ * ON ENTRY:
+ *      name            is a string representing the scheme name.
+ *
+ * ON EXIT:
+ *      returns         the enumerated constant for that scheme.
+ */
+extern HTAAScheme HTAAScheme_enum(const char *name);
 
 /* PUBLIC                                               HTAAScheme_name()
-**                      GET THE NAME OF A GIVEN SCHEME
-** ON ENTRY:
-**      scheme          is one of the scheme enum values:
-**                      HTAA_NONE, HTAA_BASIC, HTAA_PUBKEY, ...
-**
-** ON EXIT:
-**      returns         the name of the scheme, i.e.
-**                      "none", "basic", "pubkey", ...
-*/
-extern char *HTAAScheme_name (HTAAScheme scheme);
+ *                      GET THE NAME OF A GIVEN SCHEME
+ * ON ENTRY:
+ *      scheme          is one of the scheme enum values:
+ *                      HTAA_NONE, HTAA_BASIC, HTAA_PUBKEY, ...
+ *
+ * ON EXIT:
+ *      returns         the name of the scheme, i.e.
+ *                      "none", "basic", "pubkey", ...
+ */
+extern char *HTAAScheme_name(HTAAScheme scheme);
 
 /*
 
@@ -113,42 +112,40 @@ Methods
  */
 
 /* PUBLIC                                                   HTAAMethod_enum()
-**              TRANSLATE METHOD NAME INTO AN ENUMERATED VALUE
-** ON ENTRY:
-**      name            is the method name to translate.
-**
-** ON EXIT:
-**      returns         HTAAMethod enumerated value corresponding
-**                      to the given name.
-*/
-extern HTAAMethod HTAAMethod_enum (const char * name);
-
+ *              TRANSLATE METHOD NAME INTO AN ENUMERATED VALUE
+ * ON ENTRY:
+ *      name            is the method name to translate.
+ *
+ * ON EXIT:
+ *      returns         HTAAMethod enumerated value corresponding
+ *                      to the given name.
+ */
+extern HTAAMethod HTAAMethod_enum(const char *name);
 
 /* PUBLIC                                               HTAAMethod_name()
-**                      GET THE NAME OF A GIVEN METHOD
-** ON ENTRY:
-**      method          is one of the method enum values:
-**                      METHOD_GET, METHOD_PUT, ...
-**
-** ON EXIT:
-**      returns         the name of the scheme, i.e.
-**                      "GET", "PUT", ...
-*/
-extern char *HTAAMethod_name (HTAAMethod method);
-
+ *                      GET THE NAME OF A GIVEN METHOD
+ * ON ENTRY:
+ *      method          is one of the method enum values:
+ *                      METHOD_GET, METHOD_PUT, ...
+ *
+ * ON EXIT:
+ *      returns         the name of the scheme, i.e.
+ *                      "GET", "PUT", ...
+ */
+extern char *HTAAMethod_name(HTAAMethod method);
 
 /* PUBLIC                                               HTAAMethod_inList()
-**              IS A METHOD IN A LIST OF METHOD NAMES
-** ON ENTRY:
-**      method          is the method to look for.
-**      list            is a list of method names.
-**
-** ON EXIT:
-**      returns         YES, if method was found.
-**                      NO, if not found.
-*/
-extern BOOL HTAAMethod_inList (HTAAMethod        method,
-                                     HTList *           list);
+ *              IS A METHOD IN A LIST OF METHOD NAMES
+ * ON ENTRY:
+ *      method          is the method to look for.
+ *      list            is a list of method names.
+ *
+ * ON EXIT:
+ *      returns         YES, if method was found.
+ *                      NO, if not found.
+ */
+extern BOOL HTAAMethod_inList(HTAAMethod method, HTList *list);
+
 /*
 
 Match Template Against Filename
@@ -156,111 +153,109 @@ Match Template Against Filename
  */
 
 /* PUBLIC                                               HTAA_templateMatch()
-**              STRING COMPARISON FUNCTION FOR FILE NAMES
-**                 WITH ONE WILDCARD * IN THE TEMPLATE
-** NOTE:
-**      This is essentially the same code as in HTRules.c, but it
-**      cannot be used because it is embedded in between other code.
-**      (In fact, HTRules.c should use this routine, but then this
-**       routine would have to be more sophisticated... why is life
-**       sometimes so hard...)
-**
-** ON ENTRY:
-**      template        is a template string to match the file name
-**                      against, may contain a single wildcard
-**                      character * which matches zero or more
-**                      arbitrary characters.
-**      filename        is the filename (or pathname) to be matched
-**                      against the template.
-**
-** ON EXIT:
-**      returns         YES, if filename matches the template.
-**                      NO, otherwise.
-*/
-extern BOOL HTAA_templateMatch (const char * template,
-                                       const char * filename);
-
+ *              STRING COMPARISON FUNCTION FOR FILE NAMES
+ *                 WITH ONE WILDCARD * IN THE TEMPLATE
+ * NOTE:
+ *      This is essentially the same code as in HTRules.c, but it
+ *      cannot be used because it is embedded in between other code.
+ *      (In fact, HTRules.c should use this routine, but then this
+ *       routine would have to be more sophisticated... why is life
+ *       sometimes so hard...)
+ *
+ * ON ENTRY:
+ *      template        is a template string to match the file name
+ *                      against, may contain a single wildcard
+ *                      character * which matches zero or more
+ *                      arbitrary characters.
+ *      filename        is the filename (or pathname) to be matched
+ *                      against the template.
+ *
+ * ON EXIT:
+ *      returns         YES, if filename matches the template.
+ *                      NO, otherwise.
+ */
+extern BOOL HTAA_templateMatch(const char *template,
+			       const char *filename);
 
 /* PUBLIC                                               HTAA_templateCaseMatch()
-**              STRING COMPARISON FUNCTION FOR FILE NAMES
-**                 WITH ONE WILDCARD * IN THE TEMPLATE (Case Insensitive)
-** NOTE:
-**      This is essentially the same code as in HTAA_templateMatch, but
-**      it compares case insensitive (for VMS). Reason for this routine
-**      is that HTAA_templateMatch gets called from several places, also
-**      there where a case sensitive match is needed, so one cannot just
-**      change the HTAA_templateMatch routine for VMS.
-**
-** ON ENTRY:
-**      template        is a template string to match the file name
-**                      against, may contain a single wildcard
-**                      character * which matches zero or more
-**                      arbitrary characters.
-**      filename        is the filename (or pathname) to be matched
-**                      against the template.
-**
-** ON EXIT:
-**      returns         YES, if filename matches the template.
-**                      NO, otherwise.
-*/
-extern BOOL HTAA_templateCaseMatch (const char * template,
-                                         const char * filename);
-
+ *              STRING COMPARISON FUNCTION FOR FILE NAMES
+ *                 WITH ONE WILDCARD * IN THE TEMPLATE (Case Insensitive)
+ * NOTE:
+ *      This is essentially the same code as in HTAA_templateMatch, but
+ *      it compares case insensitive (for VMS). Reason for this routine
+ *      is that HTAA_templateMatch gets called from several places, also
+ *      there where a case sensitive match is needed, so one cannot just
+ *      change the HTAA_templateMatch routine for VMS.
+ *
+ * ON ENTRY:
+ *      template        is a template string to match the file name
+ *                      against, may contain a single wildcard
+ *                      character * which matches zero or more
+ *                      arbitrary characters.
+ *      filename        is the filename (or pathname) to be matched
+ *                      against the template.
+ *
+ * ON EXIT:
+ *      returns         YES, if filename matches the template.
+ *                      NO, otherwise.
+ */
+extern BOOL HTAA_templateCaseMatch(const char *template,
+				   const char *filename);
 
 /* PUBLIC                                       HTAA_makeProtectionTemplate()
-**              CREATE A PROTECTION TEMPLATE FOR THE FILES
-**              IN THE SAME DIRECTORY AS THE GIVEN FILE
-**              (Used by server if there is no fancier way for
-**              it to tell the client, and by browser if server
-**              didn't send WWW-ProtectionTemplate: field)
-** ON ENTRY:
-**      docname is the document pathname (from URL).
-**
-** ON EXIT:
-**      returns a template matching docname, and other files
-**              files in that directory.
-**
-**              E.g.  /foo/bar/x.html  =>  /foo/bar/ *
-**                                                  ^
-**                              Space only to prevent it from
-**                              being a comment marker here,
-**                              there really isn't any space.
-*/
-extern char *HTAA_makeProtectionTemplate (const char * docname);
+ *              CREATE A PROTECTION TEMPLATE FOR THE FILES
+ *              IN THE SAME DIRECTORY AS THE GIVEN FILE
+ *              (Used by server if there is no fancier way for
+ *              it to tell the client, and by browser if server
+ *              didn't send WWW-ProtectionTemplate: field)
+ * ON ENTRY:
+ *      docname is the document pathname (from URL).
+ *
+ * ON EXIT:
+ *      returns a template matching docname, and other files
+ *              files in that directory.
+ *
+ *              E.g.  /foo/bar/x.html  =>  /foo/bar/ *
+ *                                                  ^
+ *                              Space only to prevent it from
+ *                              being a comment marker here,
+ *                              there really isn't any space.
+ */
+extern char *HTAA_makeProtectionTemplate(const char *docname);
+
 /*
 
 MIME Argument List Parser
 
  */
 
-
 /* PUBLIC                                               HTAA_parseArgList()
-**              PARSE AN ARGUMENT LIST GIVEN IN A HEADER FIELD
-** ON ENTRY:
-**      str     is a comma-separated list:
-**
-**                      item, item, item
-**              where
-**                      item ::= value
-**                             | name=value
-**                             | name="value"
-**
-**              Leading and trailing whitespace is ignored
-**              everywhere except inside quotes, so the following
-**              examples are equal:
-**
-**                      name=value,foo=bar
-**                       name="value",foo="bar"
-**                        name = value ,  foo = bar
-**                         name = "value" ,  foo = "bar"
-**
-** ON EXIT:
-**      returns a list of name-value pairs (actually HTAssocList*).
-**              For items with no name, just value, the name is
-**              the number of order number of that item. E.g.
-**              "1" for the first, etc.
-*/
-extern HTList *HTAA_parseArgList (char * str);
+ *              PARSE AN ARGUMENT LIST GIVEN IN A HEADER FIELD
+ * ON ENTRY:
+ *      str     is a comma-separated list:
+ *
+ *                      item, item, item
+ *              where
+ *                      item ::= value
+ *                             | name=value
+ *                             | name="value"
+ *
+ *              Leading and trailing whitespace is ignored
+ *              everywhere except inside quotes, so the following
+ *              examples are equal:
+ *
+ *                      name=value,foo=bar
+ *                       name="value",foo="bar"
+ *                        name = value ,  foo = bar
+ *                         name = "value" ,  foo = "bar"
+ *
+ * ON EXIT:
+ *      returns a list of name-value pairs (actually HTAssocList*).
+ *              For items with no name, just value, the name is
+ *              the number of order number of that item. E.g.
+ *              "1" for the first, etc.
+ */
+extern HTList *HTAA_parseArgList(char *str);
 
 /*
 
@@ -269,50 +264,49 @@ Header Line Reader
  */
 
 /* PUBLIC                                               HTAA_setupReader()
-**              SET UP HEADER LINE READER, i.e., give
-**              the already-read-but-not-yet-processed
-**              buffer of text to be read before more
-**              is read from the socket.
-** ON ENTRY:
-**      start_of_headers is a pointer to a buffer containing
-**                      the beginning of the header lines
-**                      (rest will be read from a socket).
-**      length          is the number of valid characters in
-**                      'start_of_headers' buffer.
-**      soc             is the socket to use when start_of_headers
-**                      buffer is used up.
-** ON EXIT:
-**      returns         nothing.
-**                      Subsequent calls to HTAA_getUnfoldedLine()
-**                      will use this buffer first and then
-**                      proceed to read from socket.
-*/
-extern void HTAA_setupReader (char *     start_of_headers,
-                                     int        length,
-                                     int        soc);
-
+ *              SET UP HEADER LINE READER, i.e., give
+ *              the already-read-but-not-yet-processed
+ *              buffer of text to be read before more
+ *              is read from the socket.
+ * ON ENTRY:
+ *      start_of_headers is a pointer to a buffer containing
+ *                      the beginning of the header lines
+ *                      (rest will be read from a socket).
+ *      length          is the number of valid characters in
+ *                      'start_of_headers' buffer.
+ *      soc             is the socket to use when start_of_headers
+ *                      buffer is used up.
+ * ON EXIT:
+ *      returns         nothing.
+ *                      Subsequent calls to HTAA_getUnfoldedLine()
+ *                      will use this buffer first and then
+ *                      proceed to read from socket.
+ */
+extern void HTAA_setupReader(char *start_of_headers,
+			     int length,
+			     int soc);
 
 /* PUBLIC                                               HTAA_getUnfoldedLine()
-**              READ AN UNFOLDED HEADER LINE FROM SOCKET
-** ON ENTRY:
-**      HTAA_setupReader must absolutely be called before
-**      this function to set up internal buffer.
-**
-** ON EXIT:
-**      returns a newly-allocated character string representing
-**              the read line.  The line is unfolded, i.e.
-**              lines that begin with whitespace are appended
-**              to current line.  E.g.
-**
-**                      Field-Name: Blaa-Blaa
-**                       This-Is-A-Continuation-Line
-**                       Here-Is_Another
-**
-**              is seen by the caller as:
-**
-**      Field-Name: Blaa-Blaa This-Is-A-Continuation-Line Here-Is_Another
-**
-*/
-extern char *HTAA_getUnfoldedLine (void);
-
-#endif  /* NOT HTAAUTIL_H */
+ *              READ AN UNFOLDED HEADER LINE FROM SOCKET
+ * ON ENTRY:
+ *      HTAA_setupReader must absolutely be called before
+ *      this function to set up internal buffer.
+ *
+ * ON EXIT:
+ *      returns a newly-allocated character string representing
+ *              the read line.  The line is unfolded, i.e.
+ *              lines that begin with whitespace are appended
+ *              to current line.  E.g.
+ *
+ *                      Field-Name: Blaa-Blaa
+ *                       This-Is-A-Continuation-Line
+ *                       Here-Is_Another
+ *
+ *              is seen by the caller as:
+ *
+ *      Field-Name: Blaa-Blaa This-Is-A-Continuation-Line Here-Is_Another
+ *
+ */
+extern char *HTAA_getUnfoldedLine(void);
+
+#endif /* NOT HTAAUTIL_H */
diff --git a/WWW/Library/Implementation/HTAccess.c b/WWW/Library/Implementation/HTAccess.c
index c44d46af..9fb3f1de 100644
--- a/WWW/Library/Implementation/HTAccess.c
+++ b/WWW/Library/Implementation/HTAccess.c
@@ -1,35 +1,35 @@
 /*		Access Manager					HTAccess.c
-**		==============
-**
-**  Authors
-**	TBL	Tim Berners-Lee timbl@info.cern.ch
-**	JFG	Jean-Francois Groff jfg@dxcern.cern.ch
-**	DD	Denis DeLaRoca (310) 825-4580  <CSP1DWD@mvs.oac.ucla.edu>
-**	FM	Foteos Macrides macrides@sci.wfeb.edu
-**	PDM	Danny Mayer mayer@ljo.dec.com
-**
-**  History
-**	 8 Jun 92 Telnet hopping prohibited as telnet is not secure TBL
-**	26 Jun 92 When over DECnet, suppressed FTP, Gopher and News. JFG
-**	 6 Oct 92 Moved HTClientHost and logfile into here. TBL
-**	17 Dec 92 Tn3270 added, bug fix. DD
-**	 4 Feb 93 Access registration, Search escapes bad chars TBL
-**		  PARAMETERS TO HTSEARCH AND HTLOADRELATIVE CHANGED
-**	28 May 93 WAIS gateway explicit if no WAIS library linked in.
-**	31 May 94 Added DIRECT_WAIS support for VMS. FM
-**	27 Jan 95 Fixed proxy support to use NNTPSERVER for checking
-**		  whether or not to use the proxy server. PDM
-**	27 Jan 95 Ensured that proxy service will be overridden for files
-**		  on the local host (because HTLoadFile() doesn't try ftp
-**		  for those) and will substitute ftp for remote files. FM
-**	28 Jan 95 Tweaked PDM's proxy override mods to handle port info
-**		  for news and wais URL's. FM
-**
-**  Bugs
-**	This module assumes that that the graphic object is hypertext, as it
-**	needs to select it when it has been loaded.  A superclass needs to be
-**	defined which accepts select and select_anchor.
-*/
+ *		==============
+ *
+ *  Authors
+ *	TBL	Tim Berners-Lee timbl@info.cern.ch
+ *	JFG	Jean-Francois Groff jfg@dxcern.cern.ch
+ *	DD	Denis DeLaRoca (310) 825-4580  <CSP1DWD@mvs.oac.ucla.edu>
+ *	FM	Foteos Macrides macrides@sci.wfeb.edu
+ *	PDM	Danny Mayer mayer@ljo.dec.com
+ *
+ *  History
+ *	 8 Jun 92 Telnet hopping prohibited as telnet is not secure TBL
+ *	26 Jun 92 When over DECnet, suppressed FTP, Gopher and News. JFG
+ *	 6 Oct 92 Moved HTClientHost and logfile into here. TBL
+ *	17 Dec 92 Tn3270 added, bug fix. DD
+ *	 4 Feb 93 Access registration, Search escapes bad chars TBL
+ *		  PARAMETERS TO HTSEARCH AND HTLOADRELATIVE CHANGED
+ *	28 May 93 WAIS gateway explicit if no WAIS library linked in.
+ *	31 May 94 Added DIRECT_WAIS support for VMS. FM
+ *	27 Jan 95 Fixed proxy support to use NNTPSERVER for checking
+ *		  whether or not to use the proxy server. PDM
+ *	27 Jan 95 Ensured that proxy service will be overridden for files
+ *		  on the local host (because HTLoadFile() doesn't try ftp
+ *		  for those) and will substitute ftp for remote files. FM
+ *	28 Jan 95 Tweaked PDM's proxy override mods to handle port info
+ *		  for news and wais URL's. FM
+ *
+ *  Bugs
+ *	This module assumes that that the graphic object is hypertext, as it
+ *	needs to select it when it has been loaded.  A superclass needs to be
+ *	defined which accepts select and select_anchor.
+ */
 
 #ifdef VMS
 #define DIRECT_WAIS
@@ -39,13 +39,13 @@
 #include <HTTP.h>
 #include <HTAlert.h>
 /*
-**  Implements:
-*/
+ *  Implements:
+ */
 #include <HTAccess.h>
 
 /*
-**  Uses:
-*/
+ *  Uses:
+ */
 #include <HTParse.h>
 #include <HTML.h>		/* SCW */
 
@@ -54,7 +54,7 @@
 #endif
 
 #include <HTList.h>
-#include <HText.h>	/* See bugs above */
+#include <HText.h>		/* See bugs above */
 #include <HTCJK.h>
 #include <UCMap.h>
 #include <GridText.h>
@@ -65,42 +65,41 @@
 #include <LYLeaks.h>
 
 /*
-**  These flags may be set to modify the operation of this module
-*/
-char * HTClientHost = NULL; /* Name of remote login host if any */
-FILE * HTlogfile = NULL;    /* File to which to output one-liners */
-BOOL HTSecure = NO;	   /* Disable access for telnet users? */
-BOOL HTPermitRedir = NO;	   /* Always allow redirection in getfile()? */
+ *  These flags may be set to modify the operation of this module
+ */
+char *HTClientHost = NULL;	/* Name of remote login host if any */
+FILE *HTlogfile = NULL;		/* File to which to output one-liners */
+BOOL HTSecure = NO;		/* Disable access for telnet users? */
+BOOL HTPermitRedir = NO;	/* Always allow redirection in getfile()? */
 
-BOOL using_proxy = NO; /* are we using a proxy gateway? */
+BOOL using_proxy = NO;		/* are we using a proxy gateway? */
 
 /*
-**  To generate other things, play with these:
-*/
+ *  To generate other things, play with these:
+ */
 HTFormat HTOutputFormat = NULL;
-HTStream* HTOutputStream = NULL; /* For non-interactive, set this */
+HTStream *HTOutputStream = NULL;	/* For non-interactive, set this */
 
-static HTList * protocols = NULL; /* List of registered protocol descriptors */
+static HTList *protocols = NULL;	/* List of registered protocol descriptors */
 
 char *use_this_url_instead = NULL;
 
-static int pushed_assume_LYhndl = -1; /* see LYUC* functions below - kw */
-static char * pushed_assume_MIMEname = NULL;
+static int pushed_assume_LYhndl = -1;	/* see LYUC* functions below - kw */
+static char *pushed_assume_MIMEname = NULL;
 
 #ifdef LY_FIND_LEAKS
-static void free_protocols (void)
+static void free_protocols(void)
 {
     HTList_delete(protocols);
     protocols = NULL;
-    FREE(pushed_assume_MIMEname); /* shouldn't happen, just in case - kw */
+    FREE(pushed_assume_MIMEname);	/* shouldn't happen, just in case - kw */
 }
 #endif /* LY_FIND_LEAKS */
 
 /*	Register a Protocol.				HTRegisterProtocol()
-**	--------------------
-*/
-BOOL HTRegisterProtocol (
-	HTProtocol *	protocol)
+ *	--------------------
+ */
+BOOL HTRegisterProtocol(HTProtocol * protocol)
 {
     if (!protocols) {
 	protocols = HTList_new();
@@ -112,19 +111,18 @@ BOOL HTRegisterProtocol (
     return YES;
 }
 
-
 /*	Register all known protocols.			HTAccessInit()
-**	-----------------------------
-**
-**	Add to or subtract from this list if you add or remove protocol
-**	modules.  This routine is called the first time the protocol list
-**	is needed, unless any protocols are already registered, in which
-**	case it is not called.	Therefore the application can override
-**	this list.
-**
-**	Compiling with NO_INIT prevents all known protocols from being
-**	forced in at link time.
-*/
+ *	-----------------------------
+ *
+ *	Add to or subtract from this list if you add or remove protocol
+ *	modules.  This routine is called the first time the protocol list
+ *	is needed, unless any protocols are already registered, in which
+ *	case it is not called.	Therefore the application can override
+ *	this list.
+ *
+ *	Compiling with NO_INIT prevents all known protocols from being
+ *	forced in at link time.
+ */
 #ifndef NO_INIT
 #ifdef GLOBALREF_IS_MACRO
 extern GLOBALREF (HTProtocol, HTTP);
@@ -133,6 +131,7 @@ extern GLOBALREF (HTProtocol, HTFile);
 extern GLOBALREF (HTProtocol, HTTelnet);
 extern GLOBALREF (HTProtocol, HTTn3270);
 extern GLOBALREF (HTProtocol, HTRlogin);
+
 #ifndef DECNET
 #ifndef DISABLE_FTP
 extern GLOBALREF (HTProtocol, HTFTP);
@@ -159,6 +158,7 @@ extern GLOBALREF (HTProtocol, HTWAIS);
 #endif /* !DECNET */
 #else
 GLOBALREF HTProtocol HTTP, HTTPS, HTFile, HTTelnet, HTTn3270, HTRlogin;
+
 #ifndef DECNET
 #ifndef DISABLE_FTP
 GLOBALREF HTProtocol HTFTP;
@@ -174,12 +174,12 @@ GLOBALREF HTProtocol HTGopher, HTCSO;
 GLOBALREF HTProtocol HTFinger;
 #endif /* not DISABLE_FINGER */
 #ifdef DIRECT_WAIS
-GLOBALREF  HTProtocol HTWAIS;
+GLOBALREF HTProtocol HTWAIS;
 #endif /* DIRECT_WAIS */
 #endif /* !DECNET */
 #endif /* GLOBALREF_IS_MACRO */
 
-static void HTAccessInit (void)			/* Call me once */
+static void HTAccessInit(void)	/* Call me once */
 {
     HTRegisterProtocol(&HTTP);
     HTRegisterProtocol(&HTTPS);
@@ -216,30 +216,29 @@ static void HTAccessInit (void)			/* Call me once */
 #endif /* !NO_INIT */
 
 /*	Check for proxy override.			override_proxy()
-**	-------------------------
-**
-**	Check the no_proxy environment variable to get the list
-**	of hosts for which proxy server is not consulted.
-**
-**	no_proxy is a comma- or space-separated list of machine
-**	or domain names, with optional :port part.  If no :port
-**	part is present, it applies to all ports on that domain.
-**
-**  Example:
-**	    no_proxy="cern.ch,some.domain:8001"
-**
-**  Use "*" to override all proxy service:
-**	     no_proxy="*"
-*/
-BOOL override_proxy (
-	const char *	addr)
+ *	-------------------------
+ *
+ *	Check the no_proxy environment variable to get the list
+ *	of hosts for which proxy server is not consulted.
+ *
+ *	no_proxy is a comma- or space-separated list of machine
+ *	or domain names, with optional :port part.  If no :port
+ *	part is present, it applies to all ports on that domain.
+ *
+ *  Example:
+ *	    no_proxy="cern.ch,some.domain:8001"
+ *
+ *  Use "*" to override all proxy service:
+ *	     no_proxy="*"
+ */
+BOOL override_proxy(const char *addr)
 {
-    const char * no_proxy = getenv("no_proxy");
-    char * p = NULL;
-    char * at = NULL;
-    char * host = NULL;
-    char * Host = NULL;
-    char * acc_method = NULL;
+    const char *no_proxy = getenv("no_proxy");
+    char *p = NULL;
+    char *at = NULL;
+    char *host = NULL;
+    char *Host = NULL;
+    char *acc_method = NULL;
     int port = 0;
     int h_len = 0;
 
@@ -252,10 +251,9 @@ BOOL override_proxy (
     }
 
     /*
-     *	Never proxy file:// URLs if they are on the local host.
-     *	HTLoadFile() will not attempt ftp for those if direct
-     *	access fails.  We'll check that first, in case no_proxy
-     *	hasn't been defined. - FM
+     * Never proxy file:// URLs if they are on the local host.  HTLoadFile()
+     * will not attempt ftp for those if direct access fails.  We'll check that
+     * first, in case no_proxy hasn't been defined.  - FM
      */
     if (!addr)
 	return NO;
@@ -265,7 +263,7 @@ BOOL override_proxy (
 	FREE(host);
 	return NO;
     }
-    Host = (((at = strchr(host, '@')) != NULL) ? (at+1) : host);
+    Host = (((at = strchr(host, '@')) != NULL) ? (at + 1) : host);
 
     if ((acc_method = HTParse(addr, "", PARSE_ACCESS))) {
 	if (!strcmp("file", acc_method) &&
@@ -284,11 +282,12 @@ BOOL override_proxy (
     }
 
     if (NULL != (p = strrchr(Host, ':'))) {	/* Port specified */
-	*p++ = 0;				/* Chop off port */
+	*p++ = 0;		/* Chop off port */
 	port = atoi(p);
-    } else {					/* Use default port */
+    } else {			/* Use default port */
 	acc_method = HTParse(addr, "", PARSE_ACCESS);
 	if (acc_method != NULL) {
+	    /* *INDENT-OFF* */
 	    if	    (!strcmp(acc_method, "http"))	port = 80;
 	    else if (!strcmp(acc_method, "https"))	port = 443;
 	    else if (!strcmp(acc_method, "ftp"))	port = 21;
@@ -312,50 +311,52 @@ BOOL override_proxy (
 	    else if (!strcmp(acc_method, "telnet"))	port = 23;
 	    else if (!strcmp(acc_method, "tn3270"))	port = 23;
 	    else if (!strcmp(acc_method, "rlogin"))	port = 513;
+	    /* *INDENT-ON* */
+
 	    FREE(acc_method);
 	}
     }
     if (!port)
-	port = 80;		    /* Default */
+	port = 80;		/* Default */
     h_len = strlen(Host);
 
     while (*no_proxy) {
-	const char * end;
-	const char * colon = NULL;
+	const char *end;
+	const char *colon = NULL;
 	int templ_port = 0;
 	int t_len;
 
 	while (*no_proxy && (WHITE(*no_proxy) || *no_proxy == ','))
-	    no_proxy++;		    /* Skip whitespace and separators */
+	    no_proxy++;		/* Skip whitespace and separators */
 
 	end = no_proxy;
 	while (*end && !WHITE(*end) && *end != ',') {	/* Find separator */
-	    if (*end == ':') colon = end;		/* Port number given */
+	    if (*end == ':')
+		colon = end;	/* Port number given */
 	    end++;
 	}
 
 	if (colon) {
-	    templ_port = atoi(colon+1);
+	    templ_port = atoi(colon + 1);
 	    t_len = colon - no_proxy;
-	}
-	else {
+	} else {
 	    t_len = end - no_proxy;
 	}
 
-	if ((!templ_port || templ_port == port)  &&
-	    (t_len > 0	&&  t_len <= h_len  &&
+	if ((!templ_port || templ_port == port) &&
+	    (t_len > 0 && t_len <= h_len &&
 	     !strncasecomp(Host + h_len - t_len, no_proxy, t_len))) {
 	    FREE(host);
 	    return YES;
 	}
-#ifdef CJK_EX	/* ASATAKU PROXY HACK */
-	if ((!templ_port || templ_port == port)	 &&
-	    (t_len > 0	&&  t_len <= h_len  &&
+#ifdef CJK_EX			/* ASATAKU PROXY HACK */
+	if ((!templ_port || templ_port == port) &&
+	    (t_len > 0 && t_len <= h_len &&
 	     isdigit(UCH(*no_proxy)) && !strncmp(host, no_proxy, t_len))) {
 	    FREE(host);
 	    return YES;
 	}
-#endif	/* ASATAKU PROXY HACK */
+#endif /* ASATAKU PROXY HACK */
 
 	if (*end)
 	    no_proxy = (end + 1);
@@ -368,31 +369,30 @@ BOOL override_proxy (
 }
 
 /*	Find physical name and access protocol		get_physical()
-**	--------------------------------------
-**
-**  On entry,
-**	addr		must point to the fully qualified hypertext reference.
-**	anchor		a parent anchor with whose address is addr
-**
-**  On exit,
-**	returns		HT_NO_ACCESS		Error has occurred.
-**			HT_OK			Success
-*/
-static int get_physical (
-	const char *		addr,
-	HTParentAnchor *	anchor)
+ *	--------------------------------------
+ *
+ *  On entry,
+ *	addr		must point to the fully qualified hypertext reference.
+ *	anchor		a parent anchor with whose address is addr
+ *
+ *  On exit,
+ *	returns		HT_NO_ACCESS		Error has occurred.
+ *			HT_OK			Success
+ */
+static int get_physical(const char *addr,
+			HTParentAnchor *anchor)
 {
     int result;
-    char * acc_method = NULL;	/* Name of access method */
-    char * physical = NULL;
-    char * Server_addr = NULL;
+    char *acc_method = NULL;	/* Name of access method */
+    char *physical = NULL;
+    char *Server_addr = NULL;
     BOOL override_flag = NO;
 
     CTRACE((tfp, "get_physical %s\n", addr));
 
     /*
-    **	Make sure the using_proxy variable is FALSE.
-    */
+     * Make sure the using_proxy variable is FALSE.
+     */
     using_proxy = NO;
 
 #ifndef NO_RULES
@@ -415,14 +415,14 @@ static int get_physical (
     } else {
 	HTAnchor_setPhysical(anchor, physical);
     }
-    FREE(physical);			/* free our copy */
+    FREE(physical);		/* free our copy */
 #else
     if (anchor->isISMAPScript == TRUE) {
 	StrAllocCopy(physical, addr);
 	StrAllocCat(physical, "?0,0");
 	CTRACE((tfp, "HTAccess: Appending '?0,0' coordinate pair.\n"));
 	HTAnchor_setPhysical(anchor, physical);
-	FREE(physical);			/* free our copy */
+	FREE(physical);		/* free our copy */
     } else {
 	HTAnchor_setPhysical(anchor, addr);
     }
@@ -431,24 +431,25 @@ static int get_physical (
     acc_method = HTParse(HTAnchor_physical(anchor), STR_FILE_URL, PARSE_ACCESS);
 
     /*
-    **	Check whether gateway access has been set up for this.
-    **
-    **	This function can be replaced by the rule system above.
-    **
-    **  If the rule system has already determined that we should
-    **  use a proxy, or that we shouldn't, ignore proxy-related
-    **  settings, don't use no_proxy either.
-    */
+     * Check whether gateway access has been set up for this.
+     *
+     * This function can be replaced by the rule system above.
+     *
+     * If the rule system has already determined that we should use a proxy, or
+     * that we shouldn't, ignore proxy-related settings, don't use no_proxy
+     * either.
+     */
 #define USE_GATEWAYS
 #ifdef USE_GATEWAYS
 
-    if (!override_flag && !using_proxy) {   /* else ignore no_proxy env var */
+    if (!override_flag && !using_proxy) {	/* else ignore no_proxy env var */
 	if (!strcasecomp(acc_method, "news")) {
 	    /*
-	    **  News is different, so we need to check the name of the server,
-	    **  as well as the default port for selective exclusions.
-	    */
+	     * News is different, so we need to check the name of the server,
+	     * as well as the default port for selective exclusions.
+	     */
 	    char *host = NULL;
+
 	    if ((host = HTParse(addr, "", PARSE_HOST))) {
 		if (strchr(host, ':') == NULL) {
 		    StrAllocCopy(Server_addr, "news://");
@@ -463,10 +464,11 @@ static int get_physical (
 	    }
 	} else if (!strcasecomp(acc_method, "wais")) {
 	    /*
-	    **  Wais also needs checking of the default port
-	    **  for selective exclusions.
-	    */
+	     * Wais also needs checking of the default port for selective
+	     * exclusions.
+	     */
 	    char *host = NULL;
+
 	    if ((host = HTParse(addr, "", PARSE_HOST))) {
 		if (!(strchr(host, ':'))) {
 		    StrAllocCopy(Server_addr, "wais://");
@@ -474,8 +476,7 @@ static int get_physical (
 		    StrAllocCat(Server_addr, ":210/");
 		}
 		FREE(host);
-	    }
-	    else
+	    } else
 		StrAllocCopy(Server_addr, addr);
 	} else {
 	    StrAllocCopy(Server_addr, addr);
@@ -484,21 +485,21 @@ static int get_physical (
     }
 
     if (!override_flag && !using_proxy) {
-	char * gateway_parameter = NULL, *gateway, *proxy;
+	char *gateway_parameter = NULL, *gateway, *proxy;
 
 	/*
-	**  Search for gateways.
-	*/
+	 * Search for gateways.
+	 */
 	HTSprintf0(&gateway_parameter, "WWW_%s_GATEWAY", acc_method);
-	gateway = LYGetEnv(gateway_parameter); /* coerce for decstation */
+	gateway = LYGetEnv(gateway_parameter);	/* coerce for decstation */
 
 	/*
-	**  Search for proxy servers.
-	*/
+	 * Search for proxy servers.
+	 */
 	if (!strcmp(acc_method, "file"))
 	    /*
-	    ** If we got to here, a file URL is for ftp on a remote host. - FM
-	    */
+	     * If we got to here, a file URL is for ftp on a remote host. - FM
+	     */
 	    strcpy(gateway_parameter, "ftp_proxy");
 	else
 	    sprintf(gateway_parameter, "%s_proxy", acc_method);
@@ -511,13 +512,15 @@ static int get_physical (
 	    CTRACE((tfp, "proxy server found: %s\n", proxy));
 
 	/*
-	**  Proxy servers have precedence over gateway servers.
-	*/
+	 * Proxy servers have precedence over gateway servers.
+	 */
 	if (proxy) {
-	    char * gatewayed = NULL;
-	    StrAllocCopy(gatewayed,proxy);
+	    char *gatewayed = NULL;
+
+	    StrAllocCopy(gatewayed, proxy);
 	    if (!strncmp(gatewayed, "http", 4)) {
 		char *cp = strrchr(gatewayed, '/');
+
 		/* Append a slash to the proxy specification if it doesn't
 		 * end in one but otherwise looks normal (starts with "http",
 		 * has no '/' other than ones before the hostname). - kw */
@@ -525,8 +528,8 @@ static int get_physical (
 		    LYAddHtmlSep(&gatewayed);
 	    }
 	    /*
-	    ** Ensure that the proxy server uses ftp for file URLs. - FM
-	    */
+	     * Ensure that the proxy server uses ftp for file URLs. - FM
+	     */
 	    if (!strncmp(addr, "file", 4)) {
 		StrAllocCat(gatewayed, "ftp");
 		StrAllocCat(gatewayed, (addr + 4));
@@ -543,10 +546,12 @@ static int get_physical (
 				 STR_HTTP_URL, PARSE_ACCESS);
 
 	} else if (gateway) {
-	    char * path = HTParse(addr, "",
-		PARSE_HOST + PARSE_PATH + PARSE_PUNCTUATION);
-		/* Chop leading / off to make host into part of path */
-	    char * gatewayed = HTParse(path+1, gateway, PARSE_ALL);
+	    char *path = HTParse(addr, "",
+				 PARSE_HOST + PARSE_PATH + PARSE_PUNCTUATION);
+
+	    /* Chop leading / off to make host into part of path */
+	    char *gatewayed = HTParse(path + 1, gateway, PARSE_ALL);
+
 	    FREE(path);
 	    HTAnchor_setPhysical(anchor, gatewayed);
 	    FREE(gatewayed);
@@ -560,17 +565,20 @@ static int get_physical (
 #endif /* use gateways */
 
     /*
-    **	Search registered protocols to find suitable one.
-    */
+     * Search registered protocols to find suitable one.
+     */
     result = HT_NO_ACCESS;
     {
 	int i, n;
+
 #ifndef NO_INIT
-	if (!protocols) HTAccessInit();
+	if (!protocols)
+	    HTAccessInit();
 #endif
 	n = HTList_count(protocols);
 	for (i = 0; i < n; i++) {
-	    HTProtocol *p = (HTProtocol *)HTList_objectAt(protocols, i);
+	    HTProtocol *p = (HTProtocol *) HTList_objectAt(protocols, i);
+
 	    if (!strcmp(p->name, acc_method)) {
 		HTAnchor_setProtocol(anchor, p);
 		FREE(acc_method);
@@ -585,19 +593,17 @@ static int get_physical (
 }
 
 /*
- *  Temporarily set the int UCLYhndl_for_unspec and string
- *  UCLYhndl_for_unspec used for charset "assuming" to the values
- *  implied by a HTParentAnchor's UCStages, after saving the current
- *  values for later restoration. - kw
- *  @@@ These functions may not really belong here, but where else?
- *  I want the "pop" to occur as soon as possible after loading
- *  has finished. - kw @@@
+ * Temporarily set the int UCLYhndl_for_unspec and string UCLYhndl_for_unspec
+ * used for charset "assuming" to the values implied by a HTParentAnchor's
+ * UCStages, after saving the current values for later restoration.  - kw @@@
+ * These functions may not really belong here, but where else?  I want the
+ * "pop" to occur as soon as possible after loading has finished.  - kw @@@
  */
-void LYUCPushAssumed (
-    HTParentAnchor *	anchor)
+void LYUCPushAssumed(HTParentAnchor *anchor)
 {
     int anchor_LYhndl = -1;
-    LYUCcharset * anchor_UCI = NULL;
+    LYUCcharset *anchor_UCI = NULL;
+
     if (anchor) {
 	anchor_LYhndl = HTAnchor_getUCLYhndl(anchor, UCT_STAGE_PARSER);
 	if (anchor_LYhndl >= 0)
@@ -609,11 +615,12 @@ void LYUCPushAssumed (
 	    if (HTCJK == JAPANESE)
 		StrAllocCopy(UCAssume_MIMEcharset, pushed_assume_MIMEname);
 	    else
-	    StrAllocCopy(UCAssume_MIMEcharset, anchor_UCI->MIMEname);
+		StrAllocCopy(UCAssume_MIMEcharset, anchor_UCI->MIMEname);
 	    pushed_assume_LYhndl = anchor_LYhndl;
 	    /* some diagnostics */
 	    if (UCLYhndl_for_unspec != anchor_LYhndl)
-	    CTRACE((tfp, "LYUCPushAssumed: UCLYhndl_for_unspec changed %d -> %d\n",
+		CTRACE((tfp,
+			"LYUCPushAssumed: UCLYhndl_for_unspec changed %d -> %d\n",
 			UCLYhndl_for_unspec,
 			anchor_LYhndl));
 	    UCLYhndl_for_unspec = anchor_LYhndl;
@@ -623,18 +630,19 @@ void LYUCPushAssumed (
     pushed_assume_LYhndl = -1;
     FREE(pushed_assume_MIMEname);
 }
+
 /*
- *  Restore the int UCLYhndl_for_unspec and string
- *  UCLYhndl_for_unspec used for charset "assuming" from the values
- *  saved by LYUCPushAssumed, if any. - kw
+ * Restore the int UCLYhndl_for_unspec and string UCLYhndl_for_unspec used for
+ * charset "assuming" from the values saved by LYUCPushAssumed, if any.  - kw
  */
-int LYUCPopAssumed (void)
+int LYUCPopAssumed(void)
 {
 
     if (pushed_assume_LYhndl >= 0) {
 	/* some diagnostics */
 	if (UCLYhndl_for_unspec != pushed_assume_LYhndl)
-	CTRACE((tfp, "LYUCPopAssumed: UCLYhndl_for_unspec changed %d -> %d\n",
+	    CTRACE((tfp,
+		    "LYUCPopAssumed: UCLYhndl_for_unspec changed %d -> %d\n",
 		    UCLYhndl_for_unspec,
 		    pushed_assume_LYhndl));
 	UCLYhndl_for_unspec = pushed_assume_LYhndl;
@@ -648,113 +656,109 @@ int LYUCPopAssumed (void)
 }
 
 /*	Load a document					HTLoad()
-**	---------------
-**
-**	This is an internal routine, which has an address AND a matching
-**	anchor.  (The public routines are called with one OR the other.)
-**
-**  On entry,
-**	addr		must point to the fully qualified hypertext reference.
-**	anchor		a parent anchor with whose address is addr
-**
-**  On exit,
-**	returns		<0		Error has occurred.
-**			HT_LOADED	Success
-**			HT_NO_DATA	Success, but no document loaded.
-**					(telnet session started etc)
-*/
-static int HTLoad (
-	const char *		addr,
-	HTParentAnchor *	anchor,
-	HTFormat		format_out,
-	HTStream *		sink)
+ *	---------------
+ *
+ *	This is an internal routine, which has an address AND a matching
+ *	anchor.  (The public routines are called with one OR the other.)
+ *
+ *  On entry,
+ *	addr		must point to the fully qualified hypertext reference.
+ *	anchor		a parent anchor with whose address is addr
+ *
+ *  On exit,
+ *	returns		<0		Error has occurred.
+ *			HT_LOADED	Success
+ *			HT_NO_DATA	Success, but no document loaded.
+ *					(telnet session started etc)
+ */
+static int HTLoad(const char *addr,
+		  HTParentAnchor *anchor,
+		  HTFormat format_out,
+		  HTStream *sink)
 {
     HTProtocol *p;
     int status = get_physical(addr, anchor);
+
     if (status == HT_FORBIDDEN) {
-	 /* prevent crash if telnet or similar was forbidden by rule. - kw */
+	/* prevent crash if telnet or similar was forbidden by rule. - kw */
 	LYFixCursesOn("show alert:");
 	return HTLoadError(sink, 500, gettext("Access forbidden by rule"));
     } else if (status == HT_REDIRECTING) {
-	return status;	/* fake redirection by rule, to redirecting_url */
+	return status;		/* fake redirection by rule, to redirecting_url */
     }
     if (status < 0)
-	return status;	/* Can't resolve or forbidden */
+	return status;		/* Can't resolve or forbidden */
 
     /* prevent crash if telnet or similar mapped or proxied by rule. - kw */
     LYFixCursesOnForAccess(addr, HTAnchor_physical(anchor));
-    p = (HTProtocol *)HTAnchor_protocol(anchor);
-    anchor->parent->underway = TRUE;		/* Hack to deal with caching */
-    status= p->load(HTAnchor_physical(anchor),
-			anchor, format_out, sink);
+    p = (HTProtocol *) HTAnchor_protocol(anchor);
+    anchor->parent->underway = TRUE;	/* Hack to deal with caching */
+    status = p->load(HTAnchor_physical(anchor),
+		     anchor, format_out, sink);
     anchor->parent->underway = FALSE;
     LYUCPopAssumed();
     return status;
 }
 
 /*	Get a save stream for a document		HTSaveStream()
-**	--------------------------------
-*/
-HTStream *HTSaveStream (
-	HTParentAnchor *	anchor)
+ *	--------------------------------
+ */
+HTStream *HTSaveStream(HTParentAnchor *anchor)
 {
-    HTProtocol *p = (HTProtocol *)HTAnchor_protocol(anchor);
+    HTProtocol *p = (HTProtocol *) HTAnchor_protocol(anchor);
+
     if (!p)
 	return NULL;
 
     return p->saveStream(anchor);
 }
 
-int redirection_attempts = 0; /* counter in HTLoadDocument */
+int redirection_attempts = 0;	/* counter in HTLoadDocument */
 
 /*	Load a document - with logging etc		HTLoadDocument()
-**	----------------------------------
-**
-**	- Checks or documents already loaded
-**	- Logs the access
-**	- Allows stdin filter option
-**	- Trace output and error messages
-**
-**  On Entry,
-**	  anchor	    is the node_anchor for the document
-**	  full_address	    The address of the document to be accessed.
-**	  filter	    if YES, treat stdin as HTML
-**
-**  On Exit,
-**	  returns    YES     Success in opening document
-**		     NO      Failure
-*/
-
-static BOOL HTLoadDocument (
-	const char *		full_address, /* may include #fragment */
-	HTParentAnchor *	anchor,
-	HTFormat		format_out,
-	HTStream*		sink)
+ *	----------------------------------
+ *
+ *	- Checks or documents already loaded
+ *	- Logs the access
+ *	- Allows stdin filter option
+ *	- Trace output and error messages
+ *
+ *  On Entry,
+ *	  anchor	    is the node_anchor for the document
+ *	  full_address	    The address of the document to be accessed.
+ *	  filter	    if YES, treat stdin as HTML
+ *
+ *  On Exit,
+ *	  returns    YES     Success in opening document
+ *		     NO      Failure
+ */
+static BOOL HTLoadDocument(const char *full_address,	/* may include #fragment */
+			   HTParentAnchor *anchor,
+			   HTFormat format_out,
+			   HTStream *sink)
 {
-    int     status;
-    HText * text;
-    const char * address_to_load = full_address;
+    int status;
+    HText *text;
+    const char *address_to_load = full_address;
     char *cp;
     BOOL ForcingNoCache = LYforce_no_cache;
 
     CTRACE((tfp, "HTAccess: loading document %s\n", address_to_load));
 
     /*
-    **	Free use_this_url_instead and reset permanent_redirection
-    **	if not done elsewhere. - FM
-    */
+     * Free use_this_url_instead and reset permanent_redirection if not done
+     * elsewhere.  - FM
+     */
     FREE(use_this_url_instead);
     permanent_redirection = FALSE;
 
     /*
-    **	Make sure some yoyo doesn't send us 'round in circles
-    **	with redirecting URLs that point back to themselves.
-    **	We'll set the original Lynx limit of 10 redirections
-    **	per requested URL from a user, because the HTTP/1.1
-    **	will no longer specify a restriction to 5, but will
-    **	leave it up to the browser's discretion, in deference
-    **	to Microsoft.  - FM
-    */
+     * Make sure some yoyo doesn't send us 'round in circles with redirecting
+     * URLs that point back to themselves.  We'll set the original Lynx limit
+     * of 10 redirections per requested URL from a user, because the HTTP/1.1
+     * will no longer specify a restriction to 5, but will leave it up to the
+     * browser's discretion, in deference to Microsoft.  - FM
+     */
     if (redirection_attempts > 10) {
 	redirection_attempts = 0;
 	HTAlert(TOO_MANY_REDIRECTIONS);
@@ -762,17 +766,16 @@ static BOOL HTLoadDocument (
     }
 
     /*
-     *	If this is marked as an internal link but we don't have the
-     *	document loaded any more, and we haven't explicitly flagged
-     *	that we want to reload with LYforce_no_cache, then something
-     *	has disappeared from the cache when we expected it to be still
-     *	there.	The user probably doesn't expect a new network access.
-     *	So if we have POST data and safe is not set in the anchor,
-     *	ask for confirmation, and fail if not granted.	The exception
-     *	are LYNXIMGMAP documents, for which we defer to LYLoadIMGmap
-     *	for prompting if necessary. - kw
+     * If this is marked as an internal link but we don't have the document
+     * loaded any more, and we haven't explicitly flagged that we want to
+     * reload with LYforce_no_cache, then something has disappeared from the
+     * cache when we expected it to be still there.  The user probably doesn't
+     * expect a new network access.  So if we have POST data and safe is not
+     * set in the anchor, ask for confirmation, and fail if not granted.  The
+     * exception are LYNXIMGMAP documents, for which we defer to LYLoadIMGmap
+     * for prompting if necessary.  - kw
      */
-    text = (HText *)HTAnchor_document(anchor);
+    text = (HText *) HTAnchor_document(anchor);
     if (LYinternal_flag && !text && !LYforce_no_cache &&
 	anchor->post_data && !anchor->safe &&
 	!isLYNXIMGMAP(full_address) &&
@@ -782,24 +785,24 @@ static BOOL HTLoadDocument (
     }
 
     /*
-    **	If we don't have POST content, check whether this is a previous
-    **	redirecting URL, and keep re-checking until we get to the final
-    **	destination or redirection limit.  If we do have POST content,
-    **	we didn't allow permanent redirection, and an interactive user
-    **	will be deciding whether to keep redirecting. - FM
-    */
+     * If we don't have POST content, check whether this is a previous
+     * redirecting URL, and keep re-checking until we get to the final
+     * destination or redirection limit.  If we do have POST content, we didn't
+     * allow permanent redirection, and an interactive user will be deciding
+     * whether to keep redirecting.  - FM
+     */
     if (!anchor->post_data) {
 	while ((cp = HTAnchor_physical(anchor)) != NULL &&
 	       !strncmp(cp, "Location=", 9)) {
 	    DocAddress NewDoc;
 
 	    CTRACE((tfp, "HTAccess: '%s' is a redirection URL.\n",
-			  anchor->address));
-	    CTRACE((tfp, "HTAccess: Redirecting to '%s'\n", cp+9));
+		    anchor->address));
+	    CTRACE((tfp, "HTAccess: Redirecting to '%s'\n", cp + 9));
 
 	    /*
-	    **	Don't exceed the redirection_attempts limit. - FM
-	    */
+	     * Don't exceed the redirection_attempts limit.  - FM
+	     */
 	    if (++redirection_attempts > 10) {
 		HTAlert(TOO_MANY_REDIRECTIONS);
 		redirection_attempts = 0;
@@ -808,9 +811,9 @@ static BOOL HTLoadDocument (
 	    }
 
 	    /*
-	    ** Set up the redirection. - FM
-	    **/
-	    StrAllocCopy(use_this_url_instead, cp+9);
+	     * Set up the redirection. - FM
+	     */
+	    StrAllocCopy(use_this_url_instead, cp + 9);
 	    NewDoc.address = use_this_url_instead;
 	    NewDoc.post_data = NULL;
 	    NewDoc.post_content_type = NULL;
@@ -821,70 +824,66 @@ static BOOL HTLoadDocument (
 	}
     }
     /*
-    **	If we had previous redirection, go back and check out
-    **	that the URL under the current restrictions. - FM
-    */
+     * If we had previous redirection, go back and check out that the URL under
+     * the current restrictions.  - FM
+     */
     if (use_this_url_instead) {
 	FREE(redirecting_url);
-	return(NO);
+	return (NO);
     }
 
     /*
-    **	See if we can use an already loaded document.
-    */
-    text = (HText *)HTAnchor_document(anchor);
+     * See if we can use an already loaded document.
+     */
+    text = (HText *) HTAnchor_document(anchor);
     if (text && !LYforce_no_cache) {
 	/*
-	**  We have a cached rendition of the target document.
-	**  Check if it's OK to re-use it.  We consider it OK if:
-	**   (1) the anchor does not have the no_cache element set, or
-	**   (2) we've overridden it, e.g., because we are acting on
-	**	 a PREV_DOC command or a link in the History Page and
-	**	 it's not a reply from a POST with the LYresubmit_posts
-	**	 flag set, or
-	**   (3) we are repositioning within the currently loaded document
-	**	 based on the target anchor's address (URL_Reference).
-	*
-	*    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 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) 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
-	*    for a client-side image map is regenerated, when in some cases
-	*    it should (e.g., user requested RELOAD, or HTTP response with
-	*    no-cache header and we are not overriding).
-	*
-	*    If DONT_TRACK_INTERNAL_LINKS is undefined, a target address that
-	*    points to the same URL as the current document may still result in
-	*    reloading, depending on whether the original URL-Reference
-	*    was given as an internal link in the context of the previously
-	*    loaded document.  HText_AreDifferent() is not used here for
-	*    testing whether we are just repositioning.  For an internal
-	*    link, the potential callers of this function from mainloop()
-	*    down will either avoid making the call (and do the repositioning
-	*    differently) or set LYinternal_flag (or LYoverride_no_cache).
-	*    Note that (a) LYNXIMGMAP pseudo-documents and (b) The "List Page"
-	*    document are treated logically as being part of the document on
-	*    which they are based, for the purpose of whether to treat a link
-	*    as internal, but the logic for this (by setting LYinternal_flag
-	*    as necessary) is implemented elsewhere.  There is a specific
-	*    test for LYNXIMGMAP here so that the generated pseudo-document
-	*    will not be re-used unless LYoverride_no_cache is set.  The same
-	*    caveat as above applies w.r.t. reloading of the underlying
-	*    resource.
-	*
-	**  We also should be checking other aspects of cache
-	**  regulation (e.g., based on an If-Modified-Since check,
-	**  etc.) but the code for doing those other things isn't
-	**  available yet.
-	*/
+	 * We have a cached rendition of the target document.  Check if it's OK
+	 * to re-use it.  We consider it OK if:
+	 * (1) the anchor does not have the no_cache element set, or
+	 * (2) we've overridden it, e.g., because we are acting on a PREV_DOC
+	 * command or a link in the History Page and it's not a reply from a
+	 * POST with the LYresubmit_posts flag set, or
+	 * (3) we are repositioning within the currently loaded document based
+	 * on the target anchor's address (URL_Reference).
+	 *
+	 * 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
+	 * 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) 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 for a
+	 * client-side image map is regenerated, when in some cases it should
+	 * (e.g., user requested RELOAD, or HTTP response with no-cache header
+	 * and we are not overriding).
+	 *
+	 * If DONT_TRACK_INTERNAL_LINKS is undefined, a target address that
+	 * points to the same URL as the current document may still result in
+	 * reloading, depending on whether the original URL-Reference was given
+	 * as an internal link in the context of the previously loaded
+	 * document.  HText_AreDifferent() is not used here for testing whether
+	 * we are just repositioning.  For an internal link, the potential
+	 * callers of this function from mainloop() down will either avoid
+	 * making the call (and do the repositioning differently) or set
+	 * LYinternal_flag (or LYoverride_no_cache).  Note that (a) LYNXIMGMAP
+	 * pseudo-documents and (b) The "List Page" document are treated
+	 * logically as being part of the document on which they are based, for
+	 * the purpose of whether to treat a link as internal, but the logic
+	 * for this (by setting LYinternal_flag as necessary) is implemented
+	 * elsewhere.  There is a specific test for LYNXIMGMAP here so that the
+	 * generated pseudo-document will not be re-used unless
+	 * LYoverride_no_cache is set.  The same caveat as above applies w.r.t. 
+	 * reloading of the underlying resource.
+	 *
+	 * We also should be checking other aspects of cache regulation (e.g.,
+	 * based on an If-Modified-Since check, etc.) but the code for doing
+	 * those other things isn't available yet.
+	 */
 	if (LYoverride_no_cache ||
 #ifdef DONT_TRACK_INTERNAL_LINKS
 	    !HText_hasNoCacheSet(text) ||
@@ -893,7 +892,7 @@ static BOOL HTLoadDocument (
 	    ((LYinternal_flag || !HText_hasNoCacheSet(text)) &&
 	     !isLYNXIMGMAP(full_address))
 #endif /* TRACK_INTERNAL_LINKS */
-	) {
+	    ) {
 	    CTRACE((tfp, "HTAccess: Document already in memory.\n"));
 	    HText_select(text);
 
@@ -918,24 +917,22 @@ static BOOL HTLoadDocument (
     }
 
     /*
-    **	Get the document from the net.	If we are auto-reloading,
-    **	the mutable anchor elements from the previous rendition
-    **	should be freed in conjunction with loading of the new
-    **	rendition. - FM
-    */
-    LYforce_no_cache = NO;  /* reset after each time through */
+     * Get the document from the net.  If we are auto-reloading, the mutable
+     * anchor elements from the previous rendition should be freed in
+     * conjunction with loading of the new rendition.  - FM
+     */
+    LYforce_no_cache = NO;	/* reset after each time through */
     if (ForcingNoCache) {
-	FREE(anchor->title);  /* ??? */
+	FREE(anchor->title);	/* ??? */
     }
     status = HTLoad(address_to_load, anchor, format_out, sink);
     CTRACE((tfp, "HTAccess:  status=%d\n", status));
 
     /*
-     *  RECOVERY:
-     *  if the loading failed, and we had a cached HText copy,
-     *  and no new HText created - use a previous copy, issue a warning.
+     * RECOVERY:  if the loading failed, and we had a cached HText copy, and no
+     * new HText created - use a previous copy, issue a warning.
      */
-    if (text && status < 0 && (HText *)HTAnchor_document(anchor) == text) {
+    if (text && status < 0 && (HText *) HTAnchor_document(anchor) == text) {
 	HTAlert(gettext("Loading failed, use a previous copy."));
 	CTRACE((tfp, "HTAccess: Loading failed, use a previous copy.\n"));
 	HText_select(text);
@@ -949,10 +946,11 @@ static BOOL HTLoadDocument (
     }
 
     /*
-    **	Log the access if necessary.
-    */
+     * Log the access if necessary.
+     */
     if (HTlogfile) {
 	time_t theTime;
+
 	time(&theTime);
 	fprintf(HTlogfile, "%24.24s %s %s %s\n",
 		ctime(&theTime),
@@ -961,123 +959,124 @@ static BOOL HTLoadDocument (
 		full_address);
 	fflush(HTlogfile);	/* Actually update it on disk */
 	CTRACE((tfp, "Log: %24.24s %s %s %s\n",
-		    ctime(&theTime),
-		    HTClientHost ? HTClientHost : "local",
-		    status < 0 ? "FAIL" : "GET",
-		    full_address));
+		ctime(&theTime),
+		HTClientHost ? HTClientHost : "local",
+		status < 0 ? "FAIL" : "GET",
+		full_address));
     }
 
     /*
-    **	Check out what we received from the net.
-    */
+     * Check out what we received from the net.
+     */
     if (status == HT_REDIRECTING) {
-	/*  Exported from HTMIME.c, of all places. *//** NO!! - FM **/
+	/* Exported from HTMIME.c, of all places.  */
+	/* NO!! - FM */
 	/*
-	**  Doing this via HTMIME.c meant that the redirection cover
-	**  page was already loaded before we learned that we want a
-	**  different URL.  Also, changing anchor->address, as Lynx
-	**  was doing, meant we could never again access its hash
-	**  table entry, creating an insolvable memory leak.  Instead,
-	**  if we had a 301 status and set permanent_redirection,
-	**  we'll load the new URL in anchor->physical, preceded by a
-	**  token, which we can check to make replacements on subsequent
-	**  access attempts.  We'll check recursively, and retrieve the
-	**  final URL if we had multiple redirections to it.  If we just
-	**  went to HTLoad now, as Lou originally had this, we couldn't do
-	**  Lynx's security checks and alternate handling of some URL types.
-	**  So, instead, we'll go all the way back to the top of getfile
-	**  in LYGetFile.c when the status is HT_REDIRECTING.  This may
-	**  seem bizarre, but it works like a charm! - FM
-	**
-	**  Actually, the location header for redirections is now again
-	**  picked up in HTMIME.c.  But that's an internal matter between
-	**  HTTP.c and HTMIME.c, is still under control of HTLoadHTTP for
-	**  http URLs, is done in a way that doesn't load the redirection
-	**  response's body (except when wanted as an error fallback), and
-	**  thus need not concern us here. - kw 1999-12-02
-	*/
+	 * Doing this via HTMIME.c meant that the redirection cover page was
+	 * already loaded before we learned that we want a different URL. 
+	 * Also, changing anchor->address, as Lynx was doing, meant we could
+	 * never again access its hash table entry, creating an insolvable
+	 * memory leak.  Instead, if we had a 301 status and set
+	 * permanent_redirection, we'll load the new URL in anchor->physical,
+	 * preceded by a token, which we can check to make replacements on
+	 * subsequent access attempts.  We'll check recursively, and retrieve
+	 * the final URL if we had multiple redirections to it.  If we just
+	 * went to HTLoad now, as Lou originally had this, we couldn't do
+	 * Lynx's security checks and alternate handling of some URL types. 
+	 * So, instead, we'll go all the way back to the top of getfile in
+	 * LYGetFile.c when the status is HT_REDIRECTING.  This may seem
+	 * bizarre, but it works like a charm!  - FM
+	 *
+	 * Actually, the location header for redirections is now again picked
+	 * up in HTMIME.c.  But that's an internal matter between HTTP.c and
+	 * HTMIME.c, is still under control of HTLoadHTTP for http URLs, is
+	 * done in a way that doesn't load the redirection response's body
+	 * (except when wanted as an error fallback), and thus need not concern
+	 * us here.  - kw 1999-12-02
+	 */
 	CTRACE((tfp, "HTAccess: '%s' is a redirection URL.\n",
-		    address_to_load));
+		address_to_load));
 	CTRACE((tfp, "HTAccess: Redirecting to '%s'\n",
-		     redirecting_url));
+		redirecting_url));
 	/*
-	**  Prevent circular references.
-	*/
-	if (strcmp(address_to_load, redirecting_url)) { /* if different */
+	 * Prevent circular references.
+	 */
+	if (strcmp(address_to_load, redirecting_url)) {		/* if different */
 	    /*
-	    **	Load token and redirecting url into anchor->physical
-	    **	if we had 301 Permanent redirection.  HTTP.c does not
-	    **	allow this if we have POST content. - FM
-	    */
+	     * Load token and redirecting url into anchor->physical if we had
+	     * 301 Permanent redirection.  HTTP.c does not allow this if we
+	     * have POST content.  - FM
+	     */
 	    if (permanent_redirection) {
 		StrAllocCopy(anchor->physical, "Location=");
 		StrAllocCat(anchor->physical, redirecting_url);
 	    }
 
 	    /*
-	    **	Set up flags before return to getfile. - FM
-	    */
+	     * Set up flags before return to getfile.  - FM
+	     */
 	    StrAllocCopy(use_this_url_instead, redirecting_url);
 	    if (ForcingNoCache)
 		LYforce_no_cache = YES;
 	    ++redirection_attempts;
 	    FREE(redirecting_url);
 	    permanent_redirection = FALSE;
-	    return(NO);
+	    return (NO);
 	}
 	++redirection_attempts;
 	FREE(redirecting_url);
 	permanent_redirection = FALSE;
-	return(YES);
+	return (YES);
     }
 
     /*
-    **	We did not receive a redirecting URL. - FM
-    */
+     * We did not receive a redirecting URL.  - FM
+     */
     redirection_attempts = 0;
     FREE(redirecting_url);
     permanent_redirection = FALSE;
 
     if (status == HT_LOADED) {
 	CTRACE((tfp, "HTAccess: `%s' has been accessed.\n",
-		    full_address));
+		full_address));
 	return YES;
     }
     if (status == HT_PARTIAL_CONTENT) {
 	HTAlert(gettext("Loading incomplete."));
 	CTRACE((tfp, "HTAccess: `%s' has been accessed, partial content.\n",
-		    full_address));
+		full_address));
 	return YES;
     }
 
     if (status == HT_NO_DATA) {
 	CTRACE((tfp, "HTAccess: `%s' has been accessed, No data left.\n",
-		    full_address));
+		full_address));
 	return NO;
     }
 
     if (status == HT_NOT_LOADED) {
 	CTRACE((tfp, "HTAccess: `%s' has been accessed, No data loaded.\n",
-		    full_address));
+		full_address));
 	return NO;
     }
 
     if (status == HT_INTERRUPTED) {
-	CTRACE((tfp, "HTAccess: `%s' has been accessed, transfer interrupted.\n",
-		    full_address));
+	CTRACE((tfp,
+		"HTAccess: `%s' has been accessed, transfer interrupted.\n",
+		full_address));
 	return NO;
     }
 
     if (status > 0) {
 	/*
-	**	If you get this, then please find which routine is returning
-	**	a positive unrecognized error code!
-	*/
+	 * If you get this, then please find which routine is returning a
+	 * positive unrecognized error code!
+	 */
 	fprintf(stderr,
- gettext("**** HTAccess: socket or file number returned by obsolete load routine!\n"));
+		gettext("**** HTAccess: socket or file number returned by obsolete load routine!\n"));
 	fprintf(stderr,
- gettext("**** HTAccess: Internal software error.  Please mail lynx-dev@sig.net!\n"));
-	fprintf(stderr, gettext("**** HTAccess: Status returned was: %d\n"),status);
+		gettext("**** HTAccess: Internal software error.  Please mail lynx-dev@sig.net!\n"));
+	fprintf(stderr, gettext("**** HTAccess: Status returned was: %d\n"), status);
 	exit(EXIT_FAILURE);
     }
 
@@ -1093,21 +1092,20 @@ static BOOL HTLoadDocument (
     CTRACE((tfp, "HTAccess: Can't access `%s'\n", full_address));
     HTLoadError(sink, 500, gettext("Unable to access document."));
     return NO;
-} /* HTLoadDocument */
+}				/* HTLoadDocument */
 
 /*	Load a document from absolute name.		HTLoadAbsolute()
-**	-----------------------------------
-**
-**  On Entry,
-**	  addr	   The absolute address of the document to be accessed.
-**	  filter   if YES, treat document as HTML
-**
-**  On Exit,
-**	  returns    YES     Success in opening document
-**		     NO      Failure
-*/
-BOOL HTLoadAbsolute (
-	const DocAddress *	docaddr)
+ *	-----------------------------------
+ *
+ *  On Entry,
+ *	  addr	   The absolute address of the document to be accessed.
+ *	  filter   if YES, treat document as HTML
+ *
+ *  On Exit,
+ *	  returns    YES     Success in opening document
+ *		     NO      Failure
+ */
+BOOL HTLoadAbsolute(const DocAddress *docaddr)
 {
     return HTLoadDocument(docaddr->address,
 			  HTAnchor_findAddress(docaddr),
@@ -1117,20 +1115,19 @@ BOOL HTLoadAbsolute (
 
 #ifdef NOT_USED_CODE
 /*	Load a document from absolute name to stream.	HTLoadToStream()
-**	---------------------------------------------
-**
-**  On Entry,
-**	  addr	   The absolute address of the document to be accessed.
-**	  sink	   if non-NULL, send data down this stream
-**
-**  On Exit,
-**	  returns    YES     Success in opening document
-**		     NO      Failure
-*/
-BOOL HTLoadToStream (
-	const char *	addr,
-	BOOL		filter,
-	HTStream *	sink)
+ *	---------------------------------------------
+ *
+ *  On Entry,
+ *	  addr	   The absolute address of the document to be accessed.
+ *	  sink	   if non-NULL, send data down this stream
+ *
+ *  On Exit,
+ *	  returns    YES     Success in opening document
+ *		     NO      Failure
+ */
+BOOL HTLoadToStream(const char *addr,
+		    BOOL filter,
+		    HTStream *sink)
 {
     return HTLoadDocument(addr,
 			  HTAnchor_findSimpleAddress(addr),
@@ -1140,24 +1137,23 @@ BOOL HTLoadToStream (
 #endif /* NOT_USED_CODE */
 
 /*	Load a document from relative name.		HTLoadRelative()
-**	-----------------------------------
-**
-**  On Entry,
-**	  relative_name     The relative address of the document
-**			    to be accessed.
-**
-**  On Exit,
-**	  returns    YES     Success in opening document
-**		     NO      Failure
-*/
-BOOL HTLoadRelative (
-	const char *		relative_name,
-	HTParentAnchor *	here)
+ *	-----------------------------------
+ *
+ *  On Entry,
+ *	  relative_name     The relative address of the document
+ *			    to be accessed.
+ *
+ *  On Exit,
+ *	  returns    YES     Success in opening document
+ *		     NO      Failure
+ */
+BOOL HTLoadRelative(const char *relative_name,
+		    HTParentAnchor *here)
 {
     DocAddress full_address;
     BOOL result;
-    char * mycopy = NULL;
-    char * stripped = NULL;
+    char *mycopy = NULL;
+    char *stripped = NULL;
 
     full_address.address = NULL;
     full_address.post_data = NULL;
@@ -1170,42 +1166,42 @@ BOOL HTLoadRelative (
 
     stripped = HTStrip(mycopy);
     full_address.address =
-		HTParse(stripped,
-			here->address,
-			PARSE_ALL_WITHOUT_ANCHOR);
+	HTParse(stripped,
+		here->address,
+		PARSE_ALL_WITHOUT_ANCHOR);
     result = HTLoadAbsolute(&full_address);
     /*
-    **	If we got redirection, result will be NO, but use_this_url_instead
-    **	will be set.  The calling routine should check both and do whatever
-    **	is appropriate. - FM
-    */
+     * If we got redirection, result will be NO, but use_this_url_instead will
+     * be set.  The calling routine should check both and do whatever is
+     * appropriate.  - FM
+     */
     FREE(full_address.address);
-    FREE(mycopy);  /* Memory leak fixed 10/7/92 -- JFG */
+    FREE(mycopy);		/* Memory leak fixed 10/7/92 -- JFG */
     return result;
 }
 
 /*	Load if necessary, and select an anchor.	HTLoadAnchor()
-**	----------------------------------------
-**
-**  On Entry,
-**	  destination		    The child or parent anchor to be loaded.
-**
-**  On Exit,
-**	  returns    YES     Success
-**		     NO      Failure
-*/
-BOOL HTLoadAnchor (
-	HTAnchor *	destination)
+ *	----------------------------------------
+ *
+ *  On Entry,
+ *	  destination		    The child or parent anchor to be loaded.
+ *
+ *  On Exit,
+ *	  returns    YES     Success
+ *		     NO      Failure
+ */
+BOOL HTLoadAnchor(HTAnchor * destination)
 {
-    HTParentAnchor * parent;
+    HTParentAnchor *parent;
     BOOL loaded = NO;
+
     if (!destination)
-	return NO;	/* No link */
+	return NO;		/* No link */
 
     parent = HTAnchor_parent(destination);
 
     if (HTAnchor_document(parent) == NULL) {	/* If not already loaded */
-						/* TBL 921202 */
+	/* TBL 921202 */
 	BOOL result;
 
 	result = HTLoadDocument(parent->address,
@@ -1213,18 +1209,17 @@ BOOL HTLoadAnchor (
 				HTOutputFormat ?
 				HTOutputFormat : WWW_PRESENT,
 				HTOutputStream);
-	if (!result) return NO;
+	if (!result)
+	    return NO;
 	loaded = YES;
-    }
-
-    {
-	HText *text = (HText*)HTAnchor_document(parent);
-
-	if ((destination != (HTAnchor *)parent) &&
-	    (destination != (HTAnchor *)(parent->parent))) {
-						  /* If child anchor */
-	    HText_selectAnchor(text,		  /* Double display? @@ */
-			       (HTChildAnchor*)destination);
+    } {
+	HText *text = (HText *) HTAnchor_document(parent);
+
+	if ((destination != (HTAnchor *) parent) &&
+	    (destination != (HTAnchor *) (parent->parent))) {
+	    /* If child anchor */
+	    HText_selectAnchor(text,	/* Double display? @@ */
+			       (HTChildAnchor *) destination);
 	} else {
 	    if (!loaded)
 		HText_select(text);
@@ -1232,40 +1227,39 @@ BOOL HTLoadAnchor (
     }
     return YES;
 
-} /* HTLoadAnchor */
+}				/* HTLoadAnchor */
 
 /*	Search.						HTSearch()
-**	-------
-**
-**	Performs a keyword search on word given by the user.  Adds the
-**	keyword to the end of the current address and attempts to open
-**	the new address.
-**
-**  On Entry,
-**	 *keywords	space-separated keyword list or similar search list
-**	here		is anchor search is to be done on.
-*/
-static char hex (
-    int		i)
+ *	-------
+ *
+ *	Performs a keyword search on word given by the user.  Adds the
+ *	keyword to the end of the current address and attempts to open
+ *	the new address.
+ *
+ *  On Entry,
+ *	 *keywords	space-separated keyword list or similar search list
+ *	here		is anchor search is to be done on.
+ */
+static char hex(int i)
 {
-    char * hexchars = "0123456789ABCDEF";
+    char *hexchars = "0123456789ABCDEF";
+
     return hexchars[i];
 }
 
-BOOL HTSearch (
-	const char *		keywords,
-	HTParentAnchor *	here)
+BOOL HTSearch(const char *keywords,
+	      HTParentAnchor *here)
 {
 #define acceptable \
 "1234567890abcdefghijlkmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ.-_"
 
     char *q, *u;
-    const char * p, *s, *e;		/* Pointers into keywords */
-    char * address = NULL;
+    const char *p, *s, *e;	/* Pointers into keywords */
+    char *address = NULL;
     BOOL result;
-    char * escaped = typecallocn(char, (strlen(keywords)*3) + 1);
+    char *escaped = typecallocn(char, (strlen(keywords) * 3) + 1);
     static const BOOL isAcceptable[96] =
-
+    /* *INDENT-OFF* */
     /*	 0 1 2 3 4 5 6 7 8 9 A B C D E F */
     {	 0,0,0,0,0,0,0,0,0,0,1,0,0,1,1,0,	/* 2x	!"#$%&'()*+,-./  */
 	 1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,	/* 3x  0123456789:;<=>?  */
@@ -1273,6 +1267,7 @@ BOOL HTSearch (
 	 1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,1,	/* 5X  PQRSTUVWXYZ[\]^_  */
 	 0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,	/* 6x  `abcdefghijklmno  */
 	 1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0 };	/* 7X  pqrstuvwxyz{\}~	DEL */
+    /* *INDENT-ON* */
 
     if (escaped == NULL)
 	outofmem(__FILE__, "HTSearch");
@@ -1280,24 +1275,25 @@ BOOL HTSearch (
     StrAllocCopy(address, here->isIndexAction);
 
     /*
-    **	Convert spaces to + and hex escape unacceptable characters.
-    */
-    for (s = keywords; *s && WHITE(*s); s++)		 /* Scan */
-	;	/* Skip white space */
-    for (e = s + strlen(s); e > s && WHITE(*(e-1)); e--) /* Scan */
-	;	/* Skip trailers */
+     * Convert spaces to + and hex escape unacceptable characters.
+     */
+    for (s = keywords; *s && WHITE(*s); s++)	/* Scan */
+	;			/* Skip white space */
+    for (e = s + strlen(s); e > s && WHITE(*(e - 1)); e--)	/* Scan */
+	;			/* Skip trailers */
     for (q = escaped, p = s; p < e; p++) {	/* Scan stripped field */
 	unsigned char c = UCH(TOASCII(*p));
+
 	if (WHITE(*p)) {
 	    *q++ = '+';
 	} else if (HTCJK != NOCJK) {
 	    *q++ = *p;
-	} else if (c>=32 && c<=UCH(127) && isAcceptable[c-32]) {
-	    *q++ = *p;				/* 930706 TBL for MVS bug */
+	} else if (c >= 32 && c <= UCH(127) && isAcceptable[c - 32]) {
+	    *q++ = *p;		/* 930706 TBL for MVS bug */
 	} else {
 	    *q++ = '%';
-	    *q++ = hex((int)(c >> 4));
-	    *q++ = hex((int)(c & 15));
+	    *q++ = hex((int) (c >> 4));
+	    *q++ = hex((int) (c & 15));
 	}
     }				/* Loop over string */
     *q = '\0';			/* Terminate escaped string */
@@ -1312,33 +1308,33 @@ BOOL HTSearch (
     FREE(address);
 
     /*
-    **	If we got redirection, result will be NO, but use_this_url_instead
-    **	will be set.  The calling routine should check both and do whatever
-    **	is appropriate.  Only an http server (not a gopher or wais server)
-    **	could return redirection.  Lynx will go all the way back to its
-    **	mainloop() and subject a redirecting URL to all of its security and
-    **	restrictions checks. - FM
-    */
+     * If we got redirection, result will be NO, but use_this_url_instead will
+     * be set.  The calling routine should check both and do whatever is
+     * appropriate.  Only an http server (not a gopher or wais server) could
+     * return redirection.  Lynx will go all the way back to its mainloop() and
+     * subject a redirecting URL to all of its security and restrictions
+     * checks.  - FM
+     */
     return result;
 }
 
 /*	Search Given Indexname.			HTSearchAbsolute()
-**	-----------------------
-**
-**	Performs a keyword search on word given by the user.  Adds the
-**	keyword to the end of the current address and attempts to open
-**	the new address.
-**
-**  On Entry,
-**	*keywords	space-separated keyword list or similar search list
-**	*indexname	is name of object search is to be done on.
-*/
-BOOL HTSearchAbsolute (
-	const char *	keywords,
-	char *		indexname)
+ *	-----------------------
+ *
+ *	Performs a keyword search on word given by the user.  Adds the
+ *	keyword to the end of the current address and attempts to open
+ *	the new address.
+ *
+ *  On Entry,
+ *	*keywords	space-separated keyword list or similar search list
+ *	*indexname	is name of object search is to be done on.
+ */
+BOOL HTSearchAbsolute(const char *keywords,
+		      char *indexname)
 {
     DocAddress abs_doc;
-    HTParentAnchor * anchor;
+    HTParentAnchor *anchor;
+
     abs_doc.address = indexname;
     abs_doc.post_data = NULL;
     abs_doc.post_content_type = NULL;
@@ -1352,37 +1348,39 @@ BOOL HTSearchAbsolute (
 
 #ifdef NOT_USED_CODE
 /*	Generate the anchor for the home page.		HTHomeAnchor()
-**	--------------------------------------
-**
-**	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 between browsers is STRONGLY recommended!
-**
-**  Priority order is:
-**		1	WWW_HOME environment variable (logical name, etc)
-**		2	~/WWW/default.html
-**		3	/usr/local/bin/default.html
-**		4	http://www.w3.org/default.html
-*/
-HTParentAnchor * HTHomeAnchor (void)
+ *	--------------------------------------
+ *
+ *	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 between browsers is STRONGLY recommended!
+ *
+ *  Priority order is:
+ *		1	WWW_HOME environment variable (logical name, etc)
+ *		2	~/WWW/default.html
+ *		3	/usr/local/bin/default.html
+ *		4	http://www.w3.org/default.html
+ */
+HTParentAnchor *HTHomeAnchor(void)
 {
-    char * my_home_document = NULL;
-    char * home = LYGetEnv(LOGICAL_DEFAULT);
-    char * ref;
-    HTParentAnchor * anchor;
+    char *my_home_document = NULL;
+    char *home = LYGetEnv(LOGICAL_DEFAULT);
+    char *ref;
+    HTParentAnchor *anchor;
 
     if (home) {
 	StrAllocCopy(my_home_document, home);
-#define MAX_FILE_NAME 1024			/* @@@ */
-    } else if (HTClientHost) {			/* Telnet server */
+#define MAX_FILE_NAME 1024	/* @@@ */
+    } else if (HTClientHost) {	/* Telnet server */
 	/*
-	**  Someone telnets in, they get a special home.
-	*/
-	FILE * fp = fopen(REMOTE_POINTER, "r");
-	char * status;
+	 * Someone telnets in, they get a special home.
+	 */
+	FILE *fp = fopen(REMOTE_POINTER, "r");
+	char *status;
+
 	if (fp) {
 	    my_home_document = typecallocn(char, MAX_FILE_NAME);
+
 	    if (my_home_document == NULL)
 		outofmem(__FILE__, "HTHomeAnchor");
 	    status = fgets(my_home_document, MAX_FILE_NAME, fp);
@@ -1394,11 +1392,11 @@ HTParentAnchor * HTHomeAnchor (void)
 	if (my_home_document == NULL)
 	    StrAllocCopy(my_home_document, REMOTE_ADDRESS);
     }
-
 #ifdef UNIX
     if (my_home_document == NULL) {
-	FILE * fp = NULL;
-	char * home = LYGetEnv("HOME");
+	FILE *fp = NULL;
+	char *home = LYGetEnv("HOME");
+
 	if (home != 0) {
 	    HTSprintf0(&my_home_document, "%s/%s", home, PERSONAL_DEFAULT);
 	    fp = fopen(my_home_document, "r");
@@ -1412,19 +1410,19 @@ HTParentAnchor * HTHomeAnchor (void)
 	    fclose(fp);
 	} else {
 	    CTRACE((tfp, "HTBrowse: No local home document ~/%s or %s\n",
-			PERSONAL_DEFAULT, LOCAL_DEFAULT_FILE));
+		    PERSONAL_DEFAULT, LOCAL_DEFAULT_FILE));
 	    FREE(my_home_document);
 	}
     }
 #endif /* UNIX */
     ref = HTParse((my_home_document ?
 		   my_home_document : (HTClientHost ?
-				     REMOTE_ADDRESS : LAST_RESORT)),
+				       REMOTE_ADDRESS : LAST_RESORT)),
 		  STR_FILE_URL,
 		  PARSE_ALL_WITHOUT_ANCHOR);
     if (my_home_document) {
 	CTRACE((tfp, "HTAccess: Using custom home page %s i.e., address %s\n",
-		    my_home_document, ref));
+		my_home_document, ref));
 	FREE(my_home_document);
     }
     anchor = HTAnchor_findSimpleAddress(ref);
diff --git a/WWW/Library/Implementation/HTAccess.h b/WWW/Library/Implementation/HTAccess.h
index a8aa73ad..0f565dec 100644
--- a/WWW/Library/Implementation/HTAccess.h
+++ b/WWW/Library/Implementation/HTAccess.h
@@ -11,7 +11,7 @@
 #ifndef HTACCESS_H
 #define HTACCESS_H
 
-extern char * use_this_url_instead;
+extern char *use_this_url_instead;
 
 extern int redirection_attempts;
 
@@ -21,12 +21,11 @@ extern int redirection_attempts;
 #include <HTFormat.h>
 
 /*      Return codes from load routines:
-**
-**      These codes may be returned by the protocol modules,
-**      and by the HTLoad routines.
-**      In general, positive codes are OK and negative ones are bad.
-*/
-
+ *
+ *      These codes may be returned by the protocol modules,
+ *      and by the HTLoad routines.
+ *      In general, positive codes are OK and negative ones are bad.
+ */
 
 /*
 
@@ -36,10 +35,10 @@ Default Addresses
    for user confusion.
 
  */
-#define LOGICAL_DEFAULT "WWW_HOME"  /* Defined to be the home page */
+#define LOGICAL_DEFAULT "WWW_HOME"	/* Defined to be the home page */
 
 #ifndef PERSONAL_DEFAULT
-#define PERSONAL_DEFAULT "WWW/default.html"     /* in home directory */
+#define PERSONAL_DEFAULT "WWW/default.html"	/* in home directory */
 #endif
 #ifndef LOCAL_DEFAULT_FILE
 #define LOCAL_DEFAULT_FILE "/usr/local/lib/WWW/default.html"
@@ -47,11 +46,11 @@ Default Addresses
 /*  If one telnets to a www access point,
     it will look in this file for home page */
 #ifndef REMOTE_POINTER
-#define REMOTE_POINTER  "/etc/www-remote.url"  /* can't be file */
+#define REMOTE_POINTER  "/etc/www-remote.url"	/* can't be file */
 #endif
 /* and if that fails it will use this. */
 #ifndef REMOTE_ADDRESS
-#define REMOTE_ADDRESS  "http://www.w3.org/remote.html"  /* can't be file */
+#define REMOTE_ADDRESS  "http://www.w3.org/remote.html"		/* can't be file */
 #endif
 
 /* If run from telnet daemon and no -l specified, use this file:
@@ -66,39 +65,37 @@ Default Addresses
 #define LAST_RESORT     "http://www.w3.org/default.html"
 #endif
 
-
 /*
 
 Flags which may be set to control this module
 
  */
 #ifdef NOT
-extern int HTDiag;                      /* Flag: load source as plain text */
+extern int HTDiag;		/* Flag: load source as plain text */
 #endif /* NOT */
-extern char * HTClientHost;             /* Name or number of telnetting host */
-extern FILE * HTlogfile;                /* File to output one-liners to */
-extern BOOL HTSecure;                   /* Disable security holes? */
-extern BOOL HTPermitRedir;              /* Special flag for getfile() */
-extern HTStream* HTOutputStream;        /* For non-interactive, set this */
-extern HTFormat HTOutputFormat;         /* To convert on load, set this */
+extern char *HTClientHost;	/* Name or number of telnetting host */
+extern FILE *HTlogfile;		/* File to output one-liners to */
+extern BOOL HTSecure;		/* Disable security holes? */
+extern BOOL HTPermitRedir;	/* Special flag for getfile() */
+extern HTStream *HTOutputStream;	/* For non-interactive, set this */
+extern HTFormat HTOutputFormat;	/* To convert on load, set this */
 
 /*	Check for proxy override.			override_proxy()
-**
-**	Check the no_proxy environment variable to get the list
-**	of hosts for which proxy server is not consulted.
-**
-**	no_proxy is a comma- or space-separated list of machine
-**	or domain names, with optional :port part.  If no :port
-**	part is present, it applies to all ports on that domain.
-**
-**  Example:
-**          no_proxy="cern.ch,some.domain:8001"
-**
-**  Use "*" to override all proxy service:
-**	     no_proxy="*"
-*/
-extern BOOL override_proxy (
-	const char *	addr);
+ *
+ *	Check the no_proxy environment variable to get the list
+ *	of hosts for which proxy server is not consulted.
+ *
+ *	no_proxy is a comma- or space-separated list of machine
+ *	or domain names, with optional :port part.  If no :port
+ *	part is present, it applies to all ports on that domain.
+ *
+ *  Example:
+ *          no_proxy="cern.ch,some.domain:8001"
+ *
+ *  Use "*" to override all proxy service:
+ *	     no_proxy="*"
+ */
+extern BOOL override_proxy(const char *addr);
 
 /*
 
@@ -113,10 +110,8 @@ Load a document from relative name
   NO                      Failure
 
  */
-extern  BOOL HTLoadRelative (
-		const char *		relative_name,
-		HTParentAnchor *	here);
-
+extern BOOL HTLoadRelative(const char *relative_name,
+			   HTParentAnchor *here);
 
 /*
 
@@ -131,8 +126,7 @@ Load a document from absolute name
   NO                      Failure
 
  */
-extern BOOL HTLoadAbsolute (const DocAddress * addr);
-
+extern BOOL HTLoadAbsolute(const DocAddress *addr);
 
 /*
 
@@ -149,9 +143,8 @@ Load a document from absolute name to a stream
    Note: This is equivalent to HTLoadDocument
 
  */
-extern BOOL HTLoadToStream (const char * addr, BOOL filter_it,
-				HTStream * sink);
-
+extern BOOL HTLoadToStream(const char *addr, BOOL filter_it,
+			   HTStream *sink);
 
 /*
 
@@ -165,8 +158,7 @@ Load if necessary, and select an anchor
   returns NO              Failure
 
  */
-extern BOOL HTLoadAnchor (HTAnchor * destination);
-
+extern BOOL HTLoadAnchor(HTAnchor * destination);
 
 /*
 
@@ -179,8 +171,7 @@ Make a stream for Saving object back
   returns                 0 if error else a stream to save the object to.
 
  */
-extern HTStream * HTSaveStream (HTParentAnchor * anchor);
-
+extern HTStream *HTSaveStream(HTParentAnchor *anchor);
 
 /*
 
@@ -194,8 +185,7 @@ Search
   here                    The anchor of the object being searched
 
  */
-extern BOOL HTSearch (const char * keywords, HTParentAnchor* here);
-
+extern BOOL HTSearch(const char *keywords, HTParentAnchor *here);
 
 /*
 
@@ -209,10 +199,8 @@ Search Given Indexname
   *indexname              is name of object search is to be done on.
 
  */
-extern BOOL HTSearchAbsolute (
-	const char *	keywords,
-	char *		indexname);
-
+extern BOOL HTSearchAbsolute(const char *keywords,
+			     char *indexname);
 
 /*
 
@@ -221,20 +209,18 @@ Register an access method
  */
 
 typedef struct _HTProtocol {
-	char * name;
+    char *name;
 
-	int (*load)(
-		const char *	full_address,
-		HTParentAnchor * anchor,
-		HTFormat	format_out,
-		HTStream*	sink);
+    int (*load) (const char *full_address,
+		 HTParentAnchor *anchor,
+		 HTFormat format_out,
+		 HTStream *sink);
 
-	HTStream* (*saveStream)(HTParentAnchor * anchor);
+    HTStream *(*saveStream) (HTParentAnchor *anchor);
 
 } HTProtocol;
 
-extern BOOL HTRegisterProtocol (HTProtocol * protocol);
-
+extern BOOL HTRegisterProtocol(HTProtocol * protocol);
 
 /*
 
@@ -248,25 +234,24 @@ Generate the anchor for the home page
    This is a default algorithm -- browser don't HAVE to use this.
 
  */
-extern HTParentAnchor * HTHomeAnchor (void);
+extern HTParentAnchor *HTHomeAnchor(void);
 
 /*
 
 Return Host Name
 
  */
-extern const char * HTHostName (void);
+extern const char *HTHostName(void);
 
 /*
 
 For registering protocols supported by Lynx
 
 */
-extern void LYRegisterLynxProtocols (void);
+extern void LYRegisterLynxProtocols(void);
 
-extern void LYUCPushAssumed (
-    HTParentAnchor *	anchor);
-extern int LYUCPopAssumed (void);
+extern void LYUCPushAssumed(HTParentAnchor *anchor);
+extern int LYUCPopAssumed(void);
 
 extern BOOL using_proxy;	/* Are we using an NNTP proxy? */
 
diff --git a/WWW/Library/Implementation/HTAnchor.c b/WWW/Library/Implementation/HTAnchor.c
index 9580a0db..9ca154d3 100644
--- a/WWW/Library/Implementation/HTAnchor.c
+++ b/WWW/Library/Implementation/HTAnchor.c
@@ -1,17 +1,17 @@
 /*	Hypertext "Anchor" Object				HTAnchor.c
-**	==========================
-**
-** An anchor represents a region of a hypertext document which is linked to
-** another anchor in the same or a different document.
-**
-** History
-**
-**	   Nov 1990  Written in Objective-C for the NeXT browser (TBL)
-**	24-Oct-1991 (JFG), written in C, browser-independent
-**	21-Nov-1991 (JFG), first complete version
-**
-**	(c) Copyright CERN 1991 - See Copyright.html
-*/
+ *	==========================
+ *
+ * An anchor represents a region of a hypertext document which is linked to
+ * another anchor in the same or a different document.
+ *
+ * History
+ *
+ *	   Nov 1990  Written in Objective-C for the NeXT browser (TBL)
+ *	24-Oct-1991 (JFG), written in C, browser-independent
+ *	21-Nov-1991 (JFG), first complete version
+ *
+ *	(c) Copyright CERN 1991 - See Copyright.html
+ */
 
 #define HASH_SIZE 101		/* Arbitrary prime.  Memory/speed tradeoff */
 
@@ -39,41 +39,42 @@
 /*
  *	This is the original function.	We'll use it again. - FM
  */
-static int HASH_FUNCTION (
-	const char *	cp_address)
+static int HASH_FUNCTION(const char *cp_address)
 {
     int hash;
     const unsigned char *p;
 
-    for (p = (const unsigned char *)cp_address, hash = 0; *p; p++)
-	hash = (int) (hash * 3 + (*(const unsigned char *)p)) % HASH_SIZE;
+    for (p = (const unsigned char *) cp_address, hash = 0; *p; p++)
+	hash = (int) (hash * 3 + (*(const unsigned char *) p)) % HASH_SIZE;
 
-    return(hash);
+    return (hash);
 }
 
 typedef struct _HyperDoc Hyperdoc;
+
 #ifdef VMS
 struct _HyperDoc {
-	int junk;	/* VMS cannot handle pointers to undefined structs */
+    int junk;			/* VMS cannot handle pointers to undefined structs */
 };
 #endif /* VMS */
 
 /* Table of lists of all parents */
-static HTList adult_table[HASH_SIZE] = { {NULL, NULL} };
-
+static HTList adult_table[HASH_SIZE] =
+{
+    {NULL, NULL}};
 
 /*				Creation Methods
-**				================
-**
-**	Do not use "new" by itself outside this module.  In order to enforce
-**	consistency, we insist that you furnish more information about the
-**	anchor you are creating : use newWithParent or newWithAddress.
-*/
-static HTParentAnchor0 * HTParentAnchor0_new (
-	const char *	address,
-	short		hash)
+ *				================
+ *
+ *	Do not use "new" by itself outside this module.  In order to enforce
+ *	consistency, we insist that you furnish more information about the
+ *	anchor you are creating : use newWithParent or newWithAddress.
+ */
+static HTParentAnchor0 *HTParentAnchor0_new(const char *address,
+					    short hash)
 {
     HTParentAnchor0 *newAnchor = typecalloc(HTParentAnchor0);
+
     if (newAnchor == NULL)
 	outofmem(__FILE__, "HTParentAnchor0_new");
 
@@ -81,33 +82,33 @@ static HTParentAnchor0 * HTParentAnchor0_new (
     StrAllocCopy(newAnchor->address, address);
     newAnchor->adult_hash = hash;
 
-    return(newAnchor);
+    return (newAnchor);
 }
 
-static HTParentAnchor * HTParentAnchor_new (
-	HTParentAnchor0 *	parent)
+static HTParentAnchor *HTParentAnchor_new(HTParentAnchor0 *parent)
 {
     HTParentAnchor *newAnchor = typecalloc(HTParentAnchor);
+
     if (newAnchor == NULL)
 	outofmem(__FILE__, "HTParentAnchor_new");
 
-    newAnchor->parent = parent;		/* cross reference */
-    parent->info = newAnchor;		/* cross reference */
-    newAnchor->address = parent->address;  /* copy pointer */
+    newAnchor->parent = parent;	/* cross reference */
+    parent->info = newAnchor;	/* cross reference */
+    newAnchor->address = parent->address;	/* copy pointer */
 
     newAnchor->isISMAPScript = FALSE;	/* Lynx appends ?0,0 if TRUE. - FM */
-    newAnchor->isHEAD = FALSE;		/* HEAD request if TRUE. - FM */
-    newAnchor->safe = FALSE;		/* Safe. - FM */
+    newAnchor->isHEAD = FALSE;	/* HEAD request if TRUE. - FM */
+    newAnchor->safe = FALSE;	/* Safe. - FM */
     newAnchor->no_cache = FALSE;	/* no-cache? - FM */
-    newAnchor->inBASE = FALSE;		/* duplicated from HTML.c/h */
+    newAnchor->inBASE = FALSE;	/* duplicated from HTML.c/h */
     newAnchor->content_length = 0;	/* Content-Length. - FM */
-    return(newAnchor);
+    return (newAnchor);
 }
 
-static HTChildAnchor * HTChildAnchor_new (
-	HTParentAnchor0 *	parent)
+static HTChildAnchor *HTChildAnchor_new(HTParentAnchor0 *parent)
 {
     HTChildAnchor *p = typecalloc(HTChildAnchor);
+
     if (p == NULL)
 	outofmem(__FILE__, "HTChildAnchor_new");
 
@@ -115,11 +116,11 @@ static HTChildAnchor * HTChildAnchor_new (
     return p;
 }
 
-static HTChildAnchor * HText_pool_ChildAnchor_new (
-	HTParentAnchor *	parent)
+static HTChildAnchor *HText_pool_ChildAnchor_new(HTParentAnchor *parent)
 {
-    HTChildAnchor *p = (HTChildAnchor *)HText_pool_calloc((HText*)(parent->document),
-						sizeof(HTChildAnchor));
+    HTChildAnchor *p = (HTChildAnchor *) HText_pool_calloc((HText *) (parent->document),
+							   sizeof(HTChildAnchor));
+
     if (p == NULL)
 	outofmem(__FILE__, "HText_pool_ChildAnchor_new");
 
@@ -136,177 +137,171 @@ static HTChildAnchor * HText_pool_ChildAnchor_new (
 #endif
 
 /*	Null-terminated string comparison
-**	---------------------------------
-** On entry,
-**	s	Points to one string, null terminated
-**	t	points to the other.
-** On exit,
-**	returns YES if the strings are equivalent
-**		NO if they differ.
-*/
-static BOOL HTSEquivalent (
-	const char *	s,
-	const char *	t)
+ *	---------------------------------
+ * On entry,
+ *	s	Points to one string, null terminated
+ *	t	points to the other.
+ * On exit,
+ *	returns YES if the strings are equivalent
+ *		NO if they differ.
+ */
+static BOOL HTSEquivalent(const char *s,
+			  const char *t)
 {
-    if (s && t) {  /* Make sure they point to something */
+    if (s && t) {		/* Make sure they point to something */
 	for (; *s && *t; s++, t++) {
 	    if (!HT_EQUIV(*s, *t)) {
-		return(NO);
+		return (NO);
 	    }
 	}
-	return(HT_EQUIV(*s, *t));
+	return (HT_EQUIV(*s, *t));
     } else {
-	return(s == t);		/* Two NULLs are equivalent, aren't they ? */
+	return (s == t);	/* Two NULLs are equivalent, aren't they ? */
     }
 }
 
 /*	Binary string comparison
-**	------------------------
-** On entry,
-**	s	Points to one bstring
-**	t	points to the other.
-** On exit,
-**	returns YES if the strings are equivalent
-**		NO if they differ.
-*/
-static BOOL HTBEquivalent (
-	const bstring *	s,
-	const bstring *	t)
+ *	------------------------
+ * On entry,
+ *	s	Points to one bstring
+ *	t	points to the other.
+ * On exit,
+ *	returns YES if the strings are equivalent
+ *		NO if they differ.
+ */
+static BOOL HTBEquivalent(const bstring *s,
+			  const bstring *t)
 {
     if (s && t && BStrLen(s) == BStrLen(t)) {
 	int j;
 	int len = BStrLen(s);
+
 	for (j = 0; j < len; ++j) {
 	    if (!HT_EQUIV(BStrData(s)[j], BStrData(t)[j])) {
-		return(NO);
+		return (NO);
 	    }
 	}
-	return(YES);
+	return (YES);
     } else {
-	return(s == t);		/* Two NULLs are equivalent, aren't they ? */
+	return (s == t);	/* Two NULLs are equivalent, aren't they ? */
     }
 }
 
 /*
- *  Three-way compare function
+ * Three-way compare function
  */
-static int compare_anchors (
-	void * l,
-	void * r)
+static int compare_anchors(void *l,
+			   void *r)
 {
-    const char* a = ((HTChildAnchor *)l)->tag;
-    const char* b = ((HTChildAnchor *)r)->tag;
+    const char *a = ((HTChildAnchor *) l)->tag;
+    const char *b = ((HTChildAnchor *) r)->tag;
+
     /* both tags are not NULL */
 
 #ifdef CASE_INSENSITIVE_ANCHORS
-	return strcasecomp(a, b); /* Case insensitive */
+    return strcasecomp(a, b);	/* Case insensitive */
 #else
-	return strcmp(a, b);      /* Case sensitive - FM */
+    return strcmp(a, b);	/* Case sensitive - FM */
 #endif /* CASE_INSENSITIVE_ANCHORS */
 }
 
-
 /*	Create new or find old sub-anchor
-**	---------------------------------
-**
-**	This one is for a named child.
-**	The parent anchor must already exist.
-*/
-static HTChildAnchor * HTAnchor_findNamedChild (
-	HTParentAnchor0 *	parent,
-	const char *		tag)
+ *	---------------------------------
+ *
+ *	This one is for a named child.
+ *	The parent anchor must already exist.
+ */
+static HTChildAnchor *HTAnchor_findNamedChild(HTParentAnchor0 *parent,
+					      const char *tag)
 {
     HTChildAnchor *child;
 
-    if (parent && tag && *tag) {  /* TBL */
+    if (parent && tag && *tag) {	/* TBL */
 	if (parent->children) {
 	    /*
-	    **  Parent has children.  Search them.
-	    */
+	     * Parent has children.  Search them.
+	     */
 	    HTChildAnchor sample;
-	    sample.tag = (char*)tag;    /* for compare_anchors() only */
 
-	    child = (HTChildAnchor *)HTBTree_search(parent->children, &sample);
+	    sample.tag = (char *) tag;	/* for compare_anchors() only */
+
+	    child = (HTChildAnchor *) HTBTree_search(parent->children, &sample);
 	    if (child != NULL) {
-		CTRACE((tfp, "Child anchor %p of parent %p with name `%s' already exists.\n",
-				(void *)child, (void *)parent, tag));
-		return(child);
+		CTRACE((tfp,
+			"Child anchor %p of parent %p with name `%s' already exists.\n",
+			(void *) child, (void *) parent, tag));
+		return (child);
 	    }
-	} else {  /* parent doesn't have any children yet : create family */
+	} else {		/* parent doesn't have any children yet : create family */
 	    parent->children = HTBTree_new(compare_anchors);
 	}
 
 	child = HTChildAnchor_new(parent);
 	CTRACE((tfp, "HTAnchor: New Anchor %p named `%s' is child of %p\n",
-		(void *)child,
+		(void *) child,
 		NonNull(tag),
-		(void *)child->parent));
+		(void *) child->parent));
 
-	StrAllocCopy(child->tag, tag);   /* should be set before HTBTree_add */
+	StrAllocCopy(child->tag, tag);	/* should be set before HTBTree_add */
 	HTBTree_add(parent->children, child);
-	return(child);
+	return (child);
 
     } else {
 	CTRACE((tfp, "HTAnchor_findNamedChild called with NULL parent.\n"));
-	return(NULL);
+	return (NULL);
     }
 
 }
 
 /*
-**	This one is for a new unnamed child being edited into an existing
-**	document.  The parent anchor and the document must already exist.
-**	(Just add new unnamed child).
-*/
-static HTChildAnchor * HTAnchor_addChild (
-	HTParentAnchor *	parent)
+ *	This one is for a new unnamed child being edited into an existing
+ *	document.  The parent anchor and the document must already exist.
+ *	(Just add new unnamed child).
+ */
+static HTChildAnchor *HTAnchor_addChild(HTParentAnchor *parent)
 {
     HTChildAnchor *child;
 
     if (!parent) {
 	CTRACE((tfp, "HTAnchor_addChild called with NULL parent.\n"));
-	return(NULL);
+	return (NULL);
     }
 
     child = HText_pool_ChildAnchor_new(parent);
     CTRACE((tfp, "HTAnchor: New unnamed Anchor %p is child of %p\n",
-		(void *)child,
-		(void *)child->parent));
+	    (void *) child,
+	    (void *) child->parent));
 
     child->tag = 0;
     HTList_linkObject(&parent->children_notag, child, &child->_add_children_notag);
 
-    return(child);
+    return (child);
 }
 
+static HTParentAnchor0 *HTAnchor_findAddress_in_adult_table(const DocAddress *newdoc);
 
-static HTParentAnchor0 * HTAnchor_findAddress_in_adult_table (
-	const DocAddress *	newdoc);
-
-static BOOL HTAnchor_link (
-	HTChildAnchor *		child,
-	HTAnchor *		destination,
-	HTLinkType *		type);
-
+static BOOL HTAnchor_link(HTChildAnchor *child,
+			  HTAnchor * destination,
+			  HTLinkType *type);
 
 /*	Create or find a child anchor with a possible link
-**	--------------------------------------------------
-**
-**	Create new anchor with a given parent and possibly
-**	a name, and possibly a link to a _relatively_ named anchor.
-**	(Code originally in ParseHTML.h)
-*/
-HTChildAnchor * HTAnchor_findChildAndLink (
-	HTParentAnchor *	parent, /* May not be 0   */
-	const char *		tag,	/* May be "" or 0 */
-	const char *		href,	/* May be "" or 0 */
-	HTLinkType *		ltype)	/* May be 0	  */
-{
-    HTChildAnchor * child;
-    CTRACE((tfp,"Entered HTAnchor_findChildAndLink:  tag=`%s',%s href=`%s'\n",
-	       NonNull(tag),
-	       (ltype == HTInternalLink) ? " (internal link)" : "",
-	       NonNull(href) ));
+ *	--------------------------------------------------
+ *
+ *	Create new anchor with a given parent and possibly
+ *	a name, and possibly a link to a _relatively_ named anchor.
+ *	(Code originally in ParseHTML.h)
+ */
+HTChildAnchor *HTAnchor_findChildAndLink(HTParentAnchor *parent,	/* May not be 0   */
+					 const char *tag,	/* May be "" or 0 */
+					 const char *href,	/* May be "" or 0 */
+					 HTLinkType *ltype)	/* May be 0       */
+{
+    HTChildAnchor *child;
+
+    CTRACE((tfp, "Entered HTAnchor_findChildAndLink:  tag=`%s',%s href=`%s'\n",
+	    NonNull(tag),
+	    (ltype == HTInternalLink) ? " (internal link)" : "",
+	    NonNull(href)));
 
     if (tag && *tag) {
 	child = HTAnchor_findNamedChild(parent->parent, tag);
@@ -316,14 +311,15 @@ HTChildAnchor * HTAnchor_findChildAndLink (
 
     if (href && *href) {
 	const char *fragment = NULL;
-	HTParentAnchor0 * dest;
+	HTParentAnchor0 *dest;
 
 	if (ltype == HTInternalLink && *href == '#') {
 	    dest = parent->parent;
 	} else {
 	    const char *relative_to = (parent->inBASE && *href != '#') ?
-				parent->content_base : parent->address;
+	    parent->content_base : parent->address;
 	    DocAddress parsed_doc;
+
 	    parsed_doc.address = HTParse(href, relative_to,
 					 PARSE_ALL_WITHOUT_ANCHOR);
 
@@ -345,59 +341,56 @@ HTChildAnchor * HTAnchor_findChildAndLink (
 	}
 
 	/*
-	** [from HTAnchor_findAddress()]
-	** If the address represents a sub-anchor, we load its parent (above),
-	** then we create a named child anchor within that parent.
-	*/
-	fragment = (*href == '#') ?  href+1 : HTParseAnchor(href);
+	 * [from HTAnchor_findAddress()]
+	 * If the address represents a sub-anchor, we load its parent (above),
+	 * then we create a named child anchor within that parent.
+	 */
+	fragment = (*href == '#') ? href + 1 : HTParseAnchor(href);
 
 	if (*fragment)
-	    dest = (HTParentAnchor0 *)HTAnchor_findNamedChild(dest, fragment);
-
+	    dest = (HTParentAnchor0 *) HTAnchor_findNamedChild(dest, fragment);
 
 	if (tag && *tag) {
-	    if (child->dest) { /* DUPLICATE_ANCHOR_NAME_WORKAROUND  - kw */
+	    if (child->dest) {	/* DUPLICATE_ANCHOR_NAME_WORKAROUND  - kw */
 		CTRACE((tfp,
-			   "*** Duplicate ChildAnchor %p named `%s'",
-			   child, tag));
-		if ((HTAnchor *)dest != child->dest || ltype != child->type) {
+			"*** Duplicate ChildAnchor %p named `%s'",
+			child, tag));
+		if ((HTAnchor *) dest != child->dest || ltype != child->type) {
 		    CTRACE((tfp,
-			   ", different dest %p or type, creating unnamed child\n",
-			   child->dest));
+			    ", different dest %p or type, creating unnamed child\n",
+			    child->dest));
 		    child = HTAnchor_addChild(parent);
 		}
 	    }
 	}
-	HTAnchor_link(child, (HTAnchor *)dest, ltype);
+	HTAnchor_link(child, (HTAnchor *) dest, ltype);
     }
     return child;
 }
 
-
 /*	Create new or find old parent anchor
-**	------------------------------------
-**
-**	Me one is for a reference which is found in a document, and might
-**	not be already loaded.
-**	Note: You are not guaranteed a new anchor -- you might get an old one,
-**	like with fonts.
-*/
-HTParentAnchor * HTAnchor_findAddress (
-	const DocAddress *	newdoc)
+ *	------------------------------------
+ *
+ *	Me one is for a reference which is found in a document, and might
+ *	not be already loaded.
+ *	Note: You are not guaranteed a new anchor -- you might get an old one,
+ *	like with fonts.
+ */
+HTParentAnchor *HTAnchor_findAddress(const DocAddress *newdoc)
 {
     /* Anchor tag specified ? */
     const char *tag = HTParseAnchor(newdoc->address);
 
-    CTRACE((tfp,"Entered HTAnchor_findAddress\n"));
+    CTRACE((tfp, "Entered HTAnchor_findAddress\n"));
 
     /*
-    **	If the address represents a sub-anchor, we load its parent,
-    **	then we create a named child anchor within that parent.
-    */
+     * If the address represents a sub-anchor, we load its parent, then we
+     * create a named child anchor within that parent.
+     */
     if (*tag) {
 	DocAddress parsed_doc;
-	HTParentAnchor0 * foundParent;
-	HTChildAnchor * foundAnchor;
+	HTParentAnchor0 *foundParent;
+	HTChildAnchor *foundAnchor;
 
 	parsed_doc.address = HTParse(newdoc->address, "",
 				     PARSE_ALL_WITHOUT_ANCHOR);
@@ -408,66 +401,63 @@ HTParentAnchor * HTAnchor_findAddress (
 	parsed_doc.safe = newdoc->safe;
 
 	foundParent = HTAnchor_findAddress_in_adult_table(&parsed_doc);
-	foundAnchor = HTAnchor_findNamedChild (foundParent, tag);
+	foundAnchor = HTAnchor_findNamedChild(foundParent, tag);
 	FREE(parsed_doc.address);
-	return HTAnchor_parent((HTAnchor *)foundParent);
+	return HTAnchor_parent((HTAnchor *) foundParent);
     }
-    return HTAnchor_parent((HTAnchor *)HTAnchor_findAddress_in_adult_table(newdoc));
+    return HTAnchor_parent((HTAnchor *) HTAnchor_findAddress_in_adult_table(newdoc));
 }
 
-
 /*  The address has no anchor tag, for sure.
  */
-static HTParentAnchor0 * HTAnchor_findAddress_in_adult_table (
-	const DocAddress *	newdoc)
+static HTParentAnchor0 *HTAnchor_findAddress_in_adult_table(const DocAddress *newdoc)
 {
     /*
-    **  Check whether we have this node.
-    */
+     * Check whether we have this node.
+     */
     int hash;
-    HTList * adults;
+    HTList *adults;
     HTList *grownups;
-    HTParentAnchor0 * foundAnchor;
+    HTParentAnchor0 *foundAnchor;
     BOOL need_extra_info = (newdoc->post_data || newdoc->post_content_type ||
-		newdoc->bookmark || newdoc->isHEAD || newdoc->safe);
+			    newdoc->bookmark || newdoc->isHEAD || newdoc->safe);
 
     /*
-     *  We need not free adult_table[] atexit -
-     *  it should be perfectly empty after free'ing all HText's.
-     *  (There is an error if it is not empty at exit). -LP
+     * We need not free adult_table[] atexit - it should be perfectly empty
+     * after free'ing all HText's.  (There is an error if it is not empty at
+     * exit).  -LP
      */
 
     /*
-    **  Select list from hash table,
-    */
+     * Select list from hash table,
+     */
     hash = HASH_FUNCTION(newdoc->address);
     adults = &(adult_table[hash]);
 
     /*
-    **  Search list for anchor.
-    */
+     * Search list for anchor.
+     */
     grownups = adults;
     while (NULL != (foundAnchor =
-		    (HTParentAnchor0 *)HTList_nextObject(grownups))) {
+		    (HTParentAnchor0 *) HTList_nextObject(grownups))) {
 	if (HTSEquivalent(foundAnchor->address, newdoc->address) &&
 
 	    ((!foundAnchor->info && !need_extra_info) ||
 	     (foundAnchor->info &&
 	      HTBEquivalent(foundAnchor->info->post_data, newdoc->post_data) &&
-	      foundAnchor->info->isHEAD == newdoc->isHEAD)))
-	{
+	      foundAnchor->info->isHEAD == newdoc->isHEAD))) {
 	    CTRACE((tfp, "Anchor %p with address `%s' already exists.\n",
-			(void *)foundAnchor, newdoc->address));
+		    (void *) foundAnchor, newdoc->address));
 	    return foundAnchor;
 	}
     }
 
     /*
-    **  Node not found: create new anchor.
-    */
+     * Node not found:  create new anchor.
+     */
     foundAnchor = HTParentAnchor0_new(newdoc->address, hash);
     CTRACE((tfp, "New anchor %p has hash %d and address `%s'\n",
-		(void *)foundAnchor, hash, newdoc->address));
+	    (void *) foundAnchor, hash, newdoc->address));
 
     if (need_extra_info) {
 	/* rare case, create a big structure */
@@ -477,7 +467,7 @@ static HTParentAnchor0 * HTAnchor_findAddress_in_adult_table (
 	    BStrCopy(p->post_data, newdoc->post_data);
 	if (newdoc->post_content_type)
 	    StrAllocCopy(p->post_content_type,
-		     newdoc->post_content_type);
+			 newdoc->post_content_type);
 	if (newdoc->bookmark)
 	    StrAllocCopy(p->bookmark, newdoc->bookmark);
 	p->isHEAD = newdoc->isHEAD;
@@ -489,17 +479,16 @@ static HTParentAnchor0 * HTAnchor_findAddress_in_adult_table (
 }
 
 /*	Create new or find old named anchor - simple form
-**	-------------------------------------------------
-**
-**     Like HTAnchor_findAddress, but simpler to use for simple cases.
-**	No post data etc. can be supplied. - kw
-*/
-HTParentAnchor * HTAnchor_findSimpleAddress (
-	const char *	url)
+ *	-------------------------------------------------
+ *
+ *     Like HTAnchor_findAddress, but simpler to use for simple cases.
+ *	No post data etc. can be supplied. - kw
+ */
+HTParentAnchor *HTAnchor_findSimpleAddress(const char *url)
 {
     DocAddress urldoc;
 
-    urldoc.address = (char *)url; /* ignore warning, it IS treated like const - kw */
+    urldoc.address = (char *) url;	/* ignore warning, it IS treated like const - kw */
     urldoc.post_data = NULL;
     urldoc.post_content_type = NULL;
     urldoc.bookmark = NULL;
@@ -508,22 +497,20 @@ HTParentAnchor * HTAnchor_findSimpleAddress (
     return HTAnchor_findAddress(&urldoc);
 }
 
-
 /*	Link me Anchor to another given one
-**	-------------------------------------
-*/
-static BOOL HTAnchor_link (
-	HTChildAnchor *	child,
-	HTAnchor *		destination,
-	HTLinkType *		type)
+ *	-------------------------------------
+ */
+static BOOL HTAnchor_link(HTChildAnchor *child,
+			  HTAnchor * destination,
+			  HTLinkType *type)
 {
     if (!(child && destination))
-	return(NO);  /* Can't link to/from non-existing anchor */
+	return (NO);		/* Can't link to/from non-existing anchor */
 
     CTRACE((tfp, "Linking child %p to anchor %p\n", child, destination));
     if (child->dest) {
 	CTRACE((tfp, "*** child anchor already has destination, exiting!\n"));
-	return(NO);
+	return (NO);
     }
 
     child->dest = destination;
@@ -533,54 +520,51 @@ static BOOL HTAnchor_link (
 	/* link only foreign children */
 	HTList_linkObject(&destination->parent->sources, child, &child->_add_sources);
 
-    return(YES);  /* Success */
+    return (YES);		/* Success */
 }
 
-
 /*	Delete an anchor and possibly related things (auto garbage collection)
-**	--------------------------------------------
-**
-**	The anchor is only deleted if the corresponding document is not loaded.
-**	All outgoing links from children are deleted, and children are
-**	removed from the sources lists of theirs targets.
-**	We also try to delete the targets whose documents are not loaded.
-**	If this anchor's sources list is empty, we delete it and its children.
-*/
+ *	--------------------------------------------
+ *
+ *	The anchor is only deleted if the corresponding document is not loaded.
+ *	All outgoing links from children are deleted, and children are
+ *	removed from the sources lists of theirs targets.
+ *	We also try to delete the targets whose documents are not loaded.
+ *	If this anchor's sources list is empty, we delete it and its children.
+ */
 
 /*
  *	Recursively try to delete destination anchor of this child.
  *	In any event, this will tell destination anchor that we
  *	no longer consider it a destination.
  */
-static void deleteLinks (
-	HTChildAnchor *	me)
+static void deleteLinks(HTChildAnchor *me)
 {
     /*
-     *	Unregister me with our destination anchor's parent.
+     * Unregister me with our destination anchor's parent.
      */
     if (me->dest) {
 	HTParentAnchor0 *parent = me->dest->parent;
 
 	/*
-	 *  Start.  Set the dest pointer to zero.
+	 * Start.  Set the dest pointer to zero.
 	 */
-	 me->dest = NULL;
+	me->dest = NULL;
 
 	/*
-	 *  Remove me from the parent's sources so that the
-	 *  parent knows one less anchor is its dest.
+	 * Remove me from the parent's sources so that the parent knows one
+	 * less anchor is its dest.
 	 */
 	if ((me->parent != parent) && !HTList_isEmpty(&parent->sources)) {
 	    /*
-	     *	Really should only need to deregister once.
+	     * Really should only need to deregister once.
 	     */
-	    HTList_unlinkObject(&parent->sources, (void *)me);
+	    HTList_unlinkObject(&parent->sources, (void *) me);
 	}
 
 	/*
-	 *  Recursive call.
-	 *  Test here to avoid calling overhead.
-	 *  Don't delete if document is loaded or being loaded.
+	 * Recursive call.  Test here to avoid calling overhead.  Don't delete
+	 * if document is loaded or being loaded.
 	 */
 	if ((me->parent != parent) && !parent->underway &&
 	    (!parent->info || !parent->info->document)) {
@@ -588,58 +572,54 @@ static void deleteLinks (
 	}
 
 	/*
-	 *  At this point, we haven't a destination.  Set it to be
-	 *  so.
-	 *  Leave the HTAtom pointed to by type up to other code to
-	 *  handle (reusable, near static).
+	 * At this point, we haven't a destination.  Set it to be so.  Leave
+	 * the HTAtom pointed to by type up to other code to handle (reusable,
+	 * near static).
 	 */
 	me->type = NULL;
     }
 }
 
+static void HTParentAnchor_free(HTParentAnchor *me);
 
-static void HTParentAnchor_free (
-	HTParentAnchor *	me);
-
-BOOL HTAnchor_delete (
-	HTParentAnchor0 *	me)
+BOOL HTAnchor_delete(HTParentAnchor0 *me)
 {
     /*
-     *	Memory leaks fixed.
+     * Memory leaks fixed.
      * 05-27-94 Lynx 2-3-1 Garrett Arch Blythe
      */
     HTBTElement *ele;
     HTChildAnchor *child;
 
     /*
-     *	Do nothing if nothing to do.
+     * Do nothing if nothing to do.
      */
     if (!me) {
-	return(NO);
+	return (NO);
     }
 
     /*
-     *	Don't delete if document is loaded or being loaded.
+     * Don't delete if document is loaded or being loaded.
      */
     if (me->underway || (me->info && me->info->document)) {
-	return(NO);
+	return (NO);
     }
 
     /*
-     *  Mark ourselves busy, so that recursive calls of this function
-     *  on this HTParentAnchor0 will not free it from under our feet. - kw
+     * Mark ourselves busy, so that recursive calls of this function on this
+     * HTParentAnchor0 will not free it from under our feet.  - kw
      */
     me->underway = TRUE;
 
     {
 	/*
-	 *  Delete all outgoing links from named children.
-	 *  Do not delete named children itself (may have incoming links).
+	 * Delete all outgoing links from named children.  Do not delete named
+	 * children itself (may have incoming links).
 	 */
 	if (me->children) {
 	    ele = HTBTree_next(me->children, NULL);
 	    while (ele != NULL) {
-		child = (HTChildAnchor *)HTBTree_object(ele);
+		child = (HTChildAnchor *) HTBTree_object(ele);
 		if (child->dest)
 		    deleteLinks(child);
 		ele = HTBTree_next(me->children, ele);
@@ -648,26 +628,25 @@ BOOL HTAnchor_delete (
     }
     me->underway = FALSE;
 
-
     /*
      * There are still incoming links to this one (we are the
      * destination of another anchor).
      */
     if (!HTList_isEmpty(&me->sources)) {
 	/*
-	 *  Can't delete parent, still have sources.
+	 * Can't delete parent, still have sources.
 	 */
-	return(NO);
+	return (NO);
     }
 
     /*
-     *	No more incoming and outgoing links : kill everything
-     *	First, delete named children.
+     * No more incoming and outgoing links :  kill everything First, delete
+     * named children.
      */
     if (me->children) {
 	ele = HTBTree_next(me->children, NULL);
 	while (ele != NULL) {
-	    child = (HTChildAnchor *)HTBTree_object(ele);
+	    child = (HTChildAnchor *) HTBTree_object(ele);
 	    FREE(child->tag);
 	    FREE(child);
 	    ele = HTBTree_next(me->children, ele);
@@ -676,7 +655,7 @@ BOOL HTAnchor_delete (
     }
 
     /*
-     *  Delete the ParentAnchor, if any. (Document was already deleted).
+     * Delete the ParentAnchor, if any.  (Document was already deleted).
      */
     if (me->info) {
 	HTParentAnchor_free(me->info);
@@ -684,79 +663,76 @@ BOOL HTAnchor_delete (
     }
 
     /*
-     *	Remove ourselves from the hash table's list.
+     * Remove ourselves from the hash table's list.
      */
-    HTList_unlinkObject(&(adult_table[me->adult_hash]), (void *)me);
+    HTList_unlinkObject(&(adult_table[me->adult_hash]), (void *) me);
 
     /*
-     *	Free the address.
+     * Free the address.
      */
     FREE(me->address);
 
     /*
-     *	Finally, kill the parent anchor passed in.
+     * Finally, kill the parent anchor passed in.
      */
     FREE(me);
 
-    return(YES);
+    return (YES);
 }
 
 /*
- *  Unnamed children (children_notag) have no sence without HText -
- *  delete them and their links if we are about to free HText.
- *  Document currently exists. Called within HText_free().
+ * Unnamed children (children_notag) have no sence without HText - delete them
+ * and their links if we are about to free HText.  Document currently exists. 
+ * Called within HText_free().
  */
-void HTAnchor_delete_links (
-	HTParentAnchor *	me)
+void HTAnchor_delete_links(HTParentAnchor *me)
 {
     HTList *cur;
     HTChildAnchor *child;
 
     /*
-     *	Do nothing if nothing to do.
+     * Do nothing if nothing to do.
      */
     if (!me || !me->document) {
 	return;
     }
 
     /*
-     *  Mark ourselves busy, so that recursive calls
-     *  on this HTParentAnchor0 will not free it from under our feet. - kw
+     * Mark ourselves busy, so that recursive calls on this HTParentAnchor0
+     * will not free it from under our feet.  - kw
      */
     me->parent->underway = TRUE;
 
     /*
-     *  Delete all outgoing links from unnamed children.
+     * Delete all outgoing links from unnamed children.
      */
     if (!HTList_isEmpty(&me->children_notag)) {
 	cur = &me->children_notag;
 	while ((child =
-		(HTChildAnchor *)HTList_unlinkLastObject(cur)) != 0) {
+		(HTChildAnchor *) HTList_unlinkLastObject(cur)) != 0) {
 	    deleteLinks(child);
-	    /* child allocated in HText pool, HText_free() will free it later*/
+	    /* child allocated in HText pool, HText_free() will free it later */
 	}
     }
     me->parent->underway = FALSE;
 }
 
-
-static void HTParentAnchor_free (
-	HTParentAnchor *	me)
+static void HTParentAnchor_free(HTParentAnchor *me)
 {
     /*
-     *	Delete the methods list.
+     * Delete the methods list.
      */
     if (me->methods) {
 	/*
-	 *  Leave what the methods point to up in memory for
-	 *  other code (near static stuff).
+	 * Leave what the methods point to up in memory for other code (near
+	 * static stuff).
 	 */
 	HTList_delete(me->methods);
 	me->methods = NULL;
     }
 
     /*
-     *	Free up all allocated members.
+     * Free up all allocated members.
      */
     FREE(me->charset);
     FREE(me->isIndexAction);
@@ -774,6 +750,7 @@ static void HTParentAnchor_free (
 #endif
     if (me->FileCache) {
 	FILE *fd;
+
 	if ((fd = fopen(me->FileCache, "r")) != NULL) {
 	    fclose(fd);
 	    remove(me->FileCache);
@@ -802,10 +779,10 @@ static void HTParentAnchor_free (
 #endif
 
     /*
-     *	Original code wanted a way to clean out the HTFormat if no
-     *	longer needed (ref count?).  I'll leave it alone since
-     *	those HTAtom objects are a little harder to know where
-     *	they are being referenced all at one time. (near static)
+     * Original code wanted a way to clean out the HTFormat if no longer needed
+     * (ref count?).  I'll leave it alone since those HTAtom objects are a
+     * little harder to know where they are being referenced all at one time. 
+     * (near static)
      */
 
     FREE(me->UCStages);
@@ -813,21 +790,20 @@ static void HTParentAnchor_free (
 }
 
 #ifdef USE_SOURCE_CACHE
-void HTAnchor_clearSourceCache (
-	HTParentAnchor *	me)
+void HTAnchor_clearSourceCache(HTParentAnchor *me)
 {
     /*
      * Clean up the source cache, if any.
      */
     if (me->source_cache_file) {
 	CTRACE((tfp, "SourceCache: Removing file %s\n",
-	       me->source_cache_file));
+		me->source_cache_file));
 	LYRemoveTemp(me->source_cache_file);
 	FREE(me->source_cache_file);
     }
     if (me->source_cache_chunk) {
 	CTRACE((tfp, "SourceCache: Removing memory chunk %p\n",
-	       (void *)me->source_cache_chunk));
+		(void *) me->source_cache_chunk));
 	HTChunkFree(me->source_cache_chunk);
 	me->source_cache_chunk = NULL;
     }
@@ -835,10 +811,9 @@ void HTAnchor_clearSourceCache (
 #endif /* USE_SOURCE_CACHE */
 
 /*	Data access functions
-**	---------------------
-*/
-HTParentAnchor * HTAnchor_parent (
-	HTAnchor *	me)
+ *	---------------------
+ */
+HTParentAnchor *HTAnchor_parent(HTAnchor * me)
 {
     if (!me)
 	return NULL;
@@ -850,56 +825,49 @@ HTParentAnchor * HTAnchor_parent (
     return HTParentAnchor_new(me->parent);
 }
 
-void HTAnchor_setDocument (
-	HTParentAnchor *	me,
-	HyperDoc *		doc)
+void HTAnchor_setDocument(HTParentAnchor *me,
+			  HyperDoc *doc)
 {
     if (me)
 	me->document = doc;
 }
 
-HyperDoc * HTAnchor_document (
-	HTParentAnchor *	me)
+HyperDoc *HTAnchor_document(HTParentAnchor *me)
 {
-    return( me ? me->document : NULL);
+    return (me ? me->document : NULL);
 }
 
-
-char * HTAnchor_address (
-	HTAnchor *	me)
+char *HTAnchor_address(HTAnchor * me)
 {
     char *addr = NULL;
 
     if (me) {
-	if (((HTParentAnchor0 *)me == me->parent) ||
-	    ((HTParentAnchor *)me == me->parent->info) ||
-	    !((HTChildAnchor *)me)->tag) {  /* it's an adult or no tag */
+	if (((HTParentAnchor0 *) me == me->parent) ||
+	    ((HTParentAnchor *) me == me->parent->info) ||
+	    !((HTChildAnchor *) me)->tag) {	/* it's an adult or no tag */
 	    StrAllocCopy(addr, me->parent->address);
-	} else {  /* it's a named child */
+	} else {		/* it's a named child */
 	    HTSprintf0(&addr, "%s#%s",
-		       me->parent->address, ((HTChildAnchor *)me)->tag);
+		       me->parent->address, ((HTChildAnchor *) me)->tag);
 	}
     }
-    return(addr);
+    return (addr);
 }
 
-void HTAnchor_setFormat (
-	HTParentAnchor *	me,
-	HTFormat		form)
+void HTAnchor_setFormat(HTParentAnchor *me,
+			HTFormat form)
 {
     if (me)
 	me->format = form;
 }
 
-HTFormat HTAnchor_format (
-	HTParentAnchor *	me)
+HTFormat HTAnchor_format(HTParentAnchor *me)
 {
-    return( me ? me->format : NULL);
+    return (me ? me->format : NULL);
 }
 
-void HTAnchor_setIndex (
-	HTParentAnchor *	me,
-	const char *		address)
+void HTAnchor_setIndex(HTParentAnchor *me,
+		       const char *address)
 {
     if (me) {
 	me->isIndex = YES;
@@ -907,42 +875,37 @@ void HTAnchor_setIndex (
     }
 }
 
-void HTAnchor_setPrompt (
-	HTParentAnchor *	me,
-	const char *		prompt)
+void HTAnchor_setPrompt(HTParentAnchor *me,
+			const char *prompt)
 {
     if (me) {
 	StrAllocCopy(me->isIndexPrompt, prompt);
     }
 }
 
-BOOL HTAnchor_isIndex (
-	HTParentAnchor *	me)
+BOOL HTAnchor_isIndex(HTParentAnchor *me)
 {
-    return( me ? me->isIndex : NO);
+    return (me ? me->isIndex : NO);
 }
 
 /*	Whether Anchor has been designated as an ISMAP link
-**	(normally by presence of an ISMAP attribute on A or IMG) - KW
-*/
-BOOL HTAnchor_isISMAPScript (
-	HTAnchor *	me)
+ *	(normally by presence of an ISMAP attribute on A or IMG) - KW
+ */
+BOOL HTAnchor_isISMAPScript(HTAnchor * me)
 {
-    return( (me && me->parent->info) ? me->parent->info->isISMAPScript : NO);
+    return ((me && me->parent->info) ? me->parent->info->isISMAPScript : NO);
 }
 
 #if defined(USE_COLOR_STYLE)
 /*	Style handling.
 */
-const char * HTAnchor_style (
-	HTParentAnchor *	me)
+const char *HTAnchor_style(HTParentAnchor *me)
 {
-	return( me ? me->style : NULL);
+    return (me ? me->style : NULL);
 }
 
-void HTAnchor_setStyle (
-	HTParentAnchor *	me,
-	const char *		style)
+void HTAnchor_setStyle(HTParentAnchor *me,
+		       const char *style)
 {
     if (me) {
 	StrAllocCopy(me->style, style);
@@ -950,18 +913,15 @@ void HTAnchor_setStyle (
 }
 #endif
 
-
 /*	Title handling.
 */
-const char * HTAnchor_title (
-	HTParentAnchor *	me)
+const char *HTAnchor_title(HTParentAnchor *me)
 {
-    return( me ? me->title : NULL);
+    return (me ? me->title : NULL);
 }
 
-void HTAnchor_setTitle (
-	HTParentAnchor *	me,
-	const char *		title)
+void HTAnchor_setTitle(HTParentAnchor *me,
+		       const char *title)
 {
     int i;
 
@@ -975,20 +935,19 @@ void HTAnchor_setTitle (
 		}
 	    }
 	} else {
-	    CTRACE((tfp,"HTAnchor_setTitle: New title is NULL! "));
+	    CTRACE((tfp, "HTAnchor_setTitle: New title is NULL! "));
 	    if (me->title) {
-		CTRACE((tfp,"Old title was \"%s\".\n", me->title));
+		CTRACE((tfp, "Old title was \"%s\".\n", me->title));
 		FREE(me->title);
 	    } else {
-		CTRACE((tfp,"Old title was NULL.\n"));
+		CTRACE((tfp, "Old title was NULL.\n"));
 	    }
 	}
     }
 }
 
-void HTAnchor_appendTitle (
-	HTParentAnchor *	me,
-	const char *		title)
+void HTAnchor_appendTitle(HTParentAnchor *me,
+			  const char *title)
 {
     int i;
 
@@ -1005,15 +964,13 @@ void HTAnchor_appendTitle (
 
 /*	Bookmark handling.
 */
-const char * HTAnchor_bookmark (
-	HTParentAnchor *	me)
+const char *HTAnchor_bookmark(HTParentAnchor *me)
 {
-    return( me ? me->bookmark : NULL);
+    return (me ? me->bookmark : NULL);
 }
 
-void HTAnchor_setBookmark (
-	HTParentAnchor *	me,
-	const char *		bookmark)
+void HTAnchor_setBookmark(HTParentAnchor *me,
+			  const char *bookmark)
 {
     if (me)
 	StrAllocCopy(me->bookmark, bookmark);
@@ -1021,15 +978,13 @@ void HTAnchor_setBookmark (
 
 /*	Owner handling.
 */
-const char * HTAnchor_owner (
-	HTParentAnchor *	me)
+const char *HTAnchor_owner(HTParentAnchor *me)
 {
-    return( me ? me->owner : NULL);
+    return (me ? me->owner : NULL);
 }
 
-void HTAnchor_setOwner (
-	HTParentAnchor *	me,
-	const char *		owner)
+void HTAnchor_setOwner(HTParentAnchor *me,
+		       const char *owner)
 {
     if (me) {
 	StrAllocCopy(me->owner, owner);
@@ -1038,15 +993,13 @@ void HTAnchor_setOwner (
 
 /*	TITLE handling in LINKs with REV="made" or REV="owner". - FM
 */
-const char * HTAnchor_RevTitle (
-	HTParentAnchor *	me)
+const char *HTAnchor_RevTitle(HTParentAnchor *me)
 {
-    return( me ? me->RevTitle : NULL);
+    return (me ? me->RevTitle : NULL);
 }
 
-void HTAnchor_setRevTitle (
-	HTParentAnchor *	me,
-	const char *		title)
+void HTAnchor_setRevTitle(HTParentAnchor *me,
+			  const char *title)
 {
     int i;
 
@@ -1064,15 +1017,13 @@ void HTAnchor_setRevTitle (
 #ifndef DISABLE_BIBP
 /*	Citehost for bibp links from LINKs with REL="citehost". - RDC
 */
-const char * HTAnchor_citehost (
-	HTParentAnchor *	me)
+const char *HTAnchor_citehost(HTParentAnchor *me)
 {
-    return( me ? me->citehost : NULL);
+    return (me ? me->citehost : NULL);
 }
 
-void HTAnchor_setCitehost (
-	HTParentAnchor *	me,
-	const char *		citehost)
+void HTAnchor_setCitehost(HTParentAnchor *me,
+			  const char *citehost)
 {
     if (me) {
 	StrAllocCopy(me->citehost, citehost);
@@ -1081,92 +1032,81 @@ void HTAnchor_setCitehost (
 #endif /* !DISABLE_BIBP */
 
 /*	Suggested filename handling. - FM
-**	(will be loaded if we had a Content-Disposition
-**	 header or META element with filename=name.suffix)
-*/
-const char * HTAnchor_SugFname (
-	HTParentAnchor *	me)
+ *	(will be loaded if we had a Content-Disposition
+ *	 header or META element with filename=name.suffix)
+ */
+const char *HTAnchor_SugFname(HTParentAnchor *me)
 {
-    return( me ? me->SugFname : NULL);
+    return (me ? me->SugFname : NULL);
 }
 
 /*	Content-Encoding handling. - FM
-**	(will be loaded if we had a Content-Encoding
-**	 header.)
-*/
-const char * HTAnchor_content_encoding (
-	HTParentAnchor *	me)
+ *	(will be loaded if we had a Content-Encoding
+ *	 header.)
+ */
+const char *HTAnchor_content_encoding(HTParentAnchor *me)
 {
-    return( me ? me->content_encoding : NULL);
+    return (me ? me->content_encoding : NULL);
 }
 
 /*	Content-Type handling. - FM
 */
-const char * HTAnchor_content_type (
-	HTParentAnchor *	me)
+const char *HTAnchor_content_type(HTParentAnchor *me)
 {
-    return( me ? me->content_type : NULL);
+    return (me ? me->content_type : NULL);
 }
 
 /*	Last-Modified header handling. - FM
 */
-const char * HTAnchor_last_modified (
-	HTParentAnchor *	me)
+const char *HTAnchor_last_modified(HTParentAnchor *me)
 {
-    return( me ? me->last_modified : NULL);
+    return (me ? me->last_modified : NULL);
 }
 
 /*	Date header handling. - FM
 */
-const char * HTAnchor_date (
-	HTParentAnchor *	me)
+const char *HTAnchor_date(HTParentAnchor *me)
 {
-    return( me ? me->date : NULL);
+    return (me ? me->date : NULL);
 }
 
 /*	Server header handling. - FM
 */
-const char * HTAnchor_server (
-	HTParentAnchor *	me)
+const char *HTAnchor_server(HTParentAnchor *me)
 {
-    return( me ? me->server : NULL);
+    return (me ? me->server : NULL);
 }
 
 /*	Safe header handling. - FM
 */
-BOOL HTAnchor_safe (
-	HTParentAnchor *	me)
+BOOL HTAnchor_safe(HTParentAnchor *me)
 {
-    return (BOOL) ( me ? me->safe : FALSE);
+    return (BOOL) (me ? me->safe : FALSE);
 }
 
 /*	Content-Base header handling. - FM
 */
-const char * HTAnchor_content_base (
-	HTParentAnchor *	me)
+const char *HTAnchor_content_base(HTParentAnchor *me)
 {
-    return( me ? me->content_base : NULL);
+    return (me ? me->content_base : NULL);
 }
 
 /*	Content-Location header handling. - FM
 */
-const char * HTAnchor_content_location (
-	HTParentAnchor *	me)
+const char *HTAnchor_content_location(HTParentAnchor *me)
 {
-    return( me ? me->content_location : NULL);
+    return (me ? me->content_location : NULL);
 }
 
 /*	Message-ID, used for mail replies - kw
 */
-const char * HTAnchor_messageID (
-	HTParentAnchor *	me)
+const char *HTAnchor_messageID(HTParentAnchor *me)
 {
-    return( me ? me->message_id : NULL);
+    return (me ? me->message_id : NULL);
 }
 
-BOOL HTAnchor_setMessageID (
-	HTParentAnchor *	me,
-	const char *		messageid)
+BOOL HTAnchor_setMessageID(HTParentAnchor *me,
+			   const char *messageid)
 {
     if (!(me && messageid && *messageid)) {
 	return FALSE;
@@ -1177,15 +1117,13 @@ BOOL HTAnchor_setMessageID (
 
 /*	Subject, used for mail replies - kw
 */
-const char * HTAnchor_subject (
-	HTParentAnchor *	me)
+const char *HTAnchor_subject(HTParentAnchor *me)
 {
-    return( me ? me->subject : NULL);
+    return (me ? me->subject : NULL);
 }
 
-BOOL HTAnchor_setSubject (
-	HTParentAnchor *	me,
-	const char *		subject)
+BOOL HTAnchor_setSubject(HTParentAnchor *me,
+			 const char *subject)
 {
     if (!(me && subject && *subject)) {
 	return FALSE;
@@ -1195,64 +1133,56 @@ BOOL HTAnchor_setSubject (
 }
 
 /*	Manipulation of links
-**	---------------------
-*/
-HTAnchor * HTAnchor_followLink (
-	HTChildAnchor *	me)
+ *	---------------------
+ */
+HTAnchor *HTAnchor_followLink(HTChildAnchor *me)
 {
-    return( me->dest);
+    return (me->dest);
 }
 
-HTAnchor * HTAnchor_followTypedLink (
-	HTChildAnchor *	me,
-	HTLinkType *		type)
+HTAnchor *HTAnchor_followTypedLink(HTChildAnchor *me,
+				   HTLinkType *type)
 {
     if (me->type == type)
-	return( me->dest);
-    return(NULL);  /* No link of me type */
+	return (me->dest);
+    return (NULL);		/* No link of me type */
 }
 
-
 /*	Methods List
-**	------------
-*/
-HTList * HTAnchor_methods (
-	HTParentAnchor *	me)
+ *	------------
+ */
+HTList *HTAnchor_methods(HTParentAnchor *me)
 {
     if (!me->methods) {
 	me->methods = HTList_new();
     }
-    return( me->methods);
+    return (me->methods);
 }
 
 /*	Protocol
-**	--------
-*/
-void * HTAnchor_protocol (
-	HTParentAnchor *	me)
+ *	--------
+ */
+void *HTAnchor_protocol(HTParentAnchor *me)
 {
-    return( me->protocol);
+    return (me->protocol);
 }
 
-void HTAnchor_setProtocol (
-	HTParentAnchor *	me,
-	void*			protocol)
+void HTAnchor_setProtocol(HTParentAnchor *me,
+			  void *protocol)
 {
     me->protocol = protocol;
 }
 
 /*	Physical Address
-**	----------------
-*/
-char * HTAnchor_physical (
-	HTParentAnchor *	me)
+ *	----------------
+ */
+char *HTAnchor_physical(HTParentAnchor *me)
 {
-    return( me->physical);
+    return (me->physical);
 }
 
-void HTAnchor_setPhysical (
-	HTParentAnchor *	me,
-	char *			physical)
+void HTAnchor_setPhysical(HTParentAnchor *me,
+			  char *physical)
 {
     if (me) {
 	StrAllocCopy(me->physical, physical);
@@ -1260,37 +1190,37 @@ void HTAnchor_setPhysical (
 }
 
 /*
-**  We store charset info in the HTParentAnchor object, for several
-**  "stages".  (See UCDefs.h)
-**  A stream method is supposed to know what stage in the model it is.
-**
-**  General model	MIME	 ->  parser  ->  structured  ->  HText
-**  e.g., text/html
-**	from HTTP:	HTMIME.c ->  SGML.c  ->  HTML.c      ->  GridText.c
-**     text/plain
-**	from file:	HTFile.c ->  HTPlain.c		     ->  GridText.c
-**
-**  The lock/set_by is used to lock e.g. a charset set by an explicit
-**  HTTP MIME header against overriding by a HTML META tag - the MIME
-**  header has higher priority.  Defaults (from -assume_.. options etc.)
-**  will not override charset explicitly given by server.
-**
-**  Some advantages of keeping this in the HTAnchor:
-**  - Global variables are bad.
-**  - Can remember a charset given by META tag when toggling to SOURCE view.
-**  - Can remember a charset given by <A CHARSET=...> href in another doc.
-**
-**  We don't modify the HTParentAnchor's charset element
-**  here, that one will only be set when explicitly given.
-*/
-LYUCcharset * HTAnchor_getUCInfoStage (
-	HTParentAnchor *	me,
-	int			which_stage)
+ *  We store charset info in the HTParentAnchor object, for several
+ *  "stages".  (See UCDefs.h)
+ *  A stream method is supposed to know what stage in the model it is.
+ *
+ *  General model	MIME	 ->  parser  ->  structured  ->  HText
+ *  e.g., text/html
+ *	from HTTP:	HTMIME.c ->  SGML.c  ->  HTML.c      ->  GridText.c
+ *     text/plain
+ *	from file:	HTFile.c ->  HTPlain.c		     ->  GridText.c
+ *
+ *  The lock/set_by is used to lock e.g. a charset set by an explicit
+ *  HTTP MIME header against overriding by a HTML META tag - the MIME
+ *  header has higher priority.  Defaults (from -assume_.. options etc.)
+ *  will not override charset explicitly given by server.
+ *
+ *  Some advantages of keeping this in the HTAnchor:
+ *  - Global variables are bad.
+ *  - Can remember a charset given by META tag when toggling to SOURCE view.
+ *  - Can remember a charset given by <A CHARSET=...> href in another doc.
+ *
+ *  We don't modify the HTParentAnchor's charset element
+ *  here, that one will only be set when explicitly given.
+ */
+LYUCcharset *HTAnchor_getUCInfoStage(HTParentAnchor *me,
+				     int which_stage)
 {
     if (me && !me->UCStages) {
 	int i;
-	int chndl = UCLYhndl_for_unspec;  /* always >= 0 */
-	UCAnchorInfo * stages = typecalloc(UCAnchorInfo);
+	int chndl = UCLYhndl_for_unspec;	/* always >= 0 */
+	UCAnchorInfo *stages = typecalloc(UCAnchorInfo);
+
 	if (stages == NULL)
 	    outofmem(__FILE__, "HTAnchor_getUCInfoStage");
 	for (i = 0; i < UCT_STAGEMAX; i++) {
@@ -1303,68 +1233,69 @@ LYUCcharset * HTAnchor_getUCInfoStage (
 		chndl = UCLYhndl_for_unrec;
 	    if (chndl < 0)
 		/*
-		**  UCLYhndl_for_unrec not defined :-(
-		**  fallback to UCLYhndl_for_unspec which always valid.
-		*/
-		chndl = UCLYhndl_for_unspec;  /* always >= 0 */
+		 * UCLYhndl_for_unrec not defined :-(
+		 * fallback to UCLYhndl_for_unspec which always valid.
+		 */
+		chndl = UCLYhndl_for_unspec;	/* always >= 0 */
 	}
 	memcpy(&stages->s[UCT_STAGE_MIME].C, &LYCharSet_UC[chndl],
 	       sizeof(LYUCcharset));
+
 	stages->s[UCT_STAGE_MIME].lock = UCT_SETBY_DEFAULT;
 	stages->s[UCT_STAGE_MIME].LYhndl = chndl;
 	me->UCStages = stages;
     }
     if (me) {
-	return( &me->UCStages->s[which_stage].C);
+	return (&me->UCStages->s[which_stage].C);
     }
-    return(NULL);
+    return (NULL);
 }
 
-int HTAnchor_getUCLYhndl (
-	HTParentAnchor *	me,
-	int			which_stage)
+int HTAnchor_getUCLYhndl(HTParentAnchor *me,
+			 int which_stage)
 {
     if (me) {
 	if (!me->UCStages) {
 	    /*
-	     *	This will allocate and initialize, if not yet done.
+	     * This will allocate and initialize, if not yet done.
 	     */
 	    (void) HTAnchor_getUCInfoStage(me, which_stage);
 	}
 	if (me->UCStages->s[which_stage].lock > UCT_SETBY_NONE) {
-	    return( me->UCStages->s[which_stage].LYhndl);
+	    return (me->UCStages->s[which_stage].LYhndl);
 	}
     }
-    return( -1);
+    return (-1);
 }
 
 #ifdef CAN_SWITCH_DISPLAY_CHARSET
-static void setup_switch_display_charset (HTParentAnchor * me, int h)
+static void setup_switch_display_charset(HTParentAnchor *me, int h)
 {
-    if (!Switch_Display_Charset(h,SWITCH_DISPLAY_CHARSET_MAYBE))
+    if (!Switch_Display_Charset(h, SWITCH_DISPLAY_CHARSET_MAYBE))
 	return;
     HTAnchor_setUCInfoStage(me, current_char_set,
-			    UCT_STAGE_HTEXT, UCT_SETBY_MIME); /* highest priorty! */
+			    UCT_STAGE_HTEXT, UCT_SETBY_MIME);	/* highest priorty! */
     HTAnchor_setUCInfoStage(me, current_char_set,
-			    UCT_STAGE_STRUCTURED, UCT_SETBY_MIME); /* highest priorty! */
-    CTRACE((tfp, "changing UCInfoStage: HTEXT/STRUCTURED stages charset='%s'.\n",
+			    UCT_STAGE_STRUCTURED, UCT_SETBY_MIME);	/* highest priorty! */
+    CTRACE((tfp,
+	    "changing UCInfoStage: HTEXT/STRUCTURED stages charset='%s'.\n",
 	    LYCharSet_UC[current_char_set].MIMEname));
 }
 #endif
 
-LYUCcharset * HTAnchor_setUCInfoStage (
-	HTParentAnchor *	me,
-	int			LYhndl,
-	int			which_stage,
-	int			set_by)
+LYUCcharset *HTAnchor_setUCInfoStage(HTParentAnchor *me,
+				     int LYhndl,
+				     int which_stage,
+				     int set_by)
 {
     if (me) {
 	/*
-	 *  This will allocate and initialize, if not yet done.
+	 * This will allocate and initialize, if not yet done.
 	 */
-	LYUCcharset * p = HTAnchor_getUCInfoStage(me, which_stage);
+	LYUCcharset *p = HTAnchor_getUCInfoStage(me, which_stage);
+
 	/*
-	 *  Can we override?
+	 * Can we override?
 	 */
 	if (set_by >= me->UCStages->s[which_stage].lock) {
 #ifdef CAN_SWITCH_DISPLAY_CHARSET
@@ -1374,31 +1305,30 @@ LYUCcharset * HTAnchor_setUCInfoStage (
 	    me->UCStages->s[which_stage].LYhndl = LYhndl;
 	    if (LYhndl >= 0) {
 		memcpy(p, &LYCharSet_UC[LYhndl], sizeof(LYUCcharset));
+
 #ifdef CAN_SWITCH_DISPLAY_CHARSET
 		/* Allow a switch to a more suitable display charset */
-		if ( LYhndl != ohandle && which_stage == UCT_STAGE_PARSER )
+		if (LYhndl != ohandle && which_stage == UCT_STAGE_PARSER)
 		    setup_switch_display_charset(me, LYhndl);
 #endif
-	    }
-	    else {
+	    } else {
 		p->UChndl = -1;
 	    }
-	    return(p);
+	    return (p);
 	}
     }
-    return(NULL);
+    return (NULL);
 }
 
-LYUCcharset * HTAnchor_resetUCInfoStage (
-	HTParentAnchor *	me,
-	int			LYhndl,
-	int			which_stage,
-	int			set_by)
+LYUCcharset *HTAnchor_resetUCInfoStage(HTParentAnchor *me,
+				       int LYhndl,
+				       int which_stage,
+				       int set_by)
 {
     int ohandle;
 
     if (!me || !me->UCStages)
-	return(NULL);
+	return (NULL);
     me->UCStages->s[which_stage].lock = set_by;
     ohandle = me->UCStages->s[which_stage].LYhndl;
     me->UCStages->s[which_stage].LYhndl = LYhndl;
@@ -1407,26 +1337,26 @@ LYUCcharset * HTAnchor_resetUCInfoStage (
     if (LYhndl >= 0 && LYhndl != ohandle && which_stage == UCT_STAGE_PARSER)
 	setup_switch_display_charset(me, LYhndl);
 #endif
-    return( &me->UCStages->s[which_stage].C);
+    return (&me->UCStages->s[which_stage].C);
 }
 
 /*
-**  A set_by of (-1) means use the lock value from the from_stage.
-*/
-LYUCcharset * HTAnchor_copyUCInfoStage (
-	HTParentAnchor *	me,
-	int			to_stage,
-	int			from_stage,
-	int			set_by)
+ *  A set_by of (-1) means use the lock value from the from_stage.
+ */
+LYUCcharset *HTAnchor_copyUCInfoStage(HTParentAnchor *me,
+				      int to_stage,
+				      int from_stage,
+				      int set_by)
 {
     if (me) {
 	/*
-	 *  This will allocate and initialize, if not yet done.
+	 * This will allocate and initialize, if not yet done.
 	 */
-	LYUCcharset * p_from = HTAnchor_getUCInfoStage(me, from_stage);
-	LYUCcharset * p_to = HTAnchor_getUCInfoStage(me, to_stage);
+	LYUCcharset *p_from = HTAnchor_getUCInfoStage(me, from_stage);
+	LYUCcharset *p_to = HTAnchor_getUCInfoStage(me, to_stage);
+
 	/*
-	 *  Can we override?
+	 * Can we override?
 	 */
 	if (set_by == -1)
 	    set_by = me->UCStages->s[from_stage].lock;
@@ -1441,16 +1371,17 @@ LYUCcharset * HTAnchor_copyUCInfoStage (
 		me->UCStages->s[from_stage].LYhndl;
 #ifdef CAN_SWITCH_DISPLAY_CHARSET
 	    /* Allow a switch to a more suitable display charset */
-	    if ( me->UCStages->s[to_stage].LYhndl >= 0
-		 && me->UCStages->s[to_stage].LYhndl != ohandle
-		 && to_stage == UCT_STAGE_PARSER )
+	    if (me->UCStages->s[to_stage].LYhndl >= 0
+		&& me->UCStages->s[to_stage].LYhndl != ohandle
+		&& to_stage == UCT_STAGE_PARSER)
 		setup_switch_display_charset(me,
 					     me->UCStages->s[to_stage].LYhndl);
 #endif
 	    if (p_to != p_from)
 		memcpy(p_to, p_from, sizeof(LYUCcharset));
-	    return(p_to);
+
+	    return (p_to);
 	}
     }
-    return(NULL);
+    return (NULL);
 }
diff --git a/WWW/Library/Implementation/HTAnchor.h b/WWW/Library/Implementation/HTAnchor.h
index bd29fede..22a9c323 100644
--- a/WWW/Library/Implementation/HTAnchor.h
+++ b/WWW/Library/Implementation/HTAnchor.h
@@ -2,11 +2,11 @@
  */
 
 /*	Hypertext "Anchor" Object				     HTAnchor.h
-**	==========================
-**
-**	An anchor represents a region of a hypertext document which is linked
-**	to another anchor in the same or a different document.
-*/
+ *	==========================
+ *
+ *	An anchor represents a region of a hypertext document which is linked
+ *	to another anchor in the same or a different document.
+ */
 
 #ifndef HTANCHOR_H
 #define HTANCHOR_H
@@ -21,10 +21,10 @@
 #include <UCDefs.h>
 
 /*			Main definition of anchor
-**			=========================
-*/
+ *			=========================
+ */
 
-typedef struct _HyperDoc HyperDoc;  /* Ready for forward references */
+typedef struct _HyperDoc HyperDoc;	/* Ready for forward references */
 typedef struct _HTAnchor HTAnchor;
 typedef struct _HTParentAnchor HTParentAnchor;
 typedef struct _HTParentAnchor0 HTParentAnchor0;
@@ -32,26 +32,25 @@ typedef struct _HTParentAnchor0 HTParentAnchor0;
 /*	After definition of HTFormat: */
 #include <HTFormat.h>
 
-
 struct _HTAnchor {		/* Generic anchor */
-  HTParentAnchor0 * parent;	/* Parent of this anchor (self for adults) */
+    HTParentAnchor0 *parent;	/* Parent of this anchor (self for adults) */
 };
 
 struct _HTParentAnchor0 {	/* One for adult_table,
 				 * generally not used outside HTAnchor.c */
-  /* Common part from the generic anchor structure */
-  HTParentAnchor0 * parent;	/* (self) */
+    /* Common part from the generic anchor structure */
+    HTParentAnchor0 *parent;	/* (self) */
 
-  /* ParentAnchor0-specific information */
-  char		  * address;	/* Absolute address of this node */
-  HTParentAnchor  * info;	/* additional info, allocated on demand */
+    /* ParentAnchor0-specific information */
+    char *address;		/* Absolute address of this node */
+    HTParentAnchor *info;	/* additional info, allocated on demand */
 
-  HTBTree *	children;	/* Subanchors <a name="tag">, sorted by tag */
-  HTList	sources;	/* List of anchors pointing to this, if any */
+    HTBTree *children;		/* Subanchors <a name="tag">, sorted by tag */
+    HTList sources;		/* List of anchors pointing to this, if any */
 
-  HTList	_add_adult;	/* - just a memory for list entry:) */
-  short		adult_hash;	/* adult list number */
-  BOOL		underway;	/* Document about to be attached to it */
+    HTList _add_adult;		/* - just a memory for list entry:) */
+    short adult_hash;		/* adult list number */
+    BOOL underway;		/* Document about to be attached to it */
 };
 
 /*
@@ -62,387 +61,332 @@ struct _HTParentAnchor0 {	/* One for adult_table,
  *  in HTAnchor_findAddress() and HTAnchor_parent()].
  */
 struct _HTParentAnchor {
-  /* Common part from the generic anchor structure */
-  HTParentAnchor0 * parent;	/* Parent of this anchor */
-
-  /* ParentAnchor-specific information */
-  HTList	children_notag;	/* Subanchors <a href=...>, tag is NULL */
-  HyperDoc *	document;	/* The document within which this is an anchor*/
-
-  char *	address;	/* parent->address, a pointer */
-  bstring *	post_data;	/* Posting data */
-  char *	post_content_type;  /* Type of post data */
-  char *	bookmark;	/* Bookmark filename */
-  HTFormat	format;		/* Pointer to node format descriptor */
-  char *	charset;	/* Pointer to character set (kludge, for now */
-  BOOL		isIndex;	/* Acceptance of a keyword search */
-  char *	isIndexAction;	/* URL of isIndex server */
-  char *	isIndexPrompt;	/* Prompt for isIndex query */
-  char *	title;		/* Title of document */
-  char *	owner;		/* Owner of document */
-  char *	RevTitle;	/* TITLE in REV="made" or REV="owner" LINK */
-  char *	citehost;	/* Citehost from REL="citehost" LINK */
+    /* Common part from the generic anchor structure */
+    HTParentAnchor0 *parent;	/* Parent of this anchor */
+
+    /* ParentAnchor-specific information */
+    HTList children_notag;	/* Subanchors <a href=...>, tag is NULL */
+    HyperDoc *document;		/* The document within which this is an anchor */
+
+    char *address;		/* parent->address, a pointer */
+    bstring *post_data;		/* Posting data */
+    char *post_content_type;	/* Type of post data */
+    char *bookmark;		/* Bookmark filename */
+    HTFormat format;		/* Pointer to node format descriptor */
+    char *charset;		/* Pointer to character set (kludge, for now */
+    BOOL isIndex;		/* Acceptance of a keyword search */
+    char *isIndexAction;	/* URL of isIndex server */
+    char *isIndexPrompt;	/* Prompt for isIndex query */
+    char *title;		/* Title of document */
+    char *owner;		/* Owner of document */
+    char *RevTitle;		/* TITLE in REV="made" or REV="owner" LINK */
+    char *citehost;		/* Citehost from REL="citehost" LINK */
 #ifdef USE_COLOR_STYLE
-  char *	style;
+    char *style;
 #endif
 
-  HTList*	methods;	/* Methods available as HTAtoms */
-  void *	protocol;	/* Protocol object */
-  char *	physical;	/* Physical address */
-  BOOL		isISMAPScript;	/* Script for clickable image map */
-  BOOL		isHEAD;		/* Document is headers from a HEAD request */
-  BOOL		safe;			/* Safe */
+    HTList *methods;		/* Methods available as HTAtoms */
+    void *protocol;		/* Protocol object */
+    char *physical;		/* Physical address */
+    BOOL isISMAPScript;		/* Script for clickable image map */
+    BOOL isHEAD;		/* Document is headers from a HEAD request */
+    BOOL safe;			/* Safe */
 #ifdef USE_SOURCE_CACHE
-  char *	source_cache_file;
-  HTChunk *	source_cache_chunk;
+    char *source_cache_file;
+    HTChunk *source_cache_chunk;
 #endif
-  char *	FileCache;	/* Path to a disk-cached copy (see src/HTFWriter.c) */
-  char *	SugFname;	/* Suggested filename */
-  char *	cache_control;	/* Cache-Control */
-  BOOL		no_cache;	/* Cache-Control, Pragma or META "no-cache"? */
-  BOOL		inBASE;		/* duplicated from HTStructured (HTML.c/h) */
-  char *	content_type;		/* Content-Type */
-  char *	content_language;	/* Content-Language */
-  char *	content_encoding;	/* Compression algorithm */
-  char *	content_base;		/* Content-Base */
-  char *	content_disposition;	/* Content-Disposition */
-  char *	content_location;	/* Content-Location */
-  char *	content_md5;		/* Content-MD5 */
-  char *	message_id;		/* Message-ID */
-  char *	subject;		/* Subject */
-  int		content_length;		/* Content-Length */
-  char *	date;			/* Date */
-  char *	expires;		/* Expires */
-  char *	last_modified;		/* Last-Modified */
-  char *	ETag;			/* ETag (HTTP1.1 cache validator) */
-  char *	server;			/* Server */
-  UCAnchorInfo *UCStages;		/* chartrans stages */
-  HTList *	imaps;			/* client side image maps */
+    char *FileCache;		/* Path to a disk-cached copy (see src/HTFWriter.c) */
+    char *SugFname;		/* Suggested filename */
+    char *cache_control;	/* Cache-Control */
+    BOOL no_cache;		/* Cache-Control, Pragma or META "no-cache"? */
+    BOOL inBASE;		/* duplicated from HTStructured (HTML.c/h) */
+    char *content_type;		/* Content-Type */
+    char *content_language;	/* Content-Language */
+    char *content_encoding;	/* Compression algorithm */
+    char *content_base;		/* Content-Base */
+    char *content_disposition;	/* Content-Disposition */
+    char *content_location;	/* Content-Location */
+    char *content_md5;		/* Content-MD5 */
+    char *message_id;		/* Message-ID */
+    char *subject;		/* Subject */
+    int content_length;		/* Content-Length */
+    char *date;			/* Date */
+    char *expires;		/* Expires */
+    char *last_modified;	/* Last-Modified */
+    char *ETag;			/* ETag (HTTP1.1 cache validator) */
+    char *server;		/* Server */
+    UCAnchorInfo *UCStages;	/* chartrans stages */
+    HTList *imaps;		/* client side image maps */
 };
 
 typedef HTAtom HTLinkType;
 
 typedef struct {
-  /* Common part from the generic anchor structure */
-  HTParentAnchor0 * parent;	/* Parent of this anchor */
+    /* Common part from the generic anchor structure */
+    HTParentAnchor0 *parent;	/* Parent of this anchor */
 
-  /* ChildAnchor-specific information */
-  char *	tag;		/* #fragment,  relative to the parent */
+    /* ChildAnchor-specific information */
+    char *tag;			/* #fragment,  relative to the parent */
 
-  HTAnchor *	dest;		/* The anchor to which this leads */
-  HTLinkType *	type;		/* Semantics of this link */
+    HTAnchor *dest;		/* The anchor to which this leads */
+    HTLinkType *type;		/* Semantics of this link */
 
-  HTList	_add_children_notag;	/* - just a memory for list entry:) */
-  HTList	_add_sources;		/* - just a memory for list entry:) */
+    HTList _add_children_notag;	/* - just a memory for list entry:) */
+    HTList _add_sources;	/* - just a memory for list entry:) */
 } HTChildAnchor;
 
 /*
-**  DocAddress structure is used for loading an absolute anchor with all
-**  needed information including posting data and post content type.
-*/
+ *  DocAddress structure is used for loading an absolute anchor with all
+ *  needed information including posting data and post content type.
+ */
 typedef struct _DocAddress {
-    char *	address;
-    bstring *	post_data;
-    char *	post_content_type;
-    char *	bookmark;
-    BOOL	isHEAD;
-    BOOL	safe;
+    char *address;
+    bstring *post_data;
+    char *post_content_type;
+    char *bookmark;
+    BOOL isHEAD;
+    BOOL safe;
 } DocAddress;
 
 /* "internal" means "within the same document, with certainty". */
-extern HTLinkType * HTInternalLink;
+extern HTLinkType *HTInternalLink;
 
 /*	Create or find a child anchor with a possible link
-**	--------------------------------------------------
-**
-**	Create new anchor with a given parent and possibly
-**	a name, and possibly a link to a _relatively_ named anchor.
-**	(Code originally in ParseHTML.h)
-*/
-extern HTChildAnchor * HTAnchor_findChildAndLink (
-	HTParentAnchor * parent,	/* May not be 0 */
-	const char * tag,		/* May be "" or 0 */
-	const char * href,		/* May be "" or 0 */
-	HTLinkType * ltype);		/* May be 0 */
+ *	--------------------------------------------------
+ *
+ *	Create new anchor with a given parent and possibly
+ *	a name, and possibly a link to a _relatively_ named anchor.
+ *	(Code originally in ParseHTML.h)
+ */
+extern HTChildAnchor *HTAnchor_findChildAndLink(HTParentAnchor *parent,		/* May not be 0 */
+						const char *tag,	/* May be "" or 0 */
+						const char *href,	/* May be "" or 0 */
+						HTLinkType *ltype);	/* May be 0 */
 
 /*	Create new or find old parent anchor
-**	------------------------------------
-**
-**	This one is for a reference which is found in a document, and might
-**	not be already loaded.
-**	Note: You are not guaranteed a new anchor -- you might get an old one,
-**	like with fonts.
-*/
-extern HTParentAnchor * HTAnchor_findAddress (
-	const DocAddress *	address);
+ *	------------------------------------
+ *
+ *	This one is for a reference which is found in a document, and might
+ *	not be already loaded.
+ *	Note: You are not guaranteed a new anchor -- you might get an old one,
+ *	like with fonts.
+ */
+extern HTParentAnchor *HTAnchor_findAddress(const DocAddress *address);
 
 /*	Create new or find old named anchor - simple form
-**	-------------------------------------------------
-**
-**	Like the previous one, but simpler to use for simple cases.
-**	No post data etc. can be supplied. - kw
-*/
-extern HTParentAnchor * HTAnchor_findSimpleAddress (
-	const char *	url);
+ *	-------------------------------------------------
+ *
+ *	Like the previous one, but simpler to use for simple cases.
+ *	No post data etc. can be supplied. - kw
+ */
+extern HTParentAnchor *HTAnchor_findSimpleAddress(const char *url);
 
 /*	Delete an anchor and possibly related things (auto garbage collection)
-**	--------------------------------------------
-**
-**	The anchor is only deleted if the corresponding document is not loaded.
-**	All outgoing links from children are deleted, and children are
-**	removed from the sources lists of their targets.
-**	We also try to delete the targets whose documents are not loaded.
-**	If this anchor's sources list is empty, we delete it and its children.
-*/
-extern BOOL HTAnchor_delete (
-	HTParentAnchor0 *	me);
+ *	--------------------------------------------
+ *
+ *	The anchor is only deleted if the corresponding document is not loaded.
+ *	All outgoing links from children are deleted, and children are
+ *	removed from the sources lists of their targets.
+ *	We also try to delete the targets whose documents are not loaded.
+ *	If this anchor's sources list is empty, we delete it and its children.
+ */
+extern BOOL HTAnchor_delete(HTParentAnchor0 *me);
 
 /*
  *  Unnamed children (children_notag) have no sense without HText -
  *  delete them and their links if we are about to free HText.
  *  Document currently exists.  Called within HText_free().
  */
-extern void HTAnchor_delete_links (
-	HTParentAnchor *	me);
+extern void HTAnchor_delete_links(HTParentAnchor *me);
 
 #ifdef USE_SOURCE_CACHE
-extern void HTAnchor_clearSourceCache (
-	HTParentAnchor *	me);
+extern void HTAnchor_clearSourceCache(HTParentAnchor *me);
 #endif
 
 /*	Data access functions
-**	---------------------
-*/
-extern HTParentAnchor * HTAnchor_parent (
-	HTAnchor *		me);
+ *	---------------------
+ */
+extern HTParentAnchor *HTAnchor_parent(HTAnchor * me);
 
-extern void HTAnchor_setDocument (
-	HTParentAnchor *	me,
-	HyperDoc *		doc);
+extern void HTAnchor_setDocument(HTParentAnchor *me,
+				 HyperDoc *doc);
 
-extern HyperDoc * HTAnchor_document (
-	HTParentAnchor *	me);
+extern HyperDoc *HTAnchor_document(HTParentAnchor *me);
 
 /*	Returns the full URI of the anchor, child or parent
-**	as a malloc'd string to be freed by the caller.
-*/
-extern char * HTAnchor_address (
-	HTAnchor *		me);
+ *	as a malloc'd string to be freed by the caller.
+ */
+extern char *HTAnchor_address(HTAnchor * me);
 
-extern void HTAnchor_setFormat (
-	HTParentAnchor *	me,
-	HTFormat		form);
+extern void HTAnchor_setFormat(HTParentAnchor *me,
+			       HTFormat form);
 
-extern HTFormat HTAnchor_format (
-	HTParentAnchor *	me);
+extern HTFormat HTAnchor_format(HTParentAnchor *me);
 
-extern void HTAnchor_setIndex (
-	HTParentAnchor *	me,
-	const char *		address);
+extern void HTAnchor_setIndex(HTParentAnchor *me,
+			      const char *address);
 
-extern void HTAnchor_setPrompt (
-	HTParentAnchor *	me,
-	const char *		prompt);
+extern void HTAnchor_setPrompt(HTParentAnchor *me,
+			       const char *prompt);
 
-extern BOOL HTAnchor_isIndex (
-	HTParentAnchor *	me);
+extern BOOL HTAnchor_isIndex(HTParentAnchor *me);
 
-extern BOOL HTAnchor_isISMAPScript (
-	HTAnchor *		me);
+extern BOOL HTAnchor_isISMAPScript(HTAnchor * me);
 
 #if defined(USE_COLOR_STYLE)
-extern const char * HTAnchor_style (
-	HTParentAnchor *	me);
+extern const char *HTAnchor_style(HTParentAnchor *me);
 
-extern void HTAnchor_setStyle (
-	HTParentAnchor *	me,
-	const char *		style);
+extern void HTAnchor_setStyle(HTParentAnchor *me,
+			      const char *style);
 #endif
 
 /*	Title handling.
 */
-extern const char * HTAnchor_title (
-	HTParentAnchor *	me);
+extern const char *HTAnchor_title(HTParentAnchor *me);
 
-extern void HTAnchor_setTitle (
-	HTParentAnchor *	me,
-	const char *		title);
+extern void HTAnchor_setTitle(HTParentAnchor *me,
+			      const char *title);
 
-extern void HTAnchor_appendTitle (
-	HTParentAnchor *	me,
-	const char *		title);
+extern void HTAnchor_appendTitle(HTParentAnchor *me,
+				 const char *title);
 
 /*	Bookmark handling.
 */
-extern const char * HTAnchor_bookmark (
-	HTParentAnchor *	me);
+extern const char *HTAnchor_bookmark(HTParentAnchor *me);
 
-extern void HTAnchor_setBookmark (
-	HTParentAnchor *	me,
-	const char *		bookmark);
+extern void HTAnchor_setBookmark(HTParentAnchor *me,
+				 const char *bookmark);
 
 /*	Owner handling.
 */
-extern const char * HTAnchor_owner (
-	HTParentAnchor *	me);
+extern const char *HTAnchor_owner(HTParentAnchor *me);
 
-extern void HTAnchor_setOwner (
-	HTParentAnchor *	me,
-	const char *		owner);
+extern void HTAnchor_setOwner(HTParentAnchor *me,
+			      const char *owner);
 
 /*	TITLE handling in LINKs with REV="made" or REV="owner". - FM
 */
-extern const char * HTAnchor_RevTitle (
-	HTParentAnchor *	me);
+extern const char *HTAnchor_RevTitle(HTParentAnchor *me);
 
-extern void HTAnchor_setRevTitle (
-	HTParentAnchor *	me,
-	const char *		title);
+extern void HTAnchor_setRevTitle(HTParentAnchor *me,
+				 const char *title);
 
 /*	Citehost for bibp links from LINKs with REL="citehost". - RDC
 */
-extern const char * HTAnchor_citehost (
-	HTParentAnchor *	me);
+extern const char *HTAnchor_citehost(HTParentAnchor *me);
 
-extern void HTAnchor_setCitehost (
-	HTParentAnchor *	me,
-	const char *		citehost);
+extern void HTAnchor_setCitehost(HTParentAnchor *me,
+				 const char *citehost);
 
 /*	Suggested filename handling. - FM
-**	(will be loaded if we had a Content-Disposition
-**	 header or META element with filename=name.suffix)
-*/
-extern const char * HTAnchor_SugFname (
-	HTParentAnchor *	me);
+ *	(will be loaded if we had a Content-Disposition
+ *	 header or META element with filename=name.suffix)
+ */
+extern const char *HTAnchor_SugFname(HTParentAnchor *me);
 
 /*	Content-Type handling. - FM
 */
-extern const char * HTAnchor_content_type (
-	HTParentAnchor *	me);
+extern const char *HTAnchor_content_type(HTParentAnchor *me);
 
 /*	Content-Encoding handling. - FM
-**	(will be loaded if we had a Content-Encoding
-**	 header.)
-*/
-extern const char * HTAnchor_content_encoding (
-	HTParentAnchor *	me);
+ *	(will be loaded if we had a Content-Encoding
+ *	 header.)
+ */
+extern const char *HTAnchor_content_encoding(HTParentAnchor *me);
 
 /*	Last-Modified header handling. - FM
 */
-extern const char * HTAnchor_last_modified (
-	HTParentAnchor *	me);
+extern const char *HTAnchor_last_modified(HTParentAnchor *me);
 
 /*	Date header handling. - FM
 */
-extern const char * HTAnchor_date (
-	HTParentAnchor *	me);
+extern const char *HTAnchor_date(HTParentAnchor *me);
 
 /*	Server header handling. - FM
 */
-extern const char * HTAnchor_server (
-	HTParentAnchor *	me);
+extern const char *HTAnchor_server(HTParentAnchor *me);
 
 /*	Safe header handling. - FM
 */
-extern BOOL HTAnchor_safe (
-	HTParentAnchor *	me);
+extern BOOL HTAnchor_safe(HTParentAnchor *me);
 
 /*	Content-Base header handling. - FM
 */
-extern const char * HTAnchor_content_base (
-	HTParentAnchor *	me);
+extern const char *HTAnchor_content_base(HTParentAnchor *me);
 
 /*	Content-Location header handling. - FM
 */
-extern const char * HTAnchor_content_location (
-	HTParentAnchor *	me);
+extern const char *HTAnchor_content_location(HTParentAnchor *me);
 
 /*	Message-ID, used for mail replies - kw
 */
-extern const char * HTAnchor_messageID (
-	HTParentAnchor *	me);
+extern const char *HTAnchor_messageID(HTParentAnchor *me);
 
-extern BOOL HTAnchor_setMessageID (
-	HTParentAnchor *	me,
-	const char *		messageid);
+extern BOOL HTAnchor_setMessageID(HTParentAnchor *me,
+				  const char *messageid);
 
 /*	Subject, used for mail replies - kw
 */
-extern const char * HTAnchor_subject (
-	HTParentAnchor *	me);
+extern const char *HTAnchor_subject(HTParentAnchor *me);
 
-extern BOOL HTAnchor_setSubject (
-	HTParentAnchor *	me,
-	const char *		subject);
+extern BOOL HTAnchor_setSubject(HTParentAnchor *me,
+				const char *subject);
 
 /*	Manipulation of links
-**	---------------------
-*/
-extern HTAnchor * HTAnchor_followLink (
-	HTChildAnchor *		me);
+ *	---------------------
+ */
+extern HTAnchor *HTAnchor_followLink(HTChildAnchor *me);
 
-extern HTAnchor * HTAnchor_followTypedLink (
-	HTChildAnchor *		me,
-	HTLinkType *		type);
+extern HTAnchor *HTAnchor_followTypedLink(HTChildAnchor *me,
+					  HTLinkType *type);
 
 /*	Read and write methods
-**	----------------------
-*/
-extern HTList * HTAnchor_methods (
-	HTParentAnchor *	me);
+ *	----------------------
+ */
+extern HTList *HTAnchor_methods(HTParentAnchor *me);
 
 /*	Protocol
-**	--------
-*/
-extern void * HTAnchor_protocol (
-	HTParentAnchor *	me);
+ *	--------
+ */
+extern void *HTAnchor_protocol(HTParentAnchor *me);
 
-extern void HTAnchor_setProtocol (
-	HTParentAnchor *	me,
-	void *			protocol);
+extern void HTAnchor_setProtocol(HTParentAnchor *me,
+				 void *protocol);
 
 /*	Physical address
-**	----------------
-*/
-extern char * HTAnchor_physical (
-	HTParentAnchor *	me);
-
-extern void HTAnchor_setPhysical (
-	HTParentAnchor *	me,
-	char *			protocol);
-
-extern LYUCcharset * HTAnchor_getUCInfoStage (
-	HTParentAnchor *	me,
-	int			which_stage);
-
-extern int HTAnchor_getUCLYhndl (
-	HTParentAnchor *	me,
-	int			which_stage);
-
-extern LYUCcharset * HTAnchor_setUCInfoStage (
-	HTParentAnchor *	me,
-	int			LYhndl,
-	int			which_stage,
-	int			set_by);
-
-extern LYUCcharset * HTAnchor_setUCInfoStage (
-	HTParentAnchor *	me,
-	int			LYhndl,
-	int			which_stage,
-	int			set_by);
-
-extern LYUCcharset * HTAnchor_resetUCInfoStage (
-	HTParentAnchor *	me,
-	int			LYhndl,
-	int			which_stage,
-	int			set_by);
-
-extern LYUCcharset * HTAnchor_copyUCInfoStage (
-	HTParentAnchor *	me,
-	int			to_stage,
-	int			from_stage,
-	int			set_by);
-
-extern void ImageMapList_free (HTList * list);
+ *	----------------
+ */
+extern char *HTAnchor_physical(HTParentAnchor *me);
+
+extern void HTAnchor_setPhysical(HTParentAnchor *me,
+				 char *protocol);
+
+extern LYUCcharset *HTAnchor_getUCInfoStage(HTParentAnchor *me,
+					    int which_stage);
+
+extern int HTAnchor_getUCLYhndl(HTParentAnchor *me,
+				int which_stage);
+
+extern LYUCcharset *HTAnchor_setUCInfoStage(HTParentAnchor *me,
+					    int LYhndl,
+					    int which_stage,
+					    int set_by);
+
+extern LYUCcharset *HTAnchor_setUCInfoStage(HTParentAnchor *me,
+					    int LYhndl,
+					    int which_stage,
+					    int set_by);
+
+extern LYUCcharset *HTAnchor_resetUCInfoStage(HTParentAnchor *me,
+					      int LYhndl,
+					      int which_stage,
+					      int set_by);
+
+extern LYUCcharset *HTAnchor_copyUCInfoStage(HTParentAnchor *me,
+					     int to_stage,
+					     int from_stage,
+					     int set_by);
+
+extern void ImageMapList_free(HTList *list);
 
 #endif /* HTANCHOR_H */
diff --git a/WWW/Library/Implementation/HTAssoc.c b/WWW/Library/Implementation/HTAssoc.c
index f3bfff9e..112f70a9 100644
--- a/WWW/Library/Implementation/HTAssoc.c
+++ b/WWW/Library/Implementation/HTAssoc.c
@@ -1,20 +1,20 @@
 
 /* MODULE							HTAssoc.c
-**	    ASSOCIATION LIST FOR STORING NAME-VALUE PAIRS.
-**	    NAMES NOT CASE SENSITIVE, AND ONLY COMMON LENGTH
-**	    IS CHECKED (allows abbreviations; well, length is
-**	    taken from lookup-up name, so if table contains
-**	    a shorter abbrev it is not found).
-** AUTHORS:
-**	AL	Ari Luotonen	luotonen@dxcern.cern.ch
-**
-** HISTORY:
-**
-**
-** BUGS:
-**
-**
-*/
+ *	    ASSOCIATION LIST FOR STORING NAME-VALUE PAIRS.
+ *	    NAMES NOT CASE SENSITIVE, AND ONLY COMMON LENGTH
+ *	    IS CHECKED (allows abbreviations; well, length is
+ *	    taken from lookup-up name, so if table contains
+ *	    a shorter abbrev it is not found).
+ * AUTHORS:
+ *	AL	Ari Luotonen	luotonen@dxcern.cern.ch
+ *
+ * HISTORY:
+ *
+ *
+ * BUGS:
+ *
+ *
+ */
 
 #include <HTUtils.h>
 
@@ -22,18 +22,18 @@
 
 #include <LYLeaks.h>
 
-HTAssocList *HTAssocList_new (void)
+HTAssocList *HTAssocList_new(void)
 {
     return HTList_new();
 }
 
-
-void HTAssocList_delete (HTAssocList * alist)
+void HTAssocList_delete(HTAssocList *alist)
 {
     if (alist) {
 	HTAssocList *cur = alist;
 	HTAssoc *assoc;
-	while (NULL != (assoc = (HTAssoc*)HTList_nextObject(cur))) {
+
+	while (NULL != (assoc = (HTAssoc *) HTList_nextObject(cur))) {
 	    FREE(assoc->name);
 	    FREE(assoc->value);
 	    FREE(assoc);
@@ -43,16 +43,16 @@ void HTAssocList_delete (HTAssocList * alist)
     }
 }
 
-
-void HTAssocList_add (HTAssocList *	alist,
-				  const char *		name,
-				  const char *		value)
+void HTAssocList_add(HTAssocList *alist,
+		     const char *name,
+		     const char *value)
 {
     HTAssoc *assoc;
 
     if (alist) {
-	if (!(assoc = (HTAssoc*)malloc(sizeof(HTAssoc))))
-	    outofmem(__FILE__, "HTAssoc_add");
+	if (!(assoc = (HTAssoc *) malloc(sizeof(HTAssoc))))
+	      outofmem(__FILE__, "HTAssoc_add");
+
 	assoc->name = NULL;
 	assoc->value = NULL;
 
@@ -60,23 +60,21 @@ void HTAssocList_add (HTAssocList *	alist,
 	    StrAllocCopy(assoc->name, name);
 	if (value)
 	    StrAllocCopy(assoc->value, value);
-	HTList_addObject(alist, (void*)assoc);
+	HTList_addObject(alist, (void *) assoc);
     } else {
-        CTRACE((tfp, "HTAssoc_add: ERROR: assoc list NULL!!\n"));
+	CTRACE((tfp, "HTAssoc_add: ERROR: assoc list NULL!!\n"));
     }
 }
 
-
-char *HTAssocList_lookup (HTAssocList *	alist,
-				      const char *	name)
+char *HTAssocList_lookup(HTAssocList *alist,
+			 const char *name)
 {
     HTAssocList *cur = alist;
     HTAssoc *assoc;
 
-    while (NULL != (assoc = (HTAssoc*)HTList_nextObject(cur))) {
+    while (NULL != (assoc = (HTAssoc *) HTList_nextObject(cur))) {
 	if (!strncasecomp(assoc->name, name, strlen(name)))
 	    return assoc->value;
     }
     return NULL;
 }
-
diff --git a/WWW/Library/Implementation/HTAssoc.h b/WWW/Library/Implementation/HTAssoc.h
index 63ece0e9..c1117ffa 100644
--- a/WWW/Library/Implementation/HTAssoc.h
+++ b/WWW/Library/Implementation/HTAssoc.h
@@ -12,19 +12,18 @@
 typedef HTList HTAssocList;
 
 typedef struct {
-    char * name;
-    char * value;
+    char *name;
+    char *value;
 } HTAssoc;
 
+extern HTAssocList *HTAssocList_new(void);
+extern void HTAssocList_delete(HTAssocList *alist);
 
-extern HTAssocList *HTAssocList_new (void);
-extern void HTAssocList_delete (HTAssocList * alist);
+extern void HTAssocList_add(HTAssocList *alist,
+			    const char *name,
+			    const char *value);
 
-extern void HTAssocList_add (HTAssocList *       alist,
-                                    const char *        name,
-                                    const char *        value);
-
-extern char *HTAssocList_lookup (HTAssocList *   alist,
-                                        const char *    name);
+extern char *HTAssocList_lookup(HTAssocList *alist,
+				const char *name);
 
 #endif /* not HTASSOC_H */
diff --git a/WWW/Library/Implementation/HTAtom.c b/WWW/Library/Implementation/HTAtom.c
index d8bf1106..1874671b 100644
--- a/WWW/Library/Implementation/HTAtom.c
+++ b/WWW/Library/Implementation/HTAtom.c
@@ -1,21 +1,21 @@
 /*			Atoms: Names to numbers			HTAtom.c
-**			=======================
-**
-**	Atoms are names which are given representative pointer values
-**	so that they can be stored more efficiently, and comparisons
-**	for equality done more efficiently.
-**
-**	Atoms are kept in a hash table consisting of an array of linked lists.
-**
-** Authors:
-**	TBL	Tim Berners-Lee, WorldWideWeb project, CERN
-**	(c) Copyright CERN 1991 - See Copyright.html
-**
-*/
+ *			=======================
+ *
+ *	Atoms are names which are given representative pointer values
+ *	so that they can be stored more efficiently, and comparisons
+ *	for equality done more efficiently.
+ *
+ *	Atoms are kept in a hash table consisting of an array of linked lists.
+ *
+ * Authors:
+ *	TBL	Tim Berners-Lee, WorldWideWeb project, CERN
+ *	(c) Copyright CERN 1991 - See Copyright.html
+ *
+ */
 
 #include <HTUtils.h>
 
-#define HASH_SIZE	101		/* Tunable */
+#define HASH_SIZE	101	/* Tunable */
 #include <HTAtom.h>
 
 #include <HTList.h>
@@ -23,14 +23,14 @@
 #include <LYexit.h>
 #include <LYLeaks.h>
 
-static HTAtom * hash_table[HASH_SIZE];
+static HTAtom *hash_table[HASH_SIZE];
 static BOOL initialised = NO;
 
 /*
  *	To free off all atoms.
  */
 #ifdef LY_FIND_LEAKS
-static void free_atoms (void);
+static void free_atoms(void);
 #endif
 
 /*
@@ -38,19 +38,20 @@ static void free_atoms (void);
  */
 #define HASH_FUNCTION(cp_hash) ((strlen(cp_hash) * UCH(*cp_hash)) % HASH_SIZE)
 
-HTAtom * HTAtom_for (const char * string)
+HTAtom *HTAtom_for(const char *string)
 {
     int hash;
-    HTAtom * a;
+    HTAtom *a;
 
-    /*		First time around, clear hash table
-    */
+    /* First time around, clear hash table
+     */
     /*
-     *	Memory leak fixed.
-     *  05-29-94 Lynx 2-3-1 Garrett Arch Blythe
+     * Memory leak fixed.
+     * 05-29-94 Lynx 2-3-1 Garrett Arch Blythe
      */
     if (!initialised) {
 	int i;
+
 	for (i = 0; i < HASH_SIZE; i++)
 	    hash_table[i] = (HTAtom *) 0;
 	initialised = YES;
@@ -59,29 +60,29 @@ HTAtom * HTAtom_for (const char * string)
 #endif
     }
 
-    /*		Generate hash function
-    */
+    /*          Generate hash function
+     */
     hash = HASH_FUNCTION(string);
 
-    /*		Search for the string in the list
-    */
+    /*          Search for the string in the list
+     */
     for (a = hash_table[hash]; a; a = a->next) {
 	if (0 == strcasecomp(a->name, string)) {
 	    /* CTRACE((tfp, "HTAtom: Old atom %p for `%s'\n", a, string)); */
-	    return a;				/* Found: return it */
+	    return a;		/* Found: return it */
 	}
     }
 
-    /*		Generate a new entry
-    */
-    a = (HTAtom *)malloc(sizeof(*a));
+    /*          Generate a new entry
+     */
+    a = (HTAtom *) malloc(sizeof(*a));
     if (a == NULL)
 	outofmem(__FILE__, "HTAtom_for");
-    a->name = (char *)malloc(strlen(string)+1);
+    a->name = (char *) malloc(strlen(string) + 1);
     if (a->name == NULL)
 	outofmem(__FILE__, "HTAtom_for");
     strcpy(a->name, string);
-    a->next = hash_table[hash];		/* Put onto the head of list */
+    a->next = hash_table[hash];	/* Put onto the head of list */
     hash_table[hash] = a;
 #ifdef NOT_DEFINED
     CTRACE((tfp, "HTAtom: New atom %p for `%s'\n", a, string));
@@ -99,32 +100,33 @@ HTAtom * HTAtom_for (const char * string)
  *	Revision History:
  *		05-29-94	created Lynx 2-3-1 Garrett Arch Blythe
  */
-static void free_atoms (void)
+static void free_atoms(void)
 {
-	auto int i_counter;
-	HTAtom *HTAp_freeme;
+    auto int i_counter;
+    HTAtom *HTAp_freeme;
+
+    /*
+     * Loop through all lists of atoms.
+     */
+    for (i_counter = 0; i_counter < HASH_SIZE; i_counter++) {
 	/*
-	 *	Loop through all lists of atoms.
+	 * Loop through the list.
 	 */
-	for (i_counter = 0; i_counter < HASH_SIZE; i_counter++)	{
-		/*
-		 *	Loop through the list.
-		 */
-		while (hash_table[i_counter] != NULL)	{
-			/*
-			 *	Free off atoms and any members.
-			 */
-			HTAp_freeme = hash_table[i_counter];
-			hash_table[i_counter] = HTAp_freeme->next;
-			FREE(HTAp_freeme->name);
-			FREE(HTAp_freeme);
-		}
+	while (hash_table[i_counter] != NULL) {
+	    /*
+	     * Free off atoms and any members.
+	     */
+	    HTAp_freeme = hash_table[i_counter];
+	    hash_table[i_counter] = HTAp_freeme->next;
+	    FREE(HTAp_freeme->name);
+	    FREE(HTAp_freeme);
 	}
+    }
 }
 #endif /* LY_FIND_LEAKS */
 
-static BOOL mime_match (const char * name,
-			      const char * templ)
+static BOOL mime_match(const char *name,
+		       const char *templ)
 {
     if (name && templ) {
 	static char *n1 = NULL;
@@ -132,14 +134,14 @@ static BOOL mime_match (const char * name,
 	char *n2;
 	char *t2;
 
-	StrAllocCopy(n1, name);		/* These also free the ones	*/
-	StrAllocCopy(t1, templ);	/* from previous call.		*/
+	StrAllocCopy(n1, name);	/* These also free the ones */
+	StrAllocCopy(t1, templ);	/* from previous call.  */
 
-	if (!(n2 = strchr(n1, '/'))  ||  !(t2 = strchr(t1, '/')))
+	if (!(n2 = strchr(n1, '/')) || !(t2 = strchr(t1, '/')))
 	    return NO;
 
-	*(n2++) = (char)0;
-	*(t2++) = (char)0;
+	*(n2++) = (char) 0;
+	*(t2++) = (char) 0;
 
 	if ((0 == strcmp(t1, "*") || 0 == strcmp(t1, n1)) &&
 	    (0 == strcmp(t2, "*") || 0 == strcmp(t2, n2)))
@@ -148,8 +150,7 @@ static BOOL mime_match (const char * name,
     return NO;
 }
 
-
-HTList *HTAtom_templateMatches (const char * templ)
+HTList *HTAtom_templateMatches(const char *templ)
 {
     HTList *matches = HTList_new();
 
@@ -158,12 +159,11 @@ HTList *HTAtom_templateMatches (const char * templ)
 	HTAtom *cur;
 
 	for (i = 0; i < HASH_SIZE; i++) {
-	    for (cur = hash_table[i];  cur;  cur = cur->next) {
+	    for (cur = hash_table[i]; cur; cur = cur->next) {
 		if (mime_match(cur->name, templ))
-		    HTList_addObject(matches, (void*)cur);
+		    HTList_addObject(matches, (void *) cur);
 	    }
 	}
     }
     return matches;
 }
-
diff --git a/WWW/Library/Implementation/HTAtom.h b/WWW/Library/Implementation/HTAtom.h
index 362f1e11..e0843c28 100644
--- a/WWW/Library/Implementation/HTAtom.h
+++ b/WWW/Library/Implementation/HTAtom.h
@@ -1,22 +1,22 @@
 /*  */
 
 /*                      Atoms: Names to numbers                 HTAtom.h
-**                      =======================
-**
-**      Atoms are names which are given representative pointer values
-**      so that they can be stored more efficiently, and compaisons
-**      for equality done more efficiently.
-**
-**      HTAtom_for(string) returns a representative value such that it
-**      will always (within one run of the program) return the same
-**      value for the same given string.
-**
-** Authors:
-**      TBL     Tim Berners-Lee, WorldWideWeb project, CERN
-**
-**      (c) Copyright CERN 1991 - See Copyright.html
-**
-*/
+ *                      =======================
+ *
+ *      Atoms are names which are given representative pointer values
+ *      so that they can be stored more efficiently, and compaisons
+ *      for equality done more efficiently.
+ *
+ *      HTAtom_for(string) returns a representative value such that it
+ *      will always (within one run of the program) return the same
+ *      value for the same given string.
+ *
+ * Authors:
+ *      TBL     Tim Berners-Lee, WorldWideWeb project, CERN
+ *
+ *      (c) Copyright CERN 1991 - See Copyright.html
+ *
+ */
 
 #ifndef HTATOM_H
 #define HTATOM_H
@@ -24,15 +24,15 @@
 #include <HTList.h>
 
 typedef struct _HTAtom HTAtom;
-struct _HTAtom {
-        HTAtom *        next;
-        char *          name;
-}; /* struct _HTAtom */
 
+struct _HTAtom {
+    HTAtom *next;
+    char *name;
+};				/* struct _HTAtom */
 
-extern HTAtom * HTAtom_for (const char * string);
-extern HTList * HTAtom_templateMatches (const char * templ);
+extern HTAtom *HTAtom_for(const char *string);
+extern HTList *HTAtom_templateMatches(const char *templ);
 
 #define HTAtom_name(a) ((a)->name)
 
-#endif  /* HTATOM_H */
+#endif /* HTATOM_H */
diff --git a/WWW/Library/Implementation/HTBTree.c b/WWW/Library/Implementation/HTBTree.c
index 1aff0ada..3ac6c9f2 100644
--- a/WWW/Library/Implementation/HTBTree.c
+++ b/WWW/Library/Implementation/HTBTree.c
@@ -1,11 +1,10 @@
 /*                  Binary Tree for sorting things
-**                  ==============================
-**                      Author: Arthur Secret
-**
-**       4 March 94: Bug fixed in the balancing procedure
-**
-*/
-
+ *                  ==============================
+ *                      Author: Arthur Secret
+ *
+ *       4 March 94: Bug fixed in the balancing procedure
+ *
+ */
 
 #include <HTUtils.h>
 #include <HTBTree.h>
@@ -14,14 +13,16 @@
 
 #include <LYLeaks.h>
 
-HTBTree * HTBTree_new (HTComparer comp)
-    /*********************************************************
-    ** This function returns an HTBTree with memory allocated
-    ** for it when given a mean to compare things
-    */
+/*********************************************************
+ * This function returns an HTBTree with memory allocated
+ * for it when given a mean to compare things
+ */
+HTBTree *HTBTree_new(HTComparer comp)
 {
-    HTBTree * tree = typeMalloc(HTBTree);
-    if (tree==NULL) outofmem(__FILE__, "HTBTree_new");
+    HTBTree *tree = typeMalloc(HTBTree);
+
+    if (tree == NULL)
+	outofmem(__FILE__, "HTBTree_new");
 
     tree->compare = comp;
     tree->top = NULL;
@@ -29,13 +30,10 @@ HTBTree * HTBTree_new (HTComparer comp)
     return tree;
 }
 
-
-
-
-static void HTBTElement_free (HTBTElement* element)
-    /**********************************************************
-    ** This void will free the memory allocated for one element
-    */
+/*********************************************************
+ * This void will free the memory allocated for one element
+ */
+static void HTBTElement_free(HTBTElement *element)
 {
     if (element) {
 	if (element->left != NULL)
@@ -46,24 +44,21 @@ static void HTBTElement_free (HTBTElement* element)
     }
 }
 
-void HTBTree_free (HTBTree* tree)
-    /**************************************************************
-    ** This void will free the memory allocated for the whole tree
-    */
+/*************************************************************
+ * This void will free the memory allocated for the whole tree
+ */
+void HTBTree_free(HTBTree *tree)
 {
     HTBTElement_free(tree->top);
     FREE(tree);
 }
 
-
-
-
-static void HTBTElementAndObject_free (HTBTElement* element)
-    /**********************************************************
-    ** This void will free the memory allocated for one element
-    */
+/*********************************************************
+ * This void will free the memory allocated for one element
+ */
+static void HTBTElementAndObject_free(HTBTElement *element)
 {
-    if (element) {     /* Just in case nothing was in the tree anyway */
+    if (element) {		/* Just in case nothing was in the tree anyway */
 	if (element->left != NULL)
 	    HTBTElementAndObject_free(element->left);
 	if (element->right != NULL)
@@ -73,28 +68,25 @@ static void HTBTElementAndObject_free (HTBTElement* element)
     }
 }
 
-void HTBTreeAndObject_free (HTBTree* tree)
-    /**************************************************************
-    ** This void will free the memory allocated for the whole tree
-    */
+/*************************************************************
+ * This void will free the memory allocated for the whole tree
+ */
+void HTBTreeAndObject_free(HTBTree *tree)
 {
     HTBTElementAndObject_free(tree->top);
     FREE(tree);
 }
 
-
-void * HTBTree_search (
-		   HTBTree*  tree,
-		   void*     object)
-    /**********************************************************************
-    ** Returns a pointer to equivalent object in a tree or NULL if none.
-    */
+/*********************************************************************
+ * Returns a pointer to equivalent object in a tree or NULL if none.
+ */
+void *HTBTree_search(HTBTree *tree,
+		     void *object)
 {
-    HTBTElement * cur = tree->top;
+    HTBTElement *cur = tree->top;
     int res;
 
-    while (cur != NULL)
-    {
+    while (cur != NULL) {
 	res = tree->compare(object, cur->object);
 
 	if (res == 0)
@@ -107,80 +99,73 @@ void * HTBTree_search (
     return NULL;
 }
 
-
-
-void HTBTree_add (
-		    HTBTree*  tree,
-		    void*     object)
-    /**********************************************************************
-    ** This void is the core of HTBTree.c . It will
-    **       1/ add a new element to the tree at the right place
-    **		so that the tree remains sorted
-    **       2/ balance the tree to be as fast as possible when reading it
-    */
+/*********************************************************************
+ * This void is the core of HTBTree.c . It will
+ *       1/ add a new element to the tree at the right place
+ *		so that the tree remains sorted
+ *       2/ balance the tree to be as fast as possible when reading it
+ */
+void HTBTree_add(HTBTree *tree,
+		 void *object)
 {
-    HTBTElement * father_of_element;
-    HTBTElement * added_element;
-    HTBTElement * forefather_of_element;
-    HTBTElement * father_of_forefather;
-    BOOL father_found,top_found;
-    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
-	** 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"
-	** 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
-	** balance the tree.
-	** corrections is an integer used to avoid infinite loops in cases
-	** such as:
-	**
-	**             3                        3
-	**          4                              4
-	**           5                            5
-	**
-	** 3 is used here to show that it need not be the top of the tree.
-	*/
+    HTBTElement *father_of_element;
+    HTBTElement *added_element;
+    HTBTElement *forefather_of_element;
+    HTBTElement *father_of_forefather;
+    BOOL father_found, top_found;
+    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 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"
+     * 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 balance the tree.  corrections is an integer used to
+     * avoid infinite loops in cases such as:
+     *
+     *             3                        3
+     *          4                              4
+     *           5                            5
+     *
+     * 3 is used here to show that it need not be the top of the tree.
+     */
 
     /*
-    ** 1/ Adding of the element to the binary tree
-    */
+     * 1/ Adding of the element to the binary tree
+     */
 
-    if (tree->top == NULL)
-    {
+    if (tree->top == NULL) {
 	tree->top = typeMalloc(HTBTElement);
-	if (tree->top == NULL) outofmem(__FILE__, "HTBTree_add");
+
+	if (tree->top == NULL)
+	    outofmem(__FILE__, "HTBTree_add");
 	tree->top->up = NULL;
 	tree->top->object = object;
 	tree->top->left = NULL;
 	tree->top->left_depth = 0;
 	tree->top->right = NULL;
 	tree->top->right_depth = 0;
-    }
-    else
-    {
+    } else {
 	father_found = YES;
 	father_of_element = tree->top;
 	added_element = NULL;
 	father_of_forefather = NULL;
 	forefather_of_element = NULL;
-	while (father_found)
-	{
-	    int res = tree->compare(object,father_of_element->object);
-	    if (res < 0)
-	    {
+	while (father_found) {
+	    int res = tree->compare(object, father_of_element->object);
+
+	    if (res < 0) {
 		if (father_of_element->left != NULL)
 		    father_of_element = father_of_element->left;
-		else
-		{
+		else {
 		    father_found = NO;
 		    father_of_element->left = typeMalloc(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;
@@ -190,16 +175,14 @@ void HTBTree_add (
 		    added_element->right = NULL;
 		    added_element->right_depth = 0;
 		}
-	    }
-	    else /* res >= 0 */
-	   {
+	    } else {		/* res >= 0 */
 		if (father_of_element->right != NULL)
 		    father_of_element = father_of_element->right;
-		else
-		{
+		else {
 		    father_found = NO;
 		    father_of_element->right = typeMalloc(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;
@@ -213,64 +196,55 @@ void HTBTree_add (
 	}
 
 	/*
-	** Changing of all depths that need to be changed
-	*/
+	 * Changing of all depths that need to be changed
+	 */
 	father_of_forefather = father_of_element;
 	forefather_of_element = added_element;
-	do
-	{
-	    if (father_of_forefather->left == forefather_of_element)
-	    {
+	do {
+	    if (father_of_forefather->left == forefather_of_element) {
 		depth = father_of_forefather->left_depth;
 		father_of_forefather->left_depth = 1
-			    + MAXIMUM(forefather_of_element->right_depth,
-				  forefather_of_element->left_depth);
+		    + MAXIMUM(forefather_of_element->right_depth,
+			      forefather_of_element->left_depth);
 		depth2 = father_of_forefather->left_depth;
-	    }
-	    else
-	    {
+	    } else {
 		depth = father_of_forefather->right_depth;
 		father_of_forefather->right_depth = 1
-			    + MAXIMUM(forefather_of_element->right_depth,
-				  forefather_of_element->left_depth);
+		    + MAXIMUM(forefather_of_element->right_depth,
+			      forefather_of_element->left_depth);
 		depth2 = father_of_forefather->right_depth;
 	    }
 	    forefather_of_element = father_of_forefather;
 	    father_of_forefather = father_of_forefather->up;
 	} while ((depth != depth2) && (father_of_forefather != NULL));
 
-
-
-	    /*
-	    ** 2/ Balancing the binary tree, if necessary
-	    */
+	/*
+	 * 2/ Balancing the binary tree, if necessary
+	 */
 	top_found = YES;
 	corrections = 0;
-	while ((top_found) && (corrections < 7))
-	{
+	while ((top_found) && (corrections < 7)) {
 	    if ((abs(father_of_element->left_depth
-		      - father_of_element->right_depth)) < 2)
-	    {
+		     - father_of_element->right_depth)) < 2) {
 		if (father_of_element->up != NULL)
 		    father_of_element = father_of_element->up;
-		else top_found = NO;
-	    }
-	    else
-	    {		     /* We start the process of balancing */
+		else
+		    top_found = NO;
+	    } else {		/* We start the process of balancing */
 
 		corrections = corrections + 1;
-		   /*
-		   ** corrections is an integer used to avoid infinite
-		   ** loops in cases such as:
-		   **
-		   **             3                        3
-		   **          4                              4
-		   **           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
-		   ** with the two following conditions (4 March 94 - AS)
-		   */
+		/*
+		 * corrections is an integer used to avoid infinite
+		 * loops in cases such as:
+		 *
+		 *             3                        3
+		 *          4                              4
+		 *           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
+		 * with the two following conditions (4 March 94 - AS)
+		 */
 
 		if ((father_of_element->left == NULL)
 		    && (father_of_element->right->right == NULL)
@@ -284,56 +258,45 @@ void HTBTree_add (
 		    && (father_of_element->left->right->left == NULL))
 		    corrections = 7;
 
-
-		if (father_of_element->left_depth > father_of_element->right_depth)
-		{
+		if (father_of_element->left_depth > father_of_element->right_depth) {
 		    added_element = father_of_element->left;
 		    father_of_element->left_depth = added_element->right_depth;
 		    added_element->right_depth = 1
-				    + MAXIMUM(father_of_element->right_depth,
-					  father_of_element->left_depth);
-		    if (father_of_element->up != NULL)
-		    {
+			+ MAXIMUM(father_of_element->right_depth,
+				  father_of_element->left_depth);
+		    if (father_of_element->up != NULL) {
 			/* Bug fixed in March 94  -  AS */
 			BOOL first_time;
 
 			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)
-			      {
-				  depth = father_of_forefather->left_depth;
-				  if (first_time)
-				  {
-				      father_of_forefather->left_depth = 1
-					  + MAXIMUM(forefather_of_element->left_depth,
+				== forefather_of_element->up) {
+				depth = father_of_forefather->left_depth;
+				if (first_time) {
+				    father_of_forefather->left_depth = 1
+					+ MAXIMUM(forefather_of_element->left_depth,
 						  forefather_of_element->right_depth);
-					first_time = NO;
-				   }
-				   else
-				       father_of_forefather->left_depth = 1
-					   + MAXIMUM(forefather_of_element->up->left_depth,
-					      forefather_of_element->up->right_depth);
+				    first_time = NO;
+				} else
+				    father_of_forefather->left_depth = 1
+					+ MAXIMUM(forefather_of_element->up->left_depth,
+						  forefather_of_element->up->right_depth);
 
 				depth2 = father_of_forefather->left_depth;
-			    }
-			    else
-			    {
+			    } else {
 				depth = father_of_forefather->right_depth;
-				if (first_time)
-				{
+				if (first_time) {
 				    father_of_forefather->right_depth = 1
-				      + MAXIMUM(forefather_of_element->left_depth,
-					       forefather_of_element->right_depth);
+					+ MAXIMUM(forefather_of_element->left_depth,
+						  forefather_of_element->right_depth);
 				    first_time = NO;
-				}
-				else
+				} else
 				    father_of_forefather->right_depth = 1
-				      + MAXIMUM(forefather_of_element->up->left_depth,
-					   forefather_of_element->up->right_depth);
+					+ MAXIMUM(forefather_of_element->up->left_depth,
+						  forefather_of_element->up->right_depth);
 				depth2 = father_of_forefather->right_depth;
 			    }
 			    forefather_of_element = forefather_of_element->up;
@@ -341,48 +304,44 @@ void HTBTree_add (
 			} while ((depth != depth2) &&
 				 (father_of_forefather != NULL));
 			father_of_forefather = father_of_element->up;
-			if (father_of_forefather->left == father_of_element)
-			{
+			if (father_of_forefather->left == father_of_element) {
 			    /*
-			    **                   3                       3
-			    **               4                       5
-			    ** When tree   5   6        becomes    7    4
-			    **            7 8                          8 6
-			    **
-			    ** 3 is used to show that it may not be the top of the
-			    ** tree.
-			    */
+			     *                   3                       3
+			     *               4                       5
+			     * When tree   5   6        becomes    7    4
+			     *            7 8                          8 6
+			     *
+			     * 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;
 			}
-			if (father_of_forefather->right == father_of_element)
-			{
+			if (father_of_forefather->right == father_of_element) {
 			    /*
-			    **          3                       3
-			    **               4                       5
-			    ** When tree   5   6        becomes    7    4
-			    **            7 8                          8 6
-			    **
-			    ** 3 is used to show that it may not be the top of the
-			    ** tree
-			    */
+			     *          3                       3
+			     *               4                       5
+			     * When tree   5   6        becomes    7    4
+			     *            7 8                          8 6
+			     *
+			     * 3 is used to show that it may not be the top of the
+			     * tree
+			     */
 			    father_of_forefather->right = added_element;
 			    father_of_element->left = added_element->right;
 			    added_element->right = father_of_element;
 			}
 			added_element->up = father_of_forefather;
-		    }
-		    else
-		    {
+		    } else {
 			/*
-			**
-			**               1                       2
-			** 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                       2
+			 * When tree   2   3        becomes    4    1
+			 *            4 5                          5 3
+			 *
+			 * 1 is used to show that it is the top of the tree
+			 */
 			added_element->up = NULL;
 			father_of_element->left = added_element->right;
 			added_element->right = father_of_element;
@@ -390,13 +349,11 @@ void HTBTree_add (
 		    father_of_element->up = added_element;
 		    if (father_of_element->left != NULL)
 			father_of_element->left->up = father_of_element;
-		}
-		else
-		{
+		} else {
 		    added_element = father_of_element->right;
 		    father_of_element->right_depth = added_element->left_depth;
 		    added_element->left_depth = 1 +
-			    MAXIMUM(father_of_element->right_depth,
+			MAXIMUM(father_of_element->right_depth,
 				father_of_element->left_depth);
 		    if (father_of_element->up != NULL)
 			/* Bug fixed in March 94  -  AS */
@@ -406,39 +363,31 @@ void HTBTree_add (
 			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)
-			    {
+				== forefather_of_element->up) {
 				depth = father_of_forefather->left_depth;
-				if (first_time)
-				{
+				if (first_time) {
 				    father_of_forefather->left_depth = 1
-				       + MAXIMUM(forefather_of_element->left_depth,
-					       forefather_of_element->right_depth);
+					+ MAXIMUM(forefather_of_element->left_depth,
+						  forefather_of_element->right_depth);
 				    first_time = NO;
-				}
-				else
+				} else
 				    father_of_forefather->left_depth = 1
-				      + MAXIMUM(forefather_of_element->up->left_depth,
-					  forefather_of_element->up->right_depth);
+					+ MAXIMUM(forefather_of_element->up->left_depth,
+						  forefather_of_element->up->right_depth);
 				depth2 = father_of_forefather->left_depth;
-			    }
-			    else
-			    {
+			    } else {
 				depth = father_of_forefather->right_depth;
-				if (first_time)
-				{
+				if (first_time) {
 				    father_of_forefather->right_depth = 1
-				       + MAXIMUM(forefather_of_element->left_depth,
-					       forefather_of_element->right_depth);
+					+ MAXIMUM(forefather_of_element->left_depth,
+						  forefather_of_element->right_depth);
 				    first_time = NO;
-				}
-				else
+				} else
 				    father_of_forefather->right_depth = 1
-				      + MAXIMUM(forefather_of_element->up->left_depth,
-					   forefather_of_element->up->right_depth);
+					+ MAXIMUM(forefather_of_element->up->left_depth,
+						  forefather_of_element->up->right_depth);
 				depth2 = father_of_forefather->right_depth;
 			    }
 			    father_of_forefather = father_of_forefather->up;
@@ -446,48 +395,44 @@ void HTBTree_add (
 			} while ((depth != depth2) &&
 				 (father_of_forefather != NULL));
 			father_of_forefather = father_of_element->up;
-			if (father_of_forefather->left == father_of_element)
-			{
+			if (father_of_forefather->left == father_of_element) {
 			    /*
-			    **                    3                       3
-			    **               4                       6
-			    ** When tree   5   6        becomes    4    8
-			    **                7 8                 5 7
-			    **
-			    ** 3 is used to show that it may not be the top of the
-			    ** tree.
-			    */
+			     *                    3                       3
+			     *               4                       6
+			     * When tree   5   6        becomes    4    8
+			     *                7 8                 5 7
+			     *
+			     * 3 is used to show that it may not be the top of the
+			     * tree.
+			     */
 			    father_of_forefather->left = added_element;
 			    father_of_element->right = added_element->left;
 			    added_element->left = father_of_element;
 			}
-			if (father_of_forefather->right == father_of_element)
-			{
+			if (father_of_forefather->right == father_of_element) {
 			    /*
-			    **           3                      3
-			    **               4                       6
-			    ** When tree   5   6        becomes    4    8
-			    **                7 8                 5 7
-			    **
-			    ** 3 is used to show that it may not be the top of the
-			    ** tree
-			    */
+			     *           3                      3
+			     *               4                       6
+			     * When tree   5   6        becomes    4    8
+			     *                7 8                 5 7
+			     *
+			     * 3 is used to show that it may not be the top of the
+			     * tree
+			     */
 			    father_of_forefather->right = added_element;
 			    father_of_element->right = added_element->left;
 			    added_element->left = father_of_element;
 			}
 			added_element->up = father_of_forefather;
-		    }
-		    else
-		    {
+		    } else {
 			/*
-			**
-			**               1                       3
-			** When tree   2   3        becomes    1    5
-			**                4 5                 2 4
-			**
-			** 1 is used to show that it is the top of the tree.
-			*/
+
+			 *               1                       3
+			 * When tree   2   3        becomes    1    5
+			 *                4 5                 2 4
+			 *
+			 * 1 is used to show that it is the top of the tree.
+			 */
 			added_element->up = NULL;
 			father_of_element->right = added_element->left;
 			added_element->left = father_of_element;
@@ -498,240 +443,228 @@ void HTBTree_add (
 		}
 	    }
 	}
-	while (father_of_element->up != NULL)
-	{
+	while (father_of_element->up != NULL) {
 	    father_of_element = father_of_element->up;
 	}
 	tree->top = father_of_element;
     }
 }
 
-
-
-HTBTElement * HTBTree_next (
-			       HTBTree*       tree,
-			       HTBTElement*   ele)
-    /**************************************************************************
-    ** this function returns a pointer to the leftmost element if ele is NULL,
-    ** and to the next object to the right otherwise.
-    ** If no elements left, returns a pointer to NULL.
-    */
+/*************************************************************************
+ * this function returns a pointer to the leftmost element if ele is NULL,
+ * and to the next object to the right otherwise.
+ * If no elements left, returns a pointer to NULL.
+ */
+HTBTElement *HTBTree_next(HTBTree *tree,
+			  HTBTElement *ele)
 {
-    HTBTElement * father_of_element;
-    HTBTElement * father_of_forefather;
+    HTBTElement *father_of_element;
+    HTBTElement *father_of_forefather;
 
-    if (ele == NULL)
-    {
+    if (ele == NULL) {
 	father_of_element = tree->top;
 	if (father_of_element != NULL)
 	    while (father_of_element->left != NULL)
 		father_of_element = father_of_element->left;
-    }
-    else
-    {
+    } else {
 	father_of_element = ele;
-	if (father_of_element->right != NULL)
-	{
+	if (father_of_element->right != NULL) {
 	    father_of_element = father_of_element->right;
 	    while (father_of_element->left != NULL)
 		father_of_element = father_of_element->left;
-	}
-	else
-	{
+	} else {
 	    father_of_forefather = father_of_element->up;
-		while (father_of_forefather &&
-		       (father_of_forefather->right == father_of_element))
-		{
-		    father_of_element = father_of_forefather;
-		    father_of_forefather = father_of_element->up;
-		}
+	    while (father_of_forefather &&
+		   (father_of_forefather->right == father_of_element)) {
+		father_of_element = father_of_forefather;
+		father_of_forefather = father_of_element->up;
+	    }
 	    father_of_element = father_of_forefather;
 	}
     }
 #ifdef BTREE_TRACE
     /* The option -DBTREE_TRACE will give much more information
-    ** about the way the process is running, for debugging matters
-    */
-    if (father_of_element != NULL)
-    {
-	printf("\nObject = %s\t",(char *)father_of_element->object);
+     * about the way the process is running, for debugging matters
+     */
+    if (father_of_element != NULL) {
+	printf("\nObject = %s\t", (char *) father_of_element->object);
 	if (father_of_element->up != NULL)
 	    printf("Objet du pere = %s\n",
-		   (char *)father_of_element->up->object);
-	else printf("Pas de Pere\n");
+		   (char *) father_of_element->up->object);
+	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);
-	else printf("Pas de fils gauche\t");
+		   (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",
-		   (char *)father_of_element->right->object);
-	else printf("Pas de fils droit\n");
-	printf("Profondeur gauche = %d\t",father_of_element->left_depth);
-	printf("Profondeur droite = %d\n",father_of_element->right_depth);
+		   (char *) father_of_element->right->object);
+	else
+	    printf("Pas de fils droit\n");
+	printf("Profondeur gauche = %d\t", father_of_element->left_depth);
+	printf("Profondeur droite = %d\n", father_of_element->right_depth);
 	printf("      **************\n");
     }
 #endif
     return father_of_element;
 }
 
-
 #ifdef TEST
-main ()
-    /******************************************************
-    ** This is just a test to show how to handle HTBTree.c
-    */
+/*****************************************************
+ * This is just a test to show how to handle HTBTree.c
+ */
+main()
 {
-    HTBTree * tree;
-    HTBTElement * next_element;
-
-    tree = HTBTree_new((HTComparer)strcasecomp);
-    HTBTree_add(tree,"hypertext");
-    HTBTree_add(tree,"Addressing");
-    HTBTree_add(tree,"X11");
-    HTBTree_add(tree,"Tools");
-    HTBTree_add(tree,"Proposal.wn");
-    HTBTree_add(tree,"Protocols");
-    HTBTree_add(tree,"NeXT");
-    HTBTree_add(tree,"Daemon");
-    HTBTree_add(tree,"Test");
-    HTBTree_add(tree,"Administration");
-    HTBTree_add(tree,"LineMode");
-    HTBTree_add(tree,"DesignIssues");
-    HTBTree_add(tree,"MarkUp");
-    HTBTree_add(tree,"Macintosh");
-    HTBTree_add(tree,"Proposal.rtf.wn");
-    HTBTree_add(tree,"FIND");
-    HTBTree_add(tree,"Paper");
-    HTBTree_add(tree,"Tcl");
-    HTBTree_add(tree,"Talks");
-    HTBTree_add(tree,"Architecture");
-    HTBTree_add(tree,"VMSHelp");
-    HTBTree_add(tree,"Provider");
-    HTBTree_add(tree,"Archive");
-    HTBTree_add(tree,"SLAC");
-    HTBTree_add(tree,"Project");
-    HTBTree_add(tree,"News");
-    HTBTree_add(tree,"Viola");
-    HTBTree_add(tree,"Users");
-    HTBTree_add(tree,"FAQ");
-    HTBTree_add(tree,"WorkingNotes");
-    HTBTree_add(tree,"Windows");
-    HTBTree_add(tree,"FineWWW");
-    HTBTree_add(tree,"Frame");
-    HTBTree_add(tree,"XMosaic");
-    HTBTree_add(tree,"People");
-    HTBTree_add(tree,"All");
-    HTBTree_add(tree,"Curses");
-    HTBTree_add(tree,"Erwise");
-    HTBTree_add(tree,"Carl");
-    HTBTree_add(tree,"MidasWWW");
-    HTBTree_add(tree,"XPM");
-    HTBTree_add(tree,"MailRobot");
-    HTBTree_add(tree,"Illustrations");
-    HTBTree_add(tree,"VMClient");
-    HTBTree_add(tree,"XPA");
-    HTBTree_add(tree,"Clients.html");
-    HTBTree_add(tree,"Library");
-    HTBTree_add(tree,"CERNLIB_Distribution");
-    HTBTree_add(tree,"libHTML");
-    HTBTree_add(tree,"WindowsPC");
-    HTBTree_add(tree,"tkWWW");
-    HTBTree_add(tree,"tk2.3");
-    HTBTree_add(tree,"CVS-RCS");
-    HTBTree_add(tree,"DecnetSockets");
-    HTBTree_add(tree,"SGMLStream");
-    HTBTree_add(tree,"NextStep");
-    HTBTree_add(tree,"CVSRepository_old");
-    HTBTree_add(tree,"ArthurSecret");
-    HTBTree_add(tree,"CVSROOT");
-    HTBTree_add(tree,"HytelnetGate");
-    HTBTree_add(tree,"cern.www.new.src");
-    HTBTree_add(tree,"Conditions");
-    HTBTree_add(tree,"HTMLGate");
-    HTBTree_add(tree,"Makefile");
-    HTBTree_add(tree,"Newsgroups.html");
-    HTBTree_add(tree,"People.html");
-    HTBTree_add(tree,"Bugs.html");
-    HTBTree_add(tree,"Summary.html");
-    HTBTree_add(tree,"zDesignIssues.wn");
-    HTBTree_add(tree,"HT.draw");
-    HTBTree_add(tree,"HTandCERN.wn");
-    HTBTree_add(tree,"Ideas.wn");
-    HTBTree_add(tree,"MarkUp.wn");
-    HTBTree_add(tree,"Proposal.html");
-    HTBTree_add(tree,"SearchPanel.draw");
-    HTBTree_add(tree,"Comments.wn");
-    HTBTree_add(tree,"Xanadu.html");
-    HTBTree_add(tree,"Storinglinks.html");
-    HTBTree_add(tree,"TheW3Book.html");
-    HTBTree_add(tree,"Talk_Feb-91.html");
-    HTBTree_add(tree,"JFosterEntry.txt");
-    HTBTree_add(tree,"Summary.txt");
-    HTBTree_add(tree,"Bibliography.html");
-    HTBTree_add(tree,"HTandCern.txt");
-    HTBTree_add(tree,"Talk.draw");
-    HTBTree_add(tree,"zDesignNotes.html");
-    HTBTree_add(tree,"Link.html");
-    HTBTree_add(tree,"Status.html");
-    HTBTree_add(tree,"http.txt");
-    HTBTree_add(tree,"People.html~");
-    HTBTree_add(tree,"TAGS");
-    HTBTree_add(tree,"summary.txt");
-    HTBTree_add(tree,"Technical.html");
-    HTBTree_add(tree,"Terms.html");
-    HTBTree_add(tree,"JANETAccess.html");
-    HTBTree_add(tree,"People.txt");
-    HTBTree_add(tree,"README.txt");
-    HTBTree_add(tree,"CodingStandards.html");
-    HTBTree_add(tree,"Copyright.txt");
-    HTBTree_add(tree,"Status_old.html");
-    HTBTree_add(tree,"patches~");
-    HTBTree_add(tree,"RelatedProducts.html");
-    HTBTree_add(tree,"Implementation");
-    HTBTree_add(tree,"History.html");
-    HTBTree_add(tree,"Makefile.bak");
-    HTBTree_add(tree,"Makefile.old");
-    HTBTree_add(tree,"Policy.html");
-    HTBTree_add(tree,"WhatIs.html");
-    HTBTree_add(tree,"TheProject.html");
-    HTBTree_add(tree,"Notation.html");
-    HTBTree_add(tree,"Helping.html");
-    HTBTree_add(tree,"Cyber-WWW.sit.Hqx");
-    HTBTree_add(tree,"Glossary.html");
-    HTBTree_add(tree,"maketags.html");
-    HTBTree_add(tree,"IntroCS.html");
-    HTBTree_add(tree,"Contrib");
-    HTBTree_add(tree,"Help.html");
-    HTBTree_add(tree,"CodeManagExec");
-    HTBTree_add(tree,"HT-0.1draz");
-    HTBTree_add(tree,"Cello");
-    HTBTree_add(tree,"TOPUB");
-    HTBTree_add(tree,"BUILD");
-    HTBTree_add(tree,"BUILDALL");
-    HTBTree_add(tree,"Lynx");
-    HTBTree_add(tree,"ArthurLibrary");
-    HTBTree_add(tree,"RashtyClient");
-    HTBTree_add(tree,"#History.html#");
-    HTBTree_add(tree,"PerlServers");
-    HTBTree_add(tree,"modules");
-    HTBTree_add(tree,"NCSA_httpd");
-    HTBTree_add(tree,"MAIL2HTML");
-    HTBTree_add(tree,"core");
-    HTBTree_add(tree,"EmacsWWW");
+    HTBTree *tree;
+    HTBTElement *next_element;
+
+    tree = HTBTree_new((HTComparer) strcasecomp);
+    HTBTree_add(tree, "hypertext");
+    HTBTree_add(tree, "Addressing");
+    HTBTree_add(tree, "X11");
+    HTBTree_add(tree, "Tools");
+    HTBTree_add(tree, "Proposal.wn");
+    HTBTree_add(tree, "Protocols");
+    HTBTree_add(tree, "NeXT");
+    HTBTree_add(tree, "Daemon");
+    HTBTree_add(tree, "Test");
+    HTBTree_add(tree, "Administration");
+    HTBTree_add(tree, "LineMode");
+    HTBTree_add(tree, "DesignIssues");
+    HTBTree_add(tree, "MarkUp");
+    HTBTree_add(tree, "Macintosh");
+    HTBTree_add(tree, "Proposal.rtf.wn");
+    HTBTree_add(tree, "FIND");
+    HTBTree_add(tree, "Paper");
+    HTBTree_add(tree, "Tcl");
+    HTBTree_add(tree, "Talks");
+    HTBTree_add(tree, "Architecture");
+    HTBTree_add(tree, "VMSHelp");
+    HTBTree_add(tree, "Provider");
+    HTBTree_add(tree, "Archive");
+    HTBTree_add(tree, "SLAC");
+    HTBTree_add(tree, "Project");
+    HTBTree_add(tree, "News");
+    HTBTree_add(tree, "Viola");
+    HTBTree_add(tree, "Users");
+    HTBTree_add(tree, "FAQ");
+    HTBTree_add(tree, "WorkingNotes");
+    HTBTree_add(tree, "Windows");
+    HTBTree_add(tree, "FineWWW");
+    HTBTree_add(tree, "Frame");
+    HTBTree_add(tree, "XMosaic");
+    HTBTree_add(tree, "People");
+    HTBTree_add(tree, "All");
+    HTBTree_add(tree, "Curses");
+    HTBTree_add(tree, "Erwise");
+    HTBTree_add(tree, "Carl");
+    HTBTree_add(tree, "MidasWWW");
+    HTBTree_add(tree, "XPM");
+    HTBTree_add(tree, "MailRobot");
+    HTBTree_add(tree, "Illustrations");
+    HTBTree_add(tree, "VMClient");
+    HTBTree_add(tree, "XPA");
+    HTBTree_add(tree, "Clients.html");
+    HTBTree_add(tree, "Library");
+    HTBTree_add(tree, "CERNLIB_Distribution");
+    HTBTree_add(tree, "libHTML");
+    HTBTree_add(tree, "WindowsPC");
+    HTBTree_add(tree, "tkWWW");
+    HTBTree_add(tree, "tk2.3");
+    HTBTree_add(tree, "CVS-RCS");
+    HTBTree_add(tree, "DecnetSockets");
+    HTBTree_add(tree, "SGMLStream");
+    HTBTree_add(tree, "NextStep");
+    HTBTree_add(tree, "CVSRepository_old");
+    HTBTree_add(tree, "ArthurSecret");
+    HTBTree_add(tree, "CVSROOT");
+    HTBTree_add(tree, "HytelnetGate");
+    HTBTree_add(tree, "cern.www.new.src");
+    HTBTree_add(tree, "Conditions");
+    HTBTree_add(tree, "HTMLGate");
+    HTBTree_add(tree, "Makefile");
+    HTBTree_add(tree, "Newsgroups.html");
+    HTBTree_add(tree, "People.html");
+    HTBTree_add(tree, "Bugs.html");
+    HTBTree_add(tree, "Summary.html");
+    HTBTree_add(tree, "zDesignIssues.wn");
+    HTBTree_add(tree, "HT.draw");
+    HTBTree_add(tree, "HTandCERN.wn");
+    HTBTree_add(tree, "Ideas.wn");
+    HTBTree_add(tree, "MarkUp.wn");
+    HTBTree_add(tree, "Proposal.html");
+    HTBTree_add(tree, "SearchPanel.draw");
+    HTBTree_add(tree, "Comments.wn");
+    HTBTree_add(tree, "Xanadu.html");
+    HTBTree_add(tree, "Storinglinks.html");
+    HTBTree_add(tree, "TheW3Book.html");
+    HTBTree_add(tree, "Talk_Feb-91.html");
+    HTBTree_add(tree, "JFosterEntry.txt");
+    HTBTree_add(tree, "Summary.txt");
+    HTBTree_add(tree, "Bibliography.html");
+    HTBTree_add(tree, "HTandCern.txt");
+    HTBTree_add(tree, "Talk.draw");
+    HTBTree_add(tree, "zDesignNotes.html");
+    HTBTree_add(tree, "Link.html");
+    HTBTree_add(tree, "Status.html");
+    HTBTree_add(tree, "http.txt");
+    HTBTree_add(tree, "People.html~");
+    HTBTree_add(tree, "TAGS");
+    HTBTree_add(tree, "summary.txt");
+    HTBTree_add(tree, "Technical.html");
+    HTBTree_add(tree, "Terms.html");
+    HTBTree_add(tree, "JANETAccess.html");
+    HTBTree_add(tree, "People.txt");
+    HTBTree_add(tree, "README.txt");
+    HTBTree_add(tree, "CodingStandards.html");
+    HTBTree_add(tree, "Copyright.txt");
+    HTBTree_add(tree, "Status_old.html");
+    HTBTree_add(tree, "patches~");
+    HTBTree_add(tree, "RelatedProducts.html");
+    HTBTree_add(tree, "Implementation");
+    HTBTree_add(tree, "History.html");
+    HTBTree_add(tree, "Makefile.bak");
+    HTBTree_add(tree, "Makefile.old");
+    HTBTree_add(tree, "Policy.html");
+    HTBTree_add(tree, "WhatIs.html");
+    HTBTree_add(tree, "TheProject.html");
+    HTBTree_add(tree, "Notation.html");
+    HTBTree_add(tree, "Helping.html");
+    HTBTree_add(tree, "Cyber-WWW.sit.Hqx");
+    HTBTree_add(tree, "Glossary.html");
+    HTBTree_add(tree, "maketags.html");
+    HTBTree_add(tree, "IntroCS.html");
+    HTBTree_add(tree, "Contrib");
+    HTBTree_add(tree, "Help.html");
+    HTBTree_add(tree, "CodeManagExec");
+    HTBTree_add(tree, "HT-0.1draz");
+    HTBTree_add(tree, "Cello");
+    HTBTree_add(tree, "TOPUB");
+    HTBTree_add(tree, "BUILD");
+    HTBTree_add(tree, "BUILDALL");
+    HTBTree_add(tree, "Lynx");
+    HTBTree_add(tree, "ArthurLibrary");
+    HTBTree_add(tree, "RashtyClient");
+    HTBTree_add(tree, "#History.html#");
+    HTBTree_add(tree, "PerlServers");
+    HTBTree_add(tree, "modules");
+    HTBTree_add(tree, "NCSA_httpd");
+    HTBTree_add(tree, "MAIL2HTML");
+    HTBTree_add(tree, "core");
+    HTBTree_add(tree, "EmacsWWW");
 #ifdef BTREE_TRACE
-    printf("\nTreeTopObject=%s\n\n",tree->top->object);
+    printf("\nTreeTopObject=%s\n\n", tree->top->object);
 #endif
-    next_element = HTBTree_next(tree,NULL);
-    while (next_element != NULL)
-    {
+    next_element = HTBTree_next(tree, NULL);
+    while (next_element != NULL) {
 #ifndef BTREE_TRACE
-	printf("The next element is %s\n",next_element->object);
+	printf("The next element is %s\n", next_element->object);
 #endif
-	next_element = HTBTree_next(tree,next_element);
+	next_element = HTBTree_next(tree, next_element);
     }
     HTBTree_free(tree);
 }
 
-
 #endif
diff --git a/WWW/Library/Implementation/HTBTree.h b/WWW/Library/Implementation/HTBTree.h
index 0bf10cf7..dc1cbc3e 100644
--- a/WWW/Library/Implementation/HTBTree.h
+++ b/WWW/Library/Implementation/HTBTree.h
@@ -22,48 +22,41 @@ Data structures
 
  */
 typedef struct _HTBTree_element {
-    void                        *object;        /* User object */
-    struct _HTBTree_element     *up;
-    struct _HTBTree_element     *left;
-    int                         left_depth;
-    struct _HTBTree_element     *right;
-    int                         right_depth;
+    void *object;		/* User object */
+    struct _HTBTree_element *up;
+    struct _HTBTree_element *left;
+    int left_depth;
+    struct _HTBTree_element *right;
+    int right_depth;
 } HTBTElement;
 
-typedef int (*HTComparer) (void * a, void * b);
+typedef int (*HTComparer) (void *a, void *b);
 
 typedef struct _HTBTree_top {
-    HTComparer                  compare;
-    struct _HTBTree_element     *top;
+    HTComparer compare;
+    struct _HTBTree_element *top;
 } HTBTree;
 
-
 /*
 
 Create a binary tree given its discrimination routine
 
  */
-extern HTBTree * HTBTree_new (HTComparer comp);
-
-
+extern HTBTree *HTBTree_new(HTComparer comp);
 
 /*
 
 Free storage of the tree but not of the objects
 
  */
-extern void HTBTree_free (HTBTree* tree);
-
-
+extern void HTBTree_free(HTBTree *tree);
 
 /*
 
 Free storage of the tree and of the objects
 
  */
-extern void HTBTreeAndObject_free (HTBTree* tree);
-
-
+extern void HTBTreeAndObject_free(HTBTree *tree);
 
 /*
 
@@ -71,8 +64,7 @@ Add an object to a binary tree
 
  */
 
-extern void HTBTree_add (HTBTree* tree, void * object);
-
+extern void HTBTree_add(HTBTree *tree, void *object);
 
 /*
 
@@ -81,8 +73,7 @@ Search an object in a binary tree
   returns          Pointer to equivalent object in a tree or NULL if none.
  */
 
-extern void * HTBTree_search (HTBTree* tree, void * object);
-
+extern void *HTBTree_search(HTBTree *tree, void *object);
 
 /*
 
@@ -91,7 +82,6 @@ Find user object for element
  */
 #define HTBTree_object(element)  ((element)->object)
 
-
 /*
 
 Find next element in depth-first order
@@ -104,6 +94,6 @@ Find next element in depth-first order
   returns                Pointer to element or NULL if none left.
 
  */
-extern HTBTElement * HTBTree_next (HTBTree* tree, HTBTElement * ele);
+extern HTBTElement *HTBTree_next(HTBTree *tree, HTBTElement *ele);
 
 #endif /* HTBTREE_H */
diff --git a/WWW/Library/Implementation/HTCJK.h b/WWW/Library/Implementation/HTCJK.h
index 760fe199..28b98e76 100644
--- a/WWW/Library/Implementation/HTCJK.h
+++ b/WWW/Library/Implementation/HTCJK.h
@@ -1,12 +1,12 @@
 /*			CJK character converter		HTCJK.h
-**			=======================
-**
-**	Added 11-Jun-96 by FM, based on jiscode.h for
-**	  Yutaka Sato's (ysato@etl.go.jp) SJIS.c, and
-**	  Takuya ASADA's (asada@three-a.co.jp) CJK patches.
-**	  (see SGML.c).
-**
-*/
+ *			=======================
+ *
+ *	Added 11-Jun-96 by FM, based on jiscode.h for
+ *	  Yutaka Sato's (ysato@etl.go.jp) SJIS.c, and
+ *	  Takuya ASADA's (asada@three-a.co.jp) CJK patches.
+ *	  (see SGML.c).
+ *
+ */
 
 #ifndef HTCJK_H
 #define HTCJK_H
@@ -16,12 +16,12 @@
 #endif
 
 /*
-**	STATUS CHANGE CODES
-*/
+ *	STATUS CHANGE CODES
+ */
 #ifdef ESC
 #undef ESC
 #endif /* ESC */
-#define ESC		CH_ESC  /* S/390 -- gil -- 0098 */
+#define ESC		CH_ESC	/* S/390 -- gil -- 0098 */
 #define TO_2BCODE	'$'
 #define TO_1BCODE	'('
 
@@ -52,71 +52,63 @@
 #define IS_BIG5_HI(hi)	((0xA1<=hi)&&(hi<=0xFE))
 #define IS_BIG5(hi,lo) (IS_BIG5_HI(hi) && (IS_BIG5_LOS(lo) || IS_BIG5_LOX(lo)))
 
-typedef enum {NOKANJI, EUC, SJIS, JIS} HTkcode;
-typedef enum {NOCJK, JAPANESE, CHINESE, KOREAN, TAIPEI} HTCJKlang;
+typedef enum {
+    NOKANJI, EUC, SJIS, JIS
+} HTkcode;
+typedef enum {
+    NOCJK, JAPANESE, CHINESE, KOREAN, TAIPEI
+} HTCJKlang;
 
 extern HTCJKlang HTCJK;
 
 /*
-**  Function prototypes.
-*/
-extern void JISx0201TO0208_EUC (
-	register unsigned char		IHI,
-	register unsigned char		ILO,
-	register unsigned char *	OHI,
-	register unsigned char *	OLO);
-
-extern unsigned char * SJIS_TO_JIS1 (
-	register unsigned char		HI,
-	register unsigned char		LO,
-	register unsigned char *	JCODE);
-
-extern unsigned char * JIS_TO_SJIS1 (
-	register unsigned char		HI,
-	register unsigned char		LO,
-	register unsigned char *	SJCODE);
-
-extern unsigned char * EUC_TO_SJIS1 (
-	unsigned char			HI,
-	unsigned char			LO,
-	register unsigned char *	SJCODE);
-
-extern void JISx0201TO0208_SJIS (
-	register unsigned char		I,
-	register unsigned char *	OHI,
-	register unsigned char *	OLO);
-
-extern unsigned char * SJIS_TO_EUC1 (
-	unsigned char		HI,
-	unsigned char		LO,
-	unsigned char *		EUCp);
-
-extern unsigned char * SJIS_TO_EUC (
-	unsigned char *		src,
-	unsigned char *		dst);
-
-extern unsigned char * EUC_TO_SJIS (
-	unsigned char *		src,
-	unsigned char *		dst);
-
-extern unsigned char * EUC_TO_JIS (
-	unsigned char *		src,
-	unsigned char *		dst,
-	const char *		toK,
-	const char *		toA);
-
-extern unsigned char * TO_EUC (
-	const unsigned char *	jis,
-	unsigned char *		euc);
-
-extern void TO_SJIS (
-	const unsigned char *	any,
-	unsigned char *		sjis);
-
-extern void TO_JIS (
-	const unsigned char *	any,
-	unsigned char *		jis);
-
-extern char *str_kcode (HTkcode code);
+ *  Function prototypes.
+ */
+extern void JISx0201TO0208_EUC(register unsigned char IHI,
+			       register unsigned char ILO,
+			       register unsigned char *OHI,
+			       register unsigned char *OLO);
+
+extern unsigned char *SJIS_TO_JIS1(register unsigned char HI,
+				   register unsigned char LO,
+				   register unsigned char *JCODE);
+
+extern unsigned char *JIS_TO_SJIS1(register unsigned char HI,
+				   register unsigned char LO,
+				   register unsigned char *SJCODE);
+
+extern unsigned char *EUC_TO_SJIS1(unsigned char HI,
+				   unsigned char LO,
+				   register unsigned char *SJCODE);
+
+extern void JISx0201TO0208_SJIS(register unsigned char I,
+				register unsigned char *OHI,
+				register unsigned char *OLO);
+
+extern unsigned char *SJIS_TO_EUC1(unsigned char HI,
+				   unsigned char LO,
+				   unsigned char *EUCp);
+
+extern unsigned char *SJIS_TO_EUC(unsigned char *src,
+				  unsigned char *dst);
+
+extern unsigned char *EUC_TO_SJIS(unsigned char *src,
+				  unsigned char *dst);
+
+extern unsigned char *EUC_TO_JIS(unsigned char *src,
+				 unsigned char *dst,
+				 const char *toK,
+				 const char *toA);
+
+extern unsigned char *TO_EUC(const unsigned char *jis,
+			     unsigned char *euc);
+
+extern void TO_SJIS(const unsigned char *any,
+		    unsigned char *sjis);
+
+extern void TO_JIS(const unsigned char *any,
+		   unsigned char *jis);
+
+extern char *str_kcode(HTkcode code);
 
 #endif /* HTCJK_H */
diff --git a/WWW/Library/Implementation/HTChunk.c b/WWW/Library/Implementation/HTChunk.c
index 63a99f8a..a0e1dc95 100644
--- a/WWW/Library/Implementation/HTChunk.c
+++ b/WWW/Library/Implementation/HTChunk.c
@@ -1,7 +1,7 @@
 /*		Chunk handling:	Flexible arrays
-**		===============================
-**
-*/
+ *		===============================
+ *
+ */
 
 #include <HTUtils.h>
 #include <HTChunk.h>
@@ -9,9 +9,9 @@
 #include <LYLeaks.h>
 
 /*
-**	Initialize a chunk with a certain allocation unit
-*/
-void HTChunkInit (HTChunk *ch, int grow)
+ *	Initialize a chunk with a certain allocation unit
+ */
+void HTChunkInit(HTChunk *ch, int grow)
 {
     ch->data = 0;
     ch->growby = grow;
@@ -20,21 +20,23 @@ void HTChunkInit (HTChunk *ch, int grow)
 }
 
 /*	Create a chunk with a certain allocation unit
-**	--------------
-*/
-HTChunk * HTChunkCreate (int grow)
+ *	--------------
+ */
+HTChunk *HTChunkCreate(int grow)
 {
-    HTChunk * ch = typecalloc(HTChunk);
+    HTChunk *ch = typecalloc(HTChunk);
+
     if (ch == NULL)
 	outofmem(__FILE__, "creation of chunk");
 
-    HTChunkInit (ch, grow);
+    HTChunkInit(ch, grow);
     return ch;
 }
 
-HTChunk * HTChunkCreateMayFail (int grow, int failok)
+HTChunk *HTChunkCreateMayFail(int grow, int failok)
 {
-    HTChunk * ch = typecalloc(HTChunk);
+    HTChunk *ch = typecalloc(HTChunk);
+
     if (ch == NULL) {
 	if (!failok) {
 	    outofmem(__FILE__, "creation of chunk");
@@ -42,65 +44,66 @@ HTChunk * HTChunkCreateMayFail (int grow, int failok)
 	    return ch;
 	}
     }
-    HTChunkInit (ch, grow);
+    HTChunkInit(ch, grow);
     ch->failok = failok;
     return ch;
 }
 
 /*	Create a chunk with a certain allocation unit and ensured size
-**	--------------
-*/
-HTChunk * HTChunkCreate2 (int grow, size_t  needed)
+ *	--------------
+ */
+HTChunk *HTChunkCreate2(int grow, size_t needed)
 {
-    HTChunk * ch = typecalloc(HTChunk);
+    HTChunk *ch = typecalloc(HTChunk);
+
     if (ch == NULL)
 	outofmem(__FILE__, "HTChunkCreate2");
 
-    HTChunkInit (ch, grow);
+    HTChunkInit(ch, grow);
     if (needed > 0) {
-	ch->allocated = needed-1 - ((needed-1) % ch->growby)
-	    + ch->growby; /* Round up */
+	ch->allocated = needed - 1 - ((needed - 1) % ch->growby)
+	    + ch->growby;	/* Round up */
 	CTRACE((tfp, "HTChunkCreate2: requested %d, allocate %d\n",
-	       (int) needed, ch->allocated));
+		(int) needed, ch->allocated));
 	ch->data = typecallocn(char, ch->allocated);
+
 	if (!ch->data)
 	    outofmem(__FILE__, "HTChunkCreate2 data");
     }
     return ch;
 }
 
-
 /*	Clear a chunk of all data
-**	--------------------------
-*/
-void HTChunkClear (HTChunk * ch)
+ *	--------------------------
+ */
+void HTChunkClear(HTChunk *ch)
 {
     FREE(ch->data);
     ch->size = 0;
     ch->allocated = 0;
 }
 
-
 /*	Free a chunk
-**	------------
-*/
-void HTChunkFree (HTChunk * ch)
+ *	------------
+ */
+void HTChunkFree(HTChunk *ch)
 {
     FREE(ch->data);
     FREE(ch);
 }
 
-
 /*	Realloc the chunk
-**	-----------------
-*/
-BOOL HTChunkRealloc (HTChunk * ch, int growby)
+ *	-----------------
+ */
+BOOL HTChunkRealloc(HTChunk *ch, int growby)
 {
     char *data;
+
     ch->allocated = ch->allocated + growby;
 
-    data = ch->data ? (char *)realloc(ch->data, ch->allocated)
-			: typecallocn(char, ch->allocated);
+    data = ch->data ? (char *) realloc(ch->data, ch->allocated)
+	: typecallocn(char, ch->allocated);
+
     if (data) {
 	ch->data = data;
     } else if (ch->failok) {
@@ -112,13 +115,12 @@ BOOL HTChunkRealloc (HTChunk * ch, int growby)
     return TRUE;
 }
 
-
 /*	Append a character
-**	------------------
-*/
+ *	------------------
+ */
 /* Warning: the code of this function is defined as macro in SGML.c. Change
   the macro or undefine it in SGML.c when changing this function. -VH */
-void HTChunkPutc (HTChunk * ch, char c)
+void HTChunkPutc(HTChunk *ch, char c)
 {
     if (ch->size >= ch->allocated) {
 	if (!HTChunkRealloc(ch, ch->growby))
@@ -127,26 +129,29 @@ void HTChunkPutc (HTChunk * ch, char c)
     ch->data[ch->size++] = c;
 }
 
-
 /*	Ensure a certain size
-**	---------------------
-*/
-void HTChunkEnsure (HTChunk * ch, int needed)
+ *	---------------------
+ */
+void HTChunkEnsure(HTChunk *ch, int needed)
 {
-    if (needed <= ch->allocated) return;
-    ch->allocated = needed-1 - ((needed-1) % ch->growby)
-			     + ch->growby; /* Round up */
-    ch->data = ch->data ? (char *)realloc(ch->data, ch->allocated)
-			: typecallocn(char, ch->allocated);
+    if (needed <= ch->allocated)
+	return;
+    ch->allocated = needed - 1 - ((needed - 1) % ch->growby)
+	+ ch->growby;		/* Round up */
+    ch->data = ch->data ? (char *) realloc(ch->data, ch->allocated)
+	: typecallocn(char, ch->allocated);
+
     if (ch->data == NULL)
 	outofmem(__FILE__, "HTChunkEnsure");
 }
 
-void HTChunkPutb (HTChunk *ch, const char *b, int l)
+void HTChunkPutb(HTChunk *ch, const char *b, int l)
 {
-    if (l <= 0) return;
+    if (l <= 0)
+	return;
     if (ch->size + l > ch->allocated) {
-	int growby = l - (l % ch->growby) + ch->growby; /* Round up */
+	int growby = l - (l % ch->growby) + ch->growby;		/* Round up */
+
 	if (!HTChunkRealloc(ch, growby))
 	    return;
     }
@@ -157,29 +162,28 @@ void HTChunkPutb (HTChunk *ch, const char *b, int l)
 #define PUTC(code) ch->data[ch->size++] = (char)(code)
 #define PUTC2(code) ch->data[ch->size++] = (char)(0x80|(0x3f &(code)))
 
-void HTChunkPutUtf8Char (
-	HTChunk *	ch,
-	UCode_t	code)
+void HTChunkPutUtf8Char(HTChunk *ch, UCode_t code)
 {
     int utflen;
 
     if (TOASCII(code) < 128)
 	utflen = 1;
-    else if   (code <     0x800L) {
+    else if (code < 0x800L) {
 	utflen = 2;
-    } else if (code <   0x10000L) {
+    } else if (code < 0x10000L) {
 	utflen = 3;
-    } else if (code <  0x200000L) {
+    } else if (code < 0x200000L) {
 	utflen = 4;
     } else if (code < 0x4000000L) {
 	utflen = 5;
-    } else if (code<=0x7fffffffL) {
+    } else if (code <= 0x7fffffffL) {
 	utflen = 6;
     } else
 	utflen = 0;
 
     if (ch->size + utflen > ch->allocated) {
 	int growby = (ch->growby >= utflen) ? ch->growby : utflen;
+
 	if (!HTChunkRealloc(ch, growby))
 	    return;
     }
@@ -188,36 +192,36 @@ void HTChunkPutUtf8Char (
     case 0:
 	return;
     case 1:
-	ch->data[ch->size++] = (char)code;
+	ch->data[ch->size++] = (char) code;
 	return;
     case 2:
-	PUTC(0xc0 | (code>>6));
+	PUTC(0xc0 | (code >> 6));
 	break;
     case 3:
-	PUTC(0xe0 | (code>>12));
+	PUTC(0xe0 | (code >> 12));
 	break;
     case 4:
-	PUTC(0xf0 | (code>>18));
+	PUTC(0xf0 | (code >> 18));
 	break;
     case 5:
-	PUTC(0xf8 | (code>>24));
+	PUTC(0xf8 | (code >> 24));
 	break;
     case 6:
-	PUTC(0xfc | (code>>30));
+	PUTC(0xfc | (code >> 30));
 	break;
     }
     switch (utflen) {
     case 6:
-	PUTC2(code>>24);
+	PUTC2(code >> 24);
 	/* FALLTHRU */
     case 5:
-	PUTC2(code>>18);
+	PUTC2(code >> 18);
 	/* FALLTHRU */
     case 4:
-	PUTC2(code>>12);
+	PUTC2(code >> 12);
 	/* FALLTHRU */
     case 3:
-	PUTC2(code>>6);
+	PUTC2(code >> 6);
 	/* FALLTHRU */
     case 2:
 	PUTC2(code);
@@ -226,20 +230,20 @@ void HTChunkPutUtf8Char (
 }
 
 /*	Terminate a chunk
-**	-----------------
-*/
-void HTChunkTerminate (HTChunk * ch)
+ *	-----------------
+ */
+void HTChunkTerminate(HTChunk *ch)
 {
-    HTChunkPutc(ch, (char)0);
+    HTChunkPutc(ch, (char) 0);
 }
 
-
 /*	Append a string
-**	---------------
-*/
-void HTChunkPuts (HTChunk * ch, const char * s)
+ *	---------------
+ */
+void HTChunkPuts(HTChunk *ch, const char *s)
 {
-    const char * p;
+    const char *p;
+
     for (p = s; *p; p++) {
 	if (ch->size >= ch->allocated) {
 	    if (!HTChunkRealloc(ch, ch->growby))
diff --git a/WWW/Library/Implementation/HTChunk.h b/WWW/Library/Implementation/HTChunk.h
index 2d53aa72..8c593bca 100644
--- a/WWW/Library/Implementation/HTChunk.h
+++ b/WWW/Library/Implementation/HTChunk.h
@@ -17,18 +17,17 @@
 #include <UCMap.h>
 
 typedef struct {
-	int	size;		/* In bytes			*/
-	int	growby;		/* Allocation unit in bytes	*/
-	int	allocated;	/* Current size of *data	*/
-	char *	data;		/* Pointer to malloced area or 0 */
-	int	failok;		/* allowed to fail without exiting program? */
+    int size;			/* In bytes                     */
+    int growby;			/* Allocation unit in bytes     */
+    int allocated;		/* Current size of *data        */
+    char *data;			/* Pointer to malloced area or 0 */
+    int failok;			/* allowed to fail without exiting program? */
 } HTChunk;
 
-
 /*
  * Initialize a chunk's allocation data and allocation-increment.
  */
-extern void HTChunkInit (HTChunk * ch, int grow);
+extern void HTChunkInit(HTChunk *ch, int grow);
 
 /*
  *
@@ -46,7 +45,7 @@ extern void HTChunkInit (HTChunk * ch, int grow);
  *
  */
 
-extern HTChunk * HTChunkCreate (int growby);
+extern HTChunk *HTChunkCreate(int growby);
 
 /*
  *  Create a chunk for which an allocation error is not a fatal application
@@ -55,14 +54,13 @@ extern HTChunk * HTChunkCreate (int growby);
  *  are ok each time after data have been appended.
  *  The create call may also fail and will reurn NULL in that case. - kw
  */
-extern HTChunk * HTChunkCreateMayFail (int growby, int failok);
+extern HTChunk *HTChunkCreateMayFail(int growby, int failok);
 
 /*
  *  Like HTChunkCreate but with initial allocation - kw
  *
  */
-extern HTChunk * HTChunkCreate2 (int growby, size_t needed);
-
+extern HTChunk *HTChunkCreate2(int growby, size_t needed);
 
 /*
  *
@@ -78,8 +76,7 @@ extern HTChunk * HTChunkCreate2 (int growby, size_t needed);
  *
  */
 
-extern void HTChunkFree (HTChunk * ch);
-
+extern void HTChunkFree(HTChunk *ch);
 
 /*
  *
@@ -95,8 +92,7 @@ extern void HTChunkFree (HTChunk * ch);
  *
  */
 
-extern void HTChunkClear (HTChunk * ch);
-
+extern void HTChunkClear(HTChunk *ch);
 
 /*
  *
@@ -114,8 +110,7 @@ extern void HTChunkClear (HTChunk * ch);
  *
  */
 
-extern BOOL HTChunkRealloc (HTChunk * ch, int growby);
-
+extern BOOL HTChunkRealloc(HTChunk *ch, int growby);
 
 /*
  *
@@ -133,8 +128,7 @@ extern BOOL HTChunkRealloc (HTChunk * ch, int growby);
  *
  */
 
-extern void HTChunkEnsure (HTChunk * ch, int s);
-
+extern void HTChunkEnsure(HTChunk *ch, int s);
 
 /*
  *
@@ -151,11 +145,11 @@ extern void HTChunkEnsure (HTChunk * ch, int s);
  *   *ch		Is one character bigger
  *
  */
-extern void HTChunkPutc (HTChunk * ch, char c);
+extern void HTChunkPutc(HTChunk *ch, char c);
 
-extern void HTChunkPutb (HTChunk * ch, const char *b, int l);
+extern void HTChunkPutb(HTChunk *ch, const char *b, int l);
 
-extern void HTChunkPutUtf8Char (HTChunk * ch, UCode_t code);
+extern void HTChunkPutUtf8Char(HTChunk *ch, UCode_t code);
 
 /*
  * Append a string to a  chunk
@@ -172,9 +166,7 @@ extern void HTChunkPutUtf8Char (HTChunk * ch, UCode_t code);
  *
  */
 
-
-extern void HTChunkPuts (HTChunk * ch, const char *str);
-
+extern void HTChunkPuts(HTChunk *ch, const char *str);
 
 /*
  *
@@ -194,7 +186,6 @@ extern void HTChunkPuts (HTChunk * ch, const char *str);
  *
  */
 
-
-extern void HTChunkTerminate (HTChunk * ch);
+extern void HTChunkTerminate(HTChunk *ch);
 
 #endif /* HTCHUNK_H */
diff --git a/WWW/Library/Implementation/HTDOS.c b/WWW/Library/Implementation/HTDOS.c
index 0e4e5614..8edb0e7c 100644
--- a/WWW/Library/Implementation/HTDOS.c
+++ b/WWW/Library/Implementation/HTDOS.c
@@ -13,24 +13,25 @@
  * Make a copy of the source argument in the result, allowing some extra
  * space so we can append directly onto the result without reallocating.
  */
-static char * copy_plus (char **  result, const char *  source)
+static char *copy_plus(char **result, const char *source)
 {
     int length = strlen(source);
-    HTSprintf0(result, "%-*s", length+10, source);
+
+    HTSprintf0(result, "%-*s", length + 10, source);
     (*result)[length] = 0;
     return (*result);
 }
 
 /* PUBLIC							HTDOS_wwwName()
-**		CONVERTS DOS Name into WWW Name
-** ON ENTRY:
-**	dosname		DOS file specification (NO NODE)
-**
-** ON EXIT:
-**	returns		WWW file specification
-**
-*/
-char * HTDOS_wwwName (const char *  dosname)
+ *		CONVERTS DOS Name into WWW Name
+ * ON ENTRY:
+ *	dosname		DOS file specification (NO NODE)
+ *
+ * ON EXIT:
+ *	returns		WWW file specification
+ *
+ */
+char *HTDOS_wwwName(const char *dosname)
 {
     static char *wwwname = NULL;
     char *cp_url = copy_plus(&wwwname, dosname);
@@ -42,7 +43,7 @@ char * HTDOS_wwwName (const char *  dosname)
     while ((ch = *dosname) != '\0') {
 	switch (ch) {
 	case '\\':
-	/* convert dos backslash to unix-style */
+	    /* convert dos backslash to unix-style */
 	    *cp_url++ = '/';
 	    break;
 	case ' ':
@@ -50,40 +51,39 @@ char * HTDOS_wwwName (const char *  dosname)
 	    *cp_url++ = '2';
 	    *cp_url++ = '0';
 	    break;
-      default:
+	default:
 	    *cp_url++ = ch;
 	    break;
-      }
-      dosname++;
+	}
+	dosname++;
     }
     *cp_url = '\0';
 #else
-    for ( ; *cp_url != '\0' ; cp_url++)
-	if(*cp_url == '\\')
-	    *cp_url = '/';   /* convert dos backslash to unix-style */
+    for (; *cp_url != '\0'; cp_url++)
+	if (*cp_url == '\\')
+	    *cp_url = '/';	/* convert dos backslash to unix-style */
 #endif
 
     wwwname_len = strlen(wwwname);
     if (wwwname_len > 1)
-	cp_url--;	/* point last char */
+	cp_url--;		/* point last char */
 
     if (wwwname_len > 3 && *cp_url == '/') {
 	cp_url++;
 	*cp_url = '\0';
     }
-    return(wwwname);
+    return (wwwname);
 }
 
-
 /*
  * Convert slashes from Unix to DOS
  */
-char * HTDOS_slashes (char *  path)
+char *HTDOS_slashes(char *path)
 {
     char *s;
 
-    for (s = path; *s != '\0'; ++s)	{
-	if (*s == '/')	{
+    for (s = path; *s != '\0'; ++s) {
+	if (*s == '/') {
 	    *s = '\\';
 	}
     }
@@ -91,16 +91,16 @@ char * HTDOS_slashes (char *  path)
 }
 
 /* PUBLIC							HTDOS_name()
-**		CONVERTS WWW name into a DOS name
-** ON ENTRY:
-**	wwwname		WWW file name
-**
-** ON EXIT:
-**	returns		DOS file specification
-*/
-char * HTDOS_name (char *  wwwname)
+ *		CONVERTS WWW name into a DOS name
+ * ON ENTRY:
+ *	wwwname		WWW file name
+ *
+ * ON EXIT:
+ *	returns		DOS file specification
+ */
+char *HTDOS_name(char *wwwname)
 {
-#ifdef _WINDOWS	/* 1998/04/02 (Thu) 08:47:20 */
+#ifdef _WINDOWS			/* 1998/04/02 (Thu) 08:47:20 */
     extern char windows_drive[];
     char temp_buff[LY_MAXPATH];
 #endif
@@ -110,12 +110,12 @@ char * HTDOS_name (char *  wwwname)
     copy_plus(&result, wwwname);
 #ifdef __DJGPP__
     if (result[0] == '/'
-     && result[1] == 'd'
-     && result[2] == 'e'
-     && result[3] == 'v'
-     && result[4] == '/'
-     && isalpha(result[5])) {
-	return(result);
+	&& result[1] == 'd'
+	&& result[2] == 'e'
+	&& result[3] == 'v'
+	&& result[4] == '/'
+	&& isalpha(result[5])) {
+	return (result);
     }
 #endif /* __DJGPP__ */
 
@@ -123,16 +123,14 @@ char * HTDOS_name (char *  wwwname)
 
     /* pesky leading slash, rudiment from file://localhost/  */
     /* the rest of path may be with or without drive letter  */
-    if((result[1] != '\\') && (result[0]  == '\\')) {
-	for (joe = 0; (result[joe] = result[joe+1]) != 0; joe++)
-	    ;
+    if ((result[1] != '\\') && (result[0] == '\\')) {
+	for (joe = 0; (result[joe] = result[joe + 1]) != 0; joe++) ;
     }
-
-#ifdef _WINDOWS	/* 1998/04/02 (Thu) 08:59:48 */
+#ifdef _WINDOWS			/* 1998/04/02 (Thu) 08:59:48 */
     if (LYLastPathSep(result) != NULL
-     && !LYIsDosDrive(result)) {
+	&& !LYIsDosDrive(result)) {
 	sprintf(temp_buff, "%.3s\\%.*s", windows_drive,
-		(int)(sizeof(temp_buff) - 5), result);
+		(int) (sizeof(temp_buff) - 5), result);
 	StrAllocCopy(result, temp_buff);
     }
 #endif
@@ -141,7 +139,7 @@ char * HTDOS_name (char *  wwwname)
      * refers to the current directory on the given device.
      */
     if (LYLastPathSep(result) == NULL
-     && LYIsDosDrive(result))
+	&& LYIsDosDrive(result))
 	LYAddPathSep0(result);
 
     CTRACE((tfp, "HTDOS_name changed `%s' to `%s'\n", wwwname, result));
@@ -169,13 +167,13 @@ char *HTDOS_short_name(char *path)
 
 #if defined(DJGPP) && defined(DJGPP_KEYHANDLER)
 /* PUBLIC       getxkey()
-**              Replaces libc's getxkey() with polling of tcp/ip
-**              library (WatTcp or Watt-32). This is required to
-**              be able to finish off dead sockets, answer pings etc.
-**
-** ON EXIT:
-**      returns extended keypress.
-*/
+ *              Replaces libc's getxkey() with polling of tcp/ip
+ *              library (WatTcp or Watt-32). This is required to
+ *              be able to finish off dead sockets, answer pings etc.
+ *
+ * ON EXIT:
+ *      returns extended keypress.
+ */
 
 /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
 #include <pc.h>
@@ -183,16 +181,15 @@ char *HTDOS_short_name(char *path)
 #include <libc/farptrgs.h>
 #include <go32.h>
 
-int getxkey (void)
+int getxkey(void)
 {
     __dpmi_regs r;
 
     /* poll tcp/ip lib and yield to DPMI-host while nothing in
      * keyboard buffer (head = tail) (simpler than kbhit).
      */
-    while (_farpeekw(_dos_ds, 0x41a) == _farpeekw(_dos_ds, 0x41c))
-    {
-	tcp_tick (NULL);
+    while (_farpeekw(_dos_ds, 0x41a) == _farpeekw(_dos_ds, 0x41c)) {
+	tcp_tick(NULL);
 	__dpmi_yield();
     }
 
@@ -206,4 +203,3 @@ int getxkey (void)
     return r.h.al;
 }
 #endif /* DJGPP && DJGPP_KEYHANDLER */
-
diff --git a/WWW/Library/Implementation/HTDOS.h b/WWW/Library/Implementation/HTDOS.h
index cae9cb02..c25f510a 100644
--- a/WWW/Library/Implementation/HTDOS.h
+++ b/WWW/Library/Implementation/HTDOS.h
@@ -8,37 +8,38 @@
 #endif /* HTUTILS_H */
 
 /* PUBLIC                                                       HTDOS_wwwName()
-**              CONVERTS DOS Name into WWW Name
-** ON ENTRY:
-**	dosname		DOS file specification (NO NODE)
-**
-** ON EXIT:
-**	returns		WWW file specification
-**
-*/
-char * HTDOS_wwwName (const char * dosname);
+ *              CONVERTS DOS Name into WWW Name
+ * ON ENTRY:
+ *	dosname		DOS file specification (NO NODE)
+ *
+ * ON EXIT:
+ *	returns		WWW file specification
+ *
+ */
+char *HTDOS_wwwName(const char *dosname);
 
 /*
  * Converts Unix slashes to DOS
  */
-char * HTDOS_slashes (char * path);
+char *HTDOS_slashes(char *path);
 
 /* PUBLIC                                                       HTDOS_name()
-**              CONVERTS WWW name into a DOS name
-** ON ENTRY:
-**	wwwname		WWW file name
-**
-** ON EXIT:
-**	returns		DOS file specification
-**
-** Bug:	Returns pointer to static -- non-reentrant
-*/
-char * HTDOS_name (char * wwwname);
-
-#ifdef WIN_EX 
-char * HTDOS_short_name (char * fn);
-#else 
-#define HTDOS_short_name(fn)  fn 
+ *              CONVERTS WWW name into a DOS name
+ * ON ENTRY:
+ *	wwwname		WWW file name
+ *
+ * ON EXIT:
+ *	returns		DOS file specification
+ *
+ * Bug:	Returns pointer to static -- non-reentrant
+ */
+char *HTDOS_name(char *wwwname);
+
+#ifdef WIN_EX
+char *HTDOS_short_name(char *fn);
+
+#else
+#define HTDOS_short_name(fn)  fn
 #endif
 
 #endif /*  HTDOS_H */
diff --git a/WWW/Library/Implementation/HTFTP.c b/WWW/Library/Implementation/HTFTP.c
index 62e91751..c017aebf 100644
--- a/WWW/Library/Implementation/HTFTP.c
+++ b/WWW/Library/Implementation/HTFTP.c
@@ -1,76 +1,76 @@
 /*			File Transfer Protocol (FTP) Client
-**			for a WorldWideWeb browser
-**			===================================
-**
-**	A cache of control connections is kept.
-**
-** Note: Port allocation
-**
-**	It is essential that the port is allocated by the system, rather
-**	than chosen in rotation by us (POLL_PORTS), or the following
-**	problem occurs.
-**
-**	It seems that an attempt by the server to connect to a port which has
-**	been used recently by a listen on the same socket, or by another
-**	socket this or another process causes a hangup of (almost exactly)
-**	one minute.  Therefore, we have to use a rotating port number.
-**	The problem remains that if the application is run twice in quick
-**	succession, it will hang for what remains of a minute.
-**
-** Authors
-**	TBL	Tim Berners-lee <timbl@info.cern.ch>
-**	DD	Denis DeLaRoca 310 825-4580 <CSP1DWD@mvs.oac.ucla.edu>
-**	LM	Lou Montulli <montulli@ukanaix.cc.ukans.edu>
-**	FM	Foteos Macrides <macrides@sci.wfeb.edu>
-** History:
-**	 2 May 91	Written TBL, as a part of the WorldWideWeb project.
-**	15 Jan 92	Bug fix: close() was used for NETCLOSE for control soc
-**	10 Feb 92	Retry if cached connection times out or breaks
-**	 8 Dec 92	Bug fix 921208 TBL after DD
-**	17 Dec 92	Anon FTP password now just WWWuser@ suggested by DD
-**			fails on princeton.edu!
-**	27 Dec 93 (FM)	Fixed up so FTP now works with VMS hosts.  Path
-**			must be Unix-style and cannot include the device
-**			or top directory.
-**	?? ??? ?? (LM)	Added code to prompt and send passwords for non
-**			anonymous FTP
-**	25 Mar 94 (LM)	Added code to recognize different ftp server types
-**			and code to parse dates and sizes on most hosts.
-**	27 Mar 93 (FM)	Added code for getting dates and sizes on VMS hosts.
-**
-** Notes:
-**			Portions Copyright 1994 Trustees of Dartmouth College
-**			Code for recognizing different FTP servers and
-**			parsing "ls -l" output taken from Macintosh Fetch
-**			program with permission from Jim Matthews,
-**			Dartmouth Software Development Team.
-*/
+ *			for a WorldWideWeb browser
+ *			===================================
+ *
+ *	A cache of control connections is kept.
+ *
+ * Note: Port allocation
+ *
+ *	It is essential that the port is allocated by the system, rather
+ *	than chosen in rotation by us (POLL_PORTS), or the following
+ *	problem occurs.
+ *
+ *	It seems that an attempt by the server to connect to a port which has
+ *	been used recently by a listen on the same socket, or by another
+ *	socket this or another process causes a hangup of (almost exactly)
+ *	one minute.  Therefore, we have to use a rotating port number.
+ *	The problem remains that if the application is run twice in quick
+ *	succession, it will hang for what remains of a minute.
+ *
+ * Authors
+ *	TBL	Tim Berners-lee <timbl@info.cern.ch>
+ *	DD	Denis DeLaRoca 310 825-4580 <CSP1DWD@mvs.oac.ucla.edu>
+ *	LM	Lou Montulli <montulli@ukanaix.cc.ukans.edu>
+ *	FM	Foteos Macrides <macrides@sci.wfeb.edu>
+ * History:
+ *	 2 May 91	Written TBL, as a part of the WorldWideWeb project.
+ *	15 Jan 92	Bug fix: close() was used for NETCLOSE for control soc
+ *	10 Feb 92	Retry if cached connection times out or breaks
+ *	 8 Dec 92	Bug fix 921208 TBL after DD
+ *	17 Dec 92	Anon FTP password now just WWWuser@ suggested by DD
+ *			fails on princeton.edu!
+ *	27 Dec 93 (FM)	Fixed up so FTP now works with VMS hosts.  Path
+ *			must be Unix-style and cannot include the device
+ *			or top directory.
+ *	?? ??? ?? (LM)	Added code to prompt and send passwords for non
+ *			anonymous FTP
+ *	25 Mar 94 (LM)	Added code to recognize different ftp server types
+ *			and code to parse dates and sizes on most hosts.
+ *	27 Mar 93 (FM)	Added code for getting dates and sizes on VMS hosts.
+ *
+ * Notes:
+ *			Portions Copyright 1994 Trustees of Dartmouth College
+ *			Code for recognizing different FTP servers and
+ *			parsing "ls -l" output taken from Macintosh Fetch
+ *			program with permission from Jim Matthews,
+ *			Dartmouth Software Development Team.
+ */
 
 /*
-BUGS:	@@@	Limit connection cache size!
-		Error reporting to user.
-		400 & 500 errors are ack'ed by user with windows.
-		Use configuration file for user names
-
-**		Note for portability this version does not use select() and
-**		so does not watch the control and data channels at the
-**		same time.
-*/
+ * BUGS:	@@@	Limit connection cache size!
+ * 		Error reporting to user.
+ * 		400 & 500 errors are ack'ed by user with windows.
+ * 		Use configuration file for user names
+ * 
+ *		Note for portability this version does not use select() and
+ *		so does not watch the control and data channels at the
+ *		same time.
+ */
 
 #include <HTUtils.h>
 
 #include <HTAlert.h>
 
-#include <HTFTP.h>	/* Implemented here */
+#include <HTFTP.h>		/* Implemented here */
 #include <HTTCP.h>
 #include <HTTP.h>
 #include <HTFont.h>
 
-#define REPEAT_PORT	/* Give the port number for each file */
-#define REPEAT_LISTEN	/* Close each listen socket and open a new one */
+#define REPEAT_PORT		/* Give the port number for each file */
+#define REPEAT_LISTEN		/* Close each listen socket and open a new one */
 
 /* define POLL_PORTS		 If allocation does not work, poll ourselves.*/
-#define LISTEN_BACKLOG 2	/* Number of pending connect requests (TCP)*/
+#define LISTEN_BACKLOG 2	/* Number of pending connect requests (TCP) */
 
 #define FIRST_TCP_PORT	1024	/* Region to try for a listening port */
 #define LAST_TCP_PORT	5999
@@ -79,7 +79,7 @@ BUGS:	@@@	Limit connection cache size!
 
 #include <HTParse.h>
 #include <HTAnchor.h>
-#include <HTFile.h>	/* For HTFileFormat() */
+#include <HTFile.h>		/* For HTFileFormat() */
 #include <HTBTree.h>
 #include <HTChunk.h>
 #ifndef IPPORT_FTP
@@ -92,10 +92,10 @@ BUGS:	@@@	Limit connection cache size!
 #include <LYLeaks.h>
 
 typedef struct _connection {
-    struct _connection *	next;	/* Link on list		*/
-    unsigned long		addr;	/* IP address		*/
-    int				socket; /* Socket number for communication */
-    BOOL			binary; /* Binary mode? */
+    struct _connection *next;	/* Link on list         */
+    unsigned long addr;		/* IP address           */
+    int socket;			/* Socket number for communication */
+    BOOL binary;		/* Binary mode? */
 } connection;
 
 /*		Hypertext object building machinery
@@ -110,28 +110,28 @@ typedef struct _connection {
 #define ABORT_TARGET (*targetClass._free)         (target)
 
 struct _HTStructured {
-	const HTStructuredClass *	isa;
-	/* ... */
+    const HTStructuredClass *isa;
+    /* ... */
 };
 
 /*	Global Variables
-**	---------------------
-*/
+ *	---------------------
+ */
 int HTfileSortMethod = FILE_BY_NAME;
 
-#ifndef DISABLE_FTP /*This disables everything to end-of-file */
+#ifndef DISABLE_FTP		/*This disables everything to end-of-file */
 static char ThisYear[8];
 static char LastYear[8];
 static int TheDate;
 static BOOLEAN HaveYears = FALSE;
 
 /*	Module-Wide Variables
-**	---------------------
-*/
-static connection * connections = NULL;/* Linked list of connections */
-static char response_text[LINE_LENGTH+1];/* Last response from ftp host */
-static connection * control = NULL;	/* Current connection */
-static int data_soc = -1;		/* Socket for data transfer =invalid */
+ *	---------------------
+ */
+static connection *connections = NULL;	/* Linked list of connections */
+static char response_text[LINE_LENGTH + 1];	/* Last response from ftp host */
+static connection *control = NULL;	/* Current connection */
+static int data_soc = -1;	/* Socket for data transfer =invalid */
 static char *user_entered_password = NULL;
 static char *last_username_and_host = NULL;
 
@@ -145,57 +145,55 @@ static char *last_username_and_host = NULL;
 static int ProFTPD_bugs = FALSE;
 
 typedef enum {
-	GENERIC_SERVER
-	, MACHTEN_SERVER
-	, UNIX_SERVER
-	, VMS_SERVER
-	, CMS_SERVER
-	, DCTS_SERVER
-	, TCPC_SERVER
-	, PETER_LEWIS_SERVER
-	, NCSA_SERVER
-	, WINDOWS_NT_SERVER
-	, WINDOWS_2K_SERVER
-	, MS_WINDOWS_SERVER
-	, MSDOS_SERVER
-	, APPLESHARE_SERVER
-	, NETPRESENZ_SERVER
-	, DLS_SERVER
+    GENERIC_SERVER
+    ,MACHTEN_SERVER
+    ,UNIX_SERVER
+    ,VMS_SERVER
+    ,CMS_SERVER
+    ,DCTS_SERVER
+    ,TCPC_SERVER
+    ,PETER_LEWIS_SERVER
+    ,NCSA_SERVER
+    ,WINDOWS_NT_SERVER
+    ,WINDOWS_2K_SERVER
+    ,MS_WINDOWS_SERVER
+    ,MSDOS_SERVER
+    ,APPLESHARE_SERVER
+    ,NETPRESENZ_SERVER
+    ,DLS_SERVER
 } eServerType;
 
-static eServerType server_type = GENERIC_SERVER; /* the type of ftp host */
-static int	unsure_type = FALSE;		/* sure about the type? */
-static BOOLEAN use_list = FALSE;		/* use the LIST command? */
+static eServerType server_type = GENERIC_SERVER;	/* the type of ftp host */
+static int unsure_type = FALSE;	/* sure about the type? */
+static BOOLEAN use_list = FALSE;	/* use the LIST command? */
 
-static int	interrupted_in_next_data_char = FALSE;
+static int interrupted_in_next_data_char = FALSE;
 
 #ifdef POLL_PORTS
-static PortNumber	port_number = FIRST_TCP_PORT;
+static PortNumber port_number = FIRST_TCP_PORT;
 #endif /* POLL_PORTS */
 
-static int	master_socket = -1;	/* Listening socket = invalid	*/
-static char	port_command[255];	/* Command for setting the port */
-static fd_set	open_sockets;		/* Mask of active channels */
-static int	num_sockets;		/* Number of sockets to scan */
-static PortNumber	passive_port;	/* Port server specified for data */
-
+static int master_socket = -1;	/* Listening socket = invalid   */
+static char port_command[255];	/* Command for setting the port */
+static fd_set open_sockets;	/* Mask of active channels */
+static int num_sockets;		/* Number of sockets to scan */
+static PortNumber passive_port;	/* Port server specified for data */
 
 #define NEXT_CHAR HTGetCharacter()	/* Use function in HTFormat.c */
 
 #define DATA_BUFFER_SIZE 2048
-static char data_buffer[DATA_BUFFER_SIZE];		/* Input data buffer */
-static char * data_read_pointer;
-static char * data_write_pointer;
-#define NEXT_DATA_CHAR next_data_char()
-static int close_connection (
-	connection *	con);
+static char data_buffer[DATA_BUFFER_SIZE];	/* Input data buffer */
+static char *data_read_pointer;
+static char *data_write_pointer;
 
+#define NEXT_DATA_CHAR next_data_char()
+static int close_connection(connection * con);
 
 #ifdef LY_FIND_LEAKS
 /*
-**  This function frees module globals. - FM
-*/
-static void free_FTPGlobals (void)
+ *  This function frees module globals. - FM
+ */
+static void free_FTPGlobals(void)
 {
     FREE(user_entered_password);
     FREE(last_username_and_host);
@@ -208,35 +206,34 @@ static void free_FTPGlobals (void)
 #endif /* LY_FIND_LEAKS */
 
 /* PUBLIC						HTVMS_name()
-**		CONVERTS WWW name into a VMS name
-** ON ENTRY:
-**	nn		Node Name (optional)
-**	fn		WWW file name
-**
-** ON EXIT:
-**	returns		vms file specification
-**
-** Bug: Returns pointer to static -- non-reentrant
-*/
-char * HTVMS_name (
-	const char *	nn,
-	const char *	fn)
+ *		CONVERTS WWW name into a VMS name
+ * ON ENTRY:
+ *	nn		Node Name (optional)
+ *	fn		WWW file name
+ *
+ * ON EXIT:
+ *	returns		vms file specification
+ *
+ * Bug: Returns pointer to static -- non-reentrant
+ */
+char *HTVMS_name(const char *nn,
+		 const char *fn)
 {
 
 /*	We try converting the filename into Files-11 syntax.  That is, we assume
-**	first that the file is, like us, on a VMS node.  We try remote
-**	(or local) DECnet access.  Files-11, VMS, VAX and DECnet
-**	are trademarks of Digital Equipment Corporation.
-**	The node is assumed to be local if the hostname WITHOUT DOMAIN
-**	matches the local one. @@@
-*/
+ *	first that the file is, like us, on a VMS node.  We try remote
+ *	(or local) DECnet access.  Files-11, VMS, VAX and DECnet
+ *	are trademarks of Digital Equipment Corporation.
+ *	The node is assumed to be local if the hostname WITHOUT DOMAIN
+ *	matches the local one. @@@
+ */
     static char *vmsname;
-    char * filename = (char*)malloc(strlen(fn)+1);
-    char * nodename = (char*)malloc(strlen(nn)+2+1);	/* Copies to hack */
+    char *filename = (char *) malloc(strlen(fn) + 1);
+    char *nodename = (char *) malloc(strlen(nn) + 2 + 1);	/* Copies to hack */
     char *second;		/* 2nd slash */
     char *last;			/* last slash */
 
-    const char * hostname = HTHostName();
+    const char *hostname = HTHostName();
 
     if (!filename || !nodename)
 	outofmem(__FILE__, "HTVMSname");
@@ -245,39 +242,42 @@ char * HTVMS_name (
     if (strncmp(nn, "localhost", 9)) {
 	const char *p;
 	const char *q;
+
 	for (p = hostname, q = nn;
-	     *p && *p != '.' && *q && *q != '.'; p++, q++){
+	     *p && *p != '.' && *q && *q != '.'; p++, q++) {
 	    if (TOUPPER(*p) != TOUPPER(*q)) {
 		char *r;
+
 		strcpy(nodename, nn);
 		r = strchr(nodename, '.');	/* Mismatch */
 		if (r)
-		    *r = '\0';			/* Chop domain */
+		    *r = '\0';	/* Chop domain */
 		strcat(nodename, "::");		/* Try decnet anyway */
 		break;
 	    }
 	}
     }
 
-    second = strchr(filename+1, '/');		/* 2nd slash */
+    second = strchr(filename + 1, '/');		/* 2nd slash */
     last = strrchr(filename, '/');	/* last slash */
 
-    if (!second) {				/* Only one slash */
+    if (!second) {		/* Only one slash */
 	HTSprintf0(&vmsname, "%s%s", nodename, filename + 1);
-    } else if (second == last) {		/* Exactly two slashes */
+    } else if (second == last) {	/* Exactly two slashes */
 	*second = '\0';		/* Split filename from disk */
-	HTSprintf0(&vmsname, "%s%s:%s", nodename, filename+1, second+1);
-	*second = '/';	/* restore */
-    } else {				/* More than two slashes */
-	char * p;
+	HTSprintf0(&vmsname, "%s%s:%s", nodename, filename + 1, second + 1);
+	*second = '/';		/* restore */
+    } else {			/* More than two slashes */
+	char *p;
+
 	*second = '\0';		/* Split disk from directories */
 	*last = '\0';		/* Split dir from filename */
 	HTSprintf0(&vmsname, "%s%s:[%s]%s",
-		nodename, filename+1, second+1, last+1);
+		   nodename, filename + 1, second + 1, last + 1);
 	*second = *last = '/';	/* restore filename */
-	for (p = strchr(vmsname, '['); *p!=']'; p++)
+	for (p = strchr(vmsname, '['); *p != ']'; p++)
 	    if (*p == '/')
-		*p = '.';		/* Convert dir sep.  to dots */
+		*p = '.';	/* Convert dir sep.  to dots */
     }
     FREE(nodename);
     FREE(filename);
@@ -285,23 +285,25 @@ char * HTVMS_name (
 }
 
 /*	Procedure: Read a character from the data connection
-**	----------------------------------------------------
-*/
-static int next_data_char (void)
+ *	----------------------------------------------------
+ */
+static int next_data_char(void)
 {
     int status;
+
     if (data_read_pointer >= data_write_pointer) {
 	status = NETREAD(data_soc, data_buffer, DATA_BUFFER_SIZE);
-      if (status == HT_INTERRUPTED)
-	interrupted_in_next_data_char = 1;
-      if (status <= 0)
-	return -1;
-      data_write_pointer = data_buffer + status;
-      data_read_pointer = data_buffer;
+	if (status == HT_INTERRUPTED)
+	    interrupted_in_next_data_char = 1;
+	if (status <= 0)
+	    return -1;
+	data_write_pointer = data_buffer + status;
+	data_read_pointer = data_buffer;
     }
 #ifdef NOT_ASCII
     {
 	char c = *data_read_pointer++;
+
 	return FROMASCII(c);
     }
 #else
@@ -309,15 +311,14 @@ static int next_data_char (void)
 #endif /* NOT_ASCII */
 }
 
-
 /*	Close an individual connection
-**
-*/
-static int close_connection (
-	connection *	con)
+ *
+ */
+static int close_connection(connection * con)
 {
-    connection * scan;
+    connection *scan;
     int status;
+
     CTRACE((tfp, "HTFTP: Closing control socket %d\n", con->socket));
     status = NETCLOSE(con->socket);
     if (TRACE && status != 0) {
@@ -337,60 +338,58 @@ static int close_connection (
 	if (scan->next == con) {
 	    scan->next = con->next;	/* Unlink */
 	    if (control == con)
-		control = (connection*)0;
+		control = (connection *) 0;
 	    return status;
-	} /*if */
-    } /* for */
-    return -1;		/* very strange -- was not on list. */
+	}			/*if */
+    }				/* for */
+    return -1;			/* very strange -- was not on list. */
 }
 
-static char *help_message_buffer = NULL;  /* global :( */
+static char *help_message_buffer = NULL;	/* global :( */
 
-static void init_help_message_cache (void)
+static void init_help_message_cache(void)
 {
     FREE(help_message_buffer);
 }
 
-static void help_message_cache_add (
-	char *		string)
+static void help_message_cache_add(char *string)
 {
     if (help_message_buffer)
 	StrAllocCat(help_message_buffer, string);
     else
 	StrAllocCopy(help_message_buffer, string);
 
-    CTRACE((tfp,"Adding message to help cache: %s\n",string));
+    CTRACE((tfp, "Adding message to help cache: %s\n", string));
 }
 
-static char *help_message_cache_non_empty (void)
+static char *help_message_cache_non_empty(void)
 {
-  return(help_message_buffer);
+    return (help_message_buffer);
 }
 
-static char *help_message_cache_contents (void)
+static char *help_message_cache_contents(void)
 {
-   return(help_message_buffer);
+    return (help_message_buffer);
 }
 
 /*	Send One Command
-**	----------------
-**
-**	This function checks whether we have a control connection, and sends
-**	one command if given.
-**
-** On entry,
-**	control	points to the connection which is established.
-**	cmd	points to a command, or is zero to just get the response.
-**
-**	The command should already be terminated with the CRLF pair.
-**
-** On exit,
-**	returns:  1 for success,
-**		  or negative for communication failure (in which case
-**		  the control connection will be closed).
-*/
-static int write_cmd (
-	char *		cmd)
+ *	----------------
+ *
+ *	This function checks whether we have a control connection, and sends
+ *	one command if given.
+ *
+ * On entry,
+ *	control	points to the connection which is established.
+ *	cmd	points to a command, or is zero to just get the response.
+ *
+ *	The command should already be terminated with the CRLF pair.
+ *
+ * On exit,
+ *	returns:  1 for success,
+ *		  or negative for communication failure (in which case
+ *		  the control connection will be closed).
+ */
+static int write_cmd(char *cmd)
 {
     int status;
 
@@ -403,16 +402,18 @@ static int write_cmd (
 	CTRACE((tfp, "  Tx: %s", cmd));
 #ifdef NOT_ASCII
 	{
-	    char * p;
+	    char *p;
+
 	    for (p = cmd; *p; p++) {
 		*p = TOASCII(*p);
 	    }
 	}
 #endif /* NOT_ASCII */
-	status = NETWRITE(control->socket, cmd, (int)strlen(cmd));
+	status = NETWRITE(control->socket, cmd, (int) strlen(cmd));
 	if (status < 0) {
-	    CTRACE((tfp, "HTFTP: Error %d sending command: closing socket %d\n",
-			status, control->socket));
+	    CTRACE((tfp,
+		    "HTFTP: Error %d sending command: closing socket %d\n",
+		    status, control->socket));
 	    close_connection(control);
 	    return status;
 	}
@@ -421,30 +422,29 @@ static int write_cmd (
 }
 
 /*	Execute Command and get Response
-**	--------------------------------
-**
-**	See the state machine illustrated in RFC959, p57. This implements
-**	one command/reply sequence.  It also interprets lines which are to
-**	be continued, which are marked with a "-" immediately after the
-**	status code.
-**
-**	Continuation then goes on until a line with a matching reply code
-**	an a space after it.
-**
-** On entry,
-**	control	points to the connection which is established.
-**	cmd	points to a command, or is zero to just get the response.
-**
-**	The command must already be terminated with the CRLF pair.
-**
-** On exit,
-**	returns:  The first digit of the reply type,
-**		  or negative for communication failure.
-*/
-static int response (
-	char *		cmd)
+ *	--------------------------------
+ *
+ *	See the state machine illustrated in RFC959, p57. This implements
+ *	one command/reply sequence.  It also interprets lines which are to
+ *	be continued, which are marked with a "-" immediately after the
+ *	status code.
+ *
+ *	Continuation then goes on until a line with a matching reply code
+ *	an a space after it.
+ *
+ * On entry,
+ *	control	points to the connection which is established.
+ *	cmd	points to a command, or is zero to just get the response.
+ *
+ *	The command must already be terminated with the CRLF pair.
+ *
+ * On exit,
+ *	returns:  The first digit of the reply type,
+ *		  or negative for communication failure.
+ */
+static int response(char *cmd)
 {
-    int result;				/* Three-digit decimal code */
+    int result;			/* Three-digit decimal code */
     int continuation_response = -1;
     int status;
 
@@ -453,37 +453,40 @@ static int response (
 
     do {
 	char *p = response_text;
+
 	for (;;) {
 	    int ich = NEXT_CHAR;
+
 	    if (((*p++ = (char) ich) == LF)
-			|| (p == &response_text[LINE_LENGTH])) {
+		|| (p == &response_text[LINE_LENGTH])) {
 
 		char continuation;
 
 		if (interrupted_in_htgetcharacter) {
-		    CTRACE((tfp, "HTFTP: Interrupted in HTGetCharacter, apparently.\n"));
-		    NETCLOSE (control->socket);
+		    CTRACE((tfp,
+			    "HTFTP: Interrupted in HTGetCharacter, apparently.\n"));
+		    NETCLOSE(control->socket);
 		    control->socket = -1;
 		    return HT_INTERRUPTED;
 		}
 
-		*p = '\0';			/* Terminate the string */
+		*p = '\0';	/* Terminate the string */
 		CTRACE((tfp, "    Rx: %s", response_text));
 
 		/* Check for login or help messages */
-		if (!strncmp(response_text,"230-",4) ||
-		    !strncmp(response_text,"250-",4) ||
-		    !strncmp(response_text,"220-",4))
-		    help_message_cache_add(response_text+4);
+		if (!strncmp(response_text, "230-", 4) ||
+		    !strncmp(response_text, "250-", 4) ||
+		    !strncmp(response_text, "220-", 4))
+		    help_message_cache_add(response_text + 4);
 
 		sscanf(response_text, "%d%c", &result, &continuation);
-		if  (continuation_response == -1) {
-			if (continuation == '-')  /* start continuation */
-			    continuation_response = result;
+		if (continuation_response == -1) {
+		    if (continuation == '-')	/* start continuation */
+			continuation_response = result;
 		} else {	/* continuing */
-			if (continuation_response == result &&
-			    continuation == ' ')
-			    continuation_response = -1; /* ended */
+		    if (continuation_response == result &&
+			continuation == ' ')
+			continuation_response = -1;	/* ended */
 		}
 #ifdef BROKEN_PROFTPD
 		if (result == 220 && LYstrstr(response_text, "ProFTPD 1.2.5")) {
@@ -492,29 +495,30 @@ static int response (
 		}
 #endif
 		break;
-	    } /* if end of line */
-
+	    }
+	    /* if end of line */
 	    if (interrupted_in_htgetcharacter) {
-		CTRACE((tfp, "HTFTP: Interrupted in HTGetCharacter, apparently.\n"));
-		NETCLOSE (control->socket);
+		CTRACE((tfp,
+			"HTFTP: Interrupted in HTGetCharacter, apparently.\n"));
+		NETCLOSE(control->socket);
 		control->socket = -1;
 		return HT_INTERRUPTED;
 	    }
 
 	    if (ich == EOF) {
 		CTRACE((tfp, "Error on rx: closing socket %d\n",
-			    control->socket));
+			control->socket));
 		strcpy(response_text, "000 *** TCP read error on response\n");
 		close_connection(control);
 		return -1;	/* End of file on response */
 	    }
-	} /* Loop over characters */
+	}			/* Loop over characters */
 
     } while (continuation_response != -1);
 
     if (result == 421) {
 	CTRACE((tfp, "HTFTP: They close so we close socket %d\n",
-		    control->socket));
+		control->socket));
 	close_connection(control);
 	return -1;
     }
@@ -522,28 +526,28 @@ static int response (
 	(0 == strncasecomp(cmd, "CWD", 3) ||
 	 0 == strcasecomp(cmd, "CDUP"))) {
 	/*
-	**  Alas, CMS returns 255 on failure to CWD to parent of root. - PG
-	*/
+	 * Alas, CMS returns 255 on failure to CWD to parent of root.  - PG
+	 */
 	result = 555;
     }
-    return result/100;
+    return result / 100;
 }
 
-static int send_cmd_1 (char *  verb)
+static int send_cmd_1(char *verb)
 {
     char command[80];
 
-    sprintf(command, "%.*s%c%c", (int) sizeof(command)-4, verb, CR, LF);
-    return response (command);
+    sprintf(command, "%.*s%c%c", (int) sizeof(command) - 4, verb, CR, LF);
+    return response(command);
 }
 
-static int send_cmd_2 (char *  verb, char *  param)
+static int send_cmd_2(char *verb, char *param)
 {
     char *command = 0;
     int status;
 
     HTSprintf0(&command, "%s %s%c%c", verb, param, CR, LF);
-    status = response (command);
+    status = response(command);
     FREE(command);
 
     return status;
@@ -552,21 +556,20 @@ static int send_cmd_2 (char *  verb, char *  param)
 #define send_cwd(path) send_cmd_2("CWD", path)
 
 /*
- *  This function should try to set the macintosh server into binary mode.
- *  Some servers need an additional letter after the MACB command.
+ * This function should try to set the macintosh server into binary mode.  Some
+ * servers need an additional letter after the MACB command.
  */
-static int set_mac_binary (
-	eServerType	ServerType)
+static int set_mac_binary(eServerType ServerType)
 {
     /* try to set mac binary mode */
     if (ServerType == APPLESHARE_SERVER ||
 	ServerType == NETPRESENZ_SERVER) {
 	/*
-	 *  Presumably E means "Enable".  - KW
+	 * Presumably E means "Enable".  - KW
 	 */
-	return(2 == response("MACB E\r\n"));
+	return (2 == response("MACB E\r\n"));
     } else {
-	return(2 == response("MACB\r\n"));
+	return (2 == response("MACB\r\n"));
     }
 }
 
@@ -574,26 +577,26 @@ static int set_mac_binary (
  * determine what kind of host it is
  */
 
-static void get_ftp_pwd (
-	eServerType *	ServerType,
-	BOOLEAN *	UseList)
+static void get_ftp_pwd(eServerType *ServerType, BOOLEAN *UseList)
 {
 
     char *cp;
+
     /* get the working directory (to see what it looks like) */
     int status = response("PWD\r\n");
+
     if (status < 0) {
 	return;
     } else {
-	cp = strchr(response_text+5,'"');
+	cp = strchr(response_text + 5, '"');
 	if (cp)
 	    *cp = '\0';
 	if (*ServerType == TCPC_SERVER) {
 	    *ServerType = ((response_text[5] == '/') ?
-					  NCSA_SERVER : TCPC_SERVER);
+			   NCSA_SERVER : TCPC_SERVER);
 	    CTRACE((tfp, "HTFTP: Treating as %s server.\n",
-			 ((*ServerType == NCSA_SERVER) ?
-						 "NCSA" : "TCPC")));
+		    ((*ServerType == NCSA_SERVER) ?
+		     "NCSA" : "TCPC")));
 	} else if (response_text[5] == '/') {
 	    /* path names beginning with / imply Unix,
 	     * right?
@@ -602,12 +605,12 @@ static void get_ftp_pwd (
 		*ServerType = NCSA_SERVER;
 		CTRACE((tfp, "HTFTP: Treating as NCSA server.\n"));
 	    } else {
-		 *ServerType = UNIX_SERVER;
-		 *UseList = TRUE;
-		 CTRACE((tfp, "HTFTP: Treating as Unix server.\n"));
+		*ServerType = UNIX_SERVER;
+		*UseList = TRUE;
+		CTRACE((tfp, "HTFTP: Treating as Unix server.\n"));
 	    }
 	    return;
-	} else if (response_text[strlen(response_text)-1] == ']') {
+	} else if (response_text[strlen(response_text) - 1] == ']') {
 	    /* path names ending with ] imply VMS, right? */
 	    *ServerType = VMS_SERVER;
 	    *UseList = TRUE;
@@ -629,17 +632,17 @@ static void get_ftp_pwd (
  * Windows NT servers.
  */
 
-static void set_unix_dirstyle (
-	eServerType *	ServerType,
-	BOOLEAN *	UseList)
+static void set_unix_dirstyle(eServerType *ServerType, BOOLEAN *UseList)
 {
 
     char *cp;
+
     /* This is a toggle.  It seems we have to toggle in order to see
      * the current state (after toggling), so we may end up toggling
      * twice.  - kw
      */
     int status = response("SITE DIRSTYLE\r\n");
+
     if (status != 2) {
 	*ServerType = GENERIC_SERVER;
 	CTRACE((tfp, "HTFTP: DIRSTYLE failed, treating as Generic server.\n"));
@@ -655,7 +658,7 @@ static void set_unix_dirstyle (
 	 * anyway, under the assumption that it's more likely that
 	 * the MSDOS setting was "off" originally. - kw
 	 */
-	cp = strstr(response_text+4, "MSDOS");
+	cp = strstr(response_text + 4, "MSDOS");
 	if (cp && strstr(cp, " off")) {
 	    return;		/* already off now. */
 	} else {
@@ -665,35 +668,34 @@ static void set_unix_dirstyle (
 }
 
 /*	Get a valid connection to the host
-**	----------------------------------
-**
-** On entry,
-**	arg	points to the name of the host in a hypertext address
-** On exit,
-**	returns <0 if error
-**		socket number if success
-**
-**	This routine takes care of managing timed-out connections, and
-**	limiting the number of connections in use at any one time.
-**
-**	It ensures that all connections are logged in if they exist.
-**	It ensures they have the port number transferred.
-*/
-static int get_connection (
-	const char *		arg,
-	HTParentAnchor *	anchor)
+ *	----------------------------------
+ *
+ * On entry,
+ *	arg	points to the name of the host in a hypertext address
+ * On exit,
+ *	returns <0 if error
+ *		socket number if success
+ *
+ *	This routine takes care of managing timed-out connections, and
+ *	limiting the number of connections in use at any one time.
+ *
+ *	It ensures that all connections are logged in if they exist.
+ *	It ensures they have the port number transferred.
+ */
+static int get_connection(const char *arg,
+			  HTParentAnchor *anchor)
 {
     int status;
-    char * command = 0;
-    connection * con;
-    char * username = NULL;
-    char * password = NULL;
+    char *command = 0;
+    connection *con;
+    char *username = NULL;
+    char *password = NULL;
     static BOOLEAN firstuse = TRUE;
 
     if (firstuse) {
 	/*
-	**  Set up freeing at exit. - FM
-	*/
+	 * Set up freeing at exit.  - FM
+	 */
 #ifdef LY_FIND_LEAKS
 	atexit(free_FTPGlobals);
 #endif
@@ -702,8 +704,8 @@ static int get_connection (
 
     if (control) {
 	/*
-	**  Reuse this object - KW, DW & FM
-	*/
+	 * Reuse this object - KW, DW & FM
+	 */
 	if (control->socket != -1) {
 	    NETCLOSE(control->socket);
 	}
@@ -712,16 +714,18 @@ static int get_connection (
 	con->binary = FALSE;
     } else {
 	/*
-	**  Allocate and init control struct.
-	*/
+	 * Allocate and init control struct.
+	 */
 	con = typecalloc(connection);
 	if (con == NULL)
 	    outofmem(__FILE__, "get_connection");
     }
     con->socket = -1;
 
-    if (!arg) return -1;		/* Bad if no name specified	*/
-    if (!*arg) return -1;		/* Bad if name had zero length	*/
+    if (!arg)
+	return -1;		/* Bad if no name specified     */
+    if (!*arg)
+	return -1;		/* Bad if name had zero length  */
 
 /* Get node name:
 */
@@ -729,12 +733,12 @@ static int get_connection (
     {
 	char *p1 = HTParse(arg, "", PARSE_HOST);
 	char *p2 = strrchr(p1, '@');	/* user? */
-	char * pw = NULL;
+	char *pw = NULL;
 
 	if (p2 != NULL) {
 	    username = p1;
-	    *p2 = '\0';			/* terminate */
-	    p1 = p2+1;			/* point to host */
+	    *p2 = '\0';		/* terminate */
+	    p1 = p2 + 1;	/* point to host */
 	    pw = strchr(username, ':');
 	    if (pw != NULL) {
 		*pw++ = '\0';
@@ -744,19 +748,18 @@ static int get_connection (
 		HTUnEscape(username);
 
 	    /*
-	     *	If the password doesn't exist then we are going to have
-	     *	to ask the user for it.  The only problem is that we
-	     *	don't want to ask for it every time, so we will store
-	     *	away in a primitive fashion.
+	     * If the password doesn't exist then we are going to have to ask
+	     * the user for it.  The only problem is that we don't want to ask
+	     * for it every time, so we will store away in a primitive fashion.
 	     */
 	    if (!password) {
 		char *tmp = NULL;
 
 		HTSprintf0(&tmp, "%s@%s", username, p1);
 		/*
-		 *  If the user@host is not equal to the last time through
-		 *  or user_entered_password has no data then we need
-		 *  to ask the user for the password.
+		 * If the user@host is not equal to the last time through or
+		 * user_entered_password has no data then we need to ask the
+		 * user for the password.
 		 */
 		if (!last_username_and_host ||
 		    strcmp(tmp, last_username_and_host) ||
@@ -764,11 +767,11 @@ static int get_connection (
 
 		    StrAllocCopy(last_username_and_host, tmp);
 		    HTSprintf0(&tmp, gettext("Enter password for user %s@%s:"),
-				     username, p1);
+			       username, p1);
 		    FREE(user_entered_password);
 		    user_entered_password = HTPromptPassword(tmp);
 
-		} /* else we already know the password */
+		}		/* else we already know the password */
 		password = user_entered_password;
 		FREE(tmp);
 	    }
@@ -776,51 +779,49 @@ static int get_connection (
 
 	if (!username)
 	    FREE(p1);
-    } /* scope of p1 */
+    }				/* scope of p1 */
 
-    status = HTDoConnect (arg, "FTP", IPPORT_FTP, (int *)&con->socket);
+    status = HTDoConnect(arg, "FTP", IPPORT_FTP, (int *) &con->socket);
 
     if (status < 0) {
 	if (status == HT_INTERRUPTED) {
 	    CTRACE((tfp, "HTFTP: Interrupted on connect\n"));
 	} else {
 	    CTRACE((tfp, "HTFTP: Unable to connect to remote host for `%s'.\n",
-			arg));
+		    arg));
 	}
 	if (status == HT_INTERRUPTED) {
-	    _HTProgress (CONNECTION_INTERRUPTED);
+	    _HTProgress(CONNECTION_INTERRUPTED);
 	    status = HT_NOT_LOADED;
 	} else {
 	    HTAlert(gettext("Unable to connect to FTP host."));
 	}
-	if (con->socket != -1)
-	{
-	  NETCLOSE(con->socket);
+	if (con->socket != -1) {
+	    NETCLOSE(con->socket);
 	}
 
 	FREE(username);
 	if (control == con)
 	    control = NULL;
 	FREE(con);
-	return status;			/* Bad return */
+	return status;		/* Bad return */
     }
 
     CTRACE((tfp, "FTP connected, socket %d  control %p\n",
-		con->socket, con));
+	    con->socket, con));
     control = con;		/* Current control connection */
 
     /* Initialise buffering for control connection */
     HTInitInput(control->socket);
     init_help_message_cache();	/* Clear the login message buffer. */
 
-
 /*	Now we log in		Look up username, prompt for pw.
 */
-    status = response((char *)0);	/* Get greeting */
+    status = response((char *) 0);	/* Get greeting */
 
     if (status == HT_INTERRUPTED) {
 	CTRACE((tfp, "HTFTP: Interrupted at beginning of login.\n"));
-	_HTProgress (CONNECTION_INTERRUPTED);
+	_HTProgress(CONNECTION_INTERRUPTED);
 	NETCLOSE(control->socket);
 	control->socket = -1;
 	return HT_INTERRUPTED;
@@ -849,7 +850,7 @@ static int get_connection (
 
 	if (status == HT_INTERRUPTED) {
 	    CTRACE((tfp, "HTFTP: Interrupted while sending username.\n"));
-	    _HTProgress (CONNECTION_INTERRUPTED);
+	    _HTProgress(CONNECTION_INTERRUPTED);
 	    NETCLOSE(control->socket);
 	    control->socket = -1;
 	    return HT_INTERRUPTED;
@@ -867,7 +868,7 @@ static int get_connection (
 	     */
 	    char *user = NULL;
 	    const char *host = NULL;
-	    char * cp;
+	    char *cp;
 
 	    if (personal_mail_address && *personal_mail_address) {
 		/*
@@ -875,7 +876,7 @@ static int get_connection (
 		 * mail address, so use that. - FM
 		 */
 		StrAllocCopy(user, personal_mail_address);
-		if ((cp=strchr(user, '@')) != NULL) {
+		if ((cp = strchr(user, '@')) != NULL) {
 		    *cp++ = '\0';
 		    host = cp;
 		} else {
@@ -885,7 +886,7 @@ static int get_connection (
 		/*
 		 * Use an environment variable and the host global. - FM
 		 */
-		if ((cp=LYGetEnv("USER")) != NULL)
+		if ((cp = LYGetEnv("USER")) != NULL)
 		    StrAllocCopy(user, cp);
 		else
 		    StrAllocCopy(user, "WWWuser");
@@ -906,7 +907,7 @@ static int get_connection (
 	FREE(command);
 	if (status == HT_INTERRUPTED) {
 	    CTRACE((tfp, "HTFTP: Interrupted while sending password.\n"));
-	    _HTProgress (CONNECTION_INTERRUPTED);
+	    _HTProgress(CONNECTION_INTERRUPTED);
 	    NETCLOSE(control->socket);
 	    control->socket = -1;
 	    return HT_INTERRUPTED;
@@ -918,7 +919,7 @@ static int get_connection (
 	status = send_cmd_1("ACCT noaccount");
 	if (status == HT_INTERRUPTED) {
 	    CTRACE((tfp, "HTFTP: Interrupted while sending password.\n"));
-	    _HTProgress (CONNECTION_INTERRUPTED);
+	    _HTProgress(CONNECTION_INTERRUPTED);
 	    NETCLOSE(control->socket);
 	    control->socket = -1;
 	    return HT_INTERRUPTED;
@@ -932,36 +933,37 @@ static int get_connection (
     }
     CTRACE((tfp, "HTFTP: Logged in.\n"));
 
-    /** Check for host type **/
+    /* Check for host type */
     if (server_type != NETPRESENZ_SERVER)
 	server_type = GENERIC_SERVER;	/* reset */
-    use_list = FALSE;			/* reset */
-    if ((status=response("SYST\r\n")) == 2) {
+    use_list = FALSE;		/* reset */
+    if ((status = response("SYST\r\n")) == 2) {
 	/* we got a line -- what kind of server are we talking to? */
-	if (strncmp(response_text+4,
+	if (strncmp(response_text + 4,
 		    "UNIX Type: L8 MAC-OS MachTen", 28) == 0) {
 	    server_type = MACHTEN_SERVER;
 	    use_list = TRUE;
 	    CTRACE((tfp, "HTFTP: Treating as MachTen server.\n"));
 
-	} else if (strstr(response_text+4, "UNIX") != NULL ||
-		   strstr(response_text+4, "Unix") != NULL) {
+	} else if (strstr(response_text + 4, "UNIX") != NULL ||
+		   strstr(response_text + 4, "Unix") != NULL) {
 	    server_type = UNIX_SERVER;
-	    unsure_type = FALSE; /* to the best of out knowledge... */
+	    unsure_type = FALSE;	/* to the best of out knowledge... */
 	    use_list = TRUE;
 	    CTRACE((tfp, "HTFTP: Treating as Unix server.\n"));
 
-	} else if (strstr(response_text+4, "MSDOS") != NULL) {
+	} else if (strstr(response_text + 4, "MSDOS") != NULL) {
 	    server_type = MSDOS_SERVER;
 	    use_list = TRUE;
 	    CTRACE((tfp, "HTFTP: Treating as MSDOS (Unix emulation) server.\n"));
 
-	} else if (strncmp(response_text+4, "VMS", 3) == 0) {
+	} else if (strncmp(response_text + 4, "VMS", 3) == 0) {
 	    char *tilde = strstr(arg, "/~");
+
 	    use_list = TRUE;
 	    if (tilde != 0
-	     && tilde[2] != 0
-	     && strstr(response_text+4, "MadGoat") != 0) {
+		&& tilde[2] != 0
+		&& strstr(response_text + 4, "MadGoat") != 0) {
 		server_type = UNIX_SERVER;
 		CTRACE((tfp, "HTFTP: Treating VMS as UNIX server.\n"));
 	    } else {
@@ -969,64 +971,64 @@ static int get_connection (
 		CTRACE((tfp, "HTFTP: Treating as VMS server.\n"));
 	    }
 
-	} else if ((strncmp(response_text+4, "VM/CMS", 6) == 0) ||
-		   (strncmp(response_text+4, "VM ", 3) == 0)) {
+	} else if ((strncmp(response_text + 4, "VM/CMS", 6) == 0) ||
+		   (strncmp(response_text + 4, "VM ", 3) == 0)) {
 	    server_type = CMS_SERVER;
 	    use_list = TRUE;
 	    CTRACE((tfp, "HTFTP: Treating as CMS server.\n"));
 
-	} else if (strncmp(response_text+4, "DCTS", 4) == 0) {
+	} else if (strncmp(response_text + 4, "DCTS", 4) == 0) {
 	    server_type = DCTS_SERVER;
 	    CTRACE((tfp, "HTFTP: Treating as DCTS server.\n"));
 
-	} else if (strstr(response_text+4, "MAC-OS TCP/Connect II") != NULL) {
+	} else if (strstr(response_text + 4, "MAC-OS TCP/Connect II") != NULL) {
 	    server_type = TCPC_SERVER;
 	    CTRACE((tfp, "HTFTP: Looks like a TCPC server.\n"));
 	    get_ftp_pwd(&server_type, &use_list);
 	    unsure_type = TRUE;
 
-	} else if (server_type == NETPRESENZ_SERVER) { /* already set above */
+	} else if (server_type == NETPRESENZ_SERVER) {	/* already set above */
 	    use_list = TRUE;
 	    set_mac_binary(server_type);
 	    CTRACE((tfp, "HTFTP: Treating as NetPresenz (MACOS) server.\n"));
 
-	} else if (strncmp(response_text+4, "MACOS Peter's Server", 20) == 0) {
+	} else if (strncmp(response_text + 4, "MACOS Peter's Server", 20) == 0) {
 	    server_type = PETER_LEWIS_SERVER;
 	    use_list = TRUE;
 	    set_mac_binary(server_type);
 	    CTRACE((tfp, "HTFTP: Treating as Peter Lewis (MACOS) server.\n"));
 
-	} else if (strncmp(response_text+4, "Windows_NT", 10) == 0) {
+	} else if (strncmp(response_text + 4, "Windows_NT", 10) == 0) {
 	    server_type = WINDOWS_NT_SERVER;
 	    CTRACE((tfp, "HTFTP: Treating as Window_NT server.\n"));
 	    set_unix_dirstyle(&server_type, &use_list);
 
-	} else if (strncmp(response_text+4, "Windows2000", 11) == 0) {
+	} else if (strncmp(response_text + 4, "Windows2000", 11) == 0) {
 	    server_type = WINDOWS_2K_SERVER;
 	    CTRACE((tfp, "HTFTP: Treating as Window_2K server.\n"));
 	    set_unix_dirstyle(&server_type, &use_list);
 
-	} else if (strncmp(response_text+4, "MS Windows", 10) == 0) {
+	} else if (strncmp(response_text + 4, "MS Windows", 10) == 0) {
 	    server_type = MS_WINDOWS_SERVER;
 	    use_list = TRUE;
 	    CTRACE((tfp, "HTFTP: Treating as MS Windows server.\n"));
 
-	} else if (strncmp(response_text+4,
+	} else if (strncmp(response_text + 4,
 			   "MACOS AppleShare IP FTP Server", 30) == 0) {
 	    server_type = APPLESHARE_SERVER;
 	    use_list = TRUE;
 	    set_mac_binary(server_type);
 	    CTRACE((tfp, "HTFTP: Treating as AppleShare server.\n"));
 
-	} else	{
+	} else {
 	    server_type = GENERIC_SERVER;
 	    CTRACE((tfp, "HTFTP: Ugh!  A Generic server.\n"));
 	    get_ftp_pwd(&server_type, &use_list);
 	    unsure_type = TRUE;
-	 }
+	}
     } else {
 	/* SYST fails :(  try to get the type from the PWD command */
-	 get_ftp_pwd(&server_type, &use_list);
+	get_ftp_pwd(&server_type, &use_list);
     }
 
 /*  Now we inform the server of the port number we will listen on
@@ -1034,24 +1036,24 @@ static int get_connection (
 #ifdef NOTREPEAT_PORT
     {
 	int status = response(port_command);
+
 	if (status != 2) {
 	    if (control->socket)
 		close_connection(control->socket);
-	    return -status;		/* Bad return */
+	    return -status;	/* Bad return */
 	}
 	CTRACE((tfp, "HTFTP: Port defined.\n"));
     }
 #endif /* NOTREPEAT_PORT */
-    return con->socket;			/* Good return */
+    return con->socket;		/* Good return */
 }
 
-
 /*	Close Master (listening) socket
-**	-------------------------------
-**
-**
-*/
-static int close_master_socket (void)
+ *	-------------------------------
+ *
+ *
+ */
+static int close_master_socket(void)
 {
     int status;
 
@@ -1066,51 +1068,50 @@ static int close_master_socket (void)
 	return status;
 }
 
-
 /*	Open a master socket for listening on
-**	-------------------------------------
-**
-**	When data is transferred, we open a port, and wait for the server to
-**	connect with the data.
-**
-** On entry,
-**	master_socket	Must be negative if not set up already.
-** On exit,
-**	Returns		socket number if good
-**			less than zero if error.
-**	master_socket	is socket number if good, else negative.
-**	port_number	is valid if good.
-*/
-static int get_listen_socket (void)
+ *	-------------------------------------
+ *
+ *	When data is transferred, we open a port, and wait for the server to
+ *	connect with the data.
+ *
+ * On entry,
+ *	master_socket	Must be negative if not set up already.
+ * On exit,
+ *	Returns		socket number if good
+ *			less than zero if error.
+ *	master_socket	is socket number if good, else negative.
+ *	port_number	is valid if good.
+ */
+static int get_listen_socket(void)
 {
 #ifdef INET6
     struct sockaddr_storage soc_address;	/* Binary network address */
-    struct sockaddr_in* soc_in = (struct sockaddr_in *)&soc_address;
+    struct sockaddr_in *soc_in = (struct sockaddr_in *) &soc_address;
     int af;
     int slen;
+
 #else
     struct sockaddr_in soc_address;	/* Binary network address */
-    struct sockaddr_in* soc_in = &soc_address;
+    struct sockaddr_in *soc_in = &soc_address;
 #endif /* INET6 */
-    int new_socket;			/* Will be master_socket */
-
+    int new_socket;		/* Will be master_socket */
 
     FD_ZERO(&open_sockets);	/* Clear our record of open sockets */
     num_sockets = 0;
 
 #ifndef REPEAT_LISTEN
     if (master_socket >= 0)
-	return master_socket;  /* Done already */
+	return master_socket;	/* Done already */
 #endif /* !REPEAT_LISTEN */
 
 #ifdef INET6
     /* query address family of control connection */
     slen = sizeof(soc_address);
-    if (getsockname(control->socket, (struct sockaddr *)&soc_address,
-		&slen) < 0) {
+    if (getsockname(control->socket, (struct sockaddr *) &soc_address,
+		    &slen) < 0) {
 	return HTInetStatus("getsockname failed");
     }
-    af = ((struct sockaddr *)&soc_address)->sa_family;
+    af = ((struct sockaddr *) &soc_address)->sa_family;
     memset(&soc_address, 0, sizeof(soc_address));
 #endif /* INET6 */
 
@@ -1131,30 +1132,32 @@ static int get_listen_socket (void)
 */
 #ifdef INET6
     memset(&soc_address, 0, sizeof(soc_address));
-    ((struct sockaddr *)&soc_address)->sa_family = af;
+    ((struct sockaddr *) &soc_address)->sa_family = af;
     switch (af) {
     case AF_INET:
 #ifdef SIN6_LEN
-	((struct sockaddr *)&soc_address)->sa_len = sizeof(struct sockaddr_in);
+	((struct sockaddr *) &soc_address)->sa_len = sizeof(struct sockaddr_in);
 #endif /* SIN6_LEN */
 	break;
     case AF_INET6:
 #ifdef SIN6_LEN
-	((struct sockaddr *)&soc_address)->sa_len = sizeof(struct sockaddr_in6);
+	((struct sockaddr *) &soc_address)->sa_len = sizeof(struct sockaddr_in6);
 #endif /* SIN6_LEN */
 	break;
     default:
 	HTInetStatus("AF");
     }
 #else
-    soc_in->sin_family = AF_INET;	    /* Family = internet, host order  */
-    soc_in->sin_addr.s_addr = INADDR_ANY;   /* Any peer address */
+    soc_in->sin_family = AF_INET;	/* Family = internet, host order  */
+    soc_in->sin_addr.s_addr = INADDR_ANY;	/* Any peer address */
 #endif /* INET6 */
 #ifdef POLL_PORTS
     {
 	PortNumber old_port_number = port_number;
-	for (port_number = (old_port_number+1); ; port_number++) {
+
+	for (port_number = (old_port_number + 1);; port_number++) {
 	    int status;
+
 	    if (port_number > LAST_TCP_PORT)
 		port_number = FIRST_TCP_PORT;
 	    if (port_number == old_port_number) {
@@ -1167,100 +1170,104 @@ static int get_listen_socket (void)
 #endif /* INET6 */
 #ifdef SOCKS
 	    if (socks_flag)
-		if ((status=Rbind(new_socket,
-			(struct sockaddr*)&soc_address,
-			    /* Cast to generic sockaddr */
-			SOCKADDR_LEN(soc_address)
+		if ((status = Rbind(new_socket,
+				    (struct sockaddr *) &soc_address,
+		/* Cast to generic sockaddr */
+				    SOCKADDR_LEN(soc_address)
 #ifndef SHORTENED_RBIND
-			,socks_bind_remoteAddr
+				    ,socks_bind_remoteAddr
 #endif /* !SHORTENED_RBIND */
-						)) == 0) {
+		     )) == 0) {
 		    break;
 		} else
 #endif /* SOCKS */
-	    if ((status=bind(new_socket,
-		    (struct sockaddr*)&soc_address,
-			    /* Cast to generic sockaddr */
-		    SOCKADDR_LEN(soc_address)
-		    )) == 0) {
-		break;
-	    }
+		    if ((status = bind(new_socket,
+				       (struct sockaddr *) &soc_address,
+		    /* Cast to generic sockaddr */
+				       SOCKADDR_LEN(soc_address)
+			 )) == 0) {
+		    break;
+		}
 	    CTRACE((tfp, "TCP bind attempt to port %d yields %d, errno=%d\n",
-		port_number, status, SOCKET_ERRNO));
-	} /* for */
+		    port_number, status, SOCKET_ERRNO));
+	}			/* for */
     }
 #else
     {
 	int status;
 	int address_length = sizeof(soc_address);
+
 #ifdef SOCKS
 	if (socks_flag)
 	    status = Rgetsockname(control->socket,
-				  (struct sockaddr *)&soc_address,
-				  (void *)&address_length);
+				  (struct sockaddr *) &soc_address,
+				  (void *) &address_length);
 	else
 #endif /* SOCKS */
-	status = getsockname(control->socket,
-			     (struct sockaddr *)&soc_address,
-			     (void *)&address_length);
-	if (status<0) return HTInetStatus("getsockname");
+	    status = getsockname(control->socket,
+				 (struct sockaddr *) &soc_address,
+				 (void *) &address_length);
+	if (status < 0)
+	    return HTInetStatus("getsockname");
 #ifdef INET6
 	CTRACE((tfp, "HTFTP: This host is %s\n",
-	    HTInetString((SockA *)soc_in)));
+		HTInetString((SockA *) soc_in)));
 
 	soc_in->sin_port = 0;	/* Unspecified: please allocate */
 #else
 	CTRACE((tfp, "HTFTP: This host is %s\n",
-	    HTInetString(soc_in)));
+		HTInetString(soc_in)));
 
 	soc_address.sin_port = 0;	/* Unspecified: please allocate */
 #endif /* INET6 */
 #ifdef SOCKS
 	if (socks_flag)
-	    status=Rbind(new_socket,
-			 (struct sockaddr*)&soc_address,
-			 /* Cast to generic sockaddr */
-			 sizeof(soc_address)
+	    status = Rbind(new_socket,
+			   (struct sockaddr *) &soc_address,
+	    /* Cast to generic sockaddr */
+			   sizeof(soc_address)
 #ifndef SHORTENED_RBIND
 #ifdef INET6
-			socks_bind_remoteAddr
+			   socks_bind_remoteAddr
 #else
-			,socks_bind_remoteAddr
+			   ,socks_bind_remoteAddr
 #endif /* INET6 */
 #endif /* !SHORTENED_RBIND */
-						);
+		);
 	else
 #endif /* SOCKS */
-	status=bind(new_socket,
-		    (struct sockaddr*)&soc_address,
-		    /* Cast to generic sockaddr */
-		    SOCKADDR_LEN(soc_address)
-		    );
-	if (status<0) return HTInetStatus("bind");
+	    status = bind(new_socket,
+			  (struct sockaddr *) &soc_address,
+	    /* Cast to generic sockaddr */
+			  SOCKADDR_LEN(soc_address)
+		);
+	if (status < 0)
+	    return HTInetStatus("bind");
 
 	address_length = sizeof(soc_address);
 #ifdef SOCKS
 	if (socks_flag)
 	    status = Rgetsockname(new_socket,
-				  (struct sockaddr*)&soc_address,
-				  (void *)&address_length);
+				  (struct sockaddr *) &soc_address,
+				  (void *) &address_length);
 	else
 #endif /* SOCKS */
-	status = getsockname(new_socket,
-			     (struct sockaddr*)&soc_address,
-			     (void *)&address_length);
-	if (status<0) return HTInetStatus("getsockname");
+	    status = getsockname(new_socket,
+				 (struct sockaddr *) &soc_address,
+				 (void *) &address_length);
+	if (status < 0)
+	    return HTInetStatus("getsockname");
     }
 #endif /* POLL_PORTS */
 
 #ifdef INET6
     CTRACE((tfp, "HTFTP: bound to port %d on %s\n",
-		(int)ntohs(soc_in->sin_port),
-		HTInetString((SockA *)soc_in)));
+	    (int) ntohs(soc_in->sin_port),
+	    HTInetString((SockA *) soc_in)));
 #else
     CTRACE((tfp, "HTFTP: bound to port %d on %s\n",
-		(int)ntohs(soc_in->sin_port),
-		HTInetString(soc_in)));
+	    (int) ntohs(soc_in->sin_port),
+	    HTInetString(soc_in)));
 #endif /* INET6 */
 
 #ifdef REPEAT_LISTEN
@@ -1272,45 +1279,47 @@ static int get_listen_socket (void)
 
 /*	Now we must find out who we are to tell the other guy
 */
-    (void)HTHostName();		/* Make address valid - doesn't work*/
+    (void) HTHostName();	/* Make address valid - doesn't work */
 #ifdef INET6
-    switch (((struct sockaddr *)&soc_address)->sa_family) {
+    switch (((struct sockaddr *) &soc_address)->sa_family) {
     case AF_INET:
 #endif /* INET6 */
 	sprintf(port_command, "PORT %d,%d,%d,%d,%d,%d%c%c",
-		    (int)*((unsigned char *)(&soc_in->sin_addr)+0),
-		    (int)*((unsigned char *)(&soc_in->sin_addr)+1),
-		    (int)*((unsigned char *)(&soc_in->sin_addr)+2),
-		    (int)*((unsigned char *)(&soc_in->sin_addr)+3),
-		    (int)*((unsigned char *)(&soc_in->sin_port)+0),
-		    (int)*((unsigned char *)(&soc_in->sin_port)+1),
-		    CR, LF);
+		(int) *((unsigned char *) (&soc_in->sin_addr) + 0),
+		(int) *((unsigned char *) (&soc_in->sin_addr) + 1),
+		(int) *((unsigned char *) (&soc_in->sin_addr) + 2),
+		(int) *((unsigned char *) (&soc_in->sin_addr) + 3),
+		(int) *((unsigned char *) (&soc_in->sin_port) + 0),
+		(int) *((unsigned char *) (&soc_in->sin_port) + 1),
+		CR, LF);
 
 #ifdef INET6
 	break;
 
     case AF_INET6:
-      {
-	char hostbuf[MAXHOSTNAMELEN];
-	char portbuf[MAXHOSTNAMELEN];
-	getnameinfo((struct sockaddr *)&soc_address,
-	    SOCKADDR_LEN(soc_address),
-	    hostbuf, sizeof(hostbuf), portbuf, sizeof(portbuf),
-	    NI_NUMERICHOST | NI_NUMERICSERV);
-	sprintf(port_command, "EPRT |%d|%s|%s|%c%c", 2, hostbuf, portbuf,
-		CR, LF);
-	break;
-      }
+	{
+	    char hostbuf[MAXHOSTNAMELEN];
+	    char portbuf[MAXHOSTNAMELEN];
+
+	    getnameinfo((struct sockaddr *) &soc_address,
+			SOCKADDR_LEN(soc_address),
+			hostbuf, sizeof(hostbuf), portbuf, sizeof(portbuf),
+			NI_NUMERICHOST | NI_NUMERICSERV);
+	    sprintf(port_command, "EPRT |%d|%s|%s|%c%c", 2, hostbuf, portbuf,
+		    CR, LF);
+	    break;
+	}
     default:
 	sprintf(port_command, "JUNK%c%c", CR, LF);
 	break;
     }
 #endif /* INET6 */
 
-    /*	Inform TCP that we will accept connections
-    */
+    /*  Inform TCP that we will accept connections
+     */
     {
 	int status;
+
 #ifdef SOCKS
 	if (socks_flag)
 	    status = Rlisten(master_socket, 1);
@@ -1324,40 +1333,42 @@ static int get_listen_socket (void)
     }
     CTRACE((tfp, "TCP: Master socket(), bind() and listen() all OK\n"));
     FD_SET(master_socket, &open_sockets);
-    if ((master_socket+1) > num_sockets)
-	num_sockets = master_socket+1;
+    if ((master_socket + 1) > num_sockets)
+	num_sockets = master_socket + 1;
 
-    return master_socket;		/* Good */
+    return master_socket;	/* Good */
 
-} /* get_listen_socket */
+}				/* get_listen_socket */
 
-static char * months[12] = {
-    "Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"
+static char *months[12] =
+{
+    "Jan", "Feb", "Mar", "Apr", "May", "Jun",
+    "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
 };
 
 /*	Procedure: Set the current and last year strings and date integer
-**	-----------------------------------------------------------------
-**
-**	Bug:
-**		This code is for sorting listings by date, if that option
-**		is selected in Lynx, and doesn't take into account time
-**		zones or ensure resetting at midnight, so the sort may not
-**		be perfect, but the actual date isn't changed in the display,
-**		i.e., the date is still correct. - FM
-*/
-static void set_years_and_date (void)
+ *	-----------------------------------------------------------------
+ *
+ *	Bug:
+ *		This code is for sorting listings by date, if that option
+ *		is selected in Lynx, and doesn't take into account time
+ *		zones or ensure resetting at midnight, so the sort may not
+ *		be perfect, but the actual date isn't changed in the display,
+ *		i.e., the date is still correct. - FM
+ */
+static void set_years_and_date(void)
 {
     char day[8], month[8], date[12];
     time_t NowTime;
     int i;
 
     NowTime = time(NULL);
-    strncpy(day, (char *)ctime(&NowTime)+8, 2);
+    strncpy(day, (char *) ctime(&NowTime) + 8, 2);
     day[2] = '\0';
     if (day[0] == ' ') {
 	day[0] = '0';
     }
-    strncpy(month, (char *)ctime(&NowTime)+4, 3);
+    strncpy(month, (char *) ctime(&NowTime) + 4, 3);
     month[3] = '\0';
     for (i = 0; i < 12; i++) {
 	if (!strcasecomp(month, months[i])) {
@@ -1367,29 +1378,28 @@ static void set_years_and_date (void)
     i++;
     sprintf(date, "9999%02d%.2s", i, day);
     TheDate = atoi(date);
-    strcpy(ThisYear, (char *)ctime(&NowTime)+20);
+    strcpy(ThisYear, (char *) ctime(&NowTime) + 20);
     ThisYear[4] = '\0';
     sprintf(LastYear, "%d", (atoi(ThisYear) - 1));
     HaveYears = TRUE;
 }
 
 typedef struct _EntryInfo {
-    char *	 filename;
-    char *	 type;
-    char *	 date;
+    char *filename;
+    char *type;
+    char *date;
     unsigned int size;
-    BOOLEAN	 display;  /* show this entry? */
+    BOOLEAN display;		/* show this entry? */
 } EntryInfo;
 
-static void free_entryinfo_struct_contents (
-	EntryInfo *	entry_info)
+static void free_entryinfo_struct_contents(EntryInfo *entry_info)
 {
     if (entry_info) {
 	FREE(entry_info->filename);
 	FREE(entry_info->type);
 	FREE(entry_info->date);
     }
-   /* dont free the struct */
+    /* dont free the struct */
 }
 
 /*
@@ -1400,8 +1410,7 @@ static void free_entryinfo_struct_contents (
  *		"Dec 12 1989  " or
  *		"FCv 23 1990  " ...
  */
-static BOOLEAN is_ls_date (
-	char *		s)
+static BOOLEAN is_ls_date(char *s)
 {
     /* must start with three alpha characters */
     if (!isalpha(UCH(*s++)) || !isalpha(UCH(*s++)) || !isalpha(UCH(*s++)))
@@ -1463,90 +1472,91 @@ static BOOLEAN is_ls_date (
 	return FALSE;
 
     return TRUE;
-} /* is_ls_date() */
+}				/* is_ls_date() */
 
 /*
- *  parse_eplf_line() --
- *	Extract the name, size, and date from an EPLF line. - 08-06-96 DJB
+ * Extract the name, size, and date from an EPLF line.  - 08-06-96 DJB
  */
-static void parse_eplf_line (
-	char *		line,
-	EntryInfo *	info)
+static void parse_eplf_line(char *line,
+			    EntryInfo *info)
 {
     char *cp = line;
     char ct[26];
     unsigned long size;
     time_t secs;
-    static time_t base; /* time() value on this OS in 1970 */
+    static time_t base;		/* time() value on this OS in 1970 */
     static int flagbase = 0;
 
     if (!flagbase) {
 	struct tm t;
-	t.tm_year = 70; t.tm_mon = 0; t.tm_mday = 0;
-	t.tm_hour = 0; t.tm_min = 0; t.tm_sec = 0;
+
+	t.tm_year = 70;
+	t.tm_mon = 0;
+	t.tm_mday = 0;
+	t.tm_hour = 0;
+	t.tm_min = 0;
+	t.tm_sec = 0;
 	t.tm_isdst = -1;
-	base = mktime(&t); /* could return -1 */
+	base = mktime(&t);	/* could return -1 */
 	flagbase = 1;
     }
 
     while (*cp) {
-	switch(*cp) {
-	    case '\t':
-		StrAllocCopy(info->filename, cp + 1);
-		return;
-	    case 's':
-		size = 0;
-		while (*(++cp) && (*cp != ','))
-		    size = (size * 10) + (*cp - '0');
-		info->size = size;
-		break;
-	    case 'm':
-		secs = 0;
-		while (*(++cp) && (*cp != ','))
-		    secs = (secs * 10) + (*cp - '0');
-		secs += base; /* assumes that time_t is #seconds */
-		strcpy(ct, ctime(&secs));
-		ct[24] = 0;
-		StrAllocCopy(info->date, ct);
-		break;
-	    case '/':
-		StrAllocCopy(info->type, ENTRY_IS_DIRECTORY);
-		/* FALLTHRU */
-	    default:
-		while (*cp) {
-		    if (*cp++ == ',')
-		      break;
-		}
-		break;
+	switch (*cp) {
+	case '\t':
+	    StrAllocCopy(info->filename, cp + 1);
+	    return;
+	case 's':
+	    size = 0;
+	    while (*(++cp) && (*cp != ','))
+		size = (size * 10) + (*cp - '0');
+	    info->size = size;
+	    break;
+	case 'm':
+	    secs = 0;
+	    while (*(++cp) && (*cp != ','))
+		secs = (secs * 10) + (*cp - '0');
+	    secs += base;	/* assumes that time_t is #seconds */
+	    strcpy(ct, ctime(&secs));
+	    ct[24] = 0;
+	    StrAllocCopy(info->date, ct);
+	    break;
+	case '/':
+	    StrAllocCopy(info->type, ENTRY_IS_DIRECTORY);
+	    /* FALLTHRU */
+	default:
+	    while (*cp) {
+		if (*cp++ == ',')
+		    break;
+	    }
+	    break;
 	}
     }
-} /* parse_eplf_line */
+}				/* parse_eplf_line */
 
 /*
- * parse_ls_line() --
- *	Extract the name, size, and date from an ls -l line.
+ * Extract the name, size, and date from an ls -l line.
  */
-static void parse_ls_line (
-	char *		line,
-	EntryInfo *	entry_info)
+static void parse_ls_line(char *line,
+			  EntryInfo *entry_info)
 {
-    int    i, j;
-    int    base=1;
-    int    size_num=0;
+    int i, j;
+    int base = 1;
+    int size_num = 0;
 
     for (i = strlen(line) - 1;
-	 (i > 13) && (!isspace(UCH(line[i])) || !is_ls_date(&line[i-12])); i--)
-	; /* null body */
+	 (i > 13) && (!isspace(UCH(line[i])) || !is_ls_date(&line[i - 12]));
+	 i--) ;			/* null body */
     line[i] = '\0';
     if (i > 13) {
-	StrAllocCopy(entry_info->date, &line[i-12]);
+	StrAllocCopy(entry_info->date, &line[i - 12]);
 	/* replace the 4th location with nbsp if it is a space or zero */
 	if (entry_info->date[4] == ' ' || entry_info->date[4] == '0')
 	    entry_info->date[4] = HT_NON_BREAK_SPACE;
 	/* make sure year or time is flush right */
 	if (entry_info->date[11] == ' ') {
 	    for (j = 11; j > 6; j--) {
-		entry_info->date[j] = entry_info->date[j-1];
+		entry_info->date[j] = entry_info->date[j - 1];
 	    }
 	}
     }
@@ -1558,35 +1568,33 @@ static void parse_ls_line (
     }
     entry_info->size = size_num;
     StrAllocCopy(entry_info->filename, &line[i + 1]);
-} /* parse_ls_line() */
+}				/* parse_ls_line() */
 
 /*
- * parse_dls_line() --
- *	Extract the name and size info and whether it refers to a
- *      directory from a LIST line in "dls" format.
+ * Extract the name and size info and whether it refers to a directory from a
+ * LIST line in "dls" format.
  */
-static void parse_dls_line (
-	char *		line,
-	EntryInfo *	entry_info,
-	char **	pspilledname)
+static void parse_dls_line(char *line,
+			   EntryInfo *entry_info,
+			   char **pspilledname)
 {
-    short  j;
-    int    base=1;
-    int    size_num=0;
-    int    len;
+    short j;
+    int base = 1;
+    int size_num = 0;
+    int len;
     char *cps = NULL;
 
-    /* README		   763	Information about this server\0
-       bin/		     -	\0
-       etc/		     =	\0
-       ls-lR		     0	\0
-       ls-lR.Z		     3	\0
-       pub/		     =	Public area\0
-       usr/		     -	\0
-       morgan		    14	-> ../real/morgan\0
+    /* README              763  Information about this server\0
+       bin/                  -  \0
+       etc/                  =  \0
+       ls-lR                 0  \0
+       ls-lR.Z               3  \0
+       pub/                  =  Public area\0
+       usr/                  -  \0
+       morgan               14  -> ../real/morgan\0
        TIMIT.mostlikely.Z\0
-			 79215	\0
-	*/
+       79215    \0
+     */
 
     len = strlen(line);
     if (len == 0) {
@@ -1608,13 +1616,13 @@ static void parse_dls_line (
 	if (*pspilledname && !*line) {
 	    entry_info->filename = *pspilledname;
 	    *pspilledname = NULL;
-	    if (entry_info->filename[strlen(entry_info->filename)-1] == '/')
+	    if (entry_info->filename[strlen(entry_info->filename) - 1] == '/')
 		StrAllocCopy(entry_info->type, ENTRY_IS_DIRECTORY);
 	    else
 		StrAllocCopy(entry_info->type, "");
 	} else {
 	    StrAllocCopy(entry_info->filename, line);
-	    if (cps && cps != line && *(cps-1) == '/')
+	    if (cps && cps != line && *(cps - 1) == '/')
 		StrAllocCopy(entry_info->type, ENTRY_IS_DIRECTORY);
 	    else
 		StrAllocCopy(entry_info->type, "");
@@ -1651,45 +1659,45 @@ static void parse_dls_line (
 	line = *pspilledname;
 	len = strlen(*pspilledname);
     }
-    if (len > 0 && line[len-1] == '/') {
-		/*
-		**  It's a dir, remove / and mark it as such.
-		*/
+    if (len > 0 && line[len - 1] == '/') {
+	/*
+	 * It's a dir, remove / and mark it as such.
+	 */
 	if (len > 1)
-	    line[len-1] = '\0';
+	    line[len - 1] = '\0';
 	if (!entry_info->type)
 	    StrAllocCopy(entry_info->type, ENTRY_IS_DIRECTORY);
     }
 
     StrAllocCopy(entry_info->filename, line);
     FREE(*pspilledname);
-} /* parse_dls_line() */
+}				/* parse_dls_line() */
 
 /*
  * parse_vms_dir_entry()
  *	Format the name, date, and size from a VMS LIST line
  *	into the EntryInfo structure - FM
  */
-static void parse_vms_dir_entry (
-	char *		line,
-	EntryInfo *	entry_info)
+static void parse_vms_dir_entry(char *line,
+				EntryInfo *entry_info)
 {
     int i, j;
     unsigned int ialloc;
     char *cp, *cpd, *cps, date[16], *sp = " ";
 
-    /**  Get rid of blank lines, and information lines.  **/
-    /**  Valid lines have the ';' version number token.  **/
+    /* Get rid of blank lines, and information lines.  Valid lines have the ';'
+     * version number token.
+     */
     if (!strlen(line) || (cp = strchr(line, ';')) == NULL) {
 	entry_info->display = FALSE;
 	return;
     }
 
-    /** Cut out file or directory name at VMS version number. **/
-    *cp++ ='\0';
-    StrAllocCopy(entry_info->filename,line);
+    /* Cut out file or directory name at VMS version number. */
+    *cp++ = '\0';
+    StrAllocCopy(entry_info->filename, line);
 
-    /** Cast VMS non-README file and directory names to lowercase. **/
+    /* Cast VMS non-README file and directory names to lowercase. */
     if (strstr(entry_info->filename, "READ") == NULL) {
 	LYLowerCase(entry_info->filename);
 	i = strlen(entry_info->filename);
@@ -1708,20 +1716,21 @@ static void parse_vms_dir_entry (
 	LYLowerCase(entry_info->filename + i);
     }
 
-    /** Uppercase terminal .z's or _z's. **/
+    /* Uppercase terminal .z's or _z's. */
     if ((--i > 2) &&
 	entry_info->filename[i] == 'z' &&
-	(entry_info->filename[i-1] == '.' ||
-	 entry_info->filename[i-1] == '_'))
+	(entry_info->filename[i - 1] == '.' ||
+	 entry_info->filename[i - 1] == '_'))
 	entry_info->filename[i] = 'Z';
 
-    /** Convert any tabs in rest of line to spaces. **/
-    cps = cp-1;
-    while ((cps=strchr(cps+1, '\t')) != NULL)
+    /* Convert any tabs in rest of line to spaces. */
+    cps = cp - 1;
+    while ((cps = strchr(cps + 1, '\t')) != NULL)
 	*cps = ' ';
 
-    /** Collapse serial spaces. **/
-    i = 0; j = 1;
+    /* Collapse serial spaces. */
+    i = 0;
+    j = 1;
     cps = cp;
     while (cps[j] != '\0') {
 	if (cps[i] == ' ' && cps[j] == ' ')
@@ -1731,60 +1740,60 @@ static void parse_vms_dir_entry (
     }
     cps[++i] = '\0';
 
-    /* Set the years and date, if we don't have them yet. **/
+    /* Set the years and date, if we don't have them yet. * */
     if (!HaveYears) {
 	set_years_and_date();
     }
 
-    /** Track down the date. **/
-    if ((cpd=strchr(cp, '-')) != NULL &&
-	strlen(cpd) > 9 && isdigit(UCH(*(cpd-1))) &&
-	isalpha(UCH(*(cpd+1))) && *(cpd+4) == '-') {
+    /* Track down the date. */
+    if ((cpd = strchr(cp, '-')) != NULL &&
+	strlen(cpd) > 9 && isdigit(UCH(*(cpd - 1))) &&
+	isalpha(UCH(*(cpd + 1))) && *(cpd + 4) == '-') {
 
-	/** Month **/
-	*(cpd+2) = (char) TOLOWER(*(cpd+2));
-	*(cpd+3) = (char) TOLOWER(*(cpd+3));
-	sprintf(date, "%.3s ", cpd+1);
+	/* Month */
+	*(cpd + 2) = (char) TOLOWER(*(cpd + 2));
+	*(cpd + 3) = (char) TOLOWER(*(cpd + 3));
+	sprintf(date, "%.3s ", cpd + 1);
 
-	/** Day **/
-	if (isdigit(UCH(*(cpd-2))))
-	    sprintf(date+4, "%.2s ", cpd-2);
+	/* Day */
+	if (isdigit(UCH(*(cpd - 2))))
+	    sprintf(date + 4, "%.2s ", cpd - 2);
 	else
-	    sprintf(date+4, "%c%.1s ", HT_NON_BREAK_SPACE, cpd-1);
+	    sprintf(date + 4, "%c%.1s ", HT_NON_BREAK_SPACE, cpd - 1);
 
-	/** Time or Year **/
-	if (!strncmp(ThisYear, cpd+5, 4) &&
-	    strlen(cpd) > 15 && *(cpd+12) == ':') {
-	    sprintf(date+7, "%.5s", cpd+10);
+	/* Time or Year */
+	if (!strncmp(ThisYear, cpd + 5, 4) &&
+	    strlen(cpd) > 15 && *(cpd + 12) == ':') {
+	    sprintf(date + 7, "%.5s", cpd + 10);
 	} else {
-	    sprintf(date+7, " %.4s", cpd+5);
+	    sprintf(date + 7, " %.4s", cpd + 5);
 	}
 
 	StrAllocCopy(entry_info->date, date);
     }
 
-    /** Track down the size **/
-    if ((cpd=strchr(cp, '/')) != NULL) {
+    /* Track down the size */
+    if ((cpd = strchr(cp, '/')) != NULL) {
 	/* Appears be in used/allocated format */
 	cps = cpd;
-	while (isdigit(UCH(*(cps-1))))
+	while (isdigit(UCH(*(cps - 1))))
 	    cps--;
 	if (cps < cpd)
 	    *cpd = '\0';
 	entry_info->size = atoi(cps);
-	cps = cpd+1;
+	cps = cpd + 1;
 	while (isdigit(UCH(*cps)))
 	    cps++;
 	*cps = '\0';
-	ialloc = atoi(cpd+1);
+	ialloc = atoi(cpd + 1);
 	/* Check if used is in blocks or bytes */
 	if (entry_info->size <= ialloc)
 	    entry_info->size *= 512;
 
-    } else if ((cps=strtok(cp, sp)) != NULL) {
+    } else if ((cps = strtok(cp, sp)) != NULL) {
 	/* We just initialized on the version number */
 	/* Now let's hunt for a lone, size number    */
-	while ((cps=strtok(NULL, sp)) != NULL) {
+	while ((cps = strtok(NULL, sp)) != NULL) {
 	    cpd = cps;
 	    while (isdigit(UCH(*cpd)))
 		cpd++;
@@ -1796,41 +1805,40 @@ static void parse_vms_dir_entry (
 	}
     }
 
-    /** Wrap it up **/
+    /* Wrap it up */
     CTRACE((tfp, "HTFTP: VMS filename: %s  date: %s  size: %d\n",
-		entry_info->filename,
-		NonNull(entry_info->date),
-		entry_info->size));
+	    entry_info->filename,
+	    NonNull(entry_info->date),
+	    entry_info->size));
     return;
-} /* parse_vms_dir_entry() */
+}				/* parse_vms_dir_entry() */
 
 /*
  * parse_ms_windows_dir_entry() --
  *	Format the name, date, and size from an MS_WINDOWS LIST line into
  *	the EntryInfo structure (assumes Chameleon NEWT format). - FM
  */
-static void parse_ms_windows_dir_entry (
-	char *		line,
-	EntryInfo *	entry_info)
+static void parse_ms_windows_dir_entry(char *line,
+				       EntryInfo *entry_info)
 {
     char *cp = line;
     char *cps, *cpd, date[16];
     char *end = line + strlen(line);
 
-    /**  Get rid of blank or junk lines.  **/
+    /*  Get rid of blank or junk lines.  */
     cp = LYSkipBlanks(cp);
     if (!(*cp)) {
 	entry_info->display = FALSE;
 	return;
     }
 
-    /** Cut out file or directory name. **/
+    /* Cut out file or directory name. */
     cps = LYSkipNonBlanks(cp);
-    *cps++ ='\0';
+    *cps++ = '\0';
     cpd = cps;
     StrAllocCopy(entry_info->filename, cp);
 
-    /** Track down the size **/
+    /* Track down the size */
     if (cps < end) {
 	cps = LYSkipBlanks(cps);
 	cpd = LYSkipNonBlanks(cps);
@@ -1844,38 +1852,38 @@ static void parse_ms_windows_dir_entry (
 	StrAllocCopy(entry_info->type, "");
     }
 
-    /* Set the years and date, if we don't have them yet. **/
+    /* Set the years and date, if we don't have them yet. * */
     if (!HaveYears) {
 	set_years_and_date();
     }
 
-    /** Track down the date. **/
+    /* Track down the date. */
     if (cpd < end) {
 	cpd = LYSkipBlanks(cpd);
 	if (strlen(cpd) > 17) {
-	    *(cpd+6)  = '\0';  /* Month and Day */
-	    *(cpd+11) = '\0';  /* Year */
-	    *(cpd+17) = '\0';  /* Time */
-	    if (strcmp(ThisYear, cpd+7))
+	    *(cpd + 6) = '\0';	/* Month and Day */
+	    *(cpd + 11) = '\0';	/* Year */
+	    *(cpd + 17) = '\0';	/* Time */
+	    if (strcmp(ThisYear, cpd + 7))
 		/* Not this year, so show the year */
-		sprintf(date, "%.6s  %.4s", cpd, (cpd+7));
+		sprintf(date, "%.6s  %.4s", cpd, (cpd + 7));
 	    else
 		/* Is this year, so show the time */
-		sprintf(date, "%.6s %.5s", cpd, (cpd+12));
+		sprintf(date, "%.6s %.5s", cpd, (cpd + 12));
 	    StrAllocCopy(entry_info->date, date);
-	    if (entry_info->date[4] == ' '|| entry_info->date[4] == '0') {
+	    if (entry_info->date[4] == ' ' || entry_info->date[4] == '0') {
 		entry_info->date[4] = HT_NON_BREAK_SPACE;
 	    }
 	}
     }
 
-    /** Wrap it up **/
+    /* Wrap it up */
     CTRACE((tfp, "HTFTP: MS Windows filename: %s  date: %s  size: %d\n",
-		entry_info->filename,
-		NonNull(entry_info->date),
-		entry_info->size));
+	    entry_info->filename,
+	    NonNull(entry_info->date),
+	    entry_info->size));
     return;
-} /* parse_ms_windows_dir_entry */
+}				/* parse_ms_windows_dir_entry */
 
 /*
  * parse_windows_nt_dir_entry() --
@@ -1883,26 +1891,25 @@ static void parse_ms_windows_dir_entry (
  *	the EntryInfo structure (assumes Chameleon NEWT format). - FM
  */
 #ifdef NOTDEFINED
-static void parse_windows_nt_dir_entry (
-	char *		line,
-	EntryInfo *	entry_info)
+static void parse_windows_nt_dir_entry(char *line,
+				       EntryInfo *entry_info)
 {
     char *cp = line;
     char *cps, *cpd, date[16];
     char *end = line + strlen(line);
     int i;
 
-    /**  Get rid of blank or junk lines.  **/
+    /*  Get rid of blank or junk lines.  */
     cp = LYSkipBlanks(cp);
     if (!(*cp)) {
 	entry_info->display = FALSE;
 	return;
     }
 
-    /** Cut out file or directory name. **/
+    /* Cut out file or directory name. */
     cpd = cp;
-    cps = LYSkipNonBlanks(end-1);
-    cp = (cps+1);
+    cps = LYSkipNonBlanks(end - 1);
+    cp = (cps + 1);
     if (!strcmp(cp, ".") || !strcmp(cp, "..")) {
 	entry_info->display = FALSE;
 	return;
@@ -1913,37 +1920,37 @@ static void parse_windows_nt_dir_entry (
     *cp = '\0';
     end = cp;
 
-    /* Set the years and date, if we don't have them yet. **/
+    /* Set the years and date, if we don't have them yet. * */
     if (!HaveYears) {
 	set_years_and_date();
     }
 
-    /** Cut out the date. **/
+    /* Cut out the date. */
     cp = cps = cpd;
     cps = LYSkipNonBlanks(cps);
-    *cps++ ='\0';
+    *cps++ = '\0';
     if (cps > end) {
 	entry_info->display = FALSE;
 	return;
     }
     cps = LYSkipBlanks(cps);
     cpd = LYSkipNonBlanks(cps);
-    *cps++ ='\0';
+    *cps++ = '\0';
     if (cps > end || cpd == cps || strlen(cpd) < 7) {
 	entry_info->display = FALSE;
 	return;
     }
     if (strlen(cp) == 8 &&
-	isdigit(*cp) && isdigit(*(cp+1)) && *(cp+2) == '-' &&
-	isdigit(*(cp+3)) && isdigit(*(cp+4)) && *(cp+5) == '-') {
-	*(cp+2)  = '\0';	/* Month */
+	isdigit(*cp) && isdigit(*(cp + 1)) && *(cp + 2) == '-' &&
+	isdigit(*(cp + 3)) && isdigit(*(cp + 4)) && *(cp + 5) == '-') {
+	*(cp + 2) = '\0';	/* Month */
 	i = atoi(cp) - 1;
-	*(cp+5) = '\0';		/* Day */
-	sprintf(date, "%.3s %.2s", months[i], (cp+3));
+	*(cp + 5) = '\0';	/* Day */
+	sprintf(date, "%.3s %.2s", months[i], (cp + 3));
 	if (date[4] == '0')
 	    date[4] = ' ';
-	cp += 6;			/* Year */
-	if (strcmp((ThisYear+2), cp)) {
+	cp += 6;		/* Year */
+	if (strcmp((ThisYear + 2), cp)) {
 	    /* Not this year, so show the year */
 	    if (atoi(cp) < 70) {
 		sprintf(&date[6], "  20%.2s", cp);
@@ -1952,19 +1959,19 @@ static void parse_windows_nt_dir_entry (
 	    }
 	} else {
 	    /* Is this year, so show the time */
-	    *(cpd+2) = '\0';	/* Hour */
+	    *(cpd + 2) = '\0';	/* Hour */
 	    i = atoi(cpd);
-	    if (*(cpd+5) == 'P' || *(cpd+5) == 'p')
+	    if (*(cpd + 5) == 'P' || *(cpd + 5) == 'p')
 		i += 12;
-	    sprintf(&date[6], " %02d:%.2s", i, (cpd+3));
+	    sprintf(&date[6], " %02d:%.2s", i, (cpd + 3));
 	}
 	StrAllocCopy(entry_info->date, date);
-	if (entry_info->date[4] == ' '|| entry_info->date[4] == '0') {
+	if (entry_info->date[4] == ' ' || entry_info->date[4] == '0') {
 	    entry_info->date[4] = HT_NON_BREAK_SPACE;
 	}
     }
 
-    /** Track down the size **/
+    /* Track down the size */
     if (cps < end) {
 	cps = LYSkipBlanks(cps);
 	cpd = LYSkipNonBlanks(cps);
@@ -1978,13 +1985,13 @@ static void parse_windows_nt_dir_entry (
 	StrAllocCopy(entry_info->type, "");
     }
 
-    /** Wrap it up **/
+    /* Wrap it up */
     CTRACE((tfp, "HTFTP: Windows NT filename: %s  date: %s  size: %d\n",
-		entry_info->filename,
-		NonNull(entry_info->date),
-		entry_info->size));
+	    entry_info->filename,
+	    NonNull(entry_info->date),
+	    entry_info->size));
     return;
-} /* parse_windows_nt_dir_entry */
+}				/* parse_windows_nt_dir_entry */
 #endif /* NOTDEFINED */
 
 /*
@@ -1992,9 +1999,8 @@ static void parse_windows_nt_dir_entry (
  *	Format the name, date, and size from a VM/CMS line into
  *	the EntryInfo structure. - FM
  */
-static void parse_cms_dir_entry (
-	char *		line,
-	EntryInfo *	entry_info)
+static void parse_cms_dir_entry(char *line,
+				EntryInfo *entry_info)
 {
     char *cp = line;
     char *cps, *cpd, date[16];
@@ -2003,51 +2009,51 @@ static void parse_cms_dir_entry (
     int Records = 0;
     int i;
 
-    /**  Get rid of blank or junk lines.  **/
+    /*  Get rid of blank or junk lines.  */
     cp = LYSkipBlanks(cp);
     if (!(*cp)) {
 	entry_info->display = FALSE;
 	return;
     }
 
-    /** Cut out file or directory name. **/
+    /* Cut out file or directory name. */
     cps = LYSkipNonBlanks(cp);
-    *cps++ ='\0';
+    *cps++ = '\0';
     StrAllocCopy(entry_info->filename, cp);
     if (strchr(entry_info->filename, '.') != NULL)
-	/** If we already have a dot, we did an NLST. **/
+	/* If we already have a dot, we did an NLST. */
 	return;
     cp = LYSkipBlanks(cps);
     if (!(*cp)) {
-	/** If we don't have more, we've misparsed. **/
+	/* If we don't have more, we've misparsed. */
 	FREE(entry_info->filename);
 	FREE(entry_info->type);
 	entry_info->display = FALSE;
 	return;
     }
     cps = LYSkipNonBlanks(cp);
-    *cps++ ='\0';
+    *cps++ = '\0';
     if ((0 == strcasecomp(cp, "DIR")) && (cp - line) > 17) {
-	/** It's an SFS directory. **/
+	/* It's an SFS directory. */
 	StrAllocCopy(entry_info->type, ENTRY_IS_DIRECTORY);
 	entry_info->size = 0;
     } else {
-	/** It's a file. **/
+	/* It's a file. */
 	cp--;
 	*cp = '.';
 	StrAllocCat(entry_info->filename, cp);
 
-	/** Track down the VM/CMS RECFM or type. **/
+	/* Track down the VM/CMS RECFM or type. */
 	cp = cps;
 	if (cp < end) {
 	    cp = LYSkipBlanks(cp);
 	    cps = LYSkipNonBlanks(cp);
 	    *cps++ = '\0';
-	    /** Check cp here, if it's relevant someday. **/
+	    /* Check cp here, if it's relevant someday. */
 	}
     }
 
-    /** Track down the record length or dash. **/
+    /* Track down the record length or dash. */
     cp = cps;
     if (cp < end) {
 	cp = LYSkipBlanks(cp);
@@ -2058,7 +2064,7 @@ static void parse_cms_dir_entry (
 	}
     }
 
-    /** Track down the number of records or the dash. **/
+    /* Track down the number of records or the dash. */
     cp = cps;
     if (cps < end) {
 	cp = LYSkipBlanks(cp);
@@ -2068,38 +2074,38 @@ static void parse_cms_dir_entry (
 	    Records = atoi(cp);
 	}
 	if (Records > 0 && RecordLength > 0) {
-	    /** Compute an approximate size. **/
+	    /* Compute an approximate size. */
 	    entry_info->size = (Records * RecordLength);
 	}
     }
 
-    /** Set the years and date, if we don't have them yet. **/
+    /* Set the years and date, if we don't have them yet. */
     if (!HaveYears) {
 	set_years_and_date();
     }
 
-    /** Track down the date. **/
+    /* Track down the date. */
     cpd = cps;
     if (((cps < end) &&
 	 (cps = strchr(cpd, ':')) != NULL) &&
 	(cps < (end - 3) &&
-	 isdigit(UCH(*(cps+1))) && isdigit(UCH(*(cps+2))) && *(cps+3) == ':')) {
+	 isdigit(UCH(*(cps + 1))) && isdigit(UCH(*(cps + 2))) && *(cps + 3) == ':')) {
 	cps += 3;
 	*cps = '\0';
 	if ((cps - cpd) >= 14) {
 	    cpd = (cps - 14);
-	    *(cpd+2) = '\0';	/* Month */
-	    *(cpd+5) = '\0';	/* Day */
-	    *(cpd+8) = '\0';	/* Year */
+	    *(cpd + 2) = '\0';	/* Month */
+	    *(cpd + 5) = '\0';	/* Day */
+	    *(cpd + 8) = '\0';	/* Year */
 	    cps -= 5;		/* Time */
 	    if (*cpd == ' ')
 		*cpd = '0';
 	    i = atoi(cpd) - 1;
-	    sprintf(date, "%.3s %.2s", months[i], (cpd+3));
+	    sprintf(date, "%.3s %.2s", months[i], (cpd + 3));
 	    if (date[4] == '0')
 		date[4] = ' ';
 	    cpd += 6;		/* Year */
-	    if (strcmp((ThisYear+2), cpd)) {
+	    if (strcmp((ThisYear + 2), cpd)) {
 		/* Not this year, so show the year. */
 		if (atoi(cpd) < 70) {
 		    sprintf(&date[6], "  20%.2s", cpd);
@@ -2108,45 +2114,43 @@ static void parse_cms_dir_entry (
 		}
 	    } else {
 		/* Is this year, so show the time. */
-		*(cps+2) = '\0';	/* Hour */
+		*(cps + 2) = '\0';	/* Hour */
 		i = atoi(cps);
-		sprintf(&date[6], " %02d:%.2s", i, (cps+3));
+		sprintf(&date[6], " %02d:%.2s", i, (cps + 3));
 	    }
 	    StrAllocCopy(entry_info->date, date);
-	    if (entry_info->date[4] == ' '|| entry_info->date[4] == '0') {
+	    if (entry_info->date[4] == ' ' || entry_info->date[4] == '0') {
 		entry_info->date[4] = HT_NON_BREAK_SPACE;
 	    }
 	}
     }
 
-    /** Wrap it up. **/
+    /* Wrap it up. */
     CTRACE((tfp, "HTFTP: VM/CMS filename: %s  date: %s  size: %d\n",
-		entry_info->filename,
-		NonNull(entry_info->date),
-		entry_info->size));
+	    entry_info->filename,
+	    NonNull(entry_info->date),
+	    entry_info->size));
     return;
-} /* parse_cms_dir_entry */
+}				/* parse_cms_dir_entry */
 
 /*
- *     parse_dir_entry()
- *	Given a line of LIST/NLST output in entry, return results
- *	and a file/dir name in entry_info struct
+ * Given a line of LIST/NLST output in entry, return results and a file/dir
+ * name in entry_info struct
  *
- *	If first is true, this is the first name in a directory.
+ * If first is true, this is the first name in a directory.
  */
-
-static EntryInfo * parse_dir_entry (
-	char *		entry,
-	BOOLEAN *	first,
-	char **	pspilledname)
+static EntryInfo *parse_dir_entry(char *entry,
+				  BOOLEAN *first,
+				  char **pspilledname)
 {
     EntryInfo *entry_info;
-    int  i;
-    int  len;
-    BOOLEAN remove_size=FALSE;
+    int i;
+    int len;
+    BOOLEAN remove_size = FALSE;
     char *cp;
 
-    entry_info = (EntryInfo *)malloc(sizeof(EntryInfo));
+    entry_info = (EntryInfo *) malloc(sizeof(EntryInfo));
+
     if (entry_info == NULL)
 	outofmem(__FILE__, "parse_dir_entry");
     entry_info->filename = NULL;
@@ -2156,273 +2160,269 @@ static EntryInfo * parse_dir_entry (
     entry_info->display = TRUE;
 
     switch (server_type) {
-	case DLS_SERVER:
-
-	    /*
-	    **	Interpret and edit LIST output from a Unix server
-	    **  in "dls" format.
-	    **  This one must have claimed to be Unix in order to
-	    **  get here; if the first line looks fishy, we revert
-	    **  to Unix and hope that fits better (this recovery is
-	    **  untested). - kw
-	    */
-
-	    if (*first) {
-		len = strlen(entry);
-		if (!len || entry[0] == ' ' ||
-		    (len >= 24 && entry[23] != ' ') ||
-		    (len < 24 && strchr(entry, ' '))) {
-		    server_type = UNIX_SERVER;
-		    CTRACE((tfp,
-			   "HTFTP: Falling back to treating as Unix server.\n"));
-		} else {
-		    *first = FALSE;
-		}
-	    }
+    case DLS_SERVER:
 
-	    if (server_type == DLS_SERVER) {
-		/* if still unchanged... */
-		parse_dls_line(entry, entry_info, pspilledname);
-
-		if (!entry_info->filename || *entry_info->filename == '\0') {
-		    entry_info->display = FALSE;
-		    return(entry_info);
-		}
-		if (!strcmp(entry_info->filename,"..") ||
-		    !strcmp(entry_info->filename,"."))
-		    entry_info->display = FALSE;
-		if (entry_info->type && *entry_info->type == '\0') {
-		    FREE(entry_info->type);
-		    return(entry_info);
-		}
-		/*
-		**	Goto the bottom and get real type.
-		*/
-		break;
-	    } /* fall through if server_type changed for *first == TRUE ! */
-
-	case UNIX_SERVER:
-	case PETER_LEWIS_SERVER:
-	case MACHTEN_SERVER:
-	case MSDOS_SERVER:
-	case WINDOWS_NT_SERVER:
-	case WINDOWS_2K_SERVER:
-	case APPLESHARE_SERVER:
-	case NETPRESENZ_SERVER:
-	    /*
-	    **	Check for EPLF output (local times).
-	    */
-	    if (*entry == '+') {
-		parse_eplf_line(entry, entry_info);
-		break;
-	    }
+	/*
+	 * Interpret and edit LIST output from a Unix server in "dls" format. 
+	 * This one must have claimed to be Unix in order to get here; if the
+	 * first line looks fishy, we revert to Unix and hope that fits better
+	 * (this recovery is untested).  - kw
+	 */
 
-	    /*
-	    **	Interpret and edit LIST output from Unix server.
-	    */
+	if (*first) {
 	    len = strlen(entry);
-	    if (*first) {
-		/* don't gettext() this -- incoming text: */
-		if (!strcmp(entry, "can not access directory .")) {
-		    /*
-		     *	Don't reset *first, nothing real will follow. - KW
-		     */
-		    entry_info->display = FALSE;
-		    return(entry_info);
-		}
+	    if (!len || entry[0] == ' ' ||
+		(len >= 24 && entry[23] != ' ') ||
+		(len < 24 && strchr(entry, ' '))) {
+		server_type = UNIX_SERVER;
+		CTRACE((tfp,
+			"HTFTP: Falling back to treating as Unix server.\n"));
+	    } else {
 		*first = FALSE;
-		if (!strncmp(entry, "total ", 6) ||
-		    strstr(entry, "not available") != NULL) {
-		    entry_info->display = FALSE;
-		    return(entry_info);
-		} else if (unsure_type) {
-		    /* this isn't really a unix server! */
-		    server_type = GENERIC_SERVER;
-		    entry_info->display = FALSE;
-		    return(entry_info);
-		}
 	    }
+	}
 
-	    /*
-	    **	Check first character of ls -l output.
-	    */
-	    if (TOUPPER(entry[0]) == 'D')  {
-		/*
-		**  It's a directory.
-		*/
-		StrAllocCopy(entry_info->type, ENTRY_IS_DIRECTORY);
-		remove_size=TRUE; /* size is not useful */
-	    } else if (entry[0] == 'l') {
-		/*
-		**  It's a symbolic link, does the user care about
-		**  knowing if it is symbolic?	I think so since
-		**  it might be a directory.
-		*/
-		StrAllocCopy(entry_info->type, gettext("Symbolic Link"));
-		remove_size=TRUE; /* size is not useful */
-
-		/*
-		**  Strip off " -> pathname".
-		*/
-		for (i = len - 1; (i > 3) &&
-				  (!isspace(UCH(entry[i])) ||
-				   (entry[i-1] != '>')	||
-				   (entry[i-2] != '-') ||
-				   (entry[i-3] != ' ')); i--)
-		    ; /* null body */
-		if (i > 3) {
-		    entry[i-3] = '\0';
-		    len = i - 3;
-		}
-	    } /* link */
-
-	    parse_ls_line(entry, entry_info);
+	if (server_type == DLS_SERVER) {
+	    /* if still unchanged... */
+	    parse_dls_line(entry, entry_info, pspilledname);
 
-	    if (!strcmp(entry_info->filename,"..") ||
-		!strcmp(entry_info->filename,"."))
+	    if (!entry_info->filename || *entry_info->filename == '\0') {
 		entry_info->display = FALSE;
+		return (entry_info);
+	    }
+	    if (!strcmp(entry_info->filename, "..") ||
+		!strcmp(entry_info->filename, "."))
+		entry_info->display = FALSE;
+	    if (entry_info->type && *entry_info->type == '\0') {
+		FREE(entry_info->type);
+		return (entry_info);
+	    }
 	    /*
-	    **	Goto the bottom and get real type.
-	    */
+	     * Goto the bottom and get real type.
+	     */
 	    break;
+	}
+	/* fall through if server_type changed for *first == TRUE ! */
+    case UNIX_SERVER:
+    case PETER_LEWIS_SERVER:
+    case MACHTEN_SERVER:
+    case MSDOS_SERVER:
+    case WINDOWS_NT_SERVER:
+    case WINDOWS_2K_SERVER:
+    case APPLESHARE_SERVER:
+    case NETPRESENZ_SERVER:
+	/*
+	 * Check for EPLF output (local times).
+	 */
+	if (*entry == '+') {
+	    parse_eplf_line(entry, entry_info);
+	    break;
+	}
 
-	case VMS_SERVER:
-	    /*
-	    **	Interpret and edit LIST output from VMS server
-	    **	and convert information lines to zero length.
-	    */
-	    parse_vms_dir_entry(entry, entry_info);
+	/*
+	 * Interpret and edit LIST output from Unix server.
+	 */
+	len = strlen(entry);
+	if (*first) {
+	    /* don't gettext() this -- incoming text: */
+	    if (!strcmp(entry, "can not access directory .")) {
+		/*
+		 * Don't reset *first, nothing real will follow.  - KW
+		 */
+		entry_info->display = FALSE;
+		return (entry_info);
+	    }
+	    *first = FALSE;
+	    if (!strncmp(entry, "total ", 6) ||
+		strstr(entry, "not available") != NULL) {
+		entry_info->display = FALSE;
+		return (entry_info);
+	    } else if (unsure_type) {
+		/* this isn't really a unix server! */
+		server_type = GENERIC_SERVER;
+		entry_info->display = FALSE;
+		return (entry_info);
+	    }
+	}
 
+	/*
+	 * Check first character of ls -l output.
+	 */
+	if (TOUPPER(entry[0]) == 'D') {
 	    /*
-	    **	Get rid of any junk lines.
-	    */
-	    if (!entry_info->display)
-		return(entry_info);
+	     * It's a directory.
+	     */
+	    StrAllocCopy(entry_info->type, ENTRY_IS_DIRECTORY);
+	    remove_size = TRUE;	/* size is not useful */
+	} else if (entry[0] == 'l') {
+	    /*
+	     * It's a symbolic link, does the user care about knowing if it is
+	     * symbolic?  I think so since it might be a directory.
+	     */
+	    StrAllocCopy(entry_info->type, gettext("Symbolic Link"));
+	    remove_size = TRUE;	/* size is not useful */
 
 	    /*
-	    **	Trim off VMS directory extensions.
-	    */
-	    len = strlen(entry_info->filename);
-	    if ((len > 4) && !strcmp(&entry_info->filename[len-4], ".dir")) {
-		entry_info->filename[len-4] = '\0';
-		StrAllocCopy(entry_info->type, ENTRY_IS_DIRECTORY);
-		remove_size=TRUE; /* size is not useful */
+	     * Strip off " -> pathname".
+	     */
+	    for (i = len - 1; (i > 3) &&
+		 (!isspace(UCH(entry[i])) ||
+		  (entry[i - 1] != '>') ||
+		  (entry[i - 2] != '-') ||
+		  (entry[i - 3] != ' ')); i--) ;	/* null body */
+	    if (i > 3) {
+		entry[i - 3] = '\0';
+		len = i - 3;
 	    }
-	    /*
-	    **	Goto the bottom and get real type.
-	    */
-	    break;
+	}
+	/* link */
+	parse_ls_line(entry, entry_info);
 
-	case MS_WINDOWS_SERVER:
-	    /*
-	    **	Interpret and edit LIST output from MS_WINDOWS server
-	    **	and convert information lines to zero length.
-	    */
-	    parse_ms_windows_dir_entry(entry, entry_info);
+	if (!strcmp(entry_info->filename, "..") ||
+	    !strcmp(entry_info->filename, "."))
+	    entry_info->display = FALSE;
+	/*
+	 * Goto the bottom and get real type.
+	 */
+	break;
 
-	    /*
-	    **	Get rid of any junk lines.
-	    */
-	    if (!entry_info->display)
-		return(entry_info);
-	    if (entry_info->type && *entry_info->type == '\0') {
-		FREE(entry_info->type);
-		return(entry_info);
-	    }
-	    /*
-	    **	Goto the bottom and get real type.
-	    */
-	    break;
+    case VMS_SERVER:
+	/*
+	 * Interpret and edit LIST output from VMS server and convert
+	 * information lines to zero length.
+	 */
+	parse_vms_dir_entry(entry, entry_info);
+
+	/*
+	 * Get rid of any junk lines.
+	 */
+	if (!entry_info->display)
+	    return (entry_info);
+
+	/*
+	 * Trim off VMS directory extensions.
+	 */
+	len = strlen(entry_info->filename);
+	if ((len > 4) && !strcmp(&entry_info->filename[len - 4], ".dir")) {
+	    entry_info->filename[len - 4] = '\0';
+	    StrAllocCopy(entry_info->type, ENTRY_IS_DIRECTORY);
+	    remove_size = TRUE;	/* size is not useful */
+	}
+	/*
+	 * Goto the bottom and get real type.
+	 */
+	break;
+
+    case MS_WINDOWS_SERVER:
+	/*
+	 * Interpret and edit LIST output from MS_WINDOWS server and convert
+	 * information lines to zero length.
+	 */
+	parse_ms_windows_dir_entry(entry, entry_info);
+
+	/*
+	 * Get rid of any junk lines.
+	 */
+	if (!entry_info->display)
+	    return (entry_info);
+	if (entry_info->type && *entry_info->type == '\0') {
+	    FREE(entry_info->type);
+	    return (entry_info);
+	}
+	/*
+	 * Goto the bottom and get real type.
+	 */
+	break;
 
 #ifdef NOTDEFINED
-	case WINDOWS_NT_SERVER:
-	    /*
-	    **	Interpret and edit LIST output from MS_WINDOWS server
-	    **	and convert information lines to zero length.
-	    */
-	    parse_windows_nt_dir_entry(entry, entry_info);
+    case WINDOWS_NT_SERVER:
+	/*
+	 * Interpret and edit LIST output from MS_WINDOWS server and convert
+	 * information lines to zero length.
+	 */
+	parse_windows_nt_dir_entry(entry, entry_info);
 
-	    /*
-	    **	Get rid of any junk lines.
-	    */
-	    if (!entry_info->display)
-		return(entry_info);
-	    if (entry_info->type && *entry_info->type == '\0') {
-		FREE(entry_info->type);
-		return(entry_info);
-	    }
-	    /*
-	    **	Goto the bottom and get real type.
-	    */
-	    break;
+	/*
+	 * Get rid of any junk lines.
+	 */
+	if (!entry_info->display)
+	    return (entry_info);
+	if (entry_info->type && *entry_info->type == '\0') {
+	    FREE(entry_info->type);
+	    return (entry_info);
+	}
+	/*
+	 * Goto the bottom and get real type.
+	 */
+	break;
 #endif /* NOTDEFINED */
 
-	case CMS_SERVER:
-	  {
+    case CMS_SERVER:
+	{
 	    /*
-	    **	Interpret and edit LIST output from VM/CMS server
-	    **	and convert any information lines to zero length.
-	    */
+	     * Interpret and edit LIST output from VM/CMS server and convert
+	     * any information lines to zero length.
+	     */
 	    parse_cms_dir_entry(entry, entry_info);
 
 	    /*
-	    **	Get rid of any junk lines.
-	    */
+	     * Get rid of any junk lines.
+	     */
 	    if (!entry_info->display)
-		return(entry_info);
+		return (entry_info);
 	    if (entry_info->type && *entry_info->type == '\0') {
 		FREE(entry_info->type);
-		return(entry_info);
+		return (entry_info);
 	    }
 	    /*
-	    **	Goto the bottom and get real type.
-	    */
+	     * Goto the bottom and get real type.
+	     */
 	    break;
-	  }
+	}
 
-	case NCSA_SERVER:
-	case TCPC_SERVER:
-	    /*
-	    **	Directories identified by trailing "/" characters.
-	    */
-	    StrAllocCopy(entry_info->filename, entry);
-	    len = strlen(entry);
-	    if (entry[len-1] == '/') {
-		/*
-		**  It's a dir, remove / and mark it as such.
-		*/
-		entry[len-1] = '\0';
-		StrAllocCopy(entry_info->type, ENTRY_IS_DIRECTORY);
-		remove_size=TRUE; /* size is not useful */
-	    }
+    case NCSA_SERVER:
+    case TCPC_SERVER:
+	/*
+	 * Directories identified by trailing "/" characters.
+	 */
+	StrAllocCopy(entry_info->filename, entry);
+	len = strlen(entry);
+	if (entry[len - 1] == '/') {
 	    /*
-	    **	Goto the bottom and get real type.
-	    */
-	    break;
+	     * It's a dir, remove / and mark it as such.
+	     */
+	    entry[len - 1] = '\0';
+	    StrAllocCopy(entry_info->type, ENTRY_IS_DIRECTORY);
+	    remove_size = TRUE;	/* size is not useful */
+	}
+	/*
+	 * Goto the bottom and get real type.
+	 */
+	break;
 
-	default:
-	    /*
-	    **	We can't tell if it is a directory since we only
-	    **	did an NLST :(	List bad file types anyways?  NOT!
-	    */
-	    StrAllocCopy(entry_info->filename, entry);
-	    return(entry_info); /* mostly empty info */
+    default:
+	/*
+	 * We can't tell if it is a directory since we only did an NLST :( List
+	 * bad file types anyways?  NOT!
+	 */
+	StrAllocCopy(entry_info->filename, entry);
+	return (entry_info);	/* mostly empty info */
 
-    } /* switch (server_type) */
+    }				/* switch (server_type) */
 
     if (remove_size && entry_info->size) {
 	entry_info->size = 0;
     }
 
     if (entry_info->filename && strlen(entry_info->filename) > 3) {
-	if (((cp=strrchr(entry_info->filename, '.')) != NULL &&
+	if (((cp = strrchr(entry_info->filename, '.')) != NULL &&
 	     0 == strncasecomp(cp, ".me", 3)) &&
 	    (cp[3] == '\0' || cp[3] == ';')) {
 	    /*
-	    **	Don't treat this as application/x-Troff-me
-	    **	if it's a Unix server but has the string
-	    **	"read.me", or if it's not a Unix server. - FM
-	    */
+	     * Don't treat this as application/x-Troff-me if it's a Unix server
+	     * but has the string "read.me", or if it's not a Unix server.  -
+	     * FM
+	     */
 	    if ((server_type != UNIX_SERVER) ||
 		(cp > (entry_info->filename + 3) &&
 		 0 == strncasecomp((cp - 4), "read.me", 7))) {
@@ -2432,18 +2432,19 @@ static EntryInfo * parse_dir_entry (
     }
 
     /*
-    **	Get real types eventually.
-    */
+     * Get real types eventually.
+     */
     if (!entry_info->type) {
 	const char *cp2;
 	HTFormat format;
-	HTAtom * encoding;  /* @@ not used at all */
+	HTAtom *encoding;	/* @@ not used at all */
+
 	format = HTFileFormat(entry_info->filename, &encoding, &cp2);
 
 	if (cp2 == NULL) {
-	    if (!strncmp(HTAtom_name(format), "application",11)) {
+	    if (!strncmp(HTAtom_name(format), "application", 11)) {
 		cp2 = HTAtom_name(format) + 12;
-		if (!strncmp(cp2,"x-",2))
+		if (!strncmp(cp2, "x-", 2))
 		    cp2 += 2;
 	    } else {
 		cp2 = HTAtom_name(format);
@@ -2453,239 +2454,232 @@ static EntryInfo * parse_dir_entry (
 	StrAllocCopy(entry_info->type, cp2);
     }
 
-    return(entry_info);
-} /* parse_dir_entry */
+    return (entry_info);
+}				/* parse_dir_entry */
 
-static int compare_EntryInfo_structs (
-	EntryInfo *	entry1,
-	EntryInfo *	entry2)
+static int compare_EntryInfo_structs(EntryInfo *entry1, EntryInfo *entry2)
 {
     int i, status;
     char date1[16], date2[16], time1[8], time2[8], month[4];
 
-    switch(HTfileSortMethod) {
-	case FILE_BY_SIZE:
-	    /* both equal or both 0 */
-	    if (entry1->size == entry2->size)
-		return(strcmp(entry1->filename, entry2->filename));
-	    else
-		if (entry1->size > entry2->size)
-		    return(1);
-		else
-		    return(-1);
-
-	case FILE_BY_TYPE:
-	    if (entry1->type && entry2->type) {
-		status = strcasecomp(entry1->type, entry2->type);
-		if (status)
-		    return(status);
-		/* else fall to filename comparison */
-	    }
+    switch (HTfileSortMethod) {
+    case FILE_BY_SIZE:
+	/* both equal or both 0 */
+	if (entry1->size == entry2->size)
 	    return (strcmp(entry1->filename, entry2->filename));
+	else if (entry1->size > entry2->size)
+	    return (1);
+	else
+	    return (-1);
+
+    case FILE_BY_TYPE:
+	if (entry1->type && entry2->type) {
+	    status = strcasecomp(entry1->type, entry2->type);
+	    if (status)
+		return (status);
+	    /* else fall to filename comparison */
+	}
+	return (strcmp(entry1->filename, entry2->filename));
 
-	case FILE_BY_DATE:
-	    if (entry1->date && entry2->date) {
-		/*
-		** Make sure we have the correct length. - FM
-		*/
-		if (strlen(entry1->date) != 12 || strlen(entry2->date) != 12) {
-		    return(strcmp(entry1->filename, entry2->filename));
-		}
-		/*
-		** Set the years and date,
-		** if we don't have them yet.
-		*/
-		if (!HaveYears) {
-		    set_years_and_date();
-		}
-		/*
-		** Set up for sorting in reverse
-		** chronological order. - FM
-		*/
-		if (entry1->date[9] == ':') {
-		    strcpy(date1, "9999");
-		    strcpy(time1, &entry1->date[7]);
-		    if (time1[0] == ' ') {
-			 time1[0] = '0';
-		    }
-		} else {
-		    strcpy(date1, &entry1->date[8]);
-		    strcpy(time1, "00:00");
-		}
-		strncpy(month, entry1->date, 3);
-		month[3] = '\0';
-		for (i = 0; i < 12; i++) {
-		    if (!strcasecomp(month, months[i])) {
-			break;
-		    }
-		}
-		i++;
-		sprintf(month, "%02d", i);
-		strcat(date1, month);
-		strncat(date1, &entry1->date[4], 2);
-		date1[8] = '\0';
-		if (date1[6] == ' ' || date1[6] == HT_NON_BREAK_SPACE) {
-		    date1[6] = '0';
+    case FILE_BY_DATE:
+	if (entry1->date && entry2->date) {
+	    /*
+	     * Make sure we have the correct length. - FM
+	     */
+	    if (strlen(entry1->date) != 12 || strlen(entry2->date) != 12) {
+		return (strcmp(entry1->filename, entry2->filename));
+	    }
+	    /*
+	     * Set the years and date,
+	     * if we don't have them yet.
+	     */
+	    if (!HaveYears) {
+		set_years_and_date();
+	    }
+	    /*
+	     * Set up for sorting in reverse
+	     * chronological order. - FM
+	     */
+	    if (entry1->date[9] == ':') {
+		strcpy(date1, "9999");
+		strcpy(time1, &entry1->date[7]);
+		if (time1[0] == ' ') {
+		    time1[0] = '0';
 		}
-		/*  If no year given, assume last year if it would otherwise
-		 *  be in the future by more than one day.  The one day
-		 *  tolerance is to account for a possible timezone
-		 *  difference. - kw */
-		if (date1[0] == '9' && atoi(date1) > TheDate + 1) {
-		    for (i = 0; i < 4; i++) {
-			date1[i] = LastYear[i];
-		    }
+	    } else {
+		strcpy(date1, &entry1->date[8]);
+		strcpy(time1, "00:00");
+	    }
+	    strncpy(month, entry1->date, 3);
+	    month[3] = '\0';
+	    for (i = 0; i < 12; i++) {
+		if (!strcasecomp(month, months[i])) {
+		    break;
 		}
-		strcat(date1, time1);
-		if (entry2->date[9] == ':') {
-		    strcpy(date2, "9999");
-		    strcpy(time2, &entry2->date[7]);
-		    if (time2[0] == ' ') {
-			time2[0] = '0';
-		    }
-		} else {
-		    strcpy(date2, &entry2->date[8]);
-		    strcpy(time2, "00:00");
+	    }
+	    i++;
+	    sprintf(month, "%02d", i);
+	    strcat(date1, month);
+	    strncat(date1, &entry1->date[4], 2);
+	    date1[8] = '\0';
+	    if (date1[6] == ' ' || date1[6] == HT_NON_BREAK_SPACE) {
+		date1[6] = '0';
+	    }
+	    /* If no year given, assume last year if it would otherwise be in
+	     * the future by more than one day.  The one day tolerance is to
+	     * account for a possible timezone difference.  - kw
+	     */
+	    if (date1[0] == '9' && atoi(date1) > TheDate + 1) {
+		for (i = 0; i < 4; i++) {
+		    date1[i] = LastYear[i];
 		}
-		strncpy(month, entry2->date, 3);
-		month[3] = '\0';
-		for (i = 0; i < 12; i++) {
-		    if (!strcasecomp(month, months[i])) {
-			break;
-		    }
+	    }
+	    strcat(date1, time1);
+	    if (entry2->date[9] == ':') {
+		strcpy(date2, "9999");
+		strcpy(time2, &entry2->date[7]);
+		if (time2[0] == ' ') {
+		    time2[0] = '0';
 		}
-		i++;
-		sprintf(month, "%02d", i);
-		strcat(date2, month);
-		strncat(date2, &entry2->date[4], 2);
-		date2[8] = '\0';
-		if (date2[6] == ' ' || date2[6] == HT_NON_BREAK_SPACE) {
-		    date2[6] = '0';
+	    } else {
+		strcpy(date2, &entry2->date[8]);
+		strcpy(time2, "00:00");
+	    }
+	    strncpy(month, entry2->date, 3);
+	    month[3] = '\0';
+	    for (i = 0; i < 12; i++) {
+		if (!strcasecomp(month, months[i])) {
+		    break;
 		}
-		/*  If no year given, assume last year if it would otherwise
-		 *  be in the future by more than one day.  The one day
-		 *  tolerance is to account for a possible timezone
-		 *  difference. - kw */
-		if (date2[0] == '9' && atoi(date2) > TheDate + 1) {
-		    for (i = 0; i < 4; i++) {
-			date2[i] = LastYear[i];
-		    }
+	    }
+	    i++;
+	    sprintf(month, "%02d", i);
+	    strcat(date2, month);
+	    strncat(date2, &entry2->date[4], 2);
+	    date2[8] = '\0';
+	    if (date2[6] == ' ' || date2[6] == HT_NON_BREAK_SPACE) {
+		date2[6] = '0';
+	    }
+	    /* If no year given, assume last year if it would otherwise be in
+	     * the future by more than one day.  The one day tolerance is to
+	     * account for a possible timezone difference.  - kw
+	     */
+	    if (date2[0] == '9' && atoi(date2) > TheDate + 1) {
+		for (i = 0; i < 4; i++) {
+		    date2[i] = LastYear[i];
 		}
-		strcat(date2, time2);
-		/*
-		** Do the comparison. - FM
-		*/
-		status = strcasecomp(date2, date1);
-		if (status)
-		    return(status);
-		/* else fall to filename comparison */
 	    }
-	    return (strcmp(entry1->filename, entry2->filename));
+	    strcat(date2, time2);
+	    /*
+	     * Do the comparison. - FM
+	     */
+	    status = strcasecomp(date2, date1);
+	    if (status)
+		return (status);
+	    /* else fall to filename comparison */
+	}
+	return (strcmp(entry1->filename, entry2->filename));
 
-	case FILE_BY_NAME:
-	default:
-	    return (strcmp(entry1->filename, entry2->filename));
+    case FILE_BY_NAME:
+    default:
+	return (strcmp(entry1->filename, entry2->filename));
     }
 }
 
-
 /*	Read a directory into an hypertext object from the data socket
-**	--------------------------------------------------------------
-**
-** On entry,
-**	anchor		Parent anchor to link the this node to
-**	address		Address of the directory
-** On exit,
-**	returns		HT_LOADED if OK
-**			<0 if error.
-*/
-static int read_directory (
-	HTParentAnchor *	parent,
-	const char *		address,
-	HTFormat		format_out,
-	HTStream *		sink)
+ *	--------------------------------------------------------------
+ *
+ * On entry,
+ *	anchor		Parent anchor to link the this node to
+ *	address		Address of the directory
+ * On exit,
+ *	returns		HT_LOADED if OK
+ *			<0 if error.
+ */
+static int read_directory(HTParentAnchor *parent,
+			  const char *address,
+			  HTFormat format_out,
+			  HTStream *sink)
 {
     int status;
     BOOLEAN WasInterrupted = FALSE;
-    HTStructured* target = HTML_new(parent, format_out, sink);
+    HTStructured *target = HTML_new(parent, format_out, sink);
     HTStructuredClass targetClass;
     char *filename = HTParse(address, "", PARSE_PATH + PARSE_PUNCTUATION);
     EntryInfo *entry_info;
     BOOLEAN first = TRUE;
     char string_buffer[64];
-    char *lastpath = NULL;/* prefix for link, either "" (for root) or xxx  */
+    char *lastpath = NULL;	/* prefix for link, either "" (for root) or xxx  */
     BOOL need_parent_link = FALSE;
     BOOL tildeIsTop = FALSE;
 
     targetClass = *(target->isa);
 
-    _HTProgress (gettext("Receiving FTP directory."));
+    _HTProgress(gettext("Receiving FTP directory."));
 
     /*
-     *  Force the current Date and Year (TheDate, ThisYear, and LastYear)
-     *  to be recalculated for each directory request.  Otherwise we have
-     *  a problem with long-running sessions assuming the wrong date for
-     *  today. - kw
+     * Force the current Date and Year (TheDate, ThisYear, and LastYear) to be
+     * recalculated for each directory request.  Otherwise we have a problem
+     * with long-running sessions assuming the wrong date for today.  - kw
      */
     HaveYears = FALSE;
     /*
-    **	Check whether we always want the home
-    **	directory treated as Welcome. - FM
-    */
+     * Check whether we always want the home directory treated as Welcome.  -
+     * FM
+     */
     if (server_type == VMS_SERVER)
 	tildeIsTop = TRUE;
 
     /*
-    **	This should always come back FALSE, since the
-    **	flag is set only for local directory listings
-    **	if LONG_LIST was defined on compilation, but
-    **	we could someday set up an equivalent listing
-    **	for Unix ftp servers. - FM
-    */
+     * This should always come back FALSE, since the flag is set only for local
+     * directory listings if LONG_LIST was defined on compilation, but we could
+     * someday set up an equivalent listing for Unix ftp servers.  - FM
+     */
     need_parent_link = HTDirTitles(target, parent, tildeIsTop);
 
     data_read_pointer = data_write_pointer = data_buffer;
 
-    if (*filename == '\0') {		  /* Empty filename: use root. */
-	StrAllocCopy (lastpath, "/");
-    } else if (!strcmp(filename,"/")) {   /* Root path. */
-	StrAllocCopy (lastpath, "/foo/..");
+    if (*filename == '\0') {	/* Empty filename: use root. */
+	StrAllocCopy(lastpath, "/");
+    } else if (!strcmp(filename, "/")) {	/* Root path. */
+	StrAllocCopy(lastpath, "/foo/..");
     } else {
-	char * p = strrchr(filename, '/');	     /* Find the lastslash. */
+	char *p = strrchr(filename, '/');	/* Find the lastslash. */
 	char *cp;
 
 	if (server_type == CMS_SERVER) {
-	    StrAllocCopy(lastpath, filename); /* Use absolute path for CMS. */
+	    StrAllocCopy(lastpath, filename);	/* Use absolute path for CMS. */
 	} else {
-	    StrAllocCopy(lastpath, p+1);   /* Take slash off the beginning. */
+	    StrAllocCopy(lastpath, p + 1);	/* Take slash off the beginning. */
 	}
-	if ((cp = strrchr(lastpath, ';')) != NULL) {   /* Trim type= param. */
-	    if (!strncasecomp((cp+1), "type=", 5)) {
-		if (TOUPPER(*(cp+6)) == 'D' ||
-		    TOUPPER(*(cp+6)) == 'A' ||
-		    TOUPPER(*(cp+6)) == 'I')
+	if ((cp = strrchr(lastpath, ';')) != NULL) {	/* Trim type= param. */
+	    if (!strncasecomp((cp + 1), "type=", 5)) {
+		if (TOUPPER(*(cp + 6)) == 'D' ||
+		    TOUPPER(*(cp + 6)) == 'A' ||
+		    TOUPPER(*(cp + 6)) == 'I')
 		    *cp = '\0';
 	    }
 	}
     }
-    FREE (filename);
+    FREE(filename);
 
     {
-	HTBTree * bt = HTBTree_new((HTComparer)compare_EntryInfo_structs);
+	HTBTree *bt = HTBTree_new((HTComparer) compare_EntryInfo_structs);
 	int ic;
-	HTChunk * chunk = HTChunkCreate(128);
+	HTChunk *chunk = HTChunkCreate(128);
 	int BytesReceived = 0;
 	int BytesReported = 0;
 	char NumBytes[64];
 	char *spilledname = NULL;
-	PUTC('\n');  /* prettier LJM */
+
+	PUTC('\n');		/* prettier LJM */
 	for (ic = 0; ic != EOF;) {	/* For each entry in the directory */
 	    HTChunkClear(chunk);
 
 	    if (HTCheckForInterrupt()) {
 		CTRACE((tfp,
-		       "read_directory: interrupted after %d bytes\n",
-		       BytesReceived));
+			"read_directory: interrupted after %d bytes\n",
+			BytesReceived));
 		WasInterrupted = TRUE;
 		if (BytesReceived) {
 		    goto unload_btree;	/* unload btree */
@@ -2697,32 +2691,32 @@ static int read_directory (
 		}
 	    }
 
-	    /*	 read directory entry
+	    /*   read directory entry
 	     */
 	    interrupted_in_next_data_char = FALSE;
-	    for (;;) {			/* Read in one line as filename */
+	    for (;;) {		/* Read in one line as filename */
 		ic = NEXT_DATA_CHAR;
-AgainForMultiNet:
+	      AgainForMultiNet:
 		if (interrupted_in_next_data_char) {
 		    CTRACE((tfp,
-			   "read_directory: interrupted_in_next_data_char after %d bytes\n",
-			   BytesReceived));
+			    "read_directory: interrupted_in_next_data_char after %d bytes\n",
+			    BytesReceived));
 		    WasInterrupted = TRUE;
 		    if (BytesReceived) {
-			goto unload_btree;  /* unload btree */
+			goto unload_btree;	/* unload btree */
 		    } else {
 			ABORT_TARGET;
 			HTBTreeAndObject_free(bt);
 			FREE(spilledname);
 			return HT_INTERRUPTED;
 		    }
-		} else if ((char)ic == CR || (char)ic == LF) {    /* Terminator? */
-		    if (chunk->size != 0) {  /* got some text */
+		} else if ((char) ic == CR || (char) ic == LF) {	/* Terminator? */
+		    if (chunk->size != 0) {	/* got some text */
 			/* Deal with MultiNet's wrapping of long lines */
 			if (server_type == VMS_SERVER) {
-			/* Deal with MultiNet's wrapping of long lines - F.M. */
+			    /* Deal with MultiNet's wrapping of long lines - F.M. */
 			    if (data_read_pointer < data_write_pointer &&
-				*(data_read_pointer+1) == ' ')
+				*(data_read_pointer + 1) == ' ')
 				data_read_pointer++;
 			    else if (data_read_pointer >= data_write_pointer) {
 				status = NETREAD(data_soc, data_buffer,
@@ -2741,17 +2735,15 @@ AgainForMultiNet:
 				    data_read_pointer++;
 				else
 				    break;
-			    }
-			    else
+			    } else
 				break;
-			}
-			else
+			} else
 			    break;	/* finish getting one entry */
 		    }
 		} else if (ic == EOF) {
-		    break;		/* End of file */
+		    break;	/* End of file */
 		} else {
-		    HTChunkPutc(chunk, (char)ic);
+		    HTChunkPutc(chunk, (char) ic);
 		}
 	    }
 	    HTChunkTerminate(chunk);
@@ -2759,8 +2751,8 @@ AgainForMultiNet:
 	    BytesReceived += chunk->size;
 	    if (BytesReceived > BytesReported + 1024) {
 #ifdef _WINDOWS
-		sprintf(NumBytes,gettext("Transferred %d bytes (%5d)"),
-				BytesReceived, ws_read_per_sec);
+		sprintf(NumBytes, gettext("Transferred %d bytes (%5d)"),
+			BytesReceived, ws_read_per_sec);
 #else
 		sprintf(NumBytes, TRANSFERRED_X_BYTES, BytesReceived);
 #endif
@@ -2769,25 +2761,25 @@ AgainForMultiNet:
 	    }
 
 	    if (ic == EOF && chunk->size == 1)
-	    /* 1 means empty: includes terminating 0 */
+		/* 1 means empty: includes terminating 0 */
 		break;
 	    CTRACE((tfp, "HTFTP: Line in %s is %s\n",
-			lastpath, chunk->data));
+		    lastpath, chunk->data));
 
 	    entry_info = parse_dir_entry(chunk->data, &first, &spilledname);
 	    if (entry_info->display) {
 		FREE(spilledname);
 		CTRACE((tfp, "Adding file to BTree: %s\n",
-			    entry_info->filename));
+			entry_info->filename));
 		HTBTree_add(bt, entry_info);
 	    } else {
 		free_entryinfo_struct_contents(entry_info);
 		FREE(entry_info);
 	    }
 
-	}  /* next entry */
+	}			/* next entry */
 
-unload_btree:
+      unload_btree:
 
 	HTChunkFree(chunk);
 	FREE(spilledname);
@@ -2808,26 +2800,27 @@ unload_btree:
 
 	/* Put up header
 	 */
-	/* PUTS("    Date	 Type		  Size	   Filename\n");
+	/* PUTS("    Date        Type             Size     Filename\n");
 	 */
 
 	/* Run through tree printing out in order
 	 */
 	{
-#ifdef SH_EX	/* 1997/10/18 (Sat) 14:14:28 */
+#ifdef SH_EX			/* 1997/10/18 (Sat) 14:14:28 */
 	    char *p, name_buff[256];
-	    int  name_len, dot_len;
+	    int name_len, dot_len;
 
 #define	FNAME_WIDTH	30
 #define	FILE_GAP	2
 
 #endif
-	    HTBTElement * ele;
+	    HTBTElement *ele;
 	    int i;
+
 	    for (ele = HTBTree_next(bt, NULL);
 		 ele != NULL;
 		 ele = HTBTree_next(bt, ele)) {
-		entry_info = (EntryInfo *)HTBTree_object(ele);
+		entry_info = (EntryInfo *) HTBTree_object(ele);
 
 		if (entry_info->date) {
 		    PUTS(entry_info->date);
@@ -2845,7 +2838,7 @@ unload_btree:
 
 		/* start the anchor */
 		HTDirEntry(target, lastpath, entry_info->filename);
-#ifdef SH_EX	/* 1997/10/18 (Sat) 16:00 */
+#ifdef SH_EX			/* 1997/10/18 (Sat) 16:00 */
 		name_len = strlen(entry_info->filename);
 
 		sprintf(name_buff, "%-30s", entry_info->filename);
@@ -2868,25 +2861,25 @@ unload_btree:
 		END(HTML_A);
 
 		if (entry_info->size) {
-#ifdef SH_EX	/* 1998/02/02 (Mon) 16:34:52 */
+#ifdef SH_EX			/* 1998/02/02 (Mon) 16:34:52 */
 		    if (entry_info->size < 1024)
 			sprintf(string_buffer, "%6d bytes",
-					       entry_info->size);
+				entry_info->size);
 		    else
 			sprintf(string_buffer, "%6d Kb",
-						entry_info->size/1024);
+				entry_info->size / 1024);
 #else
 		    if (entry_info->size < 1024)
 			sprintf(string_buffer, "  %d bytes",
-					       entry_info->size);
+				entry_info->size);
 		    else
 			sprintf(string_buffer, "  %dKb",
-						entry_info->size/1024);
+				entry_info->size / 1024);
 #endif
 		    PUTS(string_buffer);
 		}
 
-		PUTC('\n'); /* end of this entry */
+		PUTC('\n');	/* end of this entry */
 
 		free_entryinfo_struct_contents(entry_info);
 	    }
@@ -2898,13 +2891,12 @@ unload_btree:
 
     FREE(lastpath);
 
-    if (WasInterrupted || data_soc != -1) { /* should always be true */
+    if (WasInterrupted || data_soc != -1) {	/* should always be true */
 	/*
-	 *  Without closing the data socket first,
-	 *  the response(0) later may hang.
-	 *  Some servers expect the client to fin/ack the close
-	 *  of the data connection before proceeding with the
-	 *  conversation on the control connection. - kw
+	 * Without closing the data socket first, the response(0) later may
+	 * hang.  Some servers expect the client to fin/ack the close of the
+	 * data connection before proceeding with the conversation on the
+	 * control connection.  - kw
 	 */
 	CTRACE((tfp, "HTFTP: Closing data socket %d\n", data_soc));
 	status = NETCLOSE(data_soc);
@@ -2922,9 +2914,8 @@ unload_btree:
 /*
  * Setup an FTP connection.
  */
-static int setup_connection (
-	const char *		name,
-	HTParentAnchor *	anchor)
+static int setup_connection(const char *name,
+			    HTParentAnchor *anchor)
 {
     int retry;			/* How many times tried? */
     int status;
@@ -2936,7 +2927,7 @@ static int setup_connection (
     server_type = GENERIC_SERVER;
     ProFTPD_bugs = FALSE;
 
-    for (retry = 0; retry < 2; retry++) { /* For timed out/broken connections */
+    for (retry = 0; retry < 2; retry++) {	/* For timed out/broken connections */
 	status = get_connection(name, anchor);
 	if (status < 0)
 	    return status;
@@ -2944,44 +2935,44 @@ static int setup_connection (
 	if (!ftp_local_passive) {
 	    status = get_listen_socket();
 	    if (status < 0) {
-		NETCLOSE (control->socket);
+		NETCLOSE(control->socket);
 		control->socket = -1;
 #ifdef INET6
 		if (master_socket >= 0)
-		    (void)close_master_socket ();
+		    (void) close_master_socket();
 #else
-		close_master_socket ();
+		close_master_socket();
 #endif /* INET6 */
 		/* HT_INTERRUPTED would fall through, if we could interrupt
 		   somehow in the middle of it, which we currently can't. */
 		return status;
 	    }
-
 #ifdef REPEAT_PORT
-	    /*	Inform the server of the port number we will listen on
-	    */
+	    /*  Inform the server of the port number we will listen on
+	     */
 	    status = response(port_command);
 	    if (status == HT_INTERRUPTED) {
 		CTRACE((tfp, "HTFTP: Interrupted in response (port_command)\n"));
-		_HTProgress (CONNECTION_INTERRUPTED);
-		NETCLOSE (control->socket);
+		_HTProgress(CONNECTION_INTERRUPTED);
+		NETCLOSE(control->socket);
 		control->socket = -1;
-		close_master_socket ();
+		close_master_socket();
 		return HT_INTERRUPTED;
 	    }
-	    if (status != 2) {		/* Could have timed out */
+	    if (status != 2) {	/* Could have timed out */
 		if (status < 0)
-		    continue;		/* try again - net error*/
-		return -status;		/* bad reply */
+		    continue;	/* try again - net error */
+		return -status;	/* bad reply */
 	    }
 	    CTRACE((tfp, "HTFTP: Port defined.\n"));
 #endif /* REPEAT_PORT */
 	} else {		/* Tell the server to be passive */
 	    char *command = NULL;
 	    char *p;
-	    int h0, h1, h2, h3, p0, p1;	/* Parts of reply */
+	    int h0, h1, h2, h3, p0, p1;		/* Parts of reply */
+
 #ifdef INET6
-	    char dst[LINE_LENGTH+1];
+	    char dst[LINE_LENGTH + 1];
 #endif
 
 	    data_soc = status;
@@ -3000,18 +2991,16 @@ static int setup_connection (
 	    }
 
 	    if (strcmp(p, "PASV") == 0) {
-		for (p = response_text; *p && *p != ','; p++)
-		    ; /* null body */
+		for (p = response_text; *p && *p != ','; p++) ;		/* null body */
 
-		while (--p > response_text && '0' <= *p && *p <= '9')
-		    ; /* null body */
-		status = sscanf(p+1, "%d,%d,%d,%d,%d,%d",
-		       &h0, &h1, &h2, &h3, &p0, &p1);
+		while (--p > response_text && '0' <= *p && *p <= '9') ;		/* null body */
+		status = sscanf(p + 1, "%d,%d,%d,%d,%d,%d",
+				&h0, &h1, &h2, &h3, &p0, &p1);
 		if (status < 4) {
 		    fprintf(tfp, "HTFTP: PASV reply has no inet address!\n");
 		    return -99;
 		}
-		passive_port = (p0<<8) + p1;
+		passive_port = (p0 << 8) + p1;
 		sprintf(dst, "%d.%d.%d.%d", h0, h1, h2, h3);
 	    } else if (strcmp(p, "EPSV") == 0) {
 		unsigned char c0, c1, c2, c3;
@@ -3021,10 +3010,11 @@ static int setup_connection (
 		/*
 		 * EPSV bla (|||port|)
 		 */
-		for (p = response_text; *p && !isspace(*p); p++)
-		    ; /* null body */
-		for (/*nothing*/; *p && *p && *p != '('; p++)	/*)*/
-		    ; /* null body */
+		for (p = response_text; *p && !isspace(*p); p++) ;	/* null body */
+		for ( /*nothing */ ;
+		     *p && *p && *p != '(';
+		     p++)	/*) */
+		    ;		/* null body */
 		status = sscanf(p, "(%c%c%c%d%c)", &c0, &c1, &c2, &p0, &c3);
 		if (status != 5) {
 		    fprintf(tfp, "HTFTP: EPSV reply has invalid format!\n");
@@ -3033,13 +3023,13 @@ static int setup_connection (
 		passive_port = p0;
 
 		sslen = sizeof(ss);
-		if (getpeername(control->socket, (struct sockaddr *)&ss,
-		    &sslen) < 0) {
+		if (getpeername(control->socket, (struct sockaddr *) &ss,
+				&sslen) < 0) {
 		    fprintf(tfp, "HTFTP: getpeername(control) failed\n");
 		    return -99;
 		}
-		if (getnameinfo((struct sockaddr *)&ss, sslen, dst,
-		    sizeof(dst), NULL, 0, NI_NUMERICHOST)) {
+		if (getnameinfo((struct sockaddr *) &ss, sslen, dst,
+				sizeof(dst), NULL, 0, NI_NUMERICHOST)) {
 		    fprintf(tfp, "HTFTP: getnameinfo failed\n");
 		    return -99;
 		}
@@ -3048,25 +3038,23 @@ static int setup_connection (
 	    status = send_cmd_1("PASV");
 	    if (status != 2) {
 		if (status < 0)
-		    continue;		/* retry or Bad return */
-		return -status;		/* bad reply */
+		    continue;	/* retry or Bad return */
+		return -status;	/* bad reply */
 	    }
-	    for (p = response_text; *p && *p != ','; p++)
-		; /* null body */
+	    for (p = response_text; *p && *p != ','; p++) ;	/* null body */
 
-	    while (--p > response_text && '0' <= *p && *p <= '9')
-		; /* null body */
+	    while (--p > response_text && '0' <= *p && *p <= '9') ;	/* null body */
 
-	    status = sscanf(p+1, "%d,%d,%d,%d,%d,%d",
+	    status = sscanf(p + 1, "%d,%d,%d,%d,%d,%d",
 			    &h0, &h1, &h2, &h3, &p0, &p1);
 	    if (status < 4) {
 		fprintf(tfp, "HTFTP: PASV reply has no inet address!\n");
 		return -99;
 	    }
-	    passive_port = (PortNumber)((p0<<8) + p1);
+	    passive_port = (PortNumber) ((p0 << 8) + p1);
 #endif /* INET6 */
 	    CTRACE((tfp, "HTFTP: Server is listening on port %d\n",
-			 passive_port));
+		    passive_port));
 
 	    /* Open connection for data:  */
 
@@ -3074,7 +3062,7 @@ static int setup_connection (
 	    HTSprintf0(&command, "%s//%s:%d/", STR_FTP_URL, dst, passive_port);
 #else
 	    HTSprintf0(&command, "%s//%d.%d.%d.%d:%d/",
-		    STR_FTP_URL, h0, h1, h2, h3, passive_port);
+		       STR_FTP_URL, h0, h1, h2, h3, passive_port);
 #endif
 	    status = HTDoConnect(command, "FTP data", passive_port, &data_soc);
 	    FREE(command);
@@ -3082,44 +3070,48 @@ static int setup_connection (
 	    if (status < 0) {
 		(void) HTInetStatus(gettext("connect for data"));
 		NETCLOSE(data_soc);
-		return status;			/* Bad return */
+		return status;	/* Bad return */
 	    }
 
 	    CTRACE((tfp, "FTP data connected, socket %d\n", data_soc));
 	}
 	status = 0;
-	break;	/* No more retries */
+	break;			/* No more retries */
 
-    } /* for retries */
+    }				/* for retries */
     return status;
 }
 
 /*	Retrieve File from Server
-**	-------------------------
-**
-** On entry,
-**	name		WWW address of a file: document, including hostname
-** On exit,
-**	returns		Socket number for file if good.
-**			<0 if bad.
-*/
-int HTFTPLoad (
-	const char *		name,
-	HTParentAnchor *	anchor,
-	HTFormat		format_out,
-	HTStream *		sink)
+ *	-------------------------
+ *
+ * On entry,
+ *	name		WWW address of a file: document, including hostname
+ * On exit,
+ *	returns		Socket number for file if good.
+ *			<0 if bad.
+ */
+int HTFTPLoad(const char *name,
+	      HTParentAnchor *anchor,
+	      HTFormat format_out,
+	      HTStream *sink)
 {
     BOOL isDirectory = NO;
-    HTAtom * encoding = NULL;
+    HTAtom *encoding = NULL;
     int status, final_status;
     int outstanding = 1;	/* outstanding control connection responses
+
 				   that we are willing to wait for, if we
 				   get to the point of reading data - kw */
     HTFormat format;
 
-    CTRACE((tfp, "HTFTPLoad(%s) %s connection\n", name, ftp_local_passive ? "passive" : "normal"));
+    CTRACE((tfp, "HTFTPLoad(%s) %s connection\n",
+	    name,
+	    (ftp_local_passive
+	     ? "passive"
+	     : "normal")));
 
-    HTReadProgress(0,0);
+    HTReadProgress(0, 0);
 
     status = setup_connection(name, anchor);
     if (status < 0)
@@ -3129,21 +3121,22 @@ int HTFTPLoad (
 */
     {
 	char *filename = HTParse(name, "", PARSE_PATH + PARSE_PUNCTUATION);
-	char *fname = filename; /** Save for subsequent free() **/
+	char *fname = filename;	/* Save for subsequent free() */
 	char *vmsname = NULL;
 	BOOL binary;
 	char *type = NULL;
 	char *cp;
 
 	if (server_type == CMS_SERVER) {
-	    /** If the unescaped path has a %2f, reject it as illegal. - FM **/
+	    /* If the unescaped path has a %2f, reject it as illegal. - FM */
 	    if (((cp = strstr(filename, "%2")) != NULL) &&
 		TOUPPER(cp[2]) == 'F') {
 		FREE(fname);
-		init_help_message_cache();  /* to free memory */
+		init_help_message_cache();	/* to free memory */
 		NETCLOSE(control->socket);
 		control->socket = -1;
-		CTRACE((tfp, "HTFTP: Rejecting path due to illegal escaped slash.\n"));
+		CTRACE((tfp,
+			"HTFTP: Rejecting path due to illegal escaped slash.\n"));
 		return -1;
 	    }
 	}
@@ -3153,10 +3146,10 @@ int HTFTPLoad (
 	    type = "D";
 	} else if ((type = strrchr(filename, ';')) != NULL) {
 	    /*
-	    **	Check and trim the type= parameter. - FM
-	    */
-	    if (!strncasecomp((type+1), "type=", 5)) {
-		switch(TOUPPER(*(type+6))) {
+	     * Check and trim the type= parameter.  - FM
+	     */
+	    if (!strncasecomp((type + 1), "type=", 5)) {
+		switch (TOUPPER(*(type + 6))) {
 		case 'D':
 		    *type = '\0';
 		    type = "D";
@@ -3175,7 +3168,7 @@ int HTFTPLoad (
 		}
 		if (!*filename) {
 		    *filename = '/';
-		    *(filename+1) = '\0';
+		    *(filename + 1) = '\0';
 		}
 	    }
 	    if (*type != '\0') {
@@ -3186,26 +3179,26 @@ int HTFTPLoad (
 	CTRACE((tfp, "HTFTP: UnEscaped %s\n", filename));
 	if (filename[1] == '~') {
 	    /*
-	    ** Check if translation of HOME as tilde is supported,
-	    ** and adjust filename if so. - FM
-	    */
+	     * Check if translation of HOME as tilde is supported,
+	     * and adjust filename if so. - FM
+	     */
 	    char *cp2 = NULL;
 	    char *fn = NULL;
 
-	    if ((cp2 = strchr((filename+1), '/')) != NULL) {
+	    if ((cp2 = strchr((filename + 1), '/')) != NULL) {
 		*cp2 = '\0';
 	    }
 	    status = send_cmd_1("PWD");
 	    if (status == 2 && response_text[5] == '/') {
-		status = send_cwd(filename+1);
+		status = send_cwd(filename + 1);
 		if (status == 2) {
-		    StrAllocCopy(fn, (filename+1));
+		    StrAllocCopy(fn, (filename + 1));
 		    if (cp2) {
 			*cp2 = '/';
-			if (fn[strlen(fn)-1] != '/') {
+			if (fn[strlen(fn) - 1] != '/') {
 			    StrAllocCat(fn, cp2);
 			} else {
-			    StrAllocCat(fn, (cp2+1));
+			    StrAllocCat(fn, (cp2 + 1));
 			}
 			cp2 = NULL;
 		    }
@@ -3219,14 +3212,15 @@ int HTFTPLoad (
 	}
 	if (strlen(filename) > 3) {
 	    char *cp2;
-	    if (((cp2=strrchr(filename, '.')) != NULL &&
+
+	    if (((cp2 = strrchr(filename, '.')) != NULL &&
 		 0 == strncasecomp(cp2, ".me", 3)) &&
 		(cp2[3] == '\0' || cp2[3] == ';')) {
 		/*
-		**  Don't treat this as application/x-Troff-me
-		**  if it's a Unix server but has the string
-		**  "read.me", or if it's not a Unix server. - FM
-		*/
+		 * Don't treat this as application/x-Troff-me if it's a Unix
+		 * server but has the string "read.me", or if it's not a Unix
+		 * server.  - FM
+		 */
 		if ((server_type != UNIX_SERVER) ||
 		    (cp2 > (filename + 3) &&
 		     0 == strncasecomp((cp2 - 4), "read.me", 7))) {
@@ -3244,15 +3238,14 @@ int HTFTPLoad (
 	}
 	format = HTCharsetFormat(format, anchor, -1);
 	binary = (BOOL) (encoding != HTAtom_for("8bit") &&
-		  encoding != HTAtom_for("7bit"));
+			 encoding != HTAtom_for("7bit"));
 	if (!binary &&
-	    /*
-	    **	Force binary if we're in source, download or dump
-	    **	mode and this is not a VM/CMS server, so we don't
-	    **	get CRLF instead of LF (or CR) for newlines in text
-	    **	files.	Can't do this for VM/CMS or we'll get
-	    **	raw EBCDIC.  - FM
-	    */
+	/*
+	 * Force binary if we're in source, download or dump mode and this is
+	 * not a VM/CMS server, so we don't get CRLF instead of LF (or CR) for
+	 * newlines in text files.  Can't do this for VM/CMS or we'll get raw
+	 * EBCDIC.  - FM
+	 */
 	    (format_out == WWW_SOURCE ||
 	     format_out == HTAtom_for("www/download") ||
 	     format_out == HTAtom_for("www/dump")) &&
@@ -3260,126 +3253,176 @@ int HTFTPLoad (
 	    binary = TRUE;
 	if (!binary && type && *type == 'I') {
 	    /*
-	    **	Force binary if we had ;type=I - FM
-	    */
+	     * Force binary if we had ;type=I - FM
+	     */
 	    binary = TRUE;
 	} else if (binary && type && *type == 'A') {
 	    /*
-	    **	Force ASCII if we had ;type=A - FM
-	    */
+	     * Force ASCII if we had ;type=A - FM
+	     */
 	    binary = FALSE;
 	}
 	if (binary != control->binary) {
 	    /*
-	    **	Act on our setting if not already set. - FM
-	    */
-	    char * mode = binary ? "I" : "A";
+	     * Act on our setting if not already set.  - FM
+	     */
+	    char *mode = binary ? "I" : "A";
+
 	    status = send_cmd_2("TYPE", mode);
 	    if (status != 2) {
-		init_help_message_cache();  /* to free memory */
+		init_help_message_cache();	/* to free memory */
 		return ((status < 0) ? status : -status);
 	    }
 	    control->binary = binary;
 	}
 	switch (server_type) {
-	/*
-	**  Handle what for Lynx are special case servers, e.g.,
-	**  for which we respect RFC 1738, or which have known
-	**  conflicts in suffix mappings. - FM
-	*/
+	    /*
+	     * Handle what for Lynx are special case servers, e.g., for which
+	     * we respect RFC 1738, or which have known conflicts in suffix
+	     * mappings.  - FM
+	     */
 	case VMS_SERVER:
-	  {
-	    char *cp1, *cp2;
-	    BOOL included_device = FALSE;
-	    BOOL found_tilde = FALSE;
-	    /** Accept only Unix-style filename **/
-	    if (strchr(filename, ':') != NULL ||
-		strchr(filename, '[') != NULL) {
-		FREE(fname);
-		init_help_message_cache();  /* to free memory */
-		NETCLOSE(control->socket);
-		control->socket = -1;
-		CTRACE((tfp, "HTFTP: Rejecting path due to non-Unix-style syntax.\n"));
-		return -1;
-	    }
-	    /** Handle any unescaped "/%2F" path **/
-	    if (!strncmp(filename, "//", 2)) {
-		int i;
-		included_device = TRUE;
-		for (i = 0; filename[(i+1)]; i++)
-		    filename[i] = filename[(i+1)];
-		filename[i] = '\0';
-		CTRACE((tfp, "HTFTP: Trimmed '%s'\n", filename));
-		cp = HTVMS_name("", filename);
-		CTRACE((tfp, "HTFTP: VMSized '%s'\n", cp));
-		if ((cp1=strrchr(cp, ']')) != NULL) {
-		    strcpy(filename, ++cp1);
-		    CTRACE((tfp, "HTFTP: Filename '%s'\n", filename));
-		    *cp1 = '\0';
-		    status = send_cwd(cp);
-		    if (status != 2) {
-			char *dotslash = 0;
-			if ((cp1=strchr(cp, '[')) != NULL) {
-			    *cp1++ = '\0';
-			    status = send_cwd(cp);
-			    if (status != 2) {
-				FREE(fname);
-				init_help_message_cache(); /* to free memory */
-				NETCLOSE(control->socket);
-				control->socket = -1;
-				return ((status < 0) ? status : -status);
-			    }
-			    HTSprintf0(&dotslash, "[.%s", cp1);
-			    status = send_cwd(dotslash);
-			    FREE(dotslash);
-			    if (status != 2) {
+	    {
+		char *cp1, *cp2;
+		BOOL included_device = FALSE;
+		BOOL found_tilde = FALSE;
+
+		/* Accept only Unix-style filename */
+		if (strchr(filename, ':') != NULL ||
+		    strchr(filename, '[') != NULL) {
+		    FREE(fname);
+		    init_help_message_cache();	/* to free memory */
+		    NETCLOSE(control->socket);
+		    control->socket = -1;
+		    CTRACE((tfp,
+			    "HTFTP: Rejecting path due to non-Unix-style syntax.\n"));
+		    return -1;
+		}
+		/* Handle any unescaped "/%2F" path */
+		if (!strncmp(filename, "//", 2)) {
+		    int i;
+
+		    included_device = TRUE;
+		    for (i = 0; filename[(i + 1)]; i++)
+			filename[i] = filename[(i + 1)];
+		    filename[i] = '\0';
+		    CTRACE((tfp, "HTFTP: Trimmed '%s'\n", filename));
+		    cp = HTVMS_name("", filename);
+		    CTRACE((tfp, "HTFTP: VMSized '%s'\n", cp));
+		    if ((cp1 = strrchr(cp, ']')) != NULL) {
+			strcpy(filename, ++cp1);
+			CTRACE((tfp, "HTFTP: Filename '%s'\n", filename));
+			*cp1 = '\0';
+			status = send_cwd(cp);
+			if (status != 2) {
+			    char *dotslash = 0;
+
+			    if ((cp1 = strchr(cp, '[')) != NULL) {
+				*cp1++ = '\0';
+				status = send_cwd(cp);
+				if (status != 2) {
+				    FREE(fname);
+				    init_help_message_cache();	/* to free memory */
+				    NETCLOSE(control->socket);
+				    control->socket = -1;
+				    return ((status < 0) ? status : -status);
+				}
+				HTSprintf0(&dotslash, "[.%s", cp1);
+				status = send_cwd(dotslash);
+				FREE(dotslash);
+				if (status != 2) {
+				    FREE(fname);
+				    init_help_message_cache();	/* to free memory */
+				    NETCLOSE(control->socket);
+				    control->socket = -1;
+				    return ((status < 0) ? status : -status);
+				}
+			    } else {
 				FREE(fname);
-				init_help_message_cache(); /* to free memory */
+				init_help_message_cache();	/* to free memory */
 				NETCLOSE(control->socket);
 				control->socket = -1;
 				return ((status < 0) ? status : -status);
 			    }
-			} else {
-			    FREE(fname);
-			    init_help_message_cache();	/* to free memory */
-			    NETCLOSE(control->socket);
-			    control->socket = -1;
-			    return ((status < 0) ? status : -status);
 			}
-		    }
-		} else if ((cp1=strchr(cp, ':')) != NULL &&
-			   strchr(cp, '[') == NULL &&
-			   strchr(cp, ']') == NULL) {
-		    cp1++;
-		    if (*cp1 != '\0') {
-			strcpy(filename, cp1);
-			CTRACE((tfp, "HTFTP: Filename '%s'\n", filename));
-			HTSprintf0(&vmsname, "%.*s[%s]", cp1-cp, cp, filename);
-			status = send_cwd(vmsname);
-			if (status != 2) {
-			    HTSprintf(&vmsname, "%.*s[000000]", cp1-cp, cp);
+		    } else if ((cp1 = strchr(cp, ':')) != NULL &&
+			       strchr(cp, '[') == NULL &&
+			       strchr(cp, ']') == NULL) {
+			cp1++;
+			if (*cp1 != '\0') {
+			    strcpy(filename, cp1);
+			    CTRACE((tfp, "HTFTP: Filename '%s'\n", filename));
+			    HTSprintf0(&vmsname, "%.*s[%s]", cp1 - cp, cp, filename);
 			    status = send_cwd(vmsname);
 			    if (status != 2) {
-				HTSprintf(&vmsname, "%.*s", cp1-cp, cp);
+				HTSprintf(&vmsname, "%.*s[000000]", cp1 - cp, cp);
 				status = send_cwd(vmsname);
 				if (status != 2) {
-				    FREE(fname);
-				    init_help_message_cache();
-				    NETCLOSE(control->socket);
-				    control->socket = -1;
-				    return ((status < 0) ? status : -status);
+				    HTSprintf(&vmsname, "%.*s", cp1 - cp, cp);
+				    status = send_cwd(vmsname);
+				    if (status != 2) {
+					FREE(fname);
+					init_help_message_cache();
+					NETCLOSE(control->socket);
+					control->socket = -1;
+					return ((status < 0) ? status : -status);
+				    }
 				}
+			    } else {
+				HTSprintf0(&vmsname, "000000");
+				filename = vmsname;
 			    }
-			} else {
-			    HTSprintf0(&vmsname, "000000");
-			    filename = vmsname;
 			}
+		    } else if (0 == strcmp(cp, (filename + 1))) {
+			status = send_cwd(cp);
+			if (status != 2) {
+			    HTSprintf0(&vmsname, "%s:", cp);
+			    status = send_cwd(vmsname);
+			    if (status != 2) {
+				FREE(fname);
+				init_help_message_cache();	/* to free memory */
+				NETCLOSE(control->socket);
+				control->socket = -1;
+				return ((status < 0) ? status : -status);
+			    }
+			}
+			HTSprintf0(&vmsname, "000000");
+			filename = vmsname;
 		    }
-		} else if (0==strcmp(cp, (filename+1))) {
-		    status = send_cwd(cp);
+		}
+		/* Trim trailing slash if filename is not the top directory */
+		if (strlen(filename) > 1 && filename[strlen(filename) - 1] == '/')
+		    filename[strlen(filename) - 1] = '\0';
+
+#ifdef MAINTAIN_CONNECTION	/* Don't need this if always new connection - F.M. */
+		if (!included_device) {
+		    /* Get the current default VMS device:[directory] */
+		    status = send_cmd_1("PWD");
 		    if (status != 2) {
-			HTSprintf0(&vmsname, "%s:", cp);
-			status = send_cwd(vmsname);
+			FREE(fname);
+			init_help_message_cache();	/* to free memory */
+			NETCLOSE(control->socket);
+			control->socket = -1;
+			return ((status < 0) ? status : -status);
+		    }
+		    /* Go to the VMS account's top directory */
+		    if ((cp = strchr(response_text, '[')) != NULL &&
+			(cp1 = strrchr(response_text, ']')) != NULL) {
+			char *tmp = 0;
+			unsigned len = 4;
+
+			StrAllocCopy(tmp, cp);
+			if ((cp2 = strchr(cp, '.')) != NULL && cp2 < cp1) {
+			    len += (cp2 - cp);
+			} else {
+			    len += (cp1 - cp);
+			}
+			tmp[len] = 0;
+			StrAllocCat(tmp, "]");
+
+			status = send_cwd(tmp);
+			FREE(tmp);
+
 			if (status != 2) {
 			    FREE(fname);
 			    init_help_message_cache();	/* to free memory */
@@ -3388,188 +3431,143 @@ int HTFTPLoad (
 			    return ((status < 0) ? status : -status);
 			}
 		    }
-		    HTSprintf0(&vmsname, "000000");
-		    filename = vmsname;
 		}
-	    }
-	    /** Trim trailing slash if filename is not the top directory **/
-	    if (strlen(filename) > 1 && filename[strlen(filename)-1] == '/')
-		filename[strlen(filename)-1] = '\0';
+#endif /* MAINTAIN_CONNECTION */
 
-#ifdef MAINTAIN_CONNECTION /* Don't need this if always new connection - F.M. */
-	    if (!included_device) {
-		/** Get the current default VMS device:[directory] **/
-		status = send_cmd_1("PWD");
-		if (status != 2) {
+		/* If we want the VMS account's top directory, list it now */
+		if (!(strcmp(filename, "/~")) ||
+		    (included_device && 0 == strcmp(filename, "000000")) ||
+		    (strlen(filename) == 1 && *filename == '/')) {
+		    isDirectory = YES;
+		    status = send_cmd_1("LIST");
 		    FREE(fname);
-		    init_help_message_cache();	/* to free memory */
-		    NETCLOSE(control->socket);
-		    control->socket = -1;
-		    return ((status < 0) ? status : -status);
+		    if (status != 1) {
+			/* Action not started */
+			init_help_message_cache();	/* to free memory */
+			NETCLOSE(control->socket);
+			control->socket = -1;
+			return ((status < 0) ? status : -status);
+		    }
+		    /* Big goto! */
+		    goto listen;
 		}
-		/** Go to the VMS account's top directory **/
-		if ((cp=strchr(response_text, '[')) != NULL &&
-		    (cp1=strrchr(response_text, ']')) != NULL) {
+		/* Otherwise, go to appropriate directory and doctor filename */
+		if (!strncmp(filename, "/~", 2)) {
+		    filename += 2;
+		    found_tilde = TRUE;
+		}
+		CTRACE((tfp, "check '%s' to translate x/y/ to [.x.y]\n", filename));
+		if (!included_device &&
+		    (cp = strchr(filename, '/')) != NULL &&
+		    (cp1 = strrchr(cp, '/')) != NULL &&
+		    (cp1 - cp) > 1) {
 		    char *tmp = 0;
-		    unsigned len = 4;
 
-		    StrAllocCopy(tmp, cp);
-		    if ((cp2=strchr(cp, '.')) != NULL && cp2 < cp1) {
-			len += (cp2 - cp);
-		    } else {
-			len += (cp1 - cp);
-		    }
-		    tmp[len] = 0;
-		    StrAllocCat(tmp, "]");
+		    HTSprintf0(&tmp, "[.%.*s]", cp1 - cp - 1, cp + 1);
+
+		    CTRACE((tfp, "change path '%s'\n", tmp));
+		    while ((cp2 = strrchr(tmp, '/')) != NULL)
+			*cp2 = '.';
+		    CTRACE((tfp, "...to  path '%s'\n", tmp));
 
 		    status = send_cwd(tmp);
 		    FREE(tmp);
 
 		    if (status != 2) {
 			FREE(fname);
-			init_help_message_cache();  /* to free memory */
+			init_help_message_cache();	/* to free memory */
 			NETCLOSE(control->socket);
 			control->socket = -1;
 			return ((status < 0) ? status : -status);
 		    }
+		    filename = cp1 + 1;
+		} else {
+		    if (!included_device && !found_tilde) {
+			filename += 1;
+		    }
 		}
+		break;
 	    }
-#endif /* MAINTAIN_CONNECTION */
-
-	    /** If we want the VMS account's top directory, list it now **/
-	    if (!(strcmp(filename, "/~")) ||
-		(included_device && 0==strcmp(filename, "000000")) ||
-		(strlen(filename) == 1 && *filename == '/')) {
-		isDirectory = YES;
-		status = send_cmd_1("LIST");
-		FREE(fname);
-		if (status != 1) {
-		    /* Action not started */
-		    init_help_message_cache();	/* to free memory */
-		    NETCLOSE(control->socket);
-		    control->socket = -1;
-		    return ((status < 0) ? status : -status);
-		}
-		/** Big goto! **/
-		goto listen;
-	    }
-	    /** Otherwise, go to appropriate directory and doctor filename **/
-	    if (!strncmp(filename, "/~", 2)) {
-		filename += 2;
-		found_tilde = TRUE;
-	    }
-	    CTRACE((tfp, "check '%s' to translate x/y/ to [.x.y]\n", filename));
-	    if (!included_device &&
-		(cp = strchr(filename, '/')) != NULL &&
-		(cp1 = strrchr(cp, '/')) != NULL &&
-		(cp1 - cp) > 1) {
-		char *tmp = 0;
-
-		HTSprintf0(&tmp, "[.%.*s]", cp1-cp-1, cp+1);
-
-		CTRACE((tfp, "change path '%s'\n", tmp));
-		while ((cp2 = strrchr(tmp, '/')) != NULL)
-		    *cp2 = '.';
-		CTRACE((tfp, "...to  path '%s'\n", tmp));
-
-		status = send_cwd(tmp);
-		FREE(tmp);
-
-		if (status != 2) {
-		    FREE(fname);
-		    init_help_message_cache();	/* to free memory */
-		    NETCLOSE(control->socket);
-		    control->socket = -1;
-		    return ((status < 0) ? status : -status);
-		}
-		filename = cp1+1;
-	    } else {
-		if (!included_device && !found_tilde) {
-		    filename += 1;
-		}
-	    }
-	    break;
-	  }
 	case CMS_SERVER:
-	  {
-	    /*
-	    **	If we want the CMS account's top directory, or a base
-	    **	SFS or anonymous directory path (i.e., without a slash),
-	    **	list it now. FM
-	    */
-	    if ((strlen(filename) == 1 && *filename == '/') ||
-		((0 == strncasecomp((filename+1), "vmsysu:", 7)) &&
-		 (cp = strchr((filename+1), '.')) != NULL &&
-		 strchr(cp, '/') == NULL) ||
-		(0 == strncasecomp(filename+1, "anonymou.", 9) &&
-		 strchr(filename+1, '/') == NULL)) {
-		if (filename[1] != '\0') {
-		    status = send_cwd(filename+1);
-		    if (status != 2) {
+	    {
+		/*
+		 * If we want the CMS account's top directory, or a base SFS or
+		 * anonymous directory path (i.e., without a slash), list it
+		 * now.  FM
+		 */
+		if ((strlen(filename) == 1 && *filename == '/') ||
+		    ((0 == strncasecomp((filename + 1), "vmsysu:", 7)) &&
+		     (cp = strchr((filename + 1), '.')) != NULL &&
+		     strchr(cp, '/') == NULL) ||
+		    (0 == strncasecomp(filename + 1, "anonymou.", 9) &&
+		     strchr(filename + 1, '/') == NULL)) {
+		    if (filename[1] != '\0') {
+			status = send_cwd(filename + 1);
+			if (status != 2) {
+			    /* Action not started */
+			    init_help_message_cache();	/* to free memory */
+			    NETCLOSE(control->socket);
+			    control->socket = -1;
+			    return ((status < 0) ? status : -status);
+			}
+		    }
+		    isDirectory = YES;
+		    if (use_list)
+			status = send_cmd_1("LIST");
+		    else
+			status = send_cmd_1("NLST");
+		    FREE(fname);
+		    if (status != 1) {
 			/* Action not started */
-			init_help_message_cache();  /* to free memory */
+			init_help_message_cache();	/* to free memory */
 			NETCLOSE(control->socket);
 			control->socket = -1;
 			return ((status < 0) ? status : -status);
 		    }
+		    /* Big goto! */
+		    goto listen;
 		}
-		isDirectory = YES;
-		if (use_list)
-		    status = send_cmd_1("LIST");
-		else
-		    status = send_cmd_1("NLST");
-		FREE(fname);
-		if (status != 1) {
-		    /* Action not started */
-		    init_help_message_cache();	/* to free memory */
-		    NETCLOSE(control->socket);
-		    control->socket = -1;
-		    return ((status < 0) ? status : -status);
-		}
-		/** Big goto! **/
-		goto listen;
-	    }
-	    filename++;
+		filename++;
 
-	    /** Otherwise, go to appropriate directory and adjust filename **/
-	    while ((cp = strchr(filename, '/')) != NULL) {
-		*cp++ = '\0';
-		status = send_cwd(filename);
-		if (status == 2) {
-		    if (*cp == '\0') {
-			isDirectory = YES;
-			if (use_list)
-			    status = send_cmd_1("LIST");
-			else
-			    status = send_cmd_1("NLST");
-			FREE(fname);
-			if (status != 1) {
-			    /** Action not started **/
-			    init_help_message_cache();	/* to free memory */
-			    NETCLOSE(control->socket);
-			    control->socket = -1;
-			    return ((status < 0) ? status : -status);
+		/* Otherwise, go to appropriate directory and adjust filename */
+		while ((cp = strchr(filename, '/')) != NULL) {
+		    *cp++ = '\0';
+		    status = send_cwd(filename);
+		    if (status == 2) {
+			if (*cp == '\0') {
+			    isDirectory = YES;
+			    if (use_list)
+				status = send_cmd_1("LIST");
+			    else
+				status = send_cmd_1("NLST");
+			    FREE(fname);
+			    if (status != 1) {
+				/* Action not started */
+				init_help_message_cache();	/* to free memory */
+				NETCLOSE(control->socket);
+				control->socket = -1;
+				return ((status < 0) ? status : -status);
+			    }
+			    /* Clear any messages from the login directory */
+			    init_help_message_cache();
+			    /* Big goto! */
+			    goto listen;
 			}
-			/** Clear any messages from the login directory **/
-			init_help_message_cache();
-			/** Big goto! **/
-			goto listen;
+			filename = cp;
 		    }
-		    filename = cp;
 		}
+		break;
 	    }
-	    break;
-	  }
 	default:
-	    /** Shift for any unescaped "/%2F" path **/
+	    /* Shift for any unescaped "/%2F" path */
 	    if (!strncmp(filename, "//", 2))
 		filename++;
 	    break;
 	}
 	/*
-	**  Act on a file or listing request, or try to figure out
-	**  which we're dealing with if we don't know yet. - FM
-	*/
+	 * Act on a file or listing request, or try to figure out which we're
+	 * dealing with if we don't know yet.  - FM
+	 */
 	if (!(type) || (type && *type != 'D')) {
 	    status = send_cmd_2("RETR", filename);
 #ifdef BROKEN_PROFTPD
@@ -3593,7 +3591,7 @@ int HTFTPLoad (
 	    status = 5;		/* Failed status set as flag. - FM */
 	}
 	if (status != 1) {	/* Failed : try to CWD to it */
-	    /** Clear any login messages if this isn't the login directory **/
+	    /* Clear any login messages if this isn't the login directory */
 	    if (strcmp(filename, "/"))
 		init_help_message_cache();
 
@@ -3619,34 +3617,36 @@ int HTFTPLoad (
 	}
     }
 
-listen:
-    if(!ftp_local_passive) {
+  listen:
+    if (!ftp_local_passive) {
 	/* Wait for the connection */
 #ifdef INET6
 	struct sockaddr_storage soc_address;
+
 #else
 	struct sockaddr_in soc_address;
 #endif /* INET6 */
-	int	soc_addrlen=sizeof(soc_address);
+	int soc_addrlen = sizeof(soc_address);
+
 #ifdef SOCKS
 	if (socks_flag)
 	    status = Raccept(master_socket,
-			     (struct sockaddr *)&soc_address,
-			     (void *)&soc_addrlen);
+			     (struct sockaddr *) &soc_address,
+			     (void *) &soc_addrlen);
 	else
 #endif /* SOCKS */
-	status = accept(master_socket,
-			(struct sockaddr *)&soc_address,
-			(void *)&soc_addrlen);
+	    status = accept(master_socket,
+			    (struct sockaddr *) &soc_address,
+			    (void *) &soc_addrlen);
 	if (status < 0) {
 	    init_help_message_cache();	/* to free memory */
 	    return HTInetStatus("accept");
 	}
 	CTRACE((tfp, "TCP: Accepted new socket %d\n", status));
 	data_soc = status;
-    } /* !ftp_local_passive */
-
-#if 0	/* no - this makes the data connection go away too soon (2.8.3dev.22) */
+    }
+    /* !ftp_local_passive */
+#if 0				/* no - this makes the data connection go away too soon (2.8.3dev.22) */
     if ((status = send_cmd_nowait("QUIT")) == 1)
 	outstanding++;
 #endif
@@ -3658,7 +3658,7 @@ listen:
 	    CTRACE((tfp, "HTFTP: Treating as \"dls\" server.\n"));
 	    server_type = DLS_SERVER;
 	}
-	final_status = read_directory (anchor, name, format_out, sink);
+	final_status = read_directory(anchor, name, format_out, sink);
 	if (final_status > 0) {
 	    if (server_type != CMS_SERVER)
 		if (outstanding-- > 0) {
@@ -3674,7 +3674,7 @@ listen:
 	    outstanding = 0;
 	}
 
-	if (data_soc != -1) { /* normally done in read_directory */
+	if (data_soc != -1) {	/* normally done in read_directory */
 	    CTRACE((tfp, "HTFTP: Closing data socket %d\n", data_soc));
 	    status = NETCLOSE(data_soc);
 	    if (status == -1)
@@ -3685,16 +3685,15 @@ listen:
 	int rv;
 	char *FileName = HTParse(name, "", PARSE_PATH + PARSE_PUNCTUATION);
 
-	/** Clear any login messages **/
+	/* Clear any login messages */
 	init_help_message_cache();
 
-	/** Fake a Content-Encoding for compressed files. - FM **/
+	/* Fake a Content-Encoding for compressed files. - FM */
 	HTUnEscape(FileName);
 	if (!IsUnityEnc(encoding)) {
 	    /*
-	     *	We already know from the call to HTFileFormat above that
-	     *	this is a compressed file, no need to look at the filename
-	     *	again. - kw
+	     * We already know from the call to HTFileFormat above that this is
+	     * a compressed file, no need to look at the filename again.  - kw
 	     */
 	    StrAllocCopy(anchor->content_type, format->name);
 	    StrAllocCopy(anchor->content_encoding, HTAtom_name(encoding));
@@ -3728,14 +3727,14 @@ listen:
 	}
 	FREE(FileName);
 
-	_HTProgress (gettext("Receiving FTP file."));
+	_HTProgress(gettext("Receiving FTP file."));
 	rv = HTParseSocket(format, format_out, anchor, data_soc, sink);
 
 	HTInitInput(control->socket);
 	/* Reset buffering to control connection DD 921208 */
 
 	if (rv < 0) {
-#if 0	/* any known servers where ABOR would work this way? */
+#if 0				/* any known servers where ABOR would work this way? */
 	    if (rv == HT_INTERRUPTED || rv == -501)
 		if (send_cmd_nowait("ABOR") == 1) {
 		    outstanding++;
@@ -3752,16 +3751,16 @@ listen:
 	    CTRACE((tfp, "HTFTP: Closing data socket %d\n", data_soc));
 	    status = NETCLOSE(data_soc);
 	} else
-	    status = 2;	/* data_soc already closed in HTCopy - kw */
+	    status = 2;		/* data_soc already closed in HTCopy - kw */
 
 	if (status < 0 && rv != HT_INTERRUPTED && rv != -1) {
 	    (void) HTInetStatus("close");	/* Comment only */
 	} else {
 	    if (rv != HT_LOADED && outstanding--) {
-		status = response(0);		/* Pick up final reply */
+		status = response(0);	/* Pick up final reply */
 		if (status != 2 && rv != HT_INTERRUPTED && rv != -1) {
-		    data_soc = -1;		/* invalidate it */
-		    init_help_message_cache();  /* to free memory */
+		    data_soc = -1;	/* invalidate it */
+		    init_help_message_cache();	/* to free memory */
 		    return HTLoadError(sink, 500, response_text);
 		} else if (status <= 0) {
 		    outstanding = 0;
@@ -3777,7 +3776,7 @@ listen:
 	if (status == 2 && !strncmp(response_text, "221", 3))
 	    break;
     }
-    data_soc = -1;			/* invalidate it */
+    data_soc = -1;		/* invalidate it */
     CTRACE((tfp, "HTFTPLoad: normal end; "));
     if (control->socket < 0) {
 	CTRACE((tfp, "control socket is %d\n", control->socket));
@@ -3788,28 +3787,26 @@ listen:
 	    HTInetStatus("control connection close");	/* Comment only */
     }
     control->socket = -1;
-    init_help_message_cache();  /* to free memory */
-      /* returns HT_LOADED (always for file if we get here) or error */
+    init_help_message_cache();	/* to free memory */
+    /* returns HT_LOADED (always for file if we get here) or error */
     return final_status;
-} /* open_file_read */
+}				/* open_file_read */
 
 /*
-**  This function frees any user entered password, so that
-**  it must be entered again for a future request. - FM
-*/
-void HTClearFTPPassword (void)
+ *  This function frees any user entered password, so that
+ *  it must be entered again for a future request. - FM
+ */
+void HTClearFTPPassword(void)
 {
     /*
-    **	Need code to check cached documents from
-    **	non-anonymous ftp accounts and do something
-    **	to ensure that they no longer can be accessed
-    **	without a new retrieval. - FM
-    */
+     * Need code to check cached documents from non-anonymous ftp accounts and
+     * do something to ensure that they no longer can be accessed without a new
+     * retrieval.  - FM
+     */
 
     /*
-    **	Now free the current user entered password,
-    **	if any. - FM
-    */
+     * Now free the current user entered password, if any.  - FM
+     */
     FREE(user_entered_password);
 }
 
diff --git a/WWW/Library/Implementation/HTFTP.h b/WWW/Library/Implementation/HTFTP.h
index 6036e266..75e60aaf 100644
--- a/WWW/Library/Implementation/HTFTP.h
+++ b/WWW/Library/Implementation/HTFTP.h
@@ -18,24 +18,22 @@
 #define FILE_BY_TYPE 1
 #define FILE_BY_SIZE 2
 #define FILE_BY_DATE 3
-extern int HTfileSortMethod;  /* specifies the method of sorting */
 
+extern int HTfileSortMethod;	/* specifies the method of sorting */
 
 /* PUBLIC						 HTVMS_name()
-**		CONVERTS WWW name into a VMS name
-** ON ENTRY:
-**	nn		Node Name (optional)
-**	fn		WWW file name
-**
-** ON EXIT:
-**	returns		vms file specification
-**
-** Bug:	Returns pointer to static -- non-reentrant
-*/
-extern char * HTVMS_name (
-	const char * nn,
-	const char * fn);
-
+ *		CONVERTS WWW name into a VMS name
+ * ON ENTRY:
+ *	nn		Node Name (optional)
+ *	fn		WWW file name
+ *
+ * ON EXIT:
+ *	returns		vms file specification
+ *
+ * Bug:	Returns pointer to static -- non-reentrant
+ */
+extern char *HTVMS_name(const char *nn,
+			const char *fn);
 
 /*
 
@@ -46,25 +44,22 @@ Retrieve File from Server
   returns                 Socket number for file if good.<0 if bad.
 
  */
-extern int HTFTPLoad 
-(
-  const char *          name,
-  HTParentAnchor *      anchor,
-  HTFormat              format_out,
-  HTStream*             sink
-);
+extern int HTFTPLoad(const char *name,
+		     HTParentAnchor *anchor,
+		     HTFormat format_out,
+		     HTStream *sink);
 
 /*
-**  This function frees any user entered password, so that
-**  it must be entered again for a future request. - FM
-*/
-extern void HTClearFTPPassword (void);
+ *  This function frees any user entered password, so that
+ *  it must be entered again for a future request. - FM
+ */
+extern void HTClearFTPPassword(void);
 
 /*
 
 Return Host Name
 
  */
-extern const char * HTHostName (void);
+extern const char *HTHostName(void);
 
 #endif
diff --git a/WWW/Library/Implementation/HTFWriter.c b/WWW/Library/Implementation/HTFWriter.c
index 2f398f84..889deedb 100644
--- a/WWW/Library/Implementation/HTFWriter.c
+++ b/WWW/Library/Implementation/HTFWriter.c
@@ -1,12 +1,12 @@
 /*		FILE WRITER				HTFWrite.h
-**		===========
-**
-**	This version of the stream object just writes to a C file.
-**	The file is assumed open and left open.
-**
-**	Bugs:
-**		strings written must be less than buffer size.
-*/
+ *		===========
+ *
+ *	This version of the stream object just writes to a C file.
+ *	The file is assumed open and left open.
+ *
+ *	Bugs:
+ *		strings written must be less than buffer size.
+ */
 
 #include <HTUtils.h>
 
@@ -20,119 +20,115 @@
 #include <LYLeaks.h>
 
 /*		Stream Object
-**		------------
-*/
+ *		------------
+ */
 
 struct _HTStream {
-	const HTStreamClass *	isa;
+    const HTStreamClass *isa;
 
-	FILE *			fp;
-	char *			end_command;
-	char *			remove_command;
-	BOOL			announce;
+    FILE *fp;
+    char *end_command;
+    char *remove_command;
+    BOOL announce;
 };
 
-
 /*_________________________________________________________________________
-**
-**		B L A C K    H O L E    C L A S S
-**
-**	There is only one black hole instance shared by anyone
-**	who wanst a black hole.  These black holes don't radiate,
-**	they just absorb data.
-*/
-static void HTBlackHole_put_character (HTStream * me, char c)
-{}
-static void HTBlackHole_put_string (HTStream * me, const char* s)
-{}
-static void HTBlackHole_write (HTStream * me, const char* s, int l)
-{}
-static void HTBlackHole_free (HTStream * me)
-{}
-static void HTBlackHole_abort (HTStream * me, HTError e)
-{}
-
+ *
+ *		B L A C K    H O L E    C L A S S
+ *
+ *	There is only one black hole instance shared by anyone
+ *	who wanst a black hole.  These black holes don't radiate,
+ *	they just absorb data.
+ */
+static void HTBlackHole_put_character(HTStream *me, char c)
+{
+}
+static void HTBlackHole_put_string(HTStream *me, const char *s)
+{
+}
+static void HTBlackHole_write(HTStream *me, const char *s, int l)
+{
+}
+static void HTBlackHole_free(HTStream *me)
+{
+}
+static void HTBlackHole_abort(HTStream *me, HTError e)
+{
+}
 
 /*	Black Hole stream
-**	-----------------
-*/
+ *	-----------------
+ */
 static const HTStreamClass HTBlackHoleClass =
 {
-	"BlackHole",
-	HTBlackHole_free,
-	HTBlackHole_abort,
-	HTBlackHole_put_character,	HTBlackHole_put_string,
-	HTBlackHole_write
+    "BlackHole",
+    HTBlackHole_free,
+    HTBlackHole_abort,
+    HTBlackHole_put_character, HTBlackHole_put_string,
+    HTBlackHole_write
 };
 
 static HTStream HTBlackHoleInstance =
 {
-	&HTBlackHoleClass,
-	NULL,
-	NULL,
-	NULL,
-	NO
+    &HTBlackHoleClass,
+    NULL,
+    NULL,
+    NULL,
+    NO
 };
 
 /*	Black hole craetion
 */
-HTStream * HTBlackHole (void)
+HTStream *HTBlackHole(void)
 {
     return &HTBlackHoleInstance;
 }
 
-
 /*_________________________________________________________________________
-**
-**		F I L E     A C T I O N 	R O U T I N E S
-**  Bug:
-**	All errors are ignored.
-*/
+ *
+ *		F I L E     A C T I O N 	R O U T I N E S
+ *  Bug:
+ *	All errors are ignored.
+ */
 
 /*	Character handling
-**	------------------
-*/
+ *	------------------
+ */
 
-static void HTFWriter_put_character (HTStream * me, char c)
+static void HTFWriter_put_character(HTStream *me, char c)
 {
     putc(c, me->fp);
 }
 
-
-
 /*	String handling
-**	---------------
-**
-**	Strings must be smaller than this buffer size.
-*/
-static void HTFWriter_put_string (HTStream * me, const char* s)
+ *	---------------
+ *
+ *	Strings must be smaller than this buffer size.
+ */
+static void HTFWriter_put_string(HTStream *me, const char *s)
 {
     fputs(s, me->fp);
 }
 
-
 /*	Buffer write.  Buffers can (and should!) be big.
-**	------------
-*/
-static void HTFWriter_write (HTStream * me, const char* s, int l)
+ *	------------
+ */
+static void HTFWriter_write(HTStream *me, const char *s, int l)
 {
     fwrite(s, 1, l, me->fp);
 }
 
-
-
-
 /*	Free an HTML object
-**	-------------------
-**
-**	Note that the SGML parsing context is freed, but the created
-**	object is not,
-**	as it takes on an existence of its own unless explicitly freed.
-*/
-static void HTFWriter_free (HTStream * me)
+ *	-------------------
+ *
+ *	Note that the SGML parsing context is freed, but the created
+ *	object is not,
+ *	as it takes on an existence of its own unless explicitly freed.
+ */
+static void HTFWriter_free(HTStream *me)
 {
     fclose(me->fp);
-    if (me->end_command) {		/* Temp file */
+    if (me->end_command) {	/* Temp file */
 	_HTProgress(me->end_command);	/* Tell user what's happening */
 	system(me->end_command);
 	FREE(me->end_command);
@@ -148,10 +144,10 @@ static void HTFWriter_free (HTStream * me)
 /*	End writing
 */
 
-static void HTFWriter_abort (HTStream * me, HTError e)
+static void HTFWriter_abort(HTStream *me, HTError e)
 {
     fclose(me->fp);
-    if (me->end_command) {		/* Temp file */
+    if (me->end_command) {	/* Temp file */
 	CTRACE((tfp, "HTFWriter: Aborting: file not executed.\n"));
 	FREE(me->end_command);
 	if (me->remove_command) {
@@ -163,33 +159,32 @@ static void HTFWriter_abort (HTStream * me, HTError e)
     FREE(me);
 }
 
-
-
 /*	Structured Object Class
-**	-----------------------
-*/
-static const HTStreamClass HTFWriter = /* As opposed to print etc */
+ *	-----------------------
+ */
+static const HTStreamClass HTFWriter =	/* As opposed to print etc */
 {
-	"FileWriter",
-	HTFWriter_free,
-	HTFWriter_abort,
-	HTFWriter_put_character,	HTFWriter_put_string,
-	HTFWriter_write
+    "FileWriter",
+    HTFWriter_free,
+    HTFWriter_abort,
+    HTFWriter_put_character, HTFWriter_put_string,
+    HTFWriter_write
 };
 
-
 /*	Subclass-specific Methods
-**	-------------------------
-*/
+ *	-------------------------
+ */
 
-HTStream* HTFWriter_new (FILE * fp)
+HTStream *HTFWriter_new(FILE *fp)
 {
-    HTStream* me;
+    HTStream *me;
 
-    if (!fp) return NULL;
+    if (!fp)
+	return NULL;
 
-    me = (HTStream*)malloc(sizeof(*me));
-    if (me == NULL) outofmem(__FILE__, "HTML_new");
+    me = (HTStream *) malloc(sizeof(*me));
+    if (me == NULL)
+	outofmem(__FILE__, "HTML_new");
     me->isa = &HTFWriter;
 
     me->fp = fp;
@@ -201,27 +196,24 @@ HTStream* HTFWriter_new (FILE * fp)
 }
 
 /*	Make system command from template
-**	---------------------------------
-**
-**	See mailcap spec for description of template.
-*/
+ *	---------------------------------
+ *
+ *	See mailcap spec for description of template.
+ */
 /* @@ to be written.  sprintfs will do for now.  */
 
-
-
 /*	Take action using a system command
-**	----------------------------------
-**
-**	originally from Ghostview handling by Marc Andreseen.
-**	Creates temporary file, writes to it, executes system command
-**	on end-document.  The suffix of the temp file can be given
-**	in case the application is fussy, or so that a generic opener can
-**	be used.
-*/
-HTStream* HTSaveAndExecute (
-	HTPresentation *	pres,
-	HTParentAnchor *	anchor,	/* Not used */
-	HTStream *		sink)	/* Not used */
+ *	----------------------------------
+ *
+ *	originally from Ghostview handling by Marc Andreseen.
+ *	Creates temporary file, writes to it, executes system command
+ *	on end-document.  The suffix of the temp file can be given
+ *	in case the application is fussy, or so that a generic opener can
+ *	be used.
+ */
+HTStream *HTSaveAndExecute(HTPresentation *pres,
+			   HTParentAnchor *anchor,	/* Not used */
+			   HTStream *sink)	/* Not used */
 
 #ifdef UNIX
 #define REMOVE_COMMAND "/bin/rm -f %s\n"
@@ -233,30 +225,31 @@ HTStream* HTSaveAndExecute (
 #ifdef REMOVE_COMMAND
 {
     char *fnam;
-    const char * suffix;
+    const char *suffix;
 
-    HTStream* me;
+    HTStream *me;
 
     if (HTClientHost) {
 	HTAlert(CANNOT_SAVE_REMOTE);
 	return HTBlackHole();
     }
 
-    me = (HTStream*)malloc(sizeof(*me));
-    if (me == NULL) outofmem(__FILE__, "Save and execute");
+    me = (HTStream *) malloc(sizeof(*me));
+    if (me == NULL)
+	outofmem(__FILE__, "Save and execute");
     me->isa = &HTFWriter;
 
     /* Save the file under a suitably suffixed name */
 
     suffix = HTFileSuffix(pres->rep, anchor->content_encoding);
 
-    fnam = (char *)malloc (L_tmpnam + 16 + strlen(suffix));
+    fnam = (char *) malloc(L_tmpnam + 16 + strlen(suffix));
     if (fnam == NULL)
 	outofmem(__FILE__, "HTSaveAndExecute");
-    tmpnam (fnam);
+    tmpnam(fnam);
     strcat(fnam, suffix);
 
-    me->fp = fopen (fnam, BIN_W);
+    me->fp = fopen(fnam, BIN_W);
     if (!me->fp) {
 	HTAlert(CANNOT_OPEN_TEMP);
 	FREE(fnam);
@@ -282,37 +275,38 @@ HTStream* HTSaveAndExecute (
     return me;
 }
 
-#else	/* can do remove */
-{ return NULL; }
+#else				/* can do remove */
+{
+    return NULL;
+}
 #endif
 
-
 /*	Save Locally
-**	------------
-**
-**  Bugs:
-**	GUI Apps should open local Save panel here really.
-**
-*/
-HTStream* HTSaveLocally (
-	HTPresentation *	pres,
-	HTParentAnchor *	anchor,	/* Not used */
-	HTStream *		sink)	/* Not used */
+ *	------------
+ *
+ *  Bugs:
+ *	GUI Apps should open local Save panel here really.
+ *
+ */
+HTStream *HTSaveLocally(HTPresentation *pres,
+			HTParentAnchor *anchor,		/* Not used */
+			HTStream *sink)		/* Not used */
 
 {
     char *fnam;
     char *answer;
-    const char * suffix;
+    const char *suffix;
 
-    HTStream* me;
+    HTStream *me;
 
     if (HTClientHost) {
 	HTAlert(CANNOT_SAVE_REMOTE);
 	return HTBlackHole();
     }
 
-    me = (HTStream*)malloc(sizeof(*me));
-    if (me == NULL) outofmem(__FILE__, "SaveLocally");
+    me = (HTStream *) malloc(sizeof(*me));
+    if (me == NULL)
+	outofmem(__FILE__, "SaveLocally");
     me->isa = &HTFWriter;
     me->end_command = NULL;
     me->remove_command = NULL;	/* If needed, put into end_command */
@@ -322,18 +316,18 @@ HTStream* HTSaveLocally (
 
     suffix = HTFileSuffix(pres->rep, anchor->content_encoding);
 
-    fnam = (char *)malloc (L_tmpnam + 16 + strlen(suffix));
+    fnam = (char *) malloc(L_tmpnam + 16 + strlen(suffix));
     if (fnam == NULL)
 	outofmem(__FILE__, "HTSaveLocally");
-    tmpnam (fnam);
+    tmpnam(fnam);
     strcat(fnam, suffix);
 
-    /*	Save Panel */
+    /*  Save Panel */
     answer = HTPrompt(GIVE_FILENAME, fnam);
 
     FREE(fnam);
 
-    me->fp = fopen (answer, BIN_W);
+    me->fp = fopen(answer, BIN_W);
     if (!me->fp) {
 	HTAlert(CANNOT_OPEN_OUTPUT);
 	FREE(answer);
@@ -345,8 +339,6 @@ HTStream* HTSaveLocally (
     return me;
 }
 
-
-
 /*	Format Converter using system command
-**	-------------------------------------
-*/
+ *	-------------------------------------
+ */
diff --git a/WWW/Library/Implementation/HTFWriter.h b/WWW/Library/Implementation/HTFWriter.h
index 563644b1..615e6341 100644
--- a/WWW/Library/Implementation/HTFWriter.h
+++ b/WWW/Library/Implementation/HTFWriter.h
@@ -11,16 +11,14 @@
 #include <HTStream.h>
 #include <HTFormat.h>
 
-extern HTStream * HTFWriter_new (FILE * fp);
+extern HTStream *HTFWriter_new(FILE *fp);
 
-extern HTStream * HTSaveAndExecute (
-        HTPresentation *        pres,
-        HTParentAnchor *        anchor, /* Not used */
-        HTStream *              sink);
+extern HTStream *HTSaveAndExecute(HTPresentation *pres,
+				  HTParentAnchor *anchor,	/* Not used */
+				  HTStream *sink);
 
-extern HTStream * HTSaveLocally (
-        HTPresentation *        pres,
-        HTParentAnchor *        anchor, /* Not used */
-        HTStream *              sink);
+extern HTStream *HTSaveLocally(HTPresentation *pres,
+			       HTParentAnchor *anchor,	/* Not used */
+			       HTStream *sink);
 
 #endif /* HTFWRITE_H */
diff --git a/WWW/Library/Implementation/HTFile.c b/WWW/Library/Implementation/HTFile.c
index 6a4646f2..bc2859f5 100644
--- a/WWW/Library/Implementation/HTFile.c
+++ b/WWW/Library/Implementation/HTFile.c
@@ -1,34 +1,34 @@
 /*			File Access				HTFile.c
-**			===========
-**
-**	This is unix-specific code in general, with some VMS bits.
-**	These are routines for file access used by browsers.
-**	Development of this module for Unix DIRED_SUPPORT in Lynx
-**	 regrettably has has been conducted in a manner with now
-**	 creates a major impediment for hopes of adapting Lynx to
-**	 a newer version of the library.
-**
-**  History:
-**	   Feb 91	Written Tim Berners-Lee CERN/CN
-**	   Apr 91	vms-vms access included using DECnet syntax
-**	26 Jun 92 (JFG) When running over DECnet, suppressed FTP.
-**			Fixed access bug for relative names on VMS.
-**	   Sep 93 (MD)	Access to VMS files allows sharing.
-**	15 Nov 93 (MD)	Moved HTVMSname to HTVMSUTILS.C
-**	27 Dec 93 (FM)	FTP now works with VMS hosts.
-**			FTP path must be Unix-style and cannot include
-**			the device or top directory.
-*/
+ *			===========
+ *
+ *	This is unix-specific code in general, with some VMS bits.
+ *	These are routines for file access used by browsers.
+ *	Development of this module for Unix DIRED_SUPPORT in Lynx
+ *	 regrettably has has been conducted in a manner with now
+ *	 creates a major impediment for hopes of adapting Lynx to
+ *	 a newer version of the library.
+ *
+ *  History:
+ *	   Feb 91	Written Tim Berners-Lee CERN/CN
+ *	   Apr 91	vms-vms access included using DECnet syntax
+ *	26 Jun 92 (JFG) When running over DECnet, suppressed FTP.
+ *			Fixed access bug for relative names on VMS.
+ *	   Sep 93 (MD)	Access to VMS files allows sharing.
+ *	15 Nov 93 (MD)	Moved HTVMSname to HTVMSUTILS.C
+ *	27 Dec 93 (FM)	FTP now works with VMS hosts.
+ *			FTP path must be Unix-style and cannot include
+ *			the device or top directory.
+ */
 
 #include <HTUtils.h>
 
 #ifndef VMS
 #if defined(DOSPATH)
 #undef LONG_LIST
-#define LONG_LIST  /* Define this for long style unix listings (ls -l),
-		     the actual style is configurable from lynx.cfg */
+#define LONG_LIST		/* Define this for long style unix listings (ls -l),
+				   the actual style is configurable from lynx.cfg */
 #endif
-/* #define NO_PARENT_DIR_REFERENCE */ /* Define this for no parent links */
+/* #define NO_PARENT_DIR_REFERENCE *//* Define this for no parent links */
 #endif /* !VMS */
 
 #if defined(DOSPATH)
@@ -77,17 +77,17 @@
 #include <LYLeaks.h>
 
 typedef struct _HTSuffix {
-	char *		suffix;
-	HTAtom *	rep;
-	HTAtom *	encoding;
-	char *		desc;
-	float		quality;
+    char *suffix;
+    HTAtom *rep;
+    HTAtom *encoding;
+    char *desc;
+    float quality;
 } HTSuffix;
 
 typedef struct {
     struct stat file_info;
     char sort_tags;
-    char file_name[1];	/* on the end of the struct, since its length varies */
+    char file_name[1];		/* on the end of the struct, since its length varies */
 } DIRED;
 
 #ifndef NGROUPS
@@ -114,50 +114,54 @@ typedef struct {
 #define ABORT_TARGET (*targetClass._abort)(target, NULL);
 
 struct _HTStructured {
-	const HTStructuredClass *	isa;
-	/* ... */
+    const HTStructuredClass *isa;
+    /* ... */
 };
 
 /*
-**  Controlling globals.
-*/
+ *  Controlling globals.
+ */
 int HTDirAccess = HT_DIR_OK;
 
 #ifdef DIRED_SUPPORT
 int HTDirReadme = HT_DIR_README_NONE;
+
 #else
 int HTDirReadme = HT_DIR_README_TOP;
 #endif /* DIRED_SUPPORT */
 
-static char *HTMountRoot = "/Net/";		/* Where to find mounts */
+static char *HTMountRoot = "/Net/";	/* Where to find mounts */
+
 #ifdef VMS
 static char *HTCacheRoot = "/WWW$SCRATCH";	/* Where to cache things */
+
 #else
 static char *HTCacheRoot = "/tmp/W3_Cache_";	/* Where to cache things */
 #endif /* VMS */
 
 /*
-**  Suffix registration.
-*/
-static HTList * HTSuffixes = 0;
-static HTSuffix no_suffix = { "*", NULL, NULL, NULL, 1.0 };
-static HTSuffix unknown_suffix = { "*.*", NULL, NULL, NULL, 1.0};
-
+ *  Suffix registration.
+ */
+static HTList *HTSuffixes = 0;
+static HTSuffix no_suffix =
+{"*", NULL, NULL, NULL, 1.0};
+static HTSuffix unknown_suffix =
+{"*.*", NULL, NULL, NULL, 1.0};
 
 /*	To free up the suffixes at program exit.
-**	----------------------------------------
-*/
+ *	----------------------------------------
+ */
 #ifdef LY_FIND_LEAKS
-static void free_suffixes (void);
+static void free_suffixes(void);
 #endif
 
 #ifdef LONG_LIST
-static char *FormatStr (
-    char **	bufp,
-    char *	start,
-    const char *	entry)
+static char *FormatStr(char **bufp,
+		       char *start,
+		       const char *entry)
 {
     char fmt[512];
+
     if (*start) {
 	sprintf(fmt, "%%%.*ss", (int) sizeof(fmt) - 3, start);
 	HTSprintf0(bufp, fmt, entry);
@@ -169,12 +173,12 @@ static char *FormatStr (
     return *bufp;
 }
 
-static char *FormatNum (
-    char **	bufp,
-    char *	start,
-    int	entry)
+static char *FormatNum(char **bufp,
+		       char *start,
+		       int entry)
 {
     char fmt[512];
+
     if (*start) {
 	sprintf(fmt, "%%%.*sd", (int) sizeof(fmt) - 3, start);
 	HTSprintf0(bufp, fmt, entry);
@@ -185,280 +189,308 @@ static char *FormatNum (
     return *bufp;
 }
 
-static void LYListFmtParse (
-	char *		fmtstr,
-	DIRED *	data,
-	char *		file,
-	HTStructured * target,
-	char *		tail)
+static void LYListFmtParse(char *fmtstr,
+			   DIRED * data,
+			   char *file,
+			   HTStructured * target,
+			   char *tail)
 {
-	char c;
-	char *s;
-	char *end;
-	char *start;
-	char *str = NULL;
-	char *buf = NULL;
-	char tmp[LY_MAXPATH];
-	char type;
+    char c;
+    char *s;
+    char *end;
+    char *start;
+    char *str = NULL;
+    char *buf = NULL;
+    char tmp[LY_MAXPATH];
+    char type;
+
 #ifndef NOUSERS
-	char *name;
+    char *name;
 #endif
-	time_t now;
-	char *datestr;
+    time_t now;
+    char *datestr;
+
 #ifdef S_IFLNK
-	int len;
+    int len;
 #endif
 #define SEC_PER_YEAR	(60 * 60 * 24 * 365)
 
-#ifdef _WINDOWS	/* 1998/01/06 (Tue) 21:20:53 */
-	static char *pbits[] = {
-		"---", "--x", "-w-", "-wx",
-		"r--", "r-x", "rw-", "rwx",
-		0 };
+#ifdef _WINDOWS			/* 1998/01/06 (Tue) 21:20:53 */
+    static char *pbits[] =
+    {
+	"---", "--x", "-w-", "-wx",
+	"r--", "r-x", "rw-", "rwx",
+	0};
+
 #define PBIT(a, n, s)  pbits[((a) >> (n)) & 0x7]
 
 #else
-	static char *pbits[] = { "---", "--x", "-w-", "-wx",
-		"r--", "r-x", "rw-", "rwx", 0 };
-	static char *psbits[] = { "--S", "--s", "-wS", "-ws",
-		"r-S", "r-s", "rwS", "rws", 0 };
+    static char *pbits[] =
+    {"---", "--x", "-w-", "-wx",
+     "r--", "r-x", "rw-", "rwx", 0};
+    static char *psbits[] =
+    {"--S", "--s", "-wS", "-ws",
+     "r-S", "r-s", "rwS", "rws", 0};
+
 #define PBIT(a, n, s)  (s) ? psbits[((a) >> (n)) & 0x7] : \
 	pbits[((a) >> (n)) & 0x7]
 #endif
 #ifdef S_ISVTX
-	static char *ptbits[] = { "--T", "--t", "-wT", "-wt",
-		"r-T", "r-t", "rwT", "rwt", 0 };
+    static char *ptbits[] =
+    {"--T", "--t", "-wT", "-wt",
+     "r-T", "r-t", "rwT", "rwt", 0};
+
 #define PTBIT(a, s)  (s) ? ptbits[(a) & 0x7] : pbits[(a) & 0x7]
 #else
 #define PTBIT(a, s)  PBIT(a, 0, 0)
 #endif
 
-	if (data->file_info.st_mode == 0)
-		fmtstr = "    %a";	/* can't stat so just do anchor */
+    if (data->file_info.st_mode == 0)
+	fmtstr = "    %a";	/* can't stat so just do anchor */
 
-	StrAllocCopy(str, fmtstr);
-	s = str;
-	end = str + strlen(str);
-	START(HTML_PRE);
+    StrAllocCopy(str, fmtstr);
+    s = str;
+    end = str + strlen(str);
+    START(HTML_PRE);
+    while (*s) {
+	start = s;
 	while (*s) {
-		start = s;
-		while (*s) {
-			if (*s == '%') {
-				if (*(s+1) == '%') /* literal % */
-					s++;
-				else
-					break;
-			}
-			s++;
-		}
-		/* s is positioned either at a % or at \0 */
-		*s = '\0';
-		if (s > start) {	/* some literal chars. */
-			PUTS(start);
-		}
-		if (s == end)
-			break;
-		start = ++s;
-		while (isdigit(UCH(*s)) || *s == '.' || *s == '-' || *s == ' ' ||
-		    *s == '#' || *s == '+' || *s == '\'')
-			s++;
-		c = *s;		/* the format char. or \0 */
-		*s = '\0';
-
-		switch (c) {
-		case '\0':
-			PUTS(start);
-			continue;
-
-		case 'A':
-		case 'a':	/* anchor */
-			HTDirEntry(target, tail, data->file_name);
-			FormatStr(&buf, start, data->file_name);
-			PUTS(buf);
-			END(HTML_A);
-			*buf = '\0';
+	    if (*s == '%') {
+		if (*(s + 1) == '%')	/* literal % */
+		    s++;
+		else
+		    break;
+	    }
+	    s++;
+	}
+	/* s is positioned either at a % or at \0 */
+	*s = '\0';
+	if (s > start) {	/* some literal chars. */
+	    PUTS(start);
+	}
+	if (s == end)
+	    break;
+	start = ++s;
+	while (isdigit(UCH(*s)) || *s == '.' || *s == '-' || *s == ' ' ||
+	       *s == '#' || *s == '+' || *s == '\'')
+	    s++;
+	c = *s;			/* the format char. or \0 */
+	*s = '\0';
+
+	switch (c) {
+	case '\0':
+	    PUTS(start);
+	    continue;
+
+	case 'A':
+	case 'a':		/* anchor */
+	    HTDirEntry(target, tail, data->file_name);
+	    FormatStr(&buf, start, data->file_name);
+	    PUTS(buf);
+	    END(HTML_A);
+	    *buf = '\0';
 #ifdef S_IFLNK
-			if (c != 'A' && S_ISLNK(data->file_info.st_mode) &&
-			    (len = readlink(file, tmp, sizeof(tmp) - 1)) >= 0) {
-				PUTS(" -> ");
-				tmp[len] = '\0';
-				PUTS(tmp);
-			}
+	    if (c != 'A' && S_ISLNK(data->file_info.st_mode) &&
+		(len = readlink(file, tmp, sizeof(tmp) - 1)) >= 0) {
+		PUTS(" -> ");
+		tmp[len] = '\0';
+		PUTS(tmp);
+	    }
 #endif
-			break;
+	    break;
 
-		case 'T':	/* MIME type */
-		case 't':	/* MIME type description */
-		    if (S_ISDIR(data->file_info.st_mode)) {
-			if (c != 'T') {
-			    FormatStr(&buf, start, ENTRY_IS_DIRECTORY);
-			} else {
-			    FormatStr(&buf, start, "");
-			}
-		    } else {
-			const char *cp2;
-			HTFormat format;
-			format = HTFileFormat(file, NULL, &cp2);
-
-			if (c != 'T') {
-			    if (cp2 == NULL) {
-				if (!strncmp(HTAtom_name(format),
-					     "application",11)) {
-				    cp2 = HTAtom_name(format) + 12;
-				    if (!strncmp(cp2,"x-",2))
-					cp2 += 2;
-				} else {
-				    cp2 = HTAtom_name(format);
-				}
-			    }
-			    FormatStr(&buf, start, cp2);
+	case 'T':		/* MIME type */
+	case 't':		/* MIME type description */
+	    if (S_ISDIR(data->file_info.st_mode)) {
+		if (c != 'T') {
+		    FormatStr(&buf, start, ENTRY_IS_DIRECTORY);
+		} else {
+		    FormatStr(&buf, start, "");
+		}
+	    } else {
+		const char *cp2;
+		HTFormat format;
+
+		format = HTFileFormat(file, NULL, &cp2);
+
+		if (c != 'T') {
+		    if (cp2 == NULL) {
+			if (!strncmp(HTAtom_name(format),
+				     "application", 11)) {
+			    cp2 = HTAtom_name(format) + 12;
+			    if (!strncmp(cp2, "x-", 2))
+				cp2 += 2;
 			} else {
-			    FormatStr(&buf, start, HTAtom_name(format));
+			    cp2 = HTAtom_name(format);
 			}
 		    }
-		    break;
+		    FormatStr(&buf, start, cp2);
+		} else {
+		    FormatStr(&buf, start, HTAtom_name(format));
+		}
+	    }
+	    break;
 
-		case 'd':	/* date */
-			now = time(0);
-			datestr = ctime(&data->file_info.st_mtime);
-			if ((now - data->file_info.st_mtime) < SEC_PER_YEAR/2)
-				/*
-				**  MMM DD HH:MM
-				*/
-				sprintf(tmp, "%.12s", datestr + 4);
-			else
-				/*
-				**  MMM DD  YYYY
-				*/
-				sprintf(tmp, "%.7s %.4s ", datestr + 4,
-					datestr + 20);
-			FormatStr(&buf, start, tmp);
-			break;
+	case 'd':		/* date */
+	    now = time(0);
+	    datestr = ctime(&data->file_info.st_mtime);
+	    if ((now - data->file_info.st_mtime) < SEC_PER_YEAR / 2)
+		/*
+		 * MMM DD HH:MM
+		 */
+		sprintf(tmp, "%.12s", datestr + 4);
+	    else
+		/*
+		 * MMM DD YYYY
+		 */
+		sprintf(tmp, "%.7s %.4s ", datestr + 4,
+			datestr + 20);
+	    FormatStr(&buf, start, tmp);
+	    break;
 
-		case 's':	/* size in bytes */
-			FormatNum(&buf, start, (int) data->file_info.st_size);
-			break;
+	case 's':		/* size in bytes */
+	    FormatNum(&buf, start, (int) data->file_info.st_size);
+	    break;
 
-		case 'K':	/* size in Kilobytes but not for directories */
-			if (S_ISDIR(data->file_info.st_mode)) {
-				FormatStr(&buf, start, "");
-				StrAllocCat(buf, " ");
-				break;
-			}
-			/* FALL THROUGH */
-		case 'k':	/* size in Kilobytes */
-			FormatNum(&buf, start, (int)((data->file_info.st_size+1023)/1024));
-			StrAllocCat(buf, "K");
-			break;
+	case 'K':		/* size in Kilobytes but not for directories */
+	    if (S_ISDIR(data->file_info.st_mode)) {
+		FormatStr(&buf, start, "");
+		StrAllocCat(buf, " ");
+		break;
+	    }
+	    /* FALL THROUGH */
+	case 'k':		/* size in Kilobytes */
+	    FormatNum(&buf, start, (int) ((data->file_info.st_size + 1023) / 1024));
+	    StrAllocCat(buf, "K");
+	    break;
 
-		case 'p':	/* unix-style permission bits */
-			switch(data->file_info.st_mode & S_IFMT) {
+	case 'p':		/* unix-style permission bits */
+	    switch (data->file_info.st_mode & S_IFMT) {
 #if defined(_MSC_VER) && defined(_S_IFIFO)
-			case _S_IFIFO: type = 'p'; break;
+	    case _S_IFIFO:
+		type = 'p';
+		break;
 #else
-			case S_IFIFO: type = 'p'; break;
+	    case S_IFIFO:
+		type = 'p';
+		break;
 #endif
-			case S_IFCHR: type = 'c'; break;
-			case S_IFDIR: type = 'd'; break;
-			case S_IFREG: type = '-'; break;
+	    case S_IFCHR:
+		type = 'c';
+		break;
+	    case S_IFDIR:
+		type = 'd';
+		break;
+	    case S_IFREG:
+		type = '-';
+		break;
 #ifdef S_IFBLK
-			case S_IFBLK: type = 'b'; break;
+	    case S_IFBLK:
+		type = 'b';
+		break;
 #endif
 #ifdef S_IFLNK
-			case S_IFLNK: type = 'l'; break;
+	    case S_IFLNK:
+		type = 'l';
+		break;
 #endif
 #ifdef S_IFSOCK
-# ifdef S_IFIFO		/* some older machines (e.g., apollo) have a conflict */
+# ifdef S_IFIFO			/* some older machines (e.g., apollo) have a conflict */
 #  if S_IFIFO != S_IFSOCK
-			case S_IFSOCK: type = 's'; break;
+	    case S_IFSOCK:
+		type = 's';
+		break;
 #  endif
 # else
-			case S_IFSOCK: type = 's'; break;
+	    case S_IFSOCK:
+		type = 's';
+		break;
 # endif
 #endif /* S_IFSOCK */
-			default: type = '?'; break;
-			}
+	    default:
+		type = '?';
+		break;
+	    }
 #ifdef _WINDOWS
-			sprintf(tmp, "%c%s", type,
-				PBIT(data->file_info.st_mode, 6, data->file_info.st_mode & S_IRWXU));
+	    sprintf(tmp, "%c%s", type,
+		    PBIT(data->file_info.st_mode, 6, data->file_info.st_mode & S_IRWXU));
 #else
-			sprintf(tmp, "%c%s%s%s", type,
-				PBIT(data->file_info.st_mode, 6, data->file_info.st_mode & S_ISUID),
-				PBIT(data->file_info.st_mode, 3, data->file_info.st_mode & S_ISGID),
-				PTBIT(data->file_info.st_mode,   data->file_info.st_mode & S_ISVTX));
+	    sprintf(tmp, "%c%s%s%s", type,
+		    PBIT(data->file_info.st_mode, 6, data->file_info.st_mode & S_ISUID),
+		    PBIT(data->file_info.st_mode, 3, data->file_info.st_mode & S_ISGID),
+		    PTBIT(data->file_info.st_mode, data->file_info.st_mode & S_ISVTX));
 #endif
-			FormatStr(&buf, start, tmp);
-			break;
+	    FormatStr(&buf, start, tmp);
+	    break;
 
-		case 'o':	/* owner */
+	case 'o':		/* owner */
 #ifndef NOUSERS
-			name = HTAA_UidToName (data->file_info.st_uid);
-			if (*name) {
-				FormatStr(&buf, start, name);
-			} else {
-				FormatNum(&buf, start, (int) data->file_info.st_uid);
-			}
+	    name = HTAA_UidToName(data->file_info.st_uid);
+	    if (*name) {
+		FormatStr(&buf, start, name);
+	    } else {
+		FormatNum(&buf, start, (int) data->file_info.st_uid);
+	    }
 #endif
-			break;
+	    break;
 
-		case 'g':	/* group */
+	case 'g':		/* group */
 #ifndef NOUSERS
-			name = HTAA_GidToName(data->file_info.st_gid);
-			if (*name) {
-				FormatStr(&buf, start, name);
-			} else {
-				FormatNum(&buf, start, (int) data->file_info.st_gid);
-			}
+	    name = HTAA_GidToName(data->file_info.st_gid);
+	    if (*name) {
+		FormatStr(&buf, start, name);
+	    } else {
+		FormatNum(&buf, start, (int) data->file_info.st_gid);
+	    }
 #endif
-			break;
-
-		case 'l':	/* link count */
-			FormatNum(&buf, start, (int) data->file_info.st_nlink);
-			break;
+	    break;
 
-		case '%':	/* literal % with flags/width */
-			FormatStr(&buf, start, "%");
-			break;
+	case 'l':		/* link count */
+	    FormatNum(&buf, start, (int) data->file_info.st_nlink);
+	    break;
 
-		default:
-			fprintf(stderr,
-			"Unknown format character `%c' in list format\n", c);
-			break;
-		}
-		if (buf)
-		    PUTS(buf);
+	case '%':		/* literal % with flags/width */
+	    FormatStr(&buf, start, "%");
+	    break;
 
-		s++;
+	default:
+	    fprintf(stderr,
+		    "Unknown format character `%c' in list format\n", c);
+	    break;
 	}
-	FREE(buf);
-	END(HTML_PRE);
-	PUTC('\n');
-	FREE(str);
+	if (buf)
+	    PUTS(buf);
+
+	s++;
+    }
+    FREE(buf);
+    END(HTML_PRE);
+    PUTC('\n');
+    FREE(str);
 }
 #endif /* LONG_LIST */
 
 /*	Define the representation associated with a file suffix.
-**	--------------------------------------------------------
-**
-**	Calling this with suffix set to "*" will set the default
-**	representation.
-**	Calling this with suffix set to "*.*" will set the default
-**	representation for unknown suffix files which contain a ".".
-**
-**	The encoding parameter can give a trivial (8bit, 7bit, binary)
-**	or real (gzip, compress) encoding.
-**
-**	If filename suffix is already defined with the same encoding
-**	its previous definition is overridden.
-*/
-void HTSetSuffix5 (
-	const char *	suffix,
-	const char *	representation,
-	const char *	encoding,
-	const char *	desc,
-	double		value)
+ *	--------------------------------------------------------
+ *
+ *	Calling this with suffix set to "*" will set the default
+ *	representation.
+ *	Calling this with suffix set to "*.*" will set the default
+ *	representation for unknown suffix files which contain a ".".
+ *
+ *	The encoding parameter can give a trivial (8bit, 7bit, binary)
+ *	or real (gzip, compress) encoding.
+ *
+ *	If filename suffix is already defined with the same encoding
+ *	its previous definition is overridden.
+ */
+void HTSetSuffix5(const char *suffix,
+		  const char *representation,
+		  const char *encoding,
+		  const char *desc,
+		  double value)
 {
-    HTSuffix * suff;
+    HTSuffix *suff;
     BOOL trivial_enc = (BOOL) IsUnityEncStr(encoding);
 
     if (strcmp(suffix, "*") == 0)
@@ -468,23 +500,23 @@ void HTSetSuffix5 (
     else {
 	HTList *cur = HTSuffixes;
 
-	while (NULL != (suff = (HTSuffix*)HTList_nextObject(cur))) {
+	while (NULL != (suff = (HTSuffix *) HTList_nextObject(cur))) {
 	    if (suff->suffix && 0 == strcmp(suff->suffix, suffix) &&
 		((trivial_enc && IsUnityEnc(suff->encoding)) ||
 		 (!trivial_enc && !IsUnityEnc(suff->encoding) &&
-		     strcmp(encoding, HTAtom_name(suff->encoding)) == 0)))
+		  strcmp(encoding, HTAtom_name(suff->encoding)) == 0)))
 		break;
 	}
-	if (!suff) { /* Not found -- create a new node */
+	if (!suff) {		/* Not found -- create a new node */
 	    suff = typecalloc(HTSuffix);
 	    if (suff == NULL)
 		outofmem(__FILE__, "HTSetSuffix");
 
 	    /*
-	    **	Memory leak fixed.
-	    **	05-28-94 Lynx 2-3-1 Garrett Arch Blythe
-	    */
-	    if (!HTSuffixes)	{
+	     * Memory leak fixed.
+	     * 05-28-94 Lynx 2-3-1 Garrett Arch Blythe
+	     */
+	    if (!HTSuffixes) {
 		HTSuffixes = HTList_new();
 #ifdef LY_FIND_LEAKS
 		atexit(free_suffixes);
@@ -501,10 +533,10 @@ void HTSetSuffix5 (
 	suff->rep = HTAtom_for(representation);
 
     /*
-    **	Memory leak fixed.
-    **	05-28-94 Lynx 2-3-1 Garrett Arch Blythe
-    **	Invariant code removed.
-    */
+     * Memory leak fixed.
+     * 05-28-94 Lynx 2-3-1 Garrett Arch Blythe
+     * Invariant code removed.
+     */
     suff->encoding = HTAtom_for(encoding);
 
     StrAllocCopy(suff->desc, desc);
@@ -514,56 +546,54 @@ void HTSetSuffix5 (
 
 #ifdef LY_FIND_LEAKS
 /*
-**	Purpose:	Free all added suffixes.
-**	Arguments:	void
-**	Return Value:	void
-**	Remarks/Portability/Dependencies/Restrictions:
-**		To be used at program exit.
-**	Revision History:
-**		05-28-94	created Lynx 2-3-1 Garrett Arch Blythe
-*/
-static void free_suffixes (void)
+ *	Purpose:	Free all added suffixes.
+ *	Arguments:	void
+ *	Return Value:	void
+ *	Remarks/Portability/Dependencies/Restrictions:
+ *		To be used at program exit.
+ *	Revision History:
+ *		05-28-94	created Lynx 2-3-1 Garrett Arch Blythe
+ */
+static void free_suffixes(void)
 {
-    HTSuffix * suff = NULL;
+    HTSuffix *suff = NULL;
 
     /*
-    **	Loop through all suffixes.
-    */
+     * Loop through all suffixes.
+     */
     while (!HTList_isEmpty(HTSuffixes)) {
 	/*
-	**  Free off each item and its members if need be.
-	*/
-	suff = (HTSuffix *)HTList_removeLastObject(HTSuffixes);
+	 * Free off each item and its members if need be.
+	 */
+	suff = (HTSuffix *) HTList_removeLastObject(HTSuffixes);
 	FREE(suff->suffix);
 	FREE(suff->desc);
 	FREE(suff);
     }
     /*
-    **	Free off the list itself.
-    */
+     * Free off the list itself.
+     */
     HTList_delete(HTSuffixes);
     HTSuffixes = NULL;
 }
 #endif /* LY_FIND_LEAKS */
 
-
 /*	Make the cache file name for a W3 document.
-**	-------------------------------------------
-**	Make up a suitable name for saving the node in
-**
-**	E.g.	/tmp/WWW_Cache_news/1234@cernvax.cern.ch
-**		/tmp/WWW_Cache_http/crnvmc/FIND/xx.xxx.xx
-**
-**  On exit:
-**	Returns a malloc'ed string which must be freed by the caller.
-*/
-char * HTCacheFileName (
-	const char *	name)
+ *	-------------------------------------------
+ *	Make up a suitable name for saving the node in
+ *
+ *	E.g.	/tmp/WWW_Cache_news/1234@cernvax.cern.ch
+ *		/tmp/WWW_Cache_http/crnvmc/FIND/xx.xxx.xx
+ *
+ *  On exit:
+ *	Returns a malloc'ed string which must be freed by the caller.
+ */
+char *HTCacheFileName(const char *name)
 {
-    char * acc_method = HTParse(name, "", PARSE_ACCESS);
-    char * host = HTParse(name, "", PARSE_HOST);
-    char * path = HTParse(name, "", PARSE_PATH+PARSE_PUNCTUATION);
-    char * result = NULL;
+    char *acc_method = HTParse(name, "", PARSE_ACCESS);
+    char *host = HTParse(name, "", PARSE_HOST);
+    char *path = HTParse(name, "", PARSE_PATH + PARSE_PUNCTUATION);
+    char *result = NULL;
 
     HTSprintf0(&result, "%s/WWW/%s/%s%s", HTCacheRoot, acc_method, host, path);
 
@@ -574,36 +604,35 @@ char * HTCacheFileName (
 }
 
 /*	Open a file for write, creating the path.
-**	-----------------------------------------
-*/
+ *	-----------------------------------------
+ */
 #ifdef NOT_IMPLEMENTED
-static int HTCreatePath (const char * path)
+static int HTCreatePath(const char *path)
 {
     return -1;
 }
 #endif /* NOT_IMPLEMENTED */
 
 /*	Convert filename from URL-path syntax to local path format
-**	----------------------------------------------------------
-**	Input name is assumed to be the URL-path of a local file
-**      URL, i.e. what comes after the "file://localhost".
-**      '#'-fragments to be treated as such must already be stripped.
-**      If expand_all is FALSE, unescape only escaped '/'. - kw
-**
-**  On exit:
-**	Returns a malloc'ed string which must be freed by the caller.
-*/
-char * HTURLPath_toFile (
-	const char *	name,
-	BOOL		expand_all,
-	BOOL		is_remote GCC_UNUSED)
+ *	----------------------------------------------------------
+ *	Input name is assumed to be the URL-path of a local file
+ *      URL, i.e. what comes after the "file://localhost".
+ *      '#'-fragments to be treated as such must already be stripped.
+ *      If expand_all is FALSE, unescape only escaped '/'. - kw
+ *
+ *  On exit:
+ *	Returns a malloc'ed string which must be freed by the caller.
+ */
+char *HTURLPath_toFile(const char *name,
+		       BOOL expand_all,
+		       BOOL is_remote GCC_UNUSED)
 {
-    char * path = NULL;
-    char * result = NULL;
+    char *path = NULL;
+    char *result = NULL;
 
     StrAllocCopy(path, name);
     if (expand_all)
-	HTUnEscape(path);		/* Interpret all % signs */
+	HTUnEscape(path);	/* Interpret all % signs */
     else
 	HTUnEscapeSome(path, "/");	/* Interpret % signs for path delims */
 
@@ -619,38 +648,37 @@ char * HTURLPath_toFile (
     return result;
 }
 /*	Convert filenames between local and WWW formats.
-**	------------------------------------------------
-**	Make up a suitable name for saving the node in
-**
-**	E.g.	$(HOME)/WWW/news/1234@cernvax.cern.ch
-**		$(HOME)/WWW/http/crnvmc/FIND/xx.xxx.xx
-**
-**  On exit:
-**	Returns a malloc'ed string which must be freed by the caller.
-*/
+ *	------------------------------------------------
+ *	Make up a suitable name for saving the node in
+ *
+ *	E.g.	$(HOME)/WWW/news/1234@cernvax.cern.ch
+ *		$(HOME)/WWW/http/crnvmc/FIND/xx.xxx.xx
+ *
+ *  On exit:
+ *	Returns a malloc'ed string which must be freed by the caller.
+ */
 /* NOTE: Don't use this function if you know that the input is a URL path
 	 rather than a full URL, use HTURLPath_toFile instead.  Otherwise
 	 this function will return the wrong thing for some unusual
 	 paths (like ones containing "//", possibly escaped). - kw
 */
-char * HTnameOfFile_WWW (
-	const char *	name,
-	BOOL		WWW_prefix,
-	BOOL		expand_all)
+char *HTnameOfFile_WWW(const char *name,
+		       BOOL WWW_prefix,
+		       BOOL expand_all)
 {
-    char * acc_method = HTParse(name, "", PARSE_ACCESS);
-    char * host = HTParse(name, "", PARSE_HOST);
-    char * path = HTParse(name, "", PARSE_PATH+PARSE_PUNCTUATION);
-    char * home;
-    char * result = NULL;
+    char *acc_method = HTParse(name, "", PARSE_ACCESS);
+    char *host = HTParse(name, "", PARSE_HOST);
+    char *path = HTParse(name, "", PARSE_PATH + PARSE_PUNCTUATION);
+    char *home;
+    char *result = NULL;
 
     if (expand_all) {
-	HTUnEscape(path);		/* Interpret all % signs */
+	HTUnEscape(path);	/* Interpret all % signs */
     } else
 	HTUnEscapeSome(path, "/");	/* Interpret % signs for path delims */
 
-    if (0 == strcmp(acc_method, "file")	/* local file */
-     || !*acc_method) {			/* implicitly local? */
+    if (0 == strcmp(acc_method, "file")		/* local file */
+	||!*acc_method) {	/* implicitly local? */
 	if ((0 == strcasecomp(host, HTHostName())) ||
 	    (0 == strcasecomp(host, "localhost")) || !*host) {
 	    CTRACE((tfp, "Node `%s' means path `%s'\n", name, path));
@@ -661,15 +689,15 @@ char * HTnameOfFile_WWW (
 	} else {
 	    StrAllocCopy(result, path);
 	}
-    } else if (WWW_prefix) {  /* other access */
+    } else if (WWW_prefix) {	/* other access */
 #ifdef VMS
 	if ((home = LYGetEnv("HOME")) == 0)
 	    home = HTCacheRoot;
 	else
 	    home = HTVMS_wwwName(home);
 #else
-#if defined(_WINDOWS)	/* 1997/10/16 (Thu) 20:42:51 */
-	home =  (char *)Home_Dir();
+#if defined(_WINDOWS)		/* 1997/10/16 (Thu) 20:42:51 */
+	home = (char *) Home_Dir();
 #else
 	home = LYGetEnv("HOME");
 #endif
@@ -692,24 +720,24 @@ char * HTnameOfFile_WWW (
 }
 
 /*	Make a WWW name from a full local path name.
-**	--------------------------------------------
-**
-**  Bugs:
-**	At present, only the names of two network root nodes are hand-coded
-**	in and valid for the NeXT only.  This should be configurable in
-**	the general case.
-*/
-char * WWW_nameOfFile (
-	const char *	name)
+ *	--------------------------------------------
+ *
+ *  Bugs:
+ *	At present, only the names of two network root nodes are hand-coded
+ *	in and valid for the NeXT only.  This should be configurable in
+ *	the general case.
+ */
+char *WWW_nameOfFile(const char *name)
 {
-    char * result = NULL;
+    char *result = NULL;
+
 #ifdef NeXT
     if (0 == strncmp("/private/Net/", name, 13)) {
-	HTSprintf0(&result, "%s//%s", STR_FILE_URL, name+13);
+	HTSprintf0(&result, "%s//%s", STR_FILE_URL, name + 13);
     } else
 #endif /* NeXT */
     if (0 == strncmp(HTMountRoot, name, 5)) {
-	HTSprintf0(&result, "%s//%s", STR_FILE_URL, name+5);
+	HTSprintf0(&result, "%s//%s", STR_FILE_URL, name + 5);
     } else {
 	HTSprintf0(&result, "%s//%s%s", STR_FILE_URL, HTHostName(), name);
     }
@@ -718,29 +746,29 @@ char * WWW_nameOfFile (
 }
 
 /*	Determine a suitable suffix, given the representation.
-**	------------------------------------------------------
-**
-**  On entry,
-**	rep	is the atomized MIME style representation
-**	enc	is an encoding, trivial (8bit, binary, etc.) or gzip etc.
-**
-**  On exit:
-**	Returns a pointer to a suitable suffix string if one has been
-**	found, else "".
-*/
-const char * HTFileSuffix (
-	HTAtom*	rep,
-	const char *	enc)
+ *	------------------------------------------------------
+ *
+ *  On entry,
+ *	rep	is the atomized MIME style representation
+ *	enc	is an encoding, trivial (8bit, binary, etc.) or gzip etc.
+ *
+ *  On exit:
+ *	Returns a pointer to a suitable suffix string if one has been
+ *	found, else "".
+ */
+const char *HTFileSuffix(HTAtom *rep,
+			 const char *enc)
 {
-    HTSuffix * suff;
+    HTSuffix *suff;
+
 #ifdef FNAMES_8_3
-    HTSuffix * first_found = NULL;
+    HTSuffix *first_found = NULL;
 #endif
     BOOL trivial_enc;
     int n;
     int i;
 
-#define NO_INIT  /* don't init anymore since I do it in Lynx at startup */
+#define NO_INIT			/* don't init anymore since I do it in Lynx at startup */
 #ifndef NO_INIT
     if (!HTSuffixes)
 	HTFileInit();
@@ -749,12 +777,12 @@ const char * HTFileSuffix (
     trivial_enc = (BOOL) IsUnityEncStr(enc);
     n = HTList_count(HTSuffixes);
     for (i = 0; i < n; i++) {
-	suff = (HTSuffix *)HTList_objectAt(HTSuffixes, i);
+	suff = (HTSuffix *) HTList_objectAt(HTSuffixes, i);
 	if (suff->rep == rep &&
 #if defined(VMS) || defined(FNAMES_8_3)
-	    /*	Don't return a suffix whose first char is a dot, and which
-		has more dots or asterisks after that, for
-		these systems - kw */
+	/*  Don't return a suffix whose first char is a dot, and which
+	   has more dots or asterisks after that, for
+	   these systems - kw */
 	    (!suff->suffix || !suff->suffix[0] || suff->suffix[0] != '.' ||
 	     (strchr(suff->suffix + 1, '.') == NULL &&
 	      strchr(suff->suffix + 1, '*') == NULL)) &&
@@ -765,16 +793,15 @@ const char * HTFileSuffix (
 #ifdef FNAMES_8_3
 	    if (suff->suffix && (strlen(suff->suffix) <= 4)) {
 		/*
-		 *  If length of suffix (including dot) is 4 or smaller,
-		 *  return this one even if we found a longer one
-		 *  earlier - kw
+		 * If length of suffix (including dot) is 4 or smaller, return
+		 * this one even if we found a longer one earlier - kw
 		 */
 		return suff->suffix;
 	    } else if (!first_found) {
-		first_found = suff;		/* remember this one */
+		first_found = suff;	/* remember this one */
 	    }
 #else
-	    return suff->suffix;		/* OK -- found */
+	    return suff->suffix;	/* OK -- found */
 #endif
 	}
     }
@@ -782,29 +809,29 @@ const char * HTFileSuffix (
     if (first_found)
 	return first_found->suffix;
 #endif
-    return "";		/* Dunno */
+    return "";			/* Dunno */
 }
 
 /*	Determine file format from file name.
-**	-------------------------------------
-**
-**	This version will return the representation and also set
-**	a variable for the encoding.
-**
-**	Encoding may be a unity encoding (binary, 8bit, etc.) or
-**	a content-coding like gzip, compress.
-**
-**	It will handle for example  x.txt, x.txt,Z, x.Z
-*/
-HTFormat HTFileFormat (
-	const char *	filename,
-	HTAtom **	pencoding,
-	const char**	pdesc)
+ *	-------------------------------------
+ *
+ *	This version will return the representation and also set
+ *	a variable for the encoding.
+ *
+ *	Encoding may be a unity encoding (binary, 8bit, etc.) or
+ *	a content-coding like gzip, compress.
+ *
+ *	It will handle for example  x.txt, x.txt,Z, x.Z
+ */
+HTFormat HTFileFormat(const char *filename,
+		      HTAtom **pencoding,
+		      const char **pdesc)
 {
-    HTSuffix * suff;
+    HTSuffix *suff;
     int n;
     int i;
     int lf;
+
 #ifdef VMS
     char *semicolon = NULL;
 #endif /* VMS */
@@ -818,13 +845,11 @@ HTFormat HTFileFormat (
 	    *pencoding = WWW_ENC_8BIT;
 	return WWW_HTML;
     }
-
 #ifdef VMS
     /*
-    **	Trim at semicolon if a version number was
-    **	included, so it doesn't interfere with the
-    **	code for getting the MIME type. - FM
-    */
+     * Trim at semicolon if a version number was included, so it doesn't
+     * interfere with the code for getting the MIME type.  - FM
+     */
     if ((semicolon = strchr(filename, ';')) != NULL)
 	*semicolon = '\0';
 #endif /* VMS */
@@ -833,14 +858,16 @@ HTFormat HTFileFormat (
     if (!HTSuffixes)
 	HTFileInit();
 #endif /* !NO_INIT */
-    lf	= strlen(filename);
+    lf = strlen(filename);
     n = HTList_count(HTSuffixes);
     for (i = 0; i < n; i++) {
 	int ls;
-	suff = (HTSuffix *)HTList_objectAt(HTSuffixes, i);
+
+	suff = (HTSuffix *) HTList_objectAt(HTSuffixes, i);
 	ls = strlen(suff->suffix);
 	if ((ls <= lf) && 0 == strcasecomp(suff->suffix, filename + lf - ls)) {
 	    int j;
+
 	    if (pencoding)
 		*pencoding = suff->encoding;
 	    if (pdesc)
@@ -850,14 +877,16 @@ HTFormat HTFileFormat (
 		if (semicolon != NULL)
 		    *semicolon = ';';
 #endif /* VMS */
-		return suff->rep;		/* OK -- found */
+		return suff->rep;	/* OK -- found */
 	    }
-	    for (j = 0; j < n; j++) {  /* Got encoding, need representation */
+	    for (j = 0; j < n; j++) {	/* Got encoding, need representation */
 		int ls2;
-		suff = (HTSuffix *)HTList_objectAt(HTSuffixes, j);
+
+		suff = (HTSuffix *) HTList_objectAt(HTSuffixes, j);
 		ls2 = strlen(suff->suffix);
-		if ((ls + ls2 <= lf) && 0 == strncasecomp(
-			suff->suffix, filename + lf - ls -ls2, ls2)) {
+		if ((ls + ls2 <= lf) &&
+		    !strncasecomp(suff->suffix,
+				  filename + lf - ls - ls2, ls2)) {
 		    if (suff->rep) {
 			if (pdesc && !(*pdesc))
 			    *pdesc = suff->desc;
@@ -880,15 +909,15 @@ HTFormat HTFileFormat (
     /* defaults tree */
 
     suff = strchr(filename, '.') ?	/* Unknown suffix */
-	 ( unknown_suffix.rep ? &unknown_suffix : &no_suffix)
-	 : &no_suffix;
+	(unknown_suffix.rep ? &unknown_suffix : &no_suffix)
+	: &no_suffix;
 
     /*
-    **	Set default encoding unless found with suffix already.
-    */
+     * Set default encoding unless found with suffix already.
+     */
     if (pencoding && !*pencoding)
 	*pencoding = suff->encoding ? suff->encoding
-				    : HTAtom_for("binary");
+	    : HTAtom_for("binary");
 #ifdef VMS
     if (semicolon != NULL)
 	*semicolon = ';';
@@ -897,17 +926,16 @@ HTFormat HTFileFormat (
 }
 
 /*	Revise the file format in relation to the Lynx charset. - FM
-**	-------------------------------------------------------
-**
-**	This checks the format associated with an anchor for
-**	an extended MIME Content-Type, and if a charset is
-**	indicated, sets Lynx up for proper handling in relation
-**	to the currently selected character set. - FM
-*/
-HTFormat HTCharsetFormat (
-	HTFormat		format,
-	HTParentAnchor *	anchor,
-	int			default_LYhndl)
+ *	-------------------------------------------------------
+ *
+ *	This checks the format associated with an anchor for
+ *	an extended MIME Content-Type, and if a charset is
+ *	indicated, sets Lynx up for proper handling in relation
+ *	to the currently selected character set. - FM
+ */
+HTFormat HTCharsetFormat(HTFormat format,
+			 HTParentAnchor *anchor,
+			 int default_LYhndl)
 {
     char *cp = NULL, *cp1, *cp2, *cp3 = NULL, *cp4;
     BOOL chartrans_ok = FALSE;
@@ -919,15 +947,15 @@ HTFormat HTCharsetFormat (
     if (((cp1 = strchr(cp, ';')) != NULL) &&
 	(cp2 = strstr(cp1, "charset")) != NULL) {
 	CTRACE((tfp, "HTCharsetFormat: Extended MIME Content-Type is %s\n",
-		    format->name));
+		format->name));
 	cp2 += 7;
 	while (*cp2 == ' ' || *cp2 == '=')
 	    cp2++;
-	StrAllocCopy(cp3, cp2); /* copy to mutilate more */
+	StrAllocCopy(cp3, cp2);	/* copy to mutilate more */
 	for (cp4 = cp3; (*cp4 != '\0' && *cp4 != '"' &&
-			 *cp4 != ';'  && *cp4 != ':' &&
+			 *cp4 != ';' && *cp4 != ':' &&
 			 !WHITE(*cp4)); cp4++) {
-	    ; /* do nothing */
+	    ;			/* do nothing */
 	}
 	*cp4 = '\0';
 	cp4 = cp3;
@@ -942,15 +970,15 @@ HTFormat HTCharsetFormat (
 				    UCT_SETBY_MIME);
 	} else if (chndl < 0) {
 	    /*
-	    **	Got something but we don't recognize it.
-	    */
+	     * Got something but we don't recognize it.
+	     */
 	    chndl = UCLYhndl_for_unrec;
 	    if (chndl < 0)
-	    /*
-	    **  UCLYhndl_for_unrec not defined :-(
-	    **  fallback to UCLYhndl_for_unspec which always valid.
-	    */
-	    chndl = UCLYhndl_for_unspec;  /* always >= 0 */
+		/*
+		 * UCLYhndl_for_unrec not defined :-( fallback to
+		 * UCLYhndl_for_unspec which always valid.
+		 */
+		chndl = UCLYhndl_for_unspec;	/* always >= 0 */
 	    if (UCCanTranslateFromTo(chndl, current_char_set)) {
 		chartrans_ok = YES;
 		HTAnchor_setUCInfoStage(anchor, chndl,
@@ -965,10 +993,11 @@ HTFormat HTCharsetFormat (
 							 current_char_set,
 							 UCT_STAGE_HTEXT,
 							 UCT_SETBY_DEFAULT);
+
 	    if (!p_out) {
 		/*
-		**  Try again.
-		*/
+		 * Try again.
+		 */
 		p_out = HTAnchor_getUCInfoStage(anchor, UCT_STAGE_HTEXT);
 	    }
 	    if (!strcmp(p_in->MIMEname, "x-transparent")) {
@@ -999,27 +1028,21 @@ HTFormat HTCharsetFormat (
 	    }
 	} else {
 	    /*
-	    **  Cannot translate.
-	    **  If according to some heuristic the given
-	    **  charset and the current display character
-	    **  both are likely to be like ISO-8859 in
-	    **  structure, pretend we have some kind
-	    **  of match.
-	    */
-	    BOOL given_is_8859
-		= (BOOL) (!strncmp(cp4, "iso-8859-", 9) &&
-		   isdigit(UCH(cp4[9])));
-	    BOOL given_is_8859like
-		= (BOOL) (given_is_8859 ||
-		   !strncmp(cp4, "windows-", 8) ||
-		   !strncmp(cp4, "cp12", 4) ||
-		   !strncmp(cp4, "cp-12", 5));
-	    BOOL given_and_display_8859like
-		= (BOOL) (given_is_8859like &&
-		   (strstr(LYchar_set_names[current_char_set],
-			   "ISO-8859") ||
-		    strstr(LYchar_set_names[current_char_set],
-			   "windows-")));
+	     * Cannot translate.  If according to some heuristic the given
+	     * charset and the current display character both are likely to be
+	     * like ISO-8859 in structure, pretend we have some kind of match.
+	     */
+	    BOOL given_is_8859 = (BOOL) (!strncmp(cp4, "iso-8859-", 9) &&
+					 isdigit(UCH(cp4[9])));
+	    BOOL given_is_8859like = (BOOL) (given_is_8859 ||
+					     !strncmp(cp4, "windows-", 8) ||
+					     !strncmp(cp4, "cp12", 4) ||
+					     !strncmp(cp4, "cp-12", 5));
+	    BOOL given_and_display_8859like = (BOOL) (given_is_8859like &&
+						      (strstr(LYchar_set_names[current_char_set],
+							      "ISO-8859") ||
+						       strstr(LYchar_set_names[current_char_set],
+							      "windows-")));
 
 	    if (given_and_display_8859like) {
 		*cp1 = '\0';
@@ -1041,118 +1064,114 @@ HTFormat HTCharsetFormat (
 	FREE(cp3);
     } else if (cp1 != NULL) {
 	/*
-	**  No charset parameter is present.
-	**  Ignore all other parameters, as
-	**  we do when charset is present. - FM
-	*/
+	 * No charset parameter is present.  Ignore all other parameters, as we
+	 * do when charset is present.  - FM
+	 */
 	*cp1 = '\0';
 	format = HTAtom_for(cp);
     }
     FREE(cp);
 
     /*
-    **	Set up defaults, if needed. - FM
-    */
+     * Set up defaults, if needed.  - FM
+     */
     if (!chartrans_ok && !anchor->charset && default_LYhndl >= 0) {
 	HTAnchor_setUCInfoStage(anchor, default_LYhndl,
 				UCT_STAGE_MIME,
 				UCT_SETBY_DEFAULT);
     }
     HTAnchor_copyUCInfoStage(anchor,
-			    UCT_STAGE_PARSER,
-			    UCT_STAGE_MIME,
-			    -1);
+			     UCT_STAGE_PARSER,
+			     UCT_STAGE_MIME,
+			     -1);
 
     return format;
 }
 
-
-
 /*	Get various pieces of meta info from file name.
-**	-----------------------------------------------
-**
-**  LYGetFileInfo fills in information that can be determined without
-**  an actual (new) access to the filesystem, based on current suffix
-**  and character set configuration.  If the file has been loaded and
-**  parsed before  (with the same URL generated here!) and the anchor
-**  is still around, some results may be influenced by that (in
-**  particular, charset info from a META tag - this is not actually
-**  tested!).
-**  The caller should not keep pointers to the returned objects around
-**  for too long, the valid lifetimes vary. In particular, the returned
-**  charset string should be copied if necessary.  If return of the
-**  file_anchor is requested, that one can be used to retrieve
-**  additional bits of info that are stored in the anchor object and
-**  are not covered here; as usual, don't keep pointers to the
-**  file_anchor longer than necessary since the object may disappear
-**  through HTuncache_current_document or at the next document load.
-**  - kw
-*/
-void LYGetFileInfo (
-	const char *		filename,
-	HTParentAnchor **	pfile_anchor,
-	HTFormat *		pformat,
-	HTAtom **		pencoding,
-	const char**		pdesc,
-	const char**		pcharset,
-	int *			pfile_cs)
+ *	-----------------------------------------------
+ *
+ *  LYGetFileInfo fills in information that can be determined without
+ *  an actual (new) access to the filesystem, based on current suffix
+ *  and character set configuration.  If the file has been loaded and
+ *  parsed before  (with the same URL generated here!) and the anchor
+ *  is still around, some results may be influenced by that (in
+ *  particular, charset info from a META tag - this is not actually
+ *  tested!).
+ *  The caller should not keep pointers to the returned objects around
+ *  for too long, the valid lifetimes vary. In particular, the returned
+ *  charset string should be copied if necessary.  If return of the
+ *  file_anchor is requested, that one can be used to retrieve
+ *  additional bits of info that are stored in the anchor object and
+ *  are not covered here; as usual, don't keep pointers to the
+ *  file_anchor longer than necessary since the object may disappear
+ *  through HTuncache_current_document or at the next document load.
+ *  - kw
+ */
+void LYGetFileInfo(const char *filename,
+		   HTParentAnchor **pfile_anchor,
+		   HTFormat *pformat,
+		   HTAtom **pencoding,
+		   const char **pdesc,
+		   const char **pcharset,
+		   int *pfile_cs)
 {
-	char *Afn;
-	char *Aname = NULL;
-	HTFormat format;
-	HTAtom * myEnc = NULL;
-	HTParentAnchor *file_anchor;
-	const char *file_csname;
-	int file_cs;
+    char *Afn;
+    char *Aname = NULL;
+    HTFormat format;
+    HTAtom *myEnc = NULL;
+    HTParentAnchor *file_anchor;
+    const char *file_csname;
+    int file_cs;
 
-	/*
-	 *  Convert filename to URL.  Note that it is always supposed to
-	 *  be a filename, not maybe-filename-maybe-URL, so we don't
-	 *  use LYFillLocalFileURL and LYEnsureAbsoluteURL. - kw
-	 */
-	Afn = HTEscape(filename, URL_PATH);
-	LYLocalFileToURL(&Aname, Afn);
-	file_anchor = HTAnchor_findSimpleAddress(Aname);
-
-	file_csname = file_anchor->charset;
-	format = HTFileFormat(filename, &myEnc, pdesc);
-	format = HTCharsetFormat(format, file_anchor, UCLYhndl_HTFile_for_unspec);
-	file_cs = HTAnchor_getUCLYhndl(file_anchor, UCT_STAGE_MIME);
-	if (!file_csname) {
-	    if (file_cs >= 0)
-		file_csname = LYCharSet_UC[file_cs].MIMEname;
-	    else file_csname = "display character set";
-	}
-	CTRACE((tfp, "GetFileInfo: '%s' is a%s %s %s file, charset=%s (%d).\n",
-	       filename,
-	       ((myEnc && *HTAtom_name(myEnc) == '8') ? "n" : myEnc ? "" :
-		*HTAtom_name(format) == 'a' ? "n" : ""),
-	       myEnc ? HTAtom_name(myEnc) : "",
-	       HTAtom_name(format),
-	       file_csname,
-	       file_cs));
-	FREE(Afn);
-	FREE(Aname);
-	if (pfile_anchor)
-	    *pfile_anchor = file_anchor;
-	if (pformat)
-	    *pformat = format;
-	if (pencoding)
-	    *pencoding = myEnc;
-	if (pcharset)
-	    *pcharset = file_csname;
-	if (pfile_cs)
-	    *pfile_cs = file_cs;
+    /*
+     * Convert filename to URL.  Note that it is always supposed to be a
+     * filename, not maybe-filename-maybe-URL, so we don't use
+     * LYFillLocalFileURL and LYEnsureAbsoluteURL.  - kw
+     */
+    Afn = HTEscape(filename, URL_PATH);
+    LYLocalFileToURL(&Aname, Afn);
+    file_anchor = HTAnchor_findSimpleAddress(Aname);
+
+    file_csname = file_anchor->charset;
+    format = HTFileFormat(filename, &myEnc, pdesc);
+    format = HTCharsetFormat(format, file_anchor, UCLYhndl_HTFile_for_unspec);
+    file_cs = HTAnchor_getUCLYhndl(file_anchor, UCT_STAGE_MIME);
+    if (!file_csname) {
+	if (file_cs >= 0)
+	    file_csname = LYCharSet_UC[file_cs].MIMEname;
+	else
+	    file_csname = "display character set";
     }
+    CTRACE((tfp, "GetFileInfo: '%s' is a%s %s %s file, charset=%s (%d).\n",
+	    filename,
+	    ((myEnc && *HTAtom_name(myEnc) == '8') ? "n" : myEnc ? "" :
+	     *HTAtom_name(format) == 'a' ? "n" : ""),
+	    myEnc ? HTAtom_name(myEnc) : "",
+	    HTAtom_name(format),
+	    file_csname,
+	    file_cs));
+    FREE(Afn);
+    FREE(Aname);
+    if (pfile_anchor)
+	*pfile_anchor = file_anchor;
+    if (pformat)
+	*pformat = format;
+    if (pencoding)
+	*pencoding = myEnc;
+    if (pcharset)
+	*pcharset = file_csname;
+    if (pfile_cs)
+	*pfile_cs = file_cs;
+}
 
 /*	Determine value from file name.
-**	-------------------------------
-**
-*/
-float HTFileValue (
-	const char *	filename)
+ *	-------------------------------
+ *
+ */
+float HTFileValue(const char *filename)
 {
-    HTSuffix * suff;
+    HTSuffix *suff;
     int n;
     int i;
     int lf = strlen(filename);
@@ -1164,101 +1183,101 @@ float HTFileValue (
     n = HTList_count(HTSuffixes);
     for (i = 0; i < n; i++) {
 	int ls;
-	suff = (HTSuffix *)HTList_objectAt(HTSuffixes, i);
+
+	suff = (HTSuffix *) HTList_objectAt(HTSuffixes, i);
 	ls = strlen(suff->suffix);
-	if ((ls <= lf) && 0==strcmp(suff->suffix, filename + lf - ls)) {
+	if ((ls <= lf) && 0 == strcmp(suff->suffix, filename + lf - ls)) {
 	    CTRACE((tfp, "File: Value of %s is %.3f\n",
-			filename, suff->quality));
-	    return suff->quality;		/* OK -- found */
+		    filename, suff->quality));
+	    return suff->quality;	/* OK -- found */
 	}
     }
-    return (float)0.3;		/* Dunno! */
+    return (float) 0.3;		/* Dunno! */
 }
 
 /*
-**  Determine compression type from file name, by looking at its suffix.
-**  Sets as side-effect a pointer to the "dot" that begins the suffix.
-*/
-CompressFileType HTCompressFileType (
-	char *		filename,
-	char *		dots,
-	char **	suffix)
+ *  Determine compression type from file name, by looking at its suffix.
+ *  Sets as side-effect a pointer to the "dot" that begins the suffix.
+ */
+CompressFileType HTCompressFileType(char *filename,
+				    char *dots,
+				    char **suffix)
 {
     CompressFileType result = cftNone;
     size_t len = strlen(filename);
     char *ftype = filename + len;
 
     if ((len > 4)
-     && !strcasecomp((ftype - 3), "bz2")
-     && strchr(dots, ftype[-4]) != 0) {
+	&& !strcasecomp((ftype - 3), "bz2")
+	&& strchr(dots, ftype[-4]) != 0) {
 	result = cftBzip2;
 	ftype -= 4;
     } else if ((len > 3)
-     && !strcasecomp((ftype - 2), "gz")
-     && strchr(dots, ftype[-3]) != 0) {
+	       && !strcasecomp((ftype - 2), "gz")
+	       && strchr(dots, ftype[-3]) != 0) {
 	result = cftGzip;
 	ftype -= 3;
     } else if ((len > 2)
-     && !strcmp((ftype - 1), "Z")
-     && strchr(dots, ftype[-2]) != 0) {
+	       && !strcmp((ftype - 1), "Z")
+	       && strchr(dots, ftype[-2]) != 0) {
 	result = cftCompress;
 	ftype -= 2;
     }
 
     *suffix = ftype;
     CTRACE((tfp, "HTCompressFileType(%s) returns %d:%s\n",
-		 filename, result, *suffix));
+	    filename, result, *suffix));
     return result;
 }
 
 /*	Determine write access to a file.
-**	---------------------------------
-**
-**  On exit:
-**	Returns YES if file can be accessed and can be written to.
-**
-**  Bugs:
-**	1.	No code for non-unix systems.
-**	2.	Isn't there a quicker way?
-*/
-BOOL HTEditable (
-	const char *	filename)
+ *	---------------------------------
+ *
+ *  On exit:
+ *	Returns YES if file can be accessed and can be written to.
+ *
+ *  Bugs:
+ *	1.	No code for non-unix systems.
+ *	2.	Isn't there a quicker way?
+ */
+BOOL HTEditable(const char *filename)
 {
 #ifndef NO_GROUPS
     GETGROUPS_T groups[NGROUPS];
-    uid_t	myUid;
-    int		ngroups;			/* The number of groups	 */
+    uid_t myUid;
+    int ngroups;		/* The number of groups  */
     struct stat fileStatus;
-    int		i;
+    int i;
 
-    if (stat(filename, &fileStatus))		/* Get details of filename */
-	return NO;				/* Can't even access file! */
+    if (stat(filename, &fileStatus))	/* Get details of filename */
+	return NO;		/* Can't even access file! */
 
     ngroups = getgroups(NGROUPS, groups);	/* Groups to which I belong  */
-    myUid = geteuid();				/* Get my user identifier */
+    myUid = geteuid();		/* Get my user identifier */
 
     if (TRACE) {
 	int i2;
+
 	fprintf(tfp,
-	    "File mode is 0%o, uid=%d, gid=%d. My uid=%d, %d groups (",
-	    (unsigned int) fileStatus.st_mode,
-	    (int) fileStatus.st_uid,
-	    (int) fileStatus.st_gid,
-	    (int) myUid,
-	    (int) ngroups);
+		"File mode is 0%o, uid=%d, gid=%d. My uid=%d, %d groups (",
+		(unsigned int) fileStatus.st_mode,
+		(int) fileStatus.st_uid,
+		(int) fileStatus.st_gid,
+		(int) myUid,
+		(int) ngroups);
 	for (i2 = 0; i2 < ngroups; i2++)
 	    fprintf(tfp, " %d", (int) groups[i2]);
 	fprintf(tfp, ")\n");
     }
 
-    if (fileStatus.st_mode & 0002)		/* I can write anyway? */
+    if (fileStatus.st_mode & 0002)	/* I can write anyway? */
 	return YES;
 
-    if ((fileStatus.st_mode & 0200)		/* I can write my own file? */
-     && (fileStatus.st_uid == myUid))
+    if ((fileStatus.st_mode & 0200)	/* I can write my own file? */
+	&&(fileStatus.st_uid == myUid))
 	return YES;
 
-    if (fileStatus.st_mode & 0020)		/* Group I am in can write? */
+    if (fileStatus.st_mode & 0020)	/* Group I am in can write? */
     {
 	for (i = 0; i < ngroups; i++) {
 	    if (groups[i] == fileStatus.st_gid)
@@ -1267,21 +1286,20 @@ BOOL HTEditable (
     }
     CTRACE((tfp, "\tFile is not editable.\n"));
 #endif /* NO_GROUPS */
-    return NO;					/* If no excuse, can't do */
+    return NO;			/* If no excuse, can't do */
 }
 
 /*	Make a save stream.
-**	-------------------
-**
-**	The stream must be used for writing back the file.
-**	@@@ no backup done
-*/
-HTStream * HTFileSaveStream (
-	HTParentAnchor *	anchor)
+ *	-------------------
+ *
+ *	The stream must be used for writing back the file.
+ *	@@@ no backup done
+ */
+HTStream *HTFileSaveStream(HTParentAnchor *anchor)
 {
-    const char * addr = anchor->address;
-    char * localname = HTLocalName(addr);
-    FILE * fp = fopen(localname, BIN_W);
+    const char *addr = anchor->address;
+    char *localname = HTLocalName(addr);
+    FILE *fp = fopen(localname, BIN_W);
 
     FREE(localname);
     if (!fp)
@@ -1291,16 +1309,14 @@ HTStream * HTFileSaveStream (
 }
 
 /*	Output one directory entry.
-**	---------------------------
-*/
-void HTDirEntry (
-	HTStructured * target,
-	const char *	tail,
-	const char *	entry)
+ *	---------------------------
+ */
+void HTDirEntry(HTStructured * target, const char *tail,
+		const char *entry)
 {
-    char * relative = NULL;
-    char * stripped = NULL;
-    char * escaped = NULL;
+    char *relative = NULL;
+    char *stripped = NULL;
+    char *escaped = NULL;
     int len;
 
     StrAllocCopy(escaped, entry);
@@ -1318,18 +1334,18 @@ void HTDirEntry (
 
     if (tail == NULL || *tail == '\0') {
 	/*
-	**  Handle extra slash at end of path.
-	*/
+	 * Handle extra slash at end of path.
+	 */
 	HTStartAnchor(target, NULL, (escaped[0] != '\0' ? escaped : "/"));
     } else {
 	/*
-	**  If empty tail, gives absolute ref below.
-	*/
+	 * If empty tail, gives absolute ref below.
+	 */
 	relative = 0;
 	HTSprintf0(&relative, "%s%s%s",
-			   tail,
-			   (*escaped != '\0' ? "/" : ""),
-			   escaped);
+		   tail,
+		   (*escaped != '\0' ? "/" : ""),
+		   escaped);
 	HTStartAnchor(target, NULL, relative);
 	FREE(relative);
     }
@@ -1338,42 +1354,42 @@ void HTDirEntry (
 }
 
 /*	Output parent directory entry.
-**	------------------------------
-**
-**    This gives the TITLE and H1 header, and also a link
-**    to the parent directory if appropriate.
-**
-**  On exit:
-**	Returns TRUE if an "Up to <parent>" link was not created
-**	for a readable local directory because LONG_LIST is defined
-**	and NO_PARENT_DIR_REFERENCE is not defined, so that the
-**	calling function should use LYListFmtParse() to create a link
-**	to the parent directory.  Otherwise, it returns FALSE. - FM
-*/
-BOOL HTDirTitles (
-	HTStructured * target,
-	HTParentAnchor * anchor,
-	BOOL		tildeIsTop)
+ *	------------------------------
+ *
+ *    This gives the TITLE and H1 header, and also a link
+ *    to the parent directory if appropriate.
+ *
+ *  On exit:
+ *	Returns TRUE if an "Up to <parent>" link was not created
+ *	for a readable local directory because LONG_LIST is defined
+ *	and NO_PARENT_DIR_REFERENCE is not defined, so that the
+ *	calling function should use LYListFmtParse() to create a link
+ *	to the parent directory.  Otherwise, it returns FALSE. - FM
+ */
+BOOL HTDirTitles(HTStructured * target, HTParentAnchor *anchor,
+		 BOOL tildeIsTop)
 {
-    const char * logical = anchor->address;
-    char * path = HTParse(logical, "", PARSE_PATH + PARSE_PUNCTUATION);
-    char * current;
-    char * cp = NULL;
+    const char *logical = anchor->address;
+    char *path = HTParse(logical, "", PARSE_PATH + PARSE_PUNCTUATION);
+    char *current;
+    char *cp = NULL;
     BOOL need_parent_link = FALSE;
     int i;
+
 #if defined(USE_DOS_DRIVES)
     BOOL local_link = (strlen(logical) > 18
-		     && !strncasecomp(logical, "file://localhost/", 17)
-		     && LYIsDosDrive(logical + 17));
+		       && !strncasecomp(logical, "file://localhost/", 17)
+		       && LYIsDosDrive(logical + 17));
     BOOL is_remote = !local_link;
+
 #else
 #define is_remote TRUE
 #endif
 
     /*
-    **	Check tildeIsTop for treating home directory as Welcome
-    **	(assume the tilde is not followed by a username). - FM
-    */
+     * Check tildeIsTop for treating home directory as Welcome (assume the
+     * tilde is not followed by a username).  - FM
+     */
     if (tildeIsTop && !strncmp(path, "/~", 2)) {
 	if (path[2] == '\0') {
 	    path[1] = '\0';
@@ -1386,93 +1402,92 @@ BOOL HTDirTitles (
     }
 
     /*
-    **	Trim out the ;type= parameter, if present. - FM
-    */
+     * Trim out the ;type= parameter, if present.  - FM
+     */
     if ((cp = strrchr(path, ';')) != NULL) {
-	if (!strncasecomp((cp+1), "type=", 5)) {
-	    if (TOUPPER(*(cp+6)) == 'D' ||
-		TOUPPER(*(cp+6)) == 'A' ||
-		TOUPPER(*(cp+6)) == 'I')
+	if (!strncasecomp((cp + 1), "type=", 5)) {
+	    if (TOUPPER(*(cp + 6)) == 'D' ||
+		TOUPPER(*(cp + 6)) == 'A' ||
+		TOUPPER(*(cp + 6)) == 'I')
 		*cp = '\0';
 	}
 	cp = NULL;
     }
-    current = LYPathLeaf (path);	/* last part or "" */
+    current = LYPathLeaf(path);	/* last part or "" */
 
     {
-      char * printable = NULL;
+	char *printable = NULL;
 
 #ifdef DIRED_SUPPORT
-      printable = HTURLPath_toFile(
-	    (0 == strncasecomp(path, "/%2F", 4))	/* "//" ? */
-	    ? (path+1)
-	    : path,
-	    TRUE,
-	    is_remote);
-      if (0 == strncasecomp(printable, "/vmsysu:", 8) ||
-	  0 == strncasecomp(printable, "/anonymou.", 10)) {
-	  StrAllocCopy(cp, (printable+1));
-	  StrAllocCopy(printable, cp);
-	  FREE(cp);
-      }
+	printable = HTURLPath_toFile(((!strncasecomp(path, "/%2F", 4))	/* "//" ? */
+				      ? (path + 1)
+				      : path),
+				     TRUE,
+				     is_remote);
+	if (0 == strncasecomp(printable, "/vmsysu:", 8) ||
+	    0 == strncasecomp(printable, "/anonymou.", 10)) {
+	    StrAllocCopy(cp, (printable + 1));
+	    StrAllocCopy(printable, cp);
+	    FREE(cp);
+	}
 #else
-      StrAllocCopy(printable, current);
-      HTUnEscape(printable);
+	StrAllocCopy(printable, current);
+	HTUnEscape(printable);
 #endif /* DIRED_SUPPORT */
 
-      START(HTML_HEAD);
-      PUTC('\n');
-      START(HTML_TITLE);
-      PUTS(*printable ? printable : WELCOME_MSG);
-      PUTS(SEGMENT_DIRECTORY);
-      END(HTML_TITLE);
-      PUTC('\n');
-      END(HTML_HEAD);
-      PUTC('\n');
+	START(HTML_HEAD);
+	PUTC('\n');
+	START(HTML_TITLE);
+	PUTS(*printable ? printable : WELCOME_MSG);
+	PUTS(SEGMENT_DIRECTORY);
+	END(HTML_TITLE);
+	PUTC('\n');
+	END(HTML_HEAD);
+	PUTC('\n');
 
 #ifdef DIRED_SUPPORT
-      START(HTML_H2);
-      PUTS(*printable ? SEGMENT_CURRENT_DIR : "");
-      PUTS(*printable ? printable : WELCOME_MSG);
-      END(HTML_H2);
-      PUTC('\n');
+	START(HTML_H2);
+	PUTS(*printable ? SEGMENT_CURRENT_DIR : "");
+	PUTS(*printable ? printable : WELCOME_MSG);
+	END(HTML_H2);
+	PUTC('\n');
 #else
-      START(HTML_H1);
-      PUTS(*printable ? printable : WELCOME_MSG);
-      END(HTML_H1);
-      PUTC('\n');
+	START(HTML_H1);
+	PUTS(*printable ? printable : WELCOME_MSG);
+	END(HTML_H1);
+	PUTC('\n');
 #endif /* DIRED_SUPPORT */
-      if (((0 == strncasecomp(printable, "vmsysu:", 7)) &&
-	   (cp = strchr(printable, '.')) != NULL &&
-	   strchr(cp, '/') == NULL) ||
-	  (0 == strncasecomp(printable, "anonymou.", 9) &&
-	   strchr(printable, '/') == NULL)) {
-	  FREE(printable);
-	  FREE(path);
-	  return(need_parent_link);
-      }
-      FREE(printable);
+	if (((0 == strncasecomp(printable, "vmsysu:", 7)) &&
+	     (cp = strchr(printable, '.')) != NULL &&
+	     strchr(cp, '/') == NULL) ||
+	    (0 == strncasecomp(printable, "anonymou.", 9) &&
+	     strchr(printable, '/') == NULL)) {
+	    FREE(printable);
+	    FREE(path);
+	    return (need_parent_link);
+	}
+	FREE(printable);
     }
 
 #ifndef NO_PARENT_DIR_REFERENCE
     /*
-    **	Make link back to parent directory.
-    */
+     * Make link back to parent directory.
+     */
     if (current - path > 0
-      && LYIsPathSep(current[-1])
-      && current[0] != '\0') {	/* was a slash AND something else too */
-	char * parent = NULL;
-	char * relative = NULL;
+	&& LYIsPathSep(current[-1])
+	&& current[0] != '\0') {	/* was a slash AND something else too */
+	char *parent = NULL;
+	char *relative = NULL;
 
 	current[-1] = '\0';
-	parent = strrchr(path, '/');  /* penultimate slash */
+	parent = strrchr(path, '/');	/* penultimate slash */
 
 	if ((parent &&
 	     (!strcmp(parent, "/..") ||
 	      !strncasecomp(parent, "/%2F", 4))) ||
 	    !strncasecomp(current, "%2F", 3)) {
 	    FREE(path);
-	    return(need_parent_link);
+	    return (need_parent_link);
 	}
 
 	relative = 0;
@@ -1480,47 +1495,45 @@ BOOL HTDirTitles (
 
 #if defined(DOSPATH) || defined(__EMX__)
 	if (local_link) {
-	    if (parent != 0 && strlen(parent) == 3 ) {
+	    if (parent != 0 && strlen(parent) == 3) {
 		StrAllocCat(relative, "/.");
 	    }
-	}
-	else
+	} else
 #endif
 
 #if !defined (VMS)
 	{
 	    /*
-	    **	On Unix, if it's not ftp and the directory cannot
-	    **	be read, don't put out a link.
-	    **
-	    **	On VMS, this problem is dealt with internally by
-	    **	HTVMSBrowseDir().
-	    */
-	    DIR  * dp = NULL;
+	     * On Unix, if it's not ftp and the directory cannot be read, don't
+	     * put out a link.
+	     *
+	     * On VMS, this problem is dealt with internally by
+	     * HTVMSBrowseDir().
+	     */
+	    DIR *dp = NULL;
 
 	    if (LYisLocalFile(logical)) {
 		/*
-		**  We need an absolute file path for the opendir.
-		**  We also need to unescape for this test.
-		**  Don't worry about %2F now, they presumably have been
-		**  dealt with above, and shouldn't appear for local
-		**  files anyway...  Assume OS / filesystem will just
-		**  ignore superfluous slashes. - KW
-		*/
-		char * fullparentpath = NULL;
+		 * We need an absolute file path for the opendir.  We also need
+		 * to unescape for this test.  Don't worry about %2F now, they
+		 * presumably have been dealt with above, and shouldn't appear
+		 * for local files anyway...  Assume OS / filesystem will just
+		 * ignore superfluous slashes.  - KW
+		 */
+		char *fullparentpath = NULL;
 
 		/*
-		**  Path has been shortened above.
-		*/
+		 * Path has been shortened above.
+		 */
 		StrAllocCopy(fullparentpath, *path ? path : "/");
 
 		/*
-		**  Guard against weirdness.
-		*/
-		if (0 == strcmp(current,"..")) {
-		    StrAllocCat(fullparentpath,"/../..");
-		} else if (0 == strcmp(current,".")) {
-		    StrAllocCat(fullparentpath,"/..");
+		 * Guard against weirdness.
+		 */
+		if (0 == strcmp(current, "..")) {
+		    StrAllocCat(fullparentpath, "/../..");
+		} else if (0 == strcmp(current, ".")) {
+		    StrAllocCat(fullparentpath, "/..");
 		}
 
 		HTUnEscape(fullparentpath);
@@ -1528,7 +1541,7 @@ BOOL HTDirTitles (
 		    FREE(fullparentpath);
 		    FREE(relative);
 		    FREE(path);
-		    return(need_parent_link);
+		    return (need_parent_link);
 		}
 		closedir(dp);
 		FREE(fullparentpath);
@@ -1536,7 +1549,7 @@ BOOL HTDirTitles (
 		need_parent_link = TRUE;
 		FREE(path);
 		FREE(relative);
-		return(need_parent_link);
+		return (need_parent_link);
 #endif /* LONG_LIST */
 	    }
 	}
@@ -1546,15 +1559,16 @@ BOOL HTDirTitles (
 
 	PUTS(SEGMENT_UP_TO);
 	if (parent) {
-	    if ((0 == strcmp(current,".")) ||
-		(0 == strcmp(current,".."))) {
+	    if ((0 == strcmp(current, ".")) ||
+		(0 == strcmp(current, ".."))) {
 		/*
-		**  Should not happen, but if it does,
-		**  at least avoid giving misleading info. - KW
-		*/
+		 * Should not happen, but if it does, at least avoid giving
+		 * misleading info.  - KW
+		 */
 		PUTS("..");
 	    } else {
-		char * printable = NULL;
+		char *printable = NULL;
+
 		StrAllocCopy(printable, parent + 1);
 		HTUnEscape(printable);
 		PUTS(printable);
@@ -1569,19 +1583,19 @@ BOOL HTDirTitles (
 #endif /* !NO_PARENT_DIR_REFERENCE */
 
     FREE(path);
-    return(need_parent_link);
+    return (need_parent_link);
 }
 
 #if defined HAVE_READDIR
 /*	Send README file.
-**	-----------------
-**
-**  If a README file exists, then it is inserted into the document here.
-*/
-static void do_readme (HTStructured *  target, const char *  localname)
+ *	-----------------
+ *
+ *  If a README file exists, then it is inserted into the document here.
+ */
+static void do_readme(HTStructured * target, const char *localname)
 {
-    FILE * fp;
-    char * readme_file_name = NULL;
+    FILE *fp;
+    char *readme_file_name = NULL;
     int ch;
 
     HTSprintf0(&readme_file_name, "%s/%s", localname, HT_DIR_README_FILE);
@@ -1591,10 +1605,10 @@ static void do_readme (HTStructured *  target, const char *  localname)
     if (fp) {
 	HTStructuredClass targetClass;
 
-	targetClass =  *target->isa;	/* (Can't init agregate in K&R) */
+	targetClass = *target->isa;	/* (Can't init agregate in K&R) */
 	START(HTML_PRE);
 	while ((ch = fgetc(fp)) != EOF) {
-	    PUTC((char)ch);
+	    PUTC((char) ch);
 	}
 	END(HTML_PRE);
 	HTDisplayPartial();
@@ -1609,9 +1623,10 @@ static void do_readme (HTStructured *  target, const char *  localname)
 #define NM_cmp(a,b) ((a) < (b) ? -1 : ((a) > (b) ? 1 : 0))
 
 #if defined(LONG_LIST) && defined(DIRED_SUPPORT)
-static char *file_type (char *  path)
+static char *file_type(char *path)
 {
     char *type;
+
     while (*path == '.')
 	++path;
     type = strchr(path, '.');
@@ -1621,11 +1636,12 @@ static char *file_type (char *  path)
 }
 #endif /* LONG_LIST && DIRED_SUPPORT */
 
-static int dired_cmp (void *  a, void *  b)
+static int dired_cmp(void *a, void *b)
 {
-    DIRED *p = (DIRED *)a;
-    DIRED *q = (DIRED *)b;
+    DIRED *p = (DIRED *) a;
+    DIRED *q = (DIRED *) b;
     int code = p->sort_tags - q->sort_tags;
+
 #if defined(LONG_LIST) && defined(DIRED_SUPPORT)
     if (code == 0) {
 	switch (dir_list_order) {
@@ -1665,20 +1681,18 @@ static int dired_cmp (void *  a, void *  b)
     return code;
 }
 
-static int print_local_dir (
-	DIR  *			dp,
-	char *			localname,
-	HTParentAnchor *	anchor,
-	HTFormat		format_out,
-	HTStream *		sink)
+static int print_local_dir(DIR *dp, char *localname,
+			   HTParentAnchor *anchor,
+			   HTFormat format_out,
+			   HTStream *sink)
 {
     HTStructured *target;	/* HTML object */
     HTStructuredClass targetClass;
-    STRUCT_DIRENT * dirbuf;
+    STRUCT_DIRENT *dirbuf;
     char *pathname = NULL;
     char *tail = NULL;
     BOOL present[HTML_A_ATTRIBUTES];
-    char * tmpfilename = NULL;
+    char *tmpfilename = NULL;
     BOOL need_parent_link = FALSE;
     int status;
     int i;
@@ -1688,24 +1702,24 @@ static int print_local_dir (
     pathname = HTParse(anchor->address, "",
 		       PARSE_PATH + PARSE_PUNCTUATION);
 
-    if (!strcmp(pathname,"/")) {
+    if (!strcmp(pathname, "/")) {
 	/*
-	**  Root path.
-	*/
-	StrAllocCopy (tail, "/foo/..");
+	 * Root path.
+	 */
+	StrAllocCopy(tail, "/foo/..");
     } else {
-	char *p = strrchr(pathname, '/');  /* find last slash */
+	char *p = strrchr(pathname, '/');	/* find last slash */
 
 	if (!p) {
 	    /*
-	    **	This probably should not happen,
-	    **	but be prepared if it does. - KW
-	    */
-	    StrAllocCopy (tail, "/foo/..");
+	     * This probably should not happen, but be prepared if it does.  -
+	     * KW
+	     */
+	    StrAllocCopy(tail, "/foo/..");
 	} else {
 	    /*
-	    **	Take slash off the beginning.
-	    */
+	     * Take slash off the beginning.
+	     */
 	    StrAllocCopy(tail, (p + 1));
 	}
     }
@@ -1719,19 +1733,17 @@ static int print_local_dir (
     }
 
     target = HTML_new(anchor, format_out, sink);
-    targetClass = *target->isa;	    /* Copy routine entry points */
+    targetClass = *target->isa;	/* Copy routine entry points */
 
     for (i = 0; i < HTML_A_ATTRIBUTES; i++)
 	present[i] = (BOOL) (i == HTML_A_HREF);
 
     /*
-    **	The need_parent_link flag will be set if an
-    **	"Up to <parent>" link was not created for a
-    **	readable parent in HTDirTitles() because
-    **	LONG_LIST is defined and NO_PARENT_DIR_REFERENCE
-    **	is not defined so that need we to create the
-    **	link via an LYListFmtParse() call. - FM
-    */
+     * The need_parent_link flag will be set if an "Up to <parent>" link was
+     * not created for a readable parent in HTDirTitles() because LONG_LIST is
+     * defined and NO_PARENT_DIR_REFERENCE is not defined so that need we to
+     * create the link via an LYListFmtParse() call.  - FM
+     */
     need_parent_link = HTDirTitles(target, anchor, FALSE);
 
 #ifdef DIRED_SUPPORT
@@ -1744,31 +1756,30 @@ static int print_local_dir (
 	do_readme(target, localname);
 
     {
-	HTBTree * bt = HTBTree_new(dired_cmp);
-	int num_of_entries = 0;	    /* lines counter */
+	HTBTree *bt = HTBTree_new(dired_cmp);
+	int num_of_entries = 0;	/* lines counter */
 
-	_HTProgress (READING_DIRECTORY);
-	status = HT_LOADED; /* assume we don't get interrupted */
+	_HTProgress(READING_DIRECTORY);
+	status = HT_LOADED;	/* assume we don't get interrupted */
 	while ((dirbuf = readdir(dp)) != NULL) {
 	    /*
-	    **	While there are directory entries to be read...
-	    */
+	     * While there are directory entries to be read...
+	     */
 	    DIRED *data = NULL;
 
 #if !(defined(DOSPATH) || defined(__EMX__))
 	    if (dirbuf->d_ino == 0)
 		/*
-		**  If the entry is not being used, skip it.
-		*/
+		 * If the entry is not being used, skip it.
+		 */
 		continue;
 #endif
 	    /*
-	    **	Skip self, parent if handled in HTDirTitles()
-	    **	or if NO_PARENT_DIR_REFERENCE is not defined,
-	    **	and any dot files if no_dotfiles is set or
-	    **	show_dotfiles is not set. - FM
-	    */
-	    if (!strcmp(dirbuf->d_name, ".")   /* self	 */ ||
+	     * Skip self, parent if handled in HTDirTitles() or if
+	     * NO_PARENT_DIR_REFERENCE is not defined, and any dot files if
+	     * no_dotfiles is set or show_dotfiles is not set.  - FM
+	     */
+	    if (!strcmp(dirbuf->d_name, ".") /* self       */ ||
 		(!strcmp(dirbuf->d_name, "..") /* parent */ &&
 		 need_parent_link == FALSE) ||
 		((strcmp(dirbuf->d_name, "..")) &&
@@ -1778,16 +1789,16 @@ static int print_local_dir (
 
 	    StrAllocCopy(tmpfilename, localname);
 	    /*
-	    **  If filename is not root directory, add trailing separator.
-	    */
+	     * If filename is not root directory, add trailing separator.
+	     */
 	    LYAddPathSep(&tmpfilename);
 
 	    StrAllocCat(tmpfilename, dirbuf->d_name);
-	    data = (DIRED *)malloc(sizeof(DIRED) + strlen(dirbuf->d_name) + 4);
+	    data = (DIRED *) malloc(sizeof(DIRED) + strlen(dirbuf->d_name) + 4);
 	    if (data == NULL) {
 		/* FIXME */
 	    }
-	    LYTrimPathSep (tmpfilename);
+	    LYTrimPathSep(tmpfilename);
 	    if (lstat(tmpfilename, &(data->file_info)) < 0)
 		data->file_info.st_mode = 0;
 
@@ -1819,15 +1830,15 @@ static int print_local_dir (
 	    }
 #endif /* !DIRED_SUPPORT */
 	    /*
-	    **	Sort dirname in the tree bt.
-	    */
+	     * Sort dirname in the tree bt.
+	     */
 	    HTBTree_add(bt, data);
 
 #ifdef DISP_PARTIAL
 	    /* optimize for expensive operation: */
-	    if (num_of_entries % (partial_threshold > 0  ?
+	    if (num_of_entries % (partial_threshold > 0 ?
 				  partial_threshold : display_lines)
-			       == 0) {
+		== 0) {
 		if (HTCheckForInterrupt()) {
 		    status = HT_PARTIAL_CONTENT;
 		    break;
@@ -1836,26 +1847,27 @@ static int print_local_dir (
 	    num_of_entries++;
 #endif /* DISP_PARTIAL */
 
-	}   /* end while directory entries left to read */
+	}			/* end while directory entries left to read */
 
 	if (status != HT_PARTIAL_CONTENT)
-	    _HTProgress (OPERATION_OK);
+	    _HTProgress(OPERATION_OK);
 	else
 	    CTRACE((tfp, "Reading the directory interrupted by user\n"));
 
-
 	/*
-	**  Run through tree printing out in order.
-	*/
+	 * Run through tree printing out in order.
+	 */
 	{
-	    HTBTElement * next_element = HTBTree_next(bt,NULL);
-		/* pick up the first element of the list */
-	    int num_of_entries_output = 0; /* lines counter */
+	    HTBTElement *next_element = HTBTree_next(bt, NULL);
+
+	    /* pick up the first element of the list */
+	    int num_of_entries_output = 0;	/* lines counter */
 
 	    char state;
-		/* I for initial (.. file),
-		   D for directory file,
-		   F for file */
+
+	    /* I for initial (.. file),
+	       D for directory file,
+	       F for file */
 
 #ifdef DIRED_SUPPORT
 	    char test;
@@ -1866,9 +1878,9 @@ static int print_local_dir (
 		DIRED *entry;
 
 #ifndef DISP_PARTIAL
-		if (num_of_entries_output % HTMAX(display_lines,10) == 0) {
+		if (num_of_entries_output % HTMAX(display_lines, 10) == 0) {
 		    if (HTCheckForInterrupt()) {
-			_HTProgress (TRANSFER_INTERRUPTED);
+			_HTProgress(TRANSFER_INTERRUPTED);
 			status = HT_PARTIAL_CONTENT;
 			break;
 		    }
@@ -1876,20 +1888,19 @@ static int print_local_dir (
 #endif
 		StrAllocCopy(tmpfilename, localname);
 		/*
-		**	If filename is not root directory.
-		*/
+		 * If filename is not root directory.
+		 */
 		LYAddPathSep(&tmpfilename);
 
-		entry = (DIRED *)(HTBTree_object(next_element));
+		entry = (DIRED *) (HTBTree_object(next_element));
 		/*
-		**  Append the current entry's filename
-		**  to the path.
-		*/
+		 * Append the current entry's filename to the path.
+		 */
 		StrAllocCat(tmpfilename, entry->file_name);
 		HTSimplify(tmpfilename);
 		/*
-		**  Output the directory entry.
-		*/
+		 * Output the directory entry.
+		 */
 		if (strcmp(DIRED_NAME(HTBTree_object(next_element)), "..")) {
 #ifdef DIRED_SUPPORT
 		    test = (DIRED_BLOK(HTBTree_object(next_element))
@@ -1908,15 +1919,15 @@ static int print_local_dir (
 			    }
 #endif /* !LONG_LIST */
 			state =
-			   (char) (DIRED_BLOK(HTBTree_object(next_element))
-			    == 'D' ? 'D' : 'F');
+			    (char) (DIRED_BLOK(HTBTree_object(next_element))
+				    == 'D' ? 'D' : 'F');
 			START(HTML_H2);
 			if (dir_list_style != MIXED_STYLE) {
-			   START(HTML_EM);
-			   PUTS(state == 'D'
-			      ? LABEL_SUBDIRECTORIES
-			      : LABEL_FILES);
-			   END(HTML_EM);
+			    START(HTML_EM);
+			    PUTS(state == 'D'
+				 ? LABEL_SUBDIRECTORIES
+				 : LABEL_FILES);
+			    END(HTML_EM);
 			}
 			END(HTML_H2);
 			PUTC('\n');
@@ -1934,13 +1945,13 @@ static int print_local_dir (
 			}
 #endif /* !LONG_LIST */
 			state =
-			  (char) (DIRED_BLOK(HTBTree_object(next_element))
-			   == 'D' ? 'D' : 'F');
+			    (char) (DIRED_BLOK(HTBTree_object(next_element))
+				    == 'D' ? 'D' : 'F');
 			START(HTML_H2);
 			START(HTML_EM);
 			PUTS(state == 'D'
-			    ? LABEL_SUBDIRECTORIES
-			    : LABEL_FILES);
+			     ? LABEL_SUBDIRECTORIES
+			     : LABEL_FILES);
 			END(HTML_EM);
 			END(HTML_H2);
 			PUTC('\n');
@@ -1954,7 +1965,6 @@ static int print_local_dir (
 		    START(HTML_LI);
 #endif /* !LONG_LIST */
 		}
-
 #ifdef LONG_LIST
 		LYListFmtParse(list_format, entry, tmpfilename, target, tail);
 #else
@@ -1966,8 +1976,8 @@ static int print_local_dir (
 #endif /* LONG_LIST */
 
 		next_element = HTBTree_next(bt, next_element);
-		    /* pick up the next element of the list;
-		     if none, return NULL*/
+		/* pick up the next element of the list;
+		   if none, return NULL */
 
 		/* optimize for expensive operation: */
 #ifdef DISP_PARTIAL
@@ -1979,7 +1989,7 @@ static int print_local_dir (
 		    HTDisplayPartial();
 
 		    if (HTCheckForInterrupt()) {
-			_HTProgress (TRANSFER_INTERRUPTED);
+			_HTProgress(TRANSFER_INTERRUPTED);
 			status = HT_PARTIAL_CONTENT;
 			break;
 		    }
@@ -1987,7 +1997,7 @@ static int print_local_dir (
 		num_of_entries_output++;
 #endif /* DISP_PARTIAL */
 
-	    } /* end while next_element */
+	    }			/* end while next_element */
 
 	    if (status == HT_LOADED) {
 		if (state == 'I') {
@@ -1999,7 +2009,7 @@ static int print_local_dir (
 		    END(HTML_DIR);
 #endif /* !LONG_LIST */
 	    }
-	} /* end printing out the tree in order */
+	}			/* end printing out the tree in order */
 
 	FREE(tmpfilename);
 	FREE(tail);
@@ -2014,21 +2024,20 @@ static int print_local_dir (
 	}
     }
     HTFinishDisplayPartial();
-    return status;  /* document loaded, maybe partial */
+    return status;		/* document loaded, maybe partial */
 }
 #endif /* HAVE_READDIR */
 
-
 #ifndef VMS
-int HTStat (
-	const char *	filename,
-	struct stat *	data)
+int HTStat(const char *filename,
+	   struct stat *data)
 {
     int result = -1;
     size_t len = strlen(filename);
 
-    if (len != 0 && LYIsPathSep(filename[len-1])) {
+    if (len != 0 && LYIsPathSep(filename[len - 1])) {
 	char *temp_name = NULL;
+
 	HTSprintf0(&temp_name, "%s.", filename);
 	result = HTStat(temp_name, data);
 	FREE(temp_name);
@@ -2040,7 +2049,7 @@ int HTStat (
 	 * directory on Windows.
 	 */
 	if (result == -1
-	 && access(filename, 0) == 0) {
+	    && access(filename, 0) == 0) {
 	    data->st_mode = S_IFDIR;
 	    result = 0;
 	}
@@ -2051,33 +2060,33 @@ int HTStat (
 #endif
 
 /*	Load a document.
-**	----------------
-**
-**  On entry:
-**	addr		must point to the fully qualified hypertext reference.
-**			This is the physical address of the file
-**
-**  On exit:
-**	returns		<0		Error has occurred.
-**			HTLOADED	OK
-**
-*/
-int HTLoadFile (
-	const char *		addr,
-	HTParentAnchor *	anchor,
-	HTFormat		format_out,
-	HTStream *		sink)
+ *	----------------
+ *
+ *  On entry:
+ *	addr		must point to the fully qualified hypertext reference.
+ *			This is the physical address of the file
+ *
+ *  On exit:
+ *	returns		<0		Error has occurred.
+ *			HTLOADED	OK
+ *
+ */
+int HTLoadFile(const char *addr,
+	       HTParentAnchor *anchor,
+	       HTFormat format_out,
+	       HTStream *sink)
 {
-    char * filename = NULL;
-    char * acc_method = NULL;
-    char * ftp_newhost;
+    char *filename = NULL;
+    char *acc_method = NULL;
+    char *ftp_newhost;
     HTFormat format;
-    char * nodename = NULL;
-    char * newname = NULL;	/* Simplified name of file */
-    HTAtom * encoding;		/* @@ not used yet */
-    HTAtom * myEncoding = NULL; /* enc of this file, may be gzip etc. */
+    char *nodename = NULL;
+    char *newname = NULL;	/* Simplified name of file */
+    HTAtom *encoding;		/* @@ not used yet */
+    HTAtom *myEncoding = NULL;	/* enc of this file, may be gzip etc. */
     int status = -1;
     char *dot;
+
 #ifdef VMS
     struct stat stat_info;
 #endif /* VMS */
@@ -2093,19 +2102,19 @@ int HTLoadFile (
 #endif
 
     /*
-    **	Reduce the filename to a basic form (hopefully unique!).
-    */
+     * Reduce the filename to a basic form (hopefully unique!).
+     */
     StrAllocCopy(newname, addr);
-    filename=HTParse(newname, "", PARSE_PATH|PARSE_PUNCTUATION);
-    nodename=HTParse(newname, "", PARSE_HOST);
+    filename = HTParse(newname, "", PARSE_PATH | PARSE_PUNCTUATION);
+    nodename = HTParse(newname, "", PARSE_HOST);
 
     /*
-    **	If access is ftp, or file is on another host, invoke ftp now.
-    */
+     * If access is ftp, or file is on another host, invoke ftp now.
+     */
     acc_method = HTParse(newname, "", PARSE_ACCESS);
     if (strcmp("ftp", acc_method) == 0 ||
-       (!LYSameHostname("localhost", nodename) &&
-	!LYSameHostname(nodename, HTHostName()))) {
+	(!LYSameHostname("localhost", nodename) &&
+	 !LYSameHostname(nodename, HTHostName()))) {
 	status = -1;
 	FREE(newname);
 	FREE(filename);
@@ -2118,8 +2127,8 @@ int HTLoadFile (
 
 	status = HTFTPLoad(addr, anchor, format_out, sink);
 
-	if ( ftp_passive == ftp_local_passive ) {
-	    if (( status >= 400 ) || ( status < 0 )) {
+	if (ftp_passive == ftp_local_passive) {
+	    if ((status >= 400) || (status < 0)) {
 		ftp_local_passive = !ftp_passive;
 		status = HTFTPLoad(addr, anchor, format_out, sink);
 	    }
@@ -2138,13 +2147,13 @@ int HTLoadFile (
 #endif /* VMS */
 
     /*
-    **	Determine the format and encoding mapped to any suffix.
-    */
+     * Determine the format and encoding mapped to any suffix.
+     */
     if (anchor->content_type && anchor->content_encoding) {
 	/*
-	 *  If content_type and content_encoding are BOTH already set
-	 *  in the anchor object, we believe it and don't try to
-	 *  derive format and encoding from the filename. - kw
+	 * If content_type and content_encoding are BOTH already set in the
+	 * anchor object, we believe it and don't try to derive format and
+	 * encoding from the filename.  - kw
 	 */
 	format = HTAtom_for(anchor->content_type);
 	myEncoding = HTAtom_for(anchor->content_encoding);
@@ -2158,22 +2167,22 @@ int HTLoadFile (
 
 	format = HTFileFormat(filename, &myEncoding, NULL);
 
-    /*
-    **	Check the format for an extended MIME charset value, and
-    **	act on it if present.  Otherwise, assume what is indicated
-    **	by the last parameter (fallback will effectively be
-    **	UCLYhndl_for_unspec, by default ISO-8859-1). - kw
-    */
-	format = HTCharsetFormat(format, anchor, default_UCLYhndl );
+	/*
+	 * Check the format for an extended MIME charset value, and act on it
+	 * if present.  Otherwise, assume what is indicated by the last
+	 * parameter (fallback will effectively be UCLYhndl_for_unspec, by
+	 * default ISO-8859-1).  - kw
+	 */
+	format = HTCharsetFormat(format, anchor, default_UCLYhndl);
     }
 
 #ifdef VMS
     /*
-    **	Check to see if the 'filename' is in fact a directory.	If it is
-    **	create a new hypertext object containing a list of files and
-    **	subdirectories contained in the directory.  All of these are links
-    **	to the directories or files listed.
-    */
+     * Check to see if the 'filename' is in fact a directory.  If it is create
+     * a new hypertext object containing a list of files and subdirectories
+     * contained in the directory.  All of these are links to the directories
+     * or files listed.
+     */
     if (HTStat(filename, &stat_info) == -1) {
 	CTRACE((tfp, "HTLoadFile: Can't stat %s\n", filename));
     } else {
@@ -2185,7 +2194,7 @@ int HTLoadFile (
 	    }
 
 	    if (HTDirAccess == HT_DIR_SELECTIVE) {
-		char * enable_file_name = NULL;
+		char *enable_file_name = NULL;
 
 		HTSprintf0(&enable_file_name, "%s/%s", filename, HT_DIR_ENABLE_FILE);
 		if (HTStat(enable_file_name, &stat_info) == -1) {
@@ -2203,26 +2212,28 @@ int HTLoadFile (
     }
 
     /*
-    **	Assume that the file is in Unix-style syntax if it contains a '/'
-    **	after the leading one. @@
-    */
+     * Assume that the file is in Unix-style syntax if it contains a '/' after
+     * the leading one.  @@
+     */
     {
-	FILE * fp;
-	char * vmsname = strchr(filename + 1, '/') ?
-		    HTVMS_name(nodename, filename) : filename + 1;
+	FILE *fp;
+	char *vmsname = strchr(filename + 1, '/') ?
+	HTVMS_name(nodename, filename) : filename + 1;
+
 	fp = fopen(vmsname, "r", "shr=put", "shr=upd");
 
 	/*
-	**  If the file wasn't VMS syntax, then perhaps it is Ultrix.
-	*/
+	 * If the file wasn't VMS syntax, then perhaps it is Ultrix.
+	 */
 	if (!fp) {
-	    char * ultrixname = 0;
+	    char *ultrixname = 0;
+
 	    CTRACE((tfp, "HTLoadFile: Can't open as %s\n", vmsname));
 	    HTSprintf0(&ultrixname, "%s::\"%s\"", nodename, filename);
 	    fp = fopen(ultrixname, "r", "shr=put", "shr=upd");
 	    if (!fp) {
 		CTRACE((tfp, "HTLoadFile: Can't open as %s\n",
-			    ultrixname));
+			ultrixname));
 	    }
 	    FREE(ultrixname);
 	}
@@ -2230,27 +2241,27 @@ int HTLoadFile (
 	    char *semicolon = NULL;
 
 	    if (HTEditable(vmsname)) {
-		HTAtom * put = HTAtom_for("PUT");
-		HTList * methods = HTAnchor_methods(anchor);
+		HTAtom *put = HTAtom_for("PUT");
+		HTList *methods = HTAnchor_methods(anchor);
+
 		if (HTList_indexOf(methods, put) == (-1)) {
 		    HTList_addObject(methods, put);
 		}
 	    }
 	    /*
-	    **	Trim vmsname at semicolon if a version number was
-	    **	included, so it doesn't interfere with the check
-	    **	for a compressed file. - FM
-	    */
+	     * Trim vmsname at semicolon if a version number was included, so
+	     * it doesn't interfere with the check for a compressed file.  - FM
+	     */
 	    if ((semicolon = strchr(vmsname, ';')) != NULL)
 		*semicolon = '\0';
 	    /*
-	    **	Fake a Content-Encoding for compressed files. - FM
-	    */
+	     * Fake a Content-Encoding for compressed files.  - FM
+	     */
 	    if (!IsUnityEnc(myEncoding)) {
 		/*
-		 *  We already know from the call to HTFileFormat above
-		 *  that this is a compressed file, no need to look at
-		 *  the filename again. - kw
+		 * We already know from the call to HTFileFormat above that
+		 * this is a compressed file, no need to look at the filename
+		 * again.  - kw
 		 */
 #ifdef USE_ZLIB
 		if (strcmp(format_out->name, "www/download") != 0 &&
@@ -2262,24 +2273,24 @@ int HTLoadFile (
 		    gzfp = gzopen(vmsname, BIN_R);
 
 		    CTRACE((tfp, "HTLoadFile: gzopen of `%s' gives %p\n",
-				vmsname, (void*)gzfp));
+			    vmsname, (void *) gzfp));
 		    internal_decompress = cftGzip;
 		} else
-#endif	/* USE_ZLIB */
+#endif /* USE_ZLIB */
 #ifdef USE_BZLIB
-		if (strcmp(format_out->name, "www/download") != 0 &&
-		    (!strcmp(HTAtom_name(myEncoding), "bzip2") ||
-		     !strcmp(HTAtom_name(myEncoding), "x-bzip2"))) {
+		    if (strcmp(format_out->name, "www/download") != 0 &&
+			(!strcmp(HTAtom_name(myEncoding), "bzip2") ||
+			 !strcmp(HTAtom_name(myEncoding), "x-bzip2"))) {
 		    fclose(fp);
 		    if (semicolon != NULL)
 			*semicolon = ';';
 		    bzfp = BZ2_bzopen(vmsname, BIN_R);
 
 		    CTRACE((tfp, "HTLoadFile: bzopen of `%s' gives %p\n",
-				vmsname, (void*)bzfp));
+			    vmsname, (void *) bzfp));
 		    use_zread = YES;
 		} else
-#endif	/* USE_BZLIB */
+#endif /* USE_BZLIB */
 		{
 		    StrAllocCopy(anchor->content_type, format->name);
 		    StrAllocCopy(anchor->content_encoding, HTAtom_name(myEncoding));
@@ -2316,12 +2327,12 @@ int HTLoadFile (
 			gzfp = gzopen(vmsname, BIN_R);
 
 			CTRACE((tfp, "HTLoadFile: gzopen of `%s' gives %p\n",
-				    vmsname, (void*)gzfp));
+				vmsname, (void *) gzfp));
 			internal_decompress = cftGzip;
 		    }
-#else  /* USE_ZLIB */
+#else /* USE_ZLIB */
 		    format = HTAtom_for("www/compressed");
-#endif	/* USE_ZLIB */
+#endif /* USE_ZLIB */
 		    break;
 		case cftBzip2:
 		    StrAllocCopy(anchor->content_encoding, "x-bzip2");
@@ -2333,12 +2344,12 @@ int HTLoadFile (
 			bzfp = BZ2_bzopen(vmsname, BIN_R);
 
 			CTRACE((tfp, "HTLoadFile: bzopen of `%s' gives %p\n",
-				    vmsname, (void*)bzfp));
+				vmsname, (void *) bzfp));
 			internal_decompress = cfgBzip2;
 		    }
-#else  /* USE_BZLIB */
+#else /* USE_BZLIB */
 		    format = HTAtom_for("www/compressed");
-#endif	/* USE_BZLIB */
+#endif /* USE_BZLIB */
 		    break;
 		case cftNone:
 		    break;
@@ -2371,13 +2382,15 @@ int HTLoadFile (
 					 -(HT_ERROR),
 					 FAILED_OPEN_COMPRESSED_FILE);
 		} else {
-		    char * sugfname = NULL;
+		    char *sugfname = NULL;
+
 		    if (anchor->SugFname) {
 			StrAllocCopy(sugfname, anchor->SugFname);
 		    } else {
-			char * anchor_path = HTParse(anchor->address, "",
-						     PARSE_PATH + PARSE_PUNCTUATION);
-			char * lastslash;
+			char *anchor_path = HTParse(anchor->address, "",
+						    PARSE_PATH + PARSE_PUNCTUATION);
+			char *lastslash;
+
 			HTUnEscape(anchor_path);
 			lastslash = strrchr(anchor_path, '/');
 			if (lastslash)
@@ -2411,7 +2424,7 @@ int HTLoadFile (
 		fclose(fp);
 	    }
 	    return status;
-	}  /* If successful open */
+	}			/* If successful open */
 	FREE(filename);
     }
 
@@ -2420,36 +2433,36 @@ int HTLoadFile (
     FREE(filename);
 
     /*
-    **	For unix, we try to translate the name into the name of a
-    **	transparently mounted file.
-    **
-    **	Not allowed in secure (HTClientHost) situations. TBL 921019
-    */
+     * For unix, we try to translate the name into the name of a transparently
+     * mounted file.
+     *
+     * Not allowed in secure (HTClientHost) situations.  TBL 921019
+     */
 #ifndef NO_UNIX_IO
-    /*	Need protection here for telnet server but not httpd server. */
+    /*  Need protection here for telnet server but not httpd server. */
 
     if (!HTSecure) {		/* try local file system */
-	char * localname = HTLocalName(addr);
+	char *localname = HTLocalName(addr);
 	struct stat dir_info;
 
 #ifdef HAVE_READDIR
 	/*
-	**  Multiformat handling.
-	**
-	**  If needed, scan directory to find a good file.
-	**  Bug:  We don't stat the file to find the length.
-	*/
+	 * Multiformat handling.
+	 *
+	 * If needed, scan directory to find a good file.  Bug:  We don't stat
+	 * the file to find the length.
+	 */
 	if ((strlen(localname) > strlen(MULTI_SUFFIX)) &&
 	    (0 == strcmp(localname + strlen(localname) - strlen(MULTI_SUFFIX),
 			 MULTI_SUFFIX))) {
 	    DIR *dp = 0;
 	    BOOL forget_multi = NO;
 
-	    STRUCT_DIRENT * dirbuf;
-	    float best = (float) NO_VALUE_FOUND; /* So far best is bad */
+	    STRUCT_DIRENT *dirbuf;
+	    float best = (float) NO_VALUE_FOUND;	/* So far best is bad */
 	    HTFormat best_rep = NULL;	/* Set when rep found */
-	    HTAtom * best_enc = NULL;
-	    char * best_name = NULL;	/* Best dir entry so far */
+	    HTAtom *best_enc = NULL;
+	    char *best_name = NULL;	/* Best dir entry so far */
 
 	    char *base = strrchr(localname, '/');
 	    int baselen = 0;
@@ -2457,8 +2470,8 @@ int HTLoadFile (
 	    if (!base || base == localname) {
 		forget_multi = YES;
 	    } else {
-		*base++ = '\0';		/* Just got directory name */
-		baselen = strlen(base)- strlen(MULTI_SUFFIX);
+		*base++ = '\0';	/* Just got directory name */
+		baselen = strlen(base) - strlen(MULTI_SUFFIX);
 		base[baselen] = '\0';	/* Chop off suffix */
 
 		dp = opendir(localname);
@@ -2471,24 +2484,26 @@ int HTLoadFile (
 
 	    while ((dirbuf = readdir(dp)) != NULL) {
 		/*
-		**  While there are directory entries to be read...
-		*/
+		 * While there are directory entries to be read...
+		 */
 #if !(defined(DOSPATH) || defined(__EMX__))
 		if (dirbuf->d_ino == 0)
 		    continue;	/* if the entry is not being used, skip it */
 #endif
-		if ((int)strlen(dirbuf->d_name) > baselen &&	 /* Match? */
+		if ((int) strlen(dirbuf->d_name) > baselen &&	/* Match? */
 		    !strncmp(dirbuf->d_name, base, baselen)) {
-		    HTAtom * enc;
+		    HTAtom *enc;
 		    HTFormat rep = HTFileFormat(dirbuf->d_name, &enc, NULL);
 		    float filevalue = HTFileValue(dirbuf->d_name);
 		    float value = HTStackValue(rep, format_out,
-						filevalue,
-						0L  /* @@@@@@ */);
+					       filevalue,
+					       0L /* @@@@@@ */ );
+
 		    if (value <= 0.0) {
 			char *atomname = NULL;
-			CompressFileType cft = HTCompressFileType(dirbuf->d_name, ".", &dot);
-			char * cp = NULL;
+			CompressFileType cft =
+			HTCompressFileType(dirbuf->d_name, ".", &dot);
+			char *cp = NULL;
 
 			enc = NULL;
 			if (cft != cftNone) {
@@ -2529,69 +2544,69 @@ int HTLoadFile (
 			}
 		    }
 		    if (value != NO_VALUE_FOUND) {
-			CTRACE((tfp, "HTLoadFile: value of presenting %s is %f\n",
-				    HTAtom_name(rep), value));
-			if  (value > best) {
+			CTRACE((tfp,
+				"HTLoadFile: value of presenting %s is %f\n",
+				HTAtom_name(rep), value));
+			if (value > best) {
 			    best_rep = rep;
 			    best_enc = enc;
 			    best = value;
 			    StrAllocCopy(best_name, dirbuf->d_name);
 			}
-		    }	/* if best so far */
-		 } /* if match */
-
-	    } /* end while directory entries left to read */
+		    }		/* if best so far */
+		}
+		/* if match */
+	    }			/* end while directory entries left to read */
 	    closedir(dp);
 
 	    if (best_rep) {
 		format = best_rep;
 		myEncoding = best_enc;
-		base[-1] = '/';		/* Restore directory name */
+		base[-1] = '/';	/* Restore directory name */
 		base[0] = '\0';
 		StrAllocCat(localname, best_name);
 		FREE(best_name);
-	    } else {			/* If not found suitable file */
+	    } else {		/* If not found suitable file */
 		FREE(localname);
 		FREE(nodename);
 		return HTLoadError(sink, 403, FAILED_NO_REPRESENTATION);
 	    }
-	    /*NOTREACHED*/
-	} /* if multi suffix */
-
+	    /*NOTREACHED */
+	}
+	/* if multi suffix */
 	/*
-	**  Check to see if the 'localname' is in fact a directory.  If it
-	**  is create a new hypertext object containing a list of files and
-	**  subdirectories contained in the directory.	All of these are
-	**  links to the directories or files listed.
-	**  NB This assumes the existence of a type 'STRUCT_DIRENT', which
-	**  will hold the directory entry, and a type 'DIR' which is used
-	**  to point to the current directory being read.
-	*/
+	 * Check to see if the 'localname' is in fact a directory.  If it is
+	 * create a new hypertext object containing a list of files and
+	 * subdirectories contained in the directory.  All of these are links
+	 * to the directories or files listed.  NB This assumes the existence
+	 * of a type 'STRUCT_DIRENT', which will hold the directory entry, and
+	 * a type 'DIR' which is used to point to the current directory being
+	 * read.
+	 */
 #if defined(USE_DOS_DRIVES)
 	if (strlen(localname) == 2 && LYIsDosDrive(localname))
 	    LYAddPathSep(&localname);
 #endif
-	if (HTStat(localname,&dir_info) == -1)	   /* get file information */
+	if (HTStat(localname, &dir_info) == -1)		/* get file information */
 	{
-				/* if can't read file information */
+	    /* if can't read file information */
 	    CTRACE((tfp, "HTLoadFile: can't stat %s\n", localname));
 
-	}  else {		/* Stat was OK */
+	} else {		/* Stat was OK */
 
 	    if (S_ISDIR(dir_info.st_mode)) {
 		/*
-		**  If localname is a directory.
-		*/
+		 * If localname is a directory.
+		 */
 		DIR *dp;
 		struct stat file_info;
 
 		CTRACE((tfp, "%s is a directory\n", localname));
 
 		/*
-		**  Check directory access.
-		**  Selective access means only those directories containing
-		**  a marker file can be browsed.
-		*/
+		 * Check directory access.  Selective access means only those
+		 * directories containing a marker file can be browsed.
+		 */
 		if (HTDirAccess == HT_DIR_FORBID) {
 		    FREE(localname);
 		    FREE(nodename);
@@ -2599,7 +2614,7 @@ int HTLoadFile (
 		}
 
 		if (HTDirAccess == HT_DIR_SELECTIVE) {
-		    char * enable_file_name = NULL;
+		    char *enable_file_name = NULL;
 
 		    HTSprintf0(&enable_file_name, "%s/%s", localname, HT_DIR_ENABLE_FILE);
 		    if (stat(enable_file_name, &file_info) != 0) {
@@ -2619,18 +2634,18 @@ int HTLoadFile (
 		}
 
 		/*
-		**  Directory access is allowed and possible.
-		*/
+		 * Directory access is allowed and possible.
+		 */
 
 		status = print_local_dir(dp, localname,
-					anchor, format_out, sink);
+					 anchor, format_out, sink);
 		closedir(dp);
 		FREE(localname);
 		FREE(nodename);
 		return status;	/* document loaded, maybe partial */
 
-	    } /* end if localname is a directory */
-
+	    }
+	    /* end if localname is a directory */
 	    if (S_ISREG(dir_info.st_mode)) {
 #ifdef INT_MAX
 		if (dir_info.st_size <= INT_MAX)
@@ -2638,33 +2653,34 @@ int HTLoadFile (
 		    anchor->content_length = dir_info.st_size;
 	    }
 
-	} /* end if file stat worked */
+	}			/* end if file stat worked */
 
 /* End of directory reading section
 */
 #endif /* HAVE_READDIR */
 	{
 	    int bin = HTCompressFileType(localname, ".", &dot) != cftNone;
-	    FILE * fp = fopen(localname, (bin ? BIN_R : "r"));
+	    FILE *fp = fopen(localname, (bin ? BIN_R : "r"));
 
 	    CTRACE((tfp, "HTLoadFile: Opening `%s' gives %p\n",
-				 localname, (void*)fp));
+		    localname, (void *) fp));
 	    if (fp) {		/* Good! */
 		if (HTEditable(localname)) {
-		    HTAtom * put = HTAtom_for("PUT");
-		    HTList * methods = HTAnchor_methods(anchor);
+		    HTAtom *put = HTAtom_for("PUT");
+		    HTList *methods = HTAnchor_methods(anchor);
+
 		    if (HTList_indexOf(methods, put) == (-1)) {
 			HTList_addObject(methods, put);
 		    }
 		}
 		/*
-		**  Fake a Content-Encoding for compressed files. - FM
-		*/
+		 * Fake a Content-Encoding for compressed files.  - FM
+		 */
 		if (!IsUnityEnc(myEncoding)) {
 		    /*
-		     *	We already know from the call to HTFileFormat above
-		     *	that this is a compressed file, no need to look at
-		     *	the filename again. - kw
+		     * We already know from the call to HTFileFormat above that
+		     * this is a compressed file, no need to look at the
+		     * filename again.  - kw
 		     */
 #ifdef USE_ZLIB
 		    if (strcmp(format_out->name, "www/download") != 0 &&
@@ -2674,22 +2690,22 @@ int HTLoadFile (
 			gzfp = gzopen(localname, BIN_R);
 
 			CTRACE((tfp, "HTLoadFile: gzopen of `%s' gives %p\n",
-				    localname, (void*)gzfp));
+				localname, (void *) gzfp));
 			internal_decompress = cftGzip;
 		    } else
-#endif	/* USE_ZLIB */
+#endif /* USE_ZLIB */
 #ifdef USE_BZLIB
-		    if (strcmp(format_out->name, "www/download") != 0 &&
-			(!strcmp(HTAtom_name(myEncoding), "bzip2") ||
-			 !strcmp(HTAtom_name(myEncoding), "x-bzip2"))) {
+			if (strcmp(format_out->name, "www/download") != 0 &&
+			    (!strcmp(HTAtom_name(myEncoding), "bzip2") ||
+			     !strcmp(HTAtom_name(myEncoding), "x-bzip2"))) {
 			fclose(fp);
 			bzfp = BZ2_bzopen(localname, BIN_R);
 
 			CTRACE((tfp, "HTLoadFile: bzopen of `%s' gives %p\n",
-				    localname, (void*)bzfp));
+				localname, (void *) bzfp));
 			internal_decompress = cftBzip2;
 		    } else
-#endif	/* USE_BZLIB */
+#endif /* USE_BZLIB */
 		    {
 			StrAllocCopy(anchor->content_type, format->name);
 			StrAllocCopy(anchor->content_encoding, HTAtom_name(myEncoding));
@@ -2722,13 +2738,14 @@ int HTLoadFile (
 			    fclose(fp);
 			    gzfp = gzopen(localname, BIN_R);
 
-			    CTRACE((tfp, "HTLoadFile: gzopen of `%s' gives %p\n",
-					localname, (void*)gzfp));
+			    CTRACE((tfp,
+				    "HTLoadFile: gzopen of `%s' gives %p\n",
+				    localname, (void *) gzfp));
 			    internal_decompress = cftGzip;
 			}
-#else  /* USE_ZLIB */
+#else /* USE_ZLIB */
 			format = HTAtom_for("www/compressed");
-#endif	/* USE_ZLIB */
+#endif /* USE_ZLIB */
 			break;
 		    case cftBzip2:
 			StrAllocCopy(anchor->content_encoding, "x-bzip2");
@@ -2737,13 +2754,14 @@ int HTLoadFile (
 			    fclose(fp);
 			    bzfp = BZ2_bzopen(localname, BIN_R);
 
-			    CTRACE((tfp, "HTLoadFile: bzopen of `%s' gives %p\n",
-					localname, (void*)bzfp));
+			    CTRACE((tfp,
+				    "HTLoadFile: bzopen of `%s' gives %p\n",
+				    localname, (void *) bzfp));
 			    internal_decompress = cftBzip2;
 			}
-#else  /* USE_BZLIB */
+#else /* USE_BZLIB */
 			format = HTAtom_for("www/compressed");
-#endif	/* USE_BZLIB */
+#endif /* USE_BZLIB */
 			break;
 		    case cftNone:
 			break;
@@ -2773,13 +2791,15 @@ int HTLoadFile (
 					     -(HT_ERROR),
 					     FAILED_OPEN_COMPRESSED_FILE);
 		    } else {
-			char * sugfname = NULL;
+			char *sugfname = NULL;
+
 			if (anchor->SugFname) {
 			    StrAllocCopy(sugfname, anchor->SugFname);
 			} else {
-			    char * anchor_path = HTParse(anchor->address, "",
-							 PARSE_PATH + PARSE_PUNCTUATION);
-			    char * lastslash;
+			    char *anchor_path = HTParse(anchor->address, "",
+							PARSE_PATH + PARSE_PUNCTUATION);
+			    char *lastslash;
+
 			    HTUnEscape(anchor_path);
 			    lastslash = strrchr(anchor_path, '/');
 			    if (lastslash)
@@ -2813,21 +2833,21 @@ int HTLoadFile (
 		    fclose(fp);
 		}
 		return status;
-	    }  /* If successful open */
+	    }			/* If successful open */
 	    FREE(localname);
-	}  /* scope of fp */
-    }  /* local unix file system */
+	}			/* scope of fp */
+    }				/* local unix file system */
 #endif /* !NO_UNIX_IO */
 #endif /* VMS */
 
 #ifndef DECNET
     /*
-    **	Now, as transparently mounted access has failed, we try FTP.
-    */
+     * Now, as transparently mounted access has failed, we try FTP.
+     */
     {
 	/*
-	**  Deal with case-sensitivity differences on VMS versus Unix.
-	*/
+	 * Deal with case-sensitivity differences on VMS versus Unix.
+	 */
 #ifdef VMS
 	if (strcasecomp(nodename, HTHostName()) != 0)
 #else
@@ -2851,8 +2871,8 @@ int HTLoadFile (
 #endif /* !DECNET */
 
     /*
-    **	All attempts have failed.
-    */
+     * All attempts have failed.
+     */
     {
 	CTRACE((tfp, "Can't open `%s', errno=%d\n", addr, SOCKET_ERRNO));
 
@@ -2865,10 +2885,10 @@ static const char *program_paths[pp_Last];
 /*
  * Given a program number, return its path
  */
-const char * HTGetProgramPath (
-	ProgramPaths	code)
+const char *HTGetProgramPath(ProgramPaths code)
 {
     const char *result = NULL;
+
     if (code > ppUnknown && code < pp_Last)
 	result = program_paths[code];
     return result;
@@ -2878,9 +2898,7 @@ const char * HTGetProgramPath (
  * Store a program's path.  The caller must allocate the string used for 'path',
  * since HTInitProgramPaths() may free it.
  */
-void HTSetProgramPath (
-	ProgramPaths	code,
-	const char *	path)
+void HTSetProgramPath(ProgramPaths code, const char *path)
 {
     if (code > ppUnknown && code < pp_Last) {
 	program_paths[code] = isEmpty(path) ? 0 : path;
@@ -2890,7 +2908,7 @@ void HTSetProgramPath (
 /*
  * Reset the list of known program paths to the ones that are compiled-in
  */
-void HTInitProgramPaths (void)
+void HTInitProgramPaths(void)
 {
     int code;
     const char *path;
@@ -3009,21 +3027,23 @@ void HTInitProgramPaths (void)
 	}
 	test = HTGetProgramPath(code);
 	if (test != NULL && test != path) {
-	    free((char *)test);
+	    free((char *) test);
 	}
 	HTSetProgramPath(code, path);
     }
 }
 
 /*
-**	Protocol descriptors
-*/
+ *	Protocol descriptors
+ */
 #ifdef GLOBALDEF_IS_MACRO
 #define _HTFILE_C_1_INIT { "ftp", HTLoadFile, 0 }
-GLOBALDEF (HTProtocol,HTFTP,_HTFILE_C_1_INIT);
+GLOBALDEF(HTProtocol, HTFTP, _HTFILE_C_1_INIT);
 #define _HTFILE_C_2_INIT { "file", HTLoadFile, HTFileSaveStream }
-GLOBALDEF (HTProtocol,HTFile,_HTFILE_C_2_INIT);
+GLOBALDEF(HTProtocol, HTFile, _HTFILE_C_2_INIT);
 #else
-GLOBALDEF HTProtocol HTFTP  = { "ftp", HTLoadFile, 0 };
-GLOBALDEF HTProtocol HTFile = { "file", HTLoadFile, HTFileSaveStream };
+GLOBALDEF HTProtocol HTFTP =
+{"ftp", HTLoadFile, 0};
+GLOBALDEF HTProtocol HTFile =
+{"file", HTLoadFile, HTFileSaveStream};
 #endif /* GLOBALDEF_IS_MACRO */
diff --git a/WWW/Library/Implementation/HTFile.h b/WWW/Library/Implementation/HTFile.h
index c44ba1e2..8c522b64 100644
--- a/WWW/Library/Implementation/HTFile.h
+++ b/WWW/Library/Implementation/HTFile.h
@@ -1,231 +1,221 @@
 /*							File access in libwww
-**				FILE ACCESS
-**
-**  These are routines for local file access used by WWW browsers and servers.
-**  Implemented by HTFile.c.
-**
-**  If the file is not a local file, then we pass it on to HTFTP in case it
-**  can be reached by FTP.
-*/
+ *				FILE ACCESS
+ *
+ *  These are routines for local file access used by WWW browsers and servers.
+ *  Implemented by HTFile.c.
+ *
+ *  If the file is not a local file, then we pass it on to HTFTP in case it
+ *  can be reached by FTP.
+ */
 #ifndef HTFILE_H
 #define HTFILE_H
 
 #include <HTFormat.h>
 #include <HTAccess.h>
 #ifndef HTML_H
-#include <HTML.h>               /* SCW */
+#include <HTML.h>		/* SCW */
 #endif /* HTML_H */
 
 /*
-**  Controlling globals
-**
-**  These flags control how directories and files are represented as
-**  hypertext, and are typically set by the application from command
-**  line options, etc.
-*/
-extern int HTDirAccess;         /* Directory access level */
-
-#define HT_DIR_FORBID           0       /* Altogether forbidden */
-#define HT_DIR_SELECTIVE        1       /* If HT_DIR_ENABLE_FILE exists */
-#define HT_DIR_OK               2       /* Any accesible directory */
-
-#define HT_DIR_ENABLE_FILE      ".www_browsable" /* If exists, can browse */
-
-extern int HTDirReadme;         /* Include readme files in listing? */
-                                        /* Values: */
-#define HT_DIR_README_NONE      0       /* No */
-#define HT_DIR_README_TOP       1       /* Yes, first */
-#define HT_DIR_README_BOTTOM    2       /* Yes, at the end */
+ *  Controlling globals
+ *
+ *  These flags control how directories and files are represented as
+ *  hypertext, and are typically set by the application from command
+ *  line options, etc.
+ */
+extern int HTDirAccess;		/* Directory access level */
+
+#define HT_DIR_FORBID           0	/* Altogether forbidden */
+#define HT_DIR_SELECTIVE        1	/* If HT_DIR_ENABLE_FILE exists */
+#define HT_DIR_OK               2	/* Any accesible directory */
+
+#define HT_DIR_ENABLE_FILE      ".www_browsable"	/* If exists, can browse */
+
+extern int HTDirReadme;		/* Include readme files in listing? */
+
+					/* Values: */
+#define HT_DIR_README_NONE      0	/* No */
+#define HT_DIR_README_TOP       1	/* Yes, first */
+#define HT_DIR_README_BOTTOM    2	/* Yes, at the end */
 
 #define HT_DIR_README_FILE              "README"
 
 /*
-**  Convert filenames between local and WWW formats
-*/
-extern char * HTURLPath_toFile (const char * name, BOOL expand_all, BOOL is_remote);
-extern char * HTnameOfFile_WWW (const char * name, BOOL WWW_prefix, BOOL expand_all);
+ *  Convert filenames between local and WWW formats
+ */
+extern char *HTURLPath_toFile(const char *name, BOOL expand_all, BOOL is_remote);
+extern char *HTnameOfFile_WWW(const char *name, BOOL WWW_prefix, BOOL expand_all);
+
 #define HTLocalName(name)      HTnameOfFile_WWW(name,TRUE,TRUE)
 #define HTfullURL_toFile(name) HTnameOfFile_WWW(name,FALSE,TRUE)
 #define HTpartURL_toFile(name) HTnameOfFile_WWW(name,FALSE,FALSE)
 
 /*
-**  Make a WWW name from a full local path name
-*/
-extern char * WWW_nameOfFile (const char * name);
+ *  Make a WWW name from a full local path name
+ */
+extern char *WWW_nameOfFile(const char *name);
 
 /*
-**  Generate the name of a cache file
-*/
-extern char * HTCacheFileName (const char * name);
+ *  Generate the name of a cache file
+ */
+extern char *HTCacheFileName(const char *name);
 
 /*
-**  Output directory titles
-**
-** This is (like the next one) used by HTFTP. It is common code to generate
-** the title and heading 1 and the parent directory link for any anchor.
-**
-** changed to return TRUE if parent directory link was generated,
-** FALSE otherwise - KW
-*/
-extern BOOL HTDirTitles (
-        HTStructured *  target,
-        HTParentAnchor* anchor,
-	BOOL		tildeIsTop);
+ *  Output directory titles
+ *
+ * This is (like the next one) used by HTFTP. It is common code to generate
+ * the title and heading 1 and the parent directory link for any anchor.
+ *
+ * changed to return TRUE if parent directory link was generated,
+ * FALSE otherwise - KW
+ */
+extern BOOL HTDirTitles(HTStructured * target, HTParentAnchor *anchor,
+			BOOL tildeIsTop);
 
 /*
-**	Check existence.
-*/
-extern int HTStat (
-	const char *	filename,
-	struct stat *	data);
+ *	Check existence.
+ */
+extern int HTStat(const char *filename,
+		  struct stat *data);
 
 /*	Load a document.
-**	----------------
-*/
-extern int HTLoadFile (
-	const char *		addr,
-	HTParentAnchor *	anchor,
-	HTFormat		format_out,
-	HTStream *		sink);
+ *	----------------
+ */
+extern int HTLoadFile(const char *addr,
+		      HTParentAnchor *anchor,
+		      HTFormat format_out,
+		      HTStream *sink);
 
 /*
-**  Output a directory entry
-**
-** This is used by HTFTP.c for example -- it is a common routine for
-**  generating a linked directory entry.
-*/
-extern void HTDirEntry (
-        HTStructured *  target,         /* in which to put the linked text */
-        const char *    tail,           /* last part of directory name */
-        const char *    entry);        /* name of this entry */
+ *  Output a directory entry
+ *
+ * This is used by HTFTP.c for example -- it is a common routine for
+ *  generating a linked directory entry.
+ */
+extern void HTDirEntry(HTStructured * target, /* in which to put the linked text */ const char *tail,	/* last part of directory name */
+		       const char *entry);	/* name of this entry */
 
 /*
-**  HTSetSuffix: Define the representation for a file suffix
-**
-**  This defines a mapping between local file suffixes and file content
-**  types and encodings.
-**
-**  ON ENTRY,
-**
-**  suffix		includes the "." if that is important (normally, yes!)
-**
-**  representation	is MIME-style content-type
-**
-**  encoding		is MIME-style content-transfer-encoding
-**			(8bit, 7bit, etc) or HTTP-style content-encoding
-**			(gzip, compress etc.)
-**
-**  quality		an a priori judgement of the quality of such files
-**			(0.0..1.0)
-**
-**  HTSetSuffix5 has one more parameter for a short description of the type
-**  which is otherwise derived from the representation:
-**
-**  desc		is a short textual description, or NULL
-**
-**  Examples:   HTSetSuffix(".ps", "application/postscript", "8bit", 1.0);
-**  Examples:   HTSetSuffix(".psz", "application/postscript", "gzip", 1.0);
-**  A MIME type could also indicate a non-trivial encoding on its own
-**  ("application/x-compressed-tar"), but in that case don't use enconding
-**  to also indicate it but use "binary" etc.
-*/
-extern void HTSetSuffix5 (
-        const char *    suffix,
-        const char *    representation,
-        const char *    encoding,
-        const char *    desc,
-        double          quality);
+ *  HTSetSuffix: Define the representation for a file suffix
+ *
+ *  This defines a mapping between local file suffixes and file content
+ *  types and encodings.
+ *
+ *  ON ENTRY,
+ *
+ *  suffix		includes the "." if that is important (normally, yes!)
+ *
+ *  representation	is MIME-style content-type
+ *
+ *  encoding		is MIME-style content-transfer-encoding
+ *			(8bit, 7bit, etc) or HTTP-style content-encoding
+ *			(gzip, compress etc.)
+ *
+ *  quality		an a priori judgement of the quality of such files
+ *			(0.0..1.0)
+ *
+ *  HTSetSuffix5 has one more parameter for a short description of the type
+ *  which is otherwise derived from the representation:
+ *
+ *  desc		is a short textual description, or NULL
+ *
+ *  Examples:   HTSetSuffix(".ps", "application/postscript", "8bit", 1.0);
+ *  Examples:   HTSetSuffix(".psz", "application/postscript", "gzip", 1.0);
+ *  A MIME type could also indicate a non-trivial encoding on its own
+ *  ("application/x-compressed-tar"), but in that case don't use enconding
+ *  to also indicate it but use "binary" etc.
+ */
+extern void HTSetSuffix5(const char *suffix,
+			 const char *representation,
+			 const char *encoding,
+			 const char *desc,
+			 double quality);
 
 #define HTSetSuffix(suff,rep,enc,q) HTSetSuffix5(suff, rep, enc, NULL, q)
 
 /*
-**  HTFileFormat: Get Representation and Encoding from file name.
-**
-**  ON EXIT,
-**
-**  return		The represntation it imagines the file is in.
-**
-**  *pEncoding		The encoding (binary, 7bit, etc). See HTSetSuffix.
-*/
-extern HTFormat HTFileFormat (
-	const char *		filename,
-	HTAtom **		pEncoding,
-	const char **		pDesc);
+ *  HTFileFormat: Get Representation and Encoding from file name.
+ *
+ *  ON EXIT,
+ *
+ *  return		The represntation it imagines the file is in.
+ *
+ *  *pEncoding		The encoding (binary, 7bit, etc). See HTSetSuffix.
+ */
+extern HTFormat HTFileFormat(const char *filename,
+			     HTAtom **pEncoding,
+			     const char **pDesc);
 
 /*
-**  HTCharsetFormat: Revise the file format in relation to the Lynx charset.
-**
-**  This checks the format associated with an anchor for
-**  for an extended MIME Content-Type, and if a charset is
-**  indicated, sets Lynx up for proper handling in relation
-**  to the currently selected character set. - FM
-*/
-extern HTFormat HTCharsetFormat (
-	HTFormat		format,
-	HTParentAnchor *	anchor,
-	int			default_LYhndl);
+ *  HTCharsetFormat: Revise the file format in relation to the Lynx charset.
+ *
+ *  This checks the format associated with an anchor for
+ *  for an extended MIME Content-Type, and if a charset is
+ *  indicated, sets Lynx up for proper handling in relation
+ *  to the currently selected character set. - FM
+ */
+extern HTFormat HTCharsetFormat(HTFormat format,
+				HTParentAnchor *anchor,
+				int default_LYhndl);
 
 /*	Get various pieces of meta info from file name.
-**	-----------------------------------------------
-**
-**  LYGetFileInfo fills in information that can be determined without
-**  an actual (new) access to the filesystem, based on current suffix
-**  and character set configuration.  If the file has been loaded and
-**  parsed before  (with the same URL generated here!) and the anchor
-**  is still around, some results may be influenced by that (in
-**  particular, charset info from a META tag - this is not actually
-**  tested!).
-**  The caller should not keep pointers to the returned objects around
-**  for too long, the valid lifetimes vary. In particular, the returned
-**  charset string should be copied if necessary.  If return of the
-**  file_anchor is requested, that one can be used to retrieve
-**  additional bits of info that are stored in the anchor object and
-**  are not covered here; as usual, don't keep pointers to the
-**  file_anchor longer than necessary since the object may disappear
-**  through HTuncache_current_document or at the next document load.
-**  - kw
-*/
-extern void LYGetFileInfo (
-	const char *		filename,
-	HTParentAnchor **	pfile_anchor,
-	HTFormat *		pformat,
-	HTAtom **		pencoding,
-	const char**		pdesc,
-	const char**		pcharset,
-	int *			pfile_cs);
+ *	-----------------------------------------------
+ *
+ *  LYGetFileInfo fills in information that can be determined without
+ *  an actual (new) access to the filesystem, based on current suffix
+ *  and character set configuration.  If the file has been loaded and
+ *  parsed before  (with the same URL generated here!) and the anchor
+ *  is still around, some results may be influenced by that (in
+ *  particular, charset info from a META tag - this is not actually
+ *  tested!).
+ *  The caller should not keep pointers to the returned objects around
+ *  for too long, the valid lifetimes vary. In particular, the returned
+ *  charset string should be copied if necessary.  If return of the
+ *  file_anchor is requested, that one can be used to retrieve
+ *  additional bits of info that are stored in the anchor object and
+ *  are not covered here; as usual, don't keep pointers to the
+ *  file_anchor longer than necessary since the object may disappear
+ *  through HTuncache_current_document or at the next document load.
+ *  - kw
+ */
+extern void LYGetFileInfo(const char *filename,
+			  HTParentAnchor **pfile_anchor,
+			  HTFormat *pformat,
+			  HTAtom **pencoding,
+			  const char **pdesc,
+			  const char **pcharset,
+			  int *pfile_cs);
 
 /*
-**  Determine file value from file name.
-*/
-extern float HTFileValue (
-	const char *	filename);
+ *  Determine file value from file name.
+ */
+extern float HTFileValue(const char *filename);
 
 /*
-**  Determine compression type from file name, by looking at its suffix.
-*/
+ *  Determine compression type from file name, by looking at its suffix.
+ */
 typedef enum {
     cftNone
-    , cftCompress
-    , cftGzip
-    , cftBzip2
+    ,cftCompress
+    ,cftGzip
+    ,cftBzip2
 } CompressFileType;
 
-extern CompressFileType HTCompressFileType (
-	char *			filename,
-	char *			dots,
-	char **			suffix);
+extern CompressFileType HTCompressFileType(char *filename,
+					   char *dots,
+					   char **suffix);
 
 /*
-**  Determine write access to a file.
-**
-**  ON EXIT,
-**
-**  return value	YES if file can be accessed and can be written to.
-**
-**  BUGS
-**
-**   Isn't there a quicker way?
-*/
+ *  Determine write access to a file.
+ *
+ *  ON EXIT,
+ *
+ *  return value	YES if file can be accessed and can be written to.
+ *
+ *  BUGS
+ *
+ *   Isn't there a quicker way?
+ */
 
 #if defined(HAVE_CONFIG_H)
 
@@ -250,30 +240,28 @@ extern CompressFileType HTCompressFileType (
 
 #endif /* HAVE_CONFIG_H */
 
-extern BOOL HTEditable (const char * filename);
+extern BOOL HTEditable(const char *filename);
 
 /*	Make a save stream.
-**	-------------------
-*/
-extern HTStream * HTFileSaveStream (
-	HTParentAnchor *	anchor);
+ *	-------------------
+ */
+extern HTStream *HTFileSaveStream(HTParentAnchor *anchor);
 
 /*
-** Determine a suitable suffix, given the representation.
-**
-**  ON ENTRY,
-**
-**  rep			is the atomized MIME style representation
-**  enc			is an encoding (8bit, binary, gzip, compress,..)
-**
-**  ON EXIT,
-**
-**  returns		a pointer to a suitable suffix string if one has
-**			been found, else NULL.
-*/
-extern const char * HTFileSuffix (
-                HTAtom* rep,
-                const char* enc);
+ * Determine a suitable suffix, given the representation.
+ *
+ *  ON ENTRY,
+ *
+ *  rep			is the atomized MIME style representation
+ *  enc			is an encoding (8bit, binary, gzip, compress,..)
+ *
+ *  ON EXIT,
+ *
+ *  returns		a pointer to a suitable suffix string if one has
+ *			been found, else NULL.
+ */
+extern const char *HTFileSuffix(HTAtom *rep,
+				const char *enc);
 
 /*
  * Enumerate external programs that lynx may assume exists.  Unlike those
@@ -309,27 +297,26 @@ typedef enum {
 /*
  * Given a program number, return its path
  */
-extern const char * HTGetProgramPath (
-		ProgramPaths code);
+extern const char *HTGetProgramPath(ProgramPaths code);
 
 /*
  * Store a program's path 
  */
-extern void HTSetProgramPath (
-		ProgramPaths code,
-		const char *path);
+extern void HTSetProgramPath(ProgramPaths code,
+			     const char *path);
 
 /*
  * Reset the list of known program paths to the ones that are compiled-in
  */
-extern void HTInitProgramPaths (void);
+extern void HTInitProgramPaths(void);
 
 /*
-**  The Protocols
-*/
+ *  The Protocols
+ */
 #ifdef GLOBALREF_IS_MACRO
-extern GLOBALREF (HTProtocol,HTFTP);
-extern GLOBALREF (HTProtocol,HTFile);
+extern GLOBALREF (HTProtocol, HTFTP);
+extern GLOBALREF (HTProtocol, HTFile);
+
 #else
 GLOBALREF HTProtocol HTFTP, HTFile;
 #endif /* GLOBALREF_IS_MACRO */
diff --git a/WWW/Library/Implementation/HTFinger.c b/WWW/Library/Implementation/HTFinger.c
index 7a9fc532..7afb64b9 100644
--- a/WWW/Library/Implementation/HTFinger.c
+++ b/WWW/Library/Implementation/HTFinger.c
@@ -1,29 +1,29 @@
 /*			FINGER ACCESS				HTFinger.c
-**			=============
-** Authors:
-**  ARB  Andrew Brooks
-**
-** History:
-**	21 Apr 94   First version (ARB, from HTNews.c by TBL)
-**	12 Mar 96   Made the URL and command buffering secure from
-**		     stack modifications, beautified the HTLoadFinger()
-**		     and response() functions, and added support for the
-**		     following URL formats for sending a "", "/w",
-**		     "username[@host]", or "/w username[@host]" command
-**		     to the server:
-**			finger://host
-**			finger://host/
-**			finger://host/%2fw
-**			finger://host/%2fw%20username[@host]
-**			finger://host/w/username[@host]
-**			finger://host/username[@host]
-**			finger://host/username[@host]/w
-**			finger://username@host
-**			finger://username@host/
-**			finger://username@host/w
-**	15 Mar 96   Added support for port 79 gtype 0 gopher URLs
-**		     relayed from HTLoadGopher. - FM
-*/
+ *			=============
+ * Authors:
+ *  ARB  Andrew Brooks
+ *
+ * History:
+ *	21 Apr 94   First version (ARB, from HTNews.c by TBL)
+ *	12 Mar 96   Made the URL and command buffering secure from
+ *		     stack modifications, beautified the HTLoadFinger()
+ *		     and response() functions, and added support for the
+ *		     following URL formats for sending a "", "/w",
+ *		     "username[@host]", or "/w username[@host]" command
+ *		     to the server:
+ *			finger://host
+ *			finger://host/
+ *			finger://host/%2fw
+ *			finger://host/%2fw%20username[@host]
+ *			finger://host/w/username[@host]
+ *			finger://host/username[@host]
+ *			finger://host/username[@host]/w
+ *			finger://username@host
+ *			finger://username@host/
+ *			finger://username@host/w
+ *	15 Mar 96   Added support for port 79 gtype 0 gopher URLs
+ *		     relayed from HTLoadGopher. - FM
+ */
 
 #include <HTUtils.h>
 
@@ -50,101 +50,97 @@
 #define FREE_TARGET (*targetClass._free)(target)
 #define NEXT_CHAR HTGetCharacter()
 
-
 /*	Module-wide variables
 */
-static int finger_fd;				/* Socket for FingerHost */
+static int finger_fd;		/* Socket for FingerHost */
 
 struct _HTStructured {
-	const HTStructuredClass * isa;		/* For gopher streams */
-	/* ... */
+    const HTStructuredClass *isa;	/* For gopher streams */
+    /* ... */
 };
 
-static HTStructured * target;			/* The output sink */
-static HTStructuredClass targetClass;		/* Copy of fn addresses */
+static HTStructured *target;	/* The output sink */
+static HTStructuredClass targetClass;	/* Copy of fn addresses */
 
 /*	Initialisation for this module
-**	------------------------------
-*/
+ *	------------------------------
+ */
 static BOOL initialized = NO;
-static BOOL initialize (void)
+static BOOL initialize(void)
 {
-  finger_fd = -1;		/* Disconnected */
-  return YES;
+    finger_fd = -1;		/* Disconnected */
+    return YES;
 }
 
-
-
 /*	Start anchor element
-**	--------------------
-*/
-static void start_anchor (const char *   href)
+ *	--------------------
+ */
+static void start_anchor(const char *href)
 {
-    BOOL		present[HTML_A_ATTRIBUTES];
-    const char*		value[HTML_A_ATTRIBUTES];
+    BOOL present[HTML_A_ATTRIBUTES];
+    const char *value[HTML_A_ATTRIBUTES];
 
     {
 	int i;
-	for(i=0; i<HTML_A_ATTRIBUTES; i++)
-	    present[i] = (BOOL) (i==HTML_A_HREF);
+
+	for (i = 0; i < HTML_A_ATTRIBUTES; i++)
+	    present[i] = (BOOL) (i == HTML_A_HREF);
     }
-    ((const char **)value)[HTML_A_HREF] = href;
-    (*targetClass.start_element)(target, HTML_A, present,
-				 (const char **)value, -1, 0);
+    ((const char **) value)[HTML_A_HREF] = href;
+    (*targetClass.start_element) (target, HTML_A, present,
+				  (const char **) value, -1, 0);
 
 }
 
 /*	Send Finger Command line to remote host & Check Response
-**	--------------------------------------------------------
-**
-** On entry,
-**	command	points to the command to be sent, including CRLF, or is null
-**		pointer if no command to be sent.
-** On exit,
-**	Negative status indicates transmission error, socket closed.
-**	Positive status is a Finger status.
-*/
-
-
-static int response (
-	char *			command,
-	char *			sitename,
-	HTParentAnchor *	anAnchor,
-	HTFormat		format_out,
-	HTStream*		sink)
+ *	--------------------------------------------------------
+ *
+ * On entry,
+ *	command	points to the command to be sent, including CRLF, or is null
+ *		pointer if no command to be sent.
+ * On exit,
+ *	Negative status indicates transmission error, socket closed.
+ *	Positive status is a Finger status.
+ */
+
+static int response(char *command,
+		    char *sitename,
+		    HTParentAnchor *anAnchor,
+		    HTFormat format_out,
+		    HTStream *sink)
 {
     int status;
     int length = strlen(command);
     int ch, i;
-    char line[BIG], *l, *cmd=NULL;
-    char *p = line, *href=NULL;
+    char line[BIG], *l, *cmd = NULL;
+    char *p = line, *href = NULL;
 
     if (length == 0)
-	return(-1);
+	return (-1);
 
     /* Set up buffering.
-    */
+     */
     HTInitInput(finger_fd);
 
     /* Send the command.
-    */
+     */
     CTRACE((tfp, "HTFinger command to be sent: %s", command));
-    status = NETWRITE(finger_fd, (char *)command, length);
+    status = NETWRITE(finger_fd, (char *) command, length);
     if (status < 0) {
 	CTRACE((tfp, "HTFinger: Unable to send command. Disconnecting.\n"));
 	NETCLOSE(finger_fd);
 	finger_fd = -1;
 	return status;
-    } /* if bad status */
-
+    }
+    /* if bad status */
     /* Make a hypertext object with an anchor list.
-    */
+     */
     target = HTML_new(anAnchor, format_out, sink);
     targetClass = *target->isa;	/* Copy routine entry points */
 
     /* Create the results report.
-    */
-    CTRACE((tfp,"HTFinger: Reading finger information\n"));
+     */
+    CTRACE((tfp, "HTFinger: Reading finger information\n"));
     START(HTML_HTML);
     PUTC('\n');
     START(HTML_HEAD);
@@ -182,17 +178,18 @@ static int response (
     PUTC('\n');
     START(HTML_PRE);
 
-    while ((ch=NEXT_CHAR) != EOF) {
+    while ((ch = NEXT_CHAR) != EOF) {
 
 	if (interrupted_in_htgetcharacter) {
-	    CTRACE((tfp, "HTFinger: Interrupted in HTGetCharacter, apparently.\n"));
-	    _HTProgress (CONNECTION_INTERRUPTED);
+	    CTRACE((tfp,
+		    "HTFinger: Interrupted in HTGetCharacter, apparently.\n"));
+	    _HTProgress(CONNECTION_INTERRUPTED);
 	    goto end_html;
 	}
 
 	if (ch != LF) {
-	    *p = (char) ch;      /* Put character in line */
-	    if (p < &line[BIG-1]) {
+	    *p = (char) ch;	/* Put character in line */
+	    if (p < &line[BIG - 1]) {
 		p++;
 	    }
 	} else {
@@ -235,7 +232,7 @@ static int response (
     NETCLOSE(finger_fd);
     finger_fd = -1;
 
-end_html:
+  end_html:
     END(HTML_PRE);
     PUTC('\n');
     END(HTML_BODY);
@@ -243,48 +240,46 @@ end_html:
     END(HTML_HTML);
     PUTC('\n');
     FREE_TARGET;
-    return(0);
+    return (0);
 }
 
-
 /*		Load by name					HTLoadFinger
-**		============
-*/
-int HTLoadFinger (
-	const char *		arg,
-	HTParentAnchor *	anAnchor,
-	HTFormat		format_out,
-	HTStream*		stream)
+ *		============
+ */
+int HTLoadFinger(const char *arg,
+		 HTParentAnchor *anAnchor,
+		 HTFormat format_out,
+		 HTStream *stream)
 {
     char *username, *sitename, *colon;	/* Fields extracted from URL */
-    char *slash, *at_sign;		/* Fields extracted from URL */
+    char *slash, *at_sign;	/* Fields extracted from URL */
     char *command, *str, *param;	/* Buffers */
-    int port;				/* Port number from URL */
-    int status;				/* tcp return */
+    int port;			/* Port number from URL */
+    int status;			/* tcp return */
     int result = HT_LOADED;
     BOOL IsGopherURL = FALSE;
-    const char * p1 = arg;
+    const char *p1 = arg;
 
     CTRACE((tfp, "HTFinger: Looking for %s\n", (arg ? arg : "NULL")));
 
     if (!(arg && *arg)) {
 	HTAlert(COULD_NOT_LOAD_DATA);
-	return HT_NOT_LOADED;			/* Ignore if no name */
+	return HT_NOT_LOADED;	/* Ignore if no name */
     }
 
     if (!initialized)
 	initialized = initialize();
     if (!initialized) {
-	HTAlert (gettext("Could not set up finger connection."));
+	HTAlert(gettext("Could not set up finger connection."));
 	return HT_NOT_LOADED;	/* FAIL */
     }
 
     /*  Set up the host and command fields.
-    */
+     */
     if (!strncasecomp(arg, "finger://", 9)) {
-	p1 = arg + 9;  /* Skip "finger://" prefix */
+	p1 = arg + 9;		/* Skip "finger://" prefix */
     } else if (!strncasecomp(arg, "gopher://", 9)) {
-	p1 = arg + 9;  /* Skip "gopher://" prefix */
+	p1 = arg + 9;		/* Skip "gopher://" prefix */
 	IsGopherURL = TRUE;
     }
 
@@ -323,7 +318,7 @@ int HTLoadFinger (
 
     if (*sitename == '\0') {
 	HTAlert(gettext("Could not load data (no sitename in finger URL)"));
-	result = HT_NOT_LOADED;		/* Ignore if no name */
+	result = HT_NOT_LOADED;	/* Ignore if no name */
     } else if ((colon = strchr(sitename, ':')) != NULL) {
 	*colon++ = '\0';
 	port = atoi(colon);
@@ -335,12 +330,12 @@ int HTLoadFinger (
 
     if (result == HT_LOADED) {
 	/* Load the string for making a connection/
-	*/
+	 */
 	str = 0;
 	HTSprintf0(&str, "lose://%s/", sitename);
 
 	/* Load the command for the finger server.
-	*/
+	 */
 	command = 0;
 	if (at_sign && slash) {
 	    if (*slash == 'w' || *slash == 'W') {
@@ -351,20 +346,20 @@ int HTLoadFinger (
 	} else if (at_sign) {
 	    HTSprintf0(&command, "%s%c%c", username, CR, LF);
 	} else if (*username == '/') {
-	    if ((slash = strchr((username+1), '/')) != NULL) {
+	    if ((slash = strchr((username + 1), '/')) != NULL) {
 		*slash = ' ';
 	    }
 	    HTSprintf0(&command, "%s%c%c", username, CR, LF);
 	} else if ((*username == 'w' || *username == 'W') &&
-		   *(username+1) == '/') {
-	    if (*username+2 != '\0') {
-		*(username+1) = ' ';
+		   *(username + 1) == '/') {
+	    if (*username + 2 != '\0') {
+		*(username + 1) = ' ';
 	    } else {
-		*(username+1) = '\0';
+		*(username + 1) = '\0';
 	    }
 	    HTSprintf0(&command, "/%s%c%c", username, CR, LF);
 	} else if ((*username == 'w' || *username == 'W') &&
-		   *(username+1) == '\0') {
+		   *(username + 1) == '\0') {
 	    HTSprintf0(&command, "/%s%c%c", username, CR, LF);
 	} else if ((slash = strchr(username, '/')) != NULL) {
 	    *slash++ = '\0';
@@ -378,16 +373,17 @@ int HTLoadFinger (
 	}
 
 	/* Now, let's get a stream setup up from the FingerHost:
-	** CONNECTING to finger host
-	*/
+	 * CONNECTING to finger host
+	 */
 	CTRACE((tfp, "HTFinger: doing HTDoConnect on '%s'\n", str));
 	status = HTDoConnect(str, "finger", FINGER_PORT, &finger_fd);
 	CTRACE((tfp, "HTFinger: Done DoConnect; status %d\n", status));
 
 	if (status == HT_INTERRUPTED) {
 	    /* Interrupt cleanly */
-	    CTRACE((tfp, "HTFinger: Interrupted on connect; recovering cleanly.\n"));
-	    HTProgress (CONNECTION_INTERRUPTED);
+	    CTRACE((tfp,
+		    "HTFinger: Interrupted on connect; recovering cleanly.\n"));
+	    HTProgress(CONNECTION_INTERRUPTED);
 	    result = HT_NOT_LOADED;
 	} else if (status < 0) {
 	    NETCLOSE(finger_fd);
@@ -399,7 +395,7 @@ int HTLoadFinger (
 	    CTRACE((tfp, "HTFinger: Connected to finger host '%s'.\n", str));
 
 	    /* Send the command, and process response if successful.
-	    */
+	     */
 	    if (response(command, sitename, anAnchor, format_out, stream) != 0) {
 		HTAlert(gettext("No response from finger server."));
 		result = HT_NOT_LOADED;
@@ -414,9 +410,10 @@ int HTLoadFinger (
 
 #ifdef GLOBALDEF_IS_MACRO
 #define _HTFINGER_C_1_INIT { "finger", HTLoadFinger, NULL }
-GLOBALDEF (HTProtocol, HTFinger, _HTFINGER_C_1_INIT);
+GLOBALDEF(HTProtocol, HTFinger, _HTFINGER_C_1_INIT);
 #else
-GLOBALDEF HTProtocol HTFinger = { "finger", HTLoadFinger, NULL };
+GLOBALDEF HTProtocol HTFinger =
+{"finger", HTLoadFinger, NULL};
 #endif /* GLOBALDEF_IS_MACRO */
 
 #endif /* not DISABLE_FINGER */
diff --git a/WWW/Library/Implementation/HTFinger.h b/WWW/Library/Implementation/HTFinger.h
index 976afa25..bda272ad 100644
--- a/WWW/Library/Implementation/HTFinger.h
+++ b/WWW/Library/Implementation/HTFinger.h
@@ -1,7 +1,7 @@
 /* Finger protocol module for the WWW library */
 /* History:
-**      21 Apr 94       Andrew Brooks
-*/
+ *      21 Apr 94       Andrew Brooks
+ */
 
 #ifndef HTFINGER_H
 #define HTFINGER_H
@@ -11,14 +11,14 @@
 
 #ifdef GLOBALREF_IS_MACRO
 extern GLOBALREF (HTProtocol, HTFinger);
+
 #else
 GLOBALREF HTProtocol HTFinger;
 #endif /* GLOBALREF_IS_MACRO */
 
-extern int HTLoadFinger (
-	const char *		arg,
-	HTParentAnchor *	anAnchor,
-	HTFormat		format_out,
-	HTStream *		stream);
+extern int HTLoadFinger(const char *arg,
+			HTParentAnchor *anAnchor,
+			HTFormat format_out,
+			HTStream *stream);
 
 #endif /* HTFINGER_H */
diff --git a/WWW/Library/Implementation/HTFormat.c b/WWW/Library/Implementation/HTFormat.c
index 0f0ea99b..7e7c4e11 100644
--- a/WWW/Library/Implementation/HTFormat.c
+++ b/WWW/Library/Implementation/HTFormat.c
@@ -1,14 +1,14 @@
 /*		Manage different file formats			HTFormat.c
-**		=============================
-**
-** Bugs:
-**	Not reentrant.
-**
-**	Assumes the incoming stream is ASCII, rather than a local file
-**	format, and so ALWAYS converts from ASCII on non-ASCII machines.
-**	Therefore, non-ASCII machines can't read local files.
-**
-*/
+ *		=============================
+ *
+ * Bugs:
+ *	Not reentrant.
+ *
+ *	Assumes the incoming stream is ASCII, rather than a local file
+ *	format, and so ALWAYS converts from ASCII on non-ASCII machines.
+ *	Therefore, non-ASCII machines can't read local files.
+ *
+ */
 
 #include <HTUtils.h>
 
@@ -18,7 +18,7 @@
 
 float HTMaxSecs = 1e10;		/* No effective limit */
 float HTMaxLength = 1e10;	/* No effective limit */
-long int HTMaxBytes  = 0;	/* No effective limit */
+long int HTMaxBytes = 0;	/* No effective limit */
 
 #ifdef UNIX
 #ifdef NeXT
@@ -58,49 +58,49 @@ BOOL HTOutputSource = NO;	/* Flag: shortcut parser to stdout */
 
 #ifdef ORIGINAL
 struct _HTStream {
-      const HTStreamClass*	isa;
-      /* ... */
+    const HTStreamClass *isa;
+    /* ... */
 };
 #endif /* ORIGINAL */
 
 /* this version used by the NetToText stream */
 struct _HTStream {
-	const HTStreamClass *	isa;
-	BOOL			had_cr;
-	HTStream *		sink;
+    const HTStreamClass *isa;
+    BOOL had_cr;
+    HTStream *sink;
 };
 
 /*	Presentation methods
-**	--------------------
-*/
-HTList * HTPresentations = NULL;
-HTPresentation * default_presentation = NULL;
+ *	--------------------
+ */
+HTList *HTPresentations = NULL;
+HTPresentation *default_presentation = NULL;
 
 /*
  *	To free off the presentation list.
  */
 #ifdef LY_FIND_LEAKS
-static void HTFreePresentations (void);
+static void HTFreePresentations(void);
 #endif
 
 /*	Define a presentation system command for a content-type
-**	-------------------------------------------------------
-*/
-void HTSetPresentation (
-	const char *	representation,
-	const char *	command,
-	double		quality,
-	double		secs,
-	double		secs_per_byte,
-	long int	maxbytes)
+ *	-------------------------------------------------------
+ */
+void HTSetPresentation(const char *representation,
+		       const char *command,
+		       double quality,
+		       double secs,
+		       double secs_per_byte,
+		       long int maxbytes)
 {
-    HTPresentation * pres = typecalloc(HTPresentation);
+    HTPresentation *pres = typecalloc(HTPresentation);
+
     if (pres == NULL)
 	outofmem(__FILE__, "HTSetPresentation");
 
     pres->rep = HTAtom_for(representation);
-    pres->rep_out = WWW_PRESENT;		/* Fixed for now ... :-) */
-    pres->converter = HTSaveAndExecute;		/* Fixed for now ...	 */
+    pres->rep_out = WWW_PRESENT;	/* Fixed for now ... :-) */
+    pres->converter = HTSaveAndExecute;		/* Fixed for now ...     */
     pres->quality = (float) quality;
     pres->secs = (float) secs;
     pres->secs_per_byte = (float) secs_per_byte;
@@ -109,17 +109,17 @@ void HTSetPresentation (
     StrAllocCopy(pres->command, command);
 
     /*
-     *	Memory leak fixed.
-     *	05-28-94 Lynx 2-3-1 Garrett Arch Blythe
+     * Memory leak fixed.
+     * 05-28-94 Lynx 2-3-1 Garrett Arch Blythe
      */
-    if (!HTPresentations)	{
+    if (!HTPresentations) {
 	HTPresentations = HTList_new();
 #ifdef LY_FIND_LEAKS
 	atexit(HTFreePresentations);
 #endif
     }
 
-    if (strcmp(representation, "*")==0) {
+    if (strcmp(representation, "*") == 0) {
 	FREE(default_presentation);
 	default_presentation = pres;
     } else {
@@ -128,25 +128,25 @@ void HTSetPresentation (
 }
 
 /*	Define a built-in function for a content-type
-**	---------------------------------------------
-*/
-void HTSetConversion (
-	const char *	representation_in,
-	const char *	representation_out,
-	HTConverter*	converter,
-	float		quality,
-	float		secs,
-	float		secs_per_byte,
-	long int	maxbytes)
+ *	---------------------------------------------
+ */
+void HTSetConversion(const char *representation_in,
+		     const char *representation_out,
+		     HTConverter *converter,
+		     float quality,
+		     float secs,
+		     float secs_per_byte,
+		     long int maxbytes)
 {
-    HTPresentation * pres = typecalloc(HTPresentation);
+    HTPresentation *pres = typecalloc(HTPresentation);
+
     if (pres == NULL)
 	outofmem(__FILE__, "HTSetConversion");
 
     pres->rep = HTAtom_for(representation_in);
     pres->rep_out = HTAtom_for(representation_out);
     pres->converter = converter;
-    pres->command = NULL;		/* Fixed */
+    pres->command = NULL;	/* Fixed */
     pres->quality = quality;
     pres->secs = secs;
     pres->secs_per_byte = secs_per_byte;
@@ -154,10 +154,10 @@ void HTSetConversion (
     pres->command = NULL;
 
     /*
-     *	Memory Leak fixed.
-     *	05-28-94 Lynx 2-3-1 Garrett Arch Blythe
+     * Memory Leak fixed.
+     * 05-28-94 Lynx 2-3-1 Garrett Arch Blythe
      */
-    if (!HTPresentations)	{
+    if (!HTPresentations) {
 	HTPresentations = HTList_new();
 #ifdef LY_FIND_LEAKS
 	atexit(HTFreePresentations);
@@ -169,33 +169,32 @@ void HTSetConversion (
 
 #ifdef LY_FIND_LEAKS
 /*
-**	Purpose:	Free the presentation list.
-**	Arguments:	void
-**	Return Value:	void
-**	Remarks/Portability/Dependencies/Restrictions:
-**		Made to clean up Lynx's bad leakage.
-**	Revision History:
-**		05-28-94	created Lynx 2-3-1 Garrett Arch Blythe
-*/
-static void HTFreePresentations (void)
+ *	Purpose:	Free the presentation list.
+ *	Arguments:	void
+ *	Return Value:	void
+ *	Remarks/Portability/Dependencies/Restrictions:
+ *		Made to clean up Lynx's bad leakage.
+ *	Revision History:
+ *		05-28-94	created Lynx 2-3-1 Garrett Arch Blythe
+ */
+static void HTFreePresentations(void)
 {
-    HTPresentation * pres = NULL;
+    HTPresentation *pres = NULL;
 
     /*
-     *	Loop through the list.
+     * Loop through the list.
      */
     while (!HTList_isEmpty(HTPresentations)) {
 	/*
-	 *  Free off each item.
-	 *  May also need to free off it's items, but not sure
-	 *  as of yet.
+	 * Free off each item.  May also need to free off it's items, but not
+	 * sure as of yet.
 	 */
-	pres = (HTPresentation *)HTList_removeLastObject(HTPresentations);
+	pres = (HTPresentation *) HTList_removeLastObject(HTPresentations);
 	FREE(pres->command);
 	FREE(pres);
     }
     /*
-     *	Free the list itself.
+     * Free the list itself.
      */
     HTList_delete(HTPresentations);
     HTPresentations = NULL;
@@ -203,40 +202,42 @@ static void HTFreePresentations (void)
 #endif /* LY_FIND_LEAKS */
 
 /*	File buffering
-**	--------------
-**
-**	The input file is read using the macro which can read from
-**	a socket or a file.
-**	The input buffer size, if large will give greater efficiency and
-**	release the server faster, and if small will save space on PCs etc.
-*/
-#define INPUT_BUFFER_SIZE 4096		/* Tradeoff */
+ *	--------------
+ *
+ *	The input file is read using the macro which can read from
+ *	a socket or a file.
+ *	The input buffer size, if large will give greater efficiency and
+ *	release the server faster, and if small will save space on PCs etc.
+ */
+#define INPUT_BUFFER_SIZE 4096	/* Tradeoff */
 static char input_buffer[INPUT_BUFFER_SIZE];
-static char * input_pointer;
-static char * input_limit;
+static char *input_pointer;
+static char *input_limit;
 static int input_file_number;
 
 /*	Set up the buffering
-**
-**	These routines are public because they are in fact needed by
-**	many parsers, and on PCs and Macs we should not duplicate
-**	the static buffer area.
-*/
-void HTInitInput (int file_number)
+ *
+ *	These routines are public because they are in fact needed by
+ *	many parsers, and on PCs and Macs we should not duplicate
+ *	the static buffer area.
+ */
+void HTInitInput(int file_number)
 {
     input_file_number = file_number;
     input_pointer = input_limit = input_buffer;
 }
 
 int interrupted_in_htgetcharacter = 0;
-int HTGetCharacter (void)
+int HTGetCharacter(void)
 {
     char ch;
+
     interrupted_in_htgetcharacter = 0;
     do {
 	if (input_pointer >= input_limit) {
 	    int status = NETREAD(input_file_number,
 				 input_buffer, INPUT_BUFFER_SIZE);
+
 	    if (status <= 0) {
 		if (status == 0)
 		    return EOF;
@@ -246,67 +247,70 @@ int HTGetCharacter (void)
 		    return EOF;
 		}
 		CTRACE((tfp, "HTFormat: File read error %d\n", status));
-		return EOF; /* -1 is returned by UCX
-			       at end of HTTP link */
+		return EOF;	/* -1 is returned by UCX
+				   at end of HTTP link */
 	    }
 	    input_pointer = input_buffer;
 	    input_limit = input_buffer + status;
 	}
 	ch = *input_pointer++;
-    } while (ch == (char) 13); /* Ignore ASCII carriage return */
+    } while (ch == (char) 13);	/* Ignore ASCII carriage return */
 
     return FROMASCII(UCH(ch));
 }
 
 #ifdef USE_SSL
-char HTGetSSLCharacter (void *  handle)
+char HTGetSSLCharacter(void *handle)
 {
     char ch;
+
     interrupted_in_htgetcharacter = 0;
-    if(!handle)
-	return (char)EOF;
+    if (!handle)
+	return (char) EOF;
     do {
 	if (input_pointer >= input_limit) {
-	    int status = SSL_read((SSL *)handle,
-				 input_buffer, INPUT_BUFFER_SIZE);
+	    int status = SSL_read((SSL *) handle,
+				  input_buffer, INPUT_BUFFER_SIZE);
+
 	    if (status <= 0) {
 		if (status == 0)
-		    return (char)EOF;
+		    return (char) EOF;
 		if (status == HT_INTERRUPTED) {
-		    CTRACE((tfp, "HTFormat: Interrupted in HTGetSSLCharacter\n"));
+		    CTRACE((tfp,
+			    "HTFormat: Interrupted in HTGetSSLCharacter\n"));
 		    interrupted_in_htgetcharacter = 1;
-		    return (char)EOF;
+		    return (char) EOF;
 		}
 		CTRACE((tfp, "HTFormat: SSL_read error %d\n", status));
-		return (char)EOF; /* -1 is returned by UCX
-				     at end of HTTP link */
+		return (char) EOF;	/* -1 is returned by UCX
+					   at end of HTTP link */
 	    }
 	    input_pointer = input_buffer;
 	    input_limit = input_buffer + status;
 	}
 	ch = *input_pointer++;
-    } while (ch == (char) 13); /* Ignore ASCII carriage return */
+    } while (ch == (char) 13);	/* Ignore ASCII carriage return */
 
     return FROMASCII(ch);
 }
 #endif /* USE_SSL */
 
-/*  Match maintype to any MIME type starting with maintype,
- *  for example:  image/gif should match image
+/* Match maintype to any MIME type starting with maintype, for example: 
+ * image/gif should match image
  */
-static int half_match (char * trial_type, char * target)
+static int half_match(char *trial_type, char *target)
 {
     char *cp = strchr(trial_type, '/');
 
     /* if no '/' or no '*' */
-    if (!cp || *(cp+1) != '*')
+    if (!cp || *(cp + 1) != '*')
 	return 0;
 
     CTRACE((tfp, "HTFormat: comparing %s and %s for half match\n",
-		trial_type, target));
+	    trial_type, target));
 
-	/* main type matches */
-    if (!strncmp(trial_type, target, (cp-trial_type)-1))
+    /* main type matches */
+    if (!strncmp(trial_type, target, (cp - trial_type) - 1))
 	return 1;
 
     return 0;
@@ -315,56 +319,58 @@ static int half_match (char * trial_type, char * target)
 #define WWW_WILDCARD_REP_OUT HTAtom_for("*")
 
 /*		Look up a presentation
-**		----------------------
-**
-**	If fill_in is NULL, only look for an exact match.
-**	If a wildcard match is made, *fill_in is used to store
-**	a possibly modified presentation, and a pointer to it is
-**	returned.  For an exact match, a pointer to the presentation
-**	in the HTPresentations list is returned.  Returns NULL if
-**	nothing found. - kw
-**
-*/
-static HTPresentation * HTFindPresentation (
-	HTFormat		rep_in,
-	HTFormat		rep_out,
-	HTPresentation*	fill_in)
+ *		----------------------
+ *
+ *	If fill_in is NULL, only look for an exact match.
+ *	If a wildcard match is made, *fill_in is used to store
+ *	a possibly modified presentation, and a pointer to it is
+ *	returned.  For an exact match, a pointer to the presentation
+ *	in the HTPresentations list is returned.  Returns NULL if
+ *	nothing found. - kw
+ *
+ */
+static HTPresentation *HTFindPresentation(HTFormat rep_in,
+					  HTFormat rep_out,
+					  HTPresentation *fill_in)
 {
-    HTAtom * wildcard = NULL; /* = HTAtom_for("*"); lookup when needed - kw */
+    HTAtom *wildcard = NULL;	/* = HTAtom_for("*"); lookup when needed - kw */
 
     CTRACE((tfp, "HTFormat: Looking up presentation for %s to %s\n",
-		HTAtom_name(rep_in), HTAtom_name(rep_out)));
+	    HTAtom_name(rep_in), HTAtom_name(rep_out)));
 
     /* don't do anymore do it in the Lynx code at startup LJM */
-    /* if (!HTPresentations) HTFormatInit(); */ /* set up the list */
+/* if (!HTPresentations) HTFormatInit(); *//* set up the list */
 
     {
 	int n = HTList_count(HTPresentations);
 	int i;
-	HTPresentation * pres, *match,
-			*strong_wildcard_match=0,
-			*weak_wildcard_match=0,
-			*last_default_match=0,
-			*strong_subtype_wildcard_match=0;
+	HTPresentation *pres;
+	HTPresentation *match;
+	HTPresentation *strong_wildcard_match = 0;
+	HTPresentation *weak_wildcard_match = 0;
+	HTPresentation *last_default_match = 0;
+	HTPresentation *strong_subtype_wildcard_match = 0;
 
 	for (i = 0; i < n; i++) {
-	    pres = (HTPresentation *)HTList_objectAt(HTPresentations, i);
+	    pres = (HTPresentation *) HTList_objectAt(HTPresentations, i);
 	    if (pres->rep == rep_in) {
 		if (pres->rep_out == rep_out) {
 		    CTRACE((tfp, "FindPresentation: found exact match: %s\n",
-				HTAtom_name(pres->rep)));
+			    HTAtom_name(pres->rep)));
 		    return pres;
 
 		} else if (!fill_in) {
 		    continue;
 		} else {
-		    if (!wildcard) wildcard = WWW_WILDCARD_REP_OUT;
+		    if (!wildcard)
+			wildcard = WWW_WILDCARD_REP_OUT;
 		    if (pres->rep_out == wildcard) {
 			if (!strong_wildcard_match)
 			    strong_wildcard_match = pres;
 			/* otherwise use the first one */
-			CTRACE((tfp, "StreamStack: found strong wildcard match: %s\n",
-				    HTAtom_name(pres->rep)));
+			CTRACE((tfp,
+				"StreamStack: found strong wildcard match: %s\n",
+				HTAtom_name(pres->rep)));
 		    }
 		}
 
@@ -372,13 +378,14 @@ static HTPresentation * HTFindPresentation (
 		continue;
 
 	    } else if (half_match(HTAtom_name(pres->rep),
-					      HTAtom_name(rep_in))) {
+				  HTAtom_name(rep_in))) {
 		if (pres->rep_out == rep_out) {
 		    if (!strong_subtype_wildcard_match)
 			strong_subtype_wildcard_match = pres;
 		    /* otherwise use the first one */
-		    CTRACE((tfp, "StreamStack: found strong subtype wildcard match: %s\n",
-				HTAtom_name(pres->rep)));
+		    CTRACE((tfp,
+			    "StreamStack: found strong subtype wildcard match: %s\n",
+			    HTAtom_name(pres->rep)));
 		}
 	    }
 
@@ -387,27 +394,29 @@ static HTPresentation * HTFindPresentation (
 		    if (!weak_wildcard_match)
 			weak_wildcard_match = pres;
 		    /* otherwise use the first one */
-		    CTRACE((tfp, "StreamStack: found weak wildcard match: %s\n",
-				HTAtom_name(pres->rep_out)));
+		    CTRACE((tfp,
+			    "StreamStack: found weak wildcard match: %s\n",
+			    HTAtom_name(pres->rep_out)));
 
 		} else if (!last_default_match) {
-		    if (!wildcard) wildcard = WWW_WILDCARD_REP_OUT;
+		    if (!wildcard)
+			wildcard = WWW_WILDCARD_REP_OUT;
 		    if (pres->rep_out == wildcard)
-			 last_default_match = pres;
+			last_default_match = pres;
 		    /* otherwise use the first one */
 		}
 	    }
 	}
 
 	match = strong_subtype_wildcard_match ? strong_subtype_wildcard_match :
-		strong_wildcard_match ? strong_wildcard_match :
-		weak_wildcard_match ? weak_wildcard_match :
-		last_default_match;
+	    strong_wildcard_match ? strong_wildcard_match :
+	    weak_wildcard_match ? weak_wildcard_match :
+	    last_default_match;
 
 	if (match) {
-	    *fill_in = *match;		/* Specific instance */
-	    fill_in->rep = rep_in;		/* yuk */
-	    fill_in->rep_out = rep_out; /* yuk */
+	    *fill_in = *match;	/* Specific instance */
+	    fill_in->rep = rep_in;	/* yuk */
+	    fill_in->rep_out = rep_out;		/* yuk */
 	    return fill_in;
 	}
     }
@@ -416,34 +425,33 @@ static HTPresentation * HTFindPresentation (
 }
 
 /*		Create a filter stack
-**		---------------------
-**
-**	If a wildcard match is made, a temporary HTPresentation
-**	structure is made to hold the destination format while the
-**	new stack is generated. This is just to pass the out format to
-**	MIME so far.  Storing the format of a stream in the stream might
-**	be a lot neater.
-**
-*/
-HTStream * HTStreamStack (
-	HTFormat		rep_in,
-	HTFormat		rep_out,
-	HTStream*		sink,
-	HTParentAnchor*	anchor)
+ *		---------------------
+ *
+ *	If a wildcard match is made, a temporary HTPresentation
+ *	structure is made to hold the destination format while the
+ *	new stack is generated. This is just to pass the out format to
+ *	MIME so far.  Storing the format of a stream in the stream might
+ *	be a lot neater.
+ *
+ */
+HTStream *HTStreamStack(HTFormat rep_in,
+			HTFormat rep_out,
+			HTStream *sink,
+			HTParentAnchor *anchor)
 {
     HTPresentation temp;
     HTPresentation *match;
     HTStream *result;
 
     CTRACE((tfp, "HTFormat: Constructing stream stack for %s to %s\n",
-		HTAtom_name(rep_in), HTAtom_name(rep_out)));
+	    HTAtom_name(rep_in), HTAtom_name(rep_out)));
 
     /* don't return on WWW_SOURCE some people might like
      * to make use of the source!!!!  LJM
      */
 #if 0
     if (rep_out == WWW_SOURCE || rep_out == rep_in)
-	return sink;	/*  LJM */
+	return sink;		/*  LJM */
 #endif
 
     if (rep_out == rep_in) {
@@ -454,9 +462,9 @@ HTStream * HTStreamStack (
 	    CTRACE((tfp, "StreamStack: Using %s\n", HTAtom_name(temp.rep_out)));
 	} else {
 	    CTRACE((tfp, "StreamStack: found exact match: %s\n",
-			HTAtom_name(match->rep)));
+		    HTAtom_name(match->rep)));
 	}
-	result = (*match->converter)(match, anchor, sink);
+	result = (*match->converter) (match, anchor, sink);
     } else {
 	result = NULL;
     }
@@ -474,16 +482,16 @@ HTStream * HTStreamStack (
 }
 
 /*		Put a presentation near start of list
-**		-------------------------------------
-**
-**	Look up a presentation (exact match only) and, if found, reorder
-**	it to the start of the HTPresentations list. - kw
-*/
-void HTReorderPresentation (
-	HTFormat		rep_in,
-	HTFormat		rep_out)
+ *		-------------------------------------
+ *
+ *	Look up a presentation (exact match only) and, if found, reorder
+ *	it to the start of the HTPresentations list. - kw
+ */
+void HTReorderPresentation(HTFormat rep_in,
+			   HTFormat rep_out)
 {
     HTPresentation *match;
+
     if ((match = HTFindPresentation(rep_in, rep_out, NULL))) {
 	HTList_removeObject(HTPresentations, match);
 	HTList_addObject(HTPresentations, match);
@@ -494,7 +502,7 @@ void HTReorderPresentation (
  * Setup 'get_accept' flag to denote presentations that are not redundant,
  * and will be listed in "Accept:" header.
  */
-void HTFilterPresentations (void)
+void HTFilterPresentations(void)
 {
     int i, j;
     int n = HTList_count(HTPresentations);
@@ -503,16 +511,16 @@ void HTFilterPresentations (void)
     char *s, *t, *x, *y;
 
     for (i = 0; i < n; i++) {
-	p = (HTPresentation *)HTList_objectAt(HTPresentations, i);
+	p = (HTPresentation *) HTList_objectAt(HTPresentations, i);
 	s = HTAtom_name(p->rep);
 
 	if (p->rep_out == WWW_PRESENT) {
 	    if (p->rep != WWW_SOURCE
-	     && strcasecomp(s, "www/mime")
-	     && strcasecomp(s, "www/compressed")
-	     && p->quality <= 1.0 && p->quality >= 0.0) {
+		&& strcasecomp(s, "www/mime")
+		&& strcasecomp(s, "www/compressed")
+		&& p->quality <= 1.0 && p->quality >= 0.0) {
 		for (j = 0, matched = FALSE; j < i; j++) {
-		    q = (HTPresentation *)HTList_objectAt(HTPresentations, j);
+		    q = (HTPresentation *) HTList_objectAt(HTPresentations, j);
 		    t = HTAtom_name(q->rep);
 
 		    if (!strcasecomp(s, t)) {
@@ -520,13 +528,13 @@ void HTFilterPresentations (void)
 			break;
 		    }
 		    if ((x = strchr(s, '/')) != 0
-		     && (y = strchr(t, '/')) != 0) {
+			&& (y = strchr(t, '/')) != 0) {
 			int len1 = x++ - s;
 			int len2 = y++ - t;
 			int lens = (len1 > len2) ? len1 : len2;
 
 			if ((*t == '*' || !strncasecomp(s, t, lens))
-			 && (*y == '*' || !strcasecomp(x, y))) {
+			    && (*y == '*' || !strcasecomp(x, y))) {
 			    matched = TRUE;
 			    break;
 			}
@@ -540,42 +548,43 @@ void HTFilterPresentations (void)
 }
 
 /*		Find the cost of a filter stack
-**		-------------------------------
-**
-**	Must return the cost of the same stack which StreamStack would set up.
-**
-** On entry,
-**	length	The size of the data to be converted
-*/
-float HTStackValue (
-	HTFormat		rep_in,
-	HTFormat		rep_out,
-	float			initial_value,
-	long int		length)
+ *		-------------------------------
+ *
+ *	Must return the cost of the same stack which StreamStack would set up.
+ *
+ * On entry,
+ *	length	The size of the data to be converted
+ */
+float HTStackValue(HTFormat rep_in,
+		   HTFormat rep_out,
+		   float initial_value,
+		   long int length)
 {
-    HTAtom * wildcard = WWW_WILDCARD_REP_OUT;
+    HTAtom *wildcard = WWW_WILDCARD_REP_OUT;
 
     CTRACE((tfp, "HTFormat: Evaluating stream stack for %s worth %.3f to %s\n",
-		HTAtom_name(rep_in), initial_value, HTAtom_name(rep_out)));
+	    HTAtom_name(rep_in), initial_value, HTAtom_name(rep_out)));
 
     if (rep_out == WWW_SOURCE || rep_out == rep_in)
 	return 0.0;
 
     /* don't do anymore do it in the Lynx code at startup LJM */
-    /* if (!HTPresentations) HTFormatInit(); */ /* set up the list */
+/* if (!HTPresentations) HTFormatInit(); *//* set up the list */
 
     {
 	int n = HTList_count(HTPresentations);
 	int i;
-	HTPresentation * pres;
+	HTPresentation *pres;
+
 	for (i = 0; i < n; i++) {
-	    pres = (HTPresentation *)HTList_objectAt(HTPresentations, i);
+	    pres = (HTPresentation *) HTList_objectAt(HTPresentations, i);
 	    if (pres->rep == rep_in &&
 		(pres->rep_out == rep_out || pres->rep_out == wildcard)) {
 		float value = initial_value * pres->quality;
+
 		if (HTMaxSecs != 0.0)
-		    value = value - (length*pres->secs_per_byte + pres->secs)
-					 /HTMaxSecs;
+		    value = value - (length * pres->secs_per_byte + pres->secs)
+			/ HTMaxSecs;
 		return value;
 	    }
 	}
@@ -586,140 +595,140 @@ float HTStackValue (
 }
 
 /*	Display the page while transfer in progress
-**	-------------------------------------------
-**
-**   Repaint the page only when necessary.
-**   This is a traverse call for HText_pageDisplay() - it works!.
-**
-*/
-void HTDisplayPartial (void)
+ *	-------------------------------------------
+ *
+ *   Repaint the page only when necessary.
+ *   This is a traverse call for HText_pageDisplay() - it works!.
+ *
+ */
+void HTDisplayPartial(void)
 {
 #ifdef DISP_PARTIAL
     if (display_partial) {
 	/*
-	**  HText_getNumOfLines() = "current" number of complete lines received
-	**  NumOfLines_partial = number of lines at the moment of last repaint.
-	**  (we update NumOfLines_partial only when we repaint the display.)
-	**
-	**  display_partial could only be enabled in HText_new()
-	**  so a new HTMainText object available - all HText_ functions use it,
-	**  lines counter HText_getNumOfLines() in particular.
-	**
-	**  Otherwise HTMainText holds info from the previous document
-	**  and we may repaint it instead of the new one:
-	**  prev doc scrolled to the first line (=Newline_partial)
-	**  is not good looking :-)	  23 Aug 1998 Leonid Pauzner
-	**
-	**  So repaint the page only when necessary:
-	*/
+	 * HText_getNumOfLines() = "current" number of complete lines received
+	 * NumOfLines_partial = number of lines at the moment of last repaint. 
+	 * (we update NumOfLines_partial only when we repaint the display.)
+	 *
+	 * display_partial could only be enabled in HText_new() so a new
+	 * HTMainText object available - all HText_ functions use it, lines
+	 * counter HText_getNumOfLines() in particular.
+	 *
+	 * Otherwise HTMainText holds info from the previous document and we
+	 * may repaint it instead of the new one:  prev doc scrolled to the
+	 * first line (=Newline_partial) is not good looking :-) 23 Aug 1998
+	 * Leonid Pauzner
+	 *
+	 * So repaint the page only when necessary:
+	 */
 	int Newline_partial = LYGetNewline();
 
 	if (((Newline_partial + display_lines) - 1 > NumOfLines_partial)
-		/* current page not complete... */
-	&& (partial_threshold > 0 ?
-		((Newline_partial + partial_threshold) -1 <= HText_getNumOfLines()) :
+	/* current page not complete... */
+	    && (partial_threshold > 0 ?
+		((Newline_partial + partial_threshold) - 1 <=
+		 HText_getNumOfLines()) :
 		((Newline_partial + display_lines) - 1 <= HText_getNumOfLines()))
-		/*
-		 * Originally we rendered by increments of 2 lines,
-		 * but that got annoying on slow network connections.
-		 * Then we switched to full-pages.  Now it's configurable.
-		 * If partial_threshold <= 0, then it's a full page
-		 */
-	) {
+	/*
+	 * Originally we rendered by increments of 2 lines,
+	 * but that got annoying on slow network connections.
+	 * Then we switched to full-pages.  Now it's configurable.
+	 * If partial_threshold <= 0, then it's a full page
+	 */
+	    ) {
 	    if (LYMainLoop_pageDisplay(Newline_partial))
 		NumOfLines_partial = HText_getNumOfLines();
 	}
     }
 #else /* nothing */
-#endif  /* DISP_PARTIAL */
+#endif /* DISP_PARTIAL */
 }
 
 /* Put this as early as possible, OK just after HTDisplayPartial() */
-void HTFinishDisplayPartial (void)
+void HTFinishDisplayPartial(void)
 {
 #ifdef DISP_PARTIAL
-		    /*
-		     *  End of incremental rendering stage here.
-		     */
-		    display_partial = FALSE;
+    /*
+     * End of incremental rendering stage here.
+     */
+    display_partial = FALSE;
 #endif /* DISP_PARTIAL */
 }
 
 /*	Push data from a socket down a stream
-**	-------------------------------------
-**
-**   This routine is responsible for creating and PRESENTING any
-**   graphic (or other) objects described by the file.
-**
-**   The file number given is assumed to be a TELNET stream, i.e., containing
-**   CRLF at the end of lines which need to be stripped to LF for unix
-**   when the format is textual.
-**
-**  State of socket and target stream on entry:
-**			socket (file_number) assumed open,
-**			target (sink) assumed valid.
-**
-**  Return values:
-**	HT_INTERRUPTED  Interruption or error after some data received.
-**	-2		Unexpected disconnect before any data received.
-**	-1		Interruption or error before any data received, or
-**			(UNIX) other read error before any data received, or
-**			download cancelled.
-**	HT_LOADED	Normal close of socket (end of file indication
-**			received), or
-**			unexpected disconnect after some data received, or
-**			other read error after some data received, or
-**			(not UNIX) other read error before any data received.
-**
-**  State of socket and target stream on return depends on return value:
-**	HT_INTERRUPTED	socket still open, target aborted.
-**	-2		socket still open, target stream still valid.
-**	-1		socket still open, target aborted.
-**	otherwise	socket closed,	target stream still valid.
-*/
-int HTCopy (
-	HTParentAnchor *	anchor,
-	int			file_number,
-	void*			handle GCC_UNUSED,
-	HTStream*		sink)
+ *	-------------------------------------
+ *
+ *   This routine is responsible for creating and PRESENTING any
+ *   graphic (or other) objects described by the file.
+ *
+ *   The file number given is assumed to be a TELNET stream, i.e., containing
+ *   CRLF at the end of lines which need to be stripped to LF for unix
+ *   when the format is textual.
+ *
+ *  State of socket and target stream on entry:
+ *			socket (file_number) assumed open,
+ *			target (sink) assumed valid.
+ *
+ *  Return values:
+ *	HT_INTERRUPTED  Interruption or error after some data received.
+ *	-2		Unexpected disconnect before any data received.
+ *	-1		Interruption or error before any data received, or
+ *			(UNIX) other read error before any data received, or
+ *			download cancelled.
+ *	HT_LOADED	Normal close of socket (end of file indication
+ *			received), or
+ *			unexpected disconnect after some data received, or
+ *			other read error after some data received, or
+ *			(not UNIX) other read error before any data received.
+ *
+ *  State of socket and target stream on return depends on return value:
+ *	HT_INTERRUPTED	socket still open, target aborted.
+ *	-2		socket still open, target stream still valid.
+ *	-1		socket still open, target aborted.
+ *	otherwise	socket closed,	target stream still valid.
+ */
+int HTCopy(HTParentAnchor *anchor,
+	   int file_number,
+	   void *handle GCC_UNUSED,
+	   HTStream *sink)
 {
     HTStreamClass targetClass;
     BOOL suppress_readprogress = NO;
     int bytes;
     int rv = 0;
 
-    /*	Push the data down the stream
-    */
-    targetClass = *(sink->isa); /* Copy pointers to procedures */
+    /*  Push the data down the stream
+     */
+    targetClass = *(sink->isa);	/* Copy pointers to procedures */
 
-    /*	Push binary from socket down sink
-    **
-    **	This operation could be put into a main event loop
-    */
+    /*
+     * Push binary from socket down sink
+     *
+     * This operation could be put into a main event loop
+     */
     HTReadProgress(bytes = 0, 0);
     for (;;) {
 	int status;
 
 	if (LYCancelDownload) {
 	    LYCancelDownload = FALSE;
-	    (*targetClass._abort)(sink, NULL);
+	    (*targetClass._abort) (sink, NULL);
 	    rv = -1;
 	    goto finished;
 	}
 
 	if (HTCheckForInterrupt()) {
-	    _HTProgress (TRANSFER_INTERRUPTED);
-	    (*targetClass._abort)(sink, NULL);
+	    _HTProgress(TRANSFER_INTERRUPTED);
+	    (*targetClass._abort) (sink, NULL);
 	    if (bytes)
 		rv = HT_INTERRUPTED;
 	    else
 		rv = -1;
 	    goto finished;
 	}
-
 #ifdef USE_SSL
 	if (handle)
-	    status = SSL_read((SSL *)handle, input_buffer, INPUT_BUFFER_SIZE);
+	    status = SSL_read((SSL *) handle, input_buffer, INPUT_BUFFER_SIZE);
 	else
 	    status = NETREAD(file_number, input_buffer, INPUT_BUFFER_SIZE);
 #else
@@ -730,71 +739,69 @@ int HTCopy (
 	    if (status == 0) {
 		break;
 	    } else if (status == HT_INTERRUPTED) {
-		_HTProgress (TRANSFER_INTERRUPTED);
-		(*targetClass._abort)(sink, NULL);
+		_HTProgress(TRANSFER_INTERRUPTED);
+		(*targetClass._abort) (sink, NULL);
 		if (bytes)
 		    rv = HT_INTERRUPTED;
 		else
 		    rv = -1;
 		goto finished;
 	    } else if (SOCKET_ERRNO == ENOTCONN ||
-#ifdef _WINDOWS	/* 1997/11/10 (Mon) 16:57:18 */
+#ifdef _WINDOWS			/* 1997/11/10 (Mon) 16:57:18 */
 		       SOCKET_ERRNO == ETIMEDOUT ||
 #endif
 		       SOCKET_ERRNO == ECONNRESET ||
 		       SOCKET_ERRNO == EPIPE) {
 		/*
-		 *  Arrrrgh, HTTP 0/1 compatibility problem, maybe.
+		 * Arrrrgh, HTTP 0/1 compatibility problem, maybe.
 		 */
 		if (bytes <= 0) {
 		    /*
-		     *	Don't have any data, so let the calling
-		     *	function decide what to do about it. - FM
+		     * Don't have any data, so let the calling function decide
+		     * what to do about it.  - FM
 		     */
 		    rv = -2;
 		    goto finished;
 		} else {
 #ifdef UNIX
-		   /*
-		    *  Treat what we've received already as the complete
-		    *  transmission, but not without giving the user
-		    *  an alert.  I don't know about all the different
-		    *  TCP stacks for VMS etc., so this is currently
-		    *  only for UNIX. - kw
-		    */
-		   HTInetStatus("NETREAD");
-		   HTAlert("Unexpected server disconnect.");
-		   CTRACE((tfp,
-	    "HTCopy: Unexpected server disconnect. Treating as completed.\n"));
-		   status = 0;
-		   break;
-#else  /* !UNIX */
-		   /*
-		    *  Treat what we've gotten already
-		    *  as the complete transmission. - FM
-		    */
-		   CTRACE((tfp,
-	    "HTCopy: Unexpected server disconnect.  Treating as completed.\n"));
-		   status = 0;
-		   break;
+		    /*
+		     * Treat what we've received already as the complete
+		     * transmission, but not without giving the user an alert. 
+		     * I don't know about all the different TCP stacks for VMS
+		     * etc., so this is currently only for UNIX.  - kw
+		     */
+		    HTInetStatus("NETREAD");
+		    HTAlert("Unexpected server disconnect.");
+		    CTRACE((tfp,
+			    "HTCopy: Unexpected server disconnect. Treating as completed.\n"));
+		    status = 0;
+		    break;
+#else /* !UNIX */
+		    /*
+		     * Treat what we've gotten already as the complete
+		     * transmission.  - FM
+		     */
+		    CTRACE((tfp,
+			    "HTCopy: Unexpected server disconnect.  Treating as completed.\n"));
+		    status = 0;
+		    break;
 #endif /* UNIX */
 		}
 #ifdef UNIX
 	    } else {		/* status < 0 and other errno */
 		/*
-		 *  Treat what we've received already as the complete
-		 *  transmission, but not without giving the user
-		 *  an alert.  I don't know about all the different
-		 *  TCP stacks for VMS etc., so this is currently
-		 *  only for UNIX. - kw
+		 * Treat what we've received already as the complete
+		 * transmission, but not without giving the user an alert.  I
+		 * don't know about all the different TCP stacks for VMS etc.,
+		 * so this is currently only for UNIX.  - kw
 		 */
 		HTInetStatus("NETREAD");
 		HTAlert("Unexpected read error.");
 		if (bytes) {
-		    (void)NETCLOSE(file_number);
+		    (void) NETCLOSE(file_number);
 		    rv = HT_LOADED;
 		} else {
-		    (*targetClass._abort)(sink, NULL);
+		    (*targetClass._abort) (sink, NULL);
 		    rv = -1;
 		}
 		goto finished;
@@ -804,85 +811,84 @@ int HTCopy (
 	}
 
 	/*
-	 *  Suppress ReadProgress messages when collecting a redirection
-	 *  message, at least initially (unless/until anchor->content_type
-	 *  gets changed, probably by the MIME message parser).  That way
-	 *  messages put up by the HTTP module or elsewhere can linger in
-	 *  the statusline for a while. - kw
+	 * Suppress ReadProgress messages when collecting a redirection
+	 * message, at least initially (unless/until anchor->content_type gets
+	 * changed, probably by the MIME message parser).  That way messages
+	 * put up by the HTTP module or elsewhere can linger in the statusline
+	 * for a while.  - kw
 	 */
 	suppress_readprogress = (anchor && anchor->content_type &&
 				 !strcmp(anchor->content_type,
 					 "message/x-http-redirection"));
 #ifdef NOT_ASCII
 	{
-	    char * p;
-	    for (p = input_buffer; p < input_buffer+status; p++) {
+	    char *p;
+
+	    for (p = input_buffer; p < input_buffer + status; p++) {
 		*p = FROMASCII(*p);
 	    }
 	}
 #endif /* NOT_ASCII */
 
-	(*targetClass.put_block)(sink, input_buffer, status);
+	(*targetClass.put_block) (sink, input_buffer, status);
 	bytes += status;
 	if (!suppress_readprogress)
 	    HTReadProgress(bytes, anchor ? anchor->content_length : 0);
 	HTDisplayPartial();
 
-    } /* next bufferload */
+    }				/* next bufferload */
 
     _HTProgress(TRANSFER_COMPLETE);
-    (void)NETCLOSE(file_number);
+    (void) NETCLOSE(file_number);
     rv = HT_LOADED;
 
-finished:
+  finished:
     HTFinishDisplayPartial();
-    return(rv);
+    return (rv);
 }
 
 /*	Push data from a file pointer down a stream
-**	-------------------------------------
-**
-**   This routine is responsible for creating and PRESENTING any
-**   graphic (or other) objects described by the file.
-**
-**
-**  State of file and target stream on entry:
-**			FILE* (fp) assumed open,
-**			target (sink) assumed valid.
-**
-**  Return values:
-**	HT_INTERRUPTED  Interruption after some data read.
-**	HT_PARTIAL_CONTENT	Error after some data read.
-**	-1		Error before any data read.
-**	HT_LOADED	Normal end of file indication on reading.
-**
-**  State of file and target stream on return:
-**	always		fp still open, target stream still valid.
-*/
-int HTFileCopy (
-	FILE *			fp,
-	HTStream*		sink)
+ *	-------------------------------------
+ *
+ *   This routine is responsible for creating and PRESENTING any
+ *   graphic (or other) objects described by the file.
+ *
+ *
+ *  State of file and target stream on entry:
+ *			FILE* (fp) assumed open,
+ *			target (sink) assumed valid.
+ *
+ *  Return values:
+ *	HT_INTERRUPTED  Interruption after some data read.
+ *	HT_PARTIAL_CONTENT	Error after some data read.
+ *	-1		Error before any data read.
+ *	HT_LOADED	Normal end of file indication on reading.
+ *
+ *  State of file and target stream on return:
+ *	always		fp still open, target stream still valid.
+ */
+int HTFileCopy(FILE *fp, HTStream *sink)
 {
     HTStreamClass targetClass;
     int status, bytes;
     int rv = HT_OK;
 
-    /*	Push the data down the stream
-    */
-    targetClass = *(sink->isa); /* Copy pointers to procedures */
+    /*  Push the data down the stream
+     */
+    targetClass = *(sink->isa);	/* Copy pointers to procedures */
 
-    /*	Push binary from socket down sink
-    */
+    /*  Push binary from socket down sink
+     */
     HTReadProgress(bytes = 0, 0);
     for (;;) {
 	status = fread(input_buffer, 1, INPUT_BUFFER_SIZE, fp);
-	if (status == 0) { /* EOF or error */
+	if (status == 0) {	/* EOF or error */
 	    if (ferror(fp) == 0) {
 		rv = HT_LOADED;
 		break;
 	    }
 	    CTRACE((tfp, "HTFormat: Read error, read returns %d\n",
-			ferror(fp)));
+		    ferror(fp)));
 	    if (bytes) {
 		rv = HT_PARTIAL_CONTENT;
 	    } else {
@@ -891,11 +897,11 @@ int HTFileCopy (
 	    break;
 	}
 
-	(*targetClass.put_block)(sink, input_buffer, status);
+	(*targetClass.put_block) (sink, input_buffer, status);
 	bytes += status;
 	HTReadProgress(bytes, 0);
-	/*  Suppress last screen update in partial mode - a regular update
-	 *  under control of mainloop() should follow anyway. - kw
+	/* Suppress last screen update in partial mode - a regular update under
+	 * control of mainloop() should follow anyway.  - kw
 	 */
 #ifdef DISP_PARTIAL
 	if (display_partial && bytes != HTMainAnchor->content_length)
@@ -903,7 +909,7 @@ int HTFileCopy (
 #endif
 
 	if (HTCheckForInterrupt()) {
-	    _HTProgress (TRANSFER_INTERRUPTED);
+	    _HTProgress(TRANSFER_INTERRUPTED);
 	    if (bytes) {
 		rv = HT_INTERRUPTED;
 	    } else {
@@ -911,7 +917,7 @@ int HTFileCopy (
 	    }
 	    break;
 	}
-    } /* next bufferload */
+    }				/* next bufferload */
 
     HTFinishDisplayPartial();
     return rv;
@@ -919,24 +925,22 @@ int HTFileCopy (
 
 #ifdef USE_SOURCE_CACHE
 /*	Push data from an HTChunk down a stream
-**	---------------------------------------
-**
-**   This routine is responsible for creating and PRESENTING any
-**   graphic (or other) objects described by the file.
-**
-**  State of memory and target stream on entry:
-**			HTChunk* (chunk) and target (sink) assumed valid.
-**
-**  Return values:
-**	HT_LOADED	All data sent.
-**	HT_INTERRUPTED  Interruption after some data read.
-**
-**  State of memory and target stream on return:
-**	always		chunk unchanged, target stream still valid.
-*/
-int HTMemCopy (
-	HTChunk *		chunk,
-	HTStream *		sink)
+ *	---------------------------------------
+ *
+ *   This routine is responsible for creating and PRESENTING any
+ *   graphic (or other) objects described by the file.
+ *
+ *  State of memory and target stream on entry:
+ *			HTChunk* (chunk) and target (sink) assumed valid.
+ *
+ *  Return values:
+ *	HT_LOADED	All data sent.
+ *	HT_INTERRUPTED  Interruption after some data read.
+ *
+ *  State of memory and target stream on return:
+ *	always		chunk unchanged, target stream still valid.
+ */
+int HTMemCopy(HTChunk *chunk, HTStream *sink)
 {
     HTStreamClass targetClass;
     int bytes = 0;
@@ -947,21 +951,22 @@ int HTMemCopy (
     HTReadProgress(0, 0);
     for (;;) {
 	/* Push the data down the stream a piece at a time, in case we're
-	** running a large document on a slow machine.
-	*/
+	 * running a large document on a slow machine.
+	 */
 	int n = INPUT_BUFFER_SIZE;
+
 	if (n > chunk->size - bytes)
 	    n = chunk->size - bytes;
 	if (n == 0)
 	    break;
-	(*targetClass.put_block)(sink, data, n);
+	(*targetClass.put_block) (sink, data, n);
 	bytes += n;
 	data += n;
 	HTReadProgress(bytes, 0);
 	HTDisplayPartial();
 
 	if (HTCheckForInterrupt()) {
-	    _HTProgress (TRANSFER_INTERRUPTED);
+	    _HTProgress(TRANSFER_INTERRUPTED);
 	    if (bytes) {
 		rv = HT_INTERRUPTED;
 	    } else {
@@ -978,52 +983,50 @@ int HTMemCopy (
 
 #ifdef USE_ZLIB
 /*	Push data from a gzip file pointer down a stream
-**	-------------------------------------
-**
-**   This routine is responsible for creating and PRESENTING any
-**   graphic (or other) objects described by the file.
-**
-**
-**  State of file and target stream on entry:
-**		      gzFile (gzfp) assumed open (should have gzipped content),
-**		      target (sink) assumed valid.
-**
-**  Return values:
-**	HT_INTERRUPTED  Interruption after some data read.
-**	HT_PARTIAL_CONTENT	Error after some data read.
-**	-1		Error before any data read.
-**	HT_LOADED	Normal end of file indication on reading.
-**
-**  State of file and target stream on return:
-**	always		gzfp still open, target stream still valid.
-*/
-static int HTGzFileCopy (
-	gzFile			gzfp,
-	HTStream*		sink)
+ *	-------------------------------------
+ *
+ *   This routine is responsible for creating and PRESENTING any
+ *   graphic (or other) objects described by the file.
+ *
+ *
+ *  State of file and target stream on entry:
+ *		      gzFile (gzfp) assumed open (should have gzipped content),
+ *		      target (sink) assumed valid.
+ *
+ *  Return values:
+ *	HT_INTERRUPTED  Interruption after some data read.
+ *	HT_PARTIAL_CONTENT	Error after some data read.
+ *	-1		Error before any data read.
+ *	HT_LOADED	Normal end of file indication on reading.
+ *
+ *  State of file and target stream on return:
+ *	always		gzfp still open, target stream still valid.
+ */
+static int HTGzFileCopy(gzFile gzfp, HTStream *sink)
 {
     HTStreamClass targetClass;
     int status, bytes;
     int gzerrnum;
     int rv = HT_OK;
 
-    /*	Push the data down the stream
-    */
-    targetClass = *(sink->isa); /* Copy pointers to procedures */
+    /*  Push the data down the stream
+     */
+    targetClass = *(sink->isa);	/* Copy pointers to procedures */
 
-    /*	read and inflate gzip'd file, and push binary down sink
-    */
+    /*  read and inflate gzip'd file, and push binary down sink
+     */
     HTReadProgress(bytes = 0, 0);
     for (;;) {
 	status = gzread(gzfp, input_buffer, INPUT_BUFFER_SIZE);
-	if (status <= 0) { /* EOF or error */
+	if (status <= 0) {	/* EOF or error */
 	    if (status == 0) {
 		rv = HT_LOADED;
 		break;
 	    }
 	    CTRACE((tfp, "HTGzFileCopy: Read error, gzread returns %d\n",
-			status));
+		    status));
 	    CTRACE((tfp, "gzerror   : %s\n",
-			gzerror(gzfp, &gzerrnum)));
+		    gzerror(gzfp, &gzerrnum)));
 	    if (TRACE) {
 		if (gzerrnum == Z_ERRNO)
 		    perror("gzerror   ");
@@ -1036,13 +1039,13 @@ static int HTGzFileCopy (
 	    break;
 	}
 
-	(*targetClass.put_block)(sink, input_buffer, status);
+	(*targetClass.put_block) (sink, input_buffer, status);
 	bytes += status;
 	HTReadProgress(bytes, -1);
 	HTDisplayPartial();
 
 	if (HTCheckForInterrupt()) {
-	    _HTProgress (TRANSFER_INTERRUPTED);
+	    _HTProgress(TRANSFER_INTERRUPTED);
 	    if (bytes) {
 		rv = HT_INTERRUPTED;
 	    } else {
@@ -1050,7 +1053,7 @@ static int HTGzFileCopy (
 	    }
 	    break;
 	}
-    } /* next bufferload */
+    }				/* next bufferload */
 
     HTFinishDisplayPartial();
     return rv;
@@ -1059,52 +1062,50 @@ static int HTGzFileCopy (
 
 #ifdef USE_BZLIB
 /*	Push data from a bzip file pointer down a stream
-**	-------------------------------------
-**
-**   This routine is responsible for creating and PRESENTING any
-**   graphic (or other) objects described by the file.
-**
-**
-**  State of file and target stream on entry:
-**		      BZFILE (bzfp) assumed open (should have bzipped content),
-**		      target (sink) assumed valid.
-**
-**  Return values:
-**	HT_INTERRUPTED  Interruption after some data read.
-**	HT_PARTIAL_CONTENT	Error after some data read.
-**	-1		Error before any data read.
-**	HT_LOADED	Normal end of file indication on reading.
-**
-**  State of file and target stream on return:
-**	always		bzfp still open, target stream still valid.
-*/
-static int HTBzFileCopy (
-	BZFILE *		bzfp,
-	HTStream*		sink)
+ *	-------------------------------------
+ *
+ *   This routine is responsible for creating and PRESENTING any
+ *   graphic (or other) objects described by the file.
+ *
+ *
+ *  State of file and target stream on entry:
+ *		      BZFILE (bzfp) assumed open (should have bzipped content),
+ *		      target (sink) assumed valid.
+ *
+ *  Return values:
+ *	HT_INTERRUPTED  Interruption after some data read.
+ *	HT_PARTIAL_CONTENT	Error after some data read.
+ *	-1		Error before any data read.
+ *	HT_LOADED	Normal end of file indication on reading.
+ *
+ *  State of file and target stream on return:
+ *	always		bzfp still open, target stream still valid.
+ */
+static int HTBzFileCopy(BZFILE * bzfp, HTStream *sink)
 {
     HTStreamClass targetClass;
     int status, bytes;
     int bzerrnum;
     int rv = HT_OK;
 
-    /*	Push the data down the stream
-    */
-    targetClass = *(sink->isa); /* Copy pointers to procedures */
+    /*  Push the data down the stream
+     */
+    targetClass = *(sink->isa);	/* Copy pointers to procedures */
 
-    /*	read and inflate bzip'd file, and push binary down sink
-    */
+    /*  read and inflate bzip'd file, and push binary down sink
+     */
     HTReadProgress(bytes = 0, 0);
     for (;;) {
 	status = BZ2_bzread(bzfp, input_buffer, INPUT_BUFFER_SIZE);
-	if (status <= 0) { /* EOF or error */
+	if (status <= 0) {	/* EOF or error */
 	    if (status == 0) {
 		rv = HT_LOADED;
 		break;
 	    }
 	    CTRACE((tfp, "HTBzFileCopy: Read error, bzread returns %d\n",
-			status));
+		    status));
 	    CTRACE((tfp, "bzerror   : %s\n",
-			BZ2_bzerror(bzfp, &bzerrnum)));
+		    BZ2_bzerror(bzfp, &bzerrnum)));
 	    if (bytes) {
 		rv = HT_PARTIAL_CONTENT;
 	    } else {
@@ -1113,13 +1114,13 @@ static int HTBzFileCopy (
 	    break;
 	}
 
-	(*targetClass.put_block)(sink, input_buffer, status);
+	(*targetClass.put_block) (sink, input_buffer, status);
 	bytes += status;
 	HTReadProgress(bytes, -1);
 	HTDisplayPartial();
 
 	if (HTCheckForInterrupt()) {
-	    _HTProgress (TRANSFER_INTERRUPTED);
+	    _HTProgress(TRANSFER_INTERRUPTED);
 	    if (bytes) {
 		rv = HT_INTERRUPTED;
 	    } else {
@@ -1127,7 +1128,7 @@ static int HTBzFileCopy (
 	    }
 	    break;
 	}
-    } /* next bufferload */
+    }				/* next bufferload */
 
     HTFinishDisplayPartial();
     return rv;
@@ -1135,84 +1136,83 @@ static int HTBzFileCopy (
 #endif /* USE_BZLIB */
 
 /*	Push data from a socket down a stream STRIPPING CR
-**	--------------------------------------------------
-**
-**   This routine is responsible for creating and PRESENTING any
-**   graphic (or other) objects described by the socket.
-**
-**   The file number given is assumed to be a TELNET stream ie containing
-**   CRLF at the end of lines which need to be stripped to LF for unix
-**   when the format is textual.
-**
-*/
-void HTCopyNoCR (
-	HTParentAnchor *	anchor GCC_UNUSED,
-	int			file_number,
-	HTStream*		sink)
+ *	--------------------------------------------------
+ *
+ *   This routine is responsible for creating and PRESENTING any
+ *   graphic (or other) objects described by the socket.
+ *
+ *   The file number given is assumed to be a TELNET stream ie containing
+ *   CRLF at the end of lines which need to be stripped to LF for unix
+ *   when the format is textual.
+ *
+ */
+void HTCopyNoCR(HTParentAnchor *anchor GCC_UNUSED,
+		int file_number,
+		HTStream *sink)
 {
     HTStreamClass targetClass;
     int character;
 
-    /*	Push the data, ignoring CRLF, down the stream
-    */
-    targetClass = *(sink->isa); /* Copy pointers to procedures */
+    /*  Push the data, ignoring CRLF, down the stream
+     */
+    targetClass = *(sink->isa);	/* Copy pointers to procedures */
 
-    /*	Push text from telnet socket down sink
-    **
-    **	@@@@@ To push strings could be faster? (especially is we
-    **	cheat and don't ignore CR! :-}
-    */
+    /*
+     * Push text from telnet socket down sink
+     *
+     * @@@@@ To push strings could be faster?  (especially is we cheat and
+     * don't ignore CR!  :-}
+     */
     HTInitInput(file_number);
     for (;;) {
 	character = HTGetCharacter();
 	if (character == EOF)
 	    break;
-	(*targetClass.put_character)(sink, UCH(character));
+	(*targetClass.put_character) (sink, UCH(character));
     }
 }
 
 /*	Parse a socket given format and file number
-**
-**   This routine is responsible for creating and PRESENTING any
-**   graphic (or other) objects described by the file.
-**
-**   The file number given is assumed to be a TELNET stream ie containing
-**   CRLF at the end of lines which need to be stripped to LF for unix
-**   when the format is textual.
-**
-**  State of socket and target stream on entry:
-**			socket (file_number) assumed open,
-**			target (sink) usually NULL (will call stream stack).
-**
-**  Return values:
-**	HT_INTERRUPTED  Interruption or error after some data received.
-**	-501		Stream stack failed (cannot present or convert).
-**	-2		Unexpected disconnect before any data received.
-**	-1		Stream stack failed (cannot present or convert), or
-**			Interruption or error before any data received, or
-**			(UNIX) other read error before any data received, or
-**			download cancelled.
-**	HT_LOADED	Normal close of socket (end of file indication
-**			received), or
-**			unexpected disconnect after some data received, or
-**			other read error after some data received, or
-**			(not UNIX) other read error before any data received.
-**
-**  State of socket and target stream on return depends on return value:
-**	HT_INTERRUPTED	socket still open, target aborted.
-**	-501		socket still open, target stream NULL.
-**	-2		socket still open, target freed.
-**	-1		socket still open, target stream aborted or NULL.
-**	otherwise	socket closed,	target stream freed.
-*/
-int HTParseSocket (
-	HTFormat		rep_in,
-	HTFormat		format_out,
-	HTParentAnchor *	anchor,
-	int			file_number,
-	HTStream*		sink)
+ *
+ *   This routine is responsible for creating and PRESENTING any
+ *   graphic (or other) objects described by the file.
+ *
+ *   The file number given is assumed to be a TELNET stream ie containing
+ *   CRLF at the end of lines which need to be stripped to LF for unix
+ *   when the format is textual.
+ *
+ *  State of socket and target stream on entry:
+ *			socket (file_number) assumed open,
+ *			target (sink) usually NULL (will call stream stack).
+ *
+ *  Return values:
+ *	HT_INTERRUPTED  Interruption or error after some data received.
+ *	-501		Stream stack failed (cannot present or convert).
+ *	-2		Unexpected disconnect before any data received.
+ *	-1		Stream stack failed (cannot present or convert), or
+ *			Interruption or error before any data received, or
+ *			(UNIX) other read error before any data received, or
+ *			download cancelled.
+ *	HT_LOADED	Normal close of socket (end of file indication
+ *			received), or
+ *			unexpected disconnect after some data received, or
+ *			other read error after some data received, or
+ *			(not UNIX) other read error before any data received.
+ *
+ *  State of socket and target stream on return depends on return value:
+ *	HT_INTERRUPTED	socket still open, target aborted.
+ *	-501		socket still open, target stream NULL.
+ *	-2		socket still open, target freed.
+ *	-1		socket still open, target stream aborted or NULL.
+ *	otherwise	socket closed,	target stream freed.
+ */
+int HTParseSocket(HTFormat rep_in,
+		  HTFormat format_out,
+		  HTParentAnchor *anchor,
+		  int file_number,
+		  HTStream *sink)
 {
-    HTStream * stream;
+    HTStream *stream;
     HTStreamClass targetClass;
     int rv;
 
@@ -1220,63 +1220,63 @@ int HTParseSocket (
 
     if (!stream) {
 	char *buffer = 0;
+
 	if (LYCancelDownload) {
 	    LYCancelDownload = FALSE;
 	    return -1;
 	}
 	HTSprintf0(&buffer, CANNOT_CONVERT_I_TO_O,
-		HTAtom_name(rep_in), HTAtom_name(format_out));
+		   HTAtom_name(rep_in), HTAtom_name(format_out));
 	CTRACE((tfp, "HTFormat: %s\n", buffer));
-	rv = HTLoadError(sink, 501, buffer); /* returns -501 */
+	rv = HTLoadError(sink, 501, buffer);	/* returns -501 */
 	FREE(buffer);
     } else {
 	/*
-	** Push the data, don't worry about CRLF we can strip them later.
-	*/
+	 * Push the data, don't worry about CRLF we can strip them later.
+	 */
 	targetClass = *(stream->isa);	/* Copy pointers to procedures */
 	rv = HTCopy(anchor, file_number, NULL, stream);
 	if (rv != -1 && rv != HT_INTERRUPTED)
-	    (*targetClass._free)(stream);
+	    (*targetClass._free) (stream);
     }
     return rv;
     /* Originally:  full: HT_LOADED;  partial: HT_INTERRUPTED;  no bytes: -1 */
 }
 
 /*	Parse a file given format and file pointer
-**
-**   This routine is responsible for creating and PRESENTING any
-**   graphic (or other) objects described by the file.
-**
-**   The file number given is assumed to be a TELNET stream ie containing
-**   CRLF at the end of lines which need to be stripped to \n for unix
-**   when the format is textual.
-**
-**  State of file and target stream on entry:
-**			FILE* (fp) assumed open,
-**			target (sink) usually NULL (will call stream stack).
-**
-**  Return values:
-**	-501		Stream stack failed (cannot present or convert).
-**	-1		Download cancelled.
-**	HT_NO_DATA	Error before any data read.
-**	HT_PARTIAL_CONTENT	Interruption or error after some data read.
-**	HT_LOADED	Normal end of file indication on reading.
-**
-**  State of file and target stream on return:
-**	always		fp still open; target freed, aborted, or NULL.
-*/
-int HTParseFile (
-	HTFormat		rep_in,
-	HTFormat		format_out,
-	HTParentAnchor *	anchor,
-	FILE *			fp,
-	HTStream*		sink)
+ *
+ *   This routine is responsible for creating and PRESENTING any
+ *   graphic (or other) objects described by the file.
+ *
+ *   The file number given is assumed to be a TELNET stream ie containing
+ *   CRLF at the end of lines which need to be stripped to \n for unix
+ *   when the format is textual.
+ *
+ *  State of file and target stream on entry:
+ *			FILE* (fp) assumed open,
+ *			target (sink) usually NULL (will call stream stack).
+ *
+ *  Return values:
+ *	-501		Stream stack failed (cannot present or convert).
+ *	-1		Download cancelled.
+ *	HT_NO_DATA	Error before any data read.
+ *	HT_PARTIAL_CONTENT	Interruption or error after some data read.
+ *	HT_LOADED	Normal end of file indication on reading.
+ *
+ *  State of file and target stream on return:
+ *	always		fp still open; target freed, aborted, or NULL.
+ */
+int HTParseFile(HTFormat rep_in,
+		HTFormat format_out,
+		HTParentAnchor *anchor,
+		FILE *fp,
+		HTStream *sink)
 {
-    HTStream * stream;
+    HTStream *stream;
     HTStreamClass targetClass;
     int rv;
 
-#ifdef SH_EX		/* 1998/01/04 (Sun) 16:04:09 */
+#ifdef SH_EX			/* 1998/01/04 (Sun) 16:04:09 */
     if (fp == NULL)
 	return HT_LOADED;
 #endif
@@ -1285,30 +1285,32 @@ int HTParseFile (
 
     if (!stream) {
 	char *buffer = 0;
+
 	if (LYCancelDownload) {
 	    LYCancelDownload = FALSE;
 	    return -1;
 	}
 	HTSprintf0(&buffer, CANNOT_CONVERT_I_TO_O,
-		HTAtom_name(rep_in), HTAtom_name(format_out));
+		   HTAtom_name(rep_in), HTAtom_name(format_out));
 	CTRACE((tfp, "HTFormat(in HTParseFile): %s\n", buffer));
 	rv = HTLoadError(sink, 501, buffer);
 	FREE(buffer);
 	return rv;
     }
 
-    /*	Push the data down the stream
-    **
-    **	@@  Bug:  This decision ought to be made based on "encoding"
-    **	rather than on content-type.  @@@  When we handle encoding.
-    **	The current method smells anyway.
-    */
+    /*
+     * Push the data down the stream
+     *
+     * @@ Bug:  This decision ought to be made based on "encoding" rather than
+     * on content-type.  @@@ When we handle encoding.  The current method
+     * smells anyway.
+     */
     targetClass = *(stream->isa);	/* Copy pointers to procedures */
     rv = HTFileCopy(fp, stream);
     if (rv == -1 || rv == HT_INTERRUPTED) {
-	(*targetClass._abort)(stream, NULL);
+	(*targetClass._abort) (stream, NULL);
     } else {
-	(*targetClass._free)(stream);
+	(*targetClass._free) (stream);
     }
 
     if (rv == -1)
@@ -1321,35 +1323,35 @@ int HTParseFile (
 
 #ifdef USE_SOURCE_CACHE
 /*	Parse a document in memory given format and memory block pointer
-**
-**   This routine is responsible for creating and PRESENTING any
-**   graphic (or other) objects described by the file.
-**
-**  State of memory and target stream on entry:
-**			HTChunk* (chunk) assumed valid,
-**			target (sink) usually NULL (will call stream stack).
-**
-**  Return values:
-**	-501		Stream stack failed (cannot present or convert).
-**	HT_LOADED	All data sent.
-**
-**  State of memory and target stream on return:
-**	always		chunk unchanged; target freed, aborted, or NULL.
-*/
-int HTParseMem (
-	HTFormat		rep_in,
-	HTFormat		format_out,
-	HTParentAnchor *	anchor,
-	HTChunk *		chunk,
-	HTStream *		sink)
+ *
+ *   This routine is responsible for creating and PRESENTING any
+ *   graphic (or other) objects described by the file.
+ *
+ *  State of memory and target stream on entry:
+ *			HTChunk* (chunk) assumed valid,
+ *			target (sink) usually NULL (will call stream stack).
+ *
+ *  Return values:
+ *	-501		Stream stack failed (cannot present or convert).
+ *	HT_LOADED	All data sent.
+ *
+ *  State of memory and target stream on return:
+ *	always		chunk unchanged; target freed, aborted, or NULL.
+ */
+int HTParseMem(HTFormat rep_in,
+	       HTFormat format_out,
+	       HTParentAnchor *anchor,
+	       HTChunk *chunk,
+	       HTStream *sink)
 {
-    HTStream * stream;
+    HTStream *stream;
     HTStreamClass targetClass;
     int rv;
 
     stream = HTStreamStack(rep_in, format_out, sink, anchor);
     if (!stream) {
 	char *buffer = 0;
+
 	HTSprintf0(&buffer, CANNOT_CONVERT_I_TO_O,
 		   HTAtom_name(rep_in), HTAtom_name(format_out));
 	CTRACE((tfp, "HTFormat(in HTParseMem): %s\n", buffer));
@@ -1359,19 +1361,19 @@ int HTParseMem (
     }
 
     /* Push the data down the stream
-    */
+     */
     targetClass = *(stream->isa);
     rv = HTMemCopy(chunk, stream);
-    (*targetClass._free)(stream);
+    (*targetClass._free) (stream);
     return HT_LOADED;
 }
 #endif
 
 #ifdef USE_ZLIB
-static int HTCloseGzFile (
-	gzFile			gzfp)
+static int HTCloseGzFile(gzFile gzfp)
 {
     int gzres;
+
     if (gzfp == NULL)
 	return 0;
     gzres = gzclose(gzfp);
@@ -1382,33 +1384,32 @@ static int HTCloseGzFile (
 	    CTRACE((tfp, "gzclose   : error number %d\n", gzres));
 	}
     }
-    return(gzres);
+    return (gzres);
 }
 
 /*	HTParseGzFile
-**
-**  State of file and target stream on entry:
-**			gzFile (gzfp) assumed open,
-**			target (sink) usually NULL (will call stream stack).
-**
-**  Return values:
-**	-501		Stream stack failed (cannot present or convert).
-**	-1		Download cancelled.
-**	HT_NO_DATA	Error before any data read.
-**	HT_PARTIAL_CONTENT	Interruption or error after some data read.
-**	HT_LOADED	Normal end of file indication on reading.
-**
-**  State of file and target stream on return:
-**	always		gzfp closed; target freed, aborted, or NULL.
-*/
-int HTParseGzFile (
-	HTFormat		rep_in,
-	HTFormat		format_out,
-	HTParentAnchor *	anchor,
-	gzFile			gzfp,
-	HTStream*		sink)
+ *
+ *  State of file and target stream on entry:
+ *			gzFile (gzfp) assumed open,
+ *			target (sink) usually NULL (will call stream stack).
+ *
+ *  Return values:
+ *	-501		Stream stack failed (cannot present or convert).
+ *	-1		Download cancelled.
+ *	HT_NO_DATA	Error before any data read.
+ *	HT_PARTIAL_CONTENT	Interruption or error after some data read.
+ *	HT_LOADED	Normal end of file indication on reading.
+ *
+ *  State of file and target stream on return:
+ *	always		gzfp closed; target freed, aborted, or NULL.
+ */
+int HTParseGzFile(HTFormat rep_in,
+		  HTFormat format_out,
+		  HTParentAnchor *anchor,
+		  gzFile gzfp,
+		  HTStream *sink)
 {
-    HTStream * stream;
+    HTStream *stream;
     HTStreamClass targetClass;
     int rv;
 
@@ -1416,31 +1417,33 @@ int HTParseGzFile (
 
     if (!stream) {
 	char *buffer = 0;
+
 	HTCloseGzFile(gzfp);
 	if (LYCancelDownload) {
 	    LYCancelDownload = FALSE;
 	    return -1;
 	}
 	HTSprintf0(&buffer, CANNOT_CONVERT_I_TO_O,
-		HTAtom_name(rep_in), HTAtom_name(format_out));
+		   HTAtom_name(rep_in), HTAtom_name(format_out));
 	CTRACE((tfp, "HTFormat(in HTParseGzFile): %s\n", buffer));
 	rv = HTLoadError(sink, 501, buffer);
 	FREE(buffer);
 	return rv;
     }
 
-    /*	Push the data down the stream
-    **
-    **	@@  Bug:  This decision ought to be made based on "encoding"
-    **	rather than on content-type.  @@@  When we handle encoding.
-    **	The current method smells anyway.
-    */
+    /*
+     * Push the data down the stream
+     *
+     * @@ Bug:  This decision ought to be made based on "encoding" rather than
+     * on content-type.  @@@ When we handle encoding.  The current method
+     * smells anyway.
+     */
     targetClass = *(stream->isa);	/* Copy pointers to procedures */
     rv = HTGzFileCopy(gzfp, stream);
     if (rv == -1 || rv == HT_INTERRUPTED) {
-	(*targetClass._abort)(stream, NULL);
+	(*targetClass._abort) (stream, NULL);
     } else {
-	(*targetClass._free)(stream);
+	(*targetClass._free) (stream);
     }
 
     HTCloseGzFile(gzfp);
@@ -1454,37 +1457,35 @@ int HTParseGzFile (
 #endif /* USE_ZLIB */
 
 #ifdef USE_BZLIB
-static void HTCloseBzFile (
-	BZFILE *		bzfp)
+static void HTCloseBzFile(BZFILE * bzfp)
 {
     if (bzfp)
 	BZ2_bzclose(bzfp);
 }
 
 /*	HTParseBzFile
-**
-**  State of file and target stream on entry:
-**			bzFile (bzfp) assumed open,
-**			target (sink) usually NULL (will call stream stack).
-**
-**  Return values:
-**	-501		Stream stack failed (cannot present or convert).
-**	-1		Download cancelled.
-**	HT_NO_DATA	Error before any data read.
-**	HT_PARTIAL_CONTENT	Interruption or error after some data read.
-**	HT_LOADED	Normal end of file indication on reading.
-**
-**  State of file and target stream on return:
-**	always		bzfp closed; target freed, aborted, or NULL.
-*/
-int HTParseBzFile (
-	HTFormat		rep_in,
-	HTFormat		format_out,
-	HTParentAnchor *	anchor,
-	BZFILE*		bzfp,
-	HTStream*		sink)
+ *
+ *  State of file and target stream on entry:
+ *			bzFile (bzfp) assumed open,
+ *			target (sink) usually NULL (will call stream stack).
+ *
+ *  Return values:
+ *	-501		Stream stack failed (cannot present or convert).
+ *	-1		Download cancelled.
+ *	HT_NO_DATA	Error before any data read.
+ *	HT_PARTIAL_CONTENT	Interruption or error after some data read.
+ *	HT_LOADED	Normal end of file indication on reading.
+ *
+ *  State of file and target stream on return:
+ *	always		bzfp closed; target freed, aborted, or NULL.
+ */
+int HTParseBzFile(HTFormat rep_in,
+		  HTFormat format_out,
+		  HTParentAnchor *anchor,
+		  BZFILE * bzfp,
+		  HTStream *sink)
 {
-    HTStream * stream;
+    HTStream *stream;
     HTStreamClass targetClass;
     int rv;
 
@@ -1492,31 +1493,33 @@ int HTParseBzFile (
 
     if (!stream) {
 	char *buffer = 0;
+
 	HTCloseBzFile(bzfp);
 	if (LYCancelDownload) {
 	    LYCancelDownload = FALSE;
 	    return -1;
 	}
 	HTSprintf0(&buffer, CANNOT_CONVERT_I_TO_O,
-		HTAtom_name(rep_in), HTAtom_name(format_out));
+		   HTAtom_name(rep_in), HTAtom_name(format_out));
 	CTRACE((tfp, "HTFormat(in HTParseBzFile): %s\n", buffer));
 	rv = HTLoadError(sink, 501, buffer);
 	FREE(buffer);
 	return rv;
     }
 
-    /*	Push the data down the stream
-    **
-    **	@@  Bug:  This decision ought to be made based on "encoding"
-    **	rather than on content-type.  @@@  When we handle encoding.
-    **	The current method smells anyway.
-    */
+    /*
+     * Push the data down the stream
+     *
+     * @@ Bug:  This decision ought to be made based on "encoding" rather than
+     * on content-type.  @@@ When we handle encoding.  The current method
+     * smells anyway.
+     */
     targetClass = *(stream->isa);	/* Copy pointers to procedures */
     rv = HTBzFileCopy(bzfp, stream);
     if (rv == -1 || rv == HT_INTERRUPTED) {
-	(*targetClass._abort)(stream, NULL);
+	(*targetClass._abort) (stream, NULL);
     } else {
-	(*targetClass._free)(stream);
+	(*targetClass._free) (stream);
     }
 
     HTCloseBzFile(bzfp);
@@ -1530,63 +1533,65 @@ int HTParseBzFile (
 #endif /* USE_BZLIB */
 
 /*	Converter stream: Network Telnet to internal character text
-**	-----------------------------------------------------------
-**
-**	The input is assumed to be in ASCII, with lines delimited
-**	by (13,10) pairs, These pairs are converted into (CR,LF)
-**	pairs in the local representation.  The (CR,LF) sequence
-**	when found is changed to a '\n' character, the internal
-**	C representation of a new line.
-*/
+ *	-----------------------------------------------------------
+ *
+ *	The input is assumed to be in ASCII, with lines delimited
+ *	by (13,10) pairs, These pairs are converted into (CR,LF)
+ *	pairs in the local representation.  The (CR,LF) sequence
+ *	when found is changed to a '\n' character, the internal
+ *	C representation of a new line.
+ */
 
-static void NetToText_put_character (HTStream *  me, char  net_char)
+static void NetToText_put_character(HTStream *me, char net_char)
 {
     char c = FROMASCII(net_char);
+
     if (me->had_cr) {
 	if (c == LF) {
 	    me->sink->isa->put_character(me->sink, '\n');	/* Newline */
 	    me->had_cr = NO;
 	    return;
 	} else {
-	    me->sink->isa->put_character(me->sink, CR); /* leftover */
+	    me->sink->isa->put_character(me->sink, CR);		/* leftover */
 	}
     }
     me->had_cr = (BOOL) (c == CR);
     if (!me->had_cr)
-	me->sink->isa->put_character(me->sink, c);		/* normal */
+	me->sink->isa->put_character(me->sink, c);	/* normal */
 }
 
-static void NetToText_put_string (HTStream *  me, const char *  s)
+static void NetToText_put_string(HTStream *me, const char *s)
 {
-    const char * p;
+    const char *p;
 
     for (p = s; *p; p++)
 	NetToText_put_character(me, *p);
 }
 
-static void NetToText_put_block (HTStream * me, const char* s, int l)
+static void NetToText_put_block(HTStream *me, const char *s, int l)
 {
-    const char * p;
+    const char *p;
 
-    for (p = s; p < (s+l); p++)
+    for (p = s; p < (s + l); p++)
 	NetToText_put_character(me, *p);
 }
 
-static void NetToText_free (HTStream *  me)
+static void NetToText_free(HTStream *me)
 {
-    (me->sink->isa->_free)(me->sink);		/* Close rest of pipe */
+    (me->sink->isa->_free) (me->sink);	/* Close rest of pipe */
     FREE(me);
 }
 
-static void NetToText_abort (HTStream *  me, HTError  e)
+static void NetToText_abort(HTStream *me, HTError e)
 {
-    me->sink->isa->_abort(me->sink,e);		/* Abort rest of pipe */
+    me->sink->isa->_abort(me->sink, e);		/* Abort rest of pipe */
     FREE(me);
 }
 
 /*	The class structure
 */
-static HTStreamClass NetToTextClass = {
+static HTStreamClass NetToTextClass =
+{
     "NetToText",
     NetToText_free,
     NetToText_abort,
@@ -1597,9 +1602,9 @@ static HTStreamClass NetToTextClass = {
 
 /*	The creation method
 */
-HTStream * HTNetToText (HTStream *  sink)
+HTStream *HTNetToText(HTStream *sink)
 {
-    HTStream* me = typecalloc(HTStream);
+    HTStream *me = typecalloc(HTStream);
 
     if (me == NULL)
 	outofmem(__FILE__, "NetToText");
@@ -1610,36 +1615,37 @@ HTStream * HTNetToText (HTStream *  sink)
     return me;
 }
 
-static HTStream	HTBaseStreamInstance;		      /* Made static */
+static HTStream HTBaseStreamInstance;	/* Made static */
+
 /*
-**	ERROR STREAM
-**	------------
-**	There is only one error stream shared by anyone who wants a
-**	generic error returned from all stream methods.
-*/
-static void HTErrorStream_put_character (HTStream *  me GCC_UNUSED, char  c GCC_UNUSED)
+ *	ERROR STREAM
+ *	------------
+ *	There is only one error stream shared by anyone who wants a
+ *	generic error returned from all stream methods.
+ */
+static void HTErrorStream_put_character(HTStream *me GCC_UNUSED, char c GCC_UNUSED)
 {
     LYCancelDownload = TRUE;
 }
 
-static void HTErrorStream_put_string (HTStream *  me GCC_UNUSED, const char *  s)
+static void HTErrorStream_put_string(HTStream *me GCC_UNUSED, const char *s)
 {
     if (s && *s)
 	LYCancelDownload = TRUE;
 }
 
-static void HTErrorStream_write (HTStream * me GCC_UNUSED, const char * s, int l)
+static void HTErrorStream_write(HTStream *me GCC_UNUSED, const char *s, int l)
 {
     if (l && s)
 	LYCancelDownload = TRUE;
 }
 
-static void HTErrorStream_free (HTStream *  me GCC_UNUSED)
+static void HTErrorStream_free(HTStream *me GCC_UNUSED)
 {
     return;
 }
 
-static void HTErrorStream_abort (HTStream *  me GCC_UNUSED, HTError  e GCC_UNUSED)
+static void HTErrorStream_abort(HTStream *me GCC_UNUSED, HTError e GCC_UNUSED)
 {
     return;
 }
@@ -1654,9 +1660,9 @@ static const HTStreamClass HTErrorStreamClass =
     HTErrorStream_write
 };
 
-HTStream * HTErrorStream (void)
+HTStream *HTErrorStream(void)
 {
     CTRACE((tfp, "ErrorStream. Created\n"));
-    HTBaseStreamInstance.isa = &HTErrorStreamClass;    /* The rest is random */
+    HTBaseStreamInstance.isa = &HTErrorStreamClass;	/* The rest is random */
     return &HTBaseStreamInstance;
 }
diff --git a/WWW/Library/Implementation/HTFormat.h b/WWW/Library/Implementation/HTFormat.h
index 500ce640..51fb0c23 100644
--- a/WWW/Library/Implementation/HTFormat.h
+++ b/WWW/Library/Implementation/HTFormat.h
@@ -26,44 +26,46 @@ The HTFormat type
    (comparison and copying) that if we stayed with strings.
 
  */
-typedef HTAtom * HTFormat;
+typedef HTAtom *HTFormat;
 
 /*
 
-   These macros (which used to be constants) define some basic internally referenced
-   representations.  The www/xxx ones are of course not MIME standard.
+   These macros (which used to be constants) define some basic internally
+   referenced representations.  The www/xxx ones are of course not MIME
+   standard.
 
-   www/source  is an output format which leaves the input untouched. It is useful for
-   diagnostics, and for users who want to see the original, whatever it is.
+   www/source is an output format which leaves the input untouched.  It is
+   useful for diagnostics, and for users who want to see the original, whatever
+   it is.
 
  */
-                        /* Internal ones */
-/* #define WWW_SOURCE HTAtom_for("www/source") */    /* Whatever it was originally*/
-extern HTAtom * WWW_SOURCE;     /* calculated once, heavy used */
+			/* Internal ones */
+/* #define WWW_SOURCE HTAtom_for("www/source") *//* Whatever it was originally */
+extern HTAtom *WWW_SOURCE;	/* calculated once, heavy used */
 
 /*
 
-   www/present represents the user's perception of the document.  If you convert to
-   www/present, you present the material to the user.
+   www/present represents the user's perception of the document.  If you
+   convert to www/present, you present the material to the user.
 
  */
-#define WWW_PRESENT HTAtom_for("www/present")   /* The user's perception */
+#define WWW_PRESENT HTAtom_for("www/present")	/* The user's perception */
 
 #define WWW_DEBUG       HTAtom_for("www/debug")
 /*
 
-   WWW_DEBUG represents the user's perception of debug information, for example sent as a
-   HTML document in a HTTP redirection message.
+   WWW_DEBUG represents the user's perception of debug information, for example
+   sent as a HTML document in a HTTP redirection message.
 
  */
 
 /*
 
-   The message/rfc822 format means a MIME message or a plain text message with no MIME
-   header.  This is what is returned by an HTTP server.
+   The message/rfc822 format means a MIME message or a plain text message with
+   no MIME header.  This is what is returned by an HTTP server.
 
  */
-#define WWW_MIME HTAtom_for("www/mime")         /* A MIME message */
+#define WWW_MIME HTAtom_for("www/mime")		/* A MIME message */
 
 /*
   For parsing only the header. - kw
@@ -75,7 +77,7 @@ extern HTAtom * WWW_SOURCE;     /* calculated once, heavy used */
    www/print is like www/present except it represents a printed copy.
 
  */
-#define WWW_PRINT HTAtom_for("www/print")       /* A printed copy */
+#define WWW_PRINT HTAtom_for("www/print")	/* A printed copy */
 
 /*
 
@@ -93,9 +95,9 @@ extern HTAtom * WWW_SOURCE;     /* calculated once, heavy used */
 
 /*
 
-   These are regular MIME types.  HTML is assumed to be added by the W3 code.
-   application/octet-stream was mistakenly application/binary in earlier libwww versions
-   (pre 2.11).
+   These are regular MIME types.  HTML is assumed to be added by the W3 code. 
+   application/octet-stream was mistakenly application/binary in earlier libwww
+   versions (pre 2.11).
 
  */
 #define WWW_PLAINTEXT   HTAtom_for("text/plain")
@@ -107,13 +109,13 @@ extern HTAtom * WWW_SOURCE;     /* calculated once, heavy used */
 
 /*
 
-   We must include the following file after defining HTFormat, to which it makes
-   reference.
+   We must include the following file after defining HTFormat, to which it
+   makes reference.
 
 The HTEncoding type
 
  */
-typedef HTAtom* HTEncoding;
+typedef HTAtom *HTEncoding;
 
 /*
 
@@ -143,53 +145,51 @@ typedef HTAtom* HTEncoding;
         ((enc)==NULL || (enc)==HTAtom_for("identity") ||\
         (enc)==WWW_ENC_8BIT || (enc)==WWW_ENC_BINARY || (enc)==WWW_ENC_7BIT)
 
-
 #include <HTAnchor.h>
 
 /*
 
 The HTPresentation and HTConverter types
 
-   This HTPresentation structure represents a possible conversion algorithm from one
-   format to another.  It includes a pointer to a conversion routine.  The conversion
-   routine returns a stream to which data should be fed. See also HTStreamStack which
-   scans the list of registered converters and calls one.  See the initialisation module
-   for a list of conversion routines.
+   This HTPresentation structure represents a possible conversion algorithm
+   from one format to another.  It includes a pointer to a conversion routine. 
+   The conversion routine returns a stream to which data should be fed.  See
+   also HTStreamStack which scans the list of registered converters and calls
+   one.  See the initialisation module for a list of conversion routines.
 
  */
 typedef struct _HTPresentation HTPresentation;
 
-typedef HTStream * HTConverter (
-        HTPresentation *        pres,
-        HTParentAnchor *        anchor,
-        HTStream *              sink);
+typedef HTStream *HTConverter (HTPresentation *pres,
+			       HTParentAnchor *anchor,
+			       HTStream *sink);
 
 struct _HTPresentation {
-        HTAtom	*	rep;            /* representation name atomized */
-        HTAtom	*	rep_out;        /* resulting representation */
-        HTConverter *	converter;	/* routine to gen the stream stack */
-        char *		command;        /* MIME-format string */
-        float		quality;        /* Between 0 (bad) and 1 (good) */
-        float		secs;
-        float		secs_per_byte;
-	long int	maxbytes;
-	BOOL		get_accept;	/* list in "Accept:" for GET */
+    HTAtom *rep;		/* representation name atomized */
+    HTAtom *rep_out;		/* resulting representation */
+    HTConverter *converter;	/* routine to gen the stream stack */
+    char *command;		/* MIME-format string */
+    float quality;		/* Between 0 (bad) and 1 (good) */
+    float secs;
+    float secs_per_byte;
+    long int maxbytes;
+    BOOL get_accept;		/* list in "Accept:" for GET */
 };
 
 /*
 
-   The list of presentations is kept by this module.  It is also scanned by modules which
-   want to know the set of formats supported. for example.
+   The list of presentations is kept by this module.  It is also scanned by
+   modules which want to know the set of formats supported.  for example.
 
  */
-extern HTList * HTPresentations;
+extern HTList *HTPresentations;
 
 /*
 
    The default presentation is used when no other is appropriate
 
  */
-extern  HTPresentation* default_presentation;
+extern HTPresentation *default_presentation;
 
 /*
 
@@ -209,16 +209,14 @@ HTSetPresentation: Register a system command to present a format
   maxbytes                A limit on the length acceptable as input (0 infinite)
 
  */
-extern void HTSetPresentation (
-        const char *	representation,
-        const char *	command,
-        double		quality,
-        double		secs,
-        double		secs_per_byte,
-	long int	maxbytes
+extern void HTSetPresentation(const char *representation,
+			      const char *command,
+			      double quality,
+			      double secs,
+			      double secs_per_byte,
+			      long int maxbytes
 );
 
-
 /*
 
 HTSetConversion:   Register a converstion routine
@@ -233,51 +231,47 @@ HTSetConversion:   Register a converstion routine
 
  */
 
-extern void HTSetConversion (
-        const char *    rep_in,
-        const char *    rep_out,
-        HTConverter *   converter,
-        float           quality,
-        float           secs,
-        float           secs_per_byte,
-	long int	maxbytes
+extern void HTSetConversion(const char *rep_in,
+			    const char *rep_out,
+			    HTConverter *converter,
+			    float quality,
+			    float secs,
+			    float secs_per_byte,
+			    long int maxbytes
 );
 
-
 /*
 
 HTStreamStack:   Create a stack of streams
 
-   This is the routine which actually sets up the conversion.  It currently checks only for
-   direct conversions, but multi-stage conversions are forseen.  It takes a stream into
-   which the output should be sent in the final format, builds the conversion stack, and
-   returns a stream into which the data in the input format should be fed.  The anchor is
-   passed because hypertxet objects load information into the anchor object which
-   represents them.
+   This is the routine which actually sets up the conversion.  It currently
+   checks only for direct conversions, but multi-stage conversions are forseen. 
+   It takes a stream into which the output should be sent in the final format,
+   builds the conversion stack, and returns a stream into which the data in the
+   input format should be fed.  The anchor is passed because hypertxet objects
+   load information into the anchor object which represents them.
 
  */
-extern HTStream * HTStreamStack (
-        HTFormat                format_in,
-        HTFormat                format_out,
-        HTStream*               stream_out,
-        HTParentAnchor*         anchor);
+extern HTStream *HTStreamStack(HTFormat format_in,
+			       HTFormat format_out,
+			       HTStream *stream_out,
+			       HTParentAnchor *anchor);
 
 /*
 HTReorderPresentation: put presentation near head of list
 
-    Look up a presentation (exact match only) and, if found, reorder
-    it to the start of the HTPresentations list. - kw
+    Look up a presentation (exact match only) and, if found, reorder it to the
+    start of the HTPresentations list.  - kw
     */
 
-extern void HTReorderPresentation (
-        HTFormat                format_in,
-        HTFormat                format_out);
+extern void HTReorderPresentation(HTFormat format_in,
+				  HTFormat format_out);
 
 /*
  * Setup 'get_accept' flag to denote presentations that are not redundant,
  * and will be listed in "Accept:" header.
  */
-extern void HTFilterPresentations (void);
+extern void HTFilterPresentations(void);
 
 /*
 
@@ -297,52 +291,48 @@ HTStackValue: Find the cost of a filter stack
   length                  The number of bytes expected in the input format
 
  */
-extern float HTStackValue (
-        HTFormat                format_in,
-        HTFormat                rep_out,
-        float                   initial_value,
-        long int                length);
+extern float HTStackValue(HTFormat format_in,
+			  HTFormat rep_out,
+			  float initial_value,
+			  long int length);
 
 #define NO_VALUE_FOUND  -1e20	/* returned if none found */
 
 /*	Display the page while transfer in progress
-**	-------------------------------------------
-**
-**   Repaint the page only when necessary.
-**   This is a traverse call for HText_pageDispaly() - it works!.
-**
-*/
-extern void HTDisplayPartial (void);
+ *	-------------------------------------------
+ *
+ *   Repaint the page only when necessary.
+ *   This is a traverse call for HText_pageDispaly() - it works!.
+ *
+ */
+extern void HTDisplayPartial(void);
 
-extern void HTFinishDisplayPartial (void);
+extern void HTFinishDisplayPartial(void);
 
 /*
 
 HTCopy:  Copy a socket to a stream
 
-   This is used by the protocol engines to send data down a stream, typically one which
-   has been generated by HTStreamStack.
+   This is used by the protocol engines to send data down a stream, typically
+   one which has been generated by HTStreamStack.
 
  */
-extern int HTCopy (
-	HTParentAnchor *	anchor,
-        int                     file_number,
-	void*			handle,
-        HTStream*               sink);
-
+extern int HTCopy(HTParentAnchor *anchor,
+		  int file_number,
+		  void *handle,
+		  HTStream *sink);
 
 /*
 
 HTFileCopy:  Copy a file to a stream
 
-   This is used by the protocol engines to send data down a stream, typically one which
-   has been generated by HTStreamStack.  It is currently called by HTParseFile
+   This is used by the protocol engines to send data down a stream, typically
+   one which has been generated by HTStreamStack.  It is currently called by
+   HTParseFile
 
  */
-extern int HTFileCopy (
-        FILE*                   fp,
-        HTStream*               sink);
-
+extern int HTFileCopy(FILE *fp,
+		      HTStream *sink);
 
 #ifdef USE_SOURCE_CACHE
 #include <HTChunk.h>
@@ -350,16 +340,15 @@ extern int HTFileCopy (
 
 HTMemCopy:  Copy a memory chunk to a stream
 
-   This is used by the protocol engines to send data down a stream, typically one which
-   has been generated by HTStreamStack.  It is currently called by HTParseMem
+   This is used by the protocol engines to send data down a stream, typically
+   one which has been generated by HTStreamStack.  It is currently called by
+   HTParseMem
 
  */
-extern int HTMemCopy (
-	HTChunk *		chunk,
-	HTStream*		sink);
+extern int HTMemCopy(HTChunk *chunk,
+		     HTStream *sink);
 #endif
 
-
 /*
 
 HTCopyNoCR: Copy a socket to a stream, stripping CR characters.
@@ -368,22 +357,21 @@ HTCopyNoCR: Copy a socket to a stream, stripping CR characters.
 
  */
 
-extern void HTCopyNoCR (
-	HTParentAnchor *	anchor,
-        int                     file_number,
-        HTStream*               sink);
-
+extern void HTCopyNoCR(HTParentAnchor *anchor,
+		       int file_number,
+		       HTStream *sink);
 
 /*
 
 Clear input buffer and set file number
 
-   This routine and the one below provide simple character input from sockets. (They are
-   left over from the older architecure and may not be used very much.)  The existence of
-   a common routine and buffer saves memory space in small implementations.
+   This routine and the one below provide simple character input from sockets. 
+   (They are left over from the older architecture and may not be used very
+   much.) The existence of a common routine and buffer saves memory space in
+   small implementations.
 
  */
-extern void HTInitInput (int file_number);
+extern void HTInitInput(int file_number);
 
 /*
 
@@ -391,23 +379,22 @@ Get next character from buffer
 
  */
 extern int interrupted_in_htgetcharacter;
-extern int HTGetCharacter (void);
-
+extern int HTGetCharacter(void);
 
 /*
 
 HTParseSocket: Parse a socket given its format
 
-   This routine is called by protocol modules to load an object.  uses HTStreamStack and
-   the copy routines above.  Returns HT_LOADED if succesful, <0 if not.
+   This routine is called by protocol modules to load an object.  uses
+   HTStreamStack and the copy routines above.  Returns HT_LOADED if successful,
+   <0 if not.
 
  */
-extern int HTParseSocket (
-        HTFormat        format_in,
-        HTFormat        format_out,
-        HTParentAnchor  *anchor,
-        int             file_number,
-        HTStream*       sink);
+extern int HTParseSocket(HTFormat format_in,
+			 HTFormat format_out,
+			 HTParentAnchor *anchor,
+			 int file_number,
+			 HTStream *sink);
 
 /*
 
@@ -418,12 +405,11 @@ HTParseFile: Parse a File through a file pointer
    return HT_PARTIAL_CONTENT, HT_NO_DATA, or other <0 for failure.
 
  */
-extern int HTParseFile (
-        HTFormat        format_in,
-        HTFormat        format_out,
-        HTParentAnchor  *anchor,
-        FILE            *fp,
-        HTStream*       sink);
+extern int HTParseFile(HTFormat format_in,
+		       HTFormat format_out,
+		       HTParentAnchor *anchor,
+		       FILE *fp,
+		       HTStream *sink);
 
 #ifdef USE_SOURCE_CACHE
 /*
@@ -435,12 +421,11 @@ HTParseMem: Parse a document in memory
    return <0 for failure.
 
  */
-extern int HTParseMem (
-	HTFormat	format_in,
-	HTFormat	format_out,
-	HTParentAnchor	*anchor,
-	HTChunk*	chunk,
-	HTStream*	sink);
+extern int HTParseMem(HTFormat format_in,
+		      HTFormat format_out,
+		      HTParentAnchor *anchor,
+		      HTChunk *chunk,
+		      HTStream *sink);
 #endif
 
 #ifdef USE_ZLIB
@@ -452,12 +437,11 @@ HTParseGzFile: Parse a gzip'ed File through a file pointer
    HTStreamStack and HTGzFileCopy.  Returns HT_LOADED if successful, can also
    return HT_PARTIAL_CONTENT, HT_NO_DATA, or other <0 for failure.
  */
-extern int HTParseGzFile (
-        HTFormat        format_in,
-        HTFormat        format_out,
-        HTParentAnchor  *anchor,
-        gzFile          gzfp,
-        HTStream*       sink);
+extern int HTParseGzFile(HTFormat format_in,
+			 HTFormat format_out,
+			 HTParentAnchor *anchor,
+			 gzFile gzfp,
+			 HTStream *sink);
 
 #endif /* USE_ZLIB */
 
@@ -470,12 +454,11 @@ HTParseBzFile: Parse a bzip2'ed File through a file pointer
    HTStreamStack and HTGzFileCopy.  Returns HT_LOADED if successful, can also
    return HT_PARTIAL_CONTENT, HT_NO_DATA, or other <0 for failure.
  */
-extern int HTParseBzFile (
-        HTFormat        format_in,
-        HTFormat        format_out,
-        HTParentAnchor  *anchor,
-        BZFILE          *bzfp,
-        HTStream*       sink);
+extern int HTParseBzFile(HTFormat format_in,
+			 HTFormat format_out,
+			 HTParentAnchor *anchor,
+			 BZFILE * bzfp,
+			 HTStream *sink);
 
 #endif /* USE_BZLIB */
 
@@ -483,31 +466,33 @@ extern int HTParseBzFile (
 
 HTNetToText: Convert Net ASCII to local representation
 
-   This is a filter stream suitable for taking text from a socket and passing it into a
-   stream which expects text in the local C representation.  It does ASCII and newline
-   conversion.  As usual, pass its output stream to it when creating it.
+   This is a filter stream suitable for taking text from a socket and passing
+   it into a stream which expects text in the local C representation.  It does
+   ASCII and newline conversion.  As usual, pass its output stream to it when
+   creating it.
 
  */
-extern HTStream *  HTNetToText (HTStream * sink);
+extern HTStream *HTNetToText(HTStream *sink);
 
 /*
 
 HTFormatInit: Set up default presentations and conversions
 
-   These are defined in HTInit.c or HTSInit.c if these have been replaced. If you don't
-   call this routine, and you don't define any presentations, then this routine will
-   automatically be called the first time a conversion is needed. However, if you
-   explicitly add some conversions (eg using HTLoadRules) then you may want also to
-   explicitly call this to get the defaults as well.
+   These are defined in HTInit.c or HTSInit.c if these have been replaced.  If
+   you don't call this routine, and you don't define any presentations, then
+   this routine will automatically be called the first time a conversion is
+   needed.  However, if you explicitly add some conversions (eg using
+   HTLoadRules) then you may want also to explicitly call this to get the
+   defaults as well.
 
  */
-extern void HTFormatInit (void);
+extern void HTFormatInit(void);
 
 /*
 
 Epilogue
 
  */
-extern BOOL HTOutputSource;     /* Flag: shortcut parser */
+extern BOOL HTOutputSource;	/* Flag: shortcut parser */
 
 #endif /* HTFORMAT_H */
diff --git a/WWW/Library/Implementation/HTGopher.c b/WWW/Library/Implementation/HTGopher.c
index d0aafb61..9489e7c2 100644
--- a/WWW/Library/Implementation/HTGopher.c
+++ b/WWW/Library/Implementation/HTGopher.c
@@ -1,19 +1,19 @@
 /*			GOPHER ACCESS				HTGopher.c
-**			=============
-**
-**  History:
-**	26 Sep 90	Adapted from other accesses (News, HTTP) TBL
-**	29 Nov 91	Downgraded to C, for portable implementation.
-**	10 Mar 96	Foteos Macrides (macrides@sci.wfbr.edu).  Added a
-**			  form-based CSO/PH gateway.  Can be invoked via a
-**			  "cso://host[:port]/" or "gopher://host:105/2"
-**			  URL.	If a gopher URL is used with a query token
-**			  ('?'), the old ISINDEX procedure will be used
-**			  instead of the form-based gateway.
-**	15 Mar 96	Foteos Macrides (macrides@sci.wfbr.edu).  Pass
-**			  port 79, gtype 0 gopher URLs to the finger
-**			  gateway.
-*/
+ *			=============
+ *
+ *  History:
+ *	26 Sep 90	Adapted from other accesses (News, HTTP) TBL
+ *	29 Nov 91	Downgraded to C, for portable implementation.
+ *	10 Mar 96	Foteos Macrides (macrides@sci.wfbr.edu).  Added a
+ *			  form-based CSO/PH gateway.  Can be invoked via a
+ *			  "cso://host[:port]/" or "gopher://host:105/2"
+ *			  URL.	If a gopher URL is used with a query token
+ *			  ('?'), the old ISINDEX procedure will be used
+ *			  instead of the form-based gateway.
+ *	15 Mar 96	Foteos Macrides (macrides@sci.wfbr.edu).  Pass
+ *			  port 79, gtype 0 gopher URLs to the finger
+ *			  gateway.
+ */
 
 #include <HTUtils.h>		/* Coding convention macros */
 
@@ -24,8 +24,8 @@
 #include <HTFinger.h>
 
 /*
-**  Implements.
-*/
+ *  Implements.
+ */
 #include <HTGopher.h>
 
 #define GOPHER_PORT 70		/* See protocol spec */
@@ -34,8 +34,8 @@
 #define LINE_LENGTH 256		/* Bug */
 
 /*
-**  Gopher entity types.
-*/
+ *  Gopher entity types.
+ */
 #define GOPHER_TEXT		'0'
 #define GOPHER_MENU		'1'
 #define GOPHER_CSO		'2'
@@ -47,15 +47,15 @@
 #define GOPHER_TELNET		'8'
 #define GOPHER_BINARY		'9'
 #define GOPHER_GIF		'g'
-#define GOPHER_HTML		'h'		/* HTML */
-#define GOPHER_CHTML		'H'		/* HTML */
+#define GOPHER_HTML		'h'	/* HTML */
+#define GOPHER_CHTML		'H'	/* HTML */
 #define GOPHER_SOUND		's'
-#define GOPHER_WWW		'w'		/* W3 address */
+#define GOPHER_WWW		'w'	/* W3 address */
 #define GOPHER_IMAGE		'I'
 #define GOPHER_TN3270		'T'
 #define GOPHER_INFO		'i'
 #define GOPHER_DUPLICATE	'+'
-#define GOPHER_PLUS_IMAGE	':'		/* Addition from Gopher Plus */
+#define GOPHER_PLUS_IMAGE	':'	/* Addition from Gopher Plus */
 #define GOPHER_PLUS_MOVIE	';'
 #define GOPHER_PLUS_SOUND	'<'
 #define GOPHER_PLUS_PDF		'P'
@@ -63,8 +63,8 @@
 #include <HTFormat.h>
 
 /*
-**  Hypertext object building machinery.
-*/
+ *  Hypertext object building machinery.
+ */
 #include <HTML.h>
 
 #include <LYStrings.h>
@@ -82,131 +82,130 @@
 #define NEXT_CHAR HTGetCharacter()
 
 /*
-**  Module-wide variables.
-*/
-static int s;				/* Socket for gopher or CSO host */
+ *  Module-wide variables.
+ */
+static int s;			/* Socket for gopher or CSO host */
 
 struct _HTStructured {
-	const HTStructuredClass * isa;	/* For gopher streams */
-	/* ... */
+    const HTStructuredClass *isa;	/* For gopher streams */
+    /* ... */
 };
 
-static HTStructured *target;		/* the new gopher hypertext */
+static HTStructured *target;	/* the new gopher hypertext */
 static HTStructuredClass targetClass;	/* Its action routines */
 
-struct _HTStream
-{
-  HTStreamClass * isa;			/* For form-based CSO  gateway - FM */
+struct _HTStream {
+    HTStreamClass *isa;		/* For form-based CSO  gateway - FM */
 };
 
-typedef struct _CSOfield_info {		/* For form-based CSO gateway - FM */
-    struct _CSOfield_info *	next;
-    char *			name;
-    char *			attributes;
-    char *			description;
-    int				id;
-    int				lookup;
-    int				indexed;
-    int				url;
-    int				max_size;
-    int				defreturn;
-    int				explicit_return;
-    int				reserved;
-    int				public;
-    char			name_buf[16];	/* Avoid malloc if we can */
-    char			desc_buf[32];	/* Avoid malloc if we can */
-    char			attr_buf[80];	/* Avoid malloc if we can */
+typedef struct _CSOfield_info {	/* For form-based CSO gateway - FM */
+    struct _CSOfield_info *next;
+    char *name;
+    char *attributes;
+    char *description;
+    int id;
+    int lookup;
+    int indexed;
+    int url;
+    int max_size;
+    int defreturn;
+    int explicit_return;
+    int reserved;
+    int public;
+    char name_buf[16];		/* Avoid malloc if we can */
+    char desc_buf[32];		/* Avoid malloc if we can */
+    char attr_buf[80];		/* Avoid malloc if we can */
 } CSOfield_info;
 
-static CSOfield_info *CSOfields = NULL; /* For form-based CSO gateway - FM */
-
-typedef struct _CSOformgen_context {	 /* For form-based CSO gateway - FM */
-    char *		host;
-    char *		seek;
-    CSOfield_info *	fld;
-    int			port;
-    int			cur_line;
-    int			cur_off;
-    int			rep_line;
-    int			rep_off;
-    int			public_override;
-    int			field_select;
+static CSOfield_info *CSOfields = NULL;		/* For form-based CSO gateway - FM */
+
+typedef struct _CSOformgen_context {	/* For form-based CSO gateway - FM */
+    char *host;
+    char *seek;
+    CSOfield_info *fld;
+    int port;
+    int cur_line;
+    int cur_off;
+    int rep_line;
+    int rep_off;
+    int public_override;
+    int field_select;
 } CSOformgen_context;
 
 /*	Matrix of allowed characters in filenames
-**	=========================================
-*/
+ *	=========================================
+ */
 static BOOL acceptable[256];
 static BOOL acceptable_inited = NO;
 
-static void init_acceptable (void)
+static void init_acceptable(void)
 {
     unsigned int i;
-    char * good =
-      "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789./-_$";
-    for(i = 0; i < 256; i++)
+    char *good =
+    "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789./-_$";
+
+    for (i = 0; i < 256; i++)
 	acceptable[i] = NO;
-    for(; *good; good++)
-	acceptable[(unsigned int)*good] = YES;
+    for (; *good; good++)
+	acceptable[(unsigned int) *good] = YES;
     acceptable_inited = YES;
 }
 
 /*	Decode one hex character
-**	========================
-*/
+ *	========================
+ */
 static const char hex[17] = "0123456789abcdef";
 
-static char from_hex (char  c)
+static char from_hex(char c)
 {
-    return (char) (       (c>='0')&&(c<='9') ? c-'0'
-			: (c>='A')&&(c<='F') ? c-'A'+10
-			: (c>='a')&&(c<='f') ? c-'a'+10
-			:		       0);
+    return (char) ((c >= '0') && (c <= '9') ? c - '0'
+		   : (c >= 'A') && (c <= 'F') ? c - 'A' + 10
+		   : (c >= 'a') && (c <= 'f') ? c - 'a' + 10
+		   : 0);
 }
 
 /*	Paste in an Anchor
-**	==================
-**
-**	The title of the destination is set, as there is no way
-**	of knowing what the title is when we arrive.
-**
-** On entry,
-**	HT	is in append mode.
-**	text	points to the text to be put into the file, 0 terminated.
-**	addr	points to the hypertext refernce address 0 terminated.
-*/
-BOOLEAN HT_Is_Gopher_URL=FALSE;
-
-static void write_anchor (const char * text, const char * addr)
+ *	==================
+ *
+ *	The title of the destination is set, as there is no way
+ *	of knowing what the title is when we arrive.
+ *
+ * On entry,
+ *	HT	is in append mode.
+ *	text	points to the text to be put into the file, 0 terminated.
+ *	addr	points to the hypertext refernce address 0 terminated.
+ */
+BOOLEAN HT_Is_Gopher_URL = FALSE;
+
+static void write_anchor(const char *text, const char *addr)
 {
     BOOL present[HTML_A_ATTRIBUTES];
-    const char * value[HTML_A_ATTRIBUTES];
+    const char *value[HTML_A_ATTRIBUTES];
 
     int i;
 
     for (i = 0; i < HTML_A_ATTRIBUTES; i++)
 	present[i] = 0;
     present[HTML_A_HREF] = YES;
-    ((const char **)value)[HTML_A_HREF] = addr;
+    ((const char **) value)[HTML_A_HREF] = addr;
     present[HTML_A_TITLE] = YES;
-    ((const char **)value)[HTML_A_TITLE] = text;
+    ((const char **) value)[HTML_A_TITLE] = text;
 
-    CTRACE((tfp,"HTGopher: adding URL: %s\n",addr));
+    CTRACE((tfp, "HTGopher: adding URL: %s\n", addr));
 
-    HT_Is_Gopher_URL = TRUE;  /* tell HTML.c that this is a Gopher URL */
-    (*targetClass.start_element)(target, HTML_A, present,
-				 (const char **)value, -1, 0);
+    HT_Is_Gopher_URL = TRUE;	/* tell HTML.c that this is a Gopher URL */
+    (*targetClass.start_element) (target, HTML_A, present,
+				  (const char **) value, -1, 0);
 
     PUTS(text);
     END(HTML_A);
 }
 
 /*	Parse a Gopher Menu document
-**	============================
-*/
-static void parse_menu (
-	const char *		arg GCC_UNUSED,
-	HTParentAnchor *	anAnchor)
+ *	============================
+ */
+static void parse_menu(const char *arg GCC_UNUSED,
+		       HTParentAnchor *anAnchor)
 {
     char gtype;
     int ich;
@@ -223,7 +222,6 @@ static void parse_menu (
 #define TAB		'\t'
 #define HEX_ESCAPE	'%'
 
-
     START(HTML_HTML);
     PUTC('\n');
     START(HTML_HEAD);
@@ -248,20 +246,22 @@ static void parse_menu (
     END(HTML_H1);
     PUTC('\n');
     START(HTML_PRE);
-    while ((ich=NEXT_CHAR) != EOF) {
+    while ((ich = NEXT_CHAR) != EOF) {
 
 	if (interrupted_in_htgetcharacter) {
-	    CTRACE((tfp, "HTGopher: Interrupted in HTGetCharacter, apparently.\n"));
+	    CTRACE((tfp,
+		    "HTGopher: Interrupted in HTGetCharacter, apparently.\n"));
 	    goto end_html;
 	}
 
-	if ((char)ich != LF) {
-	    *p = (char) ich;    /* Put character in line */
-	    if (p< &line[BIG-1]) p++;
+	if ((char) ich != LF) {
+	    *p = (char) ich;	/* Put character in line */
+	    if (p < &line[BIG - 1])
+		p++;
 
 	} else {
 	    *p++ = '\0';	/* Terminate line */
-	    bytes += p-line;	/* add size */
+	    bytes += p - line;	/* add size */
 	    p = line;		/* Scan it to parse it */
 	    port = 0;		/* Flag "not parsed" */
 	    CTRACE((tfp, "HTGopher: Menu item: %s\n", line));
@@ -274,14 +274,14 @@ static void parse_menu (
 	    }
 
 	    /* Break on line with a dot by itself */
-	    if ((gtype=='.') && ((*p=='\r') || (*p==0)))
+	    if ((gtype == '.') && ((*p == '\r') || (*p == 0)))
 		break;
 
 	    if (gtype && *p) {
 		name = p;
 		selector = strchr(name, TAB);
 		if (selector) {
-		    *selector++ = '\0'; /* Terminate name */
+		    *selector++ = '\0';		/* Terminate name */
 		    /*
 		     * Gopher+ Type=0+ objects can be binary, and will
 		     * have 9 or 5 beginning their selector.  Make sure
@@ -293,23 +293,26 @@ static void parse_menu (
 			gtype = *selector;
 		    host = strchr(selector, TAB);
 		    if (host) {
-			*host++ = '\0'; /* Terminate selector */
+			*host++ = '\0';		/* Terminate selector */
 			port = strchr(host, TAB);
 			if (port) {
 			    char *junk;
+
 			    port[0] = ':';	/* delimit host a la W3 */
 			    junk = strchr(port, TAB);
-			    if (junk) *junk++ = '\0';	/* Chop port */
-			    if ((port[1]=='0') && (!port[2]))
-				port[0] = '\0'; /* 0 means none */
-			} /* no port */
-		    } /* host ok */
-		} /* selector ok */
-	    } /* gtype and name ok */
-
+			    if (junk)
+				*junk++ = '\0';		/* Chop port */
+			    if ((port[1] == '0') && (!port[2]))
+				port[0] = '\0';		/* 0 means none */
+			}	/* no port */
+		    }		/* host ok */
+		}		/* selector ok */
+	    }
+	    /* gtype and name ok */
 	    /* Nameless files are a separator line */
 	    if (gtype == GOPHER_TEXT) {
-		int i = strlen(name)-1;
+		int i = strlen(name) - 1;
+
 		while (name[i] == ' ' && i >= 0)
 		    name[i--] = '\0';
 		if (i < 0)
@@ -321,112 +324,109 @@ static void parse_menu (
 		write_anchor(name, selector);
 
 	    } else if (gtype == GOPHER_INFO) {
-	    /* Information or separator line */
+		/* Information or separator line */
 		PUTS("       ");
 		PUTS(name);
 
-	    } else if (port) {		/* Other types need port */
+	    } else if (port) {	/* Other types need port */
 		char *address = 0;
 		char *format = *selector ? "%s//%s@%s/" : "%s//%s/";
 
 		if (gtype == GOPHER_TELNET) {
 		    PUTS(" (TEL) ");
 		    HTSprintf0(&address, format, STR_TELNET_URL, selector, host);
-		}
-		else if (gtype == GOPHER_TN3270)
-		{
+		} else if (gtype == GOPHER_TN3270) {
 		    PUTS("(3270) ");
 		    HTSprintf0(&address, format, STR_TN3270_URL, selector, host);
-		}
-		else {			/* If parsed ok */
+		} else {	/* If parsed ok */
 		    char *r;
 
-		    switch(gtype) {
-			case GOPHER_TEXT:
-			    PUTS("(FILE) ");
-			    break;
-			case GOPHER_MENU:
-			    PUTS(" (DIR) ");
-			    break;
-			case GOPHER_CSO:
-			    PUTS(" (CSO) ");
-			    break;
-			case GOPHER_PCBINARY:
-			    PUTS(" (BIN) ");
-			    break;
-			case GOPHER_UUENCODED:
-			    PUTS(" (UUE) ");
-			    break;
-			case GOPHER_INDEX:
-			    PUTS("  (?)  ");
-			    break;
-			case GOPHER_BINARY:
-			    PUTS(" (BIN) ");
-			    break;
-			case GOPHER_GIF:
-			case GOPHER_IMAGE:
-			case GOPHER_PLUS_IMAGE:
-			    PUTS(" (IMG) ");
-			    break;
-			case GOPHER_SOUND:
-			case GOPHER_PLUS_SOUND:
-			    PUTS(" (SND) ");
-			    break;
-			case GOPHER_MACBINHEX:
-			    PUTS(" (HQX) ");
-			    break;
-			case GOPHER_HTML:
-			case GOPHER_CHTML:
-			    PUTS("(HTML) ");
-			    break;
-			case 'm':
-			    PUTS("(MIME) ");
-			    break;
-			case GOPHER_PLUS_MOVIE:
-			    PUTS(" (MOV) ");
-			    break;
-			case GOPHER_PLUS_PDF:
-			    PUTS(" (PDF) ");
-			    break;
-			default:
-			    PUTS("(UNKN) ");
-			    break;
+		    switch (gtype) {
+		    case GOPHER_TEXT:
+			PUTS("(FILE) ");
+			break;
+		    case GOPHER_MENU:
+			PUTS(" (DIR) ");
+			break;
+		    case GOPHER_CSO:
+			PUTS(" (CSO) ");
+			break;
+		    case GOPHER_PCBINARY:
+			PUTS(" (BIN) ");
+			break;
+		    case GOPHER_UUENCODED:
+			PUTS(" (UUE) ");
+			break;
+		    case GOPHER_INDEX:
+			PUTS("  (?)  ");
+			break;
+		    case GOPHER_BINARY:
+			PUTS(" (BIN) ");
+			break;
+		    case GOPHER_GIF:
+		    case GOPHER_IMAGE:
+		    case GOPHER_PLUS_IMAGE:
+			PUTS(" (IMG) ");
+			break;
+		    case GOPHER_SOUND:
+		    case GOPHER_PLUS_SOUND:
+			PUTS(" (SND) ");
+			break;
+		    case GOPHER_MACBINHEX:
+			PUTS(" (HQX) ");
+			break;
+		    case GOPHER_HTML:
+		    case GOPHER_CHTML:
+			PUTS("(HTML) ");
+			break;
+		    case 'm':
+			PUTS("(MIME) ");
+			break;
+		    case GOPHER_PLUS_MOVIE:
+			PUTS(" (MOV) ");
+			break;
+		    case GOPHER_PLUS_PDF:
+			PUTS(" (PDF) ");
+			break;
+		    default:
+			PUTS("(UNKN) ");
+			break;
 		    }
 
 		    HTSprintf0(&address, "//%s/%c", host, gtype);
 
-		    for(r = selector; *r; r++) { /* Encode selector string */
+		    for (r = selector; *r; r++) {	/* Encode selector string */
 			if (acceptable[UCH(*r)]) {
 			    HTSprintf(&address, "%c", *r);
 			} else {
 			    HTSprintf(&address, "%c%c%c",
-				HEX_ESCAPE,	/* Means hex coming */
-				hex[(TOASCII(*r)) >> 4],
-				hex[(TOASCII(*r)) & 15]);
+				      HEX_ESCAPE,	/* Means hex coming */
+				      hex[(TOASCII(*r)) >> 4],
+				      hex[(TOASCII(*r)) & 15]);
 			}
 		    }
 		}
 		/* Error response from Gopher doesn't deserve to
 		   be a hyperlink. */
-		if (strcmp (address, "gopher://error.host:1/0"))
+		if (strcmp(address, "gopher://error.host:1/0"))
 		    write_anchor(name, address);
 		else
 		    PUTS(name);
 		FREE(address);
-	    } else { /* parse error */
+	    } else {		/* parse error */
 		CTRACE((tfp, "HTGopher: Bad menu item.\n"));
 		PUTS(line);
 
-	    } /* parse error */
+	    }			/* parse error */
 
 	    PUTC('\n');
-	    p = line;	/* Start again at beginning of line */
+	    p = line;		/* Start again at beginning of line */
 
-	} /* if end of line */
+	}			/* if end of line */
 
-    } /* Loop over characters */
+    }				/* Loop over characters */
 
-end_html:
+  end_html:
     END(HTML_PRE);
     PUTC('\n');
     END(HTML_BODY);
@@ -439,26 +439,25 @@ end_html:
 }
 
 /*	Parse a Gopher CSO document from an ISINDEX query.
-**	==================================================
-**
-**   Accepts an open socket to a CSO server waiting to send us
-**   data and puts it on the screen in a reasonable manner.
-**
-**   Perhaps this data can be automatically linked to some
-**   other source as well???
-**
-**  Taken from hacking by Lou Montulli@ukanaix.cc.ukans.edu
-**  on XMosaic-1.1, and put on libwww 2.11 by Arthur Secret,
-**  secret@dxcern.cern.ch .
-*/
-static void parse_cso (
-	const char *		arg,
-	HTParentAnchor *	anAnchor)
+ *	==================================================
+ *
+ *   Accepts an open socket to a CSO server waiting to send us
+ *   data and puts it on the screen in a reasonable manner.
+ *
+ *   Perhaps this data can be automatically linked to some
+ *   other source as well???
+ *
+ *  Taken from hacking by Lou Montulli@ukanaix.cc.ukans.edu
+ *  on XMosaic-1.1, and put on libwww 2.11 by Arthur Secret,
+ *  secret@dxcern.cern.ch .
+ */
+static void parse_cso(const char *arg,
+		      HTParentAnchor *anAnchor)
 {
     int ich;
     char line[BIG];
     char *p = line;
-    char *second_colon, last_char='\0';
+    char *second_colon, last_char = '\0';
     const char *title;
 
     START(HTML_HEAD);
@@ -484,107 +483,99 @@ static void parse_cso (
     START(HTML_PRE);
 
     /*
-    **	Start grabbing chars from the network.
-    */
-    while ((ich=NEXT_CHAR) != EOF)
-	{
-	    if ((char)ich != LF)
-		{
-		    *p = (char) ich;    /* Put character in line */
-		    if (p< &line[BIG-1]) p++;
-		}
-	    else
-		{
-		    *p = '\0';		/* Terminate line */
-		    p = line;		/* Scan it to parse it */
-		    /*
-		    **	OK we now have a line in 'p'.
-		    **	Lets parse it and print it.
-		    */
+     * Start grabbing chars from the network.
+     */
+    while ((ich = NEXT_CHAR) != EOF) {
+	if ((char) ich != LF) {
+	    *p = (char) ich;	/* Put character in line */
+	    if (p < &line[BIG - 1])
+		p++;
+	} else {
+	    *p = '\0';		/* Terminate line */
+	    p = line;		/* Scan it to parse it */
+	    /*
+	     * OK we now have a line in 'p'.  Lets parse it and print it.
+	     */
 
-		    /*
-		    **	Break on line that begins with a 2.
-		    **	It's the end of data.
-		    */
-		    if (*p == '2')
-			break;
+	    /*
+	     * Break on line that begins with a 2.  It's the end of data.
+	     */
+	    if (*p == '2')
+		break;
 
-		    /*
-		    **	Lines beginning with 5 are errors.
-		    **	Print them and quit.
-		    */
-		    if (*p == '5') {
-			START(HTML_H2);
-			PUTS(p+4);
-			END(HTML_H2);
-			break;
-		    }
+	    /*
+	     * Lines beginning with 5 are errors.  Print them and quit.
+	     */
+	    if (*p == '5') {
+		START(HTML_H2);
+		PUTS(p + 4);
+		END(HTML_H2);
+		break;
+	    }
 
-		    if (*p == '-') {
-			/*
-			**  Data lines look like  -200:#:
-			**  where # is the search result number and can be
-			**  multiple digits (infinite?).
-			**  Find the second colon and check the digit to the
-			**  left of it to see if they are diferent.
-			**  If they are then a different person is starting.
-			**  Make this line an <h2>.
-			*/
+	    if (*p == '-') {
+		/*
+		 * Data lines look like -200:#:
+		 * where # is the search result number and can be multiple
+		 * digits (infinite?).
+		 * Find the second colon and check the digit to the left of it
+		 * to see if they are diferent.  If they are then a different
+		 * person is starting.  Make this line an <h2>.
+		 */
 
-			/*
-			**  Find the second_colon.
-			*/
-			second_colon = strchr( strchr(p,':')+1, ':');
+		/*
+		 * Find the second_colon.
+		 */
+		second_colon = strchr(strchr(p, ':') + 1, ':');
 
-			if(second_colon != NULL) {  /* error check */
+		if (second_colon != NULL) {	/* error check */
 
-			    if (*(second_colon-1) != last_char)
-				/* print seperator */
-			    {
-				END(HTML_PRE);
-				START(HTML_H2);
-			    }
+		    if (*(second_colon - 1) != last_char)
+			/* print seperator */
+		    {
+			END(HTML_PRE);
+			START(HTML_H2);
+		    }
 
+		    /*
+		     * Right now the record appears with the alias (first line)
+		     * as the header and the rest as <pre> text.
+		     *
+		     * It might look better with the name as the header and the
+		     * rest as a <ul> with <li> tags.  I'm not sure whether the
+		     * name field comes in any special order or if its even
+		     * required in a record, so for now the first line is the
+		     * header no matter what it is (it's almost always the
+		     * alias).
+		     *
+		     * A <dl> with the first line as the <DT> and the rest as
+		     * some form of <DD> might good also?
+		     */
 
-			    /*
-			    **	Right now the record appears with the alias
-			    **	(first line) as the header and the rest as
-			    **	<pre> text.
-			    **	It might look better with the name as the
-			    **	header and the rest as a <ul> with <li> tags.
-			    **	I'm not sure whether the name field comes in
-			    **	any special order or if its even required in
-			    **	a record, so for now the first line is the
-			    **	header no matter what it is (it's almost
-			    **	always the alias).
-			    **	A <dl> with the first line as the <DT> and
-			    **	the rest as some form of <DD> might good also?
-			    */
-
-			    /*
-			    **	Print data.
-			    */
-			    PUTS(second_colon+1);
-			    PUTC('\n');
-
-			    if (*(second_colon-1) != last_char)
-				/* end seperator */
-			    {
-				END(HTML_H2);
-				START(HTML_PRE);
-			    }
+		    /*
+		     * Print data.
+		     */
+		    PUTS(second_colon + 1);
+		    PUTC('\n');
+
+		    if (*(second_colon - 1) != last_char)
+			/* end seperator */
+		    {
+			END(HTML_H2);
+			START(HTML_PRE);
+		    }
 
-			    /*
-			    **	Save the char before the second colon
-			    **	for comparison on the next pass.
-			    */
-			    last_char =  *(second_colon-1) ;
+		    /*
+		     * Save the char before the second colon for comparison on
+		     * the next pass.
+		     */
+		    last_char = *(second_colon - 1);
 
-			} /* end if second_colon */
-		    } /* end if *p == '-' */
-		} /* if end of line */
+		}		/* end if second_colon */
+	    }			/* end if *p == '-' */
+	}			/* if end of line */
 
-	} /* Loop over characters */
+    }				/* Loop over characters */
 
     /* end the text block */
     PUTC('\n');
@@ -592,17 +583,16 @@ static void parse_cso (
     PUTC('\n');
     FREE_TARGET;
 
-    return;  /* all done */
-} /* end of procedure */
+    return;			/* all done */
+}				/* end of procedure */
 
 /*	Display a Gopher CSO ISINDEX cover page.
-**	========================================
-*/
-static void display_cso (
-	const char *		arg,
-	HTParentAnchor *	anAnchor)
+ *	========================================
+ */
+static void display_cso(const char *arg,
+			HTParentAnchor *anAnchor)
 {
-    const char * title;
+    const char *title;
 
     START(HTML_HEAD);
     PUTC('\n');
@@ -621,8 +611,8 @@ static void display_cso (
     if ((title = HTAnchor_title(anAnchor)))
 	PUTS(title);
     else {
-       PUTS(arg);
-       PUTS(INDEX_SEGMENT);
+	PUTS(arg);
+	PUTS(INDEX_SEGMENT);
     }
     END(HTML_H1);
     PUTS(GOPHER_CSO_INDEX_SUBTITLE);
@@ -640,13 +630,12 @@ static void display_cso (
 }
 
 /*	Display a Gopher Index document.
-**	================================
-*/
-static void display_index (
-				  const char * arg,
-				  HTParentAnchor *anAnchor)
+ *	================================
+ */
+static void display_index(const char *arg,
+			  HTParentAnchor *anAnchor)
 {
-    const char * title;
+    const char *title;
 
     START(HTML_HEAD);
     PUTC('\n');
@@ -666,8 +655,8 @@ static void display_index (
     if ((title = HTAnchor_title(anAnchor)))
 	PUTS(title);
     else {
-       PUTS(arg);
-       PUTS(INDEX_SEGMENT);
+	PUTS(arg);
+	PUTS(INDEX_SEGMENT);
     }
     END(HTML_H1);
     PUTS(GOPHER_INDEX_SUBTITLE);
@@ -682,38 +671,40 @@ static void display_index (
 }
 
 /*	De-escape a selector into a command.
-**	====================================
-**
-**	The % hex escapes are converted. Otheriwse, the string is copied.
-*/
-static void de_escape (char * command, const char * selector)
+ *	====================================
+ *
+ *	The % hex escapes are converted. Otheriwse, the string is copied.
+ */
+static void de_escape(char *command, const char *selector)
 {
-    const char * p = selector;
-    char * q = command;
-	if (command == NULL)
-	    outofmem(__FILE__, "HTLoadGopher");
+    const char *p = selector;
+    char *q = command;
+
+    if (command == NULL)
+	outofmem(__FILE__, "HTLoadGopher");
     while (*p) {		/* Decode hex */
 	if (*p == HEX_ESCAPE) {
 	    char c;
 	    unsigned int b;
+
 	    p++;
 	    c = *p++;
-	    b =   from_hex(c);
+	    b = from_hex(c);
 	    c = *p++;
-	    if (!c) break;	/* Odd number of chars! */
-	    *q++ = (char) FROMASCII((b<<4) + from_hex(c));
+	    if (!c)
+		break;		/* Odd number of chars! */
+	    *q++ = (char) FROMASCII((b << 4) + from_hex(c));
 	} else {
 	    *q++ = *p++;	/* Record */
 	}
     }
-    *q++ = '\0';	/* Terminate command */
+    *q++ = '\0';		/* Terminate command */
 }
 
-
 /*	Free the CSOfields structures. - FM
-**	===================================
-*/
-static void free_CSOfields (void)
+ *	===================================
+ */
+static void free_CSOfields(void)
 {
     CSOfield_info *cur = CSOfields;
     CSOfield_info *prev;
@@ -734,22 +725,22 @@ static void free_CSOfields (void)
 }
 
 /*	Interpret CSO/PH form template keys. - FM
-**	=========================================
-*/
-static void interpret_cso_key (
-	char *			key,
-	char *			buf,
-	int *			length,
-	CSOformgen_context *	ctx,
-	HTStream *		Target)
+ *	=========================================
+ */
+static void interpret_cso_key(char *key,
+			      char *buf,
+			      int *length,
+			      CSOformgen_context * ctx,
+			      HTStream *Target)
 {
     CSOfield_info *fld;
 
     if ((fld = ctx->fld) != 0) {
 	/*
-	**  Most substitutions only recognized inside of loops.
-	*/
+	 * Most substitutions only recognized inside of loops.
+	 */
 	int error = 0;
+
 	if (0 == strncmp(key, "$(FID)", 6)) {
 	    sprintf(buf, "%d", fld->id);
 	} else if (0 == strncmp(key, "$(FDESC)", 8)) {
@@ -779,34 +770,34 @@ static void interpret_cso_key (
 	else
 	    fld = ctx->fld->next;
 	switch (ctx->field_select) {
-	  case 0:
+	case 0:
 	    /*
-	    **	'Query' fields, public and lookup attributes.
-	    */
+	     * 'Query' fields, public and lookup attributes.
+	     */
 	    for (; fld; fld = fld->next)
-		 if (fld->public && (fld->lookup==1))
-		     break;
+		if (fld->public && (fld->lookup == 1))
+		    break;
 	    break;
-	  case 1:
+	case 1:
 	    /*
-	    **	'Query' fields, accept lookup attribute.
-	    */
+	     * 'Query' fields, accept lookup attribute.
+	     */
 	    for (; fld; fld = fld->next)
 		if (fld->lookup == 1)
 		    break;
 	    break;
-	  case 2:
+	case 2:
 	    /*
-	    **	'Return' fields, public only.
-	    */
+	     * 'Return' fields, public only.
+	     */
 	    for (; fld; fld = fld->next)
 		if (fld->public)
 		    break;
 	    break;
-	  case 3:
+	case 3:
 	    /*
-	    **	All fields.
-	    */
+	     * All fields.
+	     */
 	    break;
 	}
 	if (fld) {
@@ -818,8 +809,8 @@ static void interpret_cso_key (
     } else if ((0 == strncmp(key, "$(QFIELDS)", 10)) ||
 	       (0 == strncmp(key, "$(RFIELDS)", 10))) {
 	/*
-	**  Begin iteration sequence.
-	*/
+	 * Begin iteration sequence.
+	 */
 	ctx->rep_line = ctx->cur_line;
 	ctx->rep_off = ctx->cur_off;
 	ctx->fld = (CSOfield_info *) 0;
@@ -830,8 +821,8 @@ static void interpret_cso_key (
 
     } else if (0 == strncmp(key, "$(NAMEFLD)", 10)) {
 	/*
-	**  Special, locate name field.  Flag lookup so QFIELDS will skip it.
-	*/
+	 * Special, locate name field.  Flag lookup so QFIELDS will skip it.
+	 */
 	for (fld = CSOfields; fld; fld = fld->next)
 	    if (strcmp(fld->name, "name") == 0 ||
 		strcmp(fld->name, "Name") == 0) {
@@ -840,20 +831,21 @@ static void interpret_cso_key (
 		break;
 	    }
 	ctx->fld = fld;
-    } else if (0 == strncmp (key, "$(HOST)", 7)) {
-	strcpy (buf, ctx->host);
-    } else if (0 == strncmp (key, "$(PORT)", 7)) {
+    } else if (0 == strncmp(key, "$(HOST)", 7)) {
+	strcpy(buf, ctx->host);
+    } else if (0 == strncmp(key, "$(PORT)", 7)) {
 	sprintf(buf, "%d", ctx->port);
     } else {
 	/*
-	**  No match, dump key to buffer so client sees it for debugging.
-	*/
+	 * No match, dump key to buffer so client sees it for debugging.
+	 */
 	size_t out = 0;
+
 	while (*key && (*key != ')')) {
 	    buf[out++] = (*key++);
-	    if (out > sizeof(buf)-2) {
+	    if (out > sizeof(buf) - 2) {
 		buf[out] = '\0';
-		(*Target->isa->put_block)(Target, buf, strlen(buf));
+		(*Target->isa->put_block) (Target, buf, strlen(buf));
 		out = 0;
 	    }
 	}
@@ -867,23 +859,22 @@ static void interpret_cso_key (
 }
 
 /*	Parse the elements in a CSO/PH fields structure. - FM
-**	=====================================================
-*/
-static int parse_cso_field_info (
-	CSOfield_info *	blk)
+ *	=====================================================
+ */
+static int parse_cso_field_info(CSOfield_info *blk)
 {
     char *info, *max_spec;
 
     /*
-    ** Initialize all fields to default values.
-    */
+     * Initialize all fields to default values.
+     */
     blk->indexed = blk->lookup = blk->reserved = blk->max_size = blk->url = 0;
     blk->defreturn = blk->explicit_return = blk->public = 0;
 
     /*
-    **	Search for keywords in info string and set values.  Attributes
-    **	are converted to all lower-case for comparison.
-    */
+     * Search for keywords in info string and set values.  Attributes are
+     * converted to all lower-case for comparison.
+     */
     info = blk->attributes;
     LYLowerCase(info);
     if (strstr(info, "indexed "))
@@ -909,11 +900,10 @@ static int parse_cso_field_info (
 }
 
 /*	Parse a reply from a CSO/PH fields request. - FM
-**	================================================
-*/
-static int parse_cso_fields (
-	char *		buf,
-	int		size)
+ *	================================================
+ */
+static int parse_cso_fields(char *buf,
+			    int size)
 {
     int ich;
     char *p = buf;
@@ -927,19 +917,20 @@ static int parse_cso_fields (
     buf[0] = '\0';
 
     /*
-    **	Start grabbing chars from the network.
-    */
+     * Start grabbing chars from the network.
+     */
     while ((ich = NEXT_CHAR) != EOF) {
 	if (interrupted_in_htgetcharacter) {
-	    CTRACE((tfp, "HTLoadCSO: Interrupted in HTGetCharacter, apparently.\n"));
+	    CTRACE((tfp,
+		    "HTLoadCSO: Interrupted in HTGetCharacter, apparently.\n"));
 	    free_CSOfields();
 	    buf[0] = '\0';
 	    return HT_INTERRUPTED;
 	}
 
-	if ((char)ich != LF) {
-	    *p = (char) ich;    /* Put character in buffer */
-	    if (p < &buf[size-1]) {
+	if ((char) ich != LF) {
+	    *p = (char) ich;	/* Put character in buffer */
+	    if (p < &buf[size - 1]) {
 		p++;
 	    }
 	} else {
@@ -950,48 +941,46 @@ static int parse_cso_fields (
 	     */
 
 	    /*
-	    **	Break on line that begins with a 2.
-	    **	It's the end of data.
-	    */
+	     * Break on line that begins with a 2.  It's the end of data.
+	     */
 	    if (*p == '2')
 		break;
 
 	    /*
-	    **	Lines beginning with 5 are errors.
-	    **	Print them and quit.
-	    */
+	     * Lines beginning with 5 are errors.  Print them and quit.
+	     */
 	    if (*p == '5') {
-		strcpy (buf, p);
+		strcpy(buf, p);
 		return 5;
 	    }
 
 	    if (*p == '-') {
 		/*
-		**  Data lines look like  -200:#:
-		**  where # is the search result number and can be
-		**  multiple digits (infinite?).
-		*/
+		 * Data lines look like -200:#:
+		 * where # is the search result number and can be multiple
+		 * digits (infinite?).
+		 */
 
 		/*
-		** Check status, ignore any non-success.
-		*/
-		if (p[1] != '2' )
+		 * Check status, ignore any non-success.
+		 */
+		if (p[1] != '2')
 		    continue;
 
 		/*
-		** Parse fields within returned line into status, ndx, name,
-		** data.
-		*/
+		 * Parse fields within returned line into status, ndx, name,
+		 * data.
+		 */
 		indx = NULL;
 		name = NULL;
 		for (i = 0; p[i]; i++) {
-		    if (p[i] == ':' ) {
+		    if (p[i] == ':') {
 			p[i] = '\0';
 			if (!indx) {
-			    indx = (char *)&p[i+1];
-			    code = atoi (indx);
+			    indx = (char *) &p[i + 1];
+			    code = atoi(indx);
 			} else if (!name) {
-			    name = (char *)&p[i+1];
+			    name = (char *) &p[i + 1];
 			} else {
 			    i++;
 			    break;
@@ -999,29 +988,30 @@ static int parse_cso_fields (
 		    }
 		}
 		/*
-		**  Add data to field structure.
-		*/
+		 * Add data to field structure.
+		 */
 		if (name) {
 		    if (code == prev_code) {
 			/*
-			**  Remaining data are description.
-			**  Save in current info block.
-			*/
-			alen = strlen((char *)&p[i]) + 1;
+			 * Remaining data are description.  Save in current
+			 * info block.
+			 */
+			alen = strlen((char *) &p[i]) + 1;
 			if (alen > sizeof(last->desc_buf)) {
 			    if (last->description != last->desc_buf)
 				FREE(last->description);
-			    if (!(last->description = (char *)malloc(alen))) {
+			    if (!(last->description = (char *) malloc(alen))) {
 				outofmem(__FILE__, "HTLoadCSO");
 			    }
 			}
-			strcpy(last->description, (char *)&p[i]);
+			strcpy(last->description, (char *) &p[i]);
 		    } else {
 			/*
-			**  Initialize new block, append to end of list
-			**  to preserve order.
-			*/
+			 * Initialize new block, append to end of list to
+			 * preserve order.
+			 */
 			new = typecalloc(CSOfield_info);
+
 			if (!new) {
 			    outofmem(__FILE__, "HTLoadCSO");
 			}
@@ -1035,85 +1025,86 @@ static int parse_cso_fields (
 			new->name = new->name_buf;
 			alen = strlen(name) + 1;
 			if (alen > sizeof(new->name_buf)) {
-			    if (!(new->name = (char *)malloc(alen))) {
+			    if (!(new->name = (char *) malloc(alen))) {
 				outofmem(__FILE__, "HTLoadCSO");
 			    }
 			}
-			strcpy (new->name, name);
+			strcpy(new->name, name);
 
 			new->attributes = new->attr_buf;
-			alen = strlen((char *)&p[i]) + 2;
+			alen = strlen((char *) &p[i]) + 2;
 			if (alen > sizeof(new->attr_buf)) {
-			    if (!(new->attributes = (char *)malloc(alen))) {
+			    if (!(new->attributes = (char *) malloc(alen))) {
 				outofmem(__FILE__, "HTLoadCSO");
 			    }
 			}
-			strcpy(new->attributes, (char *)&p[i]);
-			strcpy((char *)&new->attributes[alen-2], " ");
+			strcpy(new->attributes, (char *) &p[i]);
+			strcpy((char *) &new->attributes[alen - 2], " ");
 			new->description = new->desc_buf;
 			new->desc_buf[0] = '\0';
 			new->id = atoi(indx);
 			/*
-			**  Scan for keywords.
-			*/
+			 * Scan for keywords.
+			 */
 			parse_cso_field_info(new);
 		    }
 		    prev_code = code;
 		} else
 		    break;
-	    } /* end if *p == '-' */
-	} /* if end of line */
+	    }			/* end if *p == '-' */
+	}			/* if end of line */
 
-    } /* Loop over characters */
+    }				/* Loop over characters */
 
     /* end the text block */
 
     if (buf[0] == '\0') {
-	return -1; /* no response */
+	return -1;		/* no response */
     }
     buf[0] = '\0';
-    return 0;  /* all done */
-} /* end of procedure */
+    return 0;			/* all done */
+}				/* end of procedure */
 
 /*	Generate a form for submitting CSO/PH searches. - FM
-**	====================================================
-*/
-static int generate_cso_form (
-	char *		host,
-	int		port,
-	char *		buf,
-	HTStream *	Target)
+ *	====================================================
+ */
+static int generate_cso_form(char *host,
+			     int port,
+			     char *buf,
+			     HTStream *Target)
 {
     int i, j, length;
     size_t out;
     int full_flag = 1;
     char *key, *line;
     CSOformgen_context ctx;
-    static char *template[] = {
-   "<HTML>\n<HEAD>\n<TITLE>CSO/PH Query Form for $(HOST)</TITLE>\n</HEAD>\n<BODY>",
-   "<H2><I>CSO/PH Query Form</I> for <EM>$(HOST)</EM></H2>",
-   "To search the database for a name, fill in one or more of the fields",
-   "in the form below and activate the 'Submit query' button.  At least",
-   "one of the entered fields must be flagged as indexed.",
-   "<HR><FORM method=\"POST\" action=\"cso://$(HOST)/\">",
-   "[ <input type=\"submit\" value=\"Submit query\"> | ",
-   "<input type=\"reset\" value=\"Clear fields\"> ]",
-   "<P><DL>",
-   "   <DT>Search parameters (* indicates indexed field):",
-   "   <DD>", "$(NAMEFLD)    <DL COMPACT>\n    <DT><I>$(FDESC)</I>$(FNDX)",
-   "    <DD>Last: <input name=\"q_$(FID)\" type=\"text\" size=49$(FSIZE2)>",
-   "    <DD>First: <input name=\"q_$(FID)\" type=\"text\" size=48$(FSIZE2)>",
-   "$(QFIELDS)    <DT><I>$(FDESC)</I>$(FNDX)",
-   "    <DD><input name=\"q_$(FID)\" type=\"text\" $(FSIZE)>\n$(NEXTFLD)",
-   "    </DL>",
-   "   </DL>\n<P><DL>",
-   "   <DT>Output format:",
-   "   <DD>Returned data option: <select name=\"return\">",
-   "    <option>default<option selected>all<option>selected</select><BR>",
-   "$(RFIELDS)    <input type=\"checkbox\" name=\"r_$(FID)\"$(FDEF)> $(FDESC)<BR>",
-   "$(NEXTFLD)    ",
-   "   </DL></FORM><HR>\n</BODY>\n</HTML>",
-   (char *) 0
+    static char *template[] =
+    {
+	"<HTML>\n<HEAD>\n<TITLE>CSO/PH Query Form for $(HOST)</TITLE>\n</HEAD>\n<BODY>",
+	"<H2><I>CSO/PH Query Form</I> for <EM>$(HOST)</EM></H2>",
+	"To search the database for a name, fill in one or more of the fields",
+	"in the form below and activate the 'Submit query' button.  At least",
+	"one of the entered fields must be flagged as indexed.",
+	"<HR><FORM method=\"POST\" action=\"cso://$(HOST)/\">",
+	"[ <input type=\"submit\" value=\"Submit query\"> | ",
+	"<input type=\"reset\" value=\"Clear fields\"> ]",
+	"<P><DL>",
+	"   <DT>Search parameters (* indicates indexed field):",
+	"   <DD>",
+	"$(NAMEFLD)    <DL COMPACT>\n    <DT><I>$(FDESC)</I>$(FNDX)",
+	"    <DD>Last: <input name=\"q_$(FID)\" type=\"text\" size=49$(FSIZE2)>",
+	"    <DD>First: <input name=\"q_$(FID)\" type=\"text\" size=48$(FSIZE2)>",
+	"$(QFIELDS)    <DT><I>$(FDESC)</I>$(FNDX)",
+	"    <DD><input name=\"q_$(FID)\" type=\"text\" $(FSIZE)>\n$(NEXTFLD)",
+	"    </DL>",
+	"   </DL>\n<P><DL>",
+	"   <DT>Output format:",
+	"   <DD>Returned data option: <select name=\"return\">",
+	"    <option>default<option selected>all<option>selected</select><BR>",
+	"$(RFIELDS)    <input type=\"checkbox\" name=\"r_$(FID)\"$(FDEF)> $(FDESC)<BR>",
+	"$(NEXTFLD)    ",
+	"   </DL></FORM><HR>\n</BODY>\n</HTML>",
+	(char *) 0
     };
 
     out = 0;
@@ -1123,30 +1114,31 @@ static int generate_cso_form (
     ctx.fld = (CSOfield_info *) 0;
     ctx.public_override = full_flag;
     /*
-    **	Parse the strings in the template array to produce HTML document
-    **	to send to client.  First line is skipped for 'full' lists.
-    */
+     * Parse the strings in the template array to produce HTML document to send
+     * to client.  First line is skipped for 'full' lists.
+     */
     out = 0;
     buf[out] = '\0';
-    for (i = full_flag ? /***1***/ 0 : 0; template[i]; i++) {
+    for (i = full_flag ? /***1***/ 0 : 0;
+	 template[i];
+	 i++) {
 	/*
-	**  Search the current string for substitution, flagged by $(
-	*/
-	for (line=template[i], j = 0; line[j]; j++) {
-	    if ((line[j] == '$') && (line[j+1] == '(')) {
+	 * Search the current string for substitution, flagged by $(
+	 */
+	for (line = template[i], j = 0; line[j]; j++) {
+	    if ((line[j] == '$') && (line[j + 1] == '(')) {
 		/*
-		** Command detected, flush output buffer and find closing ')'
-		** that delimits the command.
-		*/
+		 * Command detected, flush output buffer and find closing ')'
+		 * that delimits the command.
+		 */
 		buf[out] = '\0';
 		if (out > 0)
-		    (*Target->isa->put_block)(Target, buf, strlen(buf));
+		    (*Target->isa->put_block) (Target, buf, strlen(buf));
 		out = 0;
-		for (key = &line[j]; line[j+1] && (line[j] != ')'); j++)
-		    ;
+		for (key = &line[j]; line[j + 1] && (line[j] != ')'); j++) ;
 		/*
-		**  Save context, interpet command and restore updated context.
-		*/
+		 * Save context, interpet command and restore updated context.
+		 */
 		ctx.cur_line = i;
 		ctx.cur_off = j;
 		interpret_cso_key(key, buf, &length, &ctx, Target);
@@ -1157,16 +1149,17 @@ static int generate_cso_form (
 
 		if (ctx.seek) {
 		    /*
-		    **	Command wants us to skip (forward) to indicated token.
-		    **	Start at current position.
-		    */
+		     * Command wants us to skip (forward) to indicated token. 
+		     * Start at current position.
+		     */
 		    int slen = strlen(ctx.seek);
+
 		    for (; template[i]; i++) {
 			for (line = template[i]; line[j]; j++) {
 			    if (line[j] == '$')
 				if (0 == strncmp(ctx.seek, &line[j], slen)) {
 				    if (j == 0)
-					j = strlen(template[--i])-1;
+					j = strlen(template[--i]) - 1;
 				    else
 					--j;
 				    line = template[i];
@@ -1180,19 +1173,20 @@ static int generate_cso_form (
 		    }
 		    if (ctx.seek) {
 			char *temp = 0;
+
 			HTSprintf0(&temp, GOPHER_CSO_SEEK_FAILED, ctx.seek);
-			(*Target->isa->put_block)(Target, temp, strlen(temp));
+			(*Target->isa->put_block) (Target, temp, strlen(temp));
 			FREE(temp);
 		    }
 		}
 	    } else {
 		/*
-		**  Non-command text, add to output buffer.
-		*/
+		 * Non-command text, add to output buffer.
+		 */
 		buf[out++] = line[j];
-		if (out > (sizeof(buf)-3)) {
+		if (out > (sizeof(buf) - 3)) {
 		    buf[out] = '\0';
-			(*Target->isa->put_block)(Target, buf, strlen(buf));
+		    (*Target->isa->put_block) (Target, buf, strlen(buf));
 		    out = 0;
 		}
 	    }
@@ -1201,16 +1195,15 @@ static int generate_cso_form (
 	buf[out] = '\0';
     }
     if (out > 0)
-	(*Target->isa->put_block)(Target, buf, strlen(buf));
+	(*Target->isa->put_block) (Target, buf, strlen(buf));
 
     return 0;
 }
 
 /*	Generate a results report for CSO/PH form-based searches. - FM
-**	==============================================================
-*/
-static int generate_cso_report (
-	HTStream *	Target)
+ *	==============================================================
+ */
+static int generate_cso_report(HTStream *Target)
 {
     int ich;
     char line[BIG];
@@ -1222,30 +1215,30 @@ static int generate_cso_report (
     BOOL stop = FALSE;
 
     /*
-    **	Read lines until non-negative status.
-    */
+     * Read lines until non-negative status.
+     */
     prev_ndx = -100;
     /*
-    **	Start grabbing chars from the network.
-    */
+     * Start grabbing chars from the network.
+     */
     while (!stop && (ich = NEXT_CHAR) != EOF) {
 	if (interrupted_in_htgetcharacter) {
-	    CTRACE((tfp, "HTLoadCSO: Interrupted in HTGetCharacter, apparently.\n"));
-	    _HTProgress (CONNECTION_INTERRUPTED);
+	    CTRACE((tfp,
+		    "HTLoadCSO: Interrupted in HTGetCharacter, apparently.\n"));
+	    _HTProgress(CONNECTION_INTERRUPTED);
 	    goto end_CSOreport;
 	}
 
-	if ((char)ich != LF) {
-	    *p = (char) ich;    /* Put character in line */
-	    if (p < &line[BIG-1]) {
+	if ((char) ich != LF) {
+	    *p = (char) ich;	/* Put character in line */
+	    if (p < &line[BIG - 1]) {
 		p++;
 	    }
 	} else {
 	    *p = '\0';		/* Terminate line */
 	    /*
-	    **	OK we now have a line.
-	    **	Load it as 'p' and parse it.
-	    */
+	     * OK we now have a line.  Load it as 'p' and parse it.
+	     */
 	    p = line;
 	    if (p[0] != '-' && p[0] != '1') {
 		stop = TRUE;
@@ -1257,9 +1250,9 @@ static int generate_cso_report (
 		if (p[i] == ':') {
 		    p[i] = '\0';
 		    if (!ndx_str) {
-			fname = ndx_str = &p[i+1];
+			fname = ndx_str = &p[i + 1];
 		    } else {
-			fname = &p[i+1];
+			fname = &p[i + 1];
 			break;
 		    }
 		}
@@ -1269,22 +1262,22 @@ static int generate_cso_report (
 		if (prev_ndx != ndx) {
 		    if (prev_ndx != -100) {
 			HTSprintf0(&buf, "</DL></DL>\n");
-			(*Target->isa->put_block)(Target, buf, strlen(buf));
+			(*Target->isa->put_block) (Target, buf, strlen(buf));
 		    }
 		    if (ndx == 0) {
 			HTSprintf0(&buf,
-		  "<HR><DL><DT>Information/status<DD><DL><DT>\n");
-			(*Target->isa->put_block)(Target, buf, strlen(buf));
+				   "<HR><DL><DT>Information/status<DD><DL><DT>\n");
+			(*Target->isa->put_block) (Target, buf, strlen(buf));
 		    } else {
 			HTSprintf0(&buf,
-	      "<HR><DL><DT>Entry %d:<DD><DL COMPACT><DT>\n", ndx);
-			(*Target->isa->put_block)(Target, buf, strlen(buf));
+				   "<HR><DL><DT>Entry %d:<DD><DL COMPACT><DT>\n", ndx);
+			(*Target->isa->put_block) (Target, buf, strlen(buf));
 		    }
 		    prev_ndx = ndx;
 		}
 	    } else {
 		HTSprintf0(&buf, "<DD>%s\n", rcode);
-		(*Target->isa->put_block)(Target, buf, strlen(buf));
+		(*Target->isa->put_block) (Target, buf, strlen(buf));
 		continue;
 	    }
 	    if ((*rcode >= '2') && (*rcode <= '5') && (fname != ndx_str)) {
@@ -1296,7 +1289,7 @@ static int generate_cso_report (
 			*fvalue++ = '\0';
 			i = strlen(fname) - 1;
 			while (i >= 0 && fname[i] == ' ') {
-			    fname[i--] = '\0'; /* trim trailing */
+			    fname[i--] = '\0';	/* trim trailing */
 			}
 			break;
 		    }
@@ -1317,12 +1310,12 @@ static int generate_cso_report (
 		    }
 		    if (fld && fld->url) {
 			HTSprintf0(&buf,
-				"<DT><I>%s</I><DD><A HREF=\"%s\">%s</A>\n",
-				fname, fvalue, fvalue);
-			(*Target->isa->put_block)(Target, buf, strlen(buf));
+				   "<DT><I>%s</I><DD><A HREF=\"%s\">%s</A>\n",
+				   fname, fvalue, fvalue);
+			(*Target->isa->put_block) (Target, buf, strlen(buf));
 		    } else {
 			HTSprintf0(&buf, "<DT><I>%s</I><DD>", fname);
-			(*Target->isa->put_block)(Target, buf, strlen(buf));
+			(*Target->isa->put_block) (Target, buf, strlen(buf));
 			buf[0] = '\0';
 			l = fvalue;
 			while (*l) {
@@ -1345,7 +1338,8 @@ static int generate_cso_report (
 				       strncmp(l, "http://", 7) &&
 				       strncmp(l, "https://", 8) &&
 				       strncmp(l, "wais://", 7) &&
-				       strncmp(l, STR_MAILTO_URL, LEN_MAILTO_URL) &&
+				       strncmp(l, STR_MAILTO_URL,
+					       LEN_MAILTO_URL) &&
 				       strncmp(l, "cso://", 6) &&
 				       strncmp(l, "gopher://", 9)) {
 				HTSprintf(&buf, "%c", *l++);
@@ -1362,11 +1356,11 @@ static int generate_cso_report (
 			    }
 			}
 			StrAllocCat(buf, "\n");
-			(*Target->isa->put_block)(Target, buf, strlen(buf));
+			(*Target->isa->put_block) (Target, buf, strlen(buf));
 		    }
 		} else {
 		    HTSprintf0(&buf, "<DD>");
-		    (*Target->isa->put_block)(Target, buf, strlen(buf));
+		    (*Target->isa->put_block) (Target, buf, strlen(buf));
 		    buf[0] = '\0';
 		    l = fvalue;
 		    while (*l) {
@@ -1406,36 +1400,35 @@ static int generate_cso_report (
 			}
 		    }
 		    StrAllocCat(buf, "\n");
-		    (*Target->isa->put_block)(Target, buf, strlen(buf));
+		    (*Target->isa->put_block) (Target, buf, strlen(buf));
 		}
 	    } else {
-		HTSprintf0(&buf, "<DD>%s\n", fname ? fname : rcode );
-		(*Target->isa->put_block)(Target, buf, strlen(buf));
+		HTSprintf0(&buf, "<DD>%s\n", fname ? fname : rcode);
+		(*Target->isa->put_block) (Target, buf, strlen(buf));
 	    }
 	}
     }
-end_CSOreport:
+  end_CSOreport:
     if (prev_ndx != -100) {
 	HTSprintf0(&buf, "</DL></DL>\n");
-	(*Target->isa->put_block)(Target, buf, strlen(buf));
+	(*Target->isa->put_block) (Target, buf, strlen(buf));
     }
     FREE(buf);
     return 0;
 }
 
 /*	CSO/PH form-based search gateway - FM			HTLoadCSO
-**	=====================================
-*/
-static int HTLoadCSO (
-	const char *		arg,
-	HTParentAnchor *	anAnchor,
-	HTFormat		format_out,
-	HTStream*		sink)
+ *	=====================================
+ */
+static int HTLoadCSO(const char *arg,
+		     HTParentAnchor *anAnchor,
+		     HTFormat format_out,
+		     HTStream *sink)
 {
     static const char end_form[] = "</BODY>\n</HTML>\n";
     char *host, *cp, *data;
     int port = CSO_PORT;
-    int status;				/* tcp return */
+    int status;			/* tcp return */
     bstring *command = NULL;
     bstring *content = NULL;
     int len, i, j, start, finish, flen, ndx;
@@ -1446,29 +1439,30 @@ static int HTLoadCSO (
     HTStream *Target = NULL;
 
     if (!acceptable_inited)
-	 init_acceptable();
+	init_acceptable();
 
     if (!arg)
-	return -3;		/* Bad if no name sepcified	*/
+	return -3;		/* Bad if no name sepcified     */
     if (!*arg)
-	return -2;		/* Bad if name had zero length	*/
+	return -2;		/* Bad if name had zero length  */
     CTRACE((tfp, "HTLoadCSO: Looking for %s\n", arg));
 
     /*
-    **	Set up a socket to the server for the data.
-    */
-    status = HTDoConnect (arg, "cso", CSO_PORT, &s);
+     * Set up a socket to the server for the data.
+     */
+    status = HTDoConnect(arg, "cso", CSO_PORT, &s);
     if (status == HT_INTERRUPTED) {
 	/*
-	**  Interrupt cleanly.
-	*/
-	CTRACE((tfp, "HTLoadCSO: Interrupted on connect; recovering cleanly.\n"));
-	_HTProgress (CONNECTION_INTERRUPTED);
+	 * Interrupt cleanly.
+	 */
+	CTRACE((tfp,
+		"HTLoadCSO: Interrupted on connect; recovering cleanly.\n"));
+	_HTProgress(CONNECTION_INTERRUPTED);
 	return HT_NOT_LOADED;
     }
     if (status < 0) {
 	CTRACE((tfp, "HTLoadCSO: Unable to connect to remote host for `%s'.\n",
-		    arg));
+		arg));
 	return HTInetStatus("connect");
     }
 
@@ -1480,23 +1474,23 @@ static int HTLoadCSO (
 	trace_bstring(command);
 	CTRACE((tfp, "' to socket %d\n", s));
     }
-    _HTProgress (GOPHER_SENDING_CSO_REQUEST);
+    _HTProgress(GOPHER_SENDING_CSO_REQUEST);
     status = NETWRITE(s, BStrData(command), BStrLen(command));
     BStrFree(command);
     if (status < 0) {
 	CTRACE((tfp, "HTLoadCSO: Unable to send command.\n"));
 	return HTInetStatus("send");
     }
-    _HTProgress (GOPHER_SENT_CSO_REQUEST);
+    _HTProgress(GOPHER_SENT_CSO_REQUEST);
 
     /*
-    **	Now read the data from the socket.
-    */
+     * Now read the data from the socket.
+     */
     status = parse_cso_fields(buf, sizeof(buf));
     if (status) {
 	NETCLOSE(s);
 	if (status == HT_INTERRUPTED) {
-	    _HTProgress (CONNECTION_INTERRUPTED);
+	    _HTProgress(CONNECTION_INTERRUPTED);
 	} else if (buf[0] != '\0') {
 	    HTAlert(buf);
 	} else {
@@ -1509,6 +1503,7 @@ static int HTLoadCSO (
 			   sink, anAnchor);
     if (!Target || Target == NULL) {
 	char *temp = 0;
+
 	HTSprintf0(&temp, CANNOT_CONVERT_I_TO_O,
 		   HTAtom_name(format_in), HTAtom_name(format_out));
 	HTAlert(temp);
@@ -1519,7 +1514,7 @@ static int HTLoadCSO (
     host = HTParse(arg, "", PARSE_HOST);
     if ((cp = strchr(host, ':')) != NULL) {
 	if (cp[1] >= '0' && cp[1] <= '9') {
-	    port = atoi((cp+1));
+	    port = atoi((cp + 1));
 	    if (port == CSO_PORT) {
 		*cp = '\0';
 	    }
@@ -1528,7 +1523,7 @@ static int HTLoadCSO (
     anAnchor->safe = TRUE;
     if (isBEmpty(anAnchor->post_data)) {
 	generate_cso_form(host, port, buf, Target);
-	(*Target->isa->_free)(Target);
+	(*Target->isa->_free) (Target);
 	FREE(host);
 	NETCLOSE(s);
 	free_CSOfields();
@@ -1536,15 +1531,15 @@ static int HTLoadCSO (
     }
 
     HTBprintf(&command,
-     "<HTML>\n<HEAD>\n<TITLE>CSO/PH Results on %s</TITLE>\n</HEAD>\n<BODY>\n",
-	    host);
-    (*Target->isa->put_block)(Target, BStrData(command), BStrLen(command));
+	      "<HTML>\n<HEAD>\n<TITLE>CSO/PH Results on %s</TITLE>\n</HEAD>\n<BODY>\n",
+	      host);
+    (*Target->isa->put_block) (Target, BStrData(command), BStrLen(command));
     BStrFree(command);
     FREE(host);
 
     BStrCopy(content, anAnchor->post_data);
 
-    if (BStrData(content)[BStrLen(content)-1] != '&')
+    if (BStrData(content)[BStrLen(content) - 1] != '&')
 	BStrCat0(content, "&");
 
     data = BStrData(content);
@@ -1565,27 +1560,27 @@ static int HTLoadCSO (
     for (i = 0; i < len; i++) {
 	if (!data[i] || data[i] == '&') {
 	    /*
-	    **	Value parsed.  Unescape characters and look for first '='
-	    **	to delimit field name from value.
-	    */
+	     * Value parsed.  Unescape characters and look for first '=' to
+	     * delimit field name from value.
+	     */
 	    flen = i - start;
 	    finish = start + flen;
 	    data[finish] = '\0';
 	    for (j = start; j < finish; j++) {
 		if (data[j] == '=') {
 		    /*
-		    **	data[start..j-1] is field name,
-		    **	[j+1..finish-1] is value.
-		    */
-		    if ((data[start+1] == '_') &&
+		     * data[start..j-1] is field name,
+		     * [j+1..finish-1] is value.
+		     */
+		    if ((data[start + 1] == '_') &&
 			((data[start] == 'r') || (data[start] == 'q'))) {
 			/*
-			**  Decode fields number and lookup field info.
-			*/
-			sscanf (&data[start+2], "%d=", &ndx);
+			 * Decode fields number and lookup field info.
+			 */
+			sscanf(&data[start + 2], "%d=", &ndx);
 			for (fld = CSOfields; fld; fld = fld->next) {
-			    if (ndx==fld->id) {
-				if ((j+1) >= finish)
+			    if (ndx == fld->id) {
+				if ((j + 1) >= finish)
 				    break;	/* ignore nulls */
 				if (data[start] == 'q') {
 				    /*
@@ -1600,13 +1595,13 @@ static int HTLoadCSO (
 					    BStrCat0(command, " ");
 					}
 					HTBprintf(&command, "%s=\"%s\"",
-						  fld->name, &data[j+1]);
+						  fld->name, &data[j + 1]);
 				    } else {
 					strcpy(buf,
-				"Warning: non-lookup field ignored<BR>\n");
-					(*Target->isa->put_block)(Target,
-								  buf,
-								  strlen(buf));
+					       "Warning: non-lookup field ignored<BR>\n");
+					(*Target->isa->put_block) (Target,
+								   buf,
+								   strlen(buf));
 				    }
 				} else if (data[start] == 'r') {
 				    fld->explicit_return = 1;
@@ -1615,9 +1610,9 @@ static int HTLoadCSO (
 			    }
 			}
 		    } else if (!strncmp(&data[start], "return=", 7)) {
-			if (!strcmp(&data[start+7], "all")) {
+			if (!strcmp(&data[start + 7], "all")) {
 			    return_type = 1;
-			} else if (!strcmp(&data[start+7], "selected")) {
+			} else if (!strcmp(&data[start + 7], "selected")) {
 			    return_type = 2;
 			}
 		    }
@@ -1630,17 +1625,17 @@ static int HTLoadCSO (
     if (isBEmpty(command) || !has_indexed) {
 	NETCLOSE(s);
 	strcpy(buf,
-  "<EM>Error:</EM> At least one indexed field value must be specified!\n");
-	(*Target->isa->put_block)(Target, buf, strlen(buf));
+	       "<EM>Error:</EM> At least one indexed field value must be specified!\n");
+	(*Target->isa->put_block) (Target, buf, strlen(buf));
 	strcpy(buf, "</BODY>\n</HTML>\n");
-	(*Target->isa->put_block)(Target, buf, strlen(buf));
-	(*Target->isa->_free)(Target);
+	(*Target->isa->put_block) (Target, buf, strlen(buf));
+	(*Target->isa->_free) (Target);
 	free_CSOfields();
 	return HT_LOADED;
     }
     /*
-    **	Append return fields.
-    */
+     * Append return fields.
+     */
     if (return_type == 1) {
 	BStrCat0(command, " return all");
     } else if (return_type == 2) {
@@ -1653,12 +1648,12 @@ static int HTLoadCSO (
     }
     HTBprintf(&command, "%c%c", CR, LF);
     strcpy(buf, "<H2>\n<EM>CSO/PH command:</EM> ");
-    (*Target->isa->put_block)(Target, buf, strlen(buf));
-    (*Target->isa->put_block)(Target, BStrData(command), BStrLen(command));
+    (*Target->isa->put_block) (Target, buf, strlen(buf));
+    (*Target->isa->put_block) (Target, BStrData(command), BStrLen(command));
     strcpy(buf, "</H2>\n");
-    (*Target->isa->put_block)(Target, buf, strlen(buf));
+    (*Target->isa->put_block) (Target, buf, strlen(buf));
     if (TRACE) {
-	CTRACE((tfp, "HTLoadCSO: Writing command `"));  
+	CTRACE((tfp, "HTLoadCSO: Writing command `"));
 	trace_bstring(command);
 	CTRACE((tfp, "' to socket %d\n", s));
     }
@@ -1671,49 +1666,48 @@ static int HTLoadCSO (
     }
     generate_cso_report(Target);
     NETCLOSE(s);
-    (*Target->isa->put_block)(Target, end_form, sizeof(end_form)-1);
-    (*Target->isa->_free)(Target);
+    (*Target->isa->put_block) (Target, end_form, sizeof(end_form) - 1);
+    (*Target->isa->_free) (Target);
     FREE(host);
     free_CSOfields();
     return HT_LOADED;
 }
 
 /*	Load by name.						HTLoadGopher
-**	=============
-**
-**  Bug:  No decoding of strange data types as yet.
-**
-*/
-static int HTLoadGopher (
-	const char *		arg,
-	HTParentAnchor *	anAnchor,
-	HTFormat		format_out,
-	HTStream*		sink)
+ *	=============
+ *
+ *  Bug:  No decoding of strange data types as yet.
+ *
+ */
+static int HTLoadGopher(const char *arg,
+			HTParentAnchor *anAnchor,
+			HTFormat format_out,
+			HTStream *sink)
 {
-    char *command;			/* The whole command */
-    int status;				/* tcp return */
-    char gtype;				/* Gopher Node type */
-    char * selector;			/* Selector string */
+    char *command;		/* The whole command */
+    int status;			/* tcp return */
+    char gtype;			/* Gopher Node type */
+    char *selector;		/* Selector string */
 
     if (!acceptable_inited)
-	 init_acceptable();
+	init_acceptable();
 
     if (!arg)
-	return -3;		/* Bad if no name sepcified	*/
+	return -3;		/* Bad if no name sepcified     */
     if (!*arg)
-	return -2;		/* Bad if name had zero length	*/
+	return -2;		/* Bad if name had zero length  */
     CTRACE((tfp, "HTGopher: Looking for %s\n", arg));
 
     /*
-    **	If it's a port 105 GOPHER_CSO gtype with no ISINDEX token ('?'),
-    **	use the form-based CSO gateway (otherwise, return an ISINDEX
-    **	cover page or do the ISINDEX search). - FM
-    */
+     * If it's a port 105 GOPHER_CSO gtype with no ISINDEX token ('?'), use the
+     * form-based CSO gateway (otherwise, return an ISINDEX cover page or do
+     * the ISINDEX search).  - FM
+     */
     {
 	int len;
 
 	if ((len = strlen(arg)) > 5) {
-	    if (0 == strcmp((const char *)&arg[len-6], ":105/2")) {
+	    if (0 == strcmp((const char *) &arg[len - 6], ":105/2")) {
 		/* Use CSO gateway. */
 		CTRACE((tfp, "HTGopher: Passing to CSO/PH gateway.\n"));
 		return HTLoadCSO(arg, anAnchor, format_out, sink);
@@ -1722,8 +1716,8 @@ static int HTLoadGopher (
     }
 
     /*
-    **	If it's a port 79/0[/...] URL, use the finger gateway. - FM
-    */
+     * If it's a port 79/0[/...] URL, use the finger gateway.  - FM
+     */
     if (strstr(arg, ":79/0") != NULL) {
 #ifndef DISABLE_FINGER
 	CTRACE((tfp, "HTGopher: Passing to finger gateway.\n"));
@@ -1735,78 +1729,86 @@ static int HTLoadGopher (
     }
 
     /*
-    **	Get entity type, and selector string.
-    */
+     * Get entity type, and selector string.
+     */
     {
-	char * p1 = HTParse(arg, "", PARSE_PATH|PARSE_PUNCTUATION);
+	char *p1 = HTParse(arg, "", PARSE_PATH | PARSE_PUNCTUATION);
+
 	gtype = '1';		/* Default = menu */
 	selector = p1;
-	if ((*selector++=='/') && (*selector)) {	/* Skip first slash */
-	    gtype = *selector++;			/* Pick up gtype */
+	if ((*selector++ == '/') && (*selector)) {	/* Skip first slash */
+	    gtype = *selector++;	/* Pick up gtype */
 	}
 	if (gtype == GOPHER_INDEX) {
-	    char * query;
+	    char *query;
+
 	    /*
-	    **	Search is allowed.
-	    */
+	     * Search is allowed.
+	     */
 	    HTAnchor_setIndex(anAnchor, anAnchor->address);
 	    query = strchr(selector, '?');	/* Look for search string */
-	    if (!query || !query[1]) {		/* No search required */
+	    if (!query || !query[1]) {	/* No search required */
 		target = HTML_new(anAnchor, format_out, sink);
 		targetClass = *target->isa;
 		display_index(arg, anAnchor);	/* Display "cover page" */
-		return HT_LOADED;		/* Local function only */
+		return HT_LOADED;	/* Local function only */
 	    }
-	    *query++ = '\0';			/* Skip '?'	*/
+	    *query++ = '\0';	/* Skip '?'     */
 	    command =
-		    (char *)malloc(strlen(selector)+ 1 + strlen(query)+ 2 + 1);
-	      if (command == NULL)
-		  outofmem(__FILE__, "HTLoadGopher");
+		(char *) malloc(strlen(selector) + 1 + strlen(query) + 2 + 1);
+	    if (command == NULL)
+		outofmem(__FILE__, "HTLoadGopher");
 
 	    de_escape(command, selector);	/* Bug fix TBL 921208 */
 
 	    strcat(command, "\t");
 
-	    {					/* Remove plus signs 921006 */
+	    {			/* Remove plus signs 921006 */
 		char *p;
-		for (p=query; *p; p++) {
-		    if (*p == '+') *p = ' ';
+
+		for (p = query; *p; p++) {
+		    if (*p == '+')
+			*p = ' ';
 		}
 	    }
 
-	    de_escape(&command[strlen(command)], query);/* bug fix LJM 940415 */
+	    de_escape(&command[strlen(command)], query);	/* bug fix LJM 940415 */
 	} else if (gtype == GOPHER_CSO) {
-	    char * query;
+	    char *query;
+
 	    /*
-	    **	Search is allowed.
-	    */
+	     * Search is allowed.
+	     */
 	    query = strchr(selector, '?');	/* Look for search string */
-	    if (!query || !query[1]) {		/* No search required */
+	    if (!query || !query[1]) {	/* No search required */
 		target = HTML_new(anAnchor, format_out, sink);
 		targetClass = *target->isa;
 		display_cso(arg, anAnchor);	/* Display "cover page" */
-		return HT_LOADED;		/* Local function only */
+		return HT_LOADED;	/* Local function only */
 	    }
 	    HTAnchor_setIndex(anAnchor, anAnchor->address);
-	    *query++ = '\0';			/* Skip '?'	*/
-	    command = (char *)malloc(strlen("query")+1 + strlen(query)+2+1);
-	      if (command == NULL)
-		  outofmem(__FILE__, "HTLoadGopher");
+	    *query++ = '\0';	/* Skip '?'     */
+	    command = (char *) malloc(strlen("query") + 1 +
+				      strlen(query) + 2 + 1);
+	    if (command == NULL)
+		outofmem(__FILE__, "HTLoadGopher");
 
 	    de_escape(command, selector);	/* Bug fix TBL 921208 */
 
 	    strcpy(command, "query ");
 
-	    {					/* Remove plus signs 921006 */
+	    {			/* Remove plus signs 921006 */
 		char *p;
-		for (p=query; *p; p++) {
-		    if (*p == '+') *p = ' ';
+
+		for (p = query; *p; p++) {
+		    if (*p == '+')
+			*p = ' ';
 		}
 	    }
-	    de_escape(&command[strlen(command)], query);/* bug fix LJM 940415 */
+	    de_escape(&command[strlen(command)], query);	/* bug fix LJM 940415 */
 
-	} else {				/* Not index */
-	    command = (char *)malloc(strlen(selector)+2+1);
+	} else {		/* Not index */
+	    command = (char *) malloc(strlen(selector) + 2 + 1);
 	    if (command == NULL)
 		outofmem(__FILE__, "HTLoadGopher");
 	    de_escape(command, selector);
@@ -1815,28 +1817,29 @@ static int HTLoadGopher (
     }
 
     {
-	char * p = command + strlen(command);
+	char *p = command + strlen(command);
+
 	*p++ = CR;		/* Macros to be correct on Mac */
 	*p++ = LF;
 	*p++ = '\0';
     }
 
     /*
-    **	Set up a socket to the server for the data.
-    */
-    status = HTDoConnect (arg, "gopher", GOPHER_PORT, &s);
+     * Set up a socket to the server for the data.
+     */
+    status = HTDoConnect(arg, "gopher", GOPHER_PORT, &s);
     if (status == HT_INTERRUPTED) {
 	/*
-	**  Interrupt cleanly.
-	*/
+	 * Interrupt cleanly.
+	 */
 	CTRACE((tfp, "HTGopher: Interrupted on connect; recovering cleanly.\n"));
-	_HTProgress (CONNECTION_INTERRUPTED);
+	_HTProgress(CONNECTION_INTERRUPTED);
 	FREE(command);
 	return HT_NOT_LOADED;
     }
     if (status < 0) {
 	CTRACE((tfp, "HTGopher: Unable to connect to remote host for `%s'.\n",
-		    arg));
+		arg));
 	FREE(command);
 	return HTInetStatus("connect");
     }
@@ -1844,39 +1847,40 @@ static int HTLoadGopher (
     HTInitInput(s);		/* Set up input buffering */
 
     CTRACE((tfp, "HTGopher: Connected, writing command `%s' to socket %d\n",
-		command, s));
+	    command, s));
 
 #ifdef NOT_ASCII
     {
-	char * p;
+	char *p;
+
 	for (p = command; *p; p++) {
 	    *p = TOASCII(*p);
 	}
     }
 #endif
 
-    _HTProgress (GOPHER_SENDING_REQUEST);
+    _HTProgress(GOPHER_SENDING_REQUEST);
 
-    status = NETWRITE(s, command, (int)strlen(command));
+    status = NETWRITE(s, command, (int) strlen(command));
     FREE(command);
     if (status < 0) {
 	CTRACE((tfp, "HTGopher: Unable to send command.\n"));
 	return HTInetStatus("send");
     }
 
-    _HTProgress (GOPHER_SENT_REQUEST);
+    _HTProgress(GOPHER_SENT_REQUEST);
 
     /*
-    **	Now read the data from the socket.
-    */
+     * Now read the data from the socket.
+     */
     switch (gtype) {
 
-    case GOPHER_TEXT :
+    case GOPHER_TEXT:
 	HTParseSocket(WWW_PLAINTEXT, format_out, anAnchor, s, sink);
 	break;
 
-    case GOPHER_HTML :
-    case GOPHER_CHTML :
+    case GOPHER_HTML:
+    case GOPHER_CHTML:
 	HTParseSocket(WWW_HTML, format_out, anAnchor, s, sink);
 	break;
 
@@ -1884,11 +1888,11 @@ static int HTLoadGopher (
     case GOPHER_IMAGE:
     case GOPHER_PLUS_IMAGE:
 	HTParseSocket(HTAtom_for("image/gif"),
-			   format_out, anAnchor, s, sink);
+		      format_out, anAnchor, s, sink);
 	break;
 
-    case GOPHER_MENU :
-    case GOPHER_INDEX :
+    case GOPHER_MENU:
+    case GOPHER_INDEX:
 	target = HTML_new(anAnchor, format_out, sink);
 	targetClass = *target->isa;
 	parse_menu(arg, anAnchor);
@@ -1900,8 +1904,8 @@ static int HTLoadGopher (
 	parse_cso(arg, anAnchor);
 	break;
 
-    case GOPHER_SOUND :
-    case GOPHER_PLUS_SOUND :
+    case GOPHER_SOUND:
+    case GOPHER_PLUS_SOUND:
 	HTParseSocket(WWW_AUDIO, format_out, anAnchor, s, sink);
 	break;
 
@@ -1911,7 +1915,7 @@ static int HTLoadGopher (
 
     case GOPHER_PLUS_PDF:
 	HTParseSocket(HTAtom_for("application/pdf"), format_out, anAnchor,
-				  s, sink);
+		      s, sink);
 	break;
 
     case GOPHER_MACBINHEX:
@@ -1920,12 +1924,12 @@ static int HTLoadGopher (
     case GOPHER_BINARY:
     default:
 	/*
-	**  Specifying WWW_UNKNOWN forces dump to local disk.
-	*/
-	HTParseSocket (WWW_UNKNOWN, format_out, anAnchor, s, sink);
+	 * Specifying WWW_UNKNOWN forces dump to local disk.
+	 */
+	HTParseSocket(WWW_UNKNOWN, format_out, anAnchor, s, sink);
 	break;
 
-    } /* switch(gtype) */
+    }				/* switch(gtype) */
 
     NETCLOSE(s);
     return HT_LOADED;
@@ -1933,12 +1937,14 @@ static int HTLoadGopher (
 
 #ifdef GLOBALDEF_IS_MACRO
 #define _HTGOPHER_C_1_INIT { "gopher", HTLoadGopher, NULL }
-GLOBALDEF (HTProtocol, HTGopher, _HTGOPHER_C_1_INIT);
+GLOBALDEF(HTProtocol, HTGopher, _HTGOPHER_C_1_INIT);
 #define _HTCSO_C_1_INIT { "cso", HTLoadCSO, NULL }
-GLOBALDEF (HTProtocol, HTCSO, _HTCSO_C_1_INIT);
+GLOBALDEF(HTProtocol, HTCSO, _HTCSO_C_1_INIT);
 #else
-GLOBALDEF HTProtocol HTGopher = { "gopher", HTLoadGopher, NULL };
-GLOBALDEF HTProtocol HTCSO = { "cso", HTLoadCSO, NULL };
+GLOBALDEF HTProtocol HTGopher =
+{"gopher", HTLoadGopher, NULL};
+GLOBALDEF HTProtocol HTCSO =
+{"cso", HTLoadCSO, NULL};
 #endif /* GLOBALDEF_IS_MACRO */
 
 #endif /* not DISABLE_GOPHER */
diff --git a/WWW/Library/Implementation/HTGopher.h b/WWW/Library/Implementation/HTGopher.h
index 624c04d4..c0207fb4 100644
--- a/WWW/Library/Implementation/HTGopher.h
+++ b/WWW/Library/Implementation/HTGopher.h
@@ -7,7 +7,6 @@
                          
  */
 
-
 #ifndef HTGOPHER_H
 #define HTGOPHER_H
 
@@ -16,6 +15,7 @@
 
 #ifdef GLOBALREF_IS_MACRO
 extern GLOBALREF (HTProtocol, HTGopher);
+
 #else
 GLOBALREF HTProtocol HTGopher;
 #endif /* GLOBALREF_IS_MACRO */
diff --git a/WWW/Library/Implementation/HTGroup.c b/WWW/Library/Implementation/HTGroup.c
index 36cfea16..eed577f3 100644
--- a/WWW/Library/Implementation/HTGroup.c
+++ b/WWW/Library/Implementation/HTGroup.c
@@ -1,95 +1,90 @@
-
 /* MODULE							HTGroup.c
-**		GROUP FILE ROUTINES
-**
-**	Contains group file parser and routines to match IP
-**	address templates and to find out group membership.
-**
-**
-** AUTHORS:
-**	AL	Ari Luotonen	luotonen@dxcern.cern.ch
-**
-** HISTORY:
-**
-**
-** BUGS:
-**
-**
-**
-** GROUP DEFINITION GRAMMAR:
-**
-**	string = "sequence of alphanumeric characters"
-**	user_name ::= string
-**	group_name ::= string
-**	group_ref ::= group_name
-**	user_def ::= user_name | group_ref
-**	user_def_list ::= user_def { ',' user_def }
-**	user_part = user_def | '(' user_def_list ')'
-**
-**	templ = "sequence of alphanumeric characters and '*'s"
-**	ip_number_mask ::= templ '.' templ '.' templ '.' templ
-**	domain_name_mask ::= templ { '.' templ }
-**	address ::= ip_number_mask | domain_name_mask
-**	address_def ::= address
-**	address_def_list ::= address_def { ',' address_def }
-**	address_part = address_def | '(' address_def_list ')'
-**
-**	item ::= [user_part] ['@' address_part]
-**	item_list ::= item { ',' item }
-**	group_def ::= item_list
-**	group_decl ::= group_name ':' group_def
-**
-*/
-
+ *		GROUP FILE ROUTINES
+ *
+ *	Contains group file parser and routines to match IP
+ *	address templates and to find out group membership.
+ *
+ *
+ * AUTHORS:
+ *	AL	Ari Luotonen	luotonen@dxcern.cern.ch
+ *
+ * HISTORY:
+ *
+ *
+ * BUGS:
+ *
+ *
+ *
+ * GROUP DEFINITION GRAMMAR:
+ *
+ *	string = "sequence of alphanumeric characters"
+ *	user_name ::= string
+ *	group_name ::= string
+ *	group_ref ::= group_name
+ *	user_def ::= user_name | group_ref
+ *	user_def_list ::= user_def { ',' user_def }
+ *	user_part = user_def | '(' user_def_list ')'
+ *
+ *	templ = "sequence of alphanumeric characters and '*'s"
+ *	ip_number_mask ::= templ '.' templ '.' templ '.' templ
+ *	domain_name_mask ::= templ { '.' templ }
+ *	address ::= ip_number_mask | domain_name_mask
+ *	address_def ::= address
+ *	address_def_list ::= address_def { ',' address_def }
+ *	address_part = address_def | '(' address_def_list ')'
+ *
+ *	item ::= [user_part] ['@' address_part]
+ *	item_list ::= item { ',' item }
+ *	group_def ::= item_list
+ *	group_decl ::= group_name ':' group_def
+ *
+ */
 
 #include <HTUtils.h>
 
 #include <HTAAUtil.h>
-#include <HTLex.h>	/* Lexical analysor	*/
-#include <HTGroup.h>	/* Implemented here	*/
+#include <HTLex.h>		/* Lexical analysor     */
+#include <HTGroup.h>		/* Implemented here     */
 
 #include <LYUtils.h>
 #include <LYLeaks.h>
 
 /*
-** Group file parser
-*/
+ * Group file parser
+ */
 
 typedef HTList UserDefList;
 typedef HTList AddressDefList;
 
 typedef struct {
-    UserDefList *	user_def_list;
-    AddressDefList *	address_def_list;
+    UserDefList *user_def_list;
+    AddressDefList *address_def_list;
 } Item;
 
 typedef struct {
-    char *	name;
-    GroupDef *	translation;
+    char *name;
+    GroupDef *translation;
 } Ref;
 
-
-
-static void syntax_error (FILE *	 fp,
-				char *	 msg,
-				LexItem lex_item)
+static void syntax_error(FILE *fp, char *msg,
+			 LexItem lex_item)
 {
     char buffer[41];
     int cnt = 0;
     int ch;
 
-    while ((ch = getc(fp)) != EOF  &&  ch != '\n')
-	if (cnt < 40) buffer[cnt++] = (char) ch;
-    buffer[cnt] = (char)0;
+    while ((ch = getc(fp)) != EOF && ch != '\n')
+	if (cnt < 40)
+	    buffer[cnt++] = (char) ch;
+    buffer[cnt] = (char) 0;
 
     CTRACE((tfp, "%s %d before: '%s'\nHTGroup.c: %s (got %s)\n",
-		"HTGroup.c: Syntax error in rule file at line",
-		HTlex_line, buffer, msg, lex_verbose(lex_item)));
+	    "HTGroup.c: Syntax error in rule file at line",
+	    HTlex_line, buffer, msg, lex_verbose(lex_item)));
     HTlex_line++;
 }
 
-
-static AddressDefList *parse_address_part (FILE *  fp)
+static AddressDefList *parse_address_part(FILE *fp)
 {
     AddressDefList *address_def_list = NULL;
     LexItem lex_item;
@@ -98,7 +93,7 @@ static AddressDefList *parse_address_part (FILE *  fp)
     lex_item = lex(fp);
     if (lex_item == LEX_ALPH_STR || lex_item == LEX_TMPL_STR)
 	only_one = YES;
-    else if (lex_item != LEX_OPEN_PAREN  ||
+    else if (lex_item != LEX_OPEN_PAREN ||
 	     ((lex_item = lex(fp)) != LEX_ALPH_STR &&
 	      lex_item != LEX_TMPL_STR)) {
 	syntax_error(fp, "Expecting a single address or '(' beginning list",
@@ -107,23 +102,24 @@ static AddressDefList *parse_address_part (FILE *  fp)
     }
     address_def_list = HTList_new();
 
-    for(;;) {
+    for (;;) {
 	Ref *ref = typecalloc(Ref);
+
 	if (ref == NULL)
 	    outofmem(__FILE__, "parse_address_part");
 	ref->name = NULL;
 	ref->translation = NULL;
 	StrAllocCopy(ref->name, HTlex_buffer);
 
-	HTList_addObject(address_def_list, (void*)ref);
+	HTList_addObject(address_def_list, (void *) ref);
 
 	if (only_one || (lex_item = lex(fp)) != LEX_ITEM_SEP)
 	    break;
 	/*
-	** Here lex_item == LEX_ITEM_SEP; after item separator it
-	** is ok to have one or more newlines (LEX_REC_SEP) and
-	** they are ignored (continuation line).
-	*/
+	 * Here lex_item == LEX_ITEM_SEP; after item separator it
+	 * is ok to have one or more newlines (LEX_REC_SEP) and
+	 * they are ignored (continuation line).
+	 */
 	do {
 	    lex_item = lex(fp);
 	} while (lex_item == LEX_REC_SEP);
@@ -145,8 +141,7 @@ static AddressDefList *parse_address_part (FILE *  fp)
     return address_def_list;
 }
 
-
-static UserDefList *parse_user_part (FILE *  fp)
+static UserDefList *parse_user_part(FILE *fp)
 {
     UserDefList *user_def_list = NULL;
     LexItem lex_item;
@@ -155,7 +150,7 @@ static UserDefList *parse_user_part (FILE *  fp)
     lex_item = lex(fp);
     if (lex_item == LEX_ALPH_STR)
 	only_one = YES;
-    else if (lex_item != LEX_OPEN_PAREN  ||
+    else if (lex_item != LEX_OPEN_PAREN ||
 	     (lex_item = lex(fp)) != LEX_ALPH_STR) {
 	syntax_error(fp, "Expecting a single name or '(' beginning list",
 		     lex_item);
@@ -165,21 +160,22 @@ static UserDefList *parse_user_part (FILE *  fp)
 
     for (;;) {
 	Ref *ref = typecalloc(Ref);
+
 	if (ref == NULL)
 	    outofmem(__FILE__, "parse_user_part");
 	ref->name = NULL;
 	ref->translation = NULL;
 	StrAllocCopy(ref->name, HTlex_buffer);
 
-	HTList_addObject(user_def_list, (void*)ref);
+	HTList_addObject(user_def_list, (void *) ref);
 
 	if (only_one || (lex_item = lex(fp)) != LEX_ITEM_SEP)
 	    break;
 	/*
-	** Here lex_item == LEX_ITEM_SEP; after item separator it
-	** is ok to have one or more newlines (LEX_REC_SEP) and
-	** they are ignored (continuation line).
-	*/
+	 * Here lex_item == LEX_ITEM_SEP; after item separator it
+	 * is ok to have one or more newlines (LEX_REC_SEP) and
+	 * they are ignored (continuation line).
+	 */
 	do {
 	    lex_item = lex(fp);
 	} while (lex_item == LEX_REC_SEP);
@@ -201,8 +197,7 @@ static UserDefList *parse_user_part (FILE *  fp)
     return user_def_list;
 }
 
-
-static Item *parse_item (FILE *  fp)
+static Item *parse_item(FILE *fp)
 {
     Item *item = NULL;
     UserDefList *user_def_list = NULL;
@@ -222,8 +217,7 @@ static Item *parse_item (FILE *  fp)
 	    lex_item == LEX_OPEN_PAREN) {
 	    unlex(lex_item);
 	    address_def_list = parse_address_part(fp);
-	}
-	else {
+	} else {
 	    if (user_def_list) {
 		HTList_delete(user_def_list);	/* @@@@ */
 		user_def_list = NULL;
@@ -232,8 +226,8 @@ static Item *parse_item (FILE *  fp)
 			 lex_item);
 	    return NULL;
 	}
-    }
-    else unlex(lex_item);
+    } else
+	unlex(lex_item);
 
     if (!user_def_list && !address_def_list) {
 	syntax_error(fp, "Empty item not allowed", lex_item);
@@ -247,30 +241,29 @@ static Item *parse_item (FILE *  fp)
     return item;
 }
 
-
-static ItemList *parse_item_list (FILE *  fp)
+static ItemList *parse_item_list(FILE *fp)
 {
     ItemList *item_list = HTList_new();
     Item *item;
     LexItem lex_item;
 
-    for(;;) {
+    for (;;) {
 	if (!(item = parse_item(fp))) {
 	    HTList_delete(item_list);	/* @@@@ */
 	    item_list = NULL;
 	    return NULL;
 	}
-	HTList_addObject(item_list, (void*)item);
+	HTList_addObject(item_list, (void *) item);
 	lex_item = lex(fp);
 	if (lex_item != LEX_ITEM_SEP) {
 	    unlex(lex_item);
 	    return item_list;
 	}
 	/*
-	** Here lex_item == LEX_ITEM_SEP; after item separator it
-	** is ok to have one or more newlines (LEX_REC_SEP) and
-	** they are ignored (continuation line).
-	*/
+	 * Here lex_item == LEX_ITEM_SEP; after item separator it
+	 * is ok to have one or more newlines (LEX_REC_SEP) and
+	 * they are ignored (continuation line).
+	 */
 	do {
 	    lex_item = lex(fp);
 	} while (lex_item == LEX_REC_SEP);
@@ -278,8 +271,7 @@ static ItemList *parse_item_list (FILE *  fp)
     }
 }
 
-
-GroupDef *HTAA_parseGroupDef (FILE *  fp)
+GroupDef *HTAA_parseGroupDef(FILE *fp)
 {
     ItemList *item_list = NULL;
     GroupDef *group_def = NULL;
@@ -301,8 +293,7 @@ GroupDef *HTAA_parseGroupDef (FILE *  fp)
     return group_def;
 }
 
-
-static GroupDef *parse_group_decl (FILE *  fp)
+static GroupDef *parse_group_decl(FILE *fp)
 {
     char *group_name = NULL;
     GroupDef *group_def = NULL;
@@ -334,20 +325,18 @@ static GroupDef *parse_group_decl (FILE *  fp)
     return group_def;
 }
 
-
-
 /*
-** Group manipulation routines
-*/
+ * Group manipulation routines
+ */
 
-static GroupDef *find_group_def (GroupDefList *	group_list,
-				       const char *	group_name)
+static GroupDef *find_group_def(GroupDefList *group_list,
+				const char *group_name)
 {
     if (group_list && group_name) {
 	GroupDefList *cur = group_list;
 	GroupDef *group_def;
 
-	while (NULL != (group_def = (GroupDef*)HTList_nextObject(cur))) {
+	while (NULL != (group_def = (GroupDef *) HTList_nextObject(cur))) {
 	    if (!strcmp(group_name, group_def->group_name)) {
 		return group_def;
 	    }
@@ -356,19 +345,18 @@ static GroupDef *find_group_def (GroupDefList *	group_list,
     return NULL;
 }
 
-
-void HTAA_resolveGroupReferences (GroupDef *	group_def,
-					      GroupDefList *	group_def_list)
+void HTAA_resolveGroupReferences(GroupDef *group_def,
+				 GroupDefList *group_def_list)
 {
     if (group_def && group_def->item_list && group_def_list) {
 	ItemList *cur1 = group_def->item_list;
 	Item *item;
 
-	while (NULL != (item = (Item*)HTList_nextObject(cur1))) {
+	while (NULL != (item = (Item *) HTList_nextObject(cur1))) {
 	    UserDefList *cur2 = item->user_def_list;
 	    Ref *ref;
 
-	    while (NULL != (ref = (Ref*)HTList_nextObject(cur2)))
+	    while (NULL != (ref = (Ref *) HTList_nextObject(cur2)))
 		ref->translation = find_group_def(group_def_list, ref->name);
 
 	    /* Does NOT translate address_def_list */
@@ -376,16 +364,14 @@ void HTAA_resolveGroupReferences (GroupDef *	group_def,
     }
 }
 
-
-static void add_group_def (GroupDefList * group_def_list,
-				 GroupDef *	 group_def)
+static void add_group_def(GroupDefList *group_def_list,
+			  GroupDef *group_def)
 {
     HTAA_resolveGroupReferences(group_def, group_def_list);
-    HTList_addObject(group_def_list, (void*)group_def);
+    HTList_addObject(group_def_list, (void *) group_def);
 }
 
-
-static GroupDefList *parse_group_file (FILE *  fp)
+static GroupDefList *parse_group_file(FILE *fp)
 {
     GroupDefList *group_def_list = HTList_new();
     GroupDef *group_def;
@@ -396,53 +382,53 @@ static GroupDefList *parse_group_file (FILE *  fp)
     return group_def_list;
 }
 
-
 /*
-** Trace functions
-*/
+ * Trace functions
+ */
 
-static void print_item (Item *  item)
+static void print_item(Item *item)
 {
     if (!item)
 	fprintf(tfp, "\tNULL-ITEM\n");
     else {
 	UserDefList *cur1 = item->user_def_list;
 	AddressDefList *cur2 = item->address_def_list;
-	Ref *user_ref = (Ref*)HTList_nextObject(cur1);
-	Ref *addr_ref = (Ref*)HTList_nextObject(cur2);
+	Ref *user_ref = (Ref *) HTList_nextObject(cur1);
+	Ref *addr_ref = (Ref *) HTList_nextObject(cur2);
 
 	if (user_ref) {
 	    fprintf(tfp, "\t[%s%s", user_ref->name,
 		    (user_ref->translation ? "*REF*" : ""));
-	    while (NULL != (user_ref = (Ref*)HTList_nextObject(cur1)))
+	    while (NULL != (user_ref = (Ref *) HTList_nextObject(cur1)))
 		fprintf(tfp, "; %s%s", user_ref->name,
 			(user_ref->translation ? "*REF*" : ""));
 	    fprintf(tfp, "] ");
-	} else fprintf(tfp, "\tANYBODY ");
+	} else
+	    fprintf(tfp, "\tANYBODY ");
 
 	if (addr_ref) {
 	    fprintf(tfp, "@ [%s", addr_ref->name);
-	    while (NULL != (addr_ref = (Ref*)HTList_nextObject(cur2)))
+	    while (NULL != (addr_ref = (Ref *) HTList_nextObject(cur2)))
 		fprintf(tfp, "; %s", addr_ref->name);
 	    fprintf(tfp, "]\n");
-	} else fprintf(tfp, "@ ANYADDRESS\n");
+	} else
+	    fprintf(tfp, "@ ANYADDRESS\n");
     }
 }
 
-
-static void print_item_list (ItemList *  item_list)
+static void print_item_list(ItemList *item_list)
 {
     ItemList *cur = item_list;
     Item *item;
 
     if (!item_list)
 	fprintf(tfp, "EMPTY");
-    else while (NULL != (item = (Item*)HTList_nextObject(cur)))
-	print_item(item);
+    else
+	while (NULL != (item = (Item *) HTList_nextObject(cur)))
+	    print_item(item);
 }
 
-
-void HTAA_printGroupDef (GroupDef *  group_def)
+void HTAA_printGroupDef(GroupDef *group_def)
 {
     if (!group_def) {
 	fprintf(tfp, "\nNULL RECORD\n");
@@ -456,35 +442,32 @@ void HTAA_printGroupDef (GroupDef *  group_def)
     fprintf(tfp, "\n");
 }
 
-
-static void print_group_def_list (GroupDefList *  group_list)
+static void print_group_def_list(GroupDefList *group_list)
 {
     GroupDefList *cur = group_list;
     GroupDef *group_def;
 
-    while (NULL != (group_def = (GroupDef*)HTList_nextObject(cur)))
+    while (NULL != (group_def = (GroupDef *) HTList_nextObject(cur)))
 	HTAA_printGroupDef(group_def);
 }
 
-
-
 /*
-** IP address template matching
-*/
+ * IP address template matching
+ */
 
 /* static						part_match()
-**		MATCH ONE PART OF INET ADDRESS AGAIST
-**		A PART OF MASK (inet address has 4 parts)
-** ON ENTRY:
-**	tcur	pointer to the beginning of template part.
-**	icur	pointer to the beginning of actual inet
-**		number part.
-**
-** ON EXIT:
-**	returns	YES, if match.
-*/
-static BOOL part_match (const char * tcur,
-			      const char * icur)
+ *		MATCH ONE PART OF INET ADDRESS AGAIST
+ *		A PART OF MASK (inet address has 4 parts)
+ * ON ENTRY:
+ *	tcur	pointer to the beginning of template part.
+ *	icur	pointer to the beginning of actual inet
+ *		number part.
+ *
+ * ON EXIT:
+ *	returns	YES, if match.
+ */
+static BOOL part_match(const char *tcur,
+		       const char *icur)
 {
     char required[4];
     char actual[4];
@@ -492,118 +475,115 @@ static BOOL part_match (const char * tcur,
     int cnt;
     BOOL status;
 
-    if (!tcur || !icur) return NO;
+    if (!tcur || !icur)
+	return NO;
 
-    cur=tcur;
-    cnt=0;
-    while (cnt < 3  &&  *cur && *cur != '.')
+    cur = tcur;
+    cnt = 0;
+    while (cnt < 3 && *cur && *cur != '.')
 	required[cnt++] = *(cur++);
-    required[cnt] = (char)0;
+    required[cnt] = (char) 0;
 
-    cur=icur;
-    cnt=0;
-    while (cnt < 3  &&  *cur && *cur != '.')
+    cur = icur;
+    cnt = 0;
+    while (cnt < 3 && *cur && *cur != '.')
 	actual[cnt++] = *(cur++);
-    actual[cnt] = (char)0;
+    actual[cnt] = (char) 0;
 
     status = HTAA_templateMatch(required, actual);
     CTRACE((tfp, "part_match: req: '%s' act: '%s' match: %s\n",
-		required, actual, (status ? "yes" : "no")));
+	    required, actual, (status ? "yes" : "no")));
 
     return status;
 }
 
-
-
 /* static						ip_number_match()
-**		MATCH INET NUMBER AGAINST AN INET NUMBER MASK
-** ON ENTRY:
-**	template	mask to match agaist, e.g., 128.141.*.*
-**	the_inet_addr	actual inet address, e.g., 128.141.201.74
-**
-** ON EXIT:
-**	returns		YES, if match;  NO, if not.
-*/
-static BOOL ip_number_match (const char *	template,
-				   const char *	the_inet_addr)
+ *		MATCH INET NUMBER AGAINST AN INET NUMBER MASK
+ * ON ENTRY:
+ *	template	mask to match agaist, e.g., 128.141.*.*
+ *	the_inet_addr	actual inet address, e.g., 128.141.201.74
+ *
+ * ON EXIT:
+ *	returns		YES, if match;  NO, if not.
+ */
+static BOOL ip_number_match(const char *template,
+			    const char *the_inet_addr)
 {
     const char *tcur = template;
     const char *icur = the_inet_addr;
     int cnt;
 
-    for (cnt=0; cnt<4; cnt++) {
+    for (cnt = 0; cnt < 4; cnt++) {
 	if (!tcur || !icur || !part_match(tcur, icur))
 	    return NO;
-	if (NULL != (tcur = strchr(tcur, '.'))) tcur++;
-	if (NULL != (icur = strchr(icur, '.'))) icur++;
+	if (NULL != (tcur = strchr(tcur, '.')))
+	    tcur++;
+	if (NULL != (icur = strchr(icur, '.')))
+	    icur++;
     }
     return YES;
 }
 
-
-
 /* static						is_domain_mask()
-**		DETERMINE IF A GIVEN MASK IS A
-**		DOMAIN NAME MASK OR AN INET NUMBER MASK
-** ON ENTRY:
-**	mask	either a domain name mask,
-**		e.g.
-**			*.cern.ch
-**
-**		or an inet number mask,
-**		e.g.
-**			128.141.*.*
-**
-** ON EXIT:
-**	returns	YES, if mask is a domain name mask.
-**		NO, if it is an inet number mask.
-*/
-static BOOL is_domain_mask (const char * 	mask)
+ *		DETERMINE IF A GIVEN MASK IS A
+ *		DOMAIN NAME MASK OR AN INET NUMBER MASK
+ * ON ENTRY:
+ *	mask	either a domain name mask,
+ *		e.g.
+ *			*.cern.ch
+ *
+ *		or an inet number mask,
+ *		e.g.
+ *			128.141.*.*
+ *
+ * ON EXIT:
+ *	returns	YES, if mask is a domain name mask.
+ *		NO, if it is an inet number mask.
+ */
+static BOOL is_domain_mask(const char *mask)
 {
     const char *cur = mask;
 
-    if (!mask) return NO;
+    if (!mask)
+	return NO;
 
     while (*cur) {
-	if (*cur != '.'  &&  *cur != '*'  &&  (*cur < '0' || *cur > '9'))
-	    return YES;	/* Even one non-digit makes it a domain name mask */
+	if (*cur != '.' && *cur != '*' && (*cur < '0' || *cur > '9'))
+	    return YES;		/* Even one non-digit makes it a domain name mask */
 	cur++;
     }
-    return NO;	/* All digits and dots, so it is an inet number mask */
+    return NO;			/* All digits and dots, so it is an inet number mask */
 }
 
-
-
 /* static							ip_mask_match()
-**		MATCH AN IP NUMBER MASK OR IP NAME MASK
-**		AGAINST ACTUAL IP NUMBER OR IP NAME
-**
-** ON ENTRY:
-**	mask		mask.  Mask may be either an inet number
-**			mask or a domain name mask,
-**			e.g.
-**				128.141.*.*
-**			or
-**				*.cern.ch
-**
-**	ip_number	IP number of connecting host.
-**	ip_name		IP name of the connecting host.
-**
-** ON EXIT:
-**	returns		YES, if hostname/internet number
-**			matches the mask.
-**			NO, if no match (no fire).
-*/
-static BOOL ip_mask_match (const char *	mask,
-				 const char *	ip_number,
-				 const char *	ip_name)
+ *		MATCH AN IP NUMBER MASK OR IP NAME MASK
+ *		AGAINST ACTUAL IP NUMBER OR IP NAME
+ *
+ * ON ENTRY:
+ *	mask		mask.  Mask may be either an inet number
+ *			mask or a domain name mask,
+ *			e.g.
+ *				128.141.*.*
+ *			or
+ *				*.cern.ch
+ *
+ *	ip_number	IP number of connecting host.
+ *	ip_name		IP name of the connecting host.
+ *
+ * ON EXIT:
+ *	returns		YES, if hostname/internet number
+ *			matches the mask.
+ *			NO, if no match (no fire).
+ */
+static BOOL ip_mask_match(const char *mask,
+			  const char *ip_number,
+			  const char *ip_name)
 {
     if (mask && (ip_number || ip_name)) {
 	if (is_domain_mask(mask)) {
 	    if (HTAA_templateMatch(mask, ip_name))
 		return YES;
-	}
-	else {
+	} else {
 	    if (ip_number_match(mask, ip_number))
 		return YES;
 	}
@@ -611,20 +591,17 @@ static BOOL ip_mask_match (const char *	mask,
     return NO;
 }
 
-
-
-
-static BOOL ip_in_def_list (AddressDefList *	address_def_list,
-				  char *		ip_number,
-				  char *		ip_name)
+static BOOL ip_in_def_list(AddressDefList *address_def_list,
+			   char *ip_number,
+			   char *ip_name)
 {
     if (address_def_list && (ip_number || ip_name)) {
 	AddressDefList *cur = address_def_list;
 	Ref *ref;
 
-	while (NULL != (ref = (Ref*)HTList_nextObject(cur))) {
+	while (NULL != (ref = (Ref *) HTList_nextObject(cur))) {
 	    /* Value of ref->translation is ignored, i.e., */
-	    /* no recursion for ip address tamplates.	  */
+	    /* no recursion for ip address tamplates.     */
 	    if (ip_mask_match(ref->name, ip_number, ip_name))
 		return YES;
 	}
@@ -632,50 +609,49 @@ static BOOL ip_in_def_list (AddressDefList *	address_def_list,
     return NO;
 }
 
-
 /*
-** Group file cached reading
-*/
+ * Group file cached reading
+ */
 
 typedef struct {
-    char *	   group_filename;
-    GroupDefList * group_list;
+    char *group_filename;
+    GroupDefList *group_list;
 } GroupCache;
 
 typedef HTList GroupCacheList;
 
 static GroupCacheList *group_cache_list = NULL;
 
-
-GroupDefList *HTAA_readGroupFile (const char *  filename)
+GroupDefList *HTAA_readGroupFile(const char *filename)
 {
     FILE *fp;
     GroupCache *group_cache;
 
-    if (isEmpty(filename)) return NULL;
+    if (isEmpty(filename))
+	return NULL;
 
     if (!group_cache_list)
 	group_cache_list = HTList_new();
     else {
 	GroupCacheList *cur = group_cache_list;
 
-	while (NULL != (group_cache = (GroupCache*)HTList_nextObject(cur))) {
+	while (NULL != (group_cache = (GroupCache *) HTList_nextObject(cur))) {
 	    if (!strcmp(filename, group_cache->group_filename)) {
 		CTRACE((tfp, "%s '%s' %s\n",
-			    "HTAA_readGroupFile: group file",
-			    filename, "already found in cache"));
+			"HTAA_readGroupFile: group file",
+			filename, "already found in cache"));
 		return group_cache->group_list;
-	    } /* if cache match */
-	} /* while cached files remain */
-    } /* cache exists */
+	    }			/* if cache match */
+	}			/* while cached files remain */
+    }				/* cache exists */
 
     CTRACE((tfp, "HTAA_readGroupFile: reading group file `%s'\n",
-		filename));
+	    filename));
 
     if (!(fp = fopen(filename, TXT_R))) {
 	CTRACE((tfp, "%s '%s'\n",
-		    "HTAA_readGroupFile: unable to open group file",
-		    filename));
+		"HTAA_readGroupFile: unable to open group file",
+		filename));
 	return NULL;
     }
 
@@ -685,7 +661,7 @@ GroupDefList *HTAA_readGroupFile (const char *  filename)
     group_cache->group_filename = NULL;
     StrAllocCopy(group_cache->group_filename, filename);
     group_cache->group_list = parse_group_file(fp);
-    HTList_addObject(group_cache_list, (void*)group_cache);
+    HTList_addObject(group_cache_list, (void *) group_cache);
     fclose(fp);
 
     CTRACE((tfp, "Read group file '%s', results follow:\n", filename));
@@ -695,29 +671,28 @@ GroupDefList *HTAA_readGroupFile (const char *  filename)
     return group_cache->group_list;
 }
 
-
 /* PUBLIC					HTAA_userAndInetInGroup()
-**		CHECK IF USER BELONGS TO TO A GIVEN GROUP
-**		AND THAT THE CONNECTION COMES FROM AN
-**		ADDRESS THAT IS ALLOWED BY THAT GROUP
-** ON ENTRY:
-**	group		the group definition structure.
-**	username	connecting user.
-**	ip_number	browser host IP number, optional.
-**	ip_name		browser host IP name, optional.
-**			However, one of ip_number or ip_name
-**			must be given.
-** ON EXIT:
-**	returns		HTAA_IP_MASK, if IP address mask was
-**			reason for failing.
-**			HTAA_NOT_MEMBER, if user does not belong
-**			to the group.
-**			HTAA_OK if both IP address and user are ok.
-*/
-HTAAFailReasonType HTAA_userAndInetInGroup (GroupDef * group,
-							char *	    username,
-							char *	    ip_number,
-							char *	    ip_name)
+ *		CHECK IF USER BELONGS TO TO A GIVEN GROUP
+ *		AND THAT THE CONNECTION COMES FROM AN
+ *		ADDRESS THAT IS ALLOWED BY THAT GROUP
+ * ON ENTRY:
+ *	group		the group definition structure.
+ *	username	connecting user.
+ *	ip_number	browser host IP number, optional.
+ *	ip_name		browser host IP name, optional.
+ *			However, one of ip_number or ip_name
+ *			must be given.
+ * ON EXIT:
+ *	returns		HTAA_IP_MASK, if IP address mask was
+ *			reason for failing.
+ *			HTAA_NOT_MEMBER, if user does not belong
+ *			to the group.
+ *			HTAA_OK if both IP address and user are ok.
+ */
+HTAAFailReasonType HTAA_userAndInetInGroup(GroupDef *group,
+					   char *username,
+					   char *ip_number,
+					   char *ip_name)
 {
     HTAAFailReasonType reason = HTAA_NOT_MEMBER;
 
@@ -725,7 +700,7 @@ HTAAFailReasonType HTAA_userAndInetInGroup (GroupDef * group,
 	ItemList *cur1 = group->item_list;
 	Item *item;
 
-	while (NULL != (item = (Item*)HTList_nextObject(cur1))) {
+	while (NULL != (item = (Item *) HTList_nextObject(cur1))) {
 	    if (!item->address_def_list ||	/* Any address allowed */
 		ip_in_def_list(item->address_def_list, ip_number, ip_name)) {
 
@@ -735,34 +710,34 @@ HTAAFailReasonType HTAA_userAndInetInGroup (GroupDef * group,
 		    UserDefList *cur2 = item->user_def_list;
 		    Ref *ref;
 
-		    while (NULL != (ref = (Ref*)HTList_nextObject(cur2))) {
+		    while (NULL != (ref = (Ref *) HTList_nextObject(cur2))) {
 
-			if (ref->translation) {	/* Group, check recursively */
+			if (ref->translation) {		/* Group, check recursively */
 			    reason = HTAA_userAndInetInGroup(ref->translation,
 							     username,
-							     ip_number,ip_name);
+							     ip_number, ip_name);
 			    if (reason == HTAA_OK)
 				return HTAA_OK;
-			}
-			else {	/* Username, check directly */
+			} else {	/* Username, check directly */
 			    if (username && *username &&
-				0==strcmp(ref->name, username))
+				0 == strcmp(ref->name, username))
 				return HTAA_OK;
 			}
-		    } /* Every user/group name in this group */
-		} /* search for username */
-	    } /* IP address ok */
-	    else {
+			/* Every user/group name in this group */
+		    }
+		    /* search for username */
+		}
+		/* IP address ok */
+	    } else {
 		reason = HTAA_IP_MASK;
 	    }
-	} /* while items in group */
-    } /* valid parameters */
-
+	}			/* while items in group */
+    }
+    /* valid parameters */
     return reason;		/* No match, or invalid parameters */
 }
 
-
-void GroupDef_delete (GroupDef *  group_def)
+void GroupDef_delete(GroupDef *group_def)
 {
     if (group_def) {
 	FREE(group_def->group_name);
@@ -773,4 +748,3 @@ void GroupDef_delete (GroupDef *  group_def)
 	FREE(group_def);
     }
 }
-
diff --git a/WWW/Library/Implementation/HTGroup.h b/WWW/Library/Implementation/HTGroup.h
index eee5f46c..cf9cbb19 100644
--- a/WWW/Library/Implementation/HTGroup.h
+++ b/WWW/Library/Implementation/HTGroup.h
@@ -7,32 +7,30 @@
 
 #include <HTList.h>
 
-
 typedef HTList GroupDefList;
 typedef HTList ItemList;
 
 typedef struct {
-    char *      group_name;
-    ItemList *  item_list;
+    char *group_name;
+    ItemList *item_list;
 } GroupDef;
 
-
 /*
-** Access Authorization failure reasons
-*/
+ * Access Authorization failure reasons
+ */
 typedef enum {
-    HTAA_OK,            /* 200 OK                               */
-    HTAA_OK_GATEWAY,    /* 200 OK, acting as a gateway          */
-    HTAA_NO_AUTH,       /* 401 Unauthorized, not authenticated  */
-    HTAA_NOT_MEMBER,    /* 401 Unauthorized, not authorized     */
-    HTAA_IP_MASK,       /* 403 Forbidden by IP mask             */
-    HTAA_BY_RULE,       /* 403 Forbidden by rule                */
-    HTAA_NO_ACL,        /* 403 Forbidden, ACL non-existent      */
-    HTAA_NO_ENTRY,      /* 403 Forbidden, no ACL entry          */
-    HTAA_SETUP_ERROR,   /* 403 Forbidden, server setup error    */
-    HTAA_DOTDOT,        /* 403 Forbidden, URL with /../ illegal */
-    HTAA_HTBIN,         /* 403 Forbidden, /htbin not enabled    */
-    HTAA_NOT_FOUND      /* 404 Not found, or read protected     */
+    HTAA_OK,			/* 200 OK                               */
+    HTAA_OK_GATEWAY,		/* 200 OK, acting as a gateway          */
+    HTAA_NO_AUTH,		/* 401 Unauthorized, not authenticated  */
+    HTAA_NOT_MEMBER,		/* 401 Unauthorized, not authorized     */
+    HTAA_IP_MASK,		/* 403 Forbidden by IP mask             */
+    HTAA_BY_RULE,		/* 403 Forbidden by rule                */
+    HTAA_NO_ACL,		/* 403 Forbidden, ACL non-existent      */
+    HTAA_NO_ENTRY,		/* 403 Forbidden, no ACL entry          */
+    HTAA_SETUP_ERROR,		/* 403 Forbidden, server setup error    */
+    HTAA_DOTDOT,		/* 403 Forbidden, URL with /../ illegal */
+    HTAA_HTBIN,			/* 403 Forbidden, /htbin not enabled    */
+    HTAA_NOT_FOUND		/* 404 Not found, or read protected     */
 } HTAAFailReasonType;
 
 /*
@@ -100,7 +98,8 @@ Group definition grammar
 
  */
 
-extern GroupDef *HTAA_parseGroupDef (FILE * fp);
+extern GroupDef *HTAA_parseGroupDef(FILE *fp);
+
 /*
 
 Fill in Pointers to referenced Group Definitions in a Group Definition
@@ -110,8 +109,9 @@ Fill in Pointers to referenced Group Definitions in a Group Definition
 
  */
 
-extern void HTAA_resolveGroupReferences (GroupDef *     group_def,
-                                                GroupDefList * group_def_list);
+extern void HTAA_resolveGroupReferences(GroupDef *group_def,
+					GroupDefList *group_def_list);
+
 /*
 
 Read Group File (and do caching)
@@ -121,7 +121,8 @@ Read Group File (and do caching)
 
  */
 
-extern GroupDefList *HTAA_readGroupFile (const char * filename);
+extern GroupDefList *HTAA_readGroupFile(const char *filename);
+
 /*
 
 Delete Group Definition
@@ -131,14 +132,16 @@ Delete Group Definition
 
  */
 
-extern void GroupDef_delete (GroupDef * group_def);
+extern void GroupDef_delete(GroupDef *group_def);
+
 /*
 
 Print Out Group Definition (for trace purposes)
 
  */
 
-extern void HTAA_printGroupDef (GroupDef * group_def);
+extern void HTAA_printGroupDef(GroupDef *group_def);
+
 /*
 
 Does a User Belong to a Given Set of Groups
@@ -148,26 +151,26 @@ Does a User Belong to a Given Set of Groups
  */
 
 /* PUBLIC                                       HTAA_userAndInetInGroup()
-**              CHECK IF USER BELONGS TO TO A GIVEN GROUP
-**              AND THAT THE CONNECTION COMES FROM AN
-**              ADDRESS THAT IS ALLOWED BY THAT GROUP
-** ON ENTRY:
-**      group           the group definition structure.
-**      username        connecting user.
-**      ip_number       browser host IP number, optional.
-**      ip_name         browser host IP name, optional.
-**                      However, one of ip_number or ip_name
-**                      must be given.
-** ON EXIT:
-**      returns         HTAA_IP_MASK, if IP address mask was
-**                      reason for failing.
-**                      HTAA_NOT_MEMBER, if user does not belong
-**                      to the group.
-**                      HTAA_OK if both IP address and user are ok.
-*/
-extern HTAAFailReasonType HTAA_userAndInetInGroup (GroupDef * group,
-                                                          char *     username,
-                                                          char *     ip_number,
-                                                          char *     ip_name);
+ *              CHECK IF USER BELONGS TO TO A GIVEN GROUP
+ *              AND THAT THE CONNECTION COMES FROM AN
+ *              ADDRESS THAT IS ALLOWED BY THAT GROUP
+ * ON ENTRY:
+ *      group           the group definition structure.
+ *      username        connecting user.
+ *      ip_number       browser host IP number, optional.
+ *      ip_name         browser host IP name, optional.
+ *                      However, one of ip_number or ip_name
+ *                      must be given.
+ * ON EXIT:
+ *      returns         HTAA_IP_MASK, if IP address mask was
+ *                      reason for failing.
+ *                      HTAA_NOT_MEMBER, if user does not belong
+ *                      to the group.
+ *                      HTAA_OK if both IP address and user are ok.
+ */
+extern HTAAFailReasonType HTAA_userAndInetInGroup(GroupDef *group,
+						  char *username,
+						  char *ip_number,
+						  char *ip_name);
 
 #endif /* not HTGROUP_H */
diff --git a/WWW/Library/Implementation/HTInit.h b/WWW/Library/Implementation/HTInit.h
index f5f12b88..3cd9cca6 100644
--- a/WWW/Library/Implementation/HTInit.h
+++ b/WWW/Library/Implementation/HTInit.h
@@ -1,11 +1,11 @@
 /*                   /Net/dxcern/userd/timbl/hypertext/WWW/Library/Implementation/HTInit.html
                                   INITIALISATION MODULE
                                              
-   This module resisters all the plug & play software modules which will be used in the
-   program.  This is for a browser.
+   This module resisters all the plug & play software modules which will be
+   used in the program.  This is for a browser.
    
-   To override this, just copy it and link in your version befoe you link with the
-   library.
+   To override this, just copy it and link in your version befoe you link with
+   the library.
    
    Implemented by HTInit.c by default.
    
@@ -17,9 +17,9 @@
 #ifndef HTUTILS_H
 #include <HTUtils.h>
 #endif
- 
-extern void HTFormatInit (void);
-extern void HTPreparsedFormatInit (void);
-extern void HTFileInit (void);
+
+extern void HTFormatInit(void);
+extern void HTPreparsedFormatInit(void);
+extern void HTFileInit(void);
 
 #endif /* HTINIT_H */
diff --git a/WWW/Library/Implementation/HTLex.c b/WWW/Library/Implementation/HTLex.c
index 6297a1f7..fea6aae8 100644
--- a/WWW/Library/Implementation/HTLex.c
+++ b/WWW/Library/Implementation/HTLex.c
@@ -1,57 +1,55 @@
 
 /* MODULE							HTLex.c
-**		LEXICAL ANALYSOR
-**
-** AUTHORS:
-**	AL	Ari Luotonen	luotonen@dxcern.cern.ch
-**
-** HISTORY:
-**
-**
-** BUGS:
-**
-**
-*/
+ *		LEXICAL ANALYSOR
+ *
+ * AUTHORS:
+ *	AL	Ari Luotonen	luotonen@dxcern.cern.ch
+ *
+ * HISTORY:
+ *
+ *
+ * BUGS:
+ *
+ *
+ */
 
 #include <HTUtils.h>
 
-#include <HTLex.h>	/* Implemented here */
+#include <HTLex.h>		/* Implemented here */
 
 #include <LYLeaks.h>
 
 /*
-** Global variables
-*/
-char HTlex_buffer[40];	/* Read lexical string		*/
-int HTlex_line = 1;	/* Line number in source file	*/
-
+ * Global variables
+ */
+char HTlex_buffer[40];		/* Read lexical string          */
+int HTlex_line = 1;		/* Line number in source file   */
 
 /*
-** Module-wide variables
-*/
+ * Module-wide variables
+ */
 static int lex_cnt;
 static BOOL lex_template;
 static LexItem lex_pushed_back = LEX_NONE;
 static FILE *cache = NULL;
 
-
-void unlex (LexItem  lex_item)
+void unlex(LexItem lex_item)
 {
     lex_pushed_back = lex_item;
 }
 
-
-LexItem lex (FILE *  fp)
+LexItem lex(FILE *fp)
 {
     int ch = 0;
 
-    if (fp != cache) {	/* This cache doesn't work ok because the system  */
-	cache = fp;	/* often assign same FILE structure the next open */
-	HTlex_line = 1;	/* file.  So, if there are syntax errors in setup */
-    }			/* files it may confuse things later on.	  */
-
+    if (fp != cache) {		/* This cache doesn't work ok because the system  */
+	cache = fp;		/* often assign same FILE structure the next open */
+	HTlex_line = 1;		/* file.  So, if there are syntax errors in setup */
+    }
+    /* files it may confuse things later on.      */
     if (lex_pushed_back != LEX_NONE) {
 	LexItem ret = lex_pushed_back;
+
 	lex_pushed_back = LEX_NONE;
 	return ret;
     }
@@ -59,73 +57,82 @@ LexItem lex (FILE *  fp)
     lex_cnt = 0;
     lex_template = NO;
 
-    for(;;) {
+    for (;;) {
 	switch (ch = getc(fp)) {
-	  case EOF:
-	  case ' ':
-	  case '\t':
-	  case '\r':
-	  case '\n':
-	  case ':':
-	  case ',':
-	  case '(':
-	  case ')':
-	  case '@':
+	case EOF:
+	case ' ':
+	case '\t':
+	case '\r':
+	case '\n':
+	case ':':
+	case ',':
+	case '(':
+	case ')':
+	case '@':
 	    if (lex_cnt > 0) {
-		if (ch != EOF) ungetc(ch,fp);
-		if (lex_template) return LEX_TMPL_STR;
-		else		  return LEX_ALPH_STR;
-	    }
-	    else switch(ch) {
-	      case EOF:		return LEX_EOF;
-	      case '\n':
-		HTlex_line++;	return LEX_REC_SEP;
-	      case ':':		return LEX_FIELD_SEP;
-	      case ',':		return LEX_ITEM_SEP;
-	      case '(':		return LEX_OPEN_PAREN;
-	      case ')':		return LEX_CLOSE_PAREN;
-	      case '@':		return LEX_AT_SIGN;
-	      default:	;	/* Leading white space ignored (SP,TAB,CR) */
-	    }
+		if (ch != EOF)
+		    ungetc(ch, fp);
+		if (lex_template)
+		    return LEX_TMPL_STR;
+		else
+		    return LEX_ALPH_STR;
+	    } else
+		switch (ch) {
+		case EOF:
+		    return LEX_EOF;
+		case '\n':
+		    HTlex_line++;
+		    return LEX_REC_SEP;
+		case ':':
+		    return LEX_FIELD_SEP;
+		case ',':
+		    return LEX_ITEM_SEP;
+		case '(':
+		    return LEX_OPEN_PAREN;
+		case ')':
+		    return LEX_CLOSE_PAREN;
+		case '@':
+		    return LEX_AT_SIGN;
+		default:;	/* Leading white space ignored (SP,TAB,CR) */
+		}
 	    break;
-	  default:
+	default:
 	    HTlex_buffer[lex_cnt++] = (char) ch;
 	    HTlex_buffer[lex_cnt] = '\0';
-	    if ('*' == ch) lex_template = YES;
-	} /* switch ch */
-    } /* forever */
+	    if ('*' == ch)
+		lex_template = YES;
+	}			/* switch ch */
+    }				/* forever */
 }
 
-
-char *lex_verbose (LexItem  lex_item)
+char *lex_verbose(LexItem lex_item)
 {
     static char msg[100];	/* @@@@@@@@ */
 
     switch (lex_item) {
-      case LEX_NONE:		/* Internally used	*/
+    case LEX_NONE:		/* Internally used      */
 	return "NO-LEX-ITEM";
-      case LEX_EOF:		/* End of file		*/
+    case LEX_EOF:		/* End of file          */
 	return "end-of-file";
-      case LEX_REC_SEP:		/* Record separator	*/
+    case LEX_REC_SEP:		/* Record separator     */
 	return "record separator (newline)";
-      case LEX_FIELD_SEP:	/* Field separator	*/
+    case LEX_FIELD_SEP:	/* Field separator      */
 	return "field separator ':'";
-      case LEX_ITEM_SEP:	/* List item separator	*/
+    case LEX_ITEM_SEP:		/* List item separator  */
 	return "item separator ','";
-      case LEX_OPEN_PAREN:	/* Group start tag	*/
+    case LEX_OPEN_PAREN:	/* Group start tag      */
 	return "'('";
-      case LEX_CLOSE_PAREN:	/* Group end tag	*/
+    case LEX_CLOSE_PAREN:	/* Group end tag        */
 	return "')'";
-      case LEX_AT_SIGN:		/* Address qualifier	*/
+    case LEX_AT_SIGN:		/* Address qualifier    */
 	return "address qualifier '@'";
-      case LEX_ALPH_STR:	/* Alphanumeric string	*/
+    case LEX_ALPH_STR:		/* Alphanumeric string  */
 	sprintf(msg, "alphanumeric string '%.70s'", HTlex_buffer);
 	return msg;
-      case LEX_TMPL_STR:	/* Template string	*/
+    case LEX_TMPL_STR:		/* Template string      */
 	sprintf(msg, "template string '%.70s'", HTlex_buffer);
 	return msg;
-      default:
+    default:
 	return "UNKNOWN-LEX-ITEM";
     }
 }
-
diff --git a/WWW/Library/Implementation/HTLex.h b/WWW/Library/Implementation/HTLex.h
index fd0f3c75..5914eba4 100644
--- a/WWW/Library/Implementation/HTLex.h
+++ b/WWW/Library/Implementation/HTLex.h
@@ -8,18 +8,18 @@
 #ifndef HTUTILS_H
 #include <HTUtils.h>
 #endif
- 
+
 typedef enum {
-    LEX_NONE,		/* Internally used      */
-    LEX_EOF,		/* End of file          */
-    LEX_REC_SEP,	/* Record separator     */
-    LEX_FIELD_SEP,	/* Field separator      */
-    LEX_ITEM_SEP,	/* List item separator  */
-    LEX_OPEN_PAREN,	/* Group start tag      */
-    LEX_CLOSE_PAREN,	/* Group end tag        */
-    LEX_AT_SIGN,	/* Address qualifier    */
-    LEX_ALPH_STR,	/* Alphanumeric string  */
-    LEX_TMPL_STR	/* Template string      */
+    LEX_NONE,			/* Internally used      */
+    LEX_EOF,			/* End of file          */
+    LEX_REC_SEP,		/* Record separator     */
+    LEX_FIELD_SEP,		/* Field separator      */
+    LEX_ITEM_SEP,		/* List item separator  */
+    LEX_OPEN_PAREN,		/* Group start tag      */
+    LEX_CLOSE_PAREN,		/* Group end tag        */
+    LEX_AT_SIGN,		/* Address qualifier    */
+    LEX_ALPH_STR,		/* Alphanumeric string  */
+    LEX_TMPL_STR		/* Template string      */
 } LexItem;
 
 extern char HTlex_buffer[];	/* Read lexical string          */
@@ -33,21 +33,24 @@ Get Next Lexical Item
 
  */
 
-extern LexItem lex (FILE * fp);
+extern LexItem lex(FILE *fp);
+
 /*
 
 Push Back Latest Item
 
  */
 
-extern void unlex (LexItem lex_item);
+extern void unlex(LexItem lex_item);
+
 /*
 
 Get the Name for Lexical Item
 
  */
 
-extern char *lex_verbose (LexItem lex_item);
+extern char *lex_verbose(LexItem lex_item);
+
 /*
 
  */
diff --git a/WWW/Library/Implementation/HTList.c b/WWW/Library/Implementation/HTList.c
index ca95864c..ccb02b19 100644
--- a/WWW/Library/Implementation/HTList.c
+++ b/WWW/Library/Implementation/HTList.c
@@ -1,10 +1,10 @@
 /*	A small List class					      HTList.c
-**	==================
-**
-**	A list is represented as a sequence of linked nodes of type HTList.
-**	The first node is a header which contains no object.
-**	New nodes are inserted between the header and the rest of the list.
-*/
+ *	==================
+ *
+ *	A list is represented as a sequence of linked nodes of type HTList.
+ *	The first node is a header which contains no object.
+ *	New nodes are inserted between the header and the rest of the list.
+ */
 
 #include <HTUtils.h>
 #include <HTList.h>
@@ -13,12 +13,12 @@
 
 /*	Create list.
 */
-HTList * HTList_new (void)
+HTList *HTList_new(void)
 {
     HTList *newList;
 
     if ((newList = typeMalloc(HTList)) == NULL)
-	outofmem(__FILE__, "HTList_new");
+	  outofmem(__FILE__, "HTList_new");
 
     newList->object = NULL;
     newList->next = NULL;
@@ -26,17 +26,15 @@ HTList * HTList_new (void)
     return newList;
 }
 
-
 /*	Delete list.
 */
-void HTList_delete (
-	HTList *	me)
+void HTList_delete(HTList *me)
 {
     HTList *current;
 
     while ((current = me)) {
-      me = me->next;
-      FREE (current);
+	me = me->next;
+	FREE(current);
     }
 
     return;
@@ -44,10 +42,10 @@ void HTList_delete (
 
 /*	Reverse order of elements in list.
  */
-HTList * HTList_reverse (
-    HTList *		start)
+HTList *HTList_reverse(HTList *start)
 {
     HTList *cur, *succ;
+
     if (!(start && start->next && (cur = start->next->next)))
 	return start;
     start->next->next = NULL;
@@ -64,15 +62,15 @@ HTList * HTList_reverse (
  *
  *	If successful, the second list will become empty but not freed.
  */
-HTList * HTList_appendList (
-    HTList *		start,
-    HTList *		tail)
+HTList *HTList_appendList(HTList *start,
+			  HTList *tail)
 {
-    HTList * temp = start;
+    HTList *temp = start;
 
     if (!start) {
-	CTRACE((tfp, "HTList: Trying to append list %p to a nonexisting list\n",
-		    tail));
+	CTRACE((tfp,
+		"HTList: Trying to append list %p to a nonexisting list\n",
+		tail));
 	return NULL;
     }
     if (!(tail && tail->next))
@@ -86,17 +84,14 @@ HTList * HTList_appendList (
     return start;
 }
 
-
 /*	Link object to START of list (so it is pointed to by the head).
  *
  *	Unlike HTList_addObject(), it does not malloc memory for HTList entry,
  *	it use already allocated memory which should not be free'd by any
  *	list operations (optimization).
  */
-void HTList_linkObject (
-	HTList *	me,
-	void *		newObject,
-	HTList *	newNode)
+void HTList_linkObject(HTList *me, void *newObject,
+		       HTList *newNode)
 {
     if (me) {
 	if (newNode->object == NULL && newNode->next == NULL) {
@@ -107,52 +102,48 @@ void HTList_linkObject (
 
 	} else {
 	    /*
-	     *  This node is already linked to some list (probably this one),
-	     *  so refuse changing node pointers to keep the list valid!!!
+	     * This node is already linked to some list (probably this one), so
+	     * refuse changing node pointers to keep the list valid!!!
 	     */
 	    CTRACE((tfp, "*** HTList: Refuse linking already linked obj "));
 	    CTRACE((tfp, "%p, node %p, list %p\n",
-			newObject, newNode, me));
+		    newObject, newNode, me));
 	}
 
     } else {
-	CTRACE((tfp, "HTList: Trying to link object %p to a nonexisting list\n",
-		    newObject));
+	CTRACE((tfp,
+		"HTList: Trying to link object %p to a nonexisting list\n",
+		newObject));
     }
 
     return;
 }
 
-
 /*      Add object to START of list (so it is pointed to by the head).
 */
-void HTList_addObject (
-	HTList *	me,
-	void *		newObject)
+void HTList_addObject(HTList *me, void *newObject)
 {
     HTList *newNode;
 
     if (me) {
 	if ((newNode = typeMalloc(HTList)) == NULL)
-	    outofmem(__FILE__, "HTList_addObject");
+	      outofmem(__FILE__, "HTList_addObject");
+
 	newNode->object = newObject;
 	newNode->next = me->next;
 	me->next = newNode;
 
     } else {
 	CTRACE((tfp, "HTList: Trying to add object %p to a nonexisting list\n",
-		    newObject));
+		newObject));
     }
 
     return;
 }
 
-
 /*      Append object to END of list (furthest from the head).
 */
-void HTList_appendObject (
-	HTList *	me,
-	void *		newObject)
+void HTList_appendObject(HTList *me, void *newObject)
 {
     HTList *temp = me;
 
@@ -165,37 +156,35 @@ void HTList_appendObject (
     return;
 }
 
-
 /*	Insert an object into the list at a specified position.
-**      If position is 0, this places the object at the head of the list
-**      and is equivalent to HTList_addObject().
-*/
-void HTList_insertObjectAt (
-	HTList *	me,
-	void *		newObject,
-	int		pos)
+ *      If position is 0, this places the object at the head of the list
+ *      and is equivalent to HTList_addObject().
+ */
+void HTList_insertObjectAt(HTList *me, void *newObject,
+			   int pos)
 {
-    HTList * newNode;
-    HTList * temp = me;
-    HTList * prevNode;
+    HTList *newNode;
+    HTList *temp = me;
+    HTList *prevNode;
     int Pos = pos;
 
     if (!temp) {
 	CTRACE((tfp, "HTList: Trying to add object %p to a nonexisting list\n",
-		    newObject));
+		newObject));
 	return;
     }
     if (Pos < 0) {
 	Pos = 0;
 	CTRACE((tfp, "HTList: Treating negative object position %d as %d.\n",
-		    pos, Pos));
+		pos, Pos));
     }
 
     prevNode = temp;
     while ((temp = temp->next)) {
 	if (Pos == 0) {
 	    if ((newNode = typeMalloc(HTList)) == NULL)
-		outofmem(__FILE__, "HTList_addObjectAt");
+		  outofmem(__FILE__, "HTList_addObjectAt");
+
 	    newNode->object = newObject;
 	    newNode->next = temp;
 	    if (prevNode)
@@ -211,13 +200,10 @@ void HTList_insertObjectAt (
     return;
 }
 
-
 /*	Unlink specified object from list.
  *	It does not free memory.
  */
-BOOL HTList_unlinkObject (
-	HTList *	me,
-	void *		oldObject)
+BOOL HTList_unlinkObject(HTList *me, void *oldObject)
 {
     HTList *temp = me;
     HTList *prevNode;
@@ -230,19 +216,16 @@ BOOL HTList_unlinkObject (
 		prevNode->next = temp->next;
 		temp->next = NULL;
 		temp->object = NULL;
-		return YES;  /* Success */
+		return YES;	/* Success */
 	    }
 	}
     }
-    return NO;  /* object not found or NULL list */
+    return NO;			/* object not found or NULL list */
 }
 
-
 /*	Remove specified object from list.
 */
-BOOL HTList_removeObject (
-	HTList *	me,
-	void *		oldObject)
+BOOL HTList_removeObject(HTList *me, void *oldObject)
 {
     HTList *temp = me;
     HTList *prevNode;
@@ -253,26 +236,23 @@ BOOL HTList_removeObject (
 	    temp = temp->next;
 	    if (temp->object == oldObject) {
 		prevNode->next = temp->next;
-		FREE (temp);
-		return YES;  /* Success */
+		FREE(temp);
+		return YES;	/* Success */
 	    }
 	}
     }
-    return NO;  /* object not found or NULL list */
+    return NO;			/* object not found or NULL list */
 }
 
-
 /*	Remove object at a given position in the list, where 0 is the
-**	object pointed to by the head (returns a pointer to the element
-**	(->object) for the object, and NULL if the list is empty, or
-**	if it doesn't exist - Yuk!).
-*/
-void * HTList_removeObjectAt  (
-	HTList *	me,
-	int		position)
+ *	object pointed to by the head (returns a pointer to the element
+ *	(->object) for the object, and NULL if the list is empty, or
+ *	if it doesn't exist - Yuk!).
+ */
+void *HTList_removeObjectAt(HTList *me, int position)
 {
-    HTList * temp = me;
-    HTList * prevNode;
+    HTList *temp = me;
+    HTList *prevNode;
     int pos = position;
 
     if (!temp || pos < 0)
@@ -290,18 +270,17 @@ void * HTList_removeObjectAt  (
 	pos--;
     }
 
-    return NULL;  /* Reached the end of the list */
+    return NULL;		/* Reached the end of the list */
 }
 
 /*	Unlink object from START of list (the Last one inserted
  *	via HTList_linkObject(), and pointed to by the head).
  *	It does not free memory.
  */
-void * HTList_unlinkLastObject (
-	HTList *	me)
+void *HTList_unlinkLastObject(HTList *me)
 {
-    HTList * lastNode;
-    void * lastObject;
+    HTList *lastNode;
+    void *lastObject;
 
     if (me && me->next) {
 	lastNode = me->next;
@@ -311,42 +290,38 @@ void * HTList_unlinkLastObject (
 	lastNode->object = NULL;
 	return lastObject;
 
-    } else {  /* Empty list */
+    } else {			/* Empty list */
 	return NULL;
     }
 }
 
-
 /*	Remove object from START of list (the Last one inserted
-**	via HTList_addObject(), and pointed to by the head).
-*/
-void * HTList_removeLastObject (
-	HTList *	me)
+ *	via HTList_addObject(), and pointed to by the head).
+ */
+void *HTList_removeLastObject(HTList *me)
 {
-    HTList * lastNode;
-    void * lastObject;
+    HTList *lastNode;
+    void *lastObject;
 
     if (me && me->next) {
 	lastNode = me->next;
 	lastObject = lastNode->object;
 	me->next = lastNode->next;
-	FREE (lastNode);
+	FREE(lastNode);
 	return lastObject;
 
-    } else {  /* Empty list */
+    } else {			/* Empty list */
 	return NULL;
     }
 }
 
-
 /*	Remove object from END of list (the First one inserted
-**	via HTList_addObject(), and furthest from the head).
-*/
-void * HTList_removeFirstObject (
-	HTList *	me)
+ *	via HTList_addObject(), and furthest from the head).
+ */
+void *HTList_removeFirstObject(HTList *me)
 {
-    HTList * temp = me;
-    HTList * prevNode;
+    HTList *temp = me;
+    HTList *prevNode;
     void *firstObject;
 
     if (!temp)
@@ -360,22 +335,20 @@ void * HTList_removeFirstObject (
 	}
 	firstObject = temp->object;
 	prevNode->next = NULL;
-	FREE (temp);
+	FREE(temp);
 	return firstObject;
 
-    } else {  /* Empty list */
+    } else {			/* Empty list */
 	return NULL;
     }
 }
 
-
 /*	Determine total number of objects in the list,
-**	not counting the head.
-*/
-int HTList_count (
-	HTList *	me)
+ *	not counting the head.
+ */
+int HTList_count(HTList *me)
 {
-    HTList * temp = me;
+    HTList *temp = me;
     int count = 0;
 
     if (temp)
@@ -385,15 +358,12 @@ int HTList_count (
     return count;
 }
 
-
 /*	Determine position of an object in the list (a value of 0
-**	means it is pointed to by the head; returns -1 if not found).
-*/
-int HTList_indexOf (
-	HTList *	me,
-	void *		object)
+ *	means it is pointed to by the head; returns -1 if not found).
+ */
+int HTList_indexOf(HTList *me, void *object)
 {
-    HTList * temp = me;
+    HTList *temp = me;
     int position = 0;
 
     if (temp) {
@@ -404,19 +374,16 @@ int HTList_indexOf (
 	}
     }
 
-    return -1;	/* Object not in the list */
+    return -1;			/* Object not in the list */
 }
 
-
 /*	Return pointer to the object at a specified position in the list,
-**	where 0 is the object pointed to by the head (returns NULL if
-**	the list is empty, or if it doesn't exist - Yuk!).
-*/
-void * HTList_objectAt (
-	HTList *	me,
-	int		position)
+ *	where 0 is the object pointed to by the head (returns NULL if
+ *	the list is empty, or if it doesn't exist - Yuk!).
+ */
+void *HTList_objectAt(HTList *me, int position)
 {
-    HTList * temp = me;
+    HTList *temp = me;
     int pos = position;
 
     if (!temp || pos < 0)
@@ -428,5 +395,5 @@ void * HTList_objectAt (
 	pos--;
     }
 
-    return NULL;	/* Reached the end of the list */
+    return NULL;		/* Reached the end of the list */
 }
diff --git a/WWW/Library/Implementation/HTList.h b/WWW/Library/Implementation/HTList.h
index a9973ba8..8a5ed0f2 100644
--- a/WWW/Library/Implementation/HTList.h
+++ b/WWW/Library/Implementation/HTList.h
@@ -1,9 +1,9 @@
 
 /*              List object
-**
-**      The list object is a generic container for storing collections
-**      of things in order.
-*/
+ *
+ *      The list object is a generic container for storing collections
+ *      of things in order.
+ */
 #ifndef HTLIST_H
 #define HTLIST_H
 
@@ -14,130 +14,102 @@
 typedef struct _HTList HTList;
 
 struct _HTList {
-	void *		object;
-	HTList *	next;
+    void *object;
+    HTList *next;
 };
 
-
 /*	Fast macro to traverse a list.  Call it first with copy of the list
-**	header.  It returns the first object and increments the passed list
-**	pointer.  Call it with the same variable until it returns NULL.
-*/
+ *	header.  It returns the first object and increments the passed list
+ *	pointer.  Call it with the same variable until it returns NULL.
+ */
 #define HTList_nextObject(me) \
 	((me) && ((me) = (me)->next) ? (me)->object : NULL)
 
-
 /*	Macro to find object pointed to by the head (returns NULL
-**	if list is empty, OR if it doesn't exist - Yuk!)
-*/
+ *	if list is empty, OR if it doesn't exist - Yuk!)
+ */
 #define HTList_lastObject(me) \
 	((me) && (me)->next ? (me)->next->object : NULL)
 
-
 /*	Macro to check if a list is empty (or doesn't exist - Yuk!)
 */
 #define HTList_isEmpty(me) ((me) ? ((me)->next == NULL) : YES)
 
-
 /*	Create list.
 */
-extern HTList * HTList_new (void);
-
+extern HTList *HTList_new(void);
 
 /*	Delete list.
 */
-extern void HTList_delete (
-	HTList *	me);
+extern void HTList_delete(HTList *me);
 
 /*	Reverse a list.
 */
-extern HTList * HTList_reverse (
-	HTList *	start);
+extern HTList *HTList_reverse(HTList *start);
 
 /*	Append two lists, making second list empty.
 */
-extern HTList * HTList_appendList (
-	HTList *	start,
-	HTList *	tail);
-
+extern HTList *HTList_appendList(HTList *start,
+				 HTList *tail);
 
 /*      Add object to START of list (so it is pointed to by the head).
 */
-extern void HTList_addObject (
-	HTList *	me,
-	void *		newObject);
-
+extern void HTList_addObject(HTList *me,
+			     void *newObject);
 
 /*      Append object to END of list (furthest from the head).
 */
-extern void HTList_appendObject (
-	HTList *	me,
-	void *		newObject);
-
+extern void HTList_appendObject(HTList *me,
+				void *newObject);
 
 /*	Insert an object into the list at a specified position.
-**      If position is 0, this places the object at the head of the list
-**      and is equivalent to HTList_addObject().
-*/
-extern void HTList_insertObjectAt (
-	HTList *	me,
-	void *		newObject,
-	int		pos);
-
+ *      If position is 0, this places the object at the head of the list
+ *      and is equivalent to HTList_addObject().
+ */
+extern void HTList_insertObjectAt(HTList *me,
+				  void *newObject,
+				  int pos);
 
 /*	Remove specified object from list.
 */
-extern BOOL HTList_removeObject (
-	HTList *	me,
-	void *		oldObject);
-
+extern BOOL HTList_removeObject(HTList *me,
+				void *oldObject);
 
 /*	Remove object at a given position in the list, where 0 is the
-**	object pointed to by the head (returns a pointer to the element
-**	(->object) for the object, and NULL if the list is empty, or
-**	if it doesn't exist - Yuk!).
-*/
-extern void * HTList_removeObjectAt (
-	HTList *	me,
-	int		position);
-
+ *	object pointed to by the head (returns a pointer to the element
+ *	(->object) for the object, and NULL if the list is empty, or
+ *	if it doesn't exist - Yuk!).
+ */
+extern void *HTList_removeObjectAt(HTList *me,
+				   int position);
 
 /*	Remove object from START of list (the Last one inserted
-**	via HTList_addObject(), and pointed to by the head).
-*/
-extern void * HTList_removeLastObject (
-	HTList *	me);
-
+ *	via HTList_addObject(), and pointed to by the head).
+ */
+extern void *HTList_removeLastObject(HTList *me);
 
 /*	Remove object from END of list (the First one inserted
-**	via HTList_addObject(), and furthest from the head).
-*/
-extern void * HTList_removeFirstObject (
-	HTList *	me);
-
+ *	via HTList_addObject(), and furthest from the head).
+ */
+extern void *HTList_removeFirstObject(HTList *me);
 
 /*	Determine total number of objects in the list,
-**	not counting the head.
-*/
-extern int HTList_count (
-	HTList *	me);
-
+ *	not counting the head.
+ */
+extern int HTList_count(HTList *me);
 
 /*	Determine position of an object in the list (a value of 0
-**	means it is pointed to by the head; returns -1 if not found).
-*/
-extern int HTList_indexOf (
-	HTList *	me,
-	void *		object);
-
+ *	means it is pointed to by the head; returns -1 if not found).
+ */
+extern int HTList_indexOf(HTList *me,
+			  void *object);
 
 /*	Return pointer to the object at a specified position in the list,
-**	where 0 is the object pointed to by the head (returns NULL if
-**	the list is empty, or if it doesn't exist - Yuk!).
-*/
-extern void * HTList_objectAt (
-	HTList *	me,
-	int		position);
+ *	where 0 is the object pointed to by the head (returns NULL if
+ *	the list is empty, or if it doesn't exist - Yuk!).
+ */
+extern void *HTList_objectAt(HTList *me,
+			     int position);
 
 /*      Link object to START of list (so it is pointed to by the head).
  *
@@ -145,23 +117,20 @@ extern void * HTList_objectAt (
  *	it use already allocated memory which should not be free'd by any
  *	list operations (optimization).
  */
-extern void HTList_linkObject (
-	HTList *	me,
-	void *		newObject,
-	HTList *	newNode);
+extern void HTList_linkObject(HTList *me,
+			      void *newObject,
+			      HTList *newNode);
 
 /*	Unlink object from START of list (the Last one inserted
  *	via HTList_linkObject(), and pointed to by the head).
  *	It does not free memory.
  */
-extern void * HTList_unlinkLastObject (
-	HTList *	me);
+extern void *HTList_unlinkLastObject(HTList *me);
 
 /*	Unlink specified object from list.
  *	It does not free memory.
  */
-extern BOOL HTList_unlinkObject (
-	HTList *	me,
-	void *		oldObject);
+extern BOOL HTList_unlinkObject(HTList *me,
+				void *oldObject);
 
 #endif /* HTLIST_H */
diff --git a/WWW/Library/Implementation/HTMIME.c b/WWW/Library/Implementation/HTMIME.c
index dc0ba31c..d7a7923f 100644
--- a/WWW/Library/Implementation/HTMIME.c
+++ b/WWW/Library/Implementation/HTMIME.c
@@ -1,16 +1,16 @@
 /*			MIME Message Parse			HTMIME.c
-**			==================
-**
-**	This is RFC 1341-specific code.
-**	The input stream pushed into this parser is assumed to be
-**	stripped on CRs, ie lines end with LF, not CR LF.
-**	(It is easy to change this except for the body part where
-**	conversion can be slow.)
-**
-** History:
-**	   Feb 92	Written Tim Berners-Lee, CERN
-**
-*/
+ *			==================
+ *
+ *	This is RFC 1341-specific code.
+ *	The input stream pushed into this parser is assumed to be
+ *	stripped on CRs, ie lines end with LF, not CR LF.
+ *	(It is easy to change this except for the body part where
+ *	conversion can be slow.)
+ *
+ * History:
+ *	   Feb 92	Written Tim Berners-Lee, CERN
+ *
+ */
 #include <HTUtils.h>
 #include <HTMIME.h>		/* Implemented here */
 #include <HTTP.h>		/* for redirecting_url */
@@ -28,130 +28,129 @@
 #include <LYLeaks.h>
 
 /*		MIME Object
-**		-----------
-*/
+ *		-----------
+ */
 
 typedef enum {
-	MIME_TRANSPARENT,	/* put straight through to target ASAP! */
-	miBEGINNING_OF_LINE,	/* first character and not a continuation */
-	miA,
-	miACCEPT_RANGES,
-	miAGE,
-	miAL,
-	miALLOW,
-	miALTERNATES,
-	miC,
-	miCACHE_CONTROL,
-	miCO,
-	miCOOKIE,
-	miCON,
-	miCONNECTION,
-	miCONTENT_,
-	miCONTENT_BASE,
-	miCONTENT_DISPOSITION,
-	miCONTENT_ENCODING,
-	miCONTENT_FEATURES,
-	miCONTENT_L,
-	miCONTENT_LANGUAGE,
-	miCONTENT_LENGTH,
-	miCONTENT_LOCATION,
-	miCONTENT_MD5,
-	miCONTENT_RANGE,
-	miCONTENT_T,
-	miCONTENT_TRANSFER_ENCODING,
-	miCONTENT_TYPE,
-	miDATE,
-	miE,
-	miETAG,
-	miEXPIRES,
-	miKEEP_ALIVE,
-	miL,
-	miLAST_MODIFIED,
-	miLINK,
-	miLOCATION,
-	miP,
-	miPR,
-	miPRAGMA,
-	miPROXY_AUTHENTICATE,
-	miPUBLIC,
-	miR,
-	miRE,
-	miREFRESH,
-	miRETRY_AFTER,
-	miS,
-	miSAFE,
-	miSE,
-	miSERVER,
-	miSET_COOKIE,
-	miSET_COOKIE1,
-	miSET_COOKIE2,
-	miT,
-	miTITLE,
-	miTRANSFER_ENCODING,
-	miU,
-	miUPGRADE,
-	miURI,
-	miV,
-	miVARY,
-	miVIA,
-	miW,
-	miWARNING,
-	miWWW_AUTHENTICATE,
-	miSKIP_GET_VALUE,	/* Skip space then get value */
-	miGET_VALUE,		/* Get value till white space */
-	miJUNK_LINE,		/* Ignore the rest of this folded line */
-	miNEWLINE,		/* Just found a LF .. maybe continuation */
-	miCHECK,		/* check against check_pointer */
-	MIME_NET_ASCII,		/* Translate from net ascii */
-	MIME_IGNORE		/* Ignore entire file */
-	/* TRANSPARENT and IGNORE are defined as stg else in _WINDOWS */
+    MIME_TRANSPARENT,		/* put straight through to target ASAP! */
+    miBEGINNING_OF_LINE,	/* first character and not a continuation */
+    miA,
+    miACCEPT_RANGES,
+    miAGE,
+    miAL,
+    miALLOW,
+    miALTERNATES,
+    miC,
+    miCACHE_CONTROL,
+    miCO,
+    miCOOKIE,
+    miCON,
+    miCONNECTION,
+    miCONTENT_,
+    miCONTENT_BASE,
+    miCONTENT_DISPOSITION,
+    miCONTENT_ENCODING,
+    miCONTENT_FEATURES,
+    miCONTENT_L,
+    miCONTENT_LANGUAGE,
+    miCONTENT_LENGTH,
+    miCONTENT_LOCATION,
+    miCONTENT_MD5,
+    miCONTENT_RANGE,
+    miCONTENT_T,
+    miCONTENT_TRANSFER_ENCODING,
+    miCONTENT_TYPE,
+    miDATE,
+    miE,
+    miETAG,
+    miEXPIRES,
+    miKEEP_ALIVE,
+    miL,
+    miLAST_MODIFIED,
+    miLINK,
+    miLOCATION,
+    miP,
+    miPR,
+    miPRAGMA,
+    miPROXY_AUTHENTICATE,
+    miPUBLIC,
+    miR,
+    miRE,
+    miREFRESH,
+    miRETRY_AFTER,
+    miS,
+    miSAFE,
+    miSE,
+    miSERVER,
+    miSET_COOKIE,
+    miSET_COOKIE1,
+    miSET_COOKIE2,
+    miT,
+    miTITLE,
+    miTRANSFER_ENCODING,
+    miU,
+    miUPGRADE,
+    miURI,
+    miV,
+    miVARY,
+    miVIA,
+    miW,
+    miWARNING,
+    miWWW_AUTHENTICATE,
+    miSKIP_GET_VALUE,		/* Skip space then get value */
+    miGET_VALUE,		/* Get value till white space */
+    miJUNK_LINE,		/* Ignore the rest of this folded line */
+    miNEWLINE,			/* Just found a LF .. maybe continuation */
+    miCHECK,			/* check against check_pointer */
+    MIME_NET_ASCII,		/* Translate from net ascii */
+    MIME_IGNORE			/* Ignore entire file */
+    /* TRANSPARENT and IGNORE are defined as stg else in _WINDOWS */
 } MIME_state;
 
 #define VALUE_SIZE 5120		/* @@@@@@@ Arbitrary? */
 struct _HTStream {
-	const HTStreamClass *	isa;
-
-	BOOL			net_ascii;	/* Is input net ascii? */
-	MIME_state		state;		/* current state */
-	MIME_state		if_ok;		/* got this state if match */
-	MIME_state		field;		/* remember which field */
-	MIME_state		fold_state;	/* state on a fold */
-	BOOL			head_only;	/* only parsing header */
-	BOOL			pickup_redirection; /* parsing for location */
-	BOOL			no_streamstack; /* use sink directly */
-	const char *		check_pointer;	/* checking input */
-
-	char *			value_pointer;	/* storing values */
-	char			value[VALUE_SIZE];
-
-	HTParentAnchor *	anchor;		/* Given on creation */
-	HTStream *		sink;		/* Given on creation */
-
-	char *			boundary;	/* For multipart */
-	char *			set_cookie;	/* Set-Cookie */
-	char *			set_cookie2;	/* Set-Cookie2 */
-	char *			location;	/* Location */
-
-	char *			refresh_url;	/* "Refresh:" URL */
-
-	HTFormat		encoding;	/* Content-Transfer-Encoding */
-	char *			compression_encoding;
-	HTFormat		format;		/* Content-Type */
-	HTStream *		target;		/* While writing out */
-	HTStreamClass		targetClass;
-
-	HTAtom *		targetRep;	/* Converting into? */
+    const HTStreamClass *isa;
+
+    BOOL net_ascii;		/* Is input net ascii? */
+    MIME_state state;		/* current state */
+    MIME_state if_ok;		/* got this state if match */
+    MIME_state field;		/* remember which field */
+    MIME_state fold_state;	/* state on a fold */
+    BOOL head_only;		/* only parsing header */
+    BOOL pickup_redirection;	/* parsing for location */
+    BOOL no_streamstack;	/* use sink directly */
+    const char *check_pointer;	/* checking input */
+
+    char *value_pointer;	/* storing values */
+    char value[VALUE_SIZE];
+
+    HTParentAnchor *anchor;	/* Given on creation */
+    HTStream *sink;		/* Given on creation */
+
+    char *boundary;		/* For multipart */
+    char *set_cookie;		/* Set-Cookie */
+    char *set_cookie2;		/* Set-Cookie2 */
+    char *location;		/* Location */
+
+    char *refresh_url;		/* "Refresh:" URL */
+
+    HTFormat encoding;		/* Content-Transfer-Encoding */
+    char *compression_encoding;
+    HTFormat format;		/* Content-Type */
+    HTStream *target;		/* While writing out */
+    HTStreamClass targetClass;
+
+    HTAtom *targetRep;		/* Converting into? */
 };
 
 /*
-**  This function is for trimming off any paired
-**  open- and close-double quotes from header values.
-**  It does not parse the string for embedded quotes,
-**  and will not modify the string unless both the
-**  first and last characters are double-quotes. - FM
-*/
-void HTMIME_TrimDoubleQuotes (
-	char *		value)
+ *  This function is for trimming off any paired
+ *  open- and close-double quotes from header values.
+ *  It does not parse the string for embedded quotes,
+ *  and will not modify the string unless both the
+ *  first and last characters are double-quotes. - FM
+ */
+void HTMIME_TrimDoubleQuotes(char *value)
 {
     int i;
     char *cp = value;
@@ -166,15 +165,15 @@ void HTMIME_TrimDoubleQuotes (
 	cp[(i - 1)] = '\0';
 
     for (i = 0; value[i]; i++)
-	value[i] = cp[(i +1)];
+	value[i] = cp[(i + 1)];
 }
 
-static BOOL content_is_compressed (HTStream *  me)
+static BOOL content_is_compressed(HTStream *me)
 {
     char *encoding = me->anchor->content_encoding;
 
     return encoding != 0
-        && strcmp(encoding, "8bit") != 0
+	&& strcmp(encoding, "8bit") != 0
 	&& strcmp(encoding, "7bit") != 0
 	&& strcmp(encoding, "binary") != 0;
 }
@@ -182,20 +181,20 @@ static BOOL content_is_compressed (HTStream *  me)
 /*
  * Strip quotes from a refresh-URL.
  */
-static void dequote (char *  url)
+static void dequote(char *url)
 {
     int len;
 
     len = strlen(url);
-    if (*url == '\'' && len > 1 && url[len-1] == url[0]) {
-	url[len-1] = '\0';
+    if (*url == '\'' && len > 1 && url[len - 1] == url[0]) {
+	url[len - 1] = '\0';
 	while ((url[0] = url[1]) != '\0') {
 	    ++url;
 	}
     }
 }
 
-static int pumpData (HTStream *  me)
+static int pumpData(HTStream *me)
 {
     if (strchr(HTAtom_name(me->format), ';') != NULL) {
 	char *cp = NULL, *cp1, *cp2, *cp3 = NULL, *cp4;
@@ -204,28 +203,28 @@ static int pumpData (HTStream *  me)
 		HTAtom_name(me->format)));
 	StrAllocCopy(cp, HTAtom_name(me->format));
 	/*
-	** Note that the Content-Type value was converted
-	** to lower case when we loaded into me->format,
-	** but there may have been a mixed or upper-case
-	** atom, so we'll force lower-casing again.  We
-	** also stripped spaces and double-quotes, but
-	** we'll make sure they're still gone from any
-	** charset parameter we check.  - FM
-	*/
+	 * Note that the Content-Type value was converted
+	 * to lower case when we loaded into me->format,
+	 * but there may have been a mixed or upper-case
+	 * atom, so we'll force lower-casing again.  We
+	 * also stripped spaces and double-quotes, but
+	 * we'll make sure they're still gone from any
+	 * charset parameter we check.  - FM
+	 */
 	LYLowerCase(cp);
 	if ((cp1 = strchr(cp, ';')) != NULL) {
 	    BOOL chartrans_ok = NO;
+
 	    if ((cp2 = strstr(cp1, "charset")) != NULL) {
 		int chndl;
 
 		cp2 += 7;
 		while (*cp2 == ' ' || *cp2 == '=' || *cp2 == '\"')
 		    cp2++;
-		StrAllocCopy(cp3, cp2); /* copy to mutilate more */
+		StrAllocCopy(cp3, cp2);		/* copy to mutilate more */
 		for (cp4 = cp3; (*cp4 != '\0' && *cp4 != '\"' &&
-				 *cp4 != ';'  && *cp4 != ':' &&
-				 !WHITE(*cp4));	cp4++)
-		    ; /* do nothing */
+				 *cp4 != ';' && *cp4 != ':' &&
+				 !WHITE(*cp4)); cp4++) ;	/* do nothing */
 		*cp4 = '\0';
 		cp4 = cp3;
 		chndl = UCGetLYhndl_byMIME(cp3);
@@ -238,17 +237,15 @@ static int pumpData (HTStream *  me)
 		    HTAnchor_setUCInfoStage(me->anchor, chndl,
 					    UCT_STAGE_MIME,
 					    UCT_SETBY_MIME);
-		}
-		else if (chndl < 0) {/* got something but we don't
-					recognize it */
+		} else if (chndl < 0) {		/* got something but we don't
+						   recognize it */
 		    chndl = UCLYhndl_for_unrec;
 		    if (chndl < 0)
 			/*
-			**  UCLYhndl_for_unrec not defined :-(
-			**  fallback to UCLYhndl_for_unspec
-			**  which always valid.
-			*/
-			chndl = UCLYhndl_for_unspec;  /* always >= 0 */
+			 * UCLYhndl_for_unrec not defined :-( fallback to
+			 * UCLYhndl_for_unspec which always valid.
+			 */
+			chndl = UCLYhndl_for_unspec;	/* always >= 0 */
 		    if (UCCanTranslateFromTo(chndl,
 					     current_char_set)) {
 			chartrans_ok = YES;
@@ -260,18 +257,19 @@ static int pumpData (HTStream *  me)
 		    }
 		}
 		if (chartrans_ok) {
-		    LYUCcharset * p_in =
-			HTAnchor_getUCInfoStage(me->anchor,
-						UCT_STAGE_MIME);
-		    LYUCcharset * p_out =
-			HTAnchor_setUCInfoStage(me->anchor,
-						current_char_set,
-						UCT_STAGE_HTEXT,
-						UCT_SETBY_DEFAULT);
+		    LYUCcharset *p_in =
+		    HTAnchor_getUCInfoStage(me->anchor,
+					    UCT_STAGE_MIME);
+		    LYUCcharset *p_out =
+		    HTAnchor_setUCInfoStage(me->anchor,
+					    current_char_set,
+					    UCT_STAGE_HTEXT,
+					    UCT_SETBY_DEFAULT);
+
 		    if (!p_out)
 			/*
-			**	Try again.
-			*/
+			 * Try again.
+			 */
 			p_out =
 			    HTAnchor_getUCInfoStage(me->anchor,
 						    UCT_STAGE_HTEXT);
@@ -306,27 +304,25 @@ static int pumpData (HTStream *  me)
 		    }
 		} else {
 		    /*
-		    **  Cannot translate.
-		    **  If according to some heuristic the given
-		    **  charset and the current display character
-		    **  both are likely to be like ISO-8859 in
-		    **  structure, pretend we have some kind
-		    **  of match.
-		    */
-		    BOOL given_is_8859
-			= (BOOL) (!strncmp(cp4, "iso-8859-", 9) &&
-				  isdigit(UCH(cp4[9])));
-		    BOOL given_is_8859like
-			= (BOOL) (given_is_8859 ||
-				  !strncmp(cp4, "windows-", 8) ||
-				  !strncmp(cp4, "cp12", 4) ||
-				  !strncmp(cp4, "cp-12", 5));
-		    BOOL given_and_display_8859like
-			= (BOOL) (given_is_8859like &&
-				  (strstr(LYchar_set_names[current_char_set],
-					  "ISO-8859") ||
-				   strstr(LYchar_set_names[current_char_set],
-					  "windows-")));
+		     * Cannot translate.  If according to some heuristic the
+		     * given charset and the current display character both are
+		     * likely to be like ISO-8859 in structure, pretend we have
+		     * some kind of match.
+		     */
+		    BOOL given_is_8859 =
+		    (BOOL) (!strncmp(cp4, "iso-8859-", 9) &&
+			    isdigit(UCH(cp4[9])));
+		    BOOL given_is_8859like =
+		    (BOOL) (given_is_8859 ||
+			    !strncmp(cp4, "windows-", 8) ||
+			    !strncmp(cp4, "cp12", 4) ||
+			    !strncmp(cp4, "cp-12", 5));
+		    BOOL given_and_display_8859like =
+		    (BOOL) (given_is_8859like &&
+			    (strstr(LYchar_set_names[current_char_set],
+				    "ISO-8859") ||
+			     strstr(LYchar_set_names[current_char_set],
+				    "windows-")));
 
 		    if (given_and_display_8859like) {
 			*cp1 = '\0';
@@ -348,10 +344,9 @@ static int pumpData (HTStream *  me)
 		FREE(cp3);
 	    } else {
 		/*
-		**	No charset parameter is present.
-		**	Ignore all other parameters, as
-		**	we do when charset is present. - FM
-		*/
+		 * No charset parameter is present.  Ignore all other
+		 * parameters, as we do when charset is present.  - FM
+		 */
 		*cp1 = '\0';
 		me->format = HTAtom_for(cp);
 	    }
@@ -359,34 +354,32 @@ static int pumpData (HTStream *  me)
 	FREE(cp);
     }
     /*
-    **  If we have an Expires header and haven't
-    **  already set the no_cache element for the
-    **  anchor, check if we should set it based
-    **  on that header. - FM
-    */
+     * If we have an Expires header and haven't already set the no_cache
+     * element for the anchor, check if we should set it based on that header. 
+     * - FM
+     */
     if (me->anchor->no_cache == FALSE &&
 	me->anchor->expires != NULL) {
 	if (!strcmp(me->anchor->expires, "0")) {
 	    /*
-	     *  The value is zero, which we treat as
-	     *  an absolute no-cache directive. - FM
+	     * The value is zero, which we treat as an absolute no-cache
+	     * directive.  - FM
 	     */
 	    me->anchor->no_cache = TRUE;
 	} else if (me->anchor->date != NULL) {
 	    /*
-	    **  We have a Date header, so check if
-	    **  the value is less than or equal to
-	    **  that. - FM
-	    */
+	     * We have a Date header, so check if the value is less than or
+	     * equal to that.  - FM
+	     */
 	    if (LYmktime(me->anchor->expires, TRUE) <=
 		LYmktime(me->anchor->date, TRUE)) {
 		me->anchor->no_cache = TRUE;
 	    }
 	} else if (LYmktime(me->anchor->expires, FALSE) == 0) {
 	    /*
-	    **  We don't have a Date header, and
-	    **  the value is in past for us. - FM
-	    */
+	     * We don't have a Date header, and the value is in past for us.  -
+	     * FM
+	     */
 	    me->anchor->no_cache = TRUE;
 	}
     }
@@ -431,13 +424,14 @@ static int pumpData (HTStream *  me)
 	me->target = me->sink;
     } else {
 	if (!me->compression_encoding) {
-	    CTRACE((tfp, "HTMIME: MIME Content-Type is '%s', converting to '%s'\n",
+	    CTRACE((tfp,
+		    "HTMIME: MIME Content-Type is '%s', converting to '%s'\n",
 		    HTAtom_name(me->format), HTAtom_name(me->targetRep)));
 	} else {
 	    /*
-	    **	Change the format to that for "www/compressed"
-	    **	and set up a stream to deal with it. - FM
-	    */
+	     * Change the format to that for "www/compressed" and set up a
+	     * stream to deal with it.  - FM
+	     */
 	    CTRACE((tfp, "HTMIME: MIME Content-Type is '%s',\n", HTAtom_name(me->format)));
 	    me->format = HTAtom_for("www/compressed");
 	    CTRACE((tfp, "        Treating as '%s'.  Converting to '%s'\n",
@@ -445,7 +439,7 @@ static int pumpData (HTStream *  me)
 	    FREE(me->compression_encoding);
 	}
 	me->target = HTStreamStack(me->format, me->targetRep,
-				   me->sink , me->anchor);
+				   me->sink, me->anchor);
 	if (!me->target) {
 	    CTRACE((tfp, "HTMIME: Can't translate! ** \n"));
 	    me->target = me->sink;	/* Cheat */
@@ -454,10 +448,9 @@ static int pumpData (HTStream *  me)
     if (me->target) {
 	me->targetClass = *me->target->isa;
 	/*
-	**	Check for encoding and select state from there,
-	**	someday, but until we have the relevant code,
-	**	from now push straight through. - FM
-	*/
+	 * Check for encoding and select state from there, someday, but until
+	 * we have the relevant code, from now push straight through.  - FM
+	 */
 	me->state = MIME_TRANSPARENT;	/* Pump rest of data right through */
     } else {
 	me->state = MIME_IGNORE;	/* What else to do? */
@@ -476,7 +469,7 @@ static int pumpData (HTStream *  me)
 	    dequote(url);
 	    HTSprintf(&txt, "<a href=\"%s%s\">%s</a><br>", base, url, url);
 	    CTRACE((tfp, "URL %s%s\n", base, url));
-	    (me->isa->put_string)(me, txt);
+	    (me->isa->put_string) (me, txt);
 	    free(txt);
 	}
 	FREE(num);
@@ -485,17 +478,17 @@ static int pumpData (HTStream *  me)
     return HT_OK;
 }
 
-static int dispatchField (HTStream *  me)
+static int dispatchField(HTStream *me)
 {
     int i, j;
     char *cp;
 
     *me->value_pointer = '\0';
     cp = me->value_pointer;
-    while ((cp > me->value) && *(--cp) == ' ')  /* S/390 -- gil -- 0146 */
+    while ((cp > me->value) && *(--cp) == ' ')	/* S/390 -- gil -- 0146 */
 	/*
-	**  Trim trailing spaces.
-	*/
+	 * Trim trailing spaces.
+	 */
 	*cp = '\0';
 
     switch (me->field) {
@@ -526,13 +519,13 @@ static int dispatchField (HTStream *  me)
 	if (!(me->value && *me->value))
 	    break;
 	/*
-	**  Convert to lowercase and indicate in anchor. - FM
-	*/
+	 * Convert to lowercase and indicate in anchor.  - FM
+	 */
 	LYLowerCase(me->value);
 	StrAllocCopy(me->anchor->cache_control, me->value);
 	/*
-	**  Check whether to set no_cache for the anchor. - FM
-	*/
+	 * Check whether to set no_cache for the anchor.  - FM
+	 */
 	{
 	    char *cp1, *cp0 = me->value;
 
@@ -588,8 +581,8 @@ static int dispatchField (HTStream *  me)
 	if (!(me->value && *me->value))
 	    break;
 	/*
-	**  Indicate in anchor. - FM
-	*/
+	 * Indicate in anchor.  - FM
+	 */
 	StrAllocCopy(me->anchor->content_base, me->value);
 	break;
     case miCONTENT_DISPOSITION:
@@ -599,17 +592,16 @@ static int dispatchField (HTStream *  me)
 	if (!(me->value && *me->value))
 	    break;
 	/*
-	**  Indicate in anchor. - FM
-	*/
+	 * Indicate in anchor.  - FM
+	 */
 	StrAllocCopy(me->anchor->content_disposition, me->value);
 	/*
-	**  It's not clear yet from existing RFCs and IDs
-	**  whether we should be looking for file;, attachment;,
-	**  and/or inline; before the filename=value, so we'll
-	**  just search for "filename" followed by '=' and just
-	**  hope we get the intended value.  It is purely a
-	**  suggested name, anyway. - FM
-	*/
+	 * It's not clear yet from existing RFCs and IDs whether we should be
+	 * looking for file;, attachment;, and/or inline; before the
+	 * filename=value, so we'll just search for "filename" followed by '='
+	 * and just hope we get the intended value.  It is purely a suggested
+	 * name, anyway.  - FM
+	 */
 	cp = me->anchor->content_disposition;
 	while (*cp != '\0' && strncasecomp(cp, "filename", 8))
 	    cp++;
@@ -650,22 +642,22 @@ static int dispatchField (HTStream *  me)
 	    !strcasecomp(me->value, "identity"))
 	    break;
 	/*
-	**  Convert to lowercase and indicate in anchor. - FM
-	*/
+	 * Convert to lowercase and indicate in anchor.  - FM
+	 */
 	LYLowerCase(me->value);
 	StrAllocCopy(me->anchor->content_encoding, me->value);
 	FREE(me->compression_encoding);
 	if (content_is_compressed(me)) {
 	    /*
-	    **	Save it to use as a flag for setting
-	    **	up a "www/compressed" target. - FM
-	    */
+	     * Save it to use as a flag for setting up a "www/compressed"
+	     * target.  - FM
+	     */
 	    StrAllocCopy(me->compression_encoding, me->value);
 	} else {
 	    /*
-	    **	Some server indicated "8bit", "7bit" or "binary"
-	    **	inappropriately.  We'll ignore it. - FM
-	    */
+	     * Some server indicated "8bit", "7bit" or "binary"
+	     * inappropriately.  We'll ignore it.  - FM
+	     */
 	    CTRACE((tfp, "                Ignoring it!\n"));
 	}
 	break;
@@ -681,8 +673,8 @@ static int dispatchField (HTStream *  me)
 	if (!(me->value && *me->value))
 	    break;
 	/*
-	**  Convert to lowercase and indicate in anchor. - FM
-	*/
+	 * Convert to lowercase and indicate in anchor.  - FM
+	 */
 	LYLowerCase(me->value);
 	StrAllocCopy(me->anchor->content_language, me->value);
 	break;
@@ -693,8 +685,8 @@ static int dispatchField (HTStream *  me)
 	if (!(me->value && *me->value))
 	    break;
 	/*
-	**  Convert to integer and indicate in anchor. - FM
-	*/
+	 * Convert to integer and indicate in anchor.  - FM
+	 */
 	me->anchor->content_length = atoi(me->value);
 	if (me->anchor->content_length < 0)
 	    me->anchor->content_length = 0;
@@ -708,8 +700,8 @@ static int dispatchField (HTStream *  me)
 	if (!(me->value && *me->value))
 	    break;
 	/*
-	**  Indicate in anchor. - FM
-	*/
+	 * Indicate in anchor.  - FM
+	 */
 	StrAllocCopy(me->anchor->content_location, me->value);
 	break;
     case miCONTENT_MD5:
@@ -719,8 +711,8 @@ static int dispatchField (HTStream *  me)
 	if (!(me->value && *me->value))
 	    break;
 	/*
-	**  Indicate in anchor. - FM
-	*/
+	 * Indicate in anchor.  - FM
+	 */
 	StrAllocCopy(me->anchor->content_md5, me->value);
 	break;
     case miCONTENT_RANGE:
@@ -735,9 +727,8 @@ static int dispatchField (HTStream *  me)
 	if (!(me->value && *me->value))
 	    break;
 	/*
-	**  Force the Content-Transfer-Encoding value
-	**  to all lower case. - FM
-	*/
+	 * Force the Content-Transfer-Encoding value to all lower case.  - FM
+	 */
 	LYLowerCase(me->value);
 	me->encoding = HTAtom_for(me->value);
 	break;
@@ -748,9 +739,9 @@ static int dispatchField (HTStream *  me)
 	if (!(me->value && *me->value))
 	    break;
 	/*
-	**  Force the Content-Type value to all lower case
-	**  and strip spaces and double-quotes. - FM
-	*/
+	 * Force the Content-Type value to all lower case and strip spaces and
+	 * double-quotes.  - FM
+	 */
 	for (i = 0, j = 0; me->value[i]; i++) {
 	    if (me->value[i] != ' ' && me->value[i] != '\"') {
 		me->value[j++] = (char) TOLOWER(me->value[i]);
@@ -766,22 +757,21 @@ static int dispatchField (HTStream *  me)
 	if (!(me->value && *me->value))
 	    break;
 	/*
-	**  Indicate in anchor. - FM
-	*/
+	 * Indicate in anchor.  - FM
+	 */
 	StrAllocCopy(me->anchor->date, me->value);
 	break;
     case miETAG:
-	/*  Do not trim double quotes:
-	 *  an entity tag consists of an opaque quoted string,
-	 *  possibly prefixed by a weakness indicator.
+	/* Do not trim double quotes:  an entity tag consists of an opaque
+	 * quoted string, possibly prefixed by a weakness indicator.
 	 */
 	CTRACE((tfp, "HTMIME: PICKED UP ETag: %s\n",
 		me->value));
 	if (!(me->value && *me->value))
 	    break;
 	/*
-	**  Indicate in anchor. - FM
-	*/
+	 * Indicate in anchor.  - FM
+	 */
 	StrAllocCopy(me->anchor->ETag, me->value);
 	break;
     case miEXPIRES:
@@ -791,8 +781,8 @@ static int dispatchField (HTStream *  me)
 	if (!(me->value && *me->value))
 	    break;
 	/*
-	**  Indicate in anchor. - FM
-	*/
+	 * Indicate in anchor.  - FM
+	 */
 	StrAllocCopy(me->anchor->expires, me->value);
 	break;
     case miKEEP_ALIVE:
@@ -807,8 +797,8 @@ static int dispatchField (HTStream *  me)
 	if (!(me->value && *me->value))
 	    break;
 	/*
-	**  Indicate in anchor. - FM
-	*/
+	 * Indicate in anchor.  - FM
+	 */
 	StrAllocCopy(me->anchor->last_modified, me->value);
 	break;
     case miLINK:
@@ -833,8 +823,8 @@ static int dispatchField (HTStream *  me)
 	if (!(me->value && *me->value))
 	    break;
 	/*
-	**  Check whether to set no_cache for the anchor. - FM
-	*/
+	 * Check whether to set no_cache for the anchor.  - FM
+	 */
 	if (!strcmp(me->value, "no-cache"))
 	    me->anchor->no_cache = TRUE;
 	break;
@@ -866,17 +856,17 @@ static int dispatchField (HTStream *  me)
 	if (!(me->value && *me->value))
 	    break;
 	/*
-	**  Indicate in anchor if "YES" or "TRUE". - FM
-	*/
+	 * Indicate in anchor if "YES" or "TRUE".  - FM
+	 */
 	if (!strcasecomp(me->value, "YES") ||
 	    !strcasecomp(me->value, "TRUE")) {
 	    me->anchor->safe = TRUE;
 	} else if (!strcasecomp(me->value, "NO") ||
 		   !strcasecomp(me->value, "FALSE")) {
 	    /*
-	    **  If server explicitly tells us that it has changed
-	    **  its mind, reset flag in anchor. - kw
-	    */
+	     * If server explicitly tells us that it has changed its mind,
+	     * reset flag in anchor.  - kw
+	     */
 	    me->anchor->safe = FALSE;
 	}
 	break;
@@ -887,8 +877,8 @@ static int dispatchField (HTStream *  me)
 	if (!(me->value && *me->value))
 	    break;
 	/*
-	**  Indicate in anchor. - FM
-	*/
+	 * Indicate in anchor.  - FM
+	 */
 	StrAllocCopy(me->anchor->server, me->value);
 	break;
     case miSET_COOKIE1:
@@ -953,49 +943,48 @@ static int dispatchField (HTStream *  me)
 	CTRACE((tfp, "HTMIME: PICKED UP WWW-Authenticate: '%s'\n",
 		me->value));
 	break;
-    default:		/* Should never get here */
+    default:			/* Should never get here */
 	return HT_ERROR;
     }
     return HT_OK;
 }
 
-
 /*_________________________________________________________________________
-**
-**			A C T I O N	R O U T I N E S
-*/
+ *
+ *			A C T I O N	R O U T I N E S
+ */
 
 /*	Character handling
-**	------------------
-**
-**	This is a FSM parser. It ignores field names it does not understand.
-**	Folded header fields are recognized.  Lines without a fieldname at
-**	the beginning (that are not folded continuation lines) are ignored
-**	as unknown field names.  Fields with empty values are not picked up.
-*/
-static void HTMIME_put_character (
-	HTStream *	me,
-	char		c)
+ *	------------------
+ *
+ *	This is a FSM parser. It ignores field names it does not understand.
+ *	Folded header fields are recognized.  Lines without a fieldname at
+ *	the beginning (that are not folded continuation lines) are ignored
+ *	as unknown field names.  Fields with empty values are not picked up.
+ */
+static void HTMIME_put_character(HTStream *me,
+				 char c)
 {
     if (me->state == MIME_TRANSPARENT) {
-	(*me->targetClass.put_character)(me->target, c);/* MUST BE FAST */
+	(*me->targetClass.put_character) (me->target, c);	/* MUST BE FAST */
 	return;
     }
 
     /*
-    **	This slightly simple conversion just strips CR and turns LF to
-    **	newline.  On unix LF is \n but on Mac \n is CR for example.
-    **	See NetToText for an implementation which preserves single CR or LF.
-    */
+     * This slightly simple conversion just strips CR and turns LF to newline. 
+     * On unix LF is \n but on Mac \n is CR for example.  See NetToText for an
+     * implementation which preserves single CR or LF.
+     */
     if (me->net_ascii) {
 	/*
-	** <sigh> This is evidence that at one time, this code supported
-	** local character sets other than ASCII.  But there is so much
-	** code in HTTP.c that depends on line_buffer's having been
-	** translated to local character set that I needed to put the
-	** FROMASCII translation there, leaving this translation purely
-	** destructive.  -- gil
-	*/  /* S/390 -- gil -- 0118 */
+	 * <sigh> This is evidence that at one time, this code supported
+	 * local character sets other than ASCII.  But there is so much
+	 * code in HTTP.c that depends on line_buffer's having been
+	 * translated to local character set that I needed to put the
+	 * FROMASCII translation there, leaving this translation purely
+	 * destructive.  -- gil
+	 */
+	/* S/390 -- gil -- 0118 */
 #ifndef   NOT_ASCII
 	c = FROMASCII(c);
 #endif /* NOT_ASCII */
@@ -1005,25 +994,25 @@ static void HTMIME_put_character (
 	    c = '\n';
     }
 
-    switch(me->state) {
+    switch (me->state) {
 
     case MIME_IGNORE:
 	return;
 
-    case MIME_TRANSPARENT:		/* Not reached see above */
-	(*me->targetClass.put_character)(me->target, c);
+    case MIME_TRANSPARENT:	/* Not reached see above */
+	(*me->targetClass.put_character) (me->target, c);
 	return;
 
     case MIME_NET_ASCII:
-	(*me->targetClass.put_character)(me->target, c); /* MUST BE FAST */
+	(*me->targetClass.put_character) (me->target, c);	/* MUST BE FAST */
 	return;
 
     case miNEWLINE:
-	if (c != '\n' && WHITE(c)) {		/* Folded line */
-	    me->state = me->fold_state; /* pop state before newline */
+	if (c != '\n' && WHITE(c)) {	/* Folded line */
+	    me->state = me->fold_state;		/* pop state before newline */
 	    if (me->state == miGET_VALUE &&
 		me->value_pointer && me->value_pointer != me->value &&
-		!WHITE(*(me->value_pointer-1))) {
+		!WHITE(*(me->value_pointer - 1))) {
 		c = ' ';
 		goto GET_VALUE;	/* will add space to value if it fits - kw */
 	    }
@@ -1055,7 +1044,8 @@ static void HTMIME_put_character (
 	    me->check_pointer = "ate:";
 	    me->if_ok = miDATE;
 	    me->state = miCHECK;
-	    CTRACE((tfp, "HTMIME: Got 'D' at beginning of line, checking for 'ate:'\n"));
+	    CTRACE((tfp,
+		    "HTMIME: Got 'D' at beginning of line, checking for 'ate:'\n"));
 	    break;
 
 	case 'e':
@@ -1069,7 +1059,8 @@ static void HTMIME_put_character (
 	    me->check_pointer = "eep-alive:";
 	    me->if_ok = miKEEP_ALIVE;
 	    me->state = miCHECK;
-	    CTRACE((tfp, "HTMIME: Got 'K' at beginning of line, checking for 'eep-alive:'\n"));
+	    CTRACE((tfp,
+		    "HTMIME: Got 'K' at beginning of line, checking for 'eep-alive:'\n"));
 	    break;
 
 	case 'l':
@@ -1120,7 +1111,7 @@ static void HTMIME_put_character (
 	    CTRACE((tfp, "HTMIME: Got 'W' at beginning of line, state now W\n"));
 	    break;
 
-	case '\n':			/* Blank line: End of Header! */
+	case '\n':		/* Blank line: End of Header! */
 	    {
 		me->net_ascii = NO;
 		pumpData(me);
@@ -1128,19 +1119,20 @@ static void HTMIME_put_character (
 	    break;
 
 	default:
-	   goto bad_field_name;
+	    goto bad_field_name;
 
-	} /* switch on character */
+	}			/* switch on character */
 	break;
 
-    case miA:				/* Check for 'c','g' or 'l' */
+    case miA:			/* Check for 'c','g' or 'l' */
 	switch (c) {
 	case 'c':
 	case 'C':
 	    me->check_pointer = "cept-ranges:";
 	    me->if_ok = miACCEPT_RANGES;
 	    me->state = miCHECK;
-	    CTRACE((tfp, "HTMIME: Was A, found C, checking for 'cept-ranges:'\n"));
+	    CTRACE((tfp,
+		    "HTMIME: Was A, found C, checking for 'cept-ranges:'\n"));
 	    break;
 
 	case 'g':
@@ -1158,14 +1150,15 @@ static void HTMIME_put_character (
 	    break;
 
 	default:
-	    CTRACE((tfp, "HTMIME: Bad character `%c' found where `%s' expected\n",
-			c, "'g' or 'l'"));
+	    CTRACE((tfp,
+		    "HTMIME: Bad character `%c' found where `%s' expected\n",
+		    c, "'g' or 'l'"));
 	    goto bad_field_name;
 
-	} /* switch on character */
+	}			/* switch on character */
 	break;
 
-    case miAL:				/* Check for 'l' or 't' */
+    case miAL:			/* Check for 'l' or 't' */
 	switch (c) {
 	case 'l':
 	case 'L':
@@ -1184,21 +1177,23 @@ static void HTMIME_put_character (
 	    break;
 
 	default:
-	    CTRACE((tfp, "HTMIME: Bad character `%c' found where `%s' expected\n",
-			c, "'l' or 't'"));
+	    CTRACE((tfp,
+		    "HTMIME: Bad character `%c' found where `%s' expected\n",
+		    c, "'l' or 't'"));
 	    goto bad_field_name;
 
-	} /* switch on character */
+	}			/* switch on character */
 	break;
 
-    case miC:				/* Check for 'a' or 'o' */
+    case miC:			/* Check for 'a' or 'o' */
 	switch (c) {
 	case 'a':
 	case 'A':
 	    me->check_pointer = "che-control:";
 	    me->if_ok = miCACHE_CONTROL;
 	    me->state = miCHECK;
-	    CTRACE((tfp, "HTMIME: Was C, found A, checking for 'che-control:'\n"));
+	    CTRACE((tfp,
+		    "HTMIME: Was C, found A, checking for 'che-control:'\n"));
 	    break;
 
 	case 'o':
@@ -1208,14 +1203,15 @@ static void HTMIME_put_character (
 	    break;
 
 	default:
-	    CTRACE((tfp, "HTMIME: Bad character `%c' found where `%s' expected\n",
-			c, "'a' or 'o'"));
+	    CTRACE((tfp,
+		    "HTMIME: Bad character `%c' found where `%s' expected\n",
+		    c, "'a' or 'o'"));
 	    goto bad_field_name;
 
-	} /* switch on character */
+	}			/* switch on character */
 	break;
 
-    case miCO:				/* Check for 'n' or 'o' */
+    case miCO:			/* Check for 'n' or 'o' */
 	switch (c) {
 	case 'n':
 	case 'N':
@@ -1232,14 +1228,15 @@ static void HTMIME_put_character (
 	    break;
 
 	default:
-	    CTRACE((tfp, "HTMIME: Bad character `%c' found where `%s' expected\n",
-			c, "'n' or 'o'"));
+	    CTRACE((tfp,
+		    "HTMIME: Bad character `%c' found where `%s' expected\n",
+		    c, "'n' or 'o'"));
 	    goto bad_field_name;
 
-	} /* switch on character */
+	}			/* switch on character */
 	break;
 
-    case miCON:				/* Check for 'n' or 't' */
+    case miCON:		/* Check for 'n' or 't' */
 	switch (c) {
 	case 'n':
 	case 'N':
@@ -1258,14 +1255,15 @@ static void HTMIME_put_character (
 	    break;
 
 	default:
-	    CTRACE((tfp, "HTMIME: Bad character `%c' found where `%s' expected\n",
-			c, "'n' or 't'"));
+	    CTRACE((tfp,
+		    "HTMIME: Bad character `%c' found where `%s' expected\n",
+		    c, "'n' or 't'"));
 	    goto bad_field_name;
 
-	} /* switch on character */
+	}			/* switch on character */
 	break;
 
-    case miE:				/* Check for 't' or 'x' */
+    case miE:			/* Check for 't' or 'x' */
 	switch (c) {
 	case 't':
 	case 'T':
@@ -1284,21 +1282,23 @@ static void HTMIME_put_character (
 	    break;
 
 	default:
-	    CTRACE((tfp, "HTMIME: Bad character `%c' found where `%s' expected\n",
-			c, "'t' or 'x'"));
+	    CTRACE((tfp,
+		    "HTMIME: Bad character `%c' found where `%s' expected\n",
+		    c, "'t' or 'x'"));
 	    goto bad_field_name;
 
-	} /* switch on character */
+	}			/* switch on character */
 	break;
 
-    case miL:				/* Check for 'a', 'i' or 'o' */
+    case miL:			/* Check for 'a', 'i' or 'o' */
 	switch (c) {
 	case 'a':
 	case 'A':
 	    me->check_pointer = "st-modified:";
 	    me->if_ok = miLAST_MODIFIED;
 	    me->state = miCHECK;
-	    CTRACE((tfp, "HTMIME: Was L, found A, checking for 'st-modified:'\n"));
+	    CTRACE((tfp,
+		    "HTMIME: Was L, found A, checking for 'st-modified:'\n"));
 	    break;
 
 	case 'i':
@@ -1318,14 +1318,15 @@ static void HTMIME_put_character (
 	    break;
 
 	default:
-	    CTRACE((tfp, "HTMIME: Bad character `%c' found where `%s' expected\n",
-			c, "'a', 'i' or 'o'"));
+	    CTRACE((tfp,
+		    "HTMIME: Bad character `%c' found where `%s' expected\n",
+		    c, "'a', 'i' or 'o'"));
 	    goto bad_field_name;
 
-	} /* switch on character */
+	}			/* switch on character */
 	break;
 
-    case miP:				/* Check for 'r' or 'u' */
+    case miP:			/* Check for 'r' or 'u' */
 	switch (c) {
 	case 'r':
 	case 'R':
@@ -1342,14 +1343,15 @@ static void HTMIME_put_character (
 	    break;
 
 	default:
-	    CTRACE((tfp, "HTMIME: Bad character `%c' found where `%s' expected\n",
-			c, "'r' or 'u'"));
+	    CTRACE((tfp,
+		    "HTMIME: Bad character `%c' found where `%s' expected\n",
+		    c, "'r' or 'u'"));
 	    goto bad_field_name;
 
-	} /* switch on character */
+	}			/* switch on character */
 	break;
 
-    case miPR:				/* Check for 'a' or 'o' */
+    case miPR:			/* Check for 'a' or 'o' */
 	switch (c) {
 	case 'a':
 	case 'A':
@@ -1364,18 +1366,20 @@ static void HTMIME_put_character (
 	    me->check_pointer = "xy-authenticate:";
 	    me->if_ok = miPROXY_AUTHENTICATE;
 	    me->state = miCHECK;
-	    CTRACE((tfp, "HTMIME: Was PR, found O, checking for 'xy-authenticate'\n"));
+	    CTRACE((tfp,
+		    "HTMIME: Was PR, found O, checking for 'xy-authenticate'\n"));
 	    break;
 
 	default:
-	    CTRACE((tfp, "HTMIME: Bad character `%c' found where `%s' expected\n",
-			c, "'a' or 'o'"));
+	    CTRACE((tfp,
+		    "HTMIME: Bad character `%c' found where `%s' expected\n",
+		    c, "'a' or 'o'"));
 	    goto bad_field_name;
 
-	} /* switch on character */
+	}			/* switch on character */
 	break;
 
-    case miR:				/* Check for 'e' */
+    case miR:			/* Check for 'e' */
 	switch (c) {
 	case 'e':
 	case 'E':
@@ -1383,17 +1387,18 @@ static void HTMIME_put_character (
 	    CTRACE((tfp, "HTMIME: Was R, found E\n"));
 	    break;
 	default:
-	    CTRACE((tfp, "HTMIME: Bad character `%c' found where `%s' expected\n",
-			c, "'e'"));
+	    CTRACE((tfp,
+		    "HTMIME: Bad character `%c' found where `%s' expected\n",
+		    c, "'e'"));
 	    goto bad_field_name;
 
-	} /* switch on character */
+	}			/* switch on character */
 	break;
 
-    case miRE:				/* Check for 'a' or 'o' */
+    case miRE:			/* Check for 'a' or 'o' */
 	switch (c) {
 	case 'f':
-	case 'F':			/* nonstandard: Netscape */
+	case 'F':		/* nonstandard: Netscape */
 	    me->check_pointer = "resh:";
 	    me->if_ok = miREFRESH;
 	    me->state = miCHECK;
@@ -1409,14 +1414,15 @@ static void HTMIME_put_character (
 	    break;
 
 	default:
-	    CTRACE((tfp, "HTMIME: Bad character `%c' found where `%s' expected\n",
-			c, "'f' or 't'"));
+	    CTRACE((tfp,
+		    "HTMIME: Bad character `%c' found where `%s' expected\n",
+		    c, "'f' or 't'"));
 	    goto bad_field_name;
 
-	} /* switch on character */
+	}			/* switch on character */
 	break;
 
-    case miS:				/* Check for 'a' or 'e' */
+    case miS:			/* Check for 'a' or 'e' */
 	switch (c) {
 	case 'a':
 	case 'A':
@@ -1433,14 +1439,15 @@ static void HTMIME_put_character (
 	    break;
 
 	default:
-	    CTRACE((tfp, "HTMIME: Bad character `%c' found where `%s' expected\n",
-			c, "'a' or 'e'"));
+	    CTRACE((tfp,
+		    "HTMIME: Bad character `%c' found where `%s' expected\n",
+		    c, "'a' or 'e'"));
 	    goto bad_field_name;
 
-	} /* switch on character */
+	}			/* switch on character */
 	break;
 
-    case miSE:				/* Check for 'r' or 't' */
+    case miSE:			/* Check for 'r' or 't' */
 	switch (c) {
 	case 'r':
 	case 'R':
@@ -1459,17 +1466,18 @@ static void HTMIME_put_character (
 	    break;
 
 	default:
-	    CTRACE((tfp, "HTMIME: Bad character `%c' found where `%s' expected\n",
-			c, "'r' or 't'"));
+	    CTRACE((tfp,
+		    "HTMIME: Bad character `%c' found where `%s' expected\n",
+		    c, "'r' or 't'"));
 	    goto bad_field_name;
 
-	} /* switch on character */
+	}			/* switch on character */
 	break;
 
-    case miSET_COOKIE:			/* Check for ':' or '2' */
+    case miSET_COOKIE:		/* Check for ':' or '2' */
 	switch (c) {
 	case ':':
-	    me->field = miSET_COOKIE1;		/* remember it */
+	    me->field = miSET_COOKIE1;	/* remember it */
 	    me->state = miSKIP_GET_VALUE;
 	    CTRACE((tfp, "HTMIME: Was SET_COOKIE, found :, processing\n"));
 	    break;
@@ -1482,14 +1490,15 @@ static void HTMIME_put_character (
 	    break;
 
 	default:
-	    CTRACE((tfp, "HTMIME: Bad character `%c' found where `%s' expected\n",
-			c, "':' or '2'"));
+	    CTRACE((tfp,
+		    "HTMIME: Bad character `%c' found where `%s' expected\n",
+		    c, "':' or '2'"));
 	    goto bad_field_name;
 
-	} /* switch on character */
+	}			/* switch on character */
 	break;
 
-    case miT:				/* Check for 'i' or 'r' */
+    case miT:			/* Check for 'i' or 'r' */
 	switch (c) {
 	case 'i':
 	case 'I':
@@ -1504,18 +1513,20 @@ static void HTMIME_put_character (
 	    me->check_pointer = "ansfer-encoding:";
 	    me->if_ok = miTRANSFER_ENCODING;
 	    me->state = miCHECK;
-	    CTRACE((tfp, "HTMIME: Was T, found R, checking for 'ansfer-encoding'\n"));
+	    CTRACE((tfp,
+		    "HTMIME: Was T, found R, checking for 'ansfer-encoding'\n"));
 	    break;
 
 	default:
-	    CTRACE((tfp, "HTMIME: Bad character `%c' found where `%s' expected\n",
-			c, "'i' or 'r'"));
+	    CTRACE((tfp,
+		    "HTMIME: Bad character `%c' found where `%s' expected\n",
+		    c, "'i' or 'r'"));
 	    goto bad_field_name;
 
-	} /* switch on character */
+	}			/* switch on character */
 	break;
 
-    case miU:				/* Check for 'p' or 'r' */
+    case miU:			/* Check for 'p' or 'r' */
 	switch (c) {
 	case 'p':
 	case 'P':
@@ -1534,14 +1545,15 @@ static void HTMIME_put_character (
 	    break;
 
 	default:
-	    CTRACE((tfp, "HTMIME: Bad character `%c' found where `%s' expected\n",
-			c, "'p' or 'r'"));
+	    CTRACE((tfp,
+		    "HTMIME: Bad character `%c' found where `%s' expected\n",
+		    c, "'p' or 'r'"));
 	    goto bad_field_name;
 
-	} /* switch on character */
+	}			/* switch on character */
 	break;
 
-    case miV:				/* Check for 'a' or 'i' */
+    case miV:			/* Check for 'a' or 'i' */
 	switch (c) {
 	case 'a':
 	case 'A':
@@ -1560,14 +1572,15 @@ static void HTMIME_put_character (
 	    break;
 
 	default:
-	    CTRACE((tfp, "HTMIME: Bad character `%c' found where `%s' expected\n",
-			c, "'a' or 'i'"));
+	    CTRACE((tfp,
+		    "HTMIME: Bad character `%c' found where `%s' expected\n",
+		    c, "'a' or 'i'"));
 	    goto bad_field_name;
 
-	} /* switch on character */
+	}			/* switch on character */
 	break;
 
-    case miW:				/* Check for 'a' or 'w' */
+    case miW:			/* Check for 'a' or 'w' */
 	switch (c) {
 	case 'a':
 	case 'A':
@@ -1582,24 +1595,27 @@ static void HTMIME_put_character (
 	    me->check_pointer = "w-authenticate:";
 	    me->if_ok = miWWW_AUTHENTICATE;
 	    me->state = miCHECK;
-	    CTRACE((tfp, "HTMIME: Was W, found W, checking for 'w-authenticate:'\n"));
+	    CTRACE((tfp,
+		    "HTMIME: Was W, found W, checking for 'w-authenticate:'\n"));
 	    break;
 
 	default:
-	    CTRACE((tfp, "HTMIME: Bad character `%c' found where `%s' expected\n",
-			c, "'a' or 'w'"));
+	    CTRACE((tfp,
+		    "HTMIME: Bad character `%c' found where `%s' expected\n",
+		    c, "'a' or 'w'"));
 	    goto bad_field_name;
 
-	} /* switch on character */
+	}			/* switch on character */
 	break;
 
-    case miCHECK:			/* Check against string */
+    case miCHECK:		/* Check against string */
 	if (TOLOWER(c) == *(me->check_pointer)++) {
 	    if (!*me->check_pointer)
 		me->state = me->if_ok;
 	} else {		/* Error */
-	    CTRACE((tfp, "HTMIME: Bad character `%c' found where `%s' expected\n",
-			c, me->check_pointer - 1));
+	    CTRACE((tfp,
+		    "HTMIME: Bad character `%c' found where `%s' expected\n",
+		    c, me->check_pointer - 1));
 	    goto bad_field_name;
 	}
 	break;
@@ -1607,13 +1623,14 @@ static void HTMIME_put_character (
     case miCONTENT_:
 	CTRACE((tfp, "HTMIME: in case CONTENT_\n"));
 
-	switch(c) {
+	switch (c) {
 	case 'b':
 	case 'B':
 	    me->check_pointer = "ase:";
 	    me->if_ok = miCONTENT_BASE;
 	    me->state = miCHECK;
-	    CTRACE((tfp, "HTMIME: Was CONTENT_, found B, checking for 'ase:'\n"));
+	    CTRACE((tfp,
+		    "HTMIME: Was CONTENT_, found B, checking for 'ase:'\n"));
 	    break;
 
 	case 'd':
@@ -1621,7 +1638,8 @@ static void HTMIME_put_character (
 	    me->check_pointer = "isposition:";
 	    me->if_ok = miCONTENT_DISPOSITION;
 	    me->state = miCHECK;
-	    CTRACE((tfp, "HTMIME: Was CONTENT_, found D, checking for 'isposition:'\n"));
+	    CTRACE((tfp,
+		    "HTMIME: Was CONTENT_, found D, checking for 'isposition:'\n"));
 	    break;
 
 	case 'e':
@@ -1629,7 +1647,8 @@ static void HTMIME_put_character (
 	    me->check_pointer = "ncoding:";
 	    me->if_ok = miCONTENT_ENCODING;
 	    me->state = miCHECK;
-	    CTRACE((tfp, "HTMIME: Was CONTENT_, found E, checking for 'ncoding:'\n"));
+	    CTRACE((tfp,
+		    "HTMIME: Was CONTENT_, found E, checking for 'ncoding:'\n"));
 	    break;
 
 	case 'f':
@@ -1637,13 +1656,15 @@ static void HTMIME_put_character (
 	    me->check_pointer = "eatures:";
 	    me->if_ok = miCONTENT_FEATURES;
 	    me->state = miCHECK;
-	    CTRACE((tfp, "HTMIME: Was CONTENT_, found F, checking for 'eatures:'\n"));
+	    CTRACE((tfp,
+		    "HTMIME: Was CONTENT_, found F, checking for 'eatures:'\n"));
 	    break;
 
 	case 'l':
 	case 'L':
 	    me->state = miCONTENT_L;
-	    CTRACE((tfp, "HTMIME: Was CONTENT_, found L, state now CONTENT_L\n"));
+	    CTRACE((tfp,
+		    "HTMIME: Was CONTENT_, found L, state now CONTENT_L\n"));
 	    break;
 
 	case 'm':
@@ -1659,32 +1680,35 @@ static void HTMIME_put_character (
 	    me->check_pointer = "ange:";
 	    me->if_ok = miCONTENT_RANGE;
 	    me->state = miCHECK;
-	    CTRACE((tfp, "HTMIME: Was CONTENT_, found R, checking for 'ange:'\n"));
+	    CTRACE((tfp,
+		    "HTMIME: Was CONTENT_, found R, checking for 'ange:'\n"));
 	    break;
 
 	case 't':
 	case 'T':
 	    me->state = miCONTENT_T;
-	    CTRACE((tfp, "HTMIME: Was CONTENT_, found T, state now CONTENT_T\n"));
+	    CTRACE((tfp,
+		    "HTMIME: Was CONTENT_, found T, state now CONTENT_T\n"));
 	    break;
 
 	default:
 	    CTRACE((tfp, "HTMIME: Was CONTENT_, found nothing; bleah\n"));
 	    goto bad_field_name;
 
-	} /* switch on character */
+	}			/* switch on character */
 	break;
 
     case miCONTENT_L:
 	CTRACE((tfp, "HTMIME: in case CONTENT_L\n"));
 
-      switch(c) {
+	switch (c) {
 	case 'a':
 	case 'A':
 	    me->check_pointer = "nguage:";
 	    me->if_ok = miCONTENT_LANGUAGE;
 	    me->state = miCHECK;
-	    CTRACE((tfp, "HTMIME: Was CONTENT_L, found A, checking for 'nguage:'\n"));
+	    CTRACE((tfp,
+		    "HTMIME: Was CONTENT_L, found A, checking for 'nguage:'\n"));
 	    break;
 
 	case 'e':
@@ -1692,7 +1716,8 @@ static void HTMIME_put_character (
 	    me->check_pointer = "ngth:";
 	    me->if_ok = miCONTENT_LENGTH;
 	    me->state = miCHECK;
-	    CTRACE((tfp, "HTMIME: Was CONTENT_L, found E, checking for 'ngth:'\n"));
+	    CTRACE((tfp,
+		    "HTMIME: Was CONTENT_L, found E, checking for 'ngth:'\n"));
 	    break;
 
 	case 'o':
@@ -1700,26 +1725,28 @@ static void HTMIME_put_character (
 	    me->check_pointer = "cation:";
 	    me->if_ok = miCONTENT_LOCATION;
 	    me->state = miCHECK;
-	    CTRACE((tfp, "HTMIME: Was CONTENT_L, found O, checking for 'cation:'\n"));
+	    CTRACE((tfp,
+		    "HTMIME: Was CONTENT_L, found O, checking for 'cation:'\n"));
 	    break;
 
 	default:
 	    CTRACE((tfp, "HTMIME: Was CONTENT_L, found nothing; bleah\n"));
 	    goto bad_field_name;
 
-	} /* switch on character */
+	}			/* switch on character */
 	break;
 
     case miCONTENT_T:
 	CTRACE((tfp, "HTMIME: in case CONTENT_T\n"));
 
-      switch(c) {
+	switch (c) {
 	case 'r':
 	case 'R':
 	    me->check_pointer = "ansfer-encoding:";
 	    me->if_ok = miCONTENT_TRANSFER_ENCODING;
 	    me->state = miCHECK;
-	    CTRACE((tfp, "HTMIME: Was CONTENT_T, found R, checking for 'ansfer-encoding:'\n"));
+	    CTRACE((tfp,
+		    "HTMIME: Was CONTENT_T, found R, checking for 'ansfer-encoding:'\n"));
 	    break;
 
 	case 'y':
@@ -1727,14 +1754,15 @@ static void HTMIME_put_character (
 	    me->check_pointer = "pe:";
 	    me->if_ok = miCONTENT_TYPE;
 	    me->state = miCHECK;
-	    CTRACE((tfp, "HTMIME: Was CONTENT_T, found Y, checking for 'pe:'\n"));
+	    CTRACE((tfp,
+		    "HTMIME: Was CONTENT_T, found Y, checking for 'pe:'\n"));
 	    break;
 
 	default:
 	    CTRACE((tfp, "HTMIME: Was CONTENT_T, found nothing; bleah\n"));
 	    goto bad_field_name;
 
-	} /* switch on character */
+	}			/* switch on character */
 	break;
 
     case miACCEPT_RANGES:
@@ -1779,7 +1807,7 @@ static void HTMIME_put_character (
     case miVIA:
     case miWARNING:
     case miWWW_AUTHENTICATE:
-	me->field = me->state;		/* remember it */
+	me->field = me->state;	/* remember it */
 	me->state = miSKIP_GET_VALUE;
 	/* Fall through! */
 
@@ -1791,8 +1819,8 @@ static void HTMIME_put_character (
 	}
 	if (WHITE(c))
 	    /*
-	    **	Skip white space.
-	    */
+	     * Skip white space.
+	     */
 	    break;
 
 	me->value_pointer = me->value;
@@ -1800,8 +1828,8 @@ static void HTMIME_put_character (
 	/* Fall through to store first character */
 
     case miGET_VALUE:
-    GET_VALUE:
-	if (c != '\n') {			/* Not end of line */
+      GET_VALUE:
+	if (c != '\n') {	/* Not end of line */
 	    if (me->value_pointer < me->value + VALUE_SIZE - 1) {
 		*me->value_pointer++ = c;
 		break;
@@ -1818,129 +1846,118 @@ static void HTMIME_put_character (
 	}
 	break;
 
-
-    } /* switch on state*/
+    }				/* switch on state */
 
     return;
 
-value_too_long:
+  value_too_long:
     CTRACE((tfp, "HTMIME: *** Syntax error. (string too long)\n"));
 
-bad_field_name:				/* Ignore it */
+  bad_field_name:		/* Ignore it */
     me->state = miJUNK_LINE;
     return;
 
 }
 
-
-
 /*	String handling
-**	---------------
-**
-**	Strings must be smaller than this buffer size.
-*/
-static void HTMIME_put_string (
-	HTStream *	me,
-	const char *	s)
+ *	---------------
+ *
+ *	Strings must be smaller than this buffer size.
+ */
+static void HTMIME_put_string(HTStream *me,
+			      const char *s)
 {
-    const char * p;
+    const char *p;
 
     if (me->state == MIME_TRANSPARENT) {	/* Optimisation */
-	(*me->targetClass.put_string)(me->target,s);
+	(*me->targetClass.put_string) (me->target, s);
 
     } else if (me->state != MIME_IGNORE) {
 	CTRACE((tfp, "HTMIME:  %s\n", s));
 
-	for (p=s; *p; p++)
+	for (p = s; *p; p++)
 	    HTMIME_put_character(me, *p);
     }
 }
 
-
 /*	Buffer write.  Buffers can (and should!) be big.
-**	------------
-*/
-static void HTMIME_write (
-	HTStream *	me,
-	const char *	s,
-	int		l)
+ *	------------
+ */
+static void HTMIME_write(HTStream *me,
+			 const char *s,
+			 int l)
 {
-    const char * p;
+    const char *p;
 
     if (me->state == MIME_TRANSPARENT) {	/* Optimisation */
-	(*me->targetClass.put_block)(me->target, s, l);
+	(*me->targetClass.put_block) (me->target, s, l);
 
     } else {
 	CTRACE((tfp, "HTMIME:  %.*s\n", l, s));
 
-	for (p = s; p < s+l; p++)
+	for (p = s; p < s + l; p++)
 	    HTMIME_put_character(me, *p);
     }
 }
 
-
 /*	Free an HTML object
-**	-------------------
-**
-*/
-static void HTMIME_free (
-	HTStream *	me)
+ *	-------------------
+ *
+ */
+static void HTMIME_free(HTStream *me)
 {
     if (me) {
 	FREE(me->location);
 	FREE(me->compression_encoding);
 	if (me->target)
-	    (*me->targetClass._free)(me->target);
+	    (*me->targetClass._free) (me->target);
 	FREE(me);
     }
 }
 
 /*	End writing
 */
-static void HTMIME_abort (
-	HTStream *	me,
-	HTError	e)
+static void HTMIME_abort(HTStream *me,
+			 HTError e)
 {
     if (me) {
 	FREE(me->location);
 	FREE(me->compression_encoding);
 	if (me->target)
-	    (*me->targetClass._abort)(me->target, e);
+	    (*me->targetClass._abort) (me->target, e);
 	FREE(me);
     }
 }
 
-
 /*	Structured Object Class
-**	-----------------------
-*/
+ *	-----------------------
+ */
 static const HTStreamClass HTMIME =
 {
-	"MIMEParser",
-	HTMIME_free,
-	HTMIME_abort,
-	HTMIME_put_character,
-	HTMIME_put_string,
-	HTMIME_write
+    "MIMEParser",
+    HTMIME_free,
+    HTMIME_abort,
+    HTMIME_put_character,
+    HTMIME_put_string,
+    HTMIME_write
 };
 
-
 /*	Subclass-specific Methods
-**	-------------------------
-*/
-HTStream* HTMIMEConvert (
-	HTPresentation *	pres,
-	HTParentAnchor *	anchor,
-	HTStream *		sink)
+ *	-------------------------
+ */
+HTStream *HTMIMEConvert(HTPresentation *pres,
+			HTParentAnchor *anchor,
+			HTStream *sink)
 {
-    HTStream* me;
+    HTStream *me;
 
     me = typecalloc(HTStream);
+
     if (me == NULL)
 	outofmem(__FILE__, "HTMIMEConvert");
-    me->isa	=	&HTMIME;
-    me->sink	=	sink;
-    me->anchor	=	anchor;
+    me->isa = &HTMIME;
+    me->sink = sink;
+    me->anchor = anchor;
     me->anchor->safe = FALSE;
     me->anchor->no_cache = FALSE;
     FREE(me->anchor->cache_control);
@@ -1958,37 +1975,37 @@ HTStream* HTMIMEConvert (
     FREE(me->anchor->last_modified);
     FREE(me->anchor->ETag);
     FREE(me->anchor->server);
-    me->target	=	NULL;
-    me->state	=	miBEGINNING_OF_LINE;
+    me->target = NULL;
+    me->state = miBEGINNING_OF_LINE;
     /*
-     *	Sadly enough, change this to always default to WWW_HTML
-     *	to parse all text as HTML for the users.
-     *	GAB 06-30-94
-     *	Thanks to Robert Rowland robert@cyclops.pei.edu
+     * Sadly enough, change this to always default to WWW_HTML to parse all
+     * text as HTML for the users.
+     * GAB 06-30-94
+     * Thanks to Robert Rowland robert@cyclops.pei.edu
      *
-     *	After discussion of the correct handline, should be application/octet-
-     *		stream or unknown; causing servers to send a correct content
-     *		type.
+     * After discussion of the correct handline, should be application/octet-
+     * stream or unknown; causing servers to send a correct content type.
      *
-     *	The consequence of using WWW_UNKNOWN is that you end up downloading
-     *	as a binary file what 99.9% of the time is an HTML file, which should
-     *	have been rendered or displayed.  So sadly enough, I'm changing it
-     *	back to WWW_HTML, and it will handle the situation like Mosaic does,
-     *	and as Robert Rowland suggested, because being functionally correct
-     *	99.9% of the time is better than being technically correct but
-     *	functionally nonsensical. - FM
-     *//***
+     * The consequence of using WWW_UNKNOWN is that you end up downloading as a
+     * binary file what 99.9% of the time is an HTML file, which should have
+     * been rendered or displayed.  So sadly enough, I'm changing it back to
+     * WWW_HTML, and it will handle the situation like Mosaic does, and as
+     * Robert Rowland suggested, because being functionally correct 99.9% of
+     * the time is better than being technically correct but functionally
+     * nonsensical.  - FM
+     */
+    /***
     me->format	  =	WWW_UNKNOWN;
-	***/
-    me->format	  =	WWW_HTML;
-    me->targetRep =	pres->rep_out;
-    me->boundary  =	NULL;		/* Not set yet */
-    me->set_cookie =	NULL;		/* Not set yet */
-    me->set_cookie2 =	NULL;		/* Not set yet */
-    me->refresh_url =	NULL;		/* Not set yet */
-    me->encoding  =	0;		/* Not set yet */
+    ***/
+    me->format = WWW_HTML;
+    me->targetRep = pres->rep_out;
+    me->boundary = NULL;	/* Not set yet */
+    me->set_cookie = NULL;	/* Not set yet */
+    me->set_cookie2 = NULL;	/* Not set yet */
+    me->refresh_url = NULL;	/* Not set yet */
+    me->encoding = 0;		/* Not set yet */
     me->compression_encoding = NULL;	/* Not set yet */
-    me->net_ascii =	NO;		/* Local character set */
+    me->net_ascii = NO;		/* Local character set */
     HTAnchor_setUCInfoStage(me->anchor, current_char_set,
 			    UCT_STAGE_STRUCTURED,
 			    UCT_SETBY_DEFAULT);
@@ -1998,12 +2015,12 @@ HTStream* HTMIMEConvert (
     return me;
 }
 
-HTStream* HTNetMIME (
-	HTPresentation *	pres,
-	HTParentAnchor *	anchor,
-	HTStream *		sink)
+HTStream *HTNetMIME(HTPresentation *pres,
+		    HTParentAnchor *anchor,
+		    HTStream *sink)
 {
-    HTStream* me = HTMIMEConvert(pres,anchor, sink);
+    HTStream *me = HTMIMEConvert(pres, anchor, sink);
+
     if (!me)
 	return NULL;
 
@@ -2011,12 +2028,12 @@ HTStream* HTNetMIME (
     return me;
 }
 
-HTStream* HTMIMERedirect (
-	HTPresentation *	pres,
-	HTParentAnchor *	anchor,
-	HTStream *		sink)
+HTStream *HTMIMERedirect(HTPresentation *pres,
+			 HTParentAnchor *anchor,
+			 HTStream *sink)
 {
-    HTStream* me = HTMIMEConvert(pres,anchor, sink);
+    HTStream *me = HTMIMEConvert(pres, anchor, sink);
+
     if (!me)
 	return NULL;
 
@@ -2027,62 +2044,61 @@ HTStream* HTMIMERedirect (
 }
 
 /*		Japanese header handling functions
-**		==================================
-**
-**	K&Rized and added 07-Jun-96 by FM, based on:
-**
+ *		==================================
+ *
+ *	K&Rized and added 07-Jun-96 by FM, based on:
+ *
 ////////////////////////////////////////////////////////////////////////
-**
-**	ISO-2022-JP handling routines
-**			&
-**	MIME decode routines (quick hack just for ISO-2022-JP)
-**
-**		Thu Jan 25 10:11:42 JST 1996
-**
-**  Copyright (C) 1994, 1995, 1996
-**  Shuichi Ichikawa (ichikawa@nuee.nagoya-u.ac.jp)
-**
-**  This program is free software; you can redistribute it and/or modify
-**  it under the terms of the GNU General Public License as published by
-**  the Free Software Foundation; either versions 2, or (at your option)
-**  any later version.
-**
-**  This program is distributed in the hope that it will be useful
-**  but WITHOUT ANY WARRANTY; without even the implied warranty of
-**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-**  GNU General Public License for more details.
-**
-**  You should have received a copy of the GNU General Public License
-**  along with SKK, see the file COPYING.  If not, write to the Free
-**  Software Foundation Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-*/
+ *
+ *	ISO-2022-JP handling routines
+ *			&
+ *	MIME decode routines (quick hack just for ISO-2022-JP)
+ *
+ *		Thu Jan 25 10:11:42 JST 1996
+ *
+ *  Copyright (C) 1994, 1995, 1996
+ *  Shuichi Ichikawa (ichikawa@nuee.nagoya-u.ac.jp)
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either versions 2, or (at your option)
+ *  any later version.
+ *
+ *  This program is distributed in the hope that it will be useful
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with SKK, see the file COPYING.  If not, write to the Free
+ *  Software Foundation Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
 
 /*
-**  MIME decoding routines
-**
-**	Written by S. Ichikawa,
-**	partially inspired by encdec.c of <jh@efd.lth.se>.
-**	Assume caller's buffer is LINE_LENGTH bytes, these decode to
-**	no longer than the input strings.
-*/
+ *  MIME decoding routines
+ *
+ *	Written by S. Ichikawa,
+ *	partially inspired by encdec.c of <jh@efd.lth.se>.
+ *	Assume caller's buffer is LINE_LENGTH bytes, these decode to
+ *	no longer than the input strings.
+ */
 #define LINE_LENGTH 512		/* Maximum length of line of ARTICLE etc */
 #ifdef ESC
 #undef ESC
 #endif /* ESC */
-#include <LYCharVals.h>  /* S/390 -- gil -- 0163 */
+#include <LYCharVals.h>		/* S/390 -- gil -- 0163 */
 #define ESC	CH_ESC
 
 static char HTmm64[] =
-    "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=" ;
+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
 static char HTmmquote[] = "0123456789ABCDEF";
 static int HTmmcont = 0;
 
-void HTmmdec_base64 (
-	char *		t,
-	char *		s)
+void HTmmdec_base64(char *t,
+		    char *s)
 {
-    int   d, count, j, val;
-    char  buf[LINE_LENGTH], *bp, nw[4], *p;
+    int d, count, j, val;
+    char buf[LINE_LENGTH], *bp, nw[4], *p;
 
     for (bp = buf; *s; s += 4) {
 	val = 0;
@@ -2094,16 +2110,16 @@ void HTmmdec_base64 (
 	    count = 3;
 
 	for (j = 0; j <= count; j++) {
-		if (!(p = strchr(HTmm64, s[j]))) {
-			return;
-		}
-		d = p - HTmm64;
-		d <<= (3-j)*6;
-		val += d;
+	    if (!(p = strchr(HTmm64, s[j]))) {
+		return;
+	    }
+	    d = p - HTmm64;
+	    d <<= (3 - j) * 6;
+	    val += d;
 	}
 	for (j = 2; j >= 0; j--) {
-		nw[j] = (char) (val & 255);
-		val >>= 8;
+	    nw[j] = (char) (val & 255);
+	    val >>= 8;
 	}
 	if (count--)
 	    *bp++ = nw[0];
@@ -2116,13 +2132,12 @@ void HTmmdec_base64 (
     strcpy(t, buf);
 }
 
-void HTmmdec_quote (
-	char *		t,
-	char *		s)
+void HTmmdec_quote(char *t,
+		   char *s)
 {
-    char  buf[LINE_LENGTH], cval, *bp, *p;
+    char buf[LINE_LENGTH], cval, *bp, *p;
 
-    for (bp = buf; *s; ) {
+    for (bp = buf; *s;) {
 	if (*s == '=') {
 	    cval = 0;
 	    if (s[1] && (p = strchr(HTmmquote, s[1]))) {
@@ -2151,19 +2166,18 @@ void HTmmdec_quote (
 }
 
 /*
-**	HTmmdecode for ISO-2022-JP - FM
-*/
-void HTmmdecode (
-	char *		trg,
-	char *		str)
+ *	HTmmdecode for ISO-2022-JP - FM
+ */
+void HTmmdecode(char *trg,
+		char *str)
 {
     char buf[LINE_LENGTH], mmbuf[LINE_LENGTH];
     char *s, *t, *u;
-    int  base64, quote;
+    int base64, quote;
 
     buf[0] = '\0';
 
-    for (s = str, u = buf; *s; ) {
+    for (s = str, u = buf; *s;) {
 	if (!strncasecomp(s, "=?ISO-2022-JP?B?", 16)) {
 	    base64 = 1;
 	} else {
@@ -2177,11 +2191,11 @@ void HTmmdecode (
 	if (base64 || quote) {
 	    if (HTmmcont) {
 		for (t = s - 1;
-		    t >= str && (*t == ' ' || *t == '\t'); t--) {
-			u--;
+		     t >= str && (*t == ' ' || *t == '\t'); t--) {
+		    u--;
 		}
 	    }
-	    for (s += 16, t = mmbuf; *s; ) {
+	    for (s += 16, t = mmbuf; *s;) {
 		if (s[0] == '?' && s[1] == '=') {
 		    break;
 		} else {
@@ -2198,7 +2212,7 @@ void HTmmdecode (
 		HTmmdec_base64(mmbuf, mmbuf);
 	    if (quote)
 		HTmmdec_quote(mmbuf, mmbuf);
-	    for (t = mmbuf; *t; )
+	    for (t = mmbuf; *t;)
 		*u++ = *t++;
 	    HTmmcont = 1;
 	    /* if (*s == ' ' || *s == '\t') *u++ = *s; */
@@ -2210,17 +2224,16 @@ void HTmmdecode (
 	}
     }
     *u = '\0';
-end:
+  end:
     strcpy(trg, buf);
 }
 
 /*
-**  Insert ESC where it seems lost.
-**  (The author of this function "rjis" is S. Ichikawa.)
-*/
-int HTrjis (
-	char *		t,
-	char *		s)
+ *  Insert ESC where it seems lost.
+ *  (The author of this function "rjis" is S. Ichikawa.)
+ */
+int HTrjis(char *t,
+	   char *s)
 {
     char *p, buf[LINE_LENGTH];
     int kanji = 0;
@@ -2230,9 +2243,9 @@ int HTrjis (
 	    strcpy(t, s);
 	return 1;
     }
-    for (p = buf; *s; ) {
+    for (p = buf; *s;) {
 	if (!kanji && s[0] == '$' && (s[1] == '@' || s[1] == 'B')) {
-	    if (HTmaybekanji((int)s[2], (int)s[3])) {
+	    if (HTmaybekanji((int) s[2], (int) s[3])) {
 		kanji = 1;
 		*p++ = ESC;
 		*p++ = *s++;
@@ -2253,18 +2266,18 @@ int HTrjis (
 	}
 	*p++ = *s++;
     }
-    *p = *s;	/* terminate string */
+    *p = *s;			/* terminate string */
 
     strcpy(t, buf);
     return 0;
 }
 
 /*
-**  The following function "maybekanji" is derived from
-**  RJIS-1.0 by Mr. Hironobu Takahashi.
-**  Maybekanji() is included here under the courtesy of the author.
-**  The original comment of rjis.c is also included here.
-*/
+ *  The following function "maybekanji" is derived from
+ *  RJIS-1.0 by Mr. Hironobu Takahashi.
+ *  Maybekanji() is included here under the courtesy of the author.
+ *  The original comment of rjis.c is also included here.
+ */
 /*
  * RJIS ( Recover JIS code from broken file )
  * @Header: rjis.c,v 0.2 92/09/04 takahasi Exp @
@@ -2286,9 +2299,8 @@ int HTrjis (
  * Software Foundation Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-int HTmaybekanji (
-	int		c1,
-	int		c2)
+int HTmaybekanji(int c1,
+		 int c2)
 {
 
     if ((c2 < 33) || (c2 > 126))
@@ -2296,58 +2308,58 @@ int HTmaybekanji (
     if ((c1 < 33) || ((40 < c1) && (c1 < 48)) || (116 < c1))
 	return 0;
     c2 -= 32;
-    switch(c1-32) {
-      case 2:
-	if ((14 < c2) && ( c2 < 26))
+    switch (c1 - 32) {
+    case 2:
+	if ((14 < c2) && (c2 < 26))
 	    return 0;
-	if ((33 < c2) && ( c2 < 42))
+	if ((33 < c2) && (c2 < 42))
 	    return 0;
-	if ((48 < c2) && ( c2 < 60))
+	if ((48 < c2) && (c2 < 60))
 	    return 0;
-	if ((74 < c2) && ( c2 < 82))
+	if ((74 < c2) && (c2 < 82))
 	    return 0;
-	if ((89 < c2) && ( c2 < 94))
+	if ((89 < c2) && (c2 < 94))
 	    return 0;
 	break;
-      case 3:
+    case 3:
 	if (c2 < 16)
 	    return 0;
-	if ((25 < c2) && ( c2 < 33))
+	if ((25 < c2) && (c2 < 33))
 	    return 0;
-	if ((58 < c2) && ( c2 < 65))
+	if ((58 < c2) && (c2 < 65))
 	    return 0;
 	if (90 < c2)
 	    return 0;
 	break;
-      case 4:
+    case 4:
 	if (83 < c2)
 	    return 0;
 	break;
-      case 5:
+    case 5:
 	if (86 < c2)
 	    return 0;
 	break;
-      case 6:
-	if ((24 < c2) && ( c2 < 33))
+    case 6:
+	if ((24 < c2) && (c2 < 33))
 	    return 0;
 	if (56 < c2)
 	    return 0;
 	break;
-      case 7:
-	if ((33 < c2) && ( c2 < 49))
+    case 7:
+	if ((33 < c2) && (c2 < 49))
 	    return 0;
 	if (81 < c2)
 	    return 0;
 	break;
-      case 8:
+    case 8:
 	if (32 < c2)
 	    return 0;
 	break;
-      case 47:
+    case 47:
 	if (51 < c2)
 	    return 0;
 	break;
-      case 84:
+    case 84:
 	if (6 < c2)
 	    return 0;
 	break;
diff --git a/WWW/Library/Implementation/HTMIME.h b/WWW/Library/Implementation/HTMIME.h
index 96306745..a7650a98 100644
--- a/WWW/Library/Implementation/HTMIME.h
+++ b/WWW/Library/Implementation/HTMIME.h
@@ -1,23 +1,23 @@
 /*                   /Net/dxcern/userd/timbl/hypertext/WWW/Library/Implementation/HTMIME.html
                                        MIME PARSER
 
-   The MIME parser stream presents a MIME document.  It recursively invokes the format
-   manager to handle embedded formats.
+   The MIME parser stream presents a MIME document.  It recursively invokes the
+   format manager to handle embedded formats.
 
-   As well as stripping off and parsing the headers, the MIME parser has to parse any
-   weirld MIME encodings it may meet within the body parts of messages, and must deal with
-   multipart messages.
+   As well as stripping off and parsing the headers, the MIME parser has to
+   parse any weirld MIME encodings it may meet within the body parts of
+   messages, and must deal with multipart messages.
 
-   This module is implemented to the level necessary for operation with WWW, but is not
-   currently complete for any arbitrary MIME message.
+   This module is implemented to the level necessary for operation with WWW,
+   but is not currently complete for any arbitrary MIME message.
 
    Check the source for latest additions to functionality.
 
-   The MIME parser is complicated by the fact that WWW allows real binary to be sent, not
-   ASCII encoded.  Therefore the netascii decoding is included in this module.  One cannot
-   layer it by converting first from Net to local text, then decoding it.  Of course, for
-   local files, the net ascii decoding is not needed.  There are therefore two creation
-   routines.
+   The MIME parser is complicated by the fact that WWW allows real binary to be
+   sent, not ASCII encoded.  Therefore the netascii decoding is included in
+   this module.  One cannot layer it by converting first from Net to local
+   text, then decoding it.  Of course, for local files, the net ascii decoding
+   is not needed.  There are therefore two creation routines.
 
  */
 #ifndef HTMIME_H
@@ -27,64 +27,59 @@
 #include <HTAnchor.h>
 
 /*
-**  This function is for trimming off any paired
-**  open- and close-double quotes from header values.
-**  It does not parse the string for embedded quotes,
-**  and will not modify the string unless both the
-**  first and last characters are double-quotes. - FM
-*/
-extern void HTMIME_TrimDoubleQuotes (
-	char *		value);
+ *  This function is for trimming off any paired
+ *  open- and close-double quotes from header values.
+ *  It does not parse the string for embedded quotes,
+ *  and will not modify the string unless both the
+ *  first and last characters are double-quotes. - FM
+ */
+extern void HTMIME_TrimDoubleQuotes(char *value);
 
 /*
 
   INPUT: LOCAL TEXT
 
  */
-extern HTStream * HTMIMEConvert (HTPresentation * pres,
-                                        HTParentAnchor * anchor,
-                                        HTStream * sink);
+extern HTStream *HTMIMEConvert(HTPresentation *pres,
+			       HTParentAnchor *anchor,
+			       HTStream *sink);
+
 /*
 
   INPUT: NET ASCII
 
  */
-extern HTStream * HTNetMIME (HTPresentation * pres,
-                                        HTParentAnchor * anchor,
-                                        HTStream * sink);
+extern HTStream *HTNetMIME(HTPresentation *pres,
+			   HTParentAnchor *anchor,
+			   HTStream *sink);
+
 /*
 
   INPUT: Redirection message, parse headers only for Location if present
 
  */
-extern HTStream * HTMIMERedirect (HTPresentation * pres,
-                                        HTParentAnchor * anchor,
-                                        HTStream * sink);
-
+extern HTStream *HTMIMERedirect(HTPresentation *pres,
+				HTParentAnchor *anchor,
+				HTStream *sink);
 
 /*
 
   For handling Japanese headers.
 
 */
-extern void HTmmdec_base64 (
-	char *	t,
-	char *	s);
+extern void HTmmdec_base64(char *t,
+			   char *s);
 
-extern void HTmmdec_quote (
-	char *	t,
-	char *	s);
+extern void HTmmdec_quote(char *t,
+			  char *s);
 
-extern void HTmmdecode (
-	char *	trg,
-	char *	str);
+extern void HTmmdecode(char *trg,
+		       char *str);
 
-extern int HTrjis (
-	char *	t,
-	char *	s);
+extern int HTrjis(char *t,
+		  char *s);
 
-extern int HTmaybekanji (
-	int	c1,
-	int	c2);
+extern int HTmaybekanji(int c1,
+			int c2);
 
 #endif /* !HTMIME_H */
diff --git a/WWW/Library/Implementation/HTMLDTD.c b/WWW/Library/Implementation/HTMLDTD.c
index 412b26d3..2cd6bc69 100644
--- a/WWW/Library/Implementation/HTMLDTD.c
+++ b/WWW/Library/Implementation/HTMLDTD.c
@@ -1,6 +1,6 @@
 /*		Our Static DTD for HTML
-**		-----------------------
-*/
+ *		-----------------------
+ */
 
 /* Implements:
 */
@@ -11,141 +11,141 @@
 #include <LYJustify.h>
 
 /*
- *     Character entities like &nbsp now excluded from our DTD tables,
- *     they are mapped to Unicode and handled by chartrans code directly
- *     the similar way the numeric entities like &#123 does.
- *     See  src/chrtrans/entities.h  for real mapping.
+ * Character entities like &nbsp now excluded from our DTD tables, they are
+ * mapped to Unicode and handled by chartrans code directly the similar way the
+ * numeric entities like &#123 does.  See src/chrtrans/entities.h for real
+ * mapping.
  */
 
 /*	Entity Names
-**	------------
-**
-**	This table must be matched exactly with ALL the translation tables
-**		(this is an obsolete translation mechanism, probably unused,
-**		currently replaced with Unicode chartrans in most cases...)
-*/
-static const char* entities[] = {
-  "AElig",	/* capital AE diphthong (ligature) */
-  "Aacute",	/* capital A, acute accent */
-  "Acirc",	/* capital A, circumflex accent */
-  "Agrave",	/* capital A, grave accent */
-  "Aring",	/* capital A, ring */
-  "Atilde",	/* capital A, tilde */
-  "Auml",	/* capital A, dieresis or umlaut mark */
-  "Ccedil",	/* capital C, cedilla */
-  "Dstrok",	/* capital Eth, Icelandic */
-  "ETH",	/* capital Eth, Icelandic */
-  "Eacute",	/* capital E, acute accent */
-  "Ecirc",	/* capital E, circumflex accent */
-  "Egrave",	/* capital E, grave accent */
-  "Euml",	/* capital E, dieresis or umlaut mark */
-  "Iacute",	/* capital I, acute accent */
-  "Icirc",	/* capital I, circumflex accent */
-  "Igrave",	/* capital I, grave accent */
-  "Iuml",	/* capital I, dieresis or umlaut mark */
-  "Ntilde",	/* capital N, tilde */
-  "Oacute",	/* capital O, acute accent */
-  "Ocirc",	/* capital O, circumflex accent */
-  "Ograve",	/* capital O, grave accent */
-  "Oslash",	/* capital O, slash */
-  "Otilde",	/* capital O, tilde */
-  "Ouml",	/* capital O, dieresis or umlaut mark */
-  "THORN",	/* capital THORN, Icelandic */
-  "Uacute",	/* capital U, acute accent */
-  "Ucirc",	/* capital U, circumflex accent */
-  "Ugrave",	/* capital U, grave accent */
-  "Uuml",	/* capital U, dieresis or umlaut mark */
-  "Yacute",	/* capital Y, acute accent */
-  "aacute",	/* small a, acute accent */
-  "acirc",	/* small a, circumflex accent */
-  "acute",	/* spacing acute */
-  "aelig",	/* small ae diphthong (ligature) */
-  "agrave",	/* small a, grave accent */
-  "amp",	/* ampersand */
-  "aring",	/* small a, ring */
-  "atilde",	/* small a, tilde */
-  "auml",	/* small a, dieresis or umlaut mark */
-  "brkbar",	/* broken vertical bar */
-  "brvbar",	/* broken vertical bar */
-  "ccedil",	/* small c, cedilla */
-  "cedil",	/* spacing cedilla */
-  "cent",	/* cent sign */
-  "copy",	/* copyright sign */
-  "curren",	/* currency sign */
-  "deg",	/* degree sign */
-  "die",	/* spacing dieresis */
-  "divide",	/* division sign */
-  "eacute",	/* small e, acute accent */
-  "ecirc",	/* small e, circumflex accent */
-  "egrave",	/* small e, grave accent */
-  "emdash",	/* dash the width of emsp */
-  "emsp",	/* em space - not collapsed */
-  "endash",	/* dash the width of ensp */
-  "ensp",	/* en space - not collapsed */
-  "eth",	/* small eth, Icelandic */
-  "euml",	/* small e, dieresis or umlaut mark */
-  "frac12",	/* fraction 1/2 */
-  "frac14",	/* fraction 1/4 */
-  "frac34",	/* fraction 3/4 */
-  "gt",		/* greater than */
-  "hibar",	/* spacing macron */
-  "iacute",	/* small i, acute accent */
-  "icirc",	/* small i, circumflex accent */
-  "iexcl",	/* inverted exclamation mark */
-  "igrave",	/* small i, grave accent */
-  "iquest",	/* inverted question mark */
-  "iuml",	/* small i, dieresis or umlaut mark */
-  "laquo",	/* angle quotation mark, left */
-  "lt",		/* less than */
-  "macr",	/* spacing macron */
-  "mdash",	/* dash the width of emsp */
-  "micro",	/* micro sign */
-  "middot",	/* middle dot */
-  "nbsp",	/* non breaking space */
-  "ndash",	/* dash the width of ensp */
-  "not",	/* negation sign */
-  "ntilde",	/* small n, tilde */
-  "oacute",	/* small o, acute accent */
-  "ocirc",	/* small o, circumflex accent */
-  "ograve",	/* small o, grave accent */
-  "ordf",	/* feminine ordinal indicator */
-  "ordm",	/* masculine ordinal indicator */
-  "oslash",	/* small o, slash */
-  "otilde",	/* small o, tilde */
-  "ouml",	/* small o, dieresis or umlaut mark */
-  "para",	/* paragraph sign */
-  "plusmn",	/* plus-or-minus sign */
-  "pound",	/* pound sign */
-  "quot",	/* quote '"' */
-  "raquo",	/* angle quotation mark, right */
-  "reg",	/* circled R registered sign */
-  "sect",	/* section sign */
-  "shy",	/* soft hyphen */
-  "sup1",	/* superscript 1 */
-  "sup2",	/* superscript 2 */
-  "sup3",	/* superscript 3 */
-  "szlig",	/* small sharp s, German (sz ligature) */
-  "thinsp",	/* thin space (not collapsed) */
-  "thorn",	/* small thorn, Icelandic */
-  "times",	/* multiplication sign */
-  "trade",	/* trade mark sign (U+2122) */
-  "uacute",	/* small u, acute accent */
-  "ucirc",	/* small u, circumflex accent */
-  "ugrave",	/* small u, grave accent */
-  "uml",	/* spacing dieresis */
-  "uuml",	/* small u, dieresis or umlaut mark */
-  "yacute",	/* small y, acute accent */
-  "yen",	/* yen sign */
-  "yuml",	/* small y, dieresis or umlaut mark */
+ *	------------
+ *
+ *	This table must be matched exactly with ALL the translation tables
+ *		(this is an obsolete translation mechanism, probably unused,
+ *		currently replaced with Unicode chartrans in most cases...)
+ */
+static const char *entities[] =
+{
+    "AElig",			/* capital AE diphthong (ligature) */
+    "Aacute",			/* capital A, acute accent */
+    "Acirc",			/* capital A, circumflex accent */
+    "Agrave",			/* capital A, grave accent */
+    "Aring",			/* capital A, ring */
+    "Atilde",			/* capital A, tilde */
+    "Auml",			/* capital A, dieresis or umlaut mark */
+    "Ccedil",			/* capital C, cedilla */
+    "Dstrok",			/* capital Eth, Icelandic */
+    "ETH",			/* capital Eth, Icelandic */
+    "Eacute",			/* capital E, acute accent */
+    "Ecirc",			/* capital E, circumflex accent */
+    "Egrave",			/* capital E, grave accent */
+    "Euml",			/* capital E, dieresis or umlaut mark */
+    "Iacute",			/* capital I, acute accent */
+    "Icirc",			/* capital I, circumflex accent */
+    "Igrave",			/* capital I, grave accent */
+    "Iuml",			/* capital I, dieresis or umlaut mark */
+    "Ntilde",			/* capital N, tilde */
+    "Oacute",			/* capital O, acute accent */
+    "Ocirc",			/* capital O, circumflex accent */
+    "Ograve",			/* capital O, grave accent */
+    "Oslash",			/* capital O, slash */
+    "Otilde",			/* capital O, tilde */
+    "Ouml",			/* capital O, dieresis or umlaut mark */
+    "THORN",			/* capital THORN, Icelandic */
+    "Uacute",			/* capital U, acute accent */
+    "Ucirc",			/* capital U, circumflex accent */
+    "Ugrave",			/* capital U, grave accent */
+    "Uuml",			/* capital U, dieresis or umlaut mark */
+    "Yacute",			/* capital Y, acute accent */
+    "aacute",			/* small a, acute accent */
+    "acirc",			/* small a, circumflex accent */
+    "acute",			/* spacing acute */
+    "aelig",			/* small ae diphthong (ligature) */
+    "agrave",			/* small a, grave accent */
+    "amp",			/* ampersand */
+    "aring",			/* small a, ring */
+    "atilde",			/* small a, tilde */
+    "auml",			/* small a, dieresis or umlaut mark */
+    "brkbar",			/* broken vertical bar */
+    "brvbar",			/* broken vertical bar */
+    "ccedil",			/* small c, cedilla */
+    "cedil",			/* spacing cedilla */
+    "cent",			/* cent sign */
+    "copy",			/* copyright sign */
+    "curren",			/* currency sign */
+    "deg",			/* degree sign */
+    "die",			/* spacing dieresis */
+    "divide",			/* division sign */
+    "eacute",			/* small e, acute accent */
+    "ecirc",			/* small e, circumflex accent */
+    "egrave",			/* small e, grave accent */
+    "emdash",			/* dash the width of emsp */
+    "emsp",			/* em space - not collapsed */
+    "endash",			/* dash the width of ensp */
+    "ensp",			/* en space - not collapsed */
+    "eth",			/* small eth, Icelandic */
+    "euml",			/* small e, dieresis or umlaut mark */
+    "frac12",			/* fraction 1/2 */
+    "frac14",			/* fraction 1/4 */
+    "frac34",			/* fraction 3/4 */
+    "gt",			/* greater than */
+    "hibar",			/* spacing macron */
+    "iacute",			/* small i, acute accent */
+    "icirc",			/* small i, circumflex accent */
+    "iexcl",			/* inverted exclamation mark */
+    "igrave",			/* small i, grave accent */
+    "iquest",			/* inverted question mark */
+    "iuml",			/* small i, dieresis or umlaut mark */
+    "laquo",			/* angle quotation mark, left */
+    "lt",			/* less than */
+    "macr",			/* spacing macron */
+    "mdash",			/* dash the width of emsp */
+    "micro",			/* micro sign */
+    "middot",			/* middle dot */
+    "nbsp",			/* non breaking space */
+    "ndash",			/* dash the width of ensp */
+    "not",			/* negation sign */
+    "ntilde",			/* small n, tilde */
+    "oacute",			/* small o, acute accent */
+    "ocirc",			/* small o, circumflex accent */
+    "ograve",			/* small o, grave accent */
+    "ordf",			/* feminine ordinal indicator */
+    "ordm",			/* masculine ordinal indicator */
+    "oslash",			/* small o, slash */
+    "otilde",			/* small o, tilde */
+    "ouml",			/* small o, dieresis or umlaut mark */
+    "para",			/* paragraph sign */
+    "plusmn",			/* plus-or-minus sign */
+    "pound",			/* pound sign */
+    "quot",			/* quote '"' */
+    "raquo",			/* angle quotation mark, right */
+    "reg",			/* circled R registered sign */
+    "sect",			/* section sign */
+    "shy",			/* soft hyphen */
+    "sup1",			/* superscript 1 */
+    "sup2",			/* superscript 2 */
+    "sup3",			/* superscript 3 */
+    "szlig",			/* small sharp s, German (sz ligature) */
+    "thinsp",			/* thin space (not collapsed) */
+    "thorn",			/* small thorn, Icelandic */
+    "times",			/* multiplication sign */
+    "trade",			/* trade mark sign (U+2122) */
+    "uacute",			/* small u, acute accent */
+    "ucirc",			/* small u, circumflex accent */
+    "ugrave",			/* small u, grave accent */
+    "uml",			/* spacing dieresis */
+    "uuml",			/* small u, dieresis or umlaut mark */
+    "yacute",			/* small y, acute accent */
+    "yen",			/* yen sign */
+    "yuml",			/* small y, dieresis or umlaut mark */
 };
 
-
 /*		Attribute Lists
-**		---------------
-**
-**	Lists must be in alphabetical order by attribute name
-**	The tag elements contain the number of attributes
-*/
+ *		---------------
+ *
+ *	Lists must be in alphabetical order by attribute name
+ *	The tag elements contain the number of attributes
+ */
 #ifdef USE_PRETTYSRC
 # define N HTMLA_NORMAL
 # define i HTMLA_ANAME
@@ -154,9 +154,9 @@ static const char* entities[] = {
 # define x HTMLA_AUXCLASS
 # define T(t) , t
 #else
-# define T(t) /*nothing*/
+# define T(t)			/*nothing */
 #endif
-
+/* *INDENT-OFF* */
 static attr a_attr[] = {		/* Anchor attributes */
 	{ "ACCESSKEY"     T(N) },
 	{ "CHARSET"       T(N) },
@@ -1052,6 +1052,7 @@ static attr ulist_attr[] = {		/* UL attributes */
 	{ "WRAP"          T(N) },
 	{ 0               T(N) }	/* Terminate list */
 };
+/* *INDENT-ON* */
 
 #undef N
 #undef i
@@ -1101,22 +1102,22 @@ static attr ulist_attr[] = {		/* UL attributes */
  */
 
 /*	Extra element info
-**	------------------
-**
-**	Order and number of tags should match the tags_* tables
-**	further below and definitions in HTMLDTD.html.
-**
-**	The interspersed comments give the original Lynx tags[] entries
-**	for orientation, so they do not necessarily reflect what will
-**	be used with the T_* info (which is in tags_new[]).
-**
-**	An important design goal was that info for each tag should fit on
-**	one 80 character screen line :).  The price to pay is that it's
-**	a bit cryptic, to say the least...  - kw
-*/
+ *	------------------
+ *
+ *	Order and number of tags should match the tags_* tables
+ *	further below and definitions in HTMLDTD.html.
+ *
+ *	The interspersed comments give the original Lynx tags[] entries
+ *	for orientation, so they do not necessarily reflect what will
+ *	be used with the T_* info (which is in tags_new[]).
+ *
+ *	An important design goal was that info for each tag should fit on
+ *	one 80 character screen line :).  The price to pay is that it's
+ *	a bit cryptic, to say the least...  - kw
+ */
 /*	 1	   2	     3	       4	 5	   6	     7	       8 */
 /*345678901234567890123456789012345678901234567890123456789012345678901234567890 */
-
+/* *INDENT-OFF* */
 /*			self	contain icont'n contn'd icont'd canclos flags*/
  /* { "A"	, a_attr,	HTML_A_ATTRIBUTES,	SGML_MIXED }, */
 #define T_A		0x0008, 0x0B007,0x0FF17,0x37787,0x77BA7,0x8604F,0x00014
@@ -1351,20 +1352,21 @@ static attr ulist_attr[] = {		/* UL attributes */
 #define T_XMP		0x0800, 0x00000,0x00000,0x367E0,0x36FFF,0x0875F,0x00001
 
 #define T__UNREC_	0x0000, 0x00000,0x00000,0x00000,0x00000,0x00000,0x00000
+/* *INDENT-ON* */
 
 /*	Elements
-**	--------
-**
-**	Must match definitions in HTMLDTD.html!
-**	Must be in alphabetical order.
-**
-**  The T_* extra info is listed here, even though most fields are not used
-**  in SGML.c if Old_DTD is set (with the exception of some Tgf_* flags).
-**  This simplifies comparison of the tags_old[] table (otherwise unchanged
-**  from original Lynx treatment) with the tags_new[] table below. - kw
-**
-**    Name*,	Attributes,	No. of attributes,     content,   extra info...
-*/
+ *	--------
+ *
+ *	Must match definitions in HTMLDTD.html!
+ *	Must be in alphabetical order.
+ *
+ *  The T_* extra info is listed here, even though most fields are not used
+ *  in SGML.c if Old_DTD is set (with the exception of some Tgf_* flags).
+ *  This simplifies comparison of the tags_old[] table (otherwise unchanged
+ *  from original Lynx treatment) with the tags_new[] table below. - kw
+ *
+ *    Name*,	Attributes,	No. of attributes,     content,   extra info...
+ */
 #undef P
 #undef P
 #undef P_
@@ -1385,7 +1387,7 @@ static attr ulist_attr[] = {		/* UL attributes */
 #define P0(x) P_(x)
 #define NULL_HTTag NULL_HTTag_
 #endif
-
+/* *INDENT-OFF* */
 static const HTTag tags_old[HTML_ALL_ELEMENTS] = {
  { P("A")	, a_attr,	HTML_A_ATTRIBUTES,	SGML_EMPTY,T_A},
  { P("ABBREV")	, gen_attr,	HTML_GEN_ATTRIBUTES,	SGML_MIXED,T_ABBREV},
@@ -1635,6 +1637,7 @@ static const HTTag tags_new[HTML_ALL_ELEMENTS] = {
    it has been signalled to parse OBJECT content as MIXED. - kw */
  { P("OBJECT")	, object_attr,	HTML_OBJECT_ATTRIBUTES, SGML_MIXED,T_OBJECT_PCDATA},
 };
+/* *INDENT-ON* */
 
 #undef P
 #undef P0
@@ -1645,11 +1648,12 @@ static const HTTag tags_new[HTML_ALL_ELEMENTS] = {
 
 static HTTag tags[HTML_ALL_ELEMENTS];
 
-const SGML_dtd HTML_dtd = {
-	tags,
-	HTML_ELEMENTS,
-	entities, /* probably unused */
-	TABLESIZE(entities),
+const SGML_dtd HTML_dtd =
+{
+    tags,
+    HTML_ELEMENTS,
+    entities,			/* probably unused */
+    TABLESIZE(entities),
 };
 
 /* This function fills the "tags" part of the HTML_dtd structure with
@@ -1659,11 +1663,11 @@ const SGML_dtd HTML_dtd = {
    that would make an initialisation call unnecessary, but my C knowledge
    is limited and I didn't want to list the whole tags_new table
    twice... - kw */
-void HTSwitchDTD (
-    int		new_flag)
+void HTSwitchDTD(int new_flag)
 {
     if (TRACE)
-	CTRACE((tfp,"HTMLDTD: Copying %s DTD element info of size %d, %d * %d\n",
+	CTRACE((tfp,
+		"HTMLDTD: Copying %s DTD element info of size %d, %d * %d\n",
 		new_flag ? "strict" : "tagsoup",
 		(int) (new_flag ? sizeof(tags_new) : sizeof(tags_old)),
 		HTML_ALL_ELEMENTS,
@@ -1676,63 +1680,57 @@ void HTSwitchDTD (
 
 HTTag HTTag_unrecognized =
 
-    { NULL_HTTag,    NULL,	0,	SGML_EMPTY,T__UNREC_};
-
+{NULL_HTTag, NULL, 0, SGML_EMPTY, T__UNREC_};
 
 /*
-**	Utility Routine:  Useful for people building HTML objects.
-*/
+ *	Utility Routine:  Useful for people building HTML objects.
+ */
 
 /*	Start anchor element
-**	--------------------
-**
-**	It is kinda convenient to have a particulr routine for
-**	starting an anchor element, as everything else for HTML is
-**	simple anyway.
-*/
+ *	--------------------
+ *
+ *	It is kinda convenient to have a particulr routine for
+ *	starting an anchor element, as everything else for HTML is
+ *	simple anyway.
+ */
 struct _HTStructured {
-    HTStructuredClass * isa;
-	/* ... */
+    HTStructuredClass *isa;
+    /* ... */
 };
 
-void HTStartAnchor (
-	HTStructured *		obj,
-	const char *		name,
-	const char *		href)
+void HTStartAnchor(HTStructured * obj, const char *name,
+		   const char *href)
 {
-    BOOL		present[HTML_A_ATTRIBUTES];
-    const char *	value[HTML_A_ATTRIBUTES];
+    BOOL present[HTML_A_ATTRIBUTES];
+    const char *value[HTML_A_ATTRIBUTES];
     int i;
 
     for (i = 0; i < HTML_A_ATTRIBUTES; i++)
-	 present[i] = NO;
+	present[i] = NO;
 
     if (name && *name) {
 	present[HTML_A_NAME] = YES;
-	value[HTML_A_NAME] = (const char *)name;
+	value[HTML_A_NAME] = (const char *) name;
     }
     if (href) {
 	present[HTML_A_HREF] = YES;
-	value[HTML_A_HREF] = (const char *)href;
+	value[HTML_A_HREF] = (const char *) href;
     }
 
-    (*obj->isa->start_element)(obj, HTML_A, present, value, -1, 0);
+    (*obj->isa->start_element) (obj, HTML_A, present, value, -1, 0);
 }
 
-
-void HTStartAnchor5 (
-	HTStructured *		obj,
-	const char *		name,
-	const char *		href,
-	const char *		linktype,
-	int			tag_charset)
+void HTStartAnchor5(HTStructured * obj, const char *name,
+		    const char *href,
+		    const char *linktype,
+		    int tag_charset)
 {
-    BOOL		present[HTML_A_ATTRIBUTES];
-    const char *	value[HTML_A_ATTRIBUTES];
+    BOOL present[HTML_A_ATTRIBUTES];
+    const char *value[HTML_A_ATTRIBUTES];
     int i;
 
     for (i = 0; i < HTML_A_ATTRIBUTES; i++)
-	 present[i] = NO;
+	present[i] = NO;
 
     if (name && *name) {
 	present[HTML_A_NAME] = YES;
@@ -1747,16 +1745,14 @@ void HTStartAnchor5 (
 	value[HTML_A_TYPE] = linktype;
     }
 
-    (*obj->isa->start_element)(obj, HTML_A, present, value, tag_charset, 0);
+    (*obj->isa->start_element) (obj, HTML_A, present, value, tag_charset, 0);
 }
 
-void HTStartIsIndex (
-	HTStructured *		obj,
-	const char *		prompt,
-	const char *		href)
+void HTStartIsIndex(HTStructured * obj, const char *prompt,
+		    const char *href)
 {
-    BOOL		present[HTML_ISINDEX_ATTRIBUTES];
-    const char *	value[HTML_ISINDEX_ATTRIBUTES];
+    BOOL present[HTML_ISINDEX_ATTRIBUTES];
+    const char *value[HTML_ISINDEX_ATTRIBUTES];
     int i;
 
     for (i = 0; i < HTML_ISINDEX_ATTRIBUTES; i++)
@@ -1764,12 +1760,12 @@ void HTStartIsIndex (
 
     if (prompt && *prompt) {
 	present[HTML_ISINDEX_PROMPT] = YES;
-	value[HTML_ISINDEX_PROMPT] = (const char *)prompt;
+	value[HTML_ISINDEX_PROMPT] = (const char *) prompt;
     }
     if (href) {
 	present[HTML_ISINDEX_HREF] = YES;
-	value[HTML_ISINDEX_HREF] = (const char *)href;
+	value[HTML_ISINDEX_HREF] = (const char *) href;
     }
 
-    (*obj->isa->start_element)(obj, HTML_ISINDEX , present, value, -1, 0);
+    (*obj->isa->start_element) (obj, HTML_ISINDEX, present, value, -1, 0);
 }
diff --git a/WWW/Library/Implementation/HTMLDTD.h b/WWW/Library/Implementation/HTMLDTD.h
index 89cf3412..c1245d3b 100644
--- a/WWW/Library/Implementation/HTMLDTD.h
+++ b/WWW/Library/Implementation/HTMLDTD.h
@@ -16,13 +16,12 @@
 #include <HTFont.h>
 
 /*
-**  Valid name chars for tag parsing.
-*/
+ *  Valid name chars for tag parsing.
+ */
 #define IsNmStart(c) (isalpha(UCH(c)))
 #define IsNmChar(c) (isalnum(UCH(c)) || \
 		      c == '_' || c=='-' || c == '.' || c==':')
 
-
 #define ReallyEmptyTagNum(e) ((HTML_dtd.tags[e].contents == SGML_EMPTY) && \
 			      !(HTML_dtd.tags[e].flags & Tgf_nreie))
 #define ReallyEmptyTag(t) ((t->contents == SGML_EMPTY) && \
@@ -41,125 +40,126 @@ Element Numbers
 
  */
 typedef enum {
-	HTML_A,
-	HTML_ABBREV,
-	HTML_ACRONYM,
-	HTML_ADDRESS,
-	HTML_APPLET,
-	HTML_AREA,
-	HTML_AU,
-	HTML_AUTHOR,
-	HTML_B,
-	HTML_BANNER,
-	HTML_BASE,
-	HTML_BASEFONT,
-	HTML_BDO,
-	HTML_BGSOUND,
-	HTML_BIG,
-	HTML_BLINK,
-	HTML_BLOCKQUOTE,
-	HTML_BODY,
-	HTML_BODYTEXT,
-	HTML_BQ,
-	HTML_BR,
-	HTML_BUTTON,
-	HTML_CAPTION,
-	HTML_CENTER,
-	HTML_CITE,
-	HTML_CODE,
-	HTML_COL,
-	HTML_COLGROUP,
-	HTML_COMMENT,
-	HTML_CREDIT,
-	HTML_DD,
-	HTML_DEL,
-	HTML_DFN,
-	HTML_DIR,
-	HTML_DIV,
-	HTML_DL,
-	HTML_DLC,
-	HTML_DT,
-	HTML_EM,
-	HTML_EMBED,
-	HTML_FIELDSET,
-	HTML_FIG,
-	HTML_FN,
-	HTML_FONT,
-	HTML_FORM,
-	HTML_FRAME,
-	HTML_FRAMESET,
-	HTML_H1,
-	HTML_H2,
-	HTML_H3,
-	HTML_H4,
-	HTML_H5,
-	HTML_H6,
-	HTML_HEAD,
-	HTML_HR,
-	HTML_HTML,
-	HTML_HY,
-	HTML_I,
-	HTML_IFRAME,
-	HTML_IMG,
-	HTML_INPUT,
-	HTML_INS,
-	HTML_ISINDEX,
-	HTML_KBD,
-	HTML_KEYGEN,
-	HTML_LABEL,
-	HTML_LEGEND,
-	HTML_LH,
-	HTML_LI,
-	HTML_LINK,
-	HTML_LISTING,
-	HTML_MAP,
-	HTML_MARQUEE,
-	HTML_MATH,
-	HTML_MENU,
-	HTML_META,
-	HTML_NEXTID,
-	HTML_NOFRAMES,
-	HTML_NOTE,
-	HTML_OBJECT,
-	HTML_OL,
-	HTML_OPTION,
-	HTML_OVERLAY,
-	HTML_P,
-	HTML_PARAM,
-	HTML_PLAINTEXT,
-	HTML_PRE,
-	HTML_Q,
-	HTML_S,
-	HTML_SAMP,
-	HTML_SCRIPT,
-	HTML_SELECT,
-	HTML_SHY,
-	HTML_SMALL,
-	HTML_SPAN,
-	HTML_SPOT,
-	HTML_STRIKE,
-	HTML_STRONG,
-	HTML_STYLE,
-	HTML_SUB,
-	HTML_SUP,
-	HTML_TAB,
-	HTML_TABLE,
-	HTML_TBODY,
-	HTML_TD,
-	HTML_TEXTAREA,
-	HTML_TEXTFLOW,
-	HTML_TFOOT,
-	HTML_TH,
-	HTML_THEAD,
-	HTML_TITLE,
-	HTML_TR,
-	HTML_TT,
-	HTML_U,
-	HTML_UL,
-	HTML_VAR,
-	HTML_WBR,
-	HTML_XMP,
-	HTML_ALT_OBJECT } HTMLElement;
+    HTML_A,
+    HTML_ABBREV,
+    HTML_ACRONYM,
+    HTML_ADDRESS,
+    HTML_APPLET,
+    HTML_AREA,
+    HTML_AU,
+    HTML_AUTHOR,
+    HTML_B,
+    HTML_BANNER,
+    HTML_BASE,
+    HTML_BASEFONT,
+    HTML_BDO,
+    HTML_BGSOUND,
+    HTML_BIG,
+    HTML_BLINK,
+    HTML_BLOCKQUOTE,
+    HTML_BODY,
+    HTML_BODYTEXT,
+    HTML_BQ,
+    HTML_BR,
+    HTML_BUTTON,
+    HTML_CAPTION,
+    HTML_CENTER,
+    HTML_CITE,
+    HTML_CODE,
+    HTML_COL,
+    HTML_COLGROUP,
+    HTML_COMMENT,
+    HTML_CREDIT,
+    HTML_DD,
+    HTML_DEL,
+    HTML_DFN,
+    HTML_DIR,
+    HTML_DIV,
+    HTML_DL,
+    HTML_DLC,
+    HTML_DT,
+    HTML_EM,
+    HTML_EMBED,
+    HTML_FIELDSET,
+    HTML_FIG,
+    HTML_FN,
+    HTML_FONT,
+    HTML_FORM,
+    HTML_FRAME,
+    HTML_FRAMESET,
+    HTML_H1,
+    HTML_H2,
+    HTML_H3,
+    HTML_H4,
+    HTML_H5,
+    HTML_H6,
+    HTML_HEAD,
+    HTML_HR,
+    HTML_HTML,
+    HTML_HY,
+    HTML_I,
+    HTML_IFRAME,
+    HTML_IMG,
+    HTML_INPUT,
+    HTML_INS,
+    HTML_ISINDEX,
+    HTML_KBD,
+    HTML_KEYGEN,
+    HTML_LABEL,
+    HTML_LEGEND,
+    HTML_LH,
+    HTML_LI,
+    HTML_LINK,
+    HTML_LISTING,
+    HTML_MAP,
+    HTML_MARQUEE,
+    HTML_MATH,
+    HTML_MENU,
+    HTML_META,
+    HTML_NEXTID,
+    HTML_NOFRAMES,
+    HTML_NOTE,
+    HTML_OBJECT,
+    HTML_OL,
+    HTML_OPTION,
+    HTML_OVERLAY,
+    HTML_P,
+    HTML_PARAM,
+    HTML_PLAINTEXT,
+    HTML_PRE,
+    HTML_Q,
+    HTML_S,
+    HTML_SAMP,
+    HTML_SCRIPT,
+    HTML_SELECT,
+    HTML_SHY,
+    HTML_SMALL,
+    HTML_SPAN,
+    HTML_SPOT,
+    HTML_STRIKE,
+    HTML_STRONG,
+    HTML_STYLE,
+    HTML_SUB,
+    HTML_SUP,
+    HTML_TAB,
+    HTML_TABLE,
+    HTML_TBODY,
+    HTML_TD,
+    HTML_TEXTAREA,
+    HTML_TEXTFLOW,
+    HTML_TFOOT,
+    HTML_TH,
+    HTML_THEAD,
+    HTML_TITLE,
+    HTML_TR,
+    HTML_TT,
+    HTML_U,
+    HTML_UL,
+    HTML_VAR,
+    HTML_WBR,
+    HTML_XMP,
+    HTML_ALT_OBJECT
+} HTMLElement;
 
 /* Notes: HTML.c uses a different extension of the HTML_ELEMENTS space
           privately, see HTNestedList.h. */
@@ -174,7 +174,6 @@ typedef enum {
                       additional variant(s) at end. */
 #define HTML_ALL_ELEMENTS 119
 
-
 /*
 
 Attribute numbers
@@ -188,7 +187,7 @@ Attribute numbers
 
  */
 #define HTML_A_ACCESSKEY        0
-#define HTML_A_CHARSET          1 /* i18n draft, added tentatively - KW */
+#define HTML_A_CHARSET          1	/* i18n draft, added tentatively - KW */
 #define HTML_A_CLASS            2
 #define HTML_A_CLEAR            3
 #define HTML_A_COORDS           4
@@ -465,7 +464,7 @@ Attribute numbers
 #define HTML_FONT_STYLE         8
 #define HTML_FONT_ATTRIBUTES    9
 
-#define HTML_FORM_ACCEPT_CHARSET  0 /* HTML 4.0 draft - kw */
+#define HTML_FORM_ACCEPT_CHARSET  0	/* HTML 4.0 draft - kw */
 #define HTML_FORM_ACTION        1
 #define HTML_FORM_CLASS         2
 #define HTML_FORM_CLEAR         3
@@ -571,7 +570,7 @@ Attribute numbers
 #define HTML_IMG_ATTRIBUTES     19
 
 #define HTML_INPUT_ACCEPT       0
-#define HTML_INPUT_ACCEPT_CHARSET  1 /* RFC 2070 HTML i18n - kw */
+#define HTML_INPUT_ACCEPT_CHARSET  1	/* RFC 2070 HTML i18n - kw */
 #define HTML_INPUT_ALIGN        2
 #define HTML_INPUT_ALT          3
 #define HTML_INPUT_CHECKED      4
@@ -604,12 +603,12 @@ Attribute numbers
 #define HTML_INPUT_WIDTH       31
 #define HTML_INPUT_ATTRIBUTES  32
 
-#define HTML_ISINDEX_ACTION     0  /* Treat as synonym for HREF. - FM */
+#define HTML_ISINDEX_ACTION     0	/* Treat as synonym for HREF. - FM */
 #define HTML_ISINDEX_DIR        1
-#define HTML_ISINDEX_HREF       2  /* HTML 3.0 "action". - FM */
+#define HTML_ISINDEX_HREF       2	/* HTML 3.0 "action". - FM */
 #define HTML_ISINDEX_ID         3
 #define HTML_ISINDEX_LANG       4
-#define HTML_ISINDEX_PROMPT     5  /* HTML 3.0 "prompt". - FM */
+#define HTML_ISINDEX_PROMPT     5	/* HTML 3.0 "prompt". - FM */
 #define HTML_ISINDEX_TITLE      6
 #define HTML_ISINDEX_ATTRIBUTES 7
 
@@ -661,7 +660,7 @@ Attribute numbers
 #define HTML_LI_VALUE          12
 #define HTML_LI_ATTRIBUTES     13
 
-#define HTML_LINK_CHARSET       0 /* RFC 2070 HTML i18n - kw */
+#define HTML_LINK_CHARSET       0	/* RFC 2070 HTML i18n - kw */
 #define HTML_LINK_CLASS         1
 #define HTML_LINK_HREF          2
 #define HTML_LINK_ID            3
@@ -695,7 +694,7 @@ Attribute numbers
 #define HTML_MATH_ATTRIBUTES    8
 
 #define HTML_META_CONTENT       0
-#define HTML_META_HTTP_EQUIV    1  /* For parsing in HTML.c - FM */
+#define HTML_META_HTTP_EQUIV    1	/* For parsing in HTML.c - FM */
 #define HTML_META_NAME          2
 #define HTML_META_ATTRIBUTES    3
 
@@ -707,7 +706,7 @@ Attribute numbers
 #define HTML_NOTE_ID            3
 #define HTML_NOTE_LANG          4
 #define HTML_NOTE_MD            5
-#define HTML_NOTE_ROLE          6 /* Old name for CLASS - FM */
+#define HTML_NOTE_ROLE          6	/* Old name for CLASS - FM */
 #define HTML_NOTE_SRC           7
 #define HTML_NOTE_STYLE         8
 #define HTML_NOTE_TITLE         9
@@ -809,7 +808,7 @@ Attribute numbers
 #define HTML_PARAM_TITLE       13
 #define HTML_PARAM_TYPE        14
 #define HTML_PARAM_VALUE       15
-#define HTML_PARAM_VALUEREF    16  /* Use VALUETYPE (DATA|REF|OBJECT). - FM */
+#define HTML_PARAM_VALUEREF    16	/* Use VALUETYPE (DATA|REF|OBJECT). - FM */
 #define HTML_PARAM_VALUETYPE   17
 #define HTML_PARAM_ATTRIBUTES  18
 
@@ -918,7 +917,7 @@ Attribute numbers
 #define HTML_TD_WIDTH          19
 #define HTML_TD_ATTRIBUTES     20
 
-#define HTML_TEXTAREA_ACCEPT_CHARSET  0 /* RFC 2070 HTML i18n - kw */
+#define HTML_TEXTAREA_ACCEPT_CHARSET  0		/* RFC 2070 HTML i18n - kw */
 #define HTML_TEXTAREA_ALIGN     1
 #define HTML_TEXTAREA_CLASS     2
 #define HTML_TEXTAREA_CLEAR     3
@@ -973,16 +972,16 @@ Attribute numbers
 
 #ifdef USE_PRETTYSRC
 /* values of HTML attributes' types */
-#define HTMLA_NORMAL 0 /* nothing specific */
-#define HTMLA_ANAME  1 /* anchor name - 'id' or a's 'name' */
-#define HTMLA_HREF   2 /* href */
-#define HTMLA_CLASS  4 /* class name.  */
-#define HTMLA_AUXCLASS 8 /* attribute, the value of which also designates
-			    a class name */
+#define HTMLA_NORMAL 0		/* nothing specific */
+#define HTMLA_ANAME  1		/* anchor name - 'id' or a's 'name' */
+#define HTMLA_HREF   2		/* href */
+#define HTMLA_CLASS  4		/* class name.  */
+#define HTMLA_AUXCLASS 8	/* attribute, the value of which also designates
+				   a class name */
 #endif
 extern const SGML_dtd HTML_dtd;
 
-extern void HTSwitchDTD (int new_flag);
+extern void HTSwitchDTD(int new_flag);
 
 extern HTTag HTTag_unrecognized;
 extern HTTag HTTag_mixedObject;
@@ -1002,17 +1001,13 @@ Start anchor element
    to be omitted.
 
  */
-extern void HTStartAnchor (
-		HTStructured * targetstream,
-		const char *	name,
-		const char *	href);
-
-extern void HTStartAnchor5 (
-		HTStructured * targetstream,
-		const char *	name,
-		const char *	href,
-		const char *	linktype,
-		int		tag_charset);
+extern void HTStartAnchor(HTStructured * targetstream, const char *name,
+			  const char *href);
+
+extern void HTStartAnchor5(HTStructured * targetstream, const char *name,
+			   const char *href,
+			   const char *linktype,
+			   int tag_charset);
 
 /*
 
@@ -1029,9 +1024,7 @@ Start IsIndex element - FM
    to be omitted.
 
  */
-extern void HTStartIsIndex (
-		HTStructured * targetstream,
-		const char *	prompt,
-		const char *	href);
+extern void HTStartIsIndex(HTStructured * targetstream, const char *prompt,
+			   const char *href);
 
 #endif /* HTMLDTD_H */
diff --git a/WWW/Library/Implementation/HTMLGen.c b/WWW/Library/Implementation/HTMLGen.c
index 51afd388..c0821dee 100644
--- a/WWW/Library/Implementation/HTMLGen.c
+++ b/WWW/Library/Implementation/HTMLGen.c
@@ -1,16 +1,16 @@
 /*		HTML Generator
-**		==============
-**
-**	This version of the HTML object sends HTML markup to the output stream.
-**
-** Bugs:	Line wrapping is not done at all.
-**		All data handled as PCDATA.
-**		Should convert old XMP, LISTING and PLAINTEXT to PRE.
-**
-**	It is not obvious to me right now whether the HEAD should be generated
-**	from the incomming data or the anchor.	Currently it is from the former
-**	which is cleanest.
-*/
+ *		==============
+ *
+ *	This version of the HTML object sends HTML markup to the output stream.
+ *
+ * Bugs:	Line wrapping is not done at all.
+ *		All data handled as PCDATA.
+ *		Should convert old XMP, LISTING and PLAINTEXT to PRE.
+ *
+ *	It is not obvious to me right now whether the HEAD should be generated
+ *	from the incomming data or the anchor.	Currently it is from the former
+ *	which is cleanest.
+ */
 
 #include <HTUtils.h>
 
@@ -49,53 +49,52 @@ static int hcode;
 #endif
 
 /*		HTML Object
-**		-----------
-*/
+ *		-----------
+ */
 struct _HTStream {
-	const HTStreamClass *		isa;
-	HTStream *			target;
-	HTStreamClass			targetClass;	/* COPY for speed */
+    const HTStreamClass *isa;
+    HTStream *target;
+    HTStreamClass targetClass;	/* COPY for speed */
 };
 
 struct _HTStructured {
-	const HTStructuredClass *	isa;
-	HTStream *			target;
-	HTStreamClass			targetClass;	/* COPY for speed */
-
-	char				buffer[BUFFER_SIZE+1]; /* 1for NL */
-	int				buffer_maxchars;
-	char *				write_pointer;
-	char *				line_break [MAX_CLEANNESS+1];
-	int				cleanness;
-	BOOL				overflowed;
-	BOOL				delete_line_break_char[MAX_CLEANNESS+1];
-	BOOL				preformatted;
-	BOOL				escape_specials;
-	BOOL				in_attrval;
+    const HTStructuredClass *isa;
+    HTStream *target;
+    HTStreamClass targetClass;	/* COPY for speed */
+
+    char buffer[BUFFER_SIZE + 1];	/* 1for NL */
+    int buffer_maxchars;
+    char *write_pointer;
+    char *line_break[MAX_CLEANNESS + 1];
+    int cleanness;
+    BOOL overflowed;
+    BOOL delete_line_break_char[MAX_CLEANNESS + 1];
+    BOOL preformatted;
+    BOOL escape_specials;
+    BOOL in_attrval;
 #ifdef USE_COLOR_STYLE
-	HText *				text;
+    HText *text;
 #endif
 };
 
 /*	Flush Buffer
-**	------------
-*/
+ *	------------
+ */
 
-static void flush_breaks (
-	HTStructured *		me)
+static void flush_breaks(HTStructured * me)
 {
     int i;
-    for (i=0; i<= MAX_CLEANNESS; i++) {
+
+    for (i = 0; i <= MAX_CLEANNESS; i++) {
 	me->line_break[i] = NULL;
     }
 }
 
-static void HTMLGen_flush (
-	HTStructured *		me)
+static void HTMLGen_flush(HTStructured * me)
 {
-    (*me->targetClass.put_block)(me->target,
-				 me->buffer,
-				 me->write_pointer - me->buffer);
+    (*me->targetClass.put_block) (me->target,
+				  me->buffer,
+				  me->write_pointer - me->buffer);
     me->write_pointer = me->buffer;
     flush_breaks(me);
     me->cleanness = 0;
@@ -104,34 +103,30 @@ static void HTMLGen_flush (
 
 #ifdef USE_COLOR_STYLE
 /*
- *  We need to flush our buffer each time before we effect a color style
- *  change, this also relies on the subsequent stage not doing any
- *  buffering - this is currently true, in cases where it matters the
- *  target stream should be the HTPlain converter.
- *  The flushing currently prevents reasonable line breaking in lines
- *  with tags.  Since color styles help visual scanning of displayed
- *  source lines, and long lines are wrapped in GridText anyway, this
- *  is probably acceptable (or even A Good Thing - more to see in one
- *  screenful).
- *  The pointer to the HText structure is initialized here before
- *  we effect the first style change.  Getting it from the global
- *  HTMainText variable isn't very clean, since it relies on the fact
- *  that HText_new() has already been called for the current stream
- *  stack's document by the time we start processing the first element;
- *  we rely on HTMLGenerator's callers (HTMLParsedPresent in particular)
- *  to guarantee this when it matters.  Normally the target stream will
- *  have been setup by HTPlainPresent, which does what we need in this
- *  respect.  (A check whether we have the right output stream could be
- *  done by checking that targetClass.name is "PlainPresenter" or similar.)
+ * We need to flush our buffer each time before we effect a color style change,
+ * this also relies on the subsequent stage not doing any buffering - this is
+ * currently true, in cases where it matters the target stream should be the
+ * HTPlain converter.  The flushing currently prevents reasonable line breaking
+ * in lines with tags.  Since color styles help visual scanning of displayed
+ * source lines, and long lines are wrapped in GridText anyway, this is
+ * probably acceptable (or even A Good Thing - more to see in one screenful). 
+ * The pointer to the HText structure is initialized here before we effect the
+ * first style change.  Getting it from the global HTMainText variable isn't
+ * very clean, since it relies on the fact that HText_new() has already been
+ * called for the current stream stack's document by the time we start
+ * processing the first element; we rely on HTMLGenerator's callers
+ * (HTMLParsedPresent in particular) to guarantee this when it matters. 
+ * Normally the target stream will have been setup by HTPlainPresent, which
+ * does what we need in this respect.  (A check whether we have the right
+ * output stream could be done by checking that targetClass.name is
+ * "PlainPresenter" or similar.)
  *
- *  All special color style handling is only done if LYPreparsedSource
- *  is set.  We could always do it for displaying source generated by
- *  an internal gateway, but this makes the rule more simple for the
- *  user: color styles are applied to html source only with the
- *  -preparsed flag. - kw
+ * All special color style handling is only done if LYPreparsedSource is set. 
+ * We could always do it for displaying source generated by an internal
+ * gateway, but this makes the rule more simple for the user:  color styles are
+ * applied to html source only with the -preparsed flag.  - kw
  */
-static void do_cstyle_flush (
-	HTStructured *		me)
+static void do_cstyle_flush(HTStructured * me)
 {
     if (!me->text && LYPreparsedSource) {
 	me->text = HTMainText;
@@ -143,19 +138,18 @@ static void do_cstyle_flush (
 #endif /* COLOR_STYLE */
 
 /*	Weighted optional line break
-**
-**	We keep track of all the breaks for when we chop the line
-*/
+ *
+ *	We keep track of all the breaks for when we chop the line
+ */
 
-static void allow_break (
-	HTStructured * me,
-	int		new_cleanness,
-	BOOL		dlbc)
+static void allow_break(HTStructured * me, int new_cleanness,
+			BOOL dlbc)
 {
-    if (dlbc && me->write_pointer == me->buffer) dlbc = NO;
+    if (dlbc && me->write_pointer == me->buffer)
+	dlbc = NO;
     me->line_break[new_cleanness] =
-			 dlbc ? me->write_pointer - 1 /* Point to space */
-			      : me->write_pointer ;   /* point to gap */
+	dlbc ? me->write_pointer - 1	/* Point to space */
+	: me->write_pointer;	/* point to gap */
     me->delete_line_break_char[new_cleanness] = dlbc;
     if (new_cleanness >= me->cleanness &&
 	(me->overflowed || me->line_break[new_cleanness] > me->buffer))
@@ -163,40 +157,38 @@ static void allow_break (
 }
 
 /*	Character handling
-**	------------------
-**
-**	The tricky bits are the line break handling.  This attempts
-**	to synchrononise line breaks on sentence or phrase ends.  This
-**	is important if one stores SGML files in a line-oriented code
-**	repository, so that if a small change is made, line ends don't
-**	shift in a ripple-through to apparently change a large part of the
-**	file.  We give extra "cleanness" to spaces appearing directly
-**	after periods (full stops), [semi]colons and commas.
-**	   This should make the source files easier to read and modify
-**	by hand, too, though this is not a primary design consideration. TBL
-*/
-static void HTMLGen_put_character (
-	HTStructured *		me,
-	char			c)
+ *	------------------
+ *
+ *	The tricky bits are the line break handling.  This attempts
+ *	to synchrononise line breaks on sentence or phrase ends.  This
+ *	is important if one stores SGML files in a line-oriented code
+ *	repository, so that if a small change is made, line ends don't
+ *	shift in a ripple-through to apparently change a large part of the
+ *	file.  We give extra "cleanness" to spaces appearing directly
+ *	after periods (full stops), [semi]colons and commas.
+ *	   This should make the source files easier to read and modify
+ *	by hand, too, though this is not a primary design consideration. TBL
+ */
+static void HTMLGen_put_character(HTStructured * me, char c)
 {
     if (me->escape_specials && UCH(c) < 32) {
 	if (c == HT_NON_BREAK_SPACE || c == HT_EN_SPACE ||
-	    c == LY_SOFT_HYPHEN) { /* recursion... */
+	    c == LY_SOFT_HYPHEN) {	/* recursion... */
 	    HTMLGen_put_character(me, '&');
 	    HTMLGen_put_character(me, '#');
 	    HTMLGen_put_character(me, 'x');
-	    switch(c) {
-	    case HT_NON_BREAK_SPACE: /* &#xA0; */
+	    switch (c) {
+	    case HT_NON_BREAK_SPACE:	/* &#xA0; */
 		HTMLGen_put_character(me, 'A');
 		HTMLGen_put_character(me, '0');
 		break;
-	    case HT_EN_SPACE: /* &#x2002; */
+	    case HT_EN_SPACE:	/* &#x2002; */
 		HTMLGen_put_character(me, '2');
 		HTMLGen_put_character(me, '0');
 		HTMLGen_put_character(me, '0');
 		HTMLGen_put_character(me, '2');
 		break;
-	    case LY_SOFT_HYPHEN: /* &#xAD; */
+	    case LY_SOFT_HYPHEN:	/* &#xAD; */
 		HTMLGen_put_character(me, 'A');
 		HTMLGen_put_character(me, 'D');
 		break;
@@ -213,54 +205,62 @@ static void HTMLGen_put_character (
     }
 
     /* Figure our whether we can break at this point
-    */
+     */
     if ((!me->preformatted && (c == ' ' || c == '\t'))) {
 	int new_cleanness = 3;
+
 	if (me->write_pointer > (me->buffer + 1)) {
 	    char delims[5];
-	    char * p;
-	    strcpy(delims, ",;:.");		/* @@ english bias */
+	    char *p;
+
+	    strcpy(delims, ",;:.");	/* @@ english bias */
 	    p = strchr(delims, me->write_pointer[-2]);
-	    if (p) new_cleanness = p - delims + 6;
-	    if (!me->in_attrval) new_cleanness += 10;
+	    if (p)
+		new_cleanness = p - delims + 6;
+	    if (!me->in_attrval)
+		new_cleanness += 10;
 	}
 	allow_break(me, new_cleanness, YES);
     }
 
     /*
-     *	Flush buffer out when full, or whenever the line is over
-     *	the nominal maximum and we can break at all
+     * Flush buffer out when full, or whenever the line is over the nominal
+     * maximum and we can break at all
      */
     if (me->write_pointer >= me->buffer + me->buffer_maxchars ||
 	(me->overflowed && me->cleanness)) {
 	if (me->cleanness) {
 	    char line_break_char = me->line_break[me->cleanness][0];
-	    char * saved = me->line_break[me->cleanness];
+	    char *saved = me->line_break[me->cleanness];
 
-	    if (me->delete_line_break_char[me->cleanness]) saved++;
+	    if (me->delete_line_break_char[me->cleanness])
+		saved++;
 	    me->line_break[me->cleanness][0] = '\n';
-	    (*me->targetClass.put_block)(me->target,
-					 me->buffer,
-			       me->line_break[me->cleanness] - me->buffer + 1);
+	    (*me->targetClass.put_block) (me->target,
+					  me->buffer,
+					  me->line_break[me->cleanness] -
+					  me->buffer + 1);
 	    me->line_break[me->cleanness][0] = line_break_char;
-	    {  /* move next line in */
-		char * p = saved;
+	    {			/* move next line in */
+		char *p = saved;
 		char *q;
-		for (q = me->buffer; p < me->write_pointer; )
+
+		for (q = me->buffer; p < me->write_pointer;)
 		    *q++ = *p++;
 	    }
 	    me->cleanness = 0;
 	    /* Now we have to check whether ther are any perfectly good breaks
-	    ** which weren't good enough for the last line but may be
-	    **	good enough for the next
-	    */
+	     * which weren't good enough for the last line but may be good
+	     * enough for the next
+	     */
 	    {
 		int i;
-		for(i=0; i <= MAX_CLEANNESS; i++) {
+
+		for (i = 0; i <= MAX_CLEANNESS; i++) {
 		    if (me->line_break[i] != NULL &&
 			me->line_break[i] > saved) {
 			me->line_break[i] = me->line_break[i] -
-						(saved-me->buffer);
+			    (saved - me->buffer);
 			me->cleanness = i;
 		    } else {
 			me->line_break[i] = NULL;
@@ -269,13 +269,13 @@ static void HTMLGen_put_character (
 	    }
 
 	    me->delete_line_break_char[0] = 0;
-	    me->write_pointer = me->write_pointer - (saved-me->buffer);
+	    me->write_pointer = me->write_pointer - (saved - me->buffer);
 	    me->overflowed = NO;
 
 	} else {
-	    (*me->targetClass.put_block)(me->target,
-					 me->buffer,
-					 me->buffer_maxchars);
+	    (*me->targetClass.put_block) (me->target,
+					  me->buffer,
+					  me->buffer_maxchars);
 	    me->write_pointer = me->buffer;
 	    flush_breaks(me);
 	    me->overflowed = YES;
@@ -284,46 +284,40 @@ static void HTMLGen_put_character (
 }
 
 /*	String handling
-**	---------------
-*/
-static void HTMLGen_put_string (
-	HTStructured *		me,
-	const char *		s)
+ *	---------------
+ */
+static void HTMLGen_put_string(HTStructured * me, const char *s)
 {
-    const char * p;
+    const char *p;
 
     for (p = s; *p; p++)
 	HTMLGen_put_character(me, *p);
 }
 
-static void HTMLGen_write (
-	HTStructured *		me,
-	const char *		s,
-	int			l)
+static void HTMLGen_write(HTStructured * me, const char *s,
+			  int l)
 {
-    const char * p;
+    const char *p;
 
     for (p = s; p < (s + l); p++)
 	HTMLGen_put_character(me, *p);
 }
 
 /*	Start Element
-**	-------------
-**
-**	Within the opening tag, there may be spaces
-**	and the line may be broken at these spaces.
-*/
-static int HTMLGen_start_element (
-	HTStructured *		me,
-	int			element_number,
-	const BOOL*		present,
-	const char **		value,
-	int			charset GCC_UNUSED,
-	char **			insert GCC_UNUSED)
+ *	-------------
+ *
+ *	Within the opening tag, there may be spaces
+ *	and the line may be broken at these spaces.
+ */
+static int HTMLGen_start_element(HTStructured * me, int element_number,
+				 const BOOL *present,
+				 const char **value,
+				 int charset GCC_UNUSED,
+				 char **insert GCC_UNUSED)
 {
     int i;
     BOOL was_preformatted = me->preformatted;
-    HTTag * tag = &HTML_dtd.tags[element_number];
+    HTTag *tag = &HTML_dtd.tags[element_number];
 
 #if defined(USE_COLOR_STYLE)
     char *title = NULL;
@@ -331,49 +325,47 @@ static int HTMLGen_start_element (
 
     if (LYPreparsedSource) {
 	/*
-	 *  Same logic as in HTML_start_element, copied from there. - kw
+	 * Same logic as in HTML_start_element, copied from there.  - kw
 	 */
-	HTSprintf (&Style_className, ";%s", HTML_dtd.tags[element_number].name);
-	strcpy (myHash, HTML_dtd.tags[element_number].name);
-	if (class_string[0])
-	{
+	HTSprintf(&Style_className, ";%s", HTML_dtd.tags[element_number].name);
+	strcpy(myHash, HTML_dtd.tags[element_number].name);
+	if (class_string[0]) {
 	    int len = strlen(myHash);
-	    sprintf (myHash + len, ".%.*s", (int) sizeof(myHash) - len - 2, class_string);
-	    HTSprintf (&Style_className, ".%s", class_string);
+
+	    sprintf(myHash + len, ".%.*s", (int) sizeof(myHash) - len - 2, class_string);
+	    HTSprintf(&Style_className, ".%s", class_string);
 	}
 	class_string[0] = '\0';
 	strtolower(myHash);
 	hcode = hash_code(myHash);
 	strtolower(Style_className);
 
-	if (TRACE_STYLE)
-	{
+	if (TRACE_STYLE) {
 	    fprintf(tfp, "CSSTRIM:%s -> %d", myHash, hcode);
-	    if (hashStyles[hcode].code!=hcode)
-	    {
+	    if (hashStyles[hcode].code != hcode) {
 		char *rp = strrchr(myHash, '.');
+
 		fprintf(tfp, " (undefined) %s\n", myHash);
-		if (rp)
-		{
+		if (rp) {
 		    int hcd;
-		    *rp = '\0'; /* trim the class */
+
+		    *rp = '\0';	/* trim the class */
 		    hcd = hash_code(myHash);
 		    fprintf(tfp, "CSS:%s -> %d", myHash, hcd);
-		    if (hashStyles[hcd].code!=hcd)
+		    if (hashStyles[hcd].code != hcd)
 			fprintf(tfp, " (undefined) %s\n", myHash);
 		    else
 			fprintf(tfp, " ca=%d\n", hashStyles[hcd].color);
 		}
-	    }
-	    else
+	    } else
 		fprintf(tfp, " ca=%d\n", hashStyles[hcode].color);
 	}
 
-	if (displayStyles[element_number + STARTAT].color > -2) /* actually set */
+	if (displayStyles[element_number + STARTAT].color > -2)		/* actually set */
 	{
 	    CTRACE2(TRACE_STYLE,
 		    (tfp, "CSSTRIM: start_element: top <%s>\n",
-			  HTML_dtd.tags[element_number].name));
+		     HTML_dtd.tags[element_number].name));
 	    do_cstyle_flush(me);
 	    HText_characterStyle(me->text, hcode, 1);
 	}
@@ -384,6 +376,7 @@ static int HTMLGen_start_element (
     HTMLGen_put_string(me, tag->name);
     if (present) {
 	BOOL had_attr = NO;
+
 	for (i = 0; i < tag->number_of_attributes; i++) {
 	    if (present[i]) {
 		had_attr = YES;
@@ -391,14 +384,14 @@ static int HTMLGen_start_element (
 		allow_break(me, 11, YES);
 #ifdef USE_COLOR_STYLE
 		/*
-		 *  Try to mimic HTML_start_element's special handling
-		 *  for HTML_LINK.  If applicable, color the displayed
-		 *  attribute / value pairs differently. - kw
+		 * Try to mimic HTML_start_element's special handling for
+		 * HTML_LINK.  If applicable, color the displayed attribute /
+		 * value pairs differently.  - kw
 		 */
 		if (LYPreparsedSource &&
 		    element_number == HTML_LINK && !title &&
 		    present[HTML_LINK_CLASS] &&
-		    value && *value[HTML_LINK_CLASS]!='\0' &&
+		    value && *value[HTML_LINK_CLASS] != '\0' &&
 		    !present[HTML_LINK_REV] &&
 		    (present[HTML_LINK_REL] || present[HTML_LINK_HREF])) {
 		    if (present[HTML_LINK_TITLE] && *value[HTML_LINK_TITLE]) {
@@ -406,7 +399,7 @@ static int HTMLGen_start_element (
 			LYTrimHead(title);
 			LYTrimTail(title);
 		    }
-		    if ((!title || *title=='\0') && present[HTML_LINK_REL]) {
+		    if ((!title || *title == '\0') && present[HTML_LINK_REL]) {
 			StrAllocCopy(title, value[HTML_LINK_REL]);
 		    }
 		    if (title && *title) {
@@ -432,8 +425,9 @@ static int HTMLGen_start_element (
 			HTMLGen_put_string(me, "='");
 			HTMLGen_put_string(me, value[i]);
 			HTMLGen_put_character(me, '\'');
-		    } else {  /* attribute value has both kinds of quotes */
+		    } else {	/* attribute value has both kinds of quotes */
 			const char *p;
+
 			HTMLGen_put_string(me, "=\"");
 			for (p = value[i]; *p; p++) {
 			    if (*p != '"') {
@@ -452,7 +446,7 @@ static int HTMLGen_start_element (
 #ifdef USE_COLOR_STYLE
 	if (had_attr && LYPreparsedSource && element_number == HTML_LINK) {
 	    /*
-	     *  Clean up after special HTML_LINK handling - kw
+	     * Clean up after special HTML_LINK handling - kw
 	     */
 	    if (title && *title) {
 		do_cstyle_flush(me);
@@ -465,15 +459,15 @@ static int HTMLGen_start_element (
 	if (had_attr)
 	    allow_break(me, 12, NO);
     }
-    HTMLGen_put_string(me, ">"); /* got rid of \n LJM */
+    HTMLGen_put_string(me, ">");	/* got rid of \n LJM */
 
     /*
-     *	Make very specific HTML assumption that PRE can't be nested!
+     * Make very specific HTML assumption that PRE can't be nested!
      */
-    me->preformatted = (element_number == HTML_PRE)  ? YES : was_preformatted;
+    me->preformatted = (element_number == HTML_PRE) ? YES : was_preformatted;
 
     /*
-     *	Can break after element start.
+     * Can break after element start.
      */
     if (!me->preformatted && tag->contents != SGML_EMPTY) {
 	if (HTML_dtd.tags[element_number].contents == SGML_ELEMENT)
@@ -481,15 +475,13 @@ static int HTMLGen_start_element (
 	else
 	    allow_break(me, 2, NO);
     }
-
 #if defined(USE_COLOR_STYLE)
     /*
-     *  Same logic as in HTML_start_element, copied from there. - kw
+     * Same logic as in HTML_start_element, copied from there.  - kw
      */
 
     /* end really empty tags straight away */
-    if (LYPreparsedSource && ReallyEmptyTagNum(element_number))
-    {
+    if (LYPreparsedSource && ReallyEmptyTagNum(element_number)) {
 	CTRACE2(TRACE_STYLE,
 		(tfp, "STYLE:begin_element:ending EMPTY element style\n"));
 	do_cstyle_flush(me);
@@ -500,14 +492,14 @@ static int HTMLGen_start_element (
 #endif /* USE_COLOR_STYLE */
     if (element_number == HTML_OBJECT && tag->contents == SGML_LITTERAL) {
 	/*
-	 *  These conditions only approximate the ones used in HTML.c.
-	 *  Let our SGML parser know that further content is to be parsed
-	 *  normally not literally. - kw
+	 * These conditions only approximate the ones used in HTML.c.  Let our
+	 * SGML parser know that further content is to be parsed normally not
+	 * literally.  - kw
 	 */
 	if (!present) {
 	    return HT_PARSER_OTHER_CONTENT;
 	} else if (!present[HTML_OBJECT_DECLARE] &&
-		   !(present[HTML_OBJECT_NAME]  &&
+		   !(present[HTML_OBJECT_NAME] &&
 		     value[HTML_OBJECT_NAME] && *value[HTML_OBJECT_NAME])) {
 	    if (present[HTML_OBJECT_SHAPES] ||
 		!(present[HTML_OBJECT_USEMAP] &&
@@ -519,25 +511,23 @@ static int HTMLGen_start_element (
 }
 
 /*		End Element
-**		-----------
-**
-*/
+ *		-----------
+ *
+ */
 /*	When we end an element, the style must be returned to that
-**	in effect before that element.	Note that anchors (etc?)
-**	don't have an associated style, so that we must scan down the
-**	stack for an element with a defined style. (In fact, the styles
-**	should be linked to the whole stack not just the top one.)
-**	TBL 921119
-*/
-static int HTMLGen_end_element (
-	HTStructured *		me,
-	int			element_number,
-	char **		insert GCC_UNUSED)
+ *	in effect before that element.	Note that anchors (etc?)
+ *	don't have an associated style, so that we must scan down the
+ *	stack for an element with a defined style. (In fact, the styles
+ *	should be linked to the whole stack not just the top one.)
+ *	TBL 921119
+ */
+static int HTMLGen_end_element(HTStructured * me, int element_number,
+			       char **insert GCC_UNUSED)
 {
     if (!me->preformatted &&
 	HTML_dtd.tags[element_number].contents != SGML_EMPTY) {
 	/*
-	 *  Can break before element end.
+	 * Can break before element end.
 	 */
 	if (HTML_dtd.tags[element_number].contents == SGML_ELEMENT)
 	    allow_break(me, 14, NO);
@@ -552,7 +542,7 @@ static int HTMLGen_end_element (
     }
 #ifdef USE_COLOR_STYLE
     /*
-     *  Same logic as in HTML_end_element, copied from there. - kw
+     * Same logic as in HTML_end_element, copied from there.  - kw
      */
     TrimColorClass(HTML_dtd.tags[element_number].name,
 		   Style_className, &hcode);
@@ -568,49 +558,43 @@ static int HTMLGen_end_element (
 }
 
 /*		Expanding entities
-**		------------------
-**
-*/
-static int HTMLGen_put_entity (
-	HTStructured *		me,
-	int			entity_number)
+ *		------------------
+ *
+ */
+static int HTMLGen_put_entity(HTStructured * me, int entity_number)
 {
     int nent = HTML_dtd.number_of_entities;
 
     HTMLGen_put_character(me, '&');
     if (entity_number < nent) {
-      HTMLGen_put_string(me, HTML_dtd.entity_names[entity_number]);
+	HTMLGen_put_string(me, HTML_dtd.entity_names[entity_number]);
     }
     HTMLGen_put_character(me, ';');
     return HT_OK;
 }
 
 /*	Free an HTML object
-**	-------------------
-**
-*/
-static void HTMLGen_free (
-	HTStructured *		me)
+ *	-------------------
+ *
+ */
+static void HTMLGen_free(HTStructured * me)
 {
-    (*me->targetClass.put_character)(me->target, '\n');
+    (*me->targetClass.put_character) (me->target, '\n');
     HTMLGen_flush(me);
-    (*me->targetClass._free)(me->target);	/* ripple through */
+    (*me->targetClass._free) (me->target);	/* ripple through */
 #ifdef USE_COLOR_STYLE
     FREE(Style_className);
 #endif
     FREE(me);
 }
 
-static void PlainToHTML_free (
-	HTStructured *		me)
+static void PlainToHTML_free(HTStructured * me)
 {
     HTMLGen_end_element(me, HTML_PRE, 0);
     HTMLGen_free(me);
 }
 
-static void HTMLGen_abort (
-	HTStructured *		me,
-	HTError		e GCC_UNUSED)
+static void HTMLGen_abort(HTStructured * me, HTError e GCC_UNUSED)
 {
     HTMLGen_free(me);
 #ifdef USE_COLOR_STYLE
@@ -618,82 +602,79 @@ static void HTMLGen_abort (
 #endif
 }
 
-static void PlainToHTML_abort (
-	HTStructured *		me,
-	HTError		e GCC_UNUSED)
+static void PlainToHTML_abort(HTStructured * me, HTError e GCC_UNUSED)
 {
     PlainToHTML_free(me);
 }
 
 /*	Structured Object Class
-**	-----------------------
-*/
-static const HTStructuredClass HTMLGeneration = /* As opposed to print etc */
+ *	-----------------------
+ */
+static const HTStructuredClass HTMLGeneration =		/* As opposed to print etc */
 {
-	"HTMLGen",
-	HTMLGen_free,
-	HTMLGen_abort,
-	HTMLGen_put_character,	HTMLGen_put_string, HTMLGen_write,
-	HTMLGen_start_element,	HTMLGen_end_element,
-	HTMLGen_put_entity
+    "HTMLGen",
+    HTMLGen_free,
+    HTMLGen_abort,
+    HTMLGen_put_character, HTMLGen_put_string, HTMLGen_write,
+    HTMLGen_start_element, HTMLGen_end_element,
+    HTMLGen_put_entity
 };
 
 /*	Subclass-specific Methods
-**	-------------------------
-*/
-extern int LYcols;			/* LYCurses.h, set in LYMain.c	*/
+ *	-------------------------
+ */
+extern int LYcols;		/* LYCurses.h, set in LYMain.c  */
 
-HTStructured * HTMLGenerator (
-	HTStream *		output)
+HTStructured *HTMLGenerator(HTStream *output)
 {
-    HTStructured* me = (HTStructured*)malloc(sizeof(*me));
+    HTStructured *me = (HTStructured *) malloc(sizeof(*me));
+
     if (me == NULL)
 	outofmem(__FILE__, "HTMLGenerator");
     me->isa = &HTMLGeneration;
 
     me->target = output;
-    me->targetClass = *me->target->isa; /* Copy pointers to routines for speed*/
+    me->targetClass = *me->target->isa;		/* Copy pointers to routines for speed */
 
     me->write_pointer = me->buffer;
     flush_breaks(me);
     me->line_break[0] = me->buffer;
-    me->cleanness =	0;
+    me->cleanness = 0;
     me->overflowed = NO;
     me->delete_line_break_char[0] = NO;
-    me->preformatted =	NO;
+    me->preformatted = NO;
     me->in_attrval = NO;
 
     /*
-     *	For what line length should we attempt to wrap ? - kw
+     * For what line length should we attempt to wrap ?  - kw
      */
     if (!LYPreparsedSource) {
-	me->buffer_maxchars = 80; /* work as before - kw */
+	me->buffer_maxchars = 80;	/* work as before - kw */
     } else if (dump_output_width > 1) {
-	me->buffer_maxchars = dump_output_width; /* try to honor -width - kw */
+	me->buffer_maxchars = dump_output_width;	/* try to honor -width - kw */
     } else if (dump_output_immediately) {
-	me->buffer_maxchars = 80; /* try to honor -width - kw */
+	me->buffer_maxchars = 80;	/* try to honor -width - kw */
     } else {
 	me->buffer_maxchars = LYcols - 2;
-	if (me->buffer_maxchars < 38) /* too narrow, let GridText deal */
+	if (me->buffer_maxchars < 38)	/* too narrow, let GridText deal */
 	    me->buffer_maxchars = 40;
     }
-    if (me->buffer_maxchars > 900) /* likely not true - kw */
+    if (me->buffer_maxchars > 900)	/* likely not true - kw */
 	me->buffer_maxchars = 78;
-    if (me->buffer_maxchars > BUFFER_SIZE) /* must not be larger! */
+    if (me->buffer_maxchars > BUFFER_SIZE)	/* must not be larger! */
 	me->buffer_maxchars = BUFFER_SIZE - 2;
 
     /*
-     *	If dump_output_immediately is set, there likely isn't anything
-     *	after this stream to interpret the Lynx special chars.	Also
-     *	if they get displayed via HTPlain, that will probably make
-     *	non-breaking space chars etc. invisible.  So let's translate
-     *	them to numerical character references.  For debugging
-     *	purposes we'll use the new hex format.
+     * If dump_output_immediately is set, there likely isn't anything after
+     * this stream to interpret the Lynx special chars.  Also if they get
+     * displayed via HTPlain, that will probably make non-breaking space chars
+     * etc.  invisible.  So let's translate them to numerical character
+     * references.  For debugging purposes we'll use the new hex format.
      */
     me->escape_specials = LYPreparsedSource;
 
 #ifdef USE_COLOR_STYLE
-    me->text = NULL;	/* Will be initialized when first needed. - kw */
+    me->text = NULL;		/* Will be initialized when first needed. - kw */
     FREE(Style_className);
     class_string[0] = '\0';
 #endif /* COLOR_STYLE */
@@ -702,46 +683,46 @@ HTStructured * HTMLGenerator (
 }
 
 /*	Stream Object Class
-**	-------------------
-**
-**	This object just converts a plain text stream into HTML
-**	It is officially a structured strem but only the stream bits exist.
-**	This is just the easiest way of typecasting all the routines.
-*/
+ *	-------------------
+ *
+ *	This object just converts a plain text stream into HTML
+ *	It is officially a structured strem but only the stream bits exist.
+ *	This is just the easiest way of typecasting all the routines.
+ */
 static const HTStructuredClass PlainToHTMLConversion =
 {
-	"plaintexttoHTML",
-	HTMLGen_free,
-	PlainToHTML_abort,
-	HTMLGen_put_character,
-	HTMLGen_put_string,
-	HTMLGen_write,
-	NULL,		/* Structured stuff */
-	NULL,
-	NULL
+    "plaintexttoHTML",
+    HTMLGen_free,
+    PlainToHTML_abort,
+    HTMLGen_put_character,
+    HTMLGen_put_string,
+    HTMLGen_write,
+    NULL,			/* Structured stuff */
+    NULL,
+    NULL
 };
 
 /*	HTConverter from plain text to HTML Stream
-**	------------------------------------------
-*/
-HTStream* HTPlainToHTML (
-	HTPresentation *	pres GCC_UNUSED,
-	HTParentAnchor *	anchor GCC_UNUSED,
-	HTStream *		sink)
+ *	------------------------------------------
+ */
+HTStream *HTPlainToHTML(HTPresentation *pres GCC_UNUSED,
+			HTParentAnchor *anchor GCC_UNUSED,
+			HTStream *sink)
 {
-    HTStructured *me = (HTStructured *)malloc(sizeof(*me));
+    HTStructured *me = (HTStructured *) malloc(sizeof(*me));
+
     if (me == NULL)
 	outofmem(__FILE__, "PlainToHTML");
-    me->isa = (const HTStructuredClass *)&PlainToHTMLConversion;
+    me->isa = (const HTStructuredClass *) &PlainToHTMLConversion;
 
     /*
-     *	Copy pointers to routines for speed.
+     * Copy pointers to routines for speed.
      */
     me->target = sink;
     me->targetClass = *me->target->isa;
     me->write_pointer = me->buffer;
     flush_breaks(me);
-    me->cleanness =	0;
+    me->cleanness = 0;
     me->overflowed = NO;
     me->delete_line_break_char[0] = NO;
     /* try to honor -width - kw */
@@ -752,5 +733,5 @@ HTStream* HTPlainToHTML (
     me->preformatted = YES;
     me->escape_specials = NO;
     me->in_attrval = NO;
-    return (HTStream*) me;
+    return (HTStream *) me;
 }
diff --git a/WWW/Library/Implementation/HTMLGen.h b/WWW/Library/Implementation/HTMLGen.h
index 133e3c3d..e1144f79 100644
--- a/WWW/Library/Implementation/HTMLGen.h
+++ b/WWW/Library/Implementation/HTMLGen.h
@@ -17,11 +17,10 @@
 
 /* Special Creation:
 */
-extern HTStructured * HTMLGenerator (HTStream * output);
+extern HTStructured *HTMLGenerator(HTStream *output);
 
-extern HTStream * HTPlainToHTML (
-        HTPresentation *        pres,
-        HTParentAnchor *        anchor,
-        HTStream *              sink);
+extern HTStream *HTPlainToHTML(HTPresentation *pres,
+			       HTParentAnchor *anchor,
+			       HTStream *sink);
 
 #endif /* HTMLGEN_H */
diff --git a/WWW/Library/Implementation/HTNews.c b/WWW/Library/Implementation/HTNews.c
index e214596e..791aee92 100644
--- a/WWW/Library/Implementation/HTNews.c
+++ b/WWW/Library/Implementation/HTNews.c
@@ -1,10 +1,10 @@
 /*			NEWS ACCESS				HTNews.c
-**			===========
-**
-** History:
-**	26 Sep 90	Written TBL
-**	29 Nov 91	Downgraded to C, for portable implementation.
-*/
+ *			===========
+ *
+ * History:
+ *	26 Sep 90	Written TBL
+ *	29 Nov 91	Downgraded to C, for portable implementation.
+ */
 
 #include <HTUtils.h>		/* Coding convention macros */
 
@@ -25,8 +25,8 @@
 #define NEWS_PORT 119		/* See rfc977 */
 #define SNEWS_PORT 563		/* See Lou Montulli */
 #define APPEND			/* Use append methods */
-int HTNewsChunkSize = 30;/* Number of articles for quick display */
-int HTNewsMaxChunk = 40; /* Largest number of articles in one window */
+int HTNewsChunkSize = 30;	/* Number of articles for quick display */
+int HTNewsMaxChunk = 40;	/* Largest number of articles in one window */
 
 #ifndef DEFAULT_NEWS_HOST
 #define DEFAULT_NEWS_HOST "news"
@@ -36,14 +36,16 @@ int HTNewsMaxChunk = 40; /* Largest number of articles in one window */
 #endif /* SERVER_FILE */
 
 #ifdef USE_SSL
-extern SSL_CTX * ssl_ctx;
-static SSL * Handle = NULL;
+extern SSL_CTX *ssl_ctx;
+static SSL *Handle = NULL;
 static int channel_s = 1;
+
 #define NEWS_NETWRITE(sock, buff, size) \
 	(Handle ? SSL_write(Handle, buff, size) : NETWRITE(sock, buff, size))
 #define NEWS_NETCLOSE(sock) \
 	{ (void)NETCLOSE(sock); if (Handle) SSL_free(Handle); Handle = NULL; }
-static char HTNewsGetCharacter (void);
+static char HTNewsGetCharacter(void);
+
 #define NEXT_CHAR HTNewsGetCharacter()
 #else
 #define NEWS_NETWRITE  NETWRITE
@@ -65,35 +67,35 @@ static char HTNewsGetCharacter (void);
 #define SnipIn2(d,fmt,tag,len,s) sprintf(d, fmt, tag, (int)sizeof(d)-len, s)
 
 struct _HTStructured {
-	const HTStructuredClass *	isa;
-	/* ... */
+    const HTStructuredClass *isa;
+    /* ... */
 };
-struct _HTStream
-{
-  HTStreamClass * isa;
+struct _HTStream {
+    HTStreamClass *isa;
 };
 
-#define LINE_LENGTH 512			/* Maximum length of line of ARTICLE etc */
+#define LINE_LENGTH 512		/* Maximum length of line of ARTICLE etc */
 #define GROUP_NAME_LENGTH	256	/* Maximum length of group name */
 
 /*
-**  Module-wide variables.
-*/
-char * HTNewsHost = NULL;		/* Default host */
-static char * NewsHost = NULL;			/* Current host */
-static char * NewsHREF = NULL;			/* Current HREF prefix */
-static int s;					/* Socket for NewsHost */
-static int HTCanPost = FALSE;			/* Current POST permission */
-static char response_text[LINE_LENGTH+1];	/* Last response */
-/* static HText *	HT;	*/		/* the new hypertext */
-static HTStructured * target;			/* The output sink */
-static HTStructuredClass targetClass;		/* Copy of fn addresses */
-static HTStream * rawtarget = NULL;		/* The output sink for rawtext */
-static HTStreamClass rawtargetClass;		/* Copy of fn addresses */
-static HTParentAnchor *node_anchor;		/* Its anchor */
-static int	diagnostic;			/* level: 0=none 2=source */
-static BOOL rawtext = NO;			/* Flag: HEAD or -mime_headers */
-static HTList *NNTP_AuthInfo = NULL;		/* AUTHINFO database */
+ *  Module-wide variables.
+ */
+char *HTNewsHost = NULL;	/* Default host */
+static char *NewsHost = NULL;	/* Current host */
+static char *NewsHREF = NULL;	/* Current HREF prefix */
+static int s;			/* Socket for NewsHost */
+static int HTCanPost = FALSE;	/* Current POST permission */
+static char response_text[LINE_LENGTH + 1];	/* Last response */
+
+/* static HText *	HT;	*//* the new hypertext */
+static HTStructured *target;	/* The output sink */
+static HTStructuredClass targetClass;	/* Copy of fn addresses */
+static HTStream *rawtarget = NULL;	/* The output sink for rawtext */
+static HTStreamClass rawtargetClass;	/* Copy of fn addresses */
+static HTParentAnchor *node_anchor;	/* Its anchor */
+static int diagnostic;		/* level: 0=none 2=source */
+static BOOL rawtext = NO;	/* Flag: HEAD or -mime_headers */
+static HTList *NNTP_AuthInfo = NULL;	/* AUTHINFO database */
 static char *name = NULL;
 static char *address = NULL;
 static char *dbuf = NULL;	/* dynamic buffer for long messages etc. */
@@ -111,13 +113,13 @@ static char *dbuf = NULL;	/* dynamic buffer for long messages etc. */
 			else (*targetClass._abort)(target, NULL)
 
 typedef struct _NNTPAuth {
-   char * host;
-   char * user;
-   char * pass;
+    char *host;
+    char *user;
+    char *pass;
 } NNTPAuth;
 
 #ifdef LY_FIND_LEAKS
-static void free_news_globals (void)
+static void free_news_globals(void)
 {
     if (s >= 0) {
 	NEWS_NETCLOSE(s);
@@ -132,7 +134,7 @@ static void free_news_globals (void)
 }
 #endif /* LY_FIND_LEAKS */
 
-static void free_NNTP_AuthInfo (void)
+static void free_NNTP_AuthInfo(void)
 {
     HTList *cur = NNTP_AuthInfo;
     NNTPAuth *auth = NULL;
@@ -140,7 +142,7 @@ static void free_NNTP_AuthInfo (void)
     if (!cur)
 	return;
 
-    while (NULL != (auth = (NNTPAuth *)HTList_nextObject(cur))) {
+    while (NULL != (auth = (NNTPAuth *) HTList_nextObject(cur))) {
 	FREE(auth->host);
 	FREE(auth->user);
 	FREE(auth->pass);
@@ -151,47 +153,47 @@ static void free_NNTP_AuthInfo (void)
     return;
 }
 
-const char * HTGetNewsHost (void)
+const char *HTGetNewsHost(void)
 {
-	return HTNewsHost;
+    return HTNewsHost;
 }
 
-void HTSetNewsHost (const char *  value)
+void HTSetNewsHost(const char *value)
 {
-	StrAllocCopy(HTNewsHost, value);
+    StrAllocCopy(HTNewsHost, value);
 }
 
 /*	Initialisation for this module
-**	------------------------------
-**
-**	Except on the NeXT, we pick up the NewsHost name from
-**
-**	1.	Environment variable NNTPSERVER
-**	2.	File SERVER_FILE
-**	3.	Compilation time macro DEFAULT_NEWS_HOST
-**	4.	Default to "news"
-**
-**	On the NeXT, we pick up the NewsHost name from, in order:
-**
-**	1.	WorldWideWeb default "NewsHost"
-**	2.	Global default "NewsHost"
-**	3.	News default "NewsHost"
-**	4.	Compilation time macro DEFAULT_NEWS_HOST
-**	5.	Default to "news"
-*/
+ *	------------------------------
+ *
+ *	Except on the NeXT, we pick up the NewsHost name from
+ *
+ *	1.	Environment variable NNTPSERVER
+ *	2.	File SERVER_FILE
+ *	3.	Compilation time macro DEFAULT_NEWS_HOST
+ *	4.	Default to "news"
+ *
+ *	On the NeXT, we pick up the NewsHost name from, in order:
+ *
+ *	1.	WorldWideWeb default "NewsHost"
+ *	2.	Global default "NewsHost"
+ *	3.	News default "NewsHost"
+ *	4.	Compilation time macro DEFAULT_NEWS_HOST
+ *	5.	Default to "news"
+ */
 static BOOL initialized = NO;
-static BOOL initialize (void)
+static BOOL initialize(void)
 {
 #ifdef NeXTStep
     char *cp = NULL;
 #endif
 
     /*
-    **	Get name of Host.
-    */
+     * Get name of Host.
+     */
 #ifdef NeXTStep
-    if ((cp = NXGetDefaultValue("WorldWideWeb","NewsHost"))==0) {
-	if ((cp = NXGetDefaultValue("News","NewsHost")) == 0) {
+    if ((cp = NXGetDefaultValue("WorldWideWeb", "NewsHost")) == 0) {
+	if ((cp = NXGetDefaultValue("News", "NewsHost")) == 0) {
 	    StrAllocCopy(HTNewsHost, DEFAULT_NEWS_HOST);
 	}
     }
@@ -203,18 +205,21 @@ static BOOL initialize (void)
     if (LYGetEnv("NNTPSERVER")) {
 	StrAllocCopy(HTNewsHost, LYGetEnv("NNTPSERVER"));
 	CTRACE((tfp, "HTNews: NNTPSERVER defined as `%s'\n",
-		    HTNewsHost));
+		HTNewsHost));
     } else {
-	FILE* fp = fopen(SERVER_FILE, TXT_R);
+	FILE *fp = fopen(SERVER_FILE, TXT_R);
+
 	if (fp) {
-	    char server_name[MAXHOSTNAMELEN+1];
+	    char server_name[MAXHOSTNAMELEN + 1];
+
 	    if (fgets(server_name, sizeof server_name, fp) != NULL) {
 		char *p = strchr(server_name, '\n');
+
 		if (p != NULL)
 		    *p = '\0';
 		StrAllocCopy(HTNewsHost, server_name);
 		CTRACE((tfp, "HTNews: File %s defines news host as `%s'\n",
-			    SERVER_FILE, HTNewsHost));
+			SERVER_FILE, HTNewsHost));
 	    }
 	    fclose(fp);
 	}
@@ -223,7 +228,7 @@ static BOOL initialize (void)
 	StrAllocCopy(HTNewsHost, DEFAULT_NEWS_HOST);
 #endif /* NeXTStep */
 
-    s = -1;		/* Disconnected */
+    s = -1;			/* Disconnected */
 #ifdef LY_FIND_LEAKS
     atexit(free_news_globals);
 #endif
@@ -231,102 +236,105 @@ static BOOL initialize (void)
 }
 
 /*	Send NNTP Command line to remote host & Check Response
-**	------------------------------------------------------
-**
-** On entry,
-**	command points to the command to be sent, including CRLF, or is null
-**		pointer if no command to be sent.
-** On exit,
-**	Negative status indicates transmission error, socket closed.
-**	Positive status is an NNTP status.
-*/
-static int response (char * command)
+ *	------------------------------------------------------
+ *
+ * On entry,
+ *	command points to the command to be sent, including CRLF, or is null
+ *		pointer if no command to be sent.
+ * On exit,
+ *	Negative status indicates transmission error, socket closed.
+ *	Positive status is an NNTP status.
+ */
+static int response(char *command)
 {
     int result;
-    char * p = response_text;
+    char *p = response_text;
     int ich;
 
     if (command) {
 	int status;
 	int length = strlen(command);
+
 	CTRACE((tfp, "NNTP command to be sent: %s", command));
 #ifdef NOT_ASCII
 	{
-	    const char	* p;
-	    char	* q;
-	    char ascii[LINE_LENGTH+1];
-	    for(p = command, q=ascii; *p; p++, q++) {
+	    const char *p;
+	    char *q;
+	    char ascii[LINE_LENGTH + 1];
+
+	    for (p = command, q = ascii; *p; p++, q++) {
 		*q = TOASCII(*p);
 	    }
 	    status = NEWS_NETWRITE(s, ascii, length);
 	}
 #else
-	status = NEWS_NETWRITE(s, (char *)command, length);
+	status = NEWS_NETWRITE(s, (char *) command, length);
 #endif /* NOT_ASCII */
-	if (status < 0){
+	if (status < 0) {
 	    CTRACE((tfp, "HTNews: Unable to send command. Disconnecting.\n"));
 	    NEWS_NETCLOSE(s);
 	    s = -1;
 	    return status;
-	} /* if bad status */
-    } /* if command to be sent */
-
+	}			/* if bad status */
+    }
+    /* if command to be sent */
     for (;;) {
 	ich = NEXT_CHAR;
 	if (((*p++ = (char) ich) == LF) ||
 	    (p == &response_text[LINE_LENGTH])) {
-	    *--p = '\0';			/* Terminate the string */
+	    *--p = '\0';	/* Terminate the string */
 	    CTRACE((tfp, "NNTP Response: %s\n", response_text));
 	    sscanf(response_text, "%d", &result);
 	    return result;
-	} /* if end of line */
-
+	}
+	/* if end of line */
 	if (ich == EOF) {
-	    *(p-1) = '\0';
+	    *(p - 1) = '\0';
 	    if (interrupted_in_htgetcharacter) {
-		CTRACE((tfp, "HTNews: Interrupted on read, closing socket %d\n",
-			    s));
+		CTRACE((tfp,
+			"HTNews: Interrupted on read, closing socket %d\n",
+			s));
 	    } else {
 		CTRACE((tfp, "HTNews: EOF on read, closing socket %d\n",
-			    s));
+			s));
 	    }
 	    NEWS_NETCLOSE(s);	/* End of file, close socket */
 	    s = -1;
 	    if (interrupted_in_htgetcharacter) {
 		interrupted_in_htgetcharacter = 0;
-		return(HT_INTERRUPTED);
+		return (HT_INTERRUPTED);
 	    }
-	    return((int)EOF);	/* End of file on response */
+	    return ((int) EOF);	/* End of file on response */
 	}
-    } /* Loop over characters */
+    }				/* Loop over characters */
 }
 
 /*	Case insensitive string comparisons
-**	-----------------------------------
-**
-** On entry,
-**	template must be already un upper case.
-**	unknown may be in upper or lower or mixed case to match.
-*/
-static BOOL match (const char * unknown, const char * template)
+ *	-----------------------------------
+ *
+ * On entry,
+ *	template must be already un upper case.
+ *	unknown may be in upper or lower or mixed case to match.
+ */
+static BOOL match(const char *unknown, const char *template)
 {
-    const char * u = unknown;
-    const char * t = template;
-    for (; *u && *t && (TOUPPER(*u) == *t); u++, t++)
-	; /* Find mismatch or end */
-    return (BOOL)(*t == 0);		/* OK if end of template */
+    const char *u = unknown;
+    const char *t = template;
+
+    for (; *u && *t && (TOUPPER(*u) == *t); u++, t++) ;		/* Find mismatch or end */
+    return (BOOL) (*t == 0);	/* OK if end of template */
 }
 
 typedef enum {
-    NNTPAUTH_ERROR =	  0,	/* general failure */
-    NNTPAUTH_OK =	281,	/* authenticated successfully */
-    NNTPAUTH_CLOSE =	502	/* server probably closed connection */
+    NNTPAUTH_ERROR = 0,		/* general failure */
+    NNTPAUTH_OK = 281,		/* authenticated successfully */
+    NNTPAUTH_CLOSE = 502	/* server probably closed connection */
 } NNTPAuthResult;
+
 /*
-**  This function handles nntp authentication. - FM
-*/
-static NNTPAuthResult HTHandleAuthInfo (
-	char *		host)
+ *  This function handles nntp authentication. - FM
+ */
+static NNTPAuthResult HTHandleAuthInfo(char *host)
 {
     HTList *cur = NULL;
     NNTPAuth *auth = NULL;
@@ -337,17 +345,17 @@ static NNTPAuthResult HTHandleAuthInfo (
     int status, tries;
 
     /*
-    **	Make sure we have an interactive user and a host. - FM
-    */
+     * Make sure we have an interactive user and a host.  - FM
+     */
     if (dump_output_immediately || !(host && *host))
 	return NNTPAUTH_ERROR;
 
     /*
-    **	Check for an existing authorization entry. - FM
-    */
+     * Check for an existing authorization entry.  - FM
+     */
     if (NNTP_AuthInfo != NULL) {
 	cur = NNTP_AuthInfo;
-	while (NULL != (auth = (NNTPAuth *)HTList_nextObject(cur))) {
+	while (NULL != (auth = (NNTPAuth *) HTList_nextObject(cur))) {
 	    if (!strcmp(auth->host, host)) {
 		UserName = auth->user;
 		PassWord = auth->pass;
@@ -362,9 +370,9 @@ static NNTPAuthResult HTHandleAuthInfo (
     }
 
     /*
-    **	Handle the username. - FM
-    */
-    buffer[sizeof(buffer)-1] = '\0';
+     * Handle the username.  - FM
+     */
+    buffer[sizeof(buffer) - 1] = '\0';
     tries = 3;
 
     while (tries) {
@@ -378,7 +386,7 @@ static NNTPAuthResult HTHandleAuthInfo (
 	    }
 	}
 	sprintf(buffer, "AUTHINFO USER %.*s%c%c",
-		(int) sizeof(buffer)-17, UserName, CR, LF);
+		(int) sizeof(buffer) - 17, UserName, CR, LF);
 	if ((status = response(buffer)) < 0) {
 	    if (status == HT_INTERRUPTED)
 		_HTProgress(CONNECTION_INTERRUPTED);
@@ -396,8 +404,8 @@ static NNTPAuthResult HTHandleAuthInfo (
 	}
 	if (status == 281) {
 	    /*
-	    **  Username is accepted and no password is required. - FM
-	    */
+	     * Username is accepted and no password is required.  - FM
+	     */
 	    if (auth) {
 		if (auth->user != UserName) {
 		    FREE(auth->user);
@@ -405,8 +413,8 @@ static NNTPAuthResult HTHandleAuthInfo (
 		}
 	    } else {
 		/*
-		**  Store the accepted username and no password. - FM
-		*/
+		 * Store the accepted username and no password.  - FM
+		 */
 		if ((auth = typecalloc(NNTPAuth)) != NULL) {
 		    StrAllocCopy(auth->host, host);
 		    auth->user = UserName;
@@ -417,16 +425,17 @@ static NNTPAuthResult HTHandleAuthInfo (
 	}
 	if (status != 381) {
 	    /*
-	    **  Not success, nor a request for the password,
-	    **  so it must be an error. - FM
-	    */
+	     * Not success, nor a request for the password, so it must be an
+	     * error.  - FM
+	     */
 	    HTAlert(response_text);
 	    tries--;
 	    if ((tries > 0) && HTConfirm(gettext("Change username?"))) {
 		if (!auth || auth->user != UserName) {
 		    FREE(UserName);
 		}
-		if ((UserName = HTPrompt(gettext("Username:"), UserName)) != NULL &&
+		if ((UserName = HTPrompt(gettext("Username:"), UserName))
+		    != NULL &&
 		    *UserName) {
 		    continue;
 		}
@@ -445,8 +454,8 @@ static NNTPAuthResult HTHandleAuthInfo (
 
     if (status == 381) {
 	/*
-	**  Handle the password. - FM
-	*/
+	 * Handle the password.  - FM
+	 */
 	tries = 3;
 	while (tries) {
 	    if (PassWord == NULL) {
@@ -459,7 +468,7 @@ static NNTPAuthResult HTHandleAuthInfo (
 		}
 	    }
 	    sprintf(buffer, "AUTHINFO PASS %.*s%c%c",
-		    (int) sizeof(buffer)-17, PassWord, CR, LF);
+		    (int) sizeof(buffer) - 17, PassWord, CR, LF);
 	    if ((status = response(buffer)) < 0) {
 		if (status == HT_INTERRUPTED) {
 		    _HTProgress(CONNECTION_INTERRUPTED);
@@ -483,8 +492,8 @@ static NNTPAuthResult HTHandleAuthInfo (
 	    }
 	    if (status == 502) {
 		/*
-		 *  That's what INN's nnrpd returns.
-		 *  It closes the connection after this. - kw
+		 * That's what INN's nnrpd returns.  It closes the connection
+		 * after this.  - kw
 		 */
 		HTAlert(response_text);
 		if (auth) {
@@ -500,10 +509,10 @@ static NNTPAuthResult HTHandleAuthInfo (
 		return NNTPAUTH_CLOSE;
 	    }
 	    if (status == 281) {
-	    /*
-	    **	Password also is accepted, and everything
-	    **	has been stored. - FM
-	    */
+		/*
+		 * Password also is accepted, and everything has been stored. 
+		 * - FM
+		 */
 		if (auth) {
 		    if (auth->user != UserName) {
 			FREE(auth->user);
@@ -524,8 +533,8 @@ static NNTPAuthResult HTHandleAuthInfo (
 		return NNTPAUTH_OK;
 	    }
 	    /*
-	    **	Not success, so it must be an error. - FM
-	    */
+	     * Not success, so it must be an error.  - FM
+	     */
 	    HTAlert(response_text);
 	    if (!auth || auth->pass != PassWord) {
 		FREE(PassWord);
@@ -551,28 +560,28 @@ static NNTPAuthResult HTHandleAuthInfo (
 }
 
 /*	Find Author's name in mail address
-**	----------------------------------
-**
-** On exit,
-**	Returns allocated string which cannot be freed by the
-**	calling function, and is reallocated on subsequent calls
-**	to this function.
-**
-** For example, returns "Tim Berners-Lee" if given any of
-**	" Tim Berners-Lee <tim@online.cern.ch> "
-**  or	" tim@online.cern.ch ( Tim Berners-Lee ) "
-*/
-static char * author_name (char * email)
+ *	----------------------------------
+ *
+ * On exit,
+ *	Returns allocated string which cannot be freed by the
+ *	calling function, and is reallocated on subsequent calls
+ *	to this function.
+ *
+ * For example, returns "Tim Berners-Lee" if given any of
+ *	" Tim Berners-Lee <tim@online.cern.ch> "
+ *  or	" tim@online.cern.ch ( Tim Berners-Lee ) "
+ */
+static char *author_name(char *email)
 {
     char *p, *e;
 
     StrAllocCopy(name, email);
-    CTRACE((tfp,"Trying to find name in: %s\n",name));
+    CTRACE((tfp, "Trying to find name in: %s\n", name));
 
     if ((p = strrchr(name, '(')) && (e = strrchr(name, ')'))) {
 	if (e > p) {
-	    *e = '\0';			/* Chop off everything after the ')'  */
-	    return HTStrip(p+1);	/* Remove leading and trailing spaces */
+	    *e = '\0';		/* Chop off everything after the ')'  */
+	    return HTStrip(p + 1);	/* Remove leading and trailing spaces */
 	}
     }
 
@@ -584,33 +593,33 @@ static char * author_name (char * email)
 	}
     }
 
-    return HTStrip(name);		/* Default to the whole thing */
+    return HTStrip(name);	/* Default to the whole thing */
 }
 
 /*	Find Author's mail address
-**	--------------------------
-**
-** On exit,
-**	Returns allocated string which cannot be freed by the
-**	calling function, and is reallocated on subsequent calls
-**	to this function.
-**
-** For example, returns "montulli@spaced.out.galaxy.net" if given any of
-**	" Lou Montulli <montulli@spaced.out.galaxy.net> "
-**  or	" montulli@spaced.out.galaxy.net ( Lou "The Stud" Montulli ) "
-*/
-static char * author_address (char * email)
+ *	--------------------------
+ *
+ * On exit,
+ *	Returns allocated string which cannot be freed by the
+ *	calling function, and is reallocated on subsequent calls
+ *	to this function.
+ *
+ * For example, returns "montulli@spaced.out.galaxy.net" if given any of
+ *	" Lou Montulli <montulli@spaced.out.galaxy.net> "
+ *  or	" montulli@spaced.out.galaxy.net ( Lou "The Stud" Montulli ) "
+ */
+static char *author_address(char *email)
 {
     char *p, *at, *e;
 
     StrAllocCopy(address, email);
-    CTRACE((tfp,"Trying to find address in: %s\n",address));
+    CTRACE((tfp, "Trying to find address in: %s\n", address));
 
     if ((p = strrchr(address, '<'))) {
 	if ((e = strrchr(p, '>')) && (at = strrchr(p, '@'))) {
 	    if (at < e) {
-		*e = '\0';		 /* Remove > */
-		return HTStrip(p+1);  /* Remove leading and trailing spaces */
+		*e = '\0';	/* Remove > */
+		return HTStrip(p + 1);	/* Remove leading and trailing spaces */
 	    }
 	}
     }
@@ -618,7 +627,7 @@ static char * author_address (char * email)
     if ((p = strrchr(address, '(')) &&
 	(e = strrchr(address, ')')) && (at = strchr(address, '@'))) {
 	if (e > p && at < e) {
-	    *p = '\0';			/* Chop off everything after the ')'  */
+	    *p = '\0';		/* Chop off everything after the ')'  */
 	    return HTStrip(address);	/* Remove leading and trailing spaces */
 	}
     }
@@ -635,57 +644,57 @@ static char * author_address (char * email)
     }
 
     /*
-    **	Default to the first word.
-    */
+     * Default to the first word.
+     */
     p = address;
     while (isspace(UCH(*p)))
-	p++; /* find first non-space */
+	p++;			/* find first non-space */
     e = p;
     while (!isspace(UCH(*e)) && *e != '\0')
-	e++; /* find next space or end */
-    *e = '\0'; /* terminate space */
+	e++;			/* find next space or end */
+    *e = '\0';			/* terminate space */
 
-    return(p);
+    return (p);
 }
 
 /*	Start anchor element
-**	--------------------
-*/
-static void start_anchor (const char *   href)
+ *	--------------------
+ */
+static void start_anchor(const char *href)
 {
-    BOOL		present[HTML_A_ATTRIBUTES];
-    const char*		value[HTML_A_ATTRIBUTES];
+    BOOL present[HTML_A_ATTRIBUTES];
+    const char *value[HTML_A_ATTRIBUTES];
     int i;
 
-    for(i=0; i < HTML_A_ATTRIBUTES; i++)
+    for (i = 0; i < HTML_A_ATTRIBUTES; i++)
 	present[i] = (BOOL) (i == HTML_A_HREF);
     value[HTML_A_HREF] = href;
-    (*targetClass.start_element)(target, HTML_A, present, value, -1, 0);
+    (*targetClass.start_element) (target, HTML_A, present, value, -1, 0);
 }
 
 /*	Start link element
-**	------------------
-*/
-static void start_link (const char *   href, const char *  rev)
+ *	------------------
+ */
+static void start_link(const char *href, const char *rev)
 {
-    BOOL		present[HTML_LINK_ATTRIBUTES];
-    const char*		value[HTML_LINK_ATTRIBUTES];
+    BOOL present[HTML_LINK_ATTRIBUTES];
+    const char *value[HTML_LINK_ATTRIBUTES];
     int i;
 
-    for(i=0; i < HTML_LINK_ATTRIBUTES; i++)
+    for (i = 0; i < HTML_LINK_ATTRIBUTES; i++)
 	present[i] = (BOOL) (i == HTML_LINK_HREF || i == HTML_LINK_REV);
     value[HTML_LINK_HREF] = href;
-    value[HTML_LINK_REV]  = rev;
-    (*targetClass.start_element)(target, HTML_LINK, present, value, -1, 0);
+    value[HTML_LINK_REV] = rev;
+    (*targetClass.start_element) (target, HTML_LINK, present, value, -1, 0);
 }
 
 /*	Start list element
-**	------------------
-*/
-static void start_list (int  seqnum)
+ *	------------------
+ */
+static void start_list(int seqnum)
 {
-    BOOL		present[HTML_OL_ATTRIBUTES];
-    const char*		value[HTML_OL_ATTRIBUTES];
+    BOOL present[HTML_OL_ATTRIBUTES];
+    const char *value[HTML_OL_ATTRIBUTES];
     char SeqNum[20];
     int i;
 
@@ -693,35 +702,34 @@ static void start_list (int  seqnum)
 	present[i] = (BOOL) (i == HTML_OL_SEQNUM || i == HTML_OL_START);
     sprintf(SeqNum, "%d", seqnum);
     value[HTML_OL_SEQNUM] = SeqNum;
-    value[HTML_OL_START]  = SeqNum;
-    (*targetClass.start_element)(target, HTML_OL, present, value, -1, 0);
+    value[HTML_OL_START] = SeqNum;
+    (*targetClass.start_element) (target, HTML_OL, present, value, -1, 0);
 }
 
 /*	Paste in an Anchor
-**	------------------
-**
-**
-** On entry,
-**	HT	has a selection of zero length at the end.
-**	text	points to the text to be put into the file, 0 terminated.
-**	addr	points to the hypertext reference address,
-**		terminated by white space, comma, NULL or '>'
-*/
-static void write_anchor (const char * text, const char * addr)
+ *	------------------
+ *
+ *
+ * On entry,
+ *	HT	has a selection of zero length at the end.
+ *	text	points to the text to be put into the file, 0 terminated.
+ *	addr	points to the hypertext reference address,
+ *		terminated by white space, comma, NULL or '>'
+ */
+static void write_anchor(const char *text, const char *addr)
 {
-    char href[LINE_LENGTH+1];
-    const char * p;
+    char href[LINE_LENGTH + 1];
+    const char *p;
     char *q;
 
-    for (p = addr; *p && (*p != '>') && !WHITE(*p) && (*p!=','); p++)
-	;
+    for (p = addr; *p && (*p != '>') && !WHITE(*p) && (*p != ','); p++) ;
     if (strlen(NewsHREF) + (p - addr) + 1 < sizeof(href)) {
 	q = href;
 	strcpy(q, NewsHREF);
-	strncat(q, addr, p-addr);	/* Make complete hypertext reference */
+	strncat(q, addr, p - addr);	/* Make complete hypertext reference */
     } else {
 	q = NULL;
-	HTSprintf0(&q, "%s%.*s", NewsHREF, p-addr, addr);
+	HTSprintf0(&q, "%s%.*s", NewsHREF, p - addr, addr);
     }
 
     start_anchor(q);
@@ -733,103 +741,99 @@ static void write_anchor (const char * text, const char * addr)
 }
 
 /*	Write list of anchors
-**	---------------------
-**
-**	We take a pointer to a list of objects, and write out each,
-**	generating an anchor for each.
-**
-** On entry,
-**	HT	has a selection of zero length at the end.
-**	text	points to a comma or space separated list of addresses.
-** On exit,
-**	*text	is NOT any more chopped up into substrings.
-*/
-static void write_anchors (char * text)
+ *	---------------------
+ *
+ *	We take a pointer to a list of objects, and write out each,
+ *	generating an anchor for each.
+ *
+ * On entry,
+ *	HT	has a selection of zero length at the end.
+ *	text	points to a comma or space separated list of addresses.
+ * On exit,
+ *	*text	is NOT any more chopped up into substrings.
+ */
+static void write_anchors(char *text)
 {
-    char * start = text;
-    char * end;
+    char *start = text;
+    char *end;
     char c;
+
     for (;;) {
-	for (; *start && (WHITE(*start)); start++)
-	    ;  /* Find start */
+	for (; *start && (WHITE(*start)); start++) ;	/* Find start */
 	if (!*start)
-	    return;			/* (Done) */
+	    return;		/* (Done) */
 	for (end = start;
-	     *end && (*end != ' ') && (*end != ','); end++)
-	    ;/* Find end */
+	     *end && (*end != ' ') && (*end != ','); end++) ;	/* Find end */
 	if (*end)
-	    end++;	/* Include comma or space but not NULL */
+	    end++;		/* Include comma or space but not NULL */
 	c = *end;
 	*end = '\0';
 	if (*start == '<')
-	    write_anchor(start, start+1);
+	    write_anchor(start, start + 1);
 	else
 	    write_anchor(start, start);
 	START(HTML_BR);
 	*end = c;
-	start = end;			/* Point to next one */
+	start = end;		/* Point to next one */
     }
 }
 
 /*	Abort the connection					abort_socket
-**	--------------------
-*/
-static void abort_socket (void)
+ *	--------------------
+ */
+static void abort_socket(void)
 {
     CTRACE((tfp, "HTNews: EOF on read, closing socket %d\n", s));
-    NEWS_NETCLOSE(s);	/* End of file, close socket */
+    NEWS_NETCLOSE(s);		/* End of file, close socket */
     if (rawtext) {
 	RAW_PUTS("Network Error: connection lost\n");
     } else {
 	PUTS("Network Error: connection lost");
 	PUTC('\n');
     }
-    s = -1;		/* End of file on response */
+    s = -1;			/* End of file on response */
 }
 
 /*
-**  Determine if a line is a valid header line.			valid_header
-**  -------------------------------------------
-*/
-static BOOLEAN valid_header (
-	char *		line)
+ *  Determine if a line is a valid header line.			valid_header
+ *  -------------------------------------------
+ */
+static BOOLEAN valid_header(char *line)
 {
     char *colon, *space;
 
     /*
-    **	Blank or tab in first position implies
-    **	this is a continuation header.
-    */
+     * Blank or tab in first position implies this is a continuation header.
+     */
     if (line[0] == ' ' || line[0] == '\t')
-	return(TRUE);
+	return (TRUE);
 
     /*
-    **	Just check for initial letter, colon, and space to make
-    **	sure we discard only invalid headers.
-    */
+     * Just check for initial letter, colon, and space to make sure we discard
+     * only invalid headers.
+     */
     colon = strchr(line, ':');
     space = strchr(line, ' ');
     if (isalpha(UCH(line[0])) && colon && space == colon + 1)
-	return(TRUE);
+	return (TRUE);
 
     /*
-    **	Anything else is a bad header -- it should be ignored.
-    */
-    return(FALSE);
+     * Anything else is a bad header -- it should be ignored.
+     */
+    return (FALSE);
 }
 
 /*	post in an Article					post_article
-**	------------------
-**			(added by FM, modeled on Lynx's previous mini inews)
-**
-**	Note the termination condition of a single dot on a line by itself.
-**
-**  On entry,
-**	s		Global socket number is OK
-**	postfile	file with header and article to post.
-*/
-static void post_article (
-	char *		postfile)
+ *	------------------
+ *			(added by FM, modeled on Lynx's previous mini inews)
+ *
+ *	Note the termination condition of a single dot on a line by itself.
+ *
+ *  On entry,
+ *	s		Global socket number is OK
+ *	postfile	file with header and article to post.
+ */
+static void post_article(char *postfile)
 {
     char line[512];
     char buf[512];
@@ -840,38 +844,31 @@ static void post_article (
     int in_header = 1, seen_header = 0, seen_fromline = 0;
     int blen = 0, llen = 0;
 
-
     /*
-    **	Open the temporary file with the
-    **	nntp headers and message body. - FM
-    */
+     * Open the temporary file with the nntp headers and message body.  - FM
+     */
     if ((fd = fopen(NonNull(postfile), TXT_R)) == NULL) {
 	HTAlert(FAILED_CANNOT_OPEN_POST);
 	return;
     }
 
     /*
-    **	Read the temporary file and post
-    **	in maximum 512 byte chunks. - FM
-    */
+     * Read the temporary file and post in maximum 512 byte chunks.  - FM
+     */
     buf[0] = '\0';
     sprintf(crlf, "%c%c", CR, LF);
-    while (fgets(line, sizeof(line)-2, fd) != NULL) {
+    while (fgets(line, sizeof(line) - 2, fd) != NULL) {
 	if ((cp = strchr(line, '\n')) != NULL)
 	    *cp = '\0';
 	if (line[0] == '.') {
 	    /*
-	    **	A single '.' means end of transmission
-	    **	for nntp.  Lead dots on lines normally
-	    **	are trimmed and the EOF is not registered
-	    **	if the dot was not followed by CRLF.
-	    **	We prepend an extra dot for any line
-	    **	beginning with one, to retain the one
-	    **	intended, as well as avoid a false EOF
-	    **	signal.  We know we have room for it in
-	    **	the buffer, because we normally send when
-	    **	it would exceed 510. - FM
-	    */
+	     * A single '.' means end of transmission for nntp.  Lead dots on
+	     * lines normally are trimmed and the EOF is not registered if the
+	     * dot was not followed by CRLF.  We prepend an extra dot for any
+	     * line beginning with one, to retain the one intended, as well as
+	     * avoid a false EOF signal.  We know we have room for it in the
+	     * buffer, because we normally send when it would exceed 510.  - FM
+	     */
 	    strcat(buf, ".");
 	    blen++;
 	}
@@ -892,7 +889,7 @@ static void post_article (
 		    strcat(buf, crlf);
 		    blen += 34;
 		}
-	     } else {
+	    } else {
 		continue;
 	    }
 	} else if (in_header) {
@@ -904,7 +901,7 @@ static void post_article (
 	}
 	strcat(line, crlf);
 	llen += 2;
-	if ((blen + llen) >= (int) sizeof(buf)-1) {
+	if ((blen + llen) >= (int) sizeof(buf) - 1) {
 	    NEWS_NETWRITE(s, buf, blen);
 	    buf[blen = 0] = 0;
 	}
@@ -915,9 +912,9 @@ static void post_article (
     HTSYS_remove(postfile);
 
     /*
-    **	Send the nntp EOF and get the server's response. - FM
-    */
-    if (blen >= (int) sizeof(buf)-4) {
+     * Send the nntp EOF and get the server's response.  - FM
+     */
+    if (blen >= (int) sizeof(buf) - 4) {
 	NEWS_NETWRITE(s, buf, blen);
 	buf[blen = 0] = 0;
     }
@@ -929,18 +926,18 @@ static void post_article (
     status = response(NULL);
     if (status == 240) {
 	/*
-	**  Successful post. - FM
-	*/
+	 * Successful post.  - FM
+	 */
 	HTProgress(response_text);
     } else {
 	/*
-	**  Shucks, something went wrong. - FM
-	*/
+	 * Shucks, something went wrong.  - FM
+	 */
 	HTAlert(response_text);
     }
 }
 
-#ifdef SH_EX	/* for MIME */
+#ifdef SH_EX			/* for MIME */
 #ifdef NEWS_DEBUG
 /* for DEBUG 1997/11/07 (Fri) 17:20:16 */
 void debug_print(unsigned char *p)
@@ -949,14 +946,14 @@ void debug_print(unsigned char *p)
 	if (*p == '\0')
 	    break;
 	if (*p == 0x1b)
-	   printf("[ESC]");
+	    printf("[ESC]");
 	else if (*p == '\n')
-	   printf("[NL]");
+	    printf("[NL]");
 	else if (*p < ' ' || *p >= 0x80)
-	   printf("(%02x)", *p);
+	    printf("(%02x)", *p);
 	else
-	   putchar(*p);
-       p++;
+	    putchar(*p);
+	p++;
     }
     printf("]\n");
 }
@@ -993,7 +990,7 @@ static char *decode_mime(char *str)
     return str;
 }
 #else /* !SH_EX */
-static char *decode_mime (char *  str)
+static char *decode_mime(char *str)
 {
     HTmmdecode(str, str);
     HTrjis(str, str);
@@ -1001,31 +998,29 @@ static char *decode_mime (char *  str)
 }
 #endif
 
-
 /*	Read in an Article					read_article
-**	------------------
-**
-**	Note the termination condition of a single dot on a line by itself.
-**	RFC 977 specifies that the line "folding" of RFC850 is not used, so we
-**	do not handle it here.
-**
-** On entry,
-**	s	Global socket number is OK
-**	HT	Global hypertext object is ready for appending text
-*/
-static int read_article (
-	HTParentAnchor *	thisanchor)
+ *	------------------
+ *
+ *	Note the termination condition of a single dot on a line by itself.
+ *	RFC 977 specifies that the line "folding" of RFC850 is not used, so we
+ *	do not handle it here.
+ *
+ * On entry,
+ *	s	Global socket number is OK
+ *	HT	Global hypertext object is ready for appending text
+ */
+static int read_article(HTParentAnchor *thisanchor)
 {
-    char line[LINE_LENGTH+1];
+    char line[LINE_LENGTH + 1];
     char *full_line = NULL;
-    char *subject = NULL;			/* Subject string	    */
-    char *from = NULL;				/* From string		    */
-    char *replyto = NULL;			/* Reply-to string	    */
-    char *date = NULL;				/* Date string		    */
-    char *organization = NULL;			/* Organization string	    */
-    char *references = NULL;			/* Hrefs for other articles */
-    char *newsgroups = NULL;			/* Newsgroups list	    */
-    char *followupto = NULL;			/* Followup list	    */
+    char *subject = NULL;	/* Subject string           */
+    char *from = NULL;		/* From string              */
+    char *replyto = NULL;	/* Reply-to string          */
+    char *date = NULL;		/* Date string              */
+    char *organization = NULL;	/* Organization string      */
+    char *references = NULL;	/* Hrefs for other articles */
+    char *newsgroups = NULL;	/* Newsgroups list          */
+    char *followupto = NULL;	/* Followup list            */
     char *href = NULL;
     char *p = line;
     char *cp;
@@ -1033,33 +1028,36 @@ static int read_article (
     BOOL done = NO;
 
     /*
-    **	Read in the HEADer of the article.
-    **
-    **	The header fields are either ignored,
-    **	or formatted and put into the text.
-    */
+     * Read in the HEADer of the article.
+     *
+     * The header fields are either ignored, or formatted and put into the
+     * text.
+     */
     if (!diagnostic && !rawtext) {
 	while (!done) {
 	    int ich = NEXT_CHAR;
+
 	    *p++ = (char) ich;
 	    if (ich == EOF) {
 		if (interrupted_in_htgetcharacter) {
 		    interrupted_in_htgetcharacter = 0;
-		    CTRACE((tfp, "HTNews: Interrupted on read, closing socket %d\n",
-				s));
+		    CTRACE((tfp,
+			    "HTNews: Interrupted on read, closing socket %d\n",
+			    s));
 		    NEWS_NETCLOSE(s);
 		    s = -1;
-		    return(HT_INTERRUPTED);
+		    return (HT_INTERRUPTED);
 		}
-		abort_socket();		/* End of file, close socket */
-		return(HT_LOADED);	/* End of file on response */
+		abort_socket();	/* End of file, close socket */
+		return (HT_LOADED);	/* End of file on response */
 	    }
-	    if (((char)ich == LF) || (p == &line[LINE_LENGTH])) {
-		*--p = '\0';			/* Terminate the string */
+	    if (((char) ich == LF) || (p == &line[LINE_LENGTH])) {
+		*--p = '\0';	/* Terminate the string */
 		CTRACE((tfp, "H %s\n", line));
 
 		if (line[0] == '\t' || line[0] == ' ') {
 		    int i = 0;
+
 		    while (line[i]) {
 			if (line[i] == '\t')
 			    line[i] = ' ';
@@ -1076,55 +1074,56 @@ static int read_article (
 
 		if (full_line[0] == '.') {
 		    /*
-		    **	End of article?
-		    */
+		     * End of article?
+		     */
 		    if (UCH(full_line[1]) < ' ') {
 			done = YES;
 			break;
 		    }
 		} else if (UCH(full_line[0]) < ' ') {
-		    break;		/* End of Header? */
+		    break;	/* End of Header? */
 
 		} else if (match(full_line, "SUBJECT:")) {
-		    StrAllocCopy(subject, HTStrip(strchr(full_line,':')+1));
+		    StrAllocCopy(subject, HTStrip(strchr(full_line, ':') + 1));
 		    decode_mime(subject);
 		} else if (match(full_line, "DATE:")) {
-		    StrAllocCopy(date, HTStrip(strchr(full_line,':')+1));
+		    StrAllocCopy(date, HTStrip(strchr(full_line, ':') + 1));
 
 		} else if (match(full_line, "ORGANIZATION:")) {
 		    StrAllocCopy(organization,
-				 HTStrip(strchr(full_line,':')+1));
+				 HTStrip(strchr(full_line, ':') + 1));
 		    decode_mime(organization);
 
 		} else if (match(full_line, "FROM:")) {
-		    StrAllocCopy(from, HTStrip(strchr(full_line,':')+1));
+		    StrAllocCopy(from, HTStrip(strchr(full_line, ':') + 1));
 		    decode_mime(from);
 
 		} else if (match(full_line, "REPLY-TO:")) {
-		    StrAllocCopy(replyto, HTStrip(strchr(full_line,':')+1));
+		    StrAllocCopy(replyto, HTStrip(strchr(full_line, ':') + 1));
 		    decode_mime(replyto);
 
 		} else if (match(full_line, "NEWSGROUPS:")) {
-		    StrAllocCopy(newsgroups, HTStrip(strchr(full_line,':')+1));
+		    StrAllocCopy(newsgroups, HTStrip(strchr(full_line, ':') + 1));
 
 		} else if (match(full_line, "REFERENCES:")) {
-		    StrAllocCopy(references, HTStrip(strchr(full_line,':')+1));
+		    StrAllocCopy(references, HTStrip(strchr(full_line, ':') + 1));
 
 		} else if (match(full_line, "FOLLOWUP-TO:")) {
-		    StrAllocCopy(followupto, HTStrip(strchr(full_line,':')+1));
+		    StrAllocCopy(followupto, HTStrip(strchr(full_line, ':') + 1));
 
 		} else if (match(full_line, "MESSAGE-ID:")) {
-		    char * msgid = HTStrip(full_line+11);
-		    if (msgid[0] == '<' && msgid[strlen(msgid)-1] == '>') {
-			msgid[strlen(msgid)-1] = '\0';	/* Chop > */
-			msgid++;			/* Chop < */
+		    char *msgid = HTStrip(full_line + 11);
+
+		    if (msgid[0] == '<' && msgid[strlen(msgid) - 1] == '>') {
+			msgid[strlen(msgid) - 1] = '\0';	/* Chop > */
+			msgid++;	/* Chop < */
 			HTAnchor_setMessageID(thisanchor, msgid);
 		    }
 
-		} /* end if match */
-		p = line;			/* Restart at beginning */
-	    } /* if end of line */
-	} /* Loop over characters */
+		}		/* end if match */
+		p = line;	/* Restart at beginning */
+	    }			/* if end of line */
+	}			/* Loop over characters */
 	FREE(full_line);
 
 	START(HTML_HEAD);
@@ -1137,10 +1136,11 @@ static int read_article (
 	END(HTML_TITLE);
 	PUTC('\n');
 	/*
-	**  Put in the owner as a link rel.
-	*/
+	 * Put in the owner as a link rel.
+	 */
 	if (from || replyto) {
 	    char *temp = NULL;
+
 	    StrAllocCopy(temp, author_address(replyto ? replyto : from));
 	    StrAllocCopy(href, STR_MAILTO_URL);
 	    if (strchr(temp, '%') || strchr(temp, '?')) {
@@ -1262,9 +1262,9 @@ static int read_article (
 
 	if (followupto && !strcasecomp(followupto, "poster")) {
 	    /*
-	    **	"Followup-To: poster" has special meaning.
-	    **  Don't use it to construct a newsreply link. -kw
-	    */
+	     * "Followup-To:  poster" has special meaning.  Don't use it to
+	     * construct a newsreply link.  -kw
+	     */
 	    START(HTML_DT);
 	    START(HTML_B);
 	    PUTS("Followup to:");
@@ -1284,14 +1284,13 @@ static int read_article (
 
 	if (newsgroups && HTCanPost) {
 	    /*
-	    **	We have permission to POST to this host,
-	    **	so add a link for posting followups for
-	    **	this article. - FM
-	    */
+	     * We have permission to POST to this host, so add a link for
+	     * posting followups for this article.  - FM
+	     */
 	    if (!strncasecomp(NewsHREF, STR_SNEWS_URL, 6))
-		StrAllocCopy(href,"snewsreply://");
+		StrAllocCopy(href, "snewsreply://");
 	    else
-		StrAllocCopy(href,"newsreply://");
+		StrAllocCopy(href, "newsreply://");
 	    StrAllocCat(href, NewsHost);
 	    StrAllocCat(href, "/");
 	    StrAllocCat(href, (followupto ? followupto : newsgroups));
@@ -1303,6 +1302,7 @@ static int read_article (
 		    strchr(ccp, '/') || strchr(ccp, '%') ||
 		    strchr(ccp, ';')) {
 		    char *cp1 = HTEscape(ccp, URL_XPALPHAS);
+
 		    StrAllocCat(href, cp1);
 		    FREE(cp1);
 		} else {
@@ -1349,21 +1349,20 @@ static int read_article (
 
     if (rawtext) {
 	/*
-	 *  No tags, and never do a PUTC. - kw
+	 * No tags, and never do a PUTC.  - kw
 	 */
 	;
     } else if (diagnostic) {
 	/*
-	**  Read in the HEAD and BODY of the Article
-	**  as XMP formatted text. - FM
-	*/
+	 * Read in the HEAD and BODY of the Article as XMP formatted text.  -
+	 * FM
+	 */
 	START(HTML_XMP);
 	PUTC('\n');
     } else {
 	/*
-	**  Read in the BODY of the Article
-	**  as PRE formatted text. - FM
-	*/
+	 * Read in the BODY of the Article as PRE formatted text.  - FM
+	 */
 	START(HTML_PRE);
 	PUTC('\n');
     }
@@ -1371,37 +1370,39 @@ static int read_article (
     p = line;
     while (!done) {
 	int ich = NEXT_CHAR;
+
 	*p++ = (char) ich;
 	if (ich == EOF) {
 	    if (interrupted_in_htgetcharacter) {
 		interrupted_in_htgetcharacter = 0;
-		CTRACE((tfp, "HTNews: Interrupted on read, closing socket %d\n",
-			    s));
+		CTRACE((tfp,
+			"HTNews: Interrupted on read, closing socket %d\n",
+			s));
 		NEWS_NETCLOSE(s);
 		s = -1;
-		return(HT_INTERRUPTED);
+		return (HT_INTERRUPTED);
 	    }
 	    abort_socket();	/* End of file, close socket */
-	    return(HT_LOADED);	/* End of file on response */
+	    return (HT_LOADED);	/* End of file on response */
 	}
-	if (((char)ich == LF) || (p == &line[LINE_LENGTH])) {
-	    *p++ = '\0';			/* Terminate the string */
+	if (((char) ich == LF) || (p == &line[LINE_LENGTH])) {
+	    *p++ = '\0';	/* Terminate the string */
 	    CTRACE((tfp, "B %s", line));
-#ifdef NEWS_DEBUG	/* 1997/11/09 (Sun) 15:56:11 */
+#ifdef NEWS_DEBUG		/* 1997/11/09 (Sun) 15:56:11 */
 	    debug_print(line);	/* @@@ */
 #endif
 	    if (line[0] == '.') {
 		/*
-		**  End of article?
-		*/
+		 * End of article?
+		 */
 		if (UCH(line[1]) < ' ') {
 		    done = YES;
 		    break;
-		} else {			/* Line starts with dot */
+		} else {	/* Line starts with dot */
 		    if (rawtext) {
 			RAW_PUTS(&line[1]);
 		    } else {
-			PUTS(&line[1]); /* Ignore first dot */
+			PUTS(&line[1]);		/* Ignore first dot */
 		    }
 		}
 	    } else {
@@ -1409,31 +1410,32 @@ static int read_article (
 		    RAW_PUTS(line);
 		} else if (diagnostic || !scan_for_buried_news_references) {
 		    /*
-		    **	All lines are passed as unmodified source. - FM
-		    */
+		     * All lines are passed as unmodified source.  - FM
+		     */
 		    PUTS(line);
 		} else {
 		    /*
-		    **	Normal lines are scanned for buried references
-		    **	to other articles.  Unfortunately, it could pick
-		    **	up mail addresses as well!  It also can corrupt
-		    **	uuencoded messages!  So we don't do this when
-		    **	fetching articles as WWW_SOURCE or when downloading
-		    **	(diagnostic is TRUE) or if the client has set
-		    **	scan_for_buried_news_references to FALSE.
-		    **	Otherwise, we convert all "<...@...>" strings
-		    **	preceded by "rticle " to "news:...@..." links,
-		    **	and any strings that look like URLs to links. - FM
-		    */
+		     * Normal lines are scanned for buried references to other
+		     * articles.  Unfortunately, it could pick up mail
+		     * addresses as well!  It also can corrupt uuencoded
+		     * messages!  So we don't do this when fetching articles as
+		     * WWW_SOURCE or when downloading (diagnostic is TRUE) or
+		     * if the client has set scan_for_buried_news_references to
+		     * FALSE.  Otherwise, we convert all "<...@...>" strings
+		     * preceded by "rticle " to "news:...@..." links, and any
+		     * strings that look like URLs to links.  - FM
+		     */
 		    char *l = line;
 		    char *p2;
 
 		    while ((p2 = strstr(l, "rticle <")) != NULL) {
-			char *q  = strrchr(p2,'>');
+			char *q = strrchr(p2, '>');
 			char *at = strrchr(p2, '@');
-			if (q && at && at<q) {
+
+			if (q && at && at < q) {
 			    char c = q[1];
-			    q[1] = 0;		/* chop up */
+
+			    q[1] = 0;	/* chop up */
 			    p2 += 7;
 			    *p2 = 0;
 			    while (*l) {
@@ -1453,7 +1455,7 @@ static int read_article (
 				    strncmp(l, STR_MAILTO_URL, LEN_MAILTO_URL) &&
 				    strncmp(l, "cso://", 6) &&
 				    strncmp(l, "gopher://", 9)) {
-				    PUTC (*l++);
+				    PUTC(*l++);
 				} else {
 				    StrAllocCopy(href, l);
 				    start_anchor(strtok(href, " \r\n\t,>)\""));
@@ -1463,19 +1465,19 @@ static int read_article (
 				    FREE(href);
 				}
 			    }
-			    *p2 = '<';		/* again */
+			    *p2 = '<';	/* again */
 			    *q = 0;
-			    start_anchor(p2+1);
-			    *q = '>';		/* again */
+			    start_anchor(p2 + 1);
+			    *q = '>';	/* again */
 			    PUTS(p2);
 			    END(HTML_A);
-			    q[1] = c;		/* again */
+			    q[1] = c;	/* again */
 			    l = q + 1;
 			} else {
-			    break;		/* line has unmatched <> */
+			    break;	/* line has unmatched <> */
 			}
 		    }
-		    while (*l) {		/* Last bit of the line */
+		    while (*l) {	/* Last bit of the line */
 			if (strncmp(l, STR_NEWS_URL, LEN_NEWS_URL) &&
 			    strncmp(l, "snews://", 8) &&
 			    strncmp(l, "nntp://", 7) &&
@@ -1492,7 +1494,7 @@ static int read_article (
 			    strncmp(l, STR_MAILTO_URL, LEN_MAILTO_URL) &&
 			    strncmp(l, "cso://", 6) &&
 			    strncmp(l, "gopher://", 9))
-			    PUTC (*l++);
+			    PUTC(*l++);
 			else {
 			    StrAllocCopy(href, l);
 			    start_anchor(strtok(href, " \r\n\t,>)\""));
@@ -1502,33 +1504,33 @@ static int read_article (
 			    FREE(href);
 			}
 		    }
-		} /* if diagnostic or not scan_for_buried_news_references */
-	    } /* if not dot */
-	    p = line;				/* Restart at beginning */
-	} /* if end of line */
-    } /* Loop over characters */
+		}		/* if diagnostic or not scan_for_buried_news_references */
+	    }			/* if not dot */
+	    p = line;		/* Restart at beginning */
+	}			/* if end of line */
+    }				/* Loop over characters */
 
     if (rawtext)
-	return(HT_LOADED);
+	return (HT_LOADED);
 
     if (diagnostic)
 	END(HTML_XMP);
     else
 	END(HTML_PRE);
     PUTC('\n');
-    return(HT_LOADED);
+    return (HT_LOADED);
 }
 
 /*	Read in a List of Newsgroups
-**	----------------------------
-**
-**  Note the termination condition of a single dot on a line by itself.
-**  RFC 977 specifies that the line "folding" of RFC850 is not used,
-**  so we do not handle it here.
-*/
-static int read_list (char *  arg)
+ *	----------------------------
+ *
+ *  Note the termination condition of a single dot on a line by itself.
+ *  RFC 977 specifies that the line "folding" of RFC850 is not used,
+ *  so we do not handle it here.
+ */
+static int read_list(char *arg)
 {
-    char line[LINE_LENGTH+1];
+    char line[LINE_LENGTH + 1];
     char *p;
     BOOL done = NO;
     BOOL head = NO;
@@ -1540,29 +1542,28 @@ static int read_list (char *  arg)
     int len = 0;
 
     /*
-    **	Support head or tail matches for groups to list. - FM
-    */
+     * Support head or tail matches for groups to list.  - FM
+     */
     if (arg && strlen(arg) > 1) {
 	if (*arg == '*') {
 	    tail = YES;
-	    StrAllocCopy(pattern, (arg+1));
-	} else if (arg[strlen(arg)-1] == '*') {
+	    StrAllocCopy(pattern, (arg + 1));
+	} else if (arg[strlen(arg) - 1] == '*') {
 	    head = YES;
 	    StrAllocCopy(pattern, arg);
-	    pattern[strlen(pattern)-1] = '\0';
+	    pattern[strlen(pattern) - 1] = '\0';
 	}
 	if (tail || head) {
-	   len = strlen(pattern);
+	    len = strlen(pattern);
 	}
 
     }
 
     /*
-    **	Read the server's reply.
-    **
-    **	The lines are scanned for newsgroup
-    **	names and descriptions.
-    */
+     * Read the server's reply.
+     *
+     * The lines are scanned for newsgroup names and descriptions.
+     */
     START(HTML_HEAD);
     PUTC('\n');
     START(HTML_TITLE);
@@ -1572,7 +1573,7 @@ static int read_list (char *  arg)
     END(HTML_HEAD);
     PUTC('\n');
     START(HTML_H1);
-    PUTS( "Newsgroups");
+    PUTS("Newsgroups");
     END(HTML_H1);
     PUTC('\n');
     p = line;
@@ -1581,18 +1582,20 @@ static int read_list (char *  arg)
     while (!done) {
 	int ich = NEXT_CHAR;
 	char ch = (char) ich;
+
 	if (ich == EOF) {
 	    if (interrupted_in_htgetcharacter) {
 		interrupted_in_htgetcharacter = 0;
-		CTRACE((tfp, "HTNews: Interrupted on read, closing socket %d\n",
-			    s));
+		CTRACE((tfp,
+			"HTNews: Interrupted on read, closing socket %d\n",
+			s));
 		NEWS_NETCLOSE(s);
 		s = -1;
-		return(HT_INTERRUPTED);
+		return (HT_INTERRUPTED);
 	    }
 	    abort_socket();	/* End of file, close socket */
 	    FREE(pattern);
-	    return(HT_LOADED);	/* End of file on response */
+	    return (HT_LOADED);	/* End of file on response */
 	} else if (skip_this_line) {
 	    if (ch == LF) {
 		skip_this_line = skip_rest_of_line = NO;
@@ -1610,47 +1613,46 @@ static int read_list (char *  arg)
 		;		/* Will be dealt with below */
 	    } else if (WHITE(ch)) {
 		ch = LF;	/* May treat as line without description */
-		skip_this_line = YES; /* ...and ignore until LF */
+		skip_this_line = YES;	/* ...and ignore until LF */
 	    } else if (strchr(line, ' ') == NULL &&
 		       strchr(line, '\t') == NULL) {
 		/* No separator found */
 		CTRACE((tfp, "HTNews..... group name too long, discarding.\n"));
-		skip_this_line = YES; /* ignore whole line */
+		skip_this_line = YES;	/* ignore whole line */
 		continue;
 	    } else {
-		skip_rest_of_line = YES; /* skip until ch == LF found */
+		skip_rest_of_line = YES;	/* skip until ch == LF found */
 	    }
 	} else {
 	    *p++ = ch;
 	}
 	if (ch == LF) {
 	    skip_rest_of_line = NO;	/* done, reset flag */
-	    *p = '\0';			/* Terminate the string */
+	    *p = '\0';		/* Terminate the string */
 	    CTRACE((tfp, "B %s", line));
 	    if (line[0] == '.') {
 		/*
-		**  End of article?
-		*/
+		 * End of article?
+		 */
 		if (UCH(line[1]) < ' ') {
 		    done = YES;
 		    break;
-		} else {			/* Line starts with dot */
+		} else {	/* Line starts with dot */
 		    START(HTML_DT);
 		    PUTS(&line[1]);
 		    MAYBE_END(HTML_DT);
 		}
 	    } else if (line[0] == '#') {	/* Comment? */
-		p = line;			/* Restart at beginning */
+		p = line;	/* Restart at beginning */
 		continue;
 	    } else {
 		/*
-		**  Normal lines are scanned for references to newsgroups.
-		*/
+		 * Normal lines are scanned for references to newsgroups.
+		 */
 		int i = 0;
 
 		/* find whitespace if it exits */
-		for (; line[i] != '\0' && !WHITE(line[i]); i++)
-		    ;  /* null body */
+		for (; line[i] != '\0' && !WHITE(line[i]); i++) ;	/* null body */
 
 		if (line[i] != '\0') {
 		    line[i] = '\0';
@@ -1666,7 +1668,7 @@ static int read_list (char *  arg)
 		    MAYBE_END(HTML_DT);
 		    PUTC('\n');
 		    START(HTML_DD);
-		    PUTS(&line[i+1]); /* put description */
+		    PUTS(&line[i + 1]);		/* put description */
 		    MAYBE_END(HTML_DD);
 		} else {
 		    if ((head && strncasecomp(line, pattern, len)) ||
@@ -1680,12 +1682,13 @@ static int read_list (char *  arg)
 		    MAYBE_END(HTML_DT);
 		    listing++;
 		}
-	    } /* if not dot */
-	    p = line;			/* Restart at beginning */
-	} /* if end of line */
-    } /* Loop over characters */
+	    }			/* if not dot */
+	    p = line;		/* Restart at beginning */
+	}			/* if end of line */
+    }				/* Loop over characters */
     if (!listing) {
 	char *msg = NULL;
+
 	START(HTML_DT);
 	HTSprintf0(&msg, gettext("No matches for: %s"), arg);
 	PUTS(msg);
@@ -1695,35 +1698,35 @@ static int read_list (char *  arg)
     END(HTML_DLC);
     PUTC('\n');
     FREE(pattern);
-    return(HT_LOADED);
+    return (HT_LOADED);
 }
 
 /*	Read in a Newsgroup
-**	-------------------
-**
-**  Unfortunately, we have to ask for each article one by one if we
-**  want more than one field.
-**
-*/
-static int read_group (
-	const char *	groupName,
-	int		first_required,
-	int		last_required)
+ *	-------------------
+ *
+ *  Unfortunately, we have to ask for each article one by one if we
+ *  want more than one field.
+ *
+ */
+static int read_group(const char *groupName,
+		      int first_required,
+		      int last_required)
 {
-    char line[LINE_LENGTH+1];
-    char author[LINE_LENGTH+1];
-    char subject[LINE_LENGTH+1];
+    char line[LINE_LENGTH + 1];
+    char author[LINE_LENGTH + 1];
+    char subject[LINE_LENGTH + 1];
     char *date = NULL;
     int i;
     char *p;
     BOOL done;
 
-    char buffer[LINE_LENGTH+1];
+    char buffer[LINE_LENGTH + 1];
     char *temp = NULL;
-    char *reference = NULL;		/* Href for article */
-    int art;				/* Article number WITHIN GROUP */
+    char *reference = NULL;	/* Href for article */
+    int art;			/* Article number WITHIN GROUP */
     int status, count, first, last;	/* Response fields */
-					/* count is only an upper limit */
+
+    /* count is only an upper limit */
 
     author[0] = '\0';
     START(HTML_HEAD);
@@ -1738,17 +1741,16 @@ static int read_group (
 
     sscanf(response_text, " %d %d %d %d", &status, &count, &first, &last);
     CTRACE((tfp, "Newsgroup status=%d, count=%d, (%d-%d) required:(%d-%d)\n",
-		status, count, first, last, first_required, last_required));
+	    status, count, first, last, first_required, last_required));
     if (last == 0) {
 	PUTS(gettext("\nNo articles in this group.\n"));
 	goto add_post;
     }
-
 #define FAST_THRESHOLD 100	/* Above this, read IDs fast */
 #define CHOP_THRESHOLD 50	/* Above this, chop off the rest */
 
     if (first_required < first)
-	first_required = first;		/* clip */
+	first_required = first;	/* clip */
     if ((last_required == 0) || (last_required > last))
 	last_required = last;
 
@@ -1757,17 +1759,17 @@ static int read_group (
 	goto add_post;
     }
 
-    if (last_required-first_required+1 > HTNewsMaxChunk) { /* Trim this block */
-	first_required = last_required-HTNewsChunkSize+1;
+    if (last_required - first_required + 1 > HTNewsMaxChunk) {	/* Trim this block */
+	first_required = last_required - HTNewsChunkSize + 1;
     }
     CTRACE((tfp, "    Chunk will be (%d-%d)\n",
-		first_required, last_required));
+	    first_required, last_required));
 
     /*
-    **	Set window title.
-    */
+     * Set window title.
+     */
     HTSprintf0(&temp, gettext("%s,  Articles %d-%d"),
-		    groupName, first_required, last_required);
+	       groupName, first_required, last_required);
     START(HTML_H1);
     PUTS(temp);
     FREE(temp);
@@ -1775,16 +1777,17 @@ static int read_group (
     PUTC('\n');
 
     /*
-    **	Link to earlier articles.
-    */
+     * Link to earlier articles.
+     */
     if (first_required > first) {
-	int before;			/* Start of one before */
-	if (first_required-HTNewsMaxChunk <= first)
+	int before;		/* Start of one before */
+
+	if (first_required - HTNewsMaxChunk <= first)
 	    before = first;
 	else
-	    before = first_required-HTNewsChunkSize;
+	    before = first_required - HTNewsChunkSize;
 	HTSprintf0(&dbuf, "%s%s/%d-%d", NewsHREF, groupName,
-				      before, first_required-1);
+		   before, first_required - 1);
 	CTRACE((tfp, "    Block before is %s\n", dbuf));
 	PUTC('(');
 	start_anchor(dbuf);
@@ -1799,10 +1802,10 @@ static int read_group (
 
 /*#define USE_XHDR*/
 #ifdef USE_XHDR
-    if (count > FAST_THRESHOLD)  {
+    if (count > FAST_THRESHOLD) {
 	HTSprintf0(&temp,
- gettext("\nThere are about %d articles currently available in %s, IDs as follows:\n\n"),
-		count, groupName);
+		   gettext("\nThere are about %d articles currently available in %s, IDs as follows:\n\n"),
+		   count, groupName);
 	PUTS(temp);
 	FREE(temp);
 	sprintf(buffer, "XHDR Message-ID %d-%d%c%c", first, last, CR, LF);
@@ -1811,53 +1814,55 @@ static int read_group (
 	    p = line;
 	    while (!done) {
 		int ich = NEXT_CHAR;
+
 		*p++ = ich;
 		if (ich == EOF) {
 		    if (interrupted_in_htgetcharacter) {
 			interrupted_in_htgetcharacter = 0;
-			CTRACE((tfp, "HTNews: Interrupted on read, closing socket %d\n",
-				    s));
+			CTRACE((tfp,
+				"HTNews: Interrupted on read, closing socket %d\n",
+				s));
 			NEWS_NETCLOSE(s);
 			s = -1;
-			return(HT_INTERRUPTED);
+			return (HT_INTERRUPTED);
 		    }
 		    abort_socket();	/* End of file, close socket */
-		    return(HT_LOADED);	/* End of file on response */
+		    return (HT_LOADED);		/* End of file on response */
 		}
-		if (((char)ich == '\n') || (p == &line[LINE_LENGTH])) {
-		    *p = '\0';		/* Terminate the string */
+		if (((char) ich == '\n') || (p == &line[LINE_LENGTH])) {
+		    *p = '\0';	/* Terminate the string */
 		    CTRACE((tfp, "X %s", line));
 		    if (line[0] == '.') {
 			/*
-			**  End of article?
-			*/
+			 * End of article?
+			 */
 			if (UCH(line[1]) < ' ') {
 			    done = YES;
 			    break;
-			} else {		/* Line starts with dot */
-				/* Ignore strange line */
+			} else {	/* Line starts with dot */
+			    /* Ignore strange line */
 			}
 		    } else {
 			/*
-			**  Normal lines are scanned for
-			**  references to articles.
-			*/
-			char * space = strchr(line, ' ');
+			 * Normal lines are scanned for references to articles.
+			 */
+			char *space = strchr(line, ' ');
+
 			if (space++)
 			    write_anchor(space, space);
-		    } /* if not dot */
-		    p = line;			/* Restart at beginning */
-		} /* if end of line */
-	    } /* Loop over characters */
+		    }		/* if not dot */
+		    p = line;	/* Restart at beginning */
+		}		/* if end of line */
+	    }			/* Loop over characters */
 
 	    /* leaving loop with "done" set */
-	} /* Good status */
+	}			/* Good status */
     }
 #endif /* USE_XHDR */
 
     /*
-    **	Read newsgroup using individual fields.
-    */
+     * Read newsgroup using individual fields.
+     */
     if (!done) {
 	START(HTML_B);
 	if (first == first_required && last == last_required)
@@ -1875,78 +1880,79 @@ static int read_group (
 /*#define OVERLAP*/
 #ifdef OVERLAP
 	    /*
-	    **	With this code we try to keep the server running flat out
-	    **	by queuing just one extra command ahead of time.
-	    **	We assume (1) that the server won't abort if it gets input
-	    **	during output, and (2) that TCP buffering is enough for the
-	    **	two commands.  Both these assumptions seem very reasonable.
-	    **	However, we HAVE had a hangup with a loaded server.
-	    */
+	     * With this code we try to keep the server running flat out by
+	     * queuing just one extra command ahead of time.  We assume (1)
+	     * that the server won't abort if it gets input during output, and
+	     * (2) that TCP buffering is enough for the two commands.  Both
+	     * these assumptions seem very reasonable.  However, we HAVE had a
+	     * hangup with a loaded server.
+	     */
 	    if (art == first_required) {
-		if (art == last_required) {		/* Only one */
+		if (art == last_required) {	/* Only one */
 		    sprintf(buffer, "HEAD %d%c%c",
-				    art, CR, LF);
+			    art, CR, LF);
 		    status = response(buffer);
-		} else {				/* First of many */
+		} else {	/* First of many */
 		    sprintf(buffer, "HEAD %d%c%cHEAD %d%c%c",
-				    art, CR, LF, art+1, CR, LF);
-			status = response(buffer);
+			    art, CR, LF, art + 1, CR, LF);
+		    status = response(buffer);
 		}
-	    } else if (art == last_required) {		/* Last of many */
+	    } else if (art == last_required) {	/* Last of many */
 		status = response(NULL);
-	    } else {					/* Middle of many */
-		sprintf(buffer, "HEAD %d%c%c", art+1, CR, LF);
+	    } else {		/* Middle of many */
+		sprintf(buffer, "HEAD %d%c%c", art + 1, CR, LF);
 		status = response(buffer);
 	    }
-#else	/* Not OVERLAP: */
+#else /* Not OVERLAP: */
 	    sprintf(buffer, "HEAD %d%c%c", art, CR, LF);
 	    status = response(buffer);
-#endif	/* OVERLAP */
+#endif /* OVERLAP */
 	    /*
-	    **	Check for a good response (221) for the HEAD request,
-	    **	and if so, parse it.  Otherwise, indicate the error
-	    **	so that the number of listings corresponds to what's
-	    **	claimed for the range, and if we are listing numbers
-	    **	via an ordered list, they stay in synchrony with the
-	    **	article numbers. - FM
-	    */
-	    if (status == 221) {	/* Head follows - parse it:*/
-		p = line;				/* Write pointer */
+	     * Check for a good response (221) for the HEAD request, and if so,
+	     * parse it.  Otherwise, indicate the error so that the number of
+	     * listings corresponds to what's claimed for the range, and if we
+	     * are listing numbers via an ordered list, they stay in synchrony
+	     * with the article numbers.  - FM
+	     */
+	    if (status == 221) {	/* Head follows - parse it: */
+		p = line;	/* Write pointer */
 		done = NO;
-		while( !done ) {
+		while (!done) {
 		    int ich = NEXT_CHAR;
+
 		    *p++ = (char) ich;
 		    if (ich == EOF) {
 			if (interrupted_in_htgetcharacter) {
 			    interrupted_in_htgetcharacter = 0;
-			    CTRACE((tfp, "HTNews: Interrupted on read, closing socket %d\n",
-					s));
+			    CTRACE((tfp,
+				    "HTNews: Interrupted on read, closing socket %d\n",
+				    s));
 			    NEWS_NETCLOSE(s);
 			    s = -1;
-			    return(HT_INTERRUPTED);
+			    return (HT_INTERRUPTED);
 			}
 			abort_socket();		/* End of file, close socket */
-			return(HT_LOADED);	/* End of file on response */
+			return (HT_LOADED);	/* End of file on response */
 		    }
-		    if (((char)ich == LF) ||
+		    if (((char) ich == LF) ||
 			(p == &line[LINE_LENGTH])) {
 
-			*--p = '\0';		/* Terminate  & chop LF*/
-			p = line;		/* Restart at beginning */
+			*--p = '\0';	/* Terminate  & chop LF */
+			p = line;	/* Restart at beginning */
 			CTRACE((tfp, "G %s\n", line));
-			switch(line[0]) {
+			switch (line[0]) {
 
 			case '.':
 			    /*
-			    **	End of article?
-			    */
+			     * End of article?
+			     */
 			    done = (BOOL) (UCH(line[1]) < ' ');
 			    break;
 
 			case 'S':
 			case 's':
 			    if (match(line, "SUBJECT:")) {
-				LYstrncpy(subject, line+9, sizeof(subject)-1);/* Save subject */
+				LYstrncpy(subject, line + 9, sizeof(subject) - 1);	/* Save subject */
 				decode_mime(subject);
 			    }
 			    break;
@@ -1954,8 +1960,9 @@ static int read_group (
 			case 'M':
 			case 'm':
 			    if (match(line, "MESSAGE-ID:")) {
-				char * addr = HTStrip(line+11) +1; /* Chop < */
-				addr[strlen(addr)-1] = '\0';	   /* Chop > */
+				char *addr = HTStrip(line + 11) + 1;	/* Chop < */
+
+				addr[strlen(addr) - 1] = '\0';	/* Chop > */
 				StrAllocCopy(reference, addr);
 			    }
 			    break;
@@ -1963,14 +1970,15 @@ static int read_group (
 			case 'f':
 			case 'F':
 			    if (match(line, "FROM:")) {
-				char * p2;
+				char *p2;
+
 				LYstrncpy(author,
-					author_name(strchr(line,':')+1),
-					sizeof(author)-1);
+					  author_name(strchr(line, ':') + 1),
+					  sizeof(author) - 1);
 				decode_mime(author);
 				p2 = author + strlen(author) - 1;
-				if (*p2==LF)
-				    *p2 = '\0'; /* Chop off newline */
+				if (*p2 == LF)
+				    *p2 = '\0';		/* Chop off newline */
 			    }
 			    break;
 
@@ -1978,17 +1986,17 @@ static int read_group (
 			case 'D':
 			    if (LYListNewsDates && match(line, "DATE:")) {
 				StrAllocCopy(date,
-					     HTStrip(strchr(line,':')+1));
+					     HTStrip(strchr(line, ':') + 1));
 			    }
 			    break;
 
-			} /* end switch on first character */
-		    } /* if end of line */
-		} /* Loop over characters */
+			}	/* end switch on first character */
+		    }		/* if end of line */
+		}		/* Loop over characters */
 
 		PUTC('\n');
 		START(HTML_LI);
-#ifdef SH_EX	/* for MIME */
+#ifdef SH_EX			/* for MIME */
 		HTSprintf0(&temp, "\"%s\"", decode_mime(subject));
 #else
 		HTSprintf0(&temp, "\"%s\"", subject);
@@ -2002,17 +2010,17 @@ static int read_group (
 		FREE(temp);
 
 		if (author[0] != '\0') {
-		     PUTS(" - ");
-		     if (LYListNewsDates)
-			 START(HTML_I);
-#ifdef SH_EX	/* for MIME */
-		     PUTS(decode_mime(author));
+		    PUTS(" - ");
+		    if (LYListNewsDates)
+			START(HTML_I);
+#ifdef SH_EX			/* for MIME */
+		    PUTS(decode_mime(author));
 #else
-		     PUTS(author);
+		    PUTS(author);
 #endif
-		     if (LYListNewsDates)
-			 END(HTML_I);
-		     author[0] = '\0';
+		    if (LYListNewsDates)
+			END(HTML_I);
+		    author[0] = '\0';
 		}
 		if (date) {
 		    if (!diagnostic) {
@@ -2022,25 +2030,26 @@ static int read_group (
 			    }
 			}
 		    }
-		    sprintf(buffer, " [%.*s]", (int)(sizeof(buffer) - 4), date);
+		    sprintf(buffer, " [%.*s]", (int) (sizeof(buffer) - 4), date);
 		    PUTS(buffer);
 		    FREE(date);
 		}
 		MAYBE_END(HTML_LI);
 		/*
-		**  Indicate progress!	 @@@@@@
-		*/
+		 * Indicate progress!  @@@@@@
+		 */
 	    } else if (status == HT_INTERRUPTED) {
 		interrupted_in_htgetcharacter = 0;
-		CTRACE((tfp, "HTNews: Interrupted on read, closing socket %d\n",
-			    s));
+		CTRACE((tfp,
+			"HTNews: Interrupted on read, closing socket %d\n",
+			s));
 		NEWS_NETCLOSE(s);
 		s = -1;
-		return(HT_INTERRUPTED);
+		return (HT_INTERRUPTED);
 	    } else {
 		/*
-		**  Use the response text on error. - FM
-		*/
+		 * Use the response text on error.  - FM
+		 */
 		PUTC('\n');
 		START(HTML_LI);
 		START(HTML_I);
@@ -2053,9 +2062,9 @@ static int read_group (
 		PUTC(' ');
 		PUTS(response_text);
 		MAYBE_END(HTML_LI);
-	    } /* Handle response to HEAD request */
-	} /* Loop over article */
-    } /* If read headers */
+	    }			/* Handle response to HEAD request */
+	}			/* Loop over article */
+    }				/* If read headers */
     PUTC('\n');
     if (LYListNewsNumbers)
 	END(HTML_OL);
@@ -2064,16 +2073,17 @@ static int read_group (
     PUTC('\n');
 
     /*
-    **	Link to later articles.
-    */
+     * Link to later articles.
+     */
     if (last_required < last) {
-	int after;			/* End of article after */
-	after = last_required+HTNewsChunkSize;
+	int after;		/* End of article after */
+
+	after = last_required + HTNewsChunkSize;
 	if (after == last)
-	    HTSprintf0(&dbuf, "%s%s", NewsHREF, groupName); /* original group */
+	    HTSprintf0(&dbuf, "%s%s", NewsHREF, groupName);	/* original group */
 	else
 	    HTSprintf0(&dbuf, "%s%s/%d-%d", NewsHREF, groupName,
-					  last_required+1, after);
+		       last_required + 1, after);
 	CTRACE((tfp, "    Block after is %s\n", dbuf));
 	PUTC('(');
 	start_anchor(dbuf);
@@ -2082,24 +2092,23 @@ static int read_group (
 	PUTS("...)\n");
     }
 
-add_post:
+  add_post:
     if (HTCanPost) {
 	/*
-	**  We have permission to POST to this host,
-	**  so add a link for posting messages to
-	**  this newsgroup. - FM
-	*/
+	 * We have permission to POST to this host, so add a link for posting
+	 * messages to this newsgroup.  - FM
+	 */
 	char *href = NULL;
 
 	START(HTML_HR);
 	PUTC('\n');
 	if (!strncasecomp(NewsHREF, STR_SNEWS_URL, 6))
-	    StrAllocCopy(href,"snewspost://");
+	    StrAllocCopy(href, "snewspost://");
 	else
-	    StrAllocCopy(href,"newspost://");
+	    StrAllocCopy(href, "newspost://");
 	StrAllocCat(href, NewsHost);
 	StrAllocCat(href, "/");
-	StrAllocCat(href,groupName);
+	StrAllocCat(href, groupName);
 	start_anchor(href);
 	PUTS(gettext("Post to "));
 	PUTS(groupName);
@@ -2109,23 +2118,22 @@ add_post:
 	START(HTML_HR);
     }
     PUTC('\n');
-    return(HT_LOADED);
+    return (HT_LOADED);
 }
 
 /*	Load by name.						HTLoadNews
-**	=============
-*/
-static int HTLoadNews (
-	const char *		arg,
-	HTParentAnchor *	anAnchor,
-	HTFormat		format_out,
-	HTStream*		stream)
+ *	=============
+ */
+static int HTLoadNews(const char *arg,
+		      HTParentAnchor *anAnchor,
+		      HTFormat format_out,
+		      HTStream *stream)
 {
-    char command[262];			/* The whole command */
-    char proxycmd[260];			/* The proxy command */
+    char command[262];		/* The whole command */
+    char proxycmd[260];		/* The proxy command */
     char groupName[GROUP_NAME_LENGTH];	/* Just the group name */
-    int status;				/* tcp return */
-    int retries;			/* A count of how hard we have tried */
+    int status;			/* tcp return */
+    int retries;		/* A count of how hard we have tried */
     BOOL normal_url;		/* Flag: "news:" or "nntp:" (physical) URL */
     BOOL group_wanted;		/* Flag: group was asked for, not article */
     BOOL list_wanted;		/* Flag: list was asked for, not article */
@@ -2140,6 +2148,7 @@ static int HTLoadNews (
     char *ProxyHost = NULL;
     char *ProxyHREF = NULL;
     char *postfile = NULL;
+
 #ifdef USE_SSL
     char SSLprogress[256];
 #endif /* USE_SSL */
@@ -2154,42 +2163,45 @@ static int HTLoadNews (
     if (!initialized)
 	initialized = initialize();
     if (!initialized)
-	return -1;	/* FAIL */
+	return -1;		/* FAIL */
 
     FREE(NewsHREF);
     command[0] = '\0';
-    command[sizeof(command)-1] = '\0';
+    command[sizeof(command) - 1] = '\0';
     proxycmd[0] = '\0';
-    proxycmd[sizeof(proxycmd)-1] = '\0';
+    proxycmd[sizeof(proxycmd) - 1] = '\0';
 
     {
-	const char * p1 = arg;
+	const char *p1 = arg;
 
 	/*
-	**  We will ask for the document, omitting the host name & anchor.
-	**
-	**  Syntax of address is
-	**	xxx@yyy			Article
-	**	<xxx@yyy>		Same article
-	**	xxxxx			News group (no "@")
-	**	group/n1-n2		Articles n1 to n2 in group
-	*/
-	normal_url = (BOOL) (!strncmp(arg, STR_NEWS_URL, LEN_NEWS_URL) || !strncmp(arg, "nntp:", 5));
+	 * We will ask for the document, omitting the host name & anchor.
+	 *
+	 * Syntax of address is
+	 * xxx@yyy                 Article
+	 * <xxx@yyy>               Same article
+	 * xxxxx                   News group (no "@")
+	 * group/n1-n2             Articles n1 to n2 in group
+	 */
+	normal_url = (BOOL) (!strncmp(arg, STR_NEWS_URL, LEN_NEWS_URL) ||
+			     !strncmp(arg, "nntp:", 5));
 	spost_wanted = (BOOL) (!normal_url && strstr(arg, "snewspost:") != NULL);
 	sreply_wanted = (BOOL) (!(normal_url || spost_wanted) &&
-			 strstr(arg, "snewsreply:") != NULL);
+				strstr(arg, "snewsreply:") != NULL);
 	post_wanted = (BOOL) (!(normal_url || spost_wanted || sreply_wanted) &&
-			strstr(arg, "newspost:") != NULL);
+			      strstr(arg, "newspost:") != NULL);
 	reply_wanted = (BOOL) (!(normal_url || spost_wanted || sreply_wanted ||
-			  post_wanted) &&
-			strstr(arg, "newsreply:") != NULL);
+				 post_wanted) &&
+			       strstr(arg, "newsreply:") != NULL);
 	group_wanted = (BOOL) ((!(spost_wanted || sreply_wanted ||
-			  post_wanted || reply_wanted) &&
-			strchr(arg, '@') == NULL) && (strchr(arg, '*') == NULL));
-	list_wanted  = (BOOL) ((!(spost_wanted || sreply_wanted ||
-			  post_wanted || reply_wanted ||
-			  group_wanted) &&
-			strchr(arg, '@') == NULL) && (strchr(arg, '*') != NULL));
+				  post_wanted || reply_wanted) &&
+				strchr(arg, '@') == NULL) &&
+			       (strchr(arg, '*') == NULL));
+	list_wanted = (BOOL) ((!(spost_wanted || sreply_wanted ||
+				 post_wanted || reply_wanted ||
+				 group_wanted) &&
+			       strchr(arg, '@') == NULL) &&
+			      (strchr(arg, '*') != NULL));
 
 #ifndef USE_SSL
 	if (!strncasecomp(arg, "snewspost:", 10) ||
@@ -2200,8 +2212,8 @@ static int HTLoadNews (
 #endif /* !USE_SSL */
 	if (post_wanted || reply_wanted || spost_wanted || sreply_wanted) {
 	    /*
-	    **	Make sure we have a non-zero path for the newsgroup(s). - FM
-	    */
+	     * Make sure we have a non-zero path for the newsgroup(s).  - FM
+	     */
 	    if ((p1 = strrchr(arg, '/')) != NULL) {
 		p1++;
 	    } else if ((p1 = strrchr(arg, ':')) != NULL) {
@@ -2209,7 +2221,7 @@ static int HTLoadNews (
 	    }
 	    if (!(p1 && *p1)) {
 		HTAlert(WWW_ILLEGAL_URL_MESSAGE);
-		return(HT_NO_DATA);
+		return (HT_NO_DATA);
 	    }
 	    if (!(cp = HTParse(arg, "", PARSE_HOST)) || *cp == '\0') {
 		if (s >= 0 && NewsHost && strcasecomp(NewsHost, HTNewsHost)) {
@@ -2226,30 +2238,31 @@ static int HTLoadNews (
 	    }
 	    FREE(cp);
 	    HTSprintf0(&NewsHREF, "%s://%.*s/",
-			     (post_wanted ?
-			       "newspost" :
-			    (reply_wanted ?
-			       "newreply" :
-			    (spost_wanted ?
-			      "snewspost" : "snewsreply"))),
-			    (int) sizeof(command) - 15, NewsHost);
+		       (post_wanted ?
+			"newspost" :
+			(reply_wanted ?
+			 "newreply" :
+			 (spost_wanted ?
+			  "snewspost" : "snewsreply"))),
+		       (int) sizeof(command) - 15, NewsHost);
 
 	    /*
-	    **	If the SSL daemon is being used as a proxy,
-	    **	reset p1 to the start of the proxied URL
-	    **	rather than to the start of the newsgroup(s). - FM
-	    */
+	     * If the SSL daemon is being used as a proxy, reset p1 to the
+	     * start of the proxied URL rather than to the start of the
+	     * newsgroup(s).  - FM
+	     */
 	    if (spost_wanted && strncasecomp(arg, "snewspost:", 10))
 		p1 = strstr(arg, "snewspost:");
 	    if (sreply_wanted && strncasecomp(arg, "snewsreply:", 11))
 		p1 = strstr(arg, "snewsreply:");
 
-	/* p1 = HTParse(arg, "", PARSE_PATH | PARSE_PUNCTUATION); */
-	/*
-	**  Don't use HTParse because news: access doesn't follow traditional
-	**  rules.  For instance, if the article reference contains a '#',
-	**  the rest of it is lost -- JFG 10/7/92, from a bug report
-	*/
+	    /* p1 = HTParse(arg, "", PARSE_PATH | PARSE_PUNCTUATION); */
+	    /*
+	     * Don't use HTParse because news:  access doesn't follow
+	     * traditional rules.  For instance, if the article reference
+	     * contains a '#', the rest of it is lost -- JFG 10/7/92, from a
+	     * bug report
+	     */
 	} else if (isNNTP_URL(arg)) {
 	    if (((*(arg + 5) == '\0') ||
 		 (!strcmp((arg + 5), "/") ||
@@ -2283,8 +2296,7 @@ static int HTLoadNews (
 	    FREE(cp);
 	    SnipIn2(command, "%s//%.*s/", STR_NNTP_URL, 9, NewsHost);
 	    StrAllocCopy(NewsHREF, command);
-	}
-	else if (!strncasecomp(arg, STR_SNEWS_URL, 6)) {
+	} else if (!strncasecomp(arg, STR_SNEWS_URL, 6)) {
 #ifdef USE_SSL
 	    if (((*(arg + 6) == '\0') ||
 		 (!strcmp((arg + 6), "/") ||
@@ -2322,8 +2334,7 @@ static int HTLoadNews (
 	    HTAlert(gettext("This client does not contain support for SNEWS URLs."));
 	    return HT_NOT_LOADED;
 #endif /* USE_SSL */
-	}
-	else if (!strncasecomp (arg, "news:/", 6)) {
+	} else if (!strncasecomp(arg, "news:/", 6)) {
 	    if (((*(arg + 6) == '\0') ||
 		 !strcmp((arg + 6), "/") ||
 		 !strcmp((arg + 6), "//")) ||
@@ -2354,7 +2365,7 @@ static int HTLoadNews (
 	    SnipIn(command, "news://%.*s/", 9, NewsHost);
 	    StrAllocCopy(NewsHREF, command);
 	} else {
-	    p1 = (arg + 5);  /* Skip "news:" prefix */
+	    p1 = (arg + 5);	/* Skip "news:" prefix */
 	    if (*p1 == '\0') {
 		p1 = "*";
 		group_wanted = FALSE;
@@ -2369,11 +2380,10 @@ static int HTLoadNews (
 	}
 
 	/*
-	**  Set up any proxy for snews URLs that returns NNTP
-	**  responses for Lynx to convert to HTML, instead of
-	**  doing the conversion itself, and for handling posts
-	**  or followups.  - TZ & FM
-	*/
+	 * Set up any proxy for snews URLs that returns NNTP responses for Lynx
+	 * to convert to HTML, instead of doing the conversion itself, and for
+	 * handling posts or followups.  - TZ & FM
+	 */
 	if (!strncasecomp(p1, STR_SNEWS_URL, 6) ||
 	    !strncasecomp(p1, "snewspost:", 10) ||
 	    !strncasecomp(p1, "snewsreply:", 11)) {
@@ -2384,20 +2394,20 @@ static int HTLoadNews (
 	    } else {
 		SnipIn2(command, "%s//%.*s", STR_SNEWS_URL, 10, NewsHost);
 	    }
-	    command[sizeof(command)-2] = '\0';
+	    command[sizeof(command) - 2] = '\0';
 	    FREE(cp);
 	    sprintf(proxycmd, "GET %.*s%c%c%c%c",
-		    (int) sizeof(proxycmd)-9, command,
+		    (int) sizeof(proxycmd) - 9, command,
 		    CR, LF, CR, LF);
 	    CTRACE((tfp, "HTNews: Proxy command is '%.*s'\n",
-			(int)(strlen(proxycmd) - 4), proxycmd));
+		    (int) (strlen(proxycmd) - 4), proxycmd));
 	    strcat(command, "/");
 	    StrAllocCopy(ProxyHREF, NewsHREF);
 	    StrAllocCopy(NewsHREF, command);
 	    if (spost_wanted || sreply_wanted) {
 		/*
-		**  Reset p1 so that it points to the newsgroup(s).
-		*/
+		 * Reset p1 so that it points to the newsgroup(s).
+		 */
 		if ((p1 = strrchr(arg, '/')) != NULL) {
 		    p1++;
 		} else {
@@ -2405,9 +2415,9 @@ static int HTLoadNews (
 		}
 	    } else {
 		/*
-		**  Reset p1 so that it points to the newsgroup
-		**  (or a wildcard), or the article.
-		*/
+		 * Reset p1 so that it points to the newsgroup (or a wildcard),
+		 * or the article.
+		 */
 		if (!(cp = strrchr((p1 + 6), '/')) || *(cp + 1) == '\0') {
 		    p1 = "*";
 		    group_wanted = FALSE;
@@ -2419,8 +2429,8 @@ static int HTLoadNews (
 	}
 
 	/*
-	**  Set up command for a post, listing, or article request. - FM
-	*/
+	 * Set up command for a post, listing, or article request.  - FM
+	 */
 	if (post_wanted || reply_wanted || spost_wanted || sreply_wanted) {
 	    strcpy(command, "POST");
 	} else if (list_wanted) {
@@ -2432,7 +2442,8 @@ static int HTLoadNews (
 	    }
 	    SnipIn(command, "XGTITLE %.*s", 11, p1);
 	} else if (group_wanted) {
-	    char * slash = strchr(p1, '/');
+	    char *slash = strchr(p1, '/');
+
 	    first = 0;
 	    last = 0;
 	    if (slash) {
@@ -2445,17 +2456,16 @@ static int HTLoadNews (
 		}
 		LYstrncpy(groupName, p1, sizeof(groupName) - 1);
 		*slash = '/';
-		(void)sscanf(slash+1, "%d-%d", &first, &last);
-		if ((first > 0) && (isdigit(UCH(*(slash+1)))) &&
-		    (strchr(slash+1, '-') == NULL || first == last)) {
+		(void) sscanf(slash + 1, "%d-%d", &first, &last);
+		if ((first > 0) && (isdigit(UCH(*(slash + 1)))) &&
+		    (strchr(slash + 1, '-') == NULL || first == last)) {
 		    /*
-		    **	We got a number greater than 0, which will be
-		    **	loaded as first, and either no range or the
-		    **	range computes to zero, so make last negative,
-		    **	as a flag to select the group and then fetch
-		    **	an article by number (first) instead of by
-		    **	messageID. - FM
-		    */
+		     * We got a number greater than 0, which will be loaded as
+		     * first, and either no range or the range computes to
+		     * zero, so make last negative, as a flag to select the
+		     * group and then fetch an article by number (first)
+		     * instead of by messageID.  - FM
+		     */
 		    last = -1;
 		}
 	    } else {
@@ -2469,8 +2479,9 @@ static int HTLoadNews (
 	    }
 	    SnipIn(command, "GROUP %.*s", 9, groupName);
 	} else {
-	    int add_open=(strchr(p1, '<') == 0);
-	    int add_close=(strchr(p1, '>') == 0);
+	    int add_open = (strchr(p1, '<') == 0);
+	    int add_close = (strchr(p1, '>') == 0);
+
 	    if (strlen(p1) + add_open + add_close >= 252) {
 		FREE(ProxyHost);
 		FREE(ProxyHREF);
@@ -2485,23 +2496,24 @@ static int HTLoadNews (
 	}
 
 	{
-	    char * p = command + strlen(command);
+	    char *p = command + strlen(command);
+
 	    /*
-	    **	Terminate command with CRLF, as in RFC 977.
-	    */
+	     * Terminate command with CRLF, as in RFC 977.
+	     */
 	    *p++ = CR;		/* Macros to be correct on Mac */
 	    *p++ = LF;
 	    *p++ = 0;
 	}
 	StrAllocCopy(ListArg, p1);
-    } /* scope of p1 */
+    }				/* scope of p1 */
 
     if (!*arg) {
 	FREE(NewsHREF);
 	FREE(ProxyHost);
 	FREE(ProxyHREF);
 	FREE(ListArg);
-	return NO;			/* Ignore if no name */
+	return NO;		/* Ignore if no name */
     }
 
     if (!(post_wanted || reply_wanted || spost_wanted || sreply_wanted ||
@@ -2510,7 +2522,7 @@ static int HTLoadNews (
 	if (head_wanted && !strncmp(command, "ARTICLE ", 8)) {
 	    /* overwrite "ARTICLE" - hack... */
 	    strcpy(command, "HEAD ");
-	    for (cp = command + 5; ; cp++)
+	    for (cp = command + 5;; cp++)
 		if ((*cp = *(cp + 3)) == '\0')
 		    break;
 	}
@@ -2528,13 +2540,13 @@ static int HTLoadNews (
 	    FREE(ProxyHREF);
 	    FREE(ListArg);
 	    HTAlert(gettext("No target for raw text!"));
-	    return(HT_NOT_LOADED);
-	}	/* Copy routine entry points */
+	    return (HT_NOT_LOADED);
+	}			/* Copy routine entry points */
 	rawtargetClass = *rawtarget->isa;
     } else
-    /*
-    **	Make a hypertext object with an anchor list.
-    */
+	/*
+	 * Make a hypertext object with an anchor list.
+	 */
     if (!(post_wanted || reply_wanted || spost_wanted || sreply_wanted)) {
 	node_anchor = anAnchor;
 	target = HTML_new(anAnchor, format_out, stream);
@@ -2542,18 +2554,19 @@ static int HTLoadNews (
     }
 
     /*
-    **	Now, let's get a stream setup up from the NewsHost.
-    */
+     * Now, let's get a stream setup up from the NewsHost.
+     */
     for (retries = 0; retries < 2; retries++) {
 	if (s < 0) {
 	    /* CONNECTING to news host */
 	    char url[260];
+
 	    if (!strcmp(NewsHREF, STR_NEWS_URL)) {
-		SnipIn (url, "lose://%.*s/", 9, NewsHost);
+		SnipIn(url, "lose://%.*s/", 9, NewsHost);
 	    } else if (ProxyHREF) {
-		SnipIn (url, "%.*s", 1, ProxyHREF);
+		SnipIn(url, "%.*s", 1, ProxyHREF);
 	    } else {
-		SnipIn (url, "%.*s", 1, NewsHREF);
+		SnipIn(url, "%.*s", 1, NewsHREF);
 	    }
 	    CTRACE((tfp, "News: doing HTDoConnect on '%s'\n", url));
 
@@ -2564,18 +2577,19 @@ static int HTLoadNews (
 		(!strncmp(arg, STR_SNEWS_URL, 6) ||
 		 !strncmp(arg, "snewspost:", 10) ||
 		 !strncmp(arg, "snewsreply:", 11)))
-		status = HTDoConnect (url, "NNTPS", SNEWS_PORT, &s);
+		status = HTDoConnect(url, "NNTPS", SNEWS_PORT, &s);
 	    else
-		status = HTDoConnect (url, "NNTP", NEWS_PORT, &s);
+		status = HTDoConnect(url, "NNTP", NEWS_PORT, &s);
 #else
-	    status = HTDoConnect (url, "NNTP", NEWS_PORT, &s);
+	    status = HTDoConnect(url, "NNTP", NEWS_PORT, &s);
 #endif /* USE_SSL */
 
 	    if (status == HT_INTERRUPTED) {
 		/*
-		**  Interrupt cleanly.
-		*/
-		CTRACE((tfp, "HTNews: Interrupted on connect; recovering cleanly.\n"));
+		 * Interrupt cleanly.
+		 */
+		CTRACE((tfp,
+			"HTNews: Interrupted on connect; recovering cleanly.\n"));
 		_HTProgress(CONNECTION_INTERRUPTED);
 		if (!(post_wanted || reply_wanted ||
 		      spost_wanted || sreply_wanted)) {
@@ -2621,12 +2635,11 @@ static int HTLoadNews (
 		return HTLoadError(stream, 500, dbuf);
 	    } else {
 		CTRACE((tfp, "HTNews: Connected to news host %s.\n",
-			    NewsHost));
+			NewsHost));
 #ifdef USE_SSL
 		/*
-		**  If this is an snews url,
-		**  then do the SSL stuff here
-		*/
+		 * If this is an snews url, then do the SSL stuff here
+		 */
 		if (!using_proxy &&
 		    (!strncmp(url, "snews", 5) ||
 		     !strncmp(url, "snewspost:", 10) ||
@@ -2638,18 +2651,21 @@ static int HTLoadNews (
 
 		    if (status <= 0) {
 			unsigned long SSLerror;
-			CTRACE((tfp,"HTNews: Unable to complete SSL handshake for '%s', SSL_connect=%d, SSL error stack dump follows\n",url, status));
+
+			CTRACE((tfp,
+				"HTNews: Unable to complete SSL handshake for '%s', SSL_connect=%d, SSL error stack dump follows\n",
+				url, status));
 			SSL_load_error_strings();
-			while((SSLerror = ERR_get_error()) != 0) {
-			    CTRACE((tfp,"HTNews: SSL: %s\n",ERR_error_string(SSLerror,NULL)));
+			while ((SSLerror = ERR_get_error()) != 0) {
+			    CTRACE((tfp, "HTNews: SSL: %s\n",
+				    ERR_error_string(SSLerror, NULL)));
 			}
-			HTAlert(
-			    "Unable to make secure connection to remote host.");
+			HTAlert("Unable to make secure connection to remote host.");
 			NEWS_NETCLOSE(s);
 			s = -1;
 			if (!(post_wanted || reply_wanted ||
 			      spost_wanted || sreply_wanted))
-			    (*targetClass._abort)(target, NULL);
+			    (*targetClass._abort) (target, NULL);
 			FREE(NewsHost);
 			FREE(NewsHREF);
 			FREE(ProxyHost);
@@ -2657,8 +2673,7 @@ static int HTLoadNews (
 			FREE(ListArg);
 			if (postfile) {
 #ifdef VMS
-			    while (remove(postfile) == 0)
-			    ; /* loop through all versions */
+			    while (remove(postfile) == 0) ;	/* loop through all versions */
 #else
 			    remove(postfile);
 #endif /* VMS */
@@ -2666,56 +2681,61 @@ static int HTLoadNews (
 			}
 			return HT_NOT_LOADED;
 		    }
-		    sprintf(SSLprogress,"Secure %d-bit %s (%s) NNTP connection",SSL_get_cipher_bits(Handle,NULL),SSL_get_cipher_version(Handle),SSL_get_cipher(Handle));
+		    sprintf(SSLprogress,
+			    "Secure %d-bit %s (%s) NNTP connection",
+			    SSL_get_cipher_bits(Handle, NULL),
+			    SSL_get_cipher_version(Handle),
+			    SSL_get_cipher(Handle));
 		    _HTProgress(SSLprogress);
 		}
 #endif /* USE_SSL */
-		HTInitInput(s);		/* set up buffering */
+		HTInitInput(s);	/* set up buffering */
 		if (proxycmd[0]) {
 		    status = NEWS_NETWRITE(s, proxycmd, strlen(proxycmd));
-		    CTRACE((tfp, "HTNews: Proxy command returned status '%d'.\n",
-				status));
+		    CTRACE((tfp,
+			    "HTNews: Proxy command returned status '%d'.\n",
+			    status));
 		}
 		if (((status = response(NULL)) / 100) != 2) {
-			NEWS_NETCLOSE(s);
-			s = -1;
-			if (status == HT_INTERRUPTED) {
-			    _HTProgress(CONNECTION_INTERRUPTED);
-			    if (!(post_wanted || reply_wanted ||
-				  spost_wanted || sreply_wanted)) {
-				ABORT_TARGET;
-			    }
-			    FREE(NewsHost);
-			    FREE(NewsHREF);
-			    FREE(ProxyHost);
-			    FREE(ProxyHREF);
-			    FREE(ListArg);
-			    if (postfile) {
-				HTSYS_remove(postfile);
-				FREE(postfile);
-			    }
-			    return(HT_NOT_LOADED);
-			}
-			if (retries < 1)
-			    continue;
-			FREE(ProxyHost);
-			FREE(ProxyHREF);
-			FREE(ListArg);
-			FREE(postfile);
+		    NEWS_NETCLOSE(s);
+		    s = -1;
+		    if (status == HT_INTERRUPTED) {
+			_HTProgress(CONNECTION_INTERRUPTED);
 			if (!(post_wanted || reply_wanted ||
 			      spost_wanted || sreply_wanted)) {
 			    ABORT_TARGET;
 			}
-			if (response_text[0]) {
-			    HTSprintf0(&dbuf,
-				gettext("Can't read news info.  News host %.20s responded: %.200s"),
-				NewsHost, response_text);
-			} else {
-			    HTSprintf0(&dbuf,
-				gettext("Can't read news info, empty response from host %s"),
-				NewsHost);
+			FREE(NewsHost);
+			FREE(NewsHREF);
+			FREE(ProxyHost);
+			FREE(ProxyHREF);
+			FREE(ListArg);
+			if (postfile) {
+			    HTSYS_remove(postfile);
+			    FREE(postfile);
 			}
-			return HTLoadError(stream, 500, dbuf);
+			return (HT_NOT_LOADED);
+		    }
+		    if (retries < 1)
+			continue;
+		    FREE(ProxyHost);
+		    FREE(ProxyHREF);
+		    FREE(ListArg);
+		    FREE(postfile);
+		    if (!(post_wanted || reply_wanted ||
+			  spost_wanted || sreply_wanted)) {
+			ABORT_TARGET;
+		    }
+		    if (response_text[0]) {
+			HTSprintf0(&dbuf,
+				   gettext("Can't read news info.  News host %.20s responded: %.200s"),
+				   NewsHost, response_text);
+		    } else {
+			HTSprintf0(&dbuf,
+				   gettext("Can't read news info, empty response from host %s"),
+				   NewsHost);
+		    }
+		    return HTLoadError(stream, 500, dbuf);
 		}
 		if (status == 200) {
 		    HTCanPost = TRUE;
@@ -2735,14 +2755,14 @@ static int HTLoadNews (
 			    HTSYS_remove(postfile);
 			    FREE(postfile);
 			}
-			return(HT_NOT_LOADED);
+			return (HT_NOT_LOADED);
 		    }
 		}
 	    }
-	} /* If needed opening */
-
+	}
+	/* If needed opening */
 	if (post_wanted || reply_wanted ||
-	     spost_wanted || sreply_wanted) {
+	    spost_wanted || sreply_wanted) {
 	    if (!HTCanPost) {
 		HTAlert(CANNOT_POST);
 		FREE(NewsHREF);
@@ -2756,11 +2776,11 @@ static int HTLoadNews (
 		    HTSYS_remove(postfile);
 		    FREE(postfile);
 		}
-		return(HT_NOT_LOADED);
+		return (HT_NOT_LOADED);
 	    }
 	    if (postfile == NULL) {
 		postfile = LYNewsPost(ListArg,
-				(BOOLEAN)(reply_wanted || sreply_wanted));
+				      (BOOLEAN) (reply_wanted || sreply_wanted));
 	    }
 	    if (postfile == NULL) {
 		HTProgress(CANCELLED);
@@ -2771,16 +2791,16 @@ static int HTLoadNews (
 		    FREE(ProxyHREF);
 		}
 		FREE(ListArg);
-		return(HT_NOT_LOADED);
+		return (HT_NOT_LOADED);
 	    }
 	} else {
 	    /*
-	    **	Ensure reader mode, but don't bother checking the
-	    **	status for anything but HT_INTERRUPTED or a 480
-	    **	Authorization request, because if the reader mode
-	    **	command is not needed, the server probably returned
-	    **	a 500, which is irrelevant at this point. - FM
-	    */
+	     * Ensure reader mode, but don't bother checking the status for
+	     * anything but HT_INTERRUPTED or a 480 Authorization request,
+	     * because if the reader mode command is not needed, the server
+	     * probably returned a 500, which is irrelevant at this point.  -
+	     * FM
+	     */
 	    char buffer[20];
 
 	    sprintf(buffer, "mode reader%c%c", CR, LF);
@@ -2790,6 +2810,7 @@ static int HTLoadNews (
 	    }
 	    if (status == 480) {
 		NNTPAuthResult auth_result = HTHandleAuthInfo(NewsHost);
+
 		if (auth_result == NNTPAUTH_CLOSE) {
 		    if (s != -1 && !(ProxyHost || ProxyHREF)) {
 			NEWS_NETCLOSE(s);
@@ -2806,7 +2827,7 @@ static int HTLoadNews (
 	    }
 	}
 
-Send_NNTP_command:
+      Send_NNTP_command:
 #ifdef NEWS_DEB
 	if (postfile)
 	    printf("postfile = %s, command = %s", postfile, command);
@@ -2825,13 +2846,12 @@ Send_NNTP_command:
 	    }
 	}
 	/*
-	 *  For some well known error responses which are expected
-	 *  to occur in normal use, break from the loop without retrying
-	 *  and without closing the connection.  It is unlikely that
-	 *  these are leftovers from a timed-out connection (but we do
-	 *  some checks to see whether the response corresponds to the
-	 *  last command), or that they will give anything else when
-	 *  automatically retried.  - kw
+	 * For some well known error responses which are expected to occur in
+	 * normal use, break from the loop without retrying and without closing
+	 * the connection.  It is unlikely that these are leftovers from a
+	 * timed-out connection (but we do some checks to see whether the
+	 * response corresponds to the last command), or that they will give
+	 * anything else when automatically retried.  - kw
 	 */
 	if (status == 411 && group_wanted &&
 	    !strncmp(command, "GROUP ", 6) &&
@@ -2841,13 +2861,13 @@ Send_NNTP_command:
 	    HTAlert(response_text);
 	    break;
 	} else if (status == 430 && !group_wanted && !list_wanted &&
-	    !strncmp(command, "ARTICLE <", 9) &&
-	    !strcasecomp(response_text + 3, " No such article")) {
+		   !strncmp(command, "ARTICLE <", 9) &&
+		   !strcasecomp(response_text + 3, " No such article")) {
 
 	    HTAlert(response_text);
 	    break;
 	}
-	if ((status/100) != 2 &&
+	if ((status / 100) != 2 &&
 	    status != 340 &&
 	    status != 480) {
 	    if (retries) {
@@ -2862,20 +2882,20 @@ Send_NNTP_command:
 	    NEWS_NETCLOSE(s);
 	    s = -1;
 	    /*
-	    **	Message might be a leftover "Timeout-disconnected",
-	    **	so try again if the retries maximum has not been
-	    **	reached.
-	    */
+	     * Message might be a leftover "Timeout-disconnected", so try again
+	     * if the retries maximum has not been reached.
+	     */
 	    continue;
 	}
 
 	/*
-	**  Post or load a group, article, etc
-	*/
+	 * Post or load a group, article, etc
+	 */
 	if (status == 480) {
 	    NNTPAuthResult auth_result;
+
 	    /*
-	     *	Some servers return 480 for a failed XGTITLE. - FM
+	     * Some servers return 480 for a failed XGTITLE.  - FM
 	     */
 	    if (list_wanted && !strncmp(command, "XGTITLE", 7) &&
 		strstr(response_text, "uthenticat") == NULL &&
@@ -2884,8 +2904,8 @@ Send_NNTP_command:
 		goto Send_NNTP_command;
 	    }
 	    /*
-	    **	Handle Authorization. - FM
-	    */
+	     * Handle Authorization.  - FM
+	     */
 	    if ((auth_result = HTHandleAuthInfo(NewsHost)) == NNTPAUTH_OK) {
 		goto Send_NNTP_command;
 	    } else if (auth_result == NNTPAUTH_CLOSE) {
@@ -2900,8 +2920,8 @@ Send_NNTP_command:
 	} else if (post_wanted || reply_wanted ||
 		   spost_wanted || sreply_wanted) {
 	    /*
-	    **	Handle posting of an article. - FM
-	    */
+	     * Handle posting of an article.  - FM
+	     */
 	    if (status != 340) {
 		HTAlert(CANNOT_POST);
 		if (postfile) {
@@ -2914,23 +2934,22 @@ Send_NNTP_command:
 	    status = HT_NOT_LOADED;
 	} else if (list_wanted) {
 	    /*
-	    **	List available newsgroups. - FM
-	    */
+	     * List available newsgroups.  - FM
+	     */
 	    _HTProgress(gettext("Reading list of available newsgroups."));
 	    status = read_list(ListArg);
 	} else if (group_wanted) {
 	    /*
-	    **	List articles in a news group. - FM
-	    */
+	     * List articles in a news group.  - FM
+	     */
 	    if (last < 0) {
 		/*
-		**  We got one article number rather than a range
-		**  following the slash which followed the group
-		**  name, or the range was zero, so now that we
-		**  have selected that group, load ARTICLE and the
-		**  the number (first) as the command and go back
-		**  to send it and check the response. - FM
-		*/
+		 * We got one article number rather than a range following the
+		 * slash which followed the group name, or the range was zero,
+		 * so now that we have selected that group, load ARTICLE and
+		 * the the number (first) as the command and go back to send it
+		 * and check the response.  - FM
+		 */
 		sprintf(command, "%s %d%c%c",
 			head_wanted ? "HEAD" : "ARTICLE",
 			first, CR, LF);
@@ -2942,8 +2961,8 @@ Send_NNTP_command:
 	    status = read_group(groupName, first, last);
 	} else {
 	    /*
-	    **	Get an article from a news group. - FM
-	    */
+	     * Get an article from a news group.  - FM
+	     */
 	    _HTProgress(gettext("Reading news article."));
 	    status = read_article(anAnchor);
 	}
@@ -2971,11 +2990,11 @@ Send_NNTP_command:
 	    FREE(postfile);
 	}
 	return status;
-    } /* Retry loop */
+    }				/* Retry loop */
 
 #if 0
     HTAlert(gettext("Sorry, could not load requested news."));
-    NXRunAlertPanel(NULL, "Sorry, could not load `%s'.", NULL,NULL,NULL, arg);
+    NXRunAlertPanel(NULL, "Sorry, could not load `%s'.", NULL, NULL, NULL, arg);
     /* No -- message earlier wil have covered it */
 #endif
 
@@ -2998,46 +3017,44 @@ Send_NNTP_command:
 }
 
 /*
-**  This function clears all authorization information by
-**  invoking the free_NNTP_AuthInfo() function, which normally
-**  is invoked at exit.  It allows a browser command to do
-**  this at any time, for example, if the user is leaving
-**  the terminal for a period of time, but does not want
-**  to end the current session.  - FM
-*/
-void HTClearNNTPAuthInfo (void)
+ *  This function clears all authorization information by
+ *  invoking the free_NNTP_AuthInfo() function, which normally
+ *  is invoked at exit.  It allows a browser command to do
+ *  this at any time, for example, if the user is leaving
+ *  the terminal for a period of time, but does not want
+ *  to end the current session.  - FM
+ */
+void HTClearNNTPAuthInfo(void)
 {
     /*
-    **	Need code to check cached documents and do
-    **	something to ensure that any protected
-    **	documents no longer can be accessed without
-    **	a new retrieval. - FM
-    */
+     * Need code to check cached documents and do something to ensure that any
+     * protected documents no longer can be accessed without a new retrieval. 
+     * - FM
+     */
 
     /*
-    **	Now free all of the authorization info. - FM
-    */
+     * Now free all of the authorization info.  - FM
+     */
     free_NNTP_AuthInfo();
 }
 
 #ifdef USE_SSL
-static char HTNewsGetCharacter (void)
+static char HTNewsGetCharacter(void)
 {
     if (!Handle)
 	return HTGetCharacter();
     else
-	return HTGetSSLCharacter((void *)Handle);
+	return HTGetSSLCharacter((void *) Handle);
 }
 
-int HTNewsProxyConnect (
-    int		sock,
-    const char *	url,
-    HTParentAnchor *	anAnchor,
-    HTFormat		format_out,
-    HTStream *		sink)
+int HTNewsProxyConnect(int sock,
+		       const char *url,
+		       HTParentAnchor *anAnchor,
+		       HTFormat format_out,
+		       HTStream *sink)
 {
     int status;
-    const char * arg = url;
+    const char *arg = url;
     char SSLprogress[256];
 
     s = channel_s = sock;
@@ -3048,19 +3065,22 @@ int HTNewsProxyConnect (
 
     if (status <= 0) {
 	unsigned long SSLerror;
+
 	channel_s = -1;
-	CTRACE((tfp,"HTNews: Unable to complete SSL handshake for '%s', SSL_connect=%d, SSL error stack dump follows\n",url, status));
+	CTRACE((tfp,
+		"HTNews: Unable to complete SSL handshake for '%s', SSL_connect=%d, SSL error stack dump follows\n",
+		url, status));
 	SSL_load_error_strings();
-	while((SSLerror = ERR_get_error()) != 0) {
-	    CTRACE((tfp,"HTNews: SSL: %s\n",ERR_error_string(SSLerror,NULL)));
+	while ((SSLerror = ERR_get_error()) != 0) {
+	    CTRACE((tfp, "HTNews: SSL: %s\n", ERR_error_string(SSLerror, NULL)));
 	}
 	HTAlert("Unable to make secure connection to remote host.");
 	NEWS_NETCLOSE(s);
 	s = -1;
 	return HT_NOT_LOADED;
     }
-    sprintf(SSLprogress,"Secure %d-bit %s (%s) NNTP connection",
-	    SSL_get_cipher_bits(Handle,NULL),
+    sprintf(SSLprogress, "Secure %d-bit %s (%s) NNTP connection",
+	    SSL_get_cipher_bits(Handle, NULL),
 	    SSL_get_cipher_version(Handle),
 	    SSL_get_cipher(Handle));
     _HTProgress(SSLprogress);
@@ -3072,27 +3092,34 @@ int HTNewsProxyConnect (
 
 #ifdef GLOBALDEF_IS_MACRO
 #define _HTNEWS_C_1_INIT { "news", HTLoadNews, NULL }
-GLOBALDEF (HTProtocol,HTNews,_HTNEWS_C_1_INIT);
+GLOBALDEF(HTProtocol, HTNews, _HTNEWS_C_1_INIT);
 #define _HTNEWS_C_2_INIT { "nntp", HTLoadNews, NULL }
-GLOBALDEF (HTProtocol,HTNNTP,_HTNEWS_C_2_INIT);
+GLOBALDEF(HTProtocol, HTNNTP, _HTNEWS_C_2_INIT);
 #define _HTNEWS_C_3_INIT { "newspost", HTLoadNews, NULL }
-GLOBALDEF (HTProtocol,HTNewsPost,_HTNEWS_C_3_INIT);
+GLOBALDEF(HTProtocol, HTNewsPost, _HTNEWS_C_3_INIT);
 #define _HTNEWS_C_4_INIT { "newsreply", HTLoadNews, NULL }
-GLOBALDEF (HTProtocol,HTNewsReply,_HTNEWS_C_4_INIT);
+GLOBALDEF(HTProtocol, HTNewsReply, _HTNEWS_C_4_INIT);
 #define _HTNEWS_C_5_INIT { "snews", HTLoadNews, NULL }
-GLOBALDEF (HTProtocol,HTSNews,_HTNEWS_C_5_INIT);
+GLOBALDEF(HTProtocol, HTSNews, _HTNEWS_C_5_INIT);
 #define _HTNEWS_C_6_INIT { "snewspost", HTLoadNews, NULL }
-GLOBALDEF (HTProtocol,HTSNewsPost,_HTNEWS_C_6_INIT);
+GLOBALDEF(HTProtocol, HTSNewsPost, _HTNEWS_C_6_INIT);
 #define _HTNEWS_C_7_INIT { "snewsreply", HTLoadNews, NULL }
-GLOBALDEF (HTProtocol,HTSNewsReply,_HTNEWS_C_7_INIT);
+GLOBALDEF(HTProtocol, HTSNewsReply, _HTNEWS_C_7_INIT);
 #else
-GLOBALDEF HTProtocol HTNews = { "news", HTLoadNews, NULL };
-GLOBALDEF HTProtocol HTNNTP = { "nntp", HTLoadNews, NULL };
-GLOBALDEF HTProtocol HTNewsPost = { "newspost", HTLoadNews, NULL };
-GLOBALDEF HTProtocol HTNewsReply = { "newsreply", HTLoadNews, NULL };
-GLOBALDEF HTProtocol HTSNews = { "snews", HTLoadNews, NULL };
-GLOBALDEF HTProtocol HTSNewsPost = { "snewspost", HTLoadNews, NULL };
-GLOBALDEF HTProtocol HTSNewsReply = { "snewsreply", HTLoadNews, NULL };
+GLOBALDEF HTProtocol HTNews =
+{"news", HTLoadNews, NULL};
+GLOBALDEF HTProtocol HTNNTP =
+{"nntp", HTLoadNews, NULL};
+GLOBALDEF HTProtocol HTNewsPost =
+{"newspost", HTLoadNews, NULL};
+GLOBALDEF HTProtocol HTNewsReply =
+{"newsreply", HTLoadNews, NULL};
+GLOBALDEF HTProtocol HTSNews =
+{"snews", HTLoadNews, NULL};
+GLOBALDEF HTProtocol HTSNewsPost =
+{"snewspost", HTLoadNews, NULL};
+GLOBALDEF HTProtocol HTSNewsReply =
+{"snewsreply", HTLoadNews, NULL};
 #endif /* GLOBALDEF_IS_MACRO */
 
 #endif /* not DISABLE_NEWS */
diff --git a/WWW/Library/Implementation/HTNews.h b/WWW/Library/Implementation/HTNews.h
index b1efb4c0..798f211f 100644
--- a/WWW/Library/Implementation/HTNews.h
+++ b/WWW/Library/Implementation/HTNews.h
@@ -3,9 +3,9 @@
                                              
  */
 /* History:
-**      26 Sep 90       Written TBL in Objective-C
-**      29 Nov 91       Downgraded to C, for portable implementation.
-*/
+ *      26 Sep 90       Written TBL in Objective-C
+ *      29 Nov 91       Downgraded to C, for portable implementation.
+ */
 
 #ifndef HTNEWS_H
 #define HTNEWS_H
@@ -17,13 +17,14 @@ extern int HTNewsChunkSize;
 extern int HTNewsMaxChunk;
 
 #ifdef GLOBALREF_IS_MACRO
-extern GLOBALREF(HTProtocol, HTNews);
-extern GLOBALREF(HTProtocol, HTNNTP);
-extern GLOBALREF(HTProtocol, HTNewsPost);
-extern GLOBALREF(HTProtocol, HTNewsReply);
-extern GLOBALREF(HTProtocol, HTSNews);
-extern GLOBALREF(HTProtocol, HTSNewsPost);
-extern GLOBALREF(HTProtocol, HTSNewsReply);
+extern GLOBALREF (HTProtocol, HTNews);
+extern GLOBALREF (HTProtocol, HTNNTP);
+extern GLOBALREF (HTProtocol, HTNewsPost);
+extern GLOBALREF (HTProtocol, HTNewsReply);
+extern GLOBALREF (HTProtocol, HTSNews);
+extern GLOBALREF (HTProtocol, HTSNewsPost);
+extern GLOBALREF (HTProtocol, HTSNewsReply);
+
 #else
 GLOBALREF HTProtocol HTNews;
 GLOBALREF HTProtocol HTNNTP;
@@ -34,20 +35,18 @@ GLOBALREF HTProtocol HTSNewsPost;
 GLOBALREF HTProtocol HTSNewsReply;
 #endif /* GLOBALREF_IS_MACRO */
 
-extern void HTSetNewsHost (
-	const char *	value);
-extern const char * HTGetNewsHost (void);
-extern char * HTNewsHost;
+extern void HTSetNewsHost(const char *value);
+extern const char *HTGetNewsHost(void);
+extern char *HTNewsHost;
 
-extern void HTClearNNTPAuthInfo (void);
+extern void HTClearNNTPAuthInfo(void);
 
 #ifdef USE_SSL
-extern int HTNewsProxyConnect (
-	int		sock,
-	const char *	url,
-	HTParentAnchor *anAnchor,
-	HTFormat	format_out,
-	HTStream *	sink);
+extern int HTNewsProxyConnect(int sock,
+			      const char *url,
+			      HTParentAnchor *anAnchor,
+			      HTFormat format_out,
+			      HTStream *sink);
 #endif
 
 #endif /* HTNEWS_H */
diff --git a/WWW/Library/Implementation/HTParse.c b/WWW/Library/Implementation/HTParse.c
index 3bf69b13..e894b55c 100644
--- a/WWW/Library/Implementation/HTParse.c
+++ b/WWW/Library/Implementation/HTParse.c
@@ -1,6 +1,6 @@
 /*		Parse HyperText Document Address		HTParse.c
-**		================================
-*/
+ *		================================
+ */
 
 #include <HTUtils.h>
 #include <HTParse.h>
@@ -21,29 +21,27 @@
 #define HEX_ESCAPE '%'
 
 struct struct_parts {
-	char * access;
-	char * host;
-	char * absolute;
-	char * relative;
-	char * search;		/* treated normally as part of path */
-	char * anchor;
+    char *access;
+    char *host;
+    char *absolute;
+    char *relative;
+    char *search;		/* treated normally as part of path */
+    char *anchor;
 };
 
-
 /*	Strip white space off a string.				HTStrip()
-**	-------------------------------
-**
-** On exit,
-**	Return value points to first non-white character, or to 0 if none.
-**	All trailing white space is OVERWRITTEN with zero.
-*/
-char * HTStrip (
-	char *		s)
+ *	-------------------------------
+ *
+ * On exit,
+ *	Return value points to first non-white character, or to 0 if none.
+ *	All trailing white space is OVERWRITTEN with zero.
+ */
+char *HTStrip(char *s)
 {
 #define SPACE(c) ((c == ' ') || (c == '\t') || (c == '\n'))
-    char * p = s;
-    for (p = s; *p; p++)
-	;			/* Find end of string */
+    char *p = s;
+
+    for (p = s; *p; p++) ;	/* Find end of string */
     for (p--; p >= s; p--) {
 	if (SPACE(*p))
 	    *p = '\0';		/* Zap trailing blanks */
@@ -56,21 +54,20 @@ char * HTStrip (
 }
 
 /*	Scan a filename for its constituents.			scan()
-**	-------------------------------------
-**
-** On entry,
-**	name	points to a document name which may be incomplete.
-** On exit,
-**	absolute or relative may be nonzero (but not both).
-**	host, anchor and access may be nonzero if they were specified.
-**	Any which are nonzero point to zero terminated strings.
-*/
-static void scan (
-	char *			name,
-	struct struct_parts *	parts)
+ *	-------------------------------------
+ *
+ * On entry,
+ *	name	points to a document name which may be incomplete.
+ * On exit,
+ *	absolute or relative may be nonzero (but not both).
+ *	host, anchor and access may be nonzero if they were specified.
+ *	Any which are nonzero point to zero terminated strings.
+ */
+static void scan(char *name,
+		 struct struct_parts *parts)
 {
-    char * after_access;
-    char * p;
+    char *after_access;
+    char *p;
 
     parts->access = NULL;
     parts->host = NULL;
@@ -80,11 +77,11 @@ static void scan (
     parts->anchor = NULL;
 
     /*
-    **	Scan left-to-right for a scheme (access).
-    */
+     * Scan left-to-right for a scheme (access).
+     */
     after_access = name;
     for (p = name; *p; p++) {
-	if (*p==':') {
+	if (*p == ':') {
 	    *p = '\0';
 	    parts->access = name;	/* Access name has been specified */
 	    after_access = (p + 1);
@@ -95,58 +92,58 @@ static void scan (
     }
 
     /*
-    **	Scan left-to-right for a fragment (anchor).
-    */
+     * Scan left-to-right for a fragment (anchor).
+     */
     for (p = after_access; *p; p++) {
-	if (*p =='#') {
+	if (*p == '#') {
 	    parts->anchor = (p + 1);
-	    *p = '\0';			/* terminate the rest */
+	    *p = '\0';		/* terminate the rest */
 	    break;		/* leave things after first # alone - kw */
 	}
     }
 
     /*
-    **	Scan left-to-right for a host or absolute path.
-    */
+     * Scan left-to-right for a host or absolute path.
+     */
     p = after_access;
     if (*p == '/') {
 	if (p[1] == '/') {
-	    parts->host = (p + 2);	  /* host has been specified	*/
-	    *p = '\0';			  /* Terminate access		*/
-	    p = strchr(parts->host, '/'); /* look for end of host name if any */
+	    parts->host = (p + 2);	/* host has been specified    */
+	    *p = '\0';		/* Terminate access           */
+	    p = strchr(parts->host, '/');	/* look for end of host name if any */
 	    if (p != NULL) {
-		*p = '\0';			/* Terminate host */
+		*p = '\0';	/* Terminate host */
 		parts->absolute = (p + 1);	/* Root has been found */
 	    } else {
 		p = strchr(parts->host, '?');
 		if (p != NULL) {
-		    *p = '\0';			/* Terminate host */
+		    *p = '\0';	/* Terminate host */
 		    parts->search = (p + 1);
 		}
 	    }
 	} else {
-	    parts->absolute = (p + 1);		/* Root found but no host */
+	    parts->absolute = (p + 1);	/* Root found but no host */
 	}
     } else {
 	parts->relative = (*after_access) ?
-			     after_access : NULL; /* NULL for "" */
+	    after_access : NULL;	/* NULL for "" */
     }
 
     /*
-    **	Check schemes that commonly have unescaped hashes.
-    */
+     * Check schemes that commonly have unescaped hashes.
+     */
     if (parts->access && parts->anchor &&
-		/* optimize */ strchr("lnsdLNSD", *parts->access) != NULL) {
+    /* optimize */ strchr("lnsdLNSD", *parts->access) != NULL) {
 	if ((!parts->host && strcasecomp(parts->access, "lynxcgi")) ||
 	    !strcasecomp(parts->access, "nntp") ||
 	    !strcasecomp(parts->access, "snews") ||
 	    !strcasecomp(parts->access, "news") ||
 	    !strcasecomp(parts->access, "data")) {
 	    /*
-	     *	Access specified but no host and not a lynxcgi URL, so the
-	     *	anchor may not really be one, e.g., news:j462#36487@foo.bar,
-	     *	or it's an nntp or snews URL, or news URL with a host.
-	     *	Restore the '#' in the address.
+	     * Access specified but no host and not a lynxcgi URL, so the
+	     * anchor may not really be one, e.g., news:j462#36487@foo.bar, or
+	     * it's an nntp or snews URL, or news URL with a host.  Restore the
+	     * '#' in the address.
 	     */
 	    /* but only if we have found a path component of which this will
 	     * become part. - kw  */
@@ -156,7 +153,7 @@ static void scan (
 	    }
 	}
     }
-} /*scan */
+}				/*scan */
 
 #if defined(HAVE_ALLOCA) && !defined(LY_FIND_LEAKS)
 #define LYalloca(x)        alloca(x)
@@ -167,44 +164,44 @@ static void scan (
 #endif
 
 /*	Parse a Name relative to another name.			HTParse()
-**	--------------------------------------
-**
-**	This returns those parts of a name which are given (and requested)
-**	substituting bits from the related name where necessary.
-**
-** On entry,
-**	aName		A filename given
-**	relatedName	A name relative to which aName is to be parsed
-**	wanted		A mask for the bits which are wanted.
-**
-** On exit,
-**     returns         A pointer to a malloc'd string which MUST BE FREED
-*/
-char * HTParse (
-	const char *	aName,
-	const char *	relatedName,
-	int		wanted)
+ *	--------------------------------------
+ *
+ *	This returns those parts of a name which are given (and requested)
+ *	substituting bits from the related name where necessary.
+ *
+ * On entry,
+ *	aName		A filename given
+ *	relatedName	A name relative to which aName is to be parsed
+ *	wanted		A mask for the bits which are wanted.
+ *
+ * On exit,
+ *     returns         A pointer to a malloc'd string which MUST BE FREED
+ */
+char *HTParse(const char *aName,
+	      const char *relatedName,
+	      int wanted)
 {
-    char * result = NULL;
-    char * tail = NULL;  /* a pointer to the end of the 'result' string */
-    char * return_value = NULL;
+    char *result = NULL;
+    char *tail = NULL;		/* a pointer to the end of the 'result' string */
+    char *return_value = NULL;
     int len, len1, len2;
-    char * name = NULL;
-    char * rel = NULL;
-    char * p;
-    char * acc_method;
+    char *name = NULL;
+    char *rel = NULL;
+    char *p;
+    char *acc_method;
     struct struct_parts given, related;
 
     CTRACE((tfp, "HTParse: aName:`%s'\n", aName));
     CTRACE((tfp, "   relatedName:`%s'\n", relatedName));
 
-    if (wanted & (PARSE_STRICTPATH | PARSE_QUERY)) { /* if detail wanted... */
+    if (wanted & (PARSE_STRICTPATH | PARSE_QUERY)) {	/* if detail wanted... */
 	if ((wanted & (PARSE_STRICTPATH | PARSE_QUERY))
-	    == (PARSE_STRICTPATH | PARSE_QUERY)) /* if strictpath AND query */
-	    wanted |= PARSE_PATH; /* then treat as if PARSE_PATH wanted */
-	if (wanted & PARSE_PATH) /* if PARSE_PATH wanted */
-	    wanted &= ~(PARSE_STRICTPATH | PARSE_QUERY); /* ignore details */
+	    == (PARSE_STRICTPATH | PARSE_QUERY))	/* if strictpath AND query */
+	    wanted |= PARSE_PATH;	/* then treat as if PARSE_PATH wanted */
+	if (wanted & PARSE_PATH)	/* if PARSE_PATH wanted */
+	    wanted &= ~(PARSE_STRICTPATH | PARSE_QUERY);	/* ignore details */
     }
+/* *INDENT-OFF* */
     CTRACE((tfp, "   want:%s%s%s%s%s%s%s\n",
 	    wanted & PARSE_PUNCTUATION ? " punc"   : "",
 	    wanted & PARSE_ANCHOR      ? " anchor" : "",
@@ -213,15 +210,16 @@ char * HTParse (
 	    wanted & PARSE_ACCESS      ? " access" : "",
 	    wanted & PARSE_STRICTPATH  ? " PATH"   : "",
 	    wanted & PARSE_QUERY       ? " QUERY"  : ""));
+/* *INDENT-ON* */
 
     /*
-    ** Allocate the temporary string. Optimized.
-    */
+     * Allocate the temporary string. Optimized.
+     */
     len1 = strlen(aName) + 1;
     len2 = strlen(relatedName) + 1;
-    len = len1 + len2 + 8;     /* Lots of space: more than enough */
+    len = len1 + len2 + 8;	/* Lots of space: more than enough */
 
-    result = tail = (char*)LYalloca(len * 2 + len1 + len2);
+    result = tail = (char *) LYalloca(len * 2 + len1 + len2);
     if (result == NULL) {
 	outofmem(__FILE__, "HTParse");
     }
@@ -230,22 +228,22 @@ char * HTParse (
     rel = name + len1;
 
     /*
-    **	Make working copy of the input string to cut up.
-    */
+     * Make working copy of the input string to cut up.
+     */
     memcpy(name, aName, len1);
 
     /*
-    **	Cut up the string into URL fields.
-    */
+     * Cut up the string into URL fields.
+     */
     scan(name, &given);
 
     /*
-    **	Now related string.
-    */
+     * Now related string.
+     */
     if ((given.access && given.host && given.absolute) || !*relatedName) {
 	/*
-	**  Inherit nothing!
-	*/
+	 * Inherit nothing!
+	 */
 	related.access = NULL;
 	related.host = NULL;
 	related.absolute = NULL;
@@ -254,20 +252,19 @@ char * HTParse (
 	related.anchor = NULL;
     } else {
 	memcpy(rel, relatedName, len2);
-	scan(rel,  &related);
+	scan(rel, &related);
     }
 
-
     /*
-    **	Handle the scheme (access) field.
-    */
+     * Handle the scheme (access) field.
+     */
     if (given.access && given.host && !given.relative && !given.absolute) {
 	if (!strcmp(given.access, "http") ||
 	    !strcmp(given.access, "https") ||
 	    !strcmp(given.access, "ftp"))
 	    /*
-	    **	Assume root.
-	    */
+	     * Assume root.
+	     */
 	    given.absolute = "";
     }
     acc_method = given.access ? given.access : related.access;
@@ -283,24 +280,20 @@ char * HTParse (
     }
 
     /*
-    **	If different schemes, inherit nothing.
-    **
-    **	We'll try complying with RFC 1808 and
-    **	the Fielding draft, and inherit nothing
-    **	if both schemes are given, rather than
-    **	only when they differ, except for
-    **	file URLs - FM
-    **
-    **	After trying it for a while, it's still
-    **	premature, IHMO, to go along with it, so
-    **	this is back to inheriting for identical
-    **	schemes whether or not they are "file".
-    **	If you want to try it again yourself,
-    **	uncomment the strcasecomp() below. - FM
-    */
+     * If different schemes, inherit nothing.
+     *
+     * We'll try complying with RFC 1808 and the Fielding draft, and inherit
+     * nothing if both schemes are given, rather than only when they differ,
+     * except for file URLs - FM
+     *
+     * After trying it for a while, it's still premature, IHMO, to go along
+     * with it, so this is back to inheriting for identical schemes whether or
+     * not they are "file".  If you want to try it again yourself, uncomment
+     * the strcasecomp() below.  - FM
+     */
     if ((given.access && related.access) &&
-	(/* strcasecomp(given.access, "file") || */
-	 strcmp(given.access, related.access))) {
+	(			/* strcasecomp(given.access, "file") || */
+	    strcmp(given.access, related.access))) {
 	related.host = NULL;
 	related.absolute = NULL;
 	related.relative = NULL;
@@ -309,8 +302,8 @@ char * HTParse (
     }
 
     /*
-    **	Handle the host field.
-    */
+     * Handle the host field.
+     */
     if (wanted & PARSE_HOST) {
 	if (given.host || related.host) {
 	    if (wanted & PARSE_PUNCTUATION) {
@@ -321,42 +314,44 @@ char * HTParse (
 #define CLEAN_URLS
 #ifdef CLEAN_URLS
 	    /*
-	    **	Ignore default port numbers, and trailing dots on FQDNs,
-	    **	which will only cause identical addresses to look different.
-	    **  (related is already a clean url).
-	    */
+	     * Ignore default port numbers, and trailing dots on FQDNs, which
+	     * will only cause identical addresses to look different.  (related
+	     * is already a clean url).
+	     */
 	    {
 		char *p2, *h;
+
 		if ((p2 = strchr(result, '@')) != NULL)
-		   tail = (p2 + 1);
+		    tail = (p2 + 1);
 		p2 = strchr(tail, ':');
 		if (p2 != NULL && !isdigit(UCH(p2[1])))
 		    /*
-		    **	Colon not followed by a port number.
-		    */
+		     * Colon not followed by a port number.
+		     */
 		    *p2 = '\0';
 		if (p2 != NULL && *p2 != '\0' && acc_method != NULL) {
 		    /*
-		    **	Port specified.
-		    */
-		    if ((!strcmp(acc_method, "http"	 ) && !strcmp(p2, ":80" )) ||
-			(!strcmp(acc_method, "https"	 ) && !strcmp(p2, ":443")) ||
-			(!strcmp(acc_method, "gopher"	 ) && !strcmp(p2, ":70" )) ||
-			(!strcmp(acc_method, "ftp"	 ) && !strcmp(p2, ":21" )) ||
-			(!strcmp(acc_method, "wais"	 ) && !strcmp(p2, ":210")) ||
-			(!strcmp(acc_method, "nntp"	 ) && !strcmp(p2, ":119")) ||
-			(!strcmp(acc_method, "news"	 ) && !strcmp(p2, ":119")) ||
-			(!strcmp(acc_method, "newspost"  ) && !strcmp(p2, ":119")) ||
-			(!strcmp(acc_method, "newsreply" ) && !strcmp(p2, ":119")) ||
-			(!strcmp(acc_method, "snews"	 ) && !strcmp(p2, ":563")) ||
-			(!strcmp(acc_method, "snewspost" ) && !strcmp(p2, ":563")) ||
-			(!strcmp(acc_method, "snewsreply") && !strcmp(p2, ":563")) ||
-			(!strcmp(acc_method, "finger"	 ) && !strcmp(p2, ":79" )) ||
-			(!strcmp(acc_method, "telnet"	 ) && !strcmp(p2, ":23" )) ||
-			(!strcmp(acc_method, "tn3270"	 ) && !strcmp(p2, ":23" )) ||
-			(!strcmp(acc_method, "rlogin"	 ) && !strcmp(p2, ":513")) ||
-			(!strcmp(acc_method, "cso"	 ) && !strcmp(p2, ":105")))
-		    *p2 = '\0'; /* It is the default: ignore it */
+		     * Port specified.
+		     */
+#define ACC_METHOD(a,b) (!strcmp(acc_method, a) && !strcmp(p2, b))
+		    if (ACC_METHOD("http", ":80") ||
+			ACC_METHOD("https", ":443") ||
+			ACC_METHOD("gopher", ":70") ||
+			ACC_METHOD("ftp", ":21") ||
+			ACC_METHOD("wais", ":210") ||
+			ACC_METHOD("nntp", ":119") ||
+			ACC_METHOD("news", ":119") ||
+			ACC_METHOD("newspost", ":119") ||
+			ACC_METHOD("newsreply", ":119") ||
+			ACC_METHOD("snews", ":563") ||
+			ACC_METHOD("snewspost", ":563") ||
+			ACC_METHOD("snewsreply", ":563") ||
+			ACC_METHOD("finger", ":79") ||
+			ACC_METHOD("telnet", ":23") ||
+			ACC_METHOD("tn3270", ":23") ||
+			ACC_METHOD("rlogin", ":513") ||
+			ACC_METHOD("cso", ":105"))
+			*p2 = '\0';	/* It is the default: ignore it */
 		}
 		if (p2 == NULL) {
 		    int len3 = strlen(tail);
@@ -364,15 +359,15 @@ char * HTParse (
 		    if (len3 > 0) {
 			h = tail + len3 - 1;	/* last char of hostname */
 			if (*h == '.')
-			    *h = '\0';		/* chop final . */
+			    *h = '\0';	/* chop final . */
 		    }
 		} else if (p2 != result) {
 		    h = p2;
-		    h--;		/* End of hostname */
+		    h--;	/* End of hostname */
 		    if (*h == '.') {
 			/*
-			**  Slide p2 over h.
-			*/
+			 * Slide p2 over h.
+			 */
 			while (*p2 != '\0')
 			    *h++ = *p2++;
 			*h = '\0';	/* terminate */
@@ -390,12 +385,12 @@ char * HTParse (
     tail = LYRemoveBlanks(result);
 
     /*
-    **	If host in given or related was ended directly with a '?' (no
-    **  slash), fake the search part into absolute.  This is the only
-    **  case search is returned from scan.  A host must have been present.
-    **  this restores the '?' at which the host part had been truncated in
-    **  scan, we have to do this after host part handling is done. - kw
-    */
+     * If host in given or related was ended directly with a '?' (no slash),
+     * fake the search part into absolute.  This is the only case search is
+     * returned from scan.  A host must have been present.  this restores the
+     * '?' at which the host part had been truncated in scan, we have to do
+     * this after host part handling is done.  - kw
+     */
     if (given.search && *(given.search - 1) == '\0') {
 	given.absolute = given.search - 1;
 	given.absolute[0] = '?';
@@ -406,8 +401,8 @@ char * HTParse (
     }
 
     /*
-    **	If different hosts, inherit no path.
-    */
+     * If different hosts, inherit no path.
+     */
     if (given.host && related.host)
 	if (strcmp(given.host, related.host) != 0) {
 	    related.absolute = NULL;
@@ -416,8 +411,8 @@ char * HTParse (
 	}
 
     /*
-    **	Handle the path.
-    */
+     * Handle the path.
+     */
     if (wanted & (PARSE_PATH | PARSE_STRICTPATH | PARSE_QUERY)) {
 	int want_detail = (wanted & (PARSE_STRICTPATH | PARSE_QUERY));
 
@@ -446,32 +441,31 @@ char * HTParse (
 	    }
 	}
 
-	if (given.absolute) {			/* All is given */
+	if (given.absolute) {	/* All is given */
 	    if (wanted & PARSE_PUNCTUATION)
 		*tail++ = '/';
 	    strcpy(tail, given.absolute);
 	    CTRACE((tfp, "HTParse: (ABS)\n"));
-	} else if (related.absolute) {		/* Adopt path not name */
+	} else if (related.absolute) {	/* Adopt path not name */
 	    *tail++ = '/';
 	    strcpy(tail, related.absolute);
 	    if (given.relative) {
 		p = strchr(tail, '?');	/* Search part? */
 		if (p == NULL)
 		    p = (tail + strlen(tail) - 1);
-		for (; *p != '/'; p--)
-		    ;				/* last / */
-		p[1] = '\0';			/* Remove filename */
-		strcat(p, given.relative); /* Add given one */
-		HTSimplify (result);
+		for (; *p != '/'; p--) ;	/* last / */
+		p[1] = '\0';	/* Remove filename */
+		strcat(p, given.relative);	/* Add given one */
+		HTSimplify(result);
 	    }
 	    CTRACE((tfp, "HTParse: (Related-ABS)\n"));
 	} else if (given.relative) {
-	    strcpy(tail, given.relative);		/* what we've got */
+	    strcpy(tail, given.relative);	/* what we've got */
 	    CTRACE((tfp, "HTParse: (REL)\n"));
 	} else if (related.relative) {
 	    strcpy(tail, related.relative);
 	    CTRACE((tfp, "HTParse: (Related-REL)\n"));
-	} else {  /* No inheritance */
+	} else {		/* No inheritance */
 	    if (!isLYNXCGI(aName) &&
 		!isLYNXEXEC(aName) &&
 		!isLYNXPROG(aName)) {
@@ -502,8 +496,8 @@ char * HTParse (
     }
 
     /*
-    **	Handle the fragment (anchor). Never inherit.
-    */
+     * Handle the fragment (anchor).  Never inherit.
+     */
     if (wanted & PARSE_ANCHOR) {
 	if (given.anchor && *given.anchor) {
 	    tail += strlen(tail);
@@ -543,6 +537,7 @@ char * HTParse (
 	    CTRACE((tfp, "HTParse:      encode:`%s'\n", result));
 	    do {
 		char *q = p + strlen(p) + 2;
+
 		while (q != p + 1) {
 		    q[0] = q[-2];
 		    --q;
@@ -563,34 +558,34 @@ char * HTParse (
     if (*relatedName &&
 	((wanted & PARSE_ALL_WITHOUT_ANCHOR) == PARSE_ALL_WITHOUT_ANCHOR)) {
 	/*
-	 *  Check whether to fill in localhost. - FM
+	 * Check whether to fill in localhost.  - FM
 	 */
 	LYFillLocalFileURL(&return_value, relatedName);
 	CTRACE((tfp, "pass LYFillLocalFile:`%s'\n", return_value));
     }
 
-    return return_value;		/* exactly the right length */
+    return return_value;	/* exactly the right length */
 }
 
 /*	HTParseAnchor(), fast HTParse() specialization
-**	----------------------------------------------
-**
-** On exit,
-**	returns		A pointer within input string (probably to its end '\0')
-*/
-const char * HTParseAnchor (
-	const char *	aName)
+ *	----------------------------------------------
+ *
+ * On exit,
+ *	returns		A pointer within input string (probably to its end '\0')
+ */
+const char *HTParseAnchor(const char *aName)
 {
-    const char* p = aName;
-    for ( ; *p && *p != '#'; p++)
-	;
+    const char *p = aName;
+
+    for (; *p && *p != '#'; p++) ;
     if (*p == '#') {
 	/* the safe way based on HTParse() -
 	 * keeping in mind scan() peculiarities on schemes:
 	 */
 	struct struct_parts given;
 
-	char* name = (char*)LYalloca((p - aName) + strlen(p) + 1);
+	char *name = (char *) LYalloca((p - aName) + strlen(p) + 1);
+
 	if (name == NULL) {
 	    outofmem(__FILE__, "HTParseAnchor");
 	}
@@ -598,9 +593,9 @@ const char * HTParseAnchor (
 	scan(name, &given);
 	LYalloca_free(name);
 
-	p++; /*next to '#'*/
+	p++;			/*next to '#' */
 	if (given.anchor == NULL) {
-	    for ( ; *p; p++)  /*scroll to end '\0'*/
+	    for (; *p; p++)	/*scroll to end '\0' */
 		;
 	}
     }
@@ -608,22 +603,21 @@ const char * HTParseAnchor (
 }
 
 /*	Simplify a filename.				HTSimplify()
-**	--------------------
-**
-**  A unix-style file is allowed to contain the sequence xxx/../ which may
-**  be replaced by "" , and the sequence "/./" which may be replaced by "/".
-**  Simplification helps us recognize duplicate filenames.
-**
-**	Thus,	/etc/junk/../fred	becomes /etc/fred
-**		/etc/junk/./fred	becomes /etc/junk/fred
-**
-**	but we should NOT change
-**		http://fred.xxx.edu/../..
-**
-**	or	../../albert.html
-*/
-void HTSimplify (
-	char *		filename)
+ *	--------------------
+ *
+ *  A unix-style file is allowed to contain the sequence xxx/../ which may
+ *  be replaced by "" , and the sequence "/./" which may be replaced by "/".
+ *  Simplification helps us recognize duplicate filenames.
+ *
+ *	Thus,	/etc/junk/../fred	becomes /etc/fred
+ *		/etc/junk/./fred	becomes /etc/junk/fred
+ *
+ *	but we should NOT change
+ *		http://fred.xxx.edu/../..
+ *
+ *	or	../../albert.html
+ */
+void HTSimplify(char *filename)
 {
     char *p;
     char *q, *q1;
@@ -639,118 +633,115 @@ void HTSimplify (
 	for (p = (filename + 2); *p; p++) {
 	    if (*p == '?') {
 		/*
-		**  We're still treating a ?searchpart as part of
-		**  the path in HTParse() and scan(), but if we
-		**  encounter a '?' here, assume it's the delimiter
-		**  and break.	We also could check for a parameter
-		**  delimiter (';') here, but the current Fielding
-		**  draft (wisely or ill-advisedly :) says that it
-		**  should be ignored and collapsing be allowed in
-		**  it's value).  The only defined parameter at
-		**  present is ;type=[A, I, or D] for ftp URLs, so
-		**  if there's a "/..", "/../", "/./", or terminal
-		**  '.' following the ';', it must be due to the
-		**  ';' being an unescaped path character and not
-		**  actually a parameter delimiter. - FM
-		*/
+		 * We're still treating a ?searchpart as part of the path in
+		 * HTParse() and scan(), but if we encounter a '?' here, assume
+		 * it's the delimiter and break.  We also could check for a
+		 * parameter delimiter (';') here, but the current Fielding
+		 * draft (wisely or ill-advisedly :) says that it should be
+		 * ignored and collapsing be allowed in it's value).  The only
+		 * defined parameter at present is ;type=[A, I, or D] for ftp
+		 * URLs, so if there's a "/..", "/../", "/./", or terminal '.'
+		 * following the ';', it must be due to the ';' being an
+		 * unescaped path character and not actually a parameter
+		 * delimiter.  - FM
+		 */
 		break;
 	    }
 	    if (*p == '/') {
 		if ((p[1] == '.') && (p[2] == '.') &&
 		    (p[3] == '/' || p[3] == '?' || p[3] == '\0')) {
 		    /*
-		    **	Handle "../", "..?" or "..".
-		    */
+		     * Handle "../", "..?" or "..".
+		     */
 		    for (q = (p - 1); (q >= filename) && (*q != '/'); q--)
 			/*
-			**  Back up to previous slash or beginning of string.
-			*/
+			 * Back up to previous slash or beginning of string.
+			 */
 			;
 		    if ((q[0] == '/') &&
 			(strncmp(q, "/../", 4) &&
 			 strncmp(q, "/..?", 4)) &&
 			!((q - 1) > filename && q[-1] == '/')) {
 			/*
-			**  Not at beginning of string or in a
-			**  host field, so remove the "/xxx/..".
-			*/
+			 * Not at beginning of string or in a host field, so
+			 * remove the "/xxx/..".
+			 */
 			q1 = (p + 3);
 			p = q;
 			while (*q1 != '\0')
 			    *p++ = *q1++;
-			*p = '\0';		/* terminate */
+			*p = '\0';	/* terminate */
 			/*
-			**  Start again with previous slash.
-			*/
+			 * Start again with previous slash.
+			 */
 			p = (q - 1);
 		    }
 		} else if (p[1] == '.' && p[2] == '/') {
 		    /*
-		    **	Handle "./" by removing both characters.
-		    */
+		     * Handle "./" by removing both characters.
+		     */
 		    q = p;
 		    q1 = (p + 2);
 		    while (*q1 != '\0')
 			*q++ = *q1++;
-		    *q = '\0';		/* terminate */
+		    *q = '\0';	/* terminate */
 		    p--;
 		} else if (p[1] == '.' && p[2] == '?') {
 		    /*
-		    **	Handle ".?" by removing the dot.
-		    */
+		     * Handle ".?" by removing the dot.
+		     */
 		    q = (p + 1);
 		    q1 = (p + 2);
 		    while (*q1 != '\0')
 			*q++ = *q1++;
-		    *q = '\0';		/* terminate */
+		    *q = '\0';	/* terminate */
 		    p--;
 		} else if (p[1] == '.' && p[2] == '\0') {
 		    /*
-		    **	Handle terminal "." by removing the character.
-		    */
+		     * Handle terminal "." by removing the character.
+		     */
 		    p[1] = '\0';
 		}
 	    }
 	}
-	if (p >= filename + 2 && *p == '?' && *(p-1)  == '.') {
-	    if (*(p-2) == '/') {
+	if (p >= filename + 2 && *p == '?' && *(p - 1) == '.') {
+	    if (*(p - 2) == '/') {
 		/*
-		**  Handle "/.?" by removing the dot.
-		*/
+		 * Handle "/.?" by removing the dot.
+		 */
 		q = p - 1;
 		q1 = p;
 		while (*q1 != '\0')
 		    *q++ = *q1++;
 		*q = '\0';
-	    } else if (*(p-2) == '.' &&
-		       p >= filename + 4 && *(p-3) == '/' &&
-		       (*(p-4) != '/' ||
-			(p > filename + 4 && *(p-5) != ':'))) {
-		    /*
-		    **	Handle "xxx/..?"
-		    */
+	    } else if (*(p - 2) == '.' &&
+		       p >= filename + 4 && *(p - 3) == '/' &&
+		       (*(p - 4) != '/' ||
+			(p > filename + 4 && *(p - 5) != ':'))) {
+		/*
+		 * Handle "xxx/..?"
+		 */
 		for (q = (p - 4); (q > filename) && (*q != '/'); q--)
-			/*
-			**  Back up to previous slash or beginning of string.
-			*/
+		    /*
+		     * Back up to previous slash or beginning of string.
+		     */
 		    ;
 		if (*q == '/') {
-		    if (q > filename && *(q-1) == '/' &&
-			!(q > filename + 1 && *(q-1) != ':'))
+		    if (q > filename && *(q - 1) == '/' &&
+			!(q > filename + 1 && *(q - 1) != ':'))
 			return;
 		    q++;
 		}
 		if (strncmp(q, "../", 3) && strncmp(q, "./", 2)) {
-			/*
-			**  Not after "//" at beginning of string or
-			**  after "://", and xxx is not ".." or ".",
-			**  so remove the "xxx/..".
-			*/
+		    /*
+		     * Not after "//" at beginning of string or after "://",
+		     * and xxx is not ".." or ".", so remove the "xxx/..".
+		     */
 		    q1 = p;
 		    p = q;
 		    while (*q1 != '\0')
 			*p++ = *q1++;
-		    *p = '\0';		/* terminate */
+		    *p = '\0';	/* terminate */
 		}
 	    }
 	}
@@ -758,67 +749,68 @@ void HTSimplify (
 }
 
 /*	Make Relative Name.					HTRelative()
-**	-------------------
-**
-** This function creates and returns a string which gives an expression of
-** one address as related to another.  Where there is no relation, an absolute
-** address is returned.
-**
-**  On entry,
-**	Both names must be absolute, fully qualified names of nodes
-**	(no anchor bits)
-**
-**  On exit,
-**	The return result points to a newly allocated name which, if
-**	parsed by HTParse relative to relatedName, will yield aName.
-**	The caller is responsible for freeing the resulting name later.
-**
-*/
-char * HTRelative (
-	const char *	aName,
-	const char *	relatedName)
+ *	-------------------
+ *
+ * This function creates and returns a string which gives an expression of
+ * one address as related to another.  Where there is no relation, an absolute
+ * address is returned.
+ *
+ *  On entry,
+ *	Both names must be absolute, fully qualified names of nodes
+ *	(no anchor bits)
+ *
+ *  On exit,
+ *	The return result points to a newly allocated name which, if
+ *	parsed by HTParse relative to relatedName, will yield aName.
+ *	The caller is responsible for freeing the resulting name later.
+ *
+ */
+char *HTRelative(const char *aName,
+		 const char *relatedName)
 {
-    char * result = NULL;
+    char *result = NULL;
     const char *p = aName;
     const char *q = relatedName;
-    const char * after_access = NULL;
-    const char * path = NULL;
-    const char * last_slash = NULL;
+    const char *after_access = NULL;
+    const char *path = NULL;
+    const char *last_slash = NULL;
     int slashes = 0;
 
     for (; *p; p++, q++) {	/* Find extent of match */
 	if (*p != *q)
 	    break;
 	if (*p == ':')
-	    after_access = p+1;
+	    after_access = p + 1;
 	if (*p == '/') {
 	    last_slash = p;
 	    slashes++;
 	    if (slashes == 3)
-		path=p;
+		path = p;
 	}
     }
 
     /* q, p point to the first non-matching character or zero */
 
-    if (!after_access) {			/* Different access */
+    if (!after_access) {	/* Different access */
 	StrAllocCopy(result, aName);
-    } else if (slashes < 3){			/* Different nodes */
+    } else if (slashes < 3) {	/* Different nodes */
 	StrAllocCopy(result, after_access);
-    } else if (slashes == 3){			/* Same node, different path */
+    } else if (slashes == 3) {	/* Same node, different path */
 	StrAllocCopy(result, path);
-    } else {					/* Some path in common */
+    } else {			/* Some path in common */
 	int levels = 0;
+
 	for (; *q && (*q != '#'); q++)
 	    if (*q == '/')
 		levels++;
-	result = typecallocn(char, 3*levels + strlen(last_slash) + 1);
+	result = typecallocn(char, 3 * levels + strlen(last_slash) + 1);
+
 	if (result == NULL)
 	    outofmem(__FILE__, "HTRelative");
 	result[0] = '\0';
 	for (; levels; levels--)
 	    strcat(result, "../");
-	strcat(result, last_slash+1);
+	strcat(result, last_slash + 1);
     }
     CTRACE((tfp,
 	    "HTparse: `%s' expressed relative to\n   `%s' is\n   `%s'.\n",
@@ -827,21 +819,22 @@ char * HTRelative (
 }
 
 /*	Escape undesirable characters using %			HTEscape()
-**	-------------------------------------
-**
-**	This function takes a pointer to a string in which
-**	some characters may be unacceptable unescaped.
-**	It returns a string which has these characters
-**	represented by a '%' character followed by two hex digits.
-**
-**	Unlike HTUnEscape(), this routine returns a calloc'd string.
-*/
+ *	-------------------------------------
+ *
+ *	This function takes a pointer to a string in which
+ *	some characters may be unacceptable unescaped.
+ *	It returns a string which has these characters
+ *	represented by a '%' character followed by two hex digits.
+ *
+ *	Unlike HTUnEscape(), this routine returns a calloc'd string.
+ */
+/* *INDENT-OFF* */
 static const unsigned char isAcceptable[96] =
 
 /*	Bit 0		xalpha		-- see HTFile.h
-**	Bit 1		xpalpha		-- as xalpha but with plus.
-**	Bit 2 ...	path		-- as xpalphas but with /
-*/
+ *	Bit 1		xpalpha		-- as xalpha but with plus.
+ *	Bit 2 ...	path		-- as xpalphas but with /
+ */
     /*	 0 1 2 3 4 5 6 7 8 9 A B C D E F */
     {	 0,0,0,0,0,0,0,0,0,0,7,6,0,7,7,4,	/* 2x	!"#$%&'()*+,-./  */
 	 7,7,7,7,7,7,7,7,7,7,0,0,0,0,0,0,	/* 3x  0123456789:;<=>?  */
@@ -849,102 +842,110 @@ static const unsigned char isAcceptable[96] =
 	 7,7,7,7,7,7,7,7,7,7,7,0,0,0,0,7,	/* 5X  PQRSTUVWXYZ[\]^_  */
 	 0,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,	/* 6x  `abcdefghijklmno  */
 	 7,7,7,7,7,7,7,7,7,7,7,0,0,0,0,0 };	/* 7X  pqrstuvwxyz{|}~	DEL */
+/* *INDENT-ON* */
 
 static char *hex = "0123456789ABCDEF";
+
 #define ACCEPTABLE(a)	( a>=32 && a<128 && ((isAcceptable[a-32]) & mask))
 
-char * HTEscape (
-	const char *	str,
-	unsigned char	mask)
+char *HTEscape(const char *str,
+	       unsigned char mask)
 {
-    const char * p;
-    char * q;
-    char * result;
+    const char *p;
+    char *q;
+    char *result;
     int unacceptable = 0;
+
     for (p = str; *p; p++)
 	if (!ACCEPTABLE(UCH(TOASCII(*p))))
 	    unacceptable++;
-    result = typecallocn(char, p-str + unacceptable + unacceptable + 1);
+    result = typecallocn(char, p - str + unacceptable + unacceptable + 1);
+
     if (result == NULL)
 	outofmem(__FILE__, "HTEscape");
     for (q = result, p = str; *p; p++) {
 	unsigned char a = TOASCII(*p);
+
 	if (!ACCEPTABLE(a)) {
 	    *q++ = HEX_ESCAPE;	/* Means hex coming */
 	    *q++ = hex[a >> 4];
 	    *q++ = hex[a & 15];
-	}
-	else *q++ = *p;
+	} else
+	    *q++ = *p;
     }
     *q++ = '\0';		/* Terminate */
     return result;
 }
 
 /*	Escape unsafe characters using %			HTEscapeUnsafe()
-**	--------------------------------
-**
-**	This function takes a pointer to a string in which
-**	some characters may be that may be unsafe are unescaped.
-**	It returns a string which has these characters
-**	represented by a '%' character followed by two hex digits.
-**
-**	Unlike HTUnEscape(), this routine returns a malloc'd string.
-*/
+ *	--------------------------------
+ *
+ *	This function takes a pointer to a string in which
+ *	some characters may be that may be unsafe are unescaped.
+ *	It returns a string which has these characters
+ *	represented by a '%' character followed by two hex digits.
+ *
+ *	Unlike HTUnEscape(), this routine returns a malloc'd string.
+ */
 #define UNSAFE(ch) (((ch) <= 32) || ((ch) >= 127))
 
-char *HTEscapeUnsafe (
-	const char *	str)
+char *HTEscapeUnsafe(const char *str)
 {
-    const char * p;
-    char * q;
-    char * result;
+    const char *p;
+    char *q;
+    char *result;
     int unacceptable = 0;
+
     for (p = str; *p; p++)
 	if (UNSAFE(UCH(TOASCII(*p))))
 	    unacceptable++;
-    result = typecallocn(char, p-str + unacceptable + unacceptable + 1);
+    result = typecallocn(char, p - str + unacceptable + unacceptable + 1);
+
     if (result == NULL)
 	outofmem(__FILE__, "HTEscapeUnsafe");
     for (q = result, p = str; *p; p++) {
 	unsigned char a = TOASCII(*p);
+
 	if (UNSAFE(a)) {
 	    *q++ = HEX_ESCAPE;	/* Means hex coming */
 	    *q++ = hex[a >> 4];
 	    *q++ = hex[a & 15];
-	}
-	else *q++ = *p;
+	} else
+	    *q++ = *p;
     }
     *q++ = '\0';		/* Terminate */
     return result;
 }
 
 /*	Escape undesirable characters using % but space to +.	HTEscapeSP()
-**	-----------------------------------------------------
-**
-**	This function takes a pointer to a string in which
-**	some characters may be unacceptable unescaped.
-**	It returns a string which has these characters
-**	represented by a '%' character followed by two hex digits,
-**	except that spaces are converted to '+' instead of %2B.
-**
-**	Unlike HTUnEscape(), this routine returns a calloced string.
-*/
-char * HTEscapeSP (
-	const char *	str,
-	unsigned char	mask)
+ *	-----------------------------------------------------
+ *
+ *	This function takes a pointer to a string in which
+ *	some characters may be unacceptable unescaped.
+ *	It returns a string which has these characters
+ *	represented by a '%' character followed by two hex digits,
+ *	except that spaces are converted to '+' instead of %2B.
+ *
+ *	Unlike HTUnEscape(), this routine returns a calloced string.
+ */
+char *HTEscapeSP(const char *str,
+		 unsigned char mask)
 {
-    const char * p;
-    char * q;
-    char * result;
+    const char *p;
+    char *q;
+    char *result;
     int unacceptable = 0;
+
     for (p = str; *p; p++)
 	if (!(*p == ' ' || ACCEPTABLE(UCH(TOASCII(*p)))))
 	    unacceptable++;
-    result = typecallocn(char, p-str + unacceptable + unacceptable + 1);
+    result = typecallocn(char, p - str + unacceptable + unacceptable + 1);
+
     if (result == NULL)
 	outofmem(__FILE__, "HTEscape");
     for (q = result, p = str; *p; p++) {
 	unsigned char a = TOASCII(*p);
+
 	if (a == 32) {
 	    *q++ = '+';
 	} else if (!ACCEPTABLE(a)) {
@@ -955,40 +956,38 @@ char * HTEscapeSP (
 	    *q++ = *p;
 	}
     }
-    *q++ = '\0';			/* Terminate */
+    *q++ = '\0';		/* Terminate */
     return result;
 }
 
 /*	Decode %xx escaped characters.				HTUnEscape()
-**	------------------------------
-**
-**	This function takes a pointer to a string in which some
-**	characters may have been encoded in %xy form, where xy is
-**	the ASCII hex code for character 16x+y.
-**	The string is converted in place, as it will never grow.
-*/
-static char from_hex (
-	char		c)
+ *	------------------------------
+ *
+ *	This function takes a pointer to a string in which some
+ *	characters may have been encoded in %xy form, where xy is
+ *	the ASCII hex code for character 16x+y.
+ *	The string is converted in place, as it will never grow.
+ */
+static char from_hex(char c)
 {
-    return (char) ( c >= '0' && c <= '9' ?  c - '0'
-	    : c >= 'A' && c <= 'F'? c - 'A' + 10
-	    : c - 'a' + 10);     /* accept small letters just in case */
+    return (char) (c >= '0' && c <= '9' ? c - '0'
+		   : c >= 'A' && c <= 'F' ? c - 'A' + 10
+		   : c - 'a' + 10);	/* accept small letters just in case */
 }
 
-char * HTUnEscape (
-	char *		str)
+char *HTUnEscape(char *str)
 {
-    char * p = str;
-    char * q = str;
+    char *p = str;
+    char *q = str;
 
     if (!(p && *p))
 	return str;
 
     while (*p != '\0') {
 	if (*p == HEX_ESCAPE &&
-	    /*
-	     *	Tests shouldn't be needed, but better safe than sorry.
-	     */
+	/*
+	 * Tests shouldn't be needed, but better safe than sorry.
+	 */
 	    p[1] && p[2] &&
 	    isxdigit(UCH(p[1])) &&
 	    isxdigit(UCH(p[2]))) {
@@ -997,8 +996,9 @@ char * HTUnEscape (
 		*q = (char) (from_hex(*p++) * 16);
 	    if (*p) {
 		/*
-		** Careful! FROMASCII() may evaluate its arg more than once!
-		*/  /* S/390 -- gil -- 0221 */
+		 * Careful! FROMASCII() may evaluate its arg more than once!
+		 */
+		/* S/390 -- gil -- 0221 */
 		*q = (char) (*q + from_hex(*p++));
 	    }
 	    *q = FROMASCII(*q);
@@ -1011,24 +1011,23 @@ char * HTUnEscape (
     *q++ = '\0';
     return str;
 
-} /* HTUnEscape */
+}				/* HTUnEscape */
 
 /*	Decode some %xx escaped characters.		      HTUnEscapeSome()
-**	-----------------------------------			Klaus Weide
-**							    (kweide@tezcat.com)
-**	This function takes a pointer to a string in which some
-**	characters may have been encoded in %xy form, where xy is
-**	the ASCII hex code for character 16x+y, and a pointer to
-**	a second string containing one or more characters which
-**	should be unescaped if escaped in the first string.
-**	The first string is converted in place, as it will never grow.
-*/
-char * HTUnEscapeSome (
-	char *		str,
-	const char *	do_trans)
+ *	-----------------------------------			Klaus Weide
+ *							    (kweide@tezcat.com)
+ *	This function takes a pointer to a string in which some
+ *	characters may have been encoded in %xy form, where xy is
+ *	the ASCII hex code for character 16x+y, and a pointer to
+ *	a second string containing one or more characters which
+ *	should be unescaped if escaped in the first string.
+ *	The first string is converted in place, as it will never grow.
+ */
+char *HTUnEscapeSome(char *str,
+		     const char *do_trans)
 {
-    char * p = str;
-    char * q = str;
+    char *p = str;
+    char *q = str;
     char testcode;
 
     if (p == NULL || *p == '\0' || do_trans == NULL || *do_trans == '\0')
@@ -1039,9 +1038,9 @@ char * HTUnEscapeSome (
 	    p[1] && p[2] &&	/* tests shouldn't be needed, but.. */
 	    isxdigit(UCH(p[1])) &&
 	    isxdigit(UCH(p[2])) &&
-	    (testcode = (char) FROMASCII(from_hex(p[1])*16 +
-		from_hex(p[2]))) && /* %00 no good*/
-	    strchr(do_trans, testcode)) { /* it's one of the ones we want */
+	    (testcode = (char) FROMASCII(from_hex(p[1]) * 16 +
+					 from_hex(p[2]))) &&	/* %00 no good */
+	    strchr(do_trans, testcode)) {	/* it's one of the ones we want */
 	    *q++ = testcode;
 	    p += 3;
 	} else {
@@ -1052,13 +1051,13 @@ char * HTUnEscapeSome (
     *q++ = '\0';
     return str;
 
-} /* HTUnEscapeSome */
-
+}				/* HTUnEscapeSome */
+/* *INDENT-OFF* */
 static const unsigned char crfc[96] =
 
 /*	Bit 0		xalpha		-- need "quoting"
-**	Bit 1		xpalpha		-- need \escape if quoted
-*/
+ *	Bit 1		xpalpha		-- need \escape if quoted
+ */
     /*	 0 1 2 3 4 5 6 7 8 9 A B C D E F */
     {	 1,0,3,0,0,0,0,0,1,1,0,0,1,0,1,0,	/* 2x	!"#$%&'()*+,-./  */
 	 0,0,0,0,0,0,0,0,0,0,1,1,1,0,1,0,	/* 3x  0123456789:;<=>?  */
@@ -1066,19 +1065,19 @@ static const unsigned char crfc[96] =
 	 0,0,0,0,0,0,0,0,0,0,0,1,2,1,0,0,	/* 5X  PQRSTUVWXYZ[\]^_  */
 	 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,	/* 6x  `abcdefghijklmno  */
 	 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3 };	/* 7X  pqrstuvwxyz{|}~	DEL */
+/* *INDENT-ON* */
 
 /*
-**  Turn a string which is not a RFC 822 token into a quoted-string. - KW
-**  The "quoted" parameter tells whether we need the beginning/ending quote
-**  marks.  If not, the caller will provide them -TD
-*/
-void HTMake822Word (
-	char **	str,
-	int		quoted)
+ *  Turn a string which is not a RFC 822 token into a quoted-string. - KW
+ *  The "quoted" parameter tells whether we need the beginning/ending quote
+ *  marks.  If not, the caller will provide them -TD
+ */
+void HTMake822Word(char **str,
+		   int quoted)
 {
-    const char * p;
-    char * q;
-    char * result;
+    const char *p;
+    char *q;
+    char *result;
     unsigned char a;
     int added = 0;
 
@@ -1087,22 +1086,22 @@ void HTMake822Word (
 	return;
     }
     for (p = *str; *p; p++) {
-	a = TOASCII(*p);  /* S/390 -- gil -- 0240 */
+	a = TOASCII(*p);	/* S/390 -- gil -- 0240 */
 	if (a < 32 || a >= 128 ||
-	    ((crfc[a-32]) & 1)) {
+	    ((crfc[a - 32]) & 1)) {
 	    if (!added)
 		added = 2;
 	    if (a >= 160 || a == '\t')
 		continue;
 	    if (a == '\r' || a == '\n')
 		added += 2;
-	    else if ((a & 127) < 32 || ((crfc[a-32]) & 2))
+	    else if ((a & 127) < 32 || ((crfc[a - 32]) & 2))
 		added++;
 	}
     }
     if (!added)
 	return;
-    result = typecallocn(char, p-(*str) + added + 1);
+    result = typecallocn(char, p - (*str) + added + 1);
     if (result == NULL)
 	outofmem(__FILE__, "HTMake822Word");
 
@@ -1110,23 +1109,24 @@ void HTMake822Word (
     if (quoted)
 	*q++ = '"';
     /*
-    ** Having converted the character to ASCII, we can't use symbolic
-    ** escape codes, since they're in the host character set, which
-    ** is not necessarily ASCII.  Thus we use octal escape codes instead.
-    ** -- gil (Paul Gilmartin) <pg@sweng.stortek.com>
-    */  /* S/390 -- gil -- 0268 */
+     * Having converted the character to ASCII, we can't use symbolic
+     * escape codes, since they're in the host character set, which
+     * is not necessarily ASCII.  Thus we use octal escape codes instead.
+     * -- gil (Paul Gilmartin) <pg@sweng.stortek.com>
+     */
+    /* S/390 -- gil -- 0268 */
     for (p = *str; *p; p++) {
 	a = TOASCII(*p);
 	if ((a != '\011') && ((a & 127) < 32 ||
-			    ( a < 128 && ((crfc[a-32]) & 2))))
+			      (a < 128 && ((crfc[a - 32]) & 2))))
 	    *q++ = '\033';
 	*q++ = *p;
-	if (a == '\012' || (a == '\015' && (TOASCII(*(p+1)) != '\012')))
+	if (a == '\012' || (a == '\015' && (TOASCII(*(p + 1)) != '\012')))
 	    *q++ = ' ';
     }
     if (quoted)
 	*q++ = '"';
-    *q++ = '\0';			/* Terminate */
+    *q++ = '\0';		/* Terminate */
     FREE(*str);
     *str = result;
 }
diff --git a/WWW/Library/Implementation/HTParse.h b/WWW/Library/Implementation/HTParse.h
index 1fa9599e..342c61a3 100644
--- a/WWW/Library/Implementation/HTParse.h
+++ b/WWW/Library/Implementation/HTParse.h
@@ -1,10 +1,10 @@
 /*                                   HTParse:  URL parsing in the WWW Library
-**				HTPARSE
-**
-**  This module of the WWW library contains code to parse URLs and various
-**  related things.
-**  Implemented by HTParse.c .
-*/
+ *				HTPARSE
+ *
+ *  This module of the WWW library contains code to parse URLs and various
+ *  related things.
+ *  Implemented by HTParse.c .
+ */
 #ifndef HTPARSE_H
 #define HTPARSE_H
 
@@ -13,9 +13,9 @@
 #endif
 
 /*
-**  The following are flag bits which may be ORed together to form
-**  a number to give the 'wanted' argument to HTParse.
-*/
+ *  The following are flag bits which may be ORed together to form
+ *  a number to give the 'wanted' argument to HTParse.
+ */
 #define PARSE_ACCESS            16
 #define PARSE_HOST               8
 #define PARSE_PATH               4
@@ -26,173 +26,161 @@
 #define PARSE_ALL_WITHOUT_ANCHOR  (PARSE_ALL ^ PARSE_ANCHOR)
 
 /*
-**  Additional flag bits for more details on components already
-**  covered by the above.  The PARSE_PATH above doesn't really
-**  strictly refer to the path component in the sense of the URI
-**  specs only, but rather to that combined with a possible query
-**  component. - kw
-*/
+ *  Additional flag bits for more details on components already
+ *  covered by the above.  The PARSE_PATH above doesn't really
+ *  strictly refer to the path component in the sense of the URI
+ *  specs only, but rather to that combined with a possible query
+ *  component. - kw
+ */
 #define PARSE_STRICTPATH        32
 #define PARSE_QUERY             64
 
 /*
-**  The following are valid mask values.  The terms are the BNF names
-**  in the URL document.
-*/
+ *  The following are valid mask values.  The terms are the BNF names
+ *  in the URL document.
+ */
 #define URL_XALPHAS     UCH(1)
 #define URL_XPALPHAS    UCH(2)
 #define URL_PATH        UCH(4)
 
-
 /*	Strip white space off a string.				HTStrip()
-**	-------------------------------
-**
-** On exit,
-**	Return value points to first non-white character, or to 0 if none.
-**	All trailing white space is OVERWRITTEN with zero.
-*/
-extern char * HTStrip (
-	char *		s);
+ *	-------------------------------
+ *
+ * On exit,
+ *	Return value points to first non-white character, or to 0 if none.
+ *	All trailing white space is OVERWRITTEN with zero.
+ */
+extern char *HTStrip(char *s);
 
 /*	Parse a Name relative to another name.			HTParse()
-**	--------------------------------------
-**
-**	This returns those parts of a name which are given (and requested)
-**	substituting bits from the related name where necessary.
-**
-** On entry,
-**	aName		A filename given
-**      relatedName     A name relative to which aName is to be parsed
-**      wanted          A mask for the bits which are wanted.
-**
-** On exit,
-**	returns		A pointer to a malloc'd string which MUST BE FREED
-*/
-extern char * HTParse (
-	const char *	aName,
-	const char *	relatedName,
-	int		wanted);
+ *	--------------------------------------
+ *
+ *	This returns those parts of a name which are given (and requested)
+ *	substituting bits from the related name where necessary.
+ *
+ * On entry,
+ *	aName		A filename given
+ *      relatedName     A name relative to which aName is to be parsed
+ *      wanted          A mask for the bits which are wanted.
+ *
+ * On exit,
+ *	returns		A pointer to a malloc'd string which MUST BE FREED
+ */
+extern char *HTParse(const char *aName,
+		     const char *relatedName,
+		     int wanted);
 
 /*	HTParseAnchor(), fast HTParse() specialization
-**	----------------------------------------------
-**
-** On exit,
-**	returns		A pointer within input string (probably to its end '\0')
-*/
-extern const char * HTParseAnchor (
-	const char *	aName);
+ *	----------------------------------------------
+ *
+ * On exit,
+ *	returns		A pointer within input string (probably to its end '\0')
+ */
+extern const char *HTParseAnchor(const char *aName);
 
 /*	Simplify a filename.				HTSimplify()
-**	--------------------
-**
-**  A unix-style file is allowed to contain the seqeunce xxx/../ which may
-**  be replaced by "" , and the seqeunce "/./" which may be replaced by "/".
-**  Simplification helps us recognize duplicate filenames.
-**
-**	Thus,	/etc/junk/../fred	becomes /etc/fred
-**		/etc/junk/./fred	becomes	/etc/junk/fred
-**
-**      but we should NOT change
-**		http://fred.xxx.edu/../..
-**
-**	or	../../albert.html
-*/
-extern void HTSimplify (
-	char *		filename);
+ *	--------------------
+ *
+ *  A unix-style file is allowed to contain the seqeunce xxx/../ which may
+ *  be replaced by "" , and the seqeunce "/./" which may be replaced by "/".
+ *  Simplification helps us recognize duplicate filenames.
+ *
+ *	Thus,	/etc/junk/../fred	becomes /etc/fred
+ *		/etc/junk/./fred	becomes	/etc/junk/fred
+ *
+ *      but we should NOT change
+ *		http://fred.xxx.edu/../..
+ *
+ *	or	../../albert.html
+ */
+extern void HTSimplify(char *filename);
 
 /*	Make Relative Name.					HTRelative()
-**	-------------------
-**
-** This function creates and returns a string which gives an expression of
-** one address as related to another.  Where there is no relation, an absolute
-** address is retured.
-**
-**  On entry,
-**	Both names must be absolute, fully qualified names of nodes
-**	(no anchor bits)
-**
-**  On exit,
-**	The return result points to a newly allocated name which, if
-**	parsed by HTParse relative to relatedName, will yield aName.
-**	The caller is responsible for freeing the resulting name later.
-**
-*/
-extern char * HTRelative (
-	const char *	aName,
-	const char *	relatedName);
+ *	-------------------
+ *
+ * This function creates and returns a string which gives an expression of
+ * one address as related to another.  Where there is no relation, an absolute
+ * address is retured.
+ *
+ *  On entry,
+ *	Both names must be absolute, fully qualified names of nodes
+ *	(no anchor bits)
+ *
+ *  On exit,
+ *	The return result points to a newly allocated name which, if
+ *	parsed by HTParse relative to relatedName, will yield aName.
+ *	The caller is responsible for freeing the resulting name later.
+ *
+ */
+extern char *HTRelative(const char *aName,
+			const char *relatedName);
 
 /*		Escape undesirable characters using %		HTEscape()
-**		-------------------------------------
-**
-**	This function takes a pointer to a string in which
-**	some characters may be unacceptable are unescaped.
-**	It returns a string which has these characters
-**	represented by a '%' character followed by two hex digits.
-**
-**	Unlike HTUnEscape(), this routine returns a malloc'd string.
-*/
-extern char * HTEscape (
-	const char *	str,
-	unsigned char	mask);
+ *		-------------------------------------
+ *
+ *	This function takes a pointer to a string in which
+ *	some characters may be unacceptable are unescaped.
+ *	It returns a string which has these characters
+ *	represented by a '%' character followed by two hex digits.
+ *
+ *	Unlike HTUnEscape(), this routine returns a malloc'd string.
+ */
+extern char *HTEscape(const char *str,
+		      unsigned char mask);
 
 /*		Escape unsafe characters using %		HTEscapeUnsafe()
-**		--------------------------------
-**
-**	This function takes a pointer to a string in which
-**	some characters may be that may be unsafe are unescaped.
-**	It returns a string which has these characters
-**	represented by a '%' character followed by two hex digits.
-**
-**	Unlike HTUnEscape(), this routine returns a malloc'd string.
-*/
-extern char * HTEscapeUnsafe (
-	const char *	str);
+ *		--------------------------------
+ *
+ *	This function takes a pointer to a string in which
+ *	some characters may be that may be unsafe are unescaped.
+ *	It returns a string which has these characters
+ *	represented by a '%' character followed by two hex digits.
+ *
+ *	Unlike HTUnEscape(), this routine returns a malloc'd string.
+ */
+extern char *HTEscapeUnsafe(const char *str);
 
 /*	Escape undesirable characters using % but space to +.	HTEscapeSP()
-**	-----------------------------------------------------
-**
-**	This function takes a pointer to a string in which
-**	some characters may be unacceptable are unescaped.
-**	It returns a string which has these characters
-**	represented by a '%' character followed by two hex digits,
-**	except that spaces are converted to '+' instead of %2B.
-**
-**	Unlike HTUnEscape(), this routine returns a malloc'd string.
-*/
-extern char * HTEscapeSP (
-	const char *	str,
-	unsigned char	mask);
+ *	-----------------------------------------------------
+ *
+ *	This function takes a pointer to a string in which
+ *	some characters may be unacceptable are unescaped.
+ *	It returns a string which has these characters
+ *	represented by a '%' character followed by two hex digits,
+ *	except that spaces are converted to '+' instead of %2B.
+ *
+ *	Unlike HTUnEscape(), this routine returns a malloc'd string.
+ */
+extern char *HTEscapeSP(const char *str,
+			unsigned char mask);
 
 /*	Decode %xx escaped characters.				HTUnEscape()
-**	------------------------------
-**
-**	This function takes a pointer to a string in which some
-**	characters may have been encoded in %xy form, where xy is
-**	the acsii hex code for character 16x+y.
-**	The string is converted in place, as it will never grow.
-*/
-extern char * HTUnEscape (
-	char *		str);
+ *	------------------------------
+ *
+ *	This function takes a pointer to a string in which some
+ *	characters may have been encoded in %xy form, where xy is
+ *	the acsii hex code for character 16x+y.
+ *	The string is converted in place, as it will never grow.
+ */
+extern char *HTUnEscape(char *str);
 
 /*	Decode some %xx escaped characters.		      HTUnEscapeSome()
-**	-----------------------------------			Klaus Weide
-**							    (kweide@tezcat.com)
-**	This function takes a pointer to a string in which some
-**	characters may have been encoded in %xy form, where xy is
-**	the acsii hex code for character 16x+y, and a pointer to
-**	a second string containing one or more characters which
-**	should be unescaped if escaped in the first string.
-**	The first string is converted in place, as it will never grow.
-*/
-extern char * HTUnEscapeSome (
-	char *		str,
-	const char *	do_trans);
+ *	-----------------------------------			Klaus Weide
+ *							    (kweide@tezcat.com)
+ *	This function takes a pointer to a string in which some
+ *	characters may have been encoded in %xy form, where xy is
+ *	the acsii hex code for character 16x+y, and a pointer to
+ *	a second string containing one or more characters which
+ *	should be unescaped if escaped in the first string.
+ *	The first string is converted in place, as it will never grow.
+ */
+extern char *HTUnEscapeSome(char *str,
+			    const char *do_trans);
 
 /*
-**  Turn a string which is not a RFC 822 token into a quoted-string. - KW
-*/
-extern void HTMake822Word (
-	char **		str,
-	int		quoted);
+ *  Turn a string which is not a RFC 822 token into a quoted-string. - KW
+ */
+extern void HTMake822Word(char **str,
+			  int quoted);
 
-#endif  /* HTPARSE_H */
+#endif /* HTPARSE_H */
diff --git a/WWW/Library/Implementation/HTPlain.c b/WWW/Library/Implementation/HTPlain.c
index bc0e72f5..72e7dde7 100644
--- a/WWW/Library/Implementation/HTPlain.c
+++ b/WWW/Library/Implementation/HTPlain.c
@@ -1,15 +1,15 @@
 /*		Plain text object		HTWrite.c
-**		=================
-**
-**	This version of the stream object just writes to a socket.
-**	The socket is assumed open and left open.
-**
-**	Bugs:
-**		strings written must be less than buffer size.
-*/
+ *		=================
+ *
+ *	This version of the stream object just writes to a socket.
+ *	The socket is assumed open and left open.
+ *
+ *	Bugs:
+ *		strings written must be less than buffer size.
+ */
 
 #include <HTUtils.h>
-#include <LYCharVals.h>  /* S/390 -- gil -- 0288 */
+#include <LYCharVals.h>		/* S/390 -- gil -- 0288 */
 
 #include <HTPlain.h>
 
@@ -31,50 +31,49 @@
 #include <LYLeaks.h>
 
 int HTPlain_lastraw = -1;
-static int HTPlain_bs_pending = 0; /* 1:bs 2:underline 3:underline+bs - kw */
+static int HTPlain_bs_pending = 0;	/* 1:bs 2:underline 3:underline+bs - kw */
 
 /*		HTML Object
-**		-----------
-*/
+ *		-----------
+ */
 struct _HTStream {
-    const HTStreamClass *	isa;
-    HText *			text;
+    const HTStreamClass *isa;
+    HText *text;
     /*
-    **	The node_anchor UCInfo and handle for the input (PARSER) stage. - FM
-    */
-    LYUCcharset		*	inUCI;
-    int				inUCLYhndl;
+     * The node_anchor UCInfo and handle for the input (PARSER) stage.  - FM
+     */
+    LYUCcharset *inUCI;
+    int inUCLYhndl;
     /*
-    **	The node_anchor UCInfo and handle for the output (HTEXT) stage. - FM
-    */
-    LYUCcharset	*		outUCI;
+     * The node_anchor UCInfo and handle for the output (HTEXT) stage.  - FM
+     */
+    LYUCcharset *outUCI;
     int outUCLYhndl;
     /*
-    **	Counter, value, buffer and pointer for UTF-8 handling. - FM
-    */
-    char			utf_count;
-    UCode_t			utf_char;
-    char			utf_buf[8];
-    char *			utf_buf_p;
+     * Counter, value, buffer and pointer for UTF-8 handling.  - FM
+     */
+    char utf_count;
+    UCode_t utf_char;
+    char utf_buf[8];
+    char *utf_buf_p;
     /*
-    **	The charset transformation structure. - FM
-    */
-    UCTransParams		T;
+     * The charset transformation structure.  - FM
+     */
+    UCTransParams T;
 };
 
-static char replace_buf [64];	      /* buffer for replacement strings */
+static char replace_buf[64];	/* buffer for replacement strings */
 
-static void HTPlain_getChartransInfo (
-	HTStream *		me,
-	HTParentAnchor *	anchor)
+static void HTPlain_getChartransInfo(HTStream *me, HTParentAnchor *anchor)
 {
     if (me->inUCLYhndl < 0) {
 	HTAnchor_copyUCInfoStage(anchor, UCT_STAGE_PARSER, UCT_STAGE_MIME,
-					 UCT_SETBY_PARSER);
+				 UCT_SETBY_PARSER);
 	me->inUCLYhndl = HTAnchor_getUCLYhndl(anchor, UCT_STAGE_PARSER);
     }
     if (me->outUCLYhndl < 0) {
 	int chndl = HTAnchor_getUCLYhndl(anchor, UCT_STAGE_HTEXT);
+
 	if (chndl < 0) {
 	    chndl = current_char_set;
 	    HTAnchor_setUCInfoStage(anchor, chndl,
@@ -89,41 +88,36 @@ static void HTPlain_getChartransInfo (
 }
 
 /*	Write the buffer out to the socket
-**	----------------------------------
-*/
+ *	----------------------------------
+ */
 
 /*_________________________________________________________________________
-**
-**			A C T I O N	R O U T I N E S
-*/
+ *
+ *			A C T I O N	R O U T I N E S
+ */
 
-static void HTPlain_write (
-	HTStream *		me,
-	const char *		s,
-	int			l);
+static void HTPlain_write(HTStream *me, const char *s,
+			  int l);
 
 /*	Character handling
-**	------------------
-*/
-static void HTPlain_put_character (
-	HTStream *		me,
-	char			c)
+ *	------------------
+ */
+static void HTPlain_put_character(HTStream *me, char c)
 {
 #ifdef REMOVE_CR_ONLY
     /*
-    **	Throw away \r's.
-    */
+     * Throw away \r's.
+     */
     if (c != '\r') {
-       HText_appendCharacter(me->text, c);
+	HText_appendCharacter(me->text, c);
     }
 #else
     /*
-    **	See HTPlain_write() for explanations of the following code
-    **	(we've been called via HTPlain_put_string() to do for each
-    **	character of a terminated string what HTPlain_write() does
-    **	via a while loop for each character in a stream of given
-    **	length). - FM
-    */
+     * See HTPlain_write() for explanations of the following code (we've been
+     * called via HTPlain_put_string() to do for each character of a terminated
+     * string what HTPlain_write() does via a while loop for each character in
+     * a stream of given length).  - FM
+     */
     if ((HTPlain_lastraw == '\r') && c == '\n') {
 	HTPlain_lastraw = -1;
 	return;
@@ -135,18 +129,17 @@ static void HTPlain_put_character (
     HTPlain_lastraw = UCH(c);
     if (c == '\r') {
 	HText_appendCharacter(me->text, '\n');
-    } else if (TOASCII(UCH(c)) >= 127) {  /* S/390 -- gil -- 0305 */
+    } else if (TOASCII(UCH(c)) >= 127) {	/* S/390 -- gil -- 0305 */
 	/*
-	**  For now, don't repeat everything here
-	**  that has been done below - KW
-	*/
+	 * For now, don't repeat everything here that has been done below - KW
+	 */
 	HTPlain_write(me, &c, 1);
     } else if (HTCJK != NOCJK) {
 	HText_appendCharacter(me->text, c);
     } else if (TOASCII(UCH(c)) >= 127 && TOASCII(UCH(c)) < 161 &&
 	       HTPassHighCtrlRaw) {
 	HText_appendCharacter(me->text, c);
-    } else if (UCH(c) == CH_NBSP) { /* S/390 -- gil -- 0341 */
+    } else if (UCH(c) == CH_NBSP) {	/* S/390 -- gil -- 0341 */
 	HText_appendCharacter(me->text, ' ');
     } else if (UCH(c) == CH_SHY) {
 	return;
@@ -158,16 +151,16 @@ static void HTPlain_put_character (
 	    !((me->outUCLYhndl == LATIN1) ||
 	      (me->outUCI->enc & (UCT_CP_SUPERSETOF_LAT1)))) {
 	    int len, high, low, i, diff = 1;
-	    const char * name;
-	    UCode_t value = (UCode_t)FROMASCII((TOASCII(UCH(c)) - 160));
+	    const char *name;
+	    UCode_t value = (UCode_t) FROMASCII((TOASCII(UCH(c)) - 160));
 
 	    name = HTMLGetEntityName(value);
-	    len =  strlen(name);
+	    len = strlen(name);
 	    for (low = 0, high = HTML_dtd.number_of_entities;
-		high > low;
-		diff < 0 ? (low = i+1) : (high = i)) {
+		 high > low;
+		 diff < 0 ? (low = i + 1) : (high = i)) {
 		/* Binary search */
-		i = (low + (high-low)/2);
+		i = (low + (high - low) / 2);
 		diff = AS_ncmp(HTML_dtd.entity_names[i], name, len);
 		if (diff == 0) {
 		    HText_appendText(me->text,
@@ -185,17 +178,16 @@ static void HTPlain_put_character (
 #endif /* REMOVE_CR_ONLY */
 }
 
-
 /*	String handling
-**	---------------
-**
-*/
-static void HTPlain_put_string (HTStream *  me, const char*  s)
+ *	---------------
+ *
+ */
+static void HTPlain_put_string(HTStream *me, const char *s)
 {
 #ifdef REMOVE_CR_ONLY
     HText_appendText(me->text, s);
 #else
-    const char * p;
+    const char *p;
 
     if (s == NULL)
 	return;
@@ -205,15 +197,14 @@ static void HTPlain_put_string (HTStream *  me, const char*  s)
 #endif /* REMOVE_CR_ONLY */
 }
 
-
 /*
-**	Entry function for displayed text/plain and WWW_SOURCE strings. - FM
-**	---------------------------------------------------------------
-*/
-static void HTPlain_write (HTStream * me, const char* s, int l)
+ *	Entry function for displayed text/plain and WWW_SOURCE strings. - FM
+ *	---------------------------------------------------------------
+ */
+static void HTPlain_write(HTStream *me, const char *s, int l)
 {
-    const char * p;
-    const char * e = s+l;
+    const char *p;
+    const char *e = s + l;
     char c;
     unsigned c_unsign;
     BOOL chk;
@@ -223,8 +214,8 @@ static void HTPlain_write (HTStream * me, const char* s, int l)
     for (p = s; p < e; p++) {
 #ifdef REMOVE_CR_ONLY
 	/*
-	**  Append the whole string, but remove any \r's. - FM
-	*/
+	 * Append the whole string, but remove any \r's.  - FM
+	 */
 	if (*p != '\r') {
 	    HText_appendCharacter(me->text, *p);
 	}
@@ -244,25 +235,24 @@ static void HTPlain_write (HTStream * me, const char* s, int l)
 		HText_appendCharacter(me->text, '_');
 	    HTPlain_bs_pending = 0;
 	} else if (*p == '_') {
-		if (!HTPlain_bs_pending) {
-		    HTPlain_bs_pending = 2;
-		    HTPlain_lastraw = UCH(*p);
-		    continue;
+	    if (!HTPlain_bs_pending) {
+		HTPlain_bs_pending = 2;
+		HTPlain_lastraw = UCH(*p);
+		continue;
 #if 0
-		} else if (HTPlain_bs_pending != 2) {
-		    HTPlain_bs_pending--; /* 1 -> 0, 3 -> 2 */
-		    HTPlain_lastraw = UCH(*p);
-		    continue;
+	    } else if (HTPlain_bs_pending != 2) {
+		HTPlain_bs_pending--;	/* 1 -> 0, 3 -> 2 */
+		HTPlain_lastraw = UCH(*p);
+		continue;
 #endif
-		}
+	    }
 	}
 
 	/*
-	**  Try to handle lone LFs, CRLFs and lone CRs
-	**  as newline, and to deal with control, ASCII,
-	**  and 8-bit characters based on best guesses
-	**  of what's appropriate. - FM
-	*/
+	 * Try to handle lone LFs, CRLFs and lone CRs as newline, and to deal
+	 * with control, ASCII, and 8-bit characters based on best guesses of
+	 * what's appropriate.  - FM
+	 */
 	if ((HTPlain_lastraw == '\r') && *p == '\n') {
 	    HTPlain_lastraw = -1;
 	    continue;
@@ -278,14 +268,14 @@ static void HTPlain_write (HTStream * me, const char* s, int l)
 	    HTPlain_bs_pending = 0;
 	} else if (HTPlain_bs_pending == 1) {
 	    HTPlain_bs_pending = 0;
-	    continue;	/* ignore last two of "X\bX" or "X\b_" - kw */
+	    continue;		/* ignore last two of "X\bX" or "X\b_" - kw */
 	} else if (HTPlain_bs_pending == 3) {
 	    if (*p == '_') {
 		HTPlain_bs_pending = 2;
 		continue;	/* ignore last two of "_\b_" - kw */
 	    } else {
 		HTPlain_bs_pending = 0;
-				/* ignore first two of "_\bX" - kw */
+		/* ignore first two of "_\bX" - kw */
 	    }
 	} else if (HTPlain_bs_pending == 2) {
 	    HText_appendCharacter(me->text, '_');
@@ -301,57 +291,55 @@ static void HTPlain_write (HTStream * me, const char* s, int l)
 	    continue;
 	}
 	/*
-	**  Make sure the character is handled as Unicode
-	**  whenever that's appropriate.  - FM
-	*/
+	 * Make sure the character is handled as Unicode whenever that's
+	 * appropriate.  - FM
+	 */
 	c = *p;
 	c_unsign = UCH(c);
-	code = (UCode_t)c_unsign;
+	code = (UCode_t) c_unsign;
 	saved_char_in = '\0';
 	/*
-	**  Combine any UTF-8 multibytes into Unicode
-	**  to check for special characters. - FM
-	*/
+	 * Combine any UTF-8 multibytes into Unicode to check for special
+	 * characters.  - FM
+	 */
 	if (me->T.decode_utf8) {
 	    /*
-	    **	Combine UTF-8 into Unicode.
-	    **	Incomplete characters silently ignored.
-	    **	from Linux kernel's console.c - KW
-	    */
-	    if (TOASCII(c_unsign) > 127) {  /* S/390 -- gil -- 0371 */
+	     * Combine UTF-8 into Unicode.  Incomplete characters silently
+	     * ignored.  from Linux kernel's console.c - KW
+	     */
+	    if (TOASCII(c_unsign) > 127) {	/* S/390 -- gil -- 0371 */
 		/*
-		**  We have an octet from a multibyte character. - FM
-		*/
+		 * We have an octet from a multibyte character.  - FM
+		 */
 		if (me->utf_count > 0 && (c & 0xc0) == 0x80) {
 		    /*
-		    **	Adjust the UCode_t value, add the octet
-		    **	to the buffer, and decrement the byte
-		    **	count. - FM
-		    */
+		     * Adjust the UCode_t value, add the octet to the buffer,
+		     * and decrement the byte count.  - FM
+		     */
 		    me->utf_char = (me->utf_char << 6) | (c & 0x3f);
 		    me->utf_count--;
 		    *(me->utf_buf_p) = c;
 		    (me->utf_buf_p)++;
 		    if (me->utf_count == 0) {
 			/*
-			**  Got a complete multibyte character.
-			*/
+			 * Got a complete multibyte character.
+			 */
 			*(me->utf_buf_p) = '\0';
 			code = me->utf_char;
 			if (code > 0 && code < 256) {
-			    c = FROMASCII((char)code);
+			    c = FROMASCII((char) code);
 			    c_unsign = UCH(c);
 			}
 		    } else {
 			/*
-			**  Get the next byte. - FM
-			*/
+			 * Get the next byte.  - FM
+			 */
 			continue;
 		    }
 		} else {
 		    /*
-		    **	Start handling a new multibyte character. - FM
-		    */
+		     * Start handling a new multibyte character.  - FM
+		     */
 		    me->utf_buf_p[0] = c;
 		    me->utf_buf_p = &me->utf_buf[1];
 		    if ((*p & 0xe0) == 0xc0) {
@@ -371,74 +359,72 @@ static void HTPlain_write (HTStream * me, const char* s, int l)
 			me->utf_char = (c & 0x01);
 		    } else {
 			/*
-			 *  We got garbage, so ignore it. - FM
+			 * We got garbage, so ignore it.  - FM
 			 */
 			me->utf_count = 0;
 			me->utf_buf_p[0] = '\0';
 			me->utf_buf_p = me->utf_buf;
 		    }
 		    /*
-		    **	Get the next byte. - FM
-		    */
+		     * Get the next byte.  - FM
+		     */
 		    continue;
 		}
 	    } else if (me->utf_count > 0) {
 		/*
-		**  Got an ASCII character when expecting
-		**  UTF-8 multibytes, so ignore the buffered
-		**  multibye characters and fall through with
-		**  the current ASCII character. - FM
-		*/
+		 * Got an ASCII character when expecting UTF-8 multibytes, so
+		 * ignore the buffered multibye characters and fall through
+		 * with the current ASCII character.  - FM
+		 */
 		me->utf_count = 0;
 		me->utf_buf[0] = '\0';
 		me->utf_buf_p = me->utf_buf;
-		code = (UCode_t)c_unsign;
+		code = (UCode_t) c_unsign;
 	    } else {
 		/*
-		**  Got a valid ASCII character, so fall
-		**  through with it. - FM
-		*/
-		code = (UCode_t)c_unsign;
+		 * Got a valid ASCII character, so fall through with it.  - FM
+		 */
+		code = (UCode_t) c_unsign;
 	    }
 	}
 	/*
-	**  Convert characters from non-UTF-8 charsets
-	**  to Unicode (if appropriate). - FM
-	*/
+	 * Convert characters from non-UTF-8 charsets to Unicode (if
+	 * appropriate).  - FM
+	 */
 	if (!(me->T.decode_utf8 &&
 	      UCH(*p) > 127)) {
 #ifdef NOTDEFINED
 	    if (me->T.strip_raw_char_in)
 		saved_char_in = c;
 #endif /* NOTDEFINED */
-	if (me->T.trans_to_uni &&
-	    (TOASCII(code) >= LYlowest_eightbit[me->inUCLYhndl] ||  /* S/390 -- gil -- 0389 */
-	     (code < ' ' && code != 0 &&
-	     me->T.trans_C0_to_uni))) {
+	    if (me->T.trans_to_uni &&
+		(TOASCII(code) >= LYlowest_eightbit[me->inUCLYhndl] ||	/* S/390 -- gil -- 0389 */
+		 (code < ' ' && code != 0 &&
+		  me->T.trans_C0_to_uni))) {
 		/*
-		**  Convert the octet to Unicode. - FM
-		*/
-	    code = (UCode_t)UCTransToUni(c, me->inUCLYhndl);
-	    if (code > 0) {
+		 * Convert the octet to Unicode.  - FM
+		 */
+		code = (UCode_t) UCTransToUni(c, me->inUCLYhndl);
+		if (code > 0) {
 		    saved_char_in = c;
-		if (code < 256) {
-			c = FROMASCII((char)code);
+		    if (code < 256) {
+			c = FROMASCII((char) code);
 			c_unsign = UCH(c);
+		    }
 		}
-	    }
 	    } else if (code < 32 && code != 0 &&
 		       me->T.trans_C0_to_uni) {
 		/*
-		**  Quote from SGML.c:
-		**	"This else if may be too ugly to keep. - KW"
-		*/
+		 * Quote from SGML.c:
+		 * "This else if may be too ugly to keep.  - KW"
+		 */
 		if (me->T.trans_from_uni &&
 		    (((code = UCTransToUni(c, me->inUCLYhndl)) >= 32) ||
 		     (me->T.transp &&
 		      (code = UCTransToUni(c, me->inUCLYhndl)) > 0))) {
 		    saved_char_in = c;
 		    if (code < 256) {
-			c = FROMASCII((char)code);
+			c = FROMASCII((char) code);
 			c_unsign = UCH(c);
 		    }
 		} else {
@@ -467,23 +453,23 @@ static void HTPlain_write (HTStream * me, const char* s, int l)
 		    }
 		    me->utf_buf[0] = '\0';
 		    code = UCH(c);
-		} /*  Next line end of ugly stuff for C0. - KW */
+		}		/*  Next line end of ugly stuff for C0. - KW */
 	    } else {
 		me->utf_buf[0] = '\0';
 		code = UCH(c);
 	    }
 	}
 	/*
-	**  At this point we have either code in Unicode
-	**  (and c in latin1 if code is in the latin1 range),
-	**  or code and c will have to be passed raw.
-	*/
+	 * At this point we have either code in Unicode (and c in latin1 if
+	 * code is in the latin1 range), or code and c will have to be passed
+	 * raw.
+	 */
 
 	/*
-	**  If CJK mode is on, we'll assume the document matches
-	**  the user's display character set, and if not, the
-	**  user should toggle off raw/CJK mode to reload. - FM
-	*/
+	 * If CJK mode is on, we'll assume the document matches the user's
+	 * display character set, and if not, the user should toggle off
+	 * raw/CJK mode to reload.  - FM
+	 */
 	if (HTCJK != NOCJK) {
 	    HText_appendCharacter(me->text, c);
 
@@ -492,84 +478,85 @@ static void HTPlain_write (HTStream * me, const char* s, int l)
 #define PASS8859SPECL me->T.pass_160_173_raw
 #define PASSHI8BIT (HTPassEightBitRaw || \
 		    (me->T.do_8bitraw && !me->T.trans_from_uni))
-	/*
-	**  If HTPassHighCtrlRaw is set (e.g., for KOI8-R) assume the
-	**  document matches and pass 127-160 8-bit characters.  If it
-	**  doesn't match, the user should toggle raw/CJK mode off. - FM
-	*/
-	} else if (TOASCII(code) >= 127 && TOASCII(code) < 161 &&  /* S/390 -- gil -- 0427 */
+	    /*
+	     * If HTPassHighCtrlRaw is set (e.g., for KOI8-R) assume the
+	     * document matches and pass 127-160 8-bit characters.  If it
+	     * doesn't match, the user should toggle raw/CJK mode off.  - FM
+	     */
+	} else if (TOASCII(code) >= 127 && TOASCII(code) < 161 &&	/* S/390 -- gil -- 0427 */
 		   PASSHICTRL && PASS8859SPECL) {
 	    HText_appendCharacter(me->text, c);
 	} else if (code == CH_SHY && PASS8859SPECL) {
 	    HText_appendCharacter(me->text, c);
-	/*
-	**  If neither HTPassHighCtrlRaw nor CJK is set, play it safe
-	**  and treat 160 (nbsp) as an ASCII space (32). - FM
-	*/
+	    /*
+	     * If neither HTPassHighCtrlRaw nor CJK is set, play it safe and
+	     * treat 160 (nbsp) as an ASCII space (32).  - FM
+	     */
 	} else if (code == CH_NBSP) {
 	    HText_appendCharacter(me->text, ' ');
-	/*
-	**  If neither HTPassHighCtrlRaw nor CJK is set, play it safe
-	**  and ignore 173 (shy). - FM
-	**  Now only ignore it for color style, which doesn't handle it anyway.
-	**  Otherwise pass it on as LY_SOFT_HYPHEN and let HText deal with it.
-	**  It should be either ignored, or displayed as a hyphen if it was
-	**  indeed at the end of a line.  Well it should. - kw
-	*/
+	    /*
+	     * If neither HTPassHighCtrlRaw nor CJK is set, play it safe and
+	     * ignore 173 (shy).  - FM
+	     * Now only ignore it for color style, which doesn't handle it
+	     * anyway.  Otherwise pass it on as LY_SOFT_HYPHEN and let HText
+	     * deal with it.  It should be either ignored, or displayed as a
+	     * hyphen if it was indeed at the end of a line.  Well it should. 
+	     * - kw
+	     */
 	} else if (code == CH_SHY) {
 #ifndef USE_COLOR_STYLE
 	    HText_appendCharacter(me->text, LY_SOFT_HYPHEN);
 #endif
 	    continue;
-	/*
-	**  If we get to here, pass the displayable ASCII characters. - FM
-	*/
+	    /*
+	     * If we get to here, pass the displayable ASCII characters.  - FM
+	     */
 	} else if ((code >= ' ' && TOASCII(code) < 127) ||
 		   (PASSHI8BIT &&
 		    c >= LYlowest_eightbit[me->outUCLYhndl]) ||
 		   *p == '\n' || *p == '\t') {
 	    HText_appendCharacter(me->text, c);
-	/*
-	**  Use an ASCII space (32) for ensp, emsp or thinsp. - FM
-	*/
+	    /*
+	     * Use an ASCII space (32) for ensp, emsp or thinsp.  - FM
+	     */
 	} else if (code == 8194 || code == 8195 || code == 8201) {
 	    HText_appendCharacter(me->text, ' ');
-	/*
-	**  If we want the raw character, pass it now. - FM
-	*/
+	    /*
+	     * If we want the raw character, pass it now.  - FM
+	     */
 	} else if (me->T.use_raw_char_in && saved_char_in) {
 	    HText_appendCharacter(me->text, saved_char_in);
 /******************************************************************
- *   I. LATIN-1 OR UCS2  TO  DISPLAY CHARSET
+ * I.  LATIN-1 OR UCS2 TO DISPLAY CHARSET
  ******************************************************************/
 	} else if ((chk = (BOOL) (me->T.trans_from_uni && code >= 160)) &&
 		   (uck = UCTransUniChar(code,
-					 me->outUCLYhndl)) >= ' ' &&  /* S/390 -- gil -- 0464 */
+					 me->outUCLYhndl)) >= ' ' &&	/* S/390 -- gil -- 0464 */
 		   uck < 256) {
 	    CTRACE((tfp, "UCTransUniChar returned 0x%.2lX:'%c'.\n",
-			uck, FROMASCII((char)uck)));
-	    HText_appendCharacter(me->text, ((char)(uck & 0xff)));
+		    uck, FROMASCII((char) uck)));
+	    HText_appendCharacter(me->text, ((char) (uck & 0xff)));
 	} else if (chk &&
 		   (uck == -4 ||
-		    (me->T.repl_translated_C0 && uck > 0 && uck < ' ')) &&  /* S/390 -- gil -- 0481 */
-		   /*
-		   **  Not found; look for replacement string.
-		   */
+		    (me->T.repl_translated_C0 && uck > 0 && uck < ' ')) &&	/* S/390 -- gil -- 0481 */
+	    /*
+	     * Not found; look for replacement string.
+	     */
 		   (uck = UCTransUniCharStr(replace_buf, 60, code,
 					    me->outUCLYhndl, 0) >= 0)) {
 	    /*
-	    **	No further tests for valididy - assume that whoever
-	    **	defined replacement strings knew what she was doing.
-	    */
+	     * No further tests for valididy - assume that whoever defined
+	     * replacement strings knew what she was doing.
+	     */
 	    HText_appendText(me->text, replace_buf);
-	/*
-	**  If we get to here, and should have translated,
-	**  translation has failed so far.
-	*/
-	} else if (chk && TOASCII(code) > 127 && me->T.output_utf8) {  /* S/390 -- gil -- 0498 */
 	    /*
-	    **	We want UTF-8 output, so do it now. - FM
-	    */
+	     * If we get to here, and should have translated, translation has
+	     * failed so far.
+	     */
+	} else if (chk && TOASCII(code) > 127 && me->T.output_utf8) {	/* S/390 -- gil -- 0498 */
+	    /*
+	     * We want UTF-8 output, so do it now.  - FM
+	     */
 	    if (*me->utf_buf) {
 		HText_appendText(me->text, me->utf_buf);
 		me->utf_buf[0] = '\0';
@@ -578,8 +565,9 @@ static void HTPlain_write (HTStream * me, const char* s, int l)
 		HText_appendText(me->text, replace_buf);
 	    } else {
 		/*
-		**  Out of luck, so use the UHHH notation (ugh). - gil
-		*/  /* S/390 -- gil -- 0517 */
+		 * Out of luck, so use the UHHH notation (ugh).  - gil
+		 */
+		/* S/390 -- gil -- 0517 */
 		sprintf(replace_buf, "U%.2lX", TOASCII(code));
 		HText_appendText(me->text, replace_buf);
 	    }
@@ -588,33 +576,32 @@ static void HTPlain_write (HTStream * me, const char* s, int l)
 		   UCH(*p) >= 192 &&
 		   UCH(*p) < 255) {
 	    /*
-	    **	KOI special: strip high bit, gives
-	    **	(somewhat) readable ASCII.
-	    */
-	    HText_appendCharacter(me->text, (char)(*p & 0x7f));
+	     * KOI special:  strip high bit, gives (somewhat) readable ASCII.
+	     */
+	    HText_appendCharacter(me->text, (char) (*p & 0x7f));
 #endif /* NOTDEFINED */
 	    /*
-	    **  If we don't actually want the character,
-	    **  make it safe and output that now. - FM
-	    */
+	     * If we don't actually want the character, make it safe and output
+	     * that now.  - FM
+	     */
 	} else if ((c_unsign > 0 &&
-		      (int) c_unsign < LYlowest_eightbit[me->outUCLYhndl]) ||
-		      (me->T.trans_from_uni && !HTPassEightBitRaw)) {
+		    (int) c_unsign < LYlowest_eightbit[me->outUCLYhndl]) ||
+		   (me->T.trans_from_uni && !HTPassEightBitRaw)) {
 	    /*
-	    **	If we do not have the "7-bit approximations" as our
-	    **	output character set (in which case we did it already)
-	    **	seek a translation for that.  Otherwise, or if the
-	    **	translation fails, use UHHH notation. - FM
-	    */
+	     * If we do not have the "7-bit approximations" as our output
+	     * character set (in which case we did it already) seek a
+	     * translation for that.  Otherwise, or if the translation fails,
+	     * use UHHH notation.  - FM
+	     */
 	    if ((chk = (BOOL) (me->outUCLYhndl !=
-			UCGetLYhndl_byMIME("us-ascii"))) &&
-		   (uck = UCTransUniChar(code,
-					 UCGetLYhndl_byMIME("us-ascii")))
-				      >= ' ' && TOASCII(uck) < 127) {  /* S/390 -- gil -- 0535 */
+			       UCGetLYhndl_byMIME("us-ascii"))) &&
+		(uck = UCTransUniChar(code,
+				      UCGetLYhndl_byMIME("us-ascii")))
+		>= ' ' && TOASCII(uck) < 127) {		/* S/390 -- gil -- 0535 */
 		/*
-		**  Got an ASCII character (yippey). - FM
-		*/
-		c = FROMASCII((char)uck);
+		 * Got an ASCII character (yippey).  - FM
+		 */
+		c = FROMASCII((char) uck);
 		HText_appendCharacter(me->text, c);
 	    } else if ((chk && uck == -4) &&
 		       (uck = UCTransUniCharStr(replace_buf,
@@ -622,32 +609,31 @@ static void HTPlain_write (HTStream * me, const char* s, int l)
 						UCGetLYhndl_byMIME("us-ascii"),
 						0) >= 0)) {
 		/*
-		**  Got a repacement string (yippey). - FM
-		*/
+		 * Got a repacement string (yippey).  - FM
+		 */
 		HText_appendText(me->text, replace_buf);
 	    } else if (code == 8204 || code == 8205) {
 		/*
-		**	Ignore 8204 (zwnj) or 8205 (zwj), if we get to here. - FM
-		*/
+		 * Ignore 8204 (zwnj) or 8205 (zwj), if we get to here.  - FM
+		 */
 		CTRACE((tfp, "HTPlain_write: Ignoring '%ld'.\n", code));
 	    } else if (code == 8206 || code == 8207) {
 		/*
-		**	Ignore 8206 (lrm) or 8207 (rlm), if we get to here. - FM
-		*/
+		 * Ignore 8206 (lrm) or 8207 (rlm), if we get to here.  - FM
+		 */
 		CTRACE((tfp, "HTPlain_write: Ignoring '%ld'.\n", code));
 	    } else {
 		/*
-		**  Out of luck, so use the UHHH notation (ugh). - FM
-		*/
-			/* do not print UHHH for now
-			sprintf(replace_buf, "U%.2lX", code);
-			HText_appendText(me->text, replace_buf);
-			*/
-		}
-		/*
-		**  If we get to here and have a monobyte character,
-		**  pass it. - FM
-		*/
+		 * Out of luck, so use the UHHH notation (ugh).  - FM
+		 */
+		/* do not print UHHH for now
+		   sprintf(replace_buf, "U%.2lX", code);
+		   HText_appendText(me->text, replace_buf);
+		 */
+	    }
+	    /*
+	     * If we get to here and have a monobyte character, pass it.  - FM
+	     */
 	} else if (c_unsign != 0 && c_unsign < 256) {
 	    HText_appendCharacter(me->text, c);
 	}
@@ -656,13 +642,12 @@ static void HTPlain_write (HTStream * me, const char* s, int l)
 }
 
 /*	Free an HTML object
-**	-------------------
-**
-**	Note that the SGML parsing context is freed, but the created object is
-**	not, as it takes on an existence of its own unless explicitly freed.
-*/
-static void HTPlain_free (
-	HTStream *	me)
+ *	-------------------
+ *
+ *	Note that the SGML parsing context is freed, but the created object is
+ *	not, as it takes on an existence of its own unless explicitly freed.
+ */
+static void HTPlain_free(HTStream *me)
 {
     if (HTPlain_bs_pending >= 2)
 	HText_appendCharacter(me->text, '_');
@@ -671,34 +656,31 @@ static void HTPlain_free (
 
 /*	End writing
 */
-static void HTPlain_abort (
-	HTStream *	me,
-	HTError	e GCC_UNUSED)
+static void HTPlain_abort(HTStream *me, HTError e GCC_UNUSED)
 {
     HTPlain_free(me);
 }
 
 /*		Structured Object Class
-**		-----------------------
-*/
+ *		-----------------------
+ */
 const HTStreamClass HTPlain =
 {
-	"PlainPresenter",
-	HTPlain_free,
-	HTPlain_abort,
-	HTPlain_put_character,	HTPlain_put_string, HTPlain_write,
+    "PlainPresenter",
+    HTPlain_free,
+    HTPlain_abort,
+    HTPlain_put_character, HTPlain_put_string, HTPlain_write,
 };
 
 /*		New object
-**		----------
-*/
-HTStream* HTPlainPresent (
-	HTPresentation *	pres GCC_UNUSED,
-	HTParentAnchor *	anchor,
-	HTStream *		sink GCC_UNUSED)
+ *		----------
+ */
+HTStream *HTPlainPresent(HTPresentation *pres GCC_UNUSED, HTParentAnchor *anchor,
+			 HTStream *sink GCC_UNUSED)
 {
 
-    HTStream* me = (HTStream*)malloc(sizeof(*me));
+    HTStream *me = (HTStream *) malloc(sizeof(*me));
+
     if (me == NULL)
 	outofmem(__FILE__, "HTPlain_new");
     me->isa = &HTPlain;
@@ -707,19 +689,19 @@ HTStream* HTPlainPresent (
 
     me->utf_count = 0;
     me->utf_char = 0;
-    me->utf_buf[0] = me->utf_buf[6] =me->utf_buf[7] = '\0';
+    me->utf_buf[0] = me->utf_buf[6] = me->utf_buf[7] = '\0';
     me->utf_buf_p = me->utf_buf;
-    me->outUCLYhndl = HTAnchor_getUCLYhndl(anchor,UCT_STAGE_HTEXT);
-    me->inUCLYhndl = HTAnchor_getUCLYhndl(anchor,UCT_STAGE_PARSER);
+    me->outUCLYhndl = HTAnchor_getUCLYhndl(anchor, UCT_STAGE_HTEXT);
+    me->inUCLYhndl = HTAnchor_getUCLYhndl(anchor, UCT_STAGE_PARSER);
     HTPlain_getChartransInfo(me, anchor);
     UCSetTransParams(&me->T,
 		     me->inUCLYhndl, me->inUCI,
 		     me->outUCLYhndl,
-		     HTAnchor_getUCInfoStage(anchor,UCT_STAGE_HTEXT));
+		     HTAnchor_getUCInfoStage(anchor, UCT_STAGE_HTEXT));
 
     me->text = HText_new(anchor);
-    HText_setStyle(me->text, LYstyles(HTML_XMP) );
+    HText_setStyle(me->text, LYstyles(HTML_XMP));
     HText_beginAppend(me->text);
 
-    return (HTStream*) me;
+    return (HTStream *) me;
 }
diff --git a/WWW/Library/Implementation/HTPlain.h b/WWW/Library/Implementation/HTPlain.h
index 163b48e1..92dcc061 100644
--- a/WWW/Library/Implementation/HTPlain.h
+++ b/WWW/Library/Implementation/HTPlain.h
@@ -8,9 +8,8 @@
 #include <HTStream.h>
 #include <HTAnchor.h>
 
-extern HTStream* HTPlainPresent (
-        HTPresentation *        pres,
-        HTParentAnchor *        anchor,
-        HTStream *              sink);
+extern HTStream *HTPlainPresent(HTPresentation *pres,
+				HTParentAnchor *anchor,
+				HTStream *sink);
 
 #endif /* HTPLAIN_H */
diff --git a/WWW/Library/Implementation/HTRules.c b/WWW/Library/Implementation/HTRules.c
index 3ba959d9..8b1d8248 100644
--- a/WWW/Library/Implementation/HTRules.c
+++ b/WWW/Library/Implementation/HTRules.c
@@ -1,23 +1,23 @@
 /*	Configuration manager for Hypertext Daemon		HTRules.c
-**	==========================================
-**
-**
-** History:
-**	 3 Jun 91	Written TBL
-**	10 Aug 91	Authorisation added after Daniel Martin (pass, fail)
-**			Rule order in file changed
-**			Comments allowed with # on 1st char of rule line
-**	17 Jun 92	Bug fix: pass and fail failed if didn't contain '*' TBL
-**	 1 Sep 93	Bug fix: no memory check - Nathan Torkington
-**			BYTE_ADDRESSING removed - Arthur Secret
-**	11 Sep 93  MD	Changed %i into %d in debug printf.
-**			VMS does not recognize %i.
-**			Bug Fix: in case of PASS, only one parameter to printf.
-**	19 Sep 93  AL	Added Access Authorization stuff.
-**	 1 Nov 93  AL	Added htbin.
-**	25 May 99  KW	Added redirect for lynx.
-**
-*/
+ *	==========================================
+ *
+ *
+ * History:
+ *	 3 Jun 91	Written TBL
+ *	10 Aug 91	Authorisation added after Daniel Martin (pass, fail)
+ *			Rule order in file changed
+ *			Comments allowed with # on 1st char of rule line
+ *	17 Jun 92	Bug fix: pass and fail failed if didn't contain '*' TBL
+ *	 1 Sep 93	Bug fix: no memory check - Nathan Torkington
+ *			BYTE_ADDRESSING removed - Arthur Secret
+ *	11 Sep 93  MD	Changed %i into %d in debug printf.
+ *			VMS does not recognize %i.
+ *			Bug Fix: in case of PASS, only one parameter to printf.
+ *	19 Sep 93  AL	Added Access Authorization stuff.
+ *	 1 Nov 93  AL	Added htbin.
+ *	25 May 99  KW	Added redirect for lynx.
+ *
+ */
 
 #include <HTUtils.h>
 
@@ -30,67 +30,65 @@
 
 #define LINE_LENGTH 256
 
-
 typedef struct _rule {
-	struct _rule *	next;
-	HTRuleOp	op;
-	char *		pattern;
-	char *		equiv;
-	char *		condition_op; /* as strings - may be inefficient, */
-	char *		condition;    /* but this is not for a server - kw */
+    struct _rule *next;
+    HTRuleOp op;
+    char *pattern;
+    char *equiv;
+    char *condition_op;		/* as strings - may be inefficient, */
+    char *condition;		/* but this is not for a server - kw */
 } rule;
 
 #ifndef NO_RULES
 
-#include <HTTP.h> /* for redirecting_url, indirectly HTPermitRedir - kw */
-#include <LYGlobalDefs.h> /* for LYUserSpecifiedURL - kw */
+#include <HTTP.h>		/* for redirecting_url, indirectly HTPermitRedir - kw */
+#include <LYGlobalDefs.h>	/* for LYUserSpecifiedURL - kw */
 #include <LYUtils.h>		/* for LYFixCursesOn - kw */
 #include <HTAlert.h>
 
 /*	Global variables
-**	----------------
-*/
-char *HTBinDir = NULL;	/* Physical /htbin directory path.	*/
-				/* In future this should not be global. */
-char *HTSearchScript = NULL;	/* Search script name.		*/
+ *	----------------
+ */
+char *HTBinDir = NULL;		/* Physical /htbin directory path.      */
 
+				/* In future this should not be global. */
+char *HTSearchScript = NULL;	/* Search script name.          */
 
 /*	Module-wide variables
-**	---------------------
-*/
+ *	---------------------
+ */
+
+static rule *rules = 0;		/* Pointer to first on list */
 
-static rule * rules = 0;	/* Pointer to first on list */
 #ifndef PUT_ON_HEAD
-static rule * rule_tail = 0;	/* Pointer to last on list */
+static rule *rule_tail = 0;	/* Pointer to last on list */
 #endif
 
-
 /*	Add rule to the list					HTAddRule()
-**	--------------------
-**
-**  On entry,
-**	pattern		points to 0-terminated string containing a single "*"
-**	equiv		points to the equivalent string with * for the
-**			place where the text matched by * goes.
-**  On exit,
-**	returns		0 if success, -1 if error.
-*/
-
-int HTAddRule (
-    HTRuleOp		op,
-    const char *	pattern,
-    const char *	equiv,
-    const char *	cond_op,
-    const char *	cond)
-{ /* BYTE_ADDRESSING removed and memory check - AS - 1 Sep 93 */
-    rule *	temp;
-    char *	pPattern = NULL;
+ *	--------------------
+ *
+ *  On entry,
+ *	pattern		points to 0-terminated string containing a single "*"
+ *	equiv		points to the equivalent string with * for the
+ *			place where the text matched by * goes.
+ *  On exit,
+ *	returns		0 if success, -1 if error.
+ */
+
+int HTAddRule(HTRuleOp op, const char *pattern,
+	      const char *equiv,
+	      const char *cond_op,
+	      const char *cond)
+{				/* BYTE_ADDRESSING removed and memory check - AS - 1 Sep 93 */
+    rule *temp;
+    char *pPattern = NULL;
 
     temp = typecalloc(rule);
-    if (temp==NULL)
+    if (temp == NULL)
 	outofmem(__FILE__, "HTAddRule");
     if (equiv) {		/* Two operands */
-	char *	pEquiv = NULL;
+	char *pEquiv = NULL;
+
 	StrAllocCopy(pEquiv, equiv);
 	temp->equiv = pEquiv;
     } else {
@@ -125,29 +123,30 @@ int HTAddRule (
     rules = temp;
 #else
     temp->next = 0;
-    if (rule_tail) rule_tail->next = temp;
-    else rules = temp;
+    if (rule_tail)
+	rule_tail->next = temp;
+    else
+	rules = temp;
     rule_tail = temp;
 #endif
 
-
     return 0;
 }
 
-
 /*	Clear all rules						HTClearRules()
-**	---------------
-**
-** On exit,
-**	There are no rules
-**
-** See also
-**	HTAddRule()
-*/
-void HTClearRules (void)
+ *	---------------
+ *
+ * On exit,
+ *	There are no rules
+ *
+ * See also
+ *	HTAddRule()
+ */
+void HTClearRules(void)
 {
     while (rules) {
-	rule * temp = rules;
+	rule *temp = rules;
+
 	rules = temp->next;
 	FREE(temp->pattern);
 	FREE(temp->equiv);
@@ -160,15 +159,15 @@ void HTClearRules (void)
 #endif
 }
 
-static BOOL rule_cond_ok (
-    rule *	 r)
+static BOOL rule_cond_ok(rule * r)
 {
     BOOL result;
+
     if (!r->condition_op)
 	return YES;
     if (strcmp(r->condition_op, "if") && strcmp(r->condition_op, "unless")) {
 	CTRACE((tfp, "....... rule ignored, unrecognized `%s'!\n",
-	       r->condition_op));
+		r->condition_op));
 	return NO;
     }
     if (!strcmp(r->condition, "redirected"))
@@ -177,7 +176,7 @@ static BOOL rule_cond_ok (
 	result = LYUserSpecifiedURL;
     else {
 	CTRACE((tfp, "....... rule ignored, unrecognized `%s %s'!\n",
-	       r->condition_op, NONNULL(r->condition)));
+		r->condition_op, NONNULL(r->condition)));
 	return NO;
     }
     if (!strcmp(r->condition_op, "if"))
@@ -186,29 +185,29 @@ static BOOL rule_cond_ok (
 	return (BOOL) (!result);
 
 }
+
 /*	Translate by rules					HTTranslate()
-**	------------------
-**
-**	The most recently defined rules are applied first.
-**
-** On entry,
-**	required	points to a string whose equivalent value is needed
-** On exit,
-**	returns		the address of the equivalent string allocated from
-**			the heap which the CALLER MUST FREE. If no translation
-**			occurred, then it is a copy of the original.
-** NEW FEATURES:
-**			When a "protect" or "defprot" rule is matched,
-**			a call to HTAA_setCurrentProtection() or
-**			HTAA_setDefaultProtection() is made to notify
-**			the Access Authorization module that the file is
-**			protected, and so it knows how to handle it.
-**								-- AL
-*/
-char * HTTranslate (
-    const char *	required)
+ *	------------------
+ *
+ *	The most recently defined rules are applied first.
+ *
+ * On entry,
+ *	required	points to a string whose equivalent value is needed
+ * On exit,
+ *	returns		the address of the equivalent string allocated from
+ *			the heap which the CALLER MUST FREE. If no translation
+ *			occurred, then it is a copy of the original.
+ * NEW FEATURES:
+ *			When a "protect" or "defprot" rule is matched,
+ *			a call to HTAA_setCurrentProtection() or
+ *			HTAA_setDefaultProtection() is made to notify
+ *			the Access Authorization module that the file is
+ *			protected, and so it knows how to handle it.
+ *								-- AL
+ */
+char *HTTranslate(const char *required)
 {
-    rule * r;
+    rule *r;
     char *current = NULL;
     char *msgtmp = NULL, *pMsg;
     int proxy_none_flag = 0;
@@ -218,25 +217,30 @@ char * HTTranslate (
 
     HTAA_clearProtections();	/* Reset from previous call -- AL */
 
-    for(r = rules; r; r = r->next) {
-	char * p = r->pattern;
-	int m=0;   /* Number of characters matched against wildcard */
-	const char * q = current;
-	for(;*p && *q; p++, q++) {   /* Find first mismatch */
-	    if (*p!=*q) break;
+    for (r = rules; r; r = r->next) {
+	char *p = r->pattern;
+	int m = 0;		/* Number of characters matched against wildcard */
+	const char *q = current;
+
+	for (; *p && *q; p++, q++) {	/* Find first mismatch */
+	    if (*p != *q)
+		break;
 	}
 
-	if (*p == '*') {		/* Match up to wildcard */
-	    m = strlen(q) - strlen(p+1); /* Amount to match to wildcard */
-	    if(m<0) continue;		/* tail is too short to match */
-	    if (0!=strcmp(q+m, p+1)) continue;	/* Tail mismatch */
-	} else				/* Not wildcard */
-	    if (*p != *q) continue;	/* plain mismatch: go to next rule */
+	if (*p == '*') {	/* Match up to wildcard */
+	    m = strlen(q) - strlen(p + 1);	/* Amount to match to wildcard */
+	    if (m < 0)
+		continue;	/* tail is too short to match */
+	    if (0 != strcmp(q + m, p + 1))
+		continue;	/* Tail mismatch */
+	} else
+	    /* Not wildcard */ if (*p != *q)
+	    continue;		/* plain mismatch: go to next rule */
 
 	if (!rule_cond_ok(r))	/* check condition, next rule if false - kw */
 	    continue;
 
-	switch (r->op) {		/* Perform operation */
+	switch (r->op) {	/* Perform operation */
 
 #ifdef ACCESS_AUTH
 	case HT_DefProt:
@@ -248,11 +252,11 @@ char * HTTranslate (
 		char *prot_file = NULL;
 
 		CTRACE((tfp, "HTRule: `%s' matched %s %s: `%s'\n",
-			    current,
-			    (r->op==HT_Protect ? "Protect" : "DefProt"),
-			    "rule, setup",
-			    (r->equiv ? r->equiv :
-			     (r->op==HT_Protect ?"DEFAULT" :"NULL!!"))));
+			current,
+			(r->op == HT_Protect ? "Protect" : "DefProt"),
+			"rule, setup",
+			(r->equiv ? r->equiv :
+			 (r->op == HT_Protect ? "DEFAULT" : "NULL!!"))));
 
 		if (r->equiv) {
 		    StrAllocCopy(local_copy, r->equiv);
@@ -273,40 +277,50 @@ char * HTTranslate (
 	    break;
 #endif /* ACCESS_AUTH */
 
-	case HT_UserMsg:		/* Produce message immediately */
+	case HT_UserMsg:	/* Produce message immediately */
 	    LYFixCursesOn("show rule message:");
 	    HTUserMsg2((r->equiv ? r->equiv : "Rule: %s"), current);
 	    break;
-	case HT_InfoMsg:		/* Produce messages immediately */
+	case HT_InfoMsg:	/* Produce messages immediately */
 	case HT_Progress:
 	case HT_Alert:
-	    LYFixCursesOn("show rule message:"); /* and fall through */
+	    LYFixCursesOn("show rule message:");	/* and fall through */
 	case HT_AlwaysAlert:
 	    pMsg = r->equiv ? r->equiv :
-		(r->op==HT_AlwaysAlert) ? "%s" : "Rule: %s";
+		(r->op == HT_AlwaysAlert) ? "%s" : "Rule: %s";
 	    if (strchr(pMsg, '%')) {
 		HTSprintf0(&msgtmp, pMsg, current);
 		pMsg = msgtmp;
 	    }
-	    switch (r->op) {		/* Actually produce message */
-	    case HT_InfoMsg:	HTInfoMsg(pMsg);	break;
-	    case HT_Progress:	HTProgress(pMsg);	break;
-	    case HT_Alert:	HTAlert(pMsg);		break;
-	    case HT_AlwaysAlert: HTAlwaysAlert("Rule alert:", pMsg);	break;
-	    default: break;
+	    switch (r->op) {	/* Actually produce message */
+	    case HT_InfoMsg:
+		HTInfoMsg(pMsg);
+		break;
+	    case HT_Progress:
+		HTProgress(pMsg);
+		break;
+	    case HT_Alert:
+		HTAlert(pMsg);
+		break;
+	    case HT_AlwaysAlert:
+		HTAlwaysAlert("Rule alert:", pMsg);
+		break;
+	    default:
+		break;
 	    }
 	    FREE(msgtmp);
 	    break;
 
-	case HT_PermitRedir:			/* Set special flag */
+	case HT_PermitRedir:	/* Set special flag */
 	    permitredir_flag = 1;
 	    CTRACE((tfp, "HTRule: Mark for redirection permitted\n"));
 	    break;
 
-	case HT_Pass:				/* Authorised */
+	case HT_Pass:		/* Authorised */
 	    if (!r->equiv) {
 		if (proxy_none_flag) {
-		    char * temp = NULL;
+		    char *temp = NULL;
+
 		    StrAllocCopy(temp, "NoProxy=");
 		    StrAllocCat(temp, current);
 		    FREE(current);
@@ -320,93 +334,97 @@ char * HTTranslate (
 	case HT_Map:
 	case HT_Redirect:
 	case HT_RedirectPerm:
-	    if (*p == *q) { /* End of both strings, no wildcard */
-		  CTRACE((tfp, "For `%s' using `%s'\n", current, r->equiv));
-		  StrAllocCopy(current, r->equiv); /* use entire translation */
+	    if (*p == *q) {	/* End of both strings, no wildcard */
+		CTRACE((tfp, "For `%s' using `%s'\n", current, r->equiv));
+		StrAllocCopy(current, r->equiv);	/* use entire translation */
 	    } else {
-		  char * ins = strchr(r->equiv, '*');	/* Insertion point */
-		  if (ins) {	/* Consistent rule!!! */
-			char * temp = NULL;
-
-			HTSprintf0(&temp, "%.*s%.*s%s",
-				   ins - r->equiv,
-				   r->equiv,
-				   m,
-				   q,
-				   ins + 1);
-			CTRACE((tfp, "For `%s' using `%s'\n",
-				    current, temp));
-			FREE(current);
-			current = temp;			/* Use this */
-
-		    } else {	/* No insertion point */
-			char * temp = NULL;
-
-			StrAllocCopy(temp, r->equiv);
-			CTRACE((tfp, "For `%s' using `%s'\n",
-						current, temp));
-			FREE(current);
-			current = temp;			/* Use this */
-		    } /* If no insertion point exists */
-		}
-		if (r->op == HT_Pass) {
-		    if (proxy_none_flag) {
-			char * temp = NULL;
-			StrAllocCopy(temp, "NoProxy=");
-			StrAllocCat(temp, current);
-			FREE(current);
-			current = temp;
-		    }
-		    CTRACE((tfp, "HTRule: ...and pass `%s'\n",
-				current));
-		    return current;
-		} else if (r->op == HT_Redirect) {
-		    CTRACE((tfp, "HTRule: ...and redirect to `%s'\n",
-				current));
-		    redirecting_url = current;
-		    HTPermitRedir = (BOOL) (permitredir_flag == 1);
-		    return (char *)0;
-		} else if (r->op == HT_RedirectPerm) {
-		    CTRACE((tfp, "HTRule: ...and redirect like 301 to `%s'\n",
-				current));
-		    redirecting_url = current;
-		    permanent_redirection = TRUE;
-		    HTPermitRedir = (BOOL) (permitredir_flag == 1);
-		    return (char *)0;
-		}
-		break;
+		char *ins = strchr(r->equiv, '*');	/* Insertion point */
+
+		if (ins) {	/* Consistent rule!!! */
+		    char *temp = NULL;
+
+		    HTSprintf0(&temp, "%.*s%.*s%s",
+			       ins - r->equiv,
+			       r->equiv,
+			       m,
+			       q,
+			       ins + 1);
+		    CTRACE((tfp, "For `%s' using `%s'\n",
+			    current, temp));
+		    FREE(current);
+		    current = temp;	/* Use this */
 
-	case HT_UseProxy:
-		if (r->equiv && 0==strcasecomp(r->equiv, "none")) {
-		    CTRACE((tfp, "For `%s' will not use proxy\n", current));
-		    proxy_none_flag = 1;
-		} else if (proxy_none_flag) {
-		    CTRACE((tfp, "For `%s' proxy server ignored: %s\n",
-			   current,
-			   NONNULL(r->equiv)));
-		} else {
-		    char * temp = NULL;
-		    StrAllocCopy(temp, "Proxied=");
-		    StrAllocCat(temp, r->equiv);
+		} else {	/* No insertion point */
+		    char *temp = NULL;
+
+		    StrAllocCopy(temp, r->equiv);
+		    CTRACE((tfp, "For `%s' using `%s'\n",
+			    current, temp));
+		    FREE(current);
+		    current = temp;	/* Use this */
+		}		/* If no insertion point exists */
+	    }
+	    if (r->op == HT_Pass) {
+		if (proxy_none_flag) {
+		    char *temp = NULL;
+
+		    StrAllocCopy(temp, "NoProxy=");
 		    StrAllocCat(temp, current);
-		    CTRACE((tfp, "HTRule: proxy server found: %s\n",
-			   NONNULL(r->equiv)));
 		    FREE(current);
-		    return temp;
+		    current = temp;
 		}
-		break;
+		CTRACE((tfp, "HTRule: ...and pass `%s'\n",
+			current));
+		return current;
+	    } else if (r->op == HT_Redirect) {
+		CTRACE((tfp, "HTRule: ...and redirect to `%s'\n",
+			current));
+		redirecting_url = current;
+		HTPermitRedir = (BOOL) (permitredir_flag == 1);
+		return (char *) 0;
+	    } else if (r->op == HT_RedirectPerm) {
+		CTRACE((tfp, "HTRule: ...and redirect like 301 to `%s'\n",
+			current));
+		redirecting_url = current;
+		permanent_redirection = TRUE;
+		HTPermitRedir = (BOOL) (permitredir_flag == 1);
+		return (char *) 0;
+	    }
+	    break;
 
-	case HT_Invalid:
-	case HT_Fail:				/* Unauthorised */
-		CTRACE((tfp, "HTRule: *** FAIL `%s'\n", current));
+	case HT_UseProxy:
+	    if (r->equiv && 0 == strcasecomp(r->equiv, "none")) {
+		CTRACE((tfp, "For `%s' will not use proxy\n", current));
+		proxy_none_flag = 1;
+	    } else if (proxy_none_flag) {
+		CTRACE((tfp, "For `%s' proxy server ignored: %s\n",
+			current,
+			NONNULL(r->equiv)));
+	    } else {
+		char *temp = NULL;
+
+		StrAllocCopy(temp, "Proxied=");
+		StrAllocCat(temp, r->equiv);
+		StrAllocCat(temp, current);
+		CTRACE((tfp, "HTRule: proxy server found: %s\n",
+			NONNULL(r->equiv)));
 		FREE(current);
-		return (char *)0;
-	} /* if tail matches ... switch operation */
+		return temp;
+	    }
+	    break;
+
+	case HT_Invalid:
+	case HT_Fail:		/* Unauthorised */
+	    CTRACE((tfp, "HTRule: *** FAIL `%s'\n", current));
+	    FREE(current);
+	    return (char *) 0;
+	}			/* if tail matches ... switch operation */
 
-    } /* loop over rules */
+    }				/* loop over rules */
 
     if (proxy_none_flag) {
-	char * temp = NULL;
+	char *temp = NULL;
+
 	StrAllocCopy(temp, "NoProxy=");
 	StrAllocCat(temp, current);
 	FREE(current);
@@ -417,93 +435,99 @@ char * HTTranslate (
 }
 
 /*	Load one line of configuration
-**	------------------------------
-**
-**	Call this, for example, to load a X resource with config info.
-**
-** returns	0 OK, < 0 syntax error.
-*/
-int  HTSetConfiguration (
-    char *		config)
+ *	------------------------------
+ *
+ *	Call this, for example, to load a X resource with config info.
+ *
+ * returns	0 OK, < 0 syntax error.
+ */
+int HTSetConfiguration(char *config)
 {
     HTRuleOp op;
-    char * line = NULL;
-    char * pointer = line;
+    char *line = NULL;
+    char *pointer = line;
     char *word1, *word2, *word3;
-    char *cond_op=NULL, *cond=NULL;
+    char *cond_op = NULL, *cond = NULL;
     float quality, secs, secs_per_byte;
     int maxbytes;
     int status;
 
     StrAllocCopy(line, config);
     {
-	char * p = strchr(line, '#');	/* Chop off comments */
-	if (p) *p = 0;
+	char *p = strchr(line, '#');	/* Chop off comments */
+
+	if (p)
+	    *p = 0;
     }
     pointer = line;
     word1 = HTNextField(&pointer);
     if (!word1) {
 	FREE(line);
 	return 0;
-    } ; /* Comment only or blank */
+    };				/* Comment only or blank */
 
     word2 = HTNextField(&pointer);
 
-    if (0==strcasecomp(word1, "defprot") ||
-	0==strcasecomp(word1, "protect"))
-	word3 = pointer;  /* The rest of the line to be parsed by AA module */
+    if (0 == strcasecomp(word1, "defprot") ||
+	0 == strcasecomp(word1, "protect"))
+	word3 = pointer;	/* The rest of the line to be parsed by AA module */
     else
 	word3 = HTNextField(&pointer);	/* Just the next word */
 
     if (!word2) {
 	fprintf(stderr, "HTRule: %s %s\n", RULE_NEEDS_DATA, line);
 	FREE(line);
-	return -2;	/*syntax error */
+	return -2;		/*syntax error */
     }
 
-    if (0==strcasecomp(word1, "suffix")) {
-	char * encoding = HTNextField(&pointer);
-	if (pointer) status = sscanf(pointer, "%f", &quality);
-	else status = 0;
-	HTSetSuffix(word2,	word3,
-				encoding ? encoding : "binary",
-				status >= 1? quality : (float) 1.0);
+    if (0 == strcasecomp(word1, "suffix")) {
+	char *encoding = HTNextField(&pointer);
 
-    } else if (0==strcasecomp(word1, "presentation")) {
-	if (pointer) status = sscanf(pointer, "%f%f%f%d",
+	if (pointer)
+	    status = sscanf(pointer, "%f", &quality);
+	else
+	    status = 0;
+	HTSetSuffix(word2, word3,
+		    encoding ? encoding : "binary",
+		    status >= 1 ? quality : (float) 1.0);
+
+    } else if (0 == strcasecomp(word1, "presentation")) {
+	if (pointer)
+	    status = sscanf(pointer, "%f%f%f%d",
 			    &quality, &secs, &secs_per_byte, &maxbytes);
-	else status = 0;
+	else
+	    status = 0;
 	HTSetPresentation(word2, word3,
-		    status >= 1 ? quality		: 1.0,
-		    status >= 2 ? secs			: 0.0,
-		    status >= 3 ? secs_per_byte		: 0.0,
-		    status >= 4 ? maxbytes		: 0 );
+			  status >= 1 ? quality : 1.0,
+			  status >= 2 ? secs : 0.0,
+			  status >= 3 ? secs_per_byte : 0.0,
+			  status >= 4 ? maxbytes : 0);
 
-    } else if (0==strncasecomp(word1, "htbin", 5) ||
-	       0==strncasecomp(word1, "bindir", 6)) {
+    } else if (0 == strncasecomp(word1, "htbin", 5) ||
+	       0 == strncasecomp(word1, "bindir", 6)) {
 	StrAllocCopy(HTBinDir, word2);	/* Physical /htbin location */
 
-    } else if (0==strncasecomp(word1, "search", 6)) {
+    } else if (0 == strncasecomp(word1, "search", 6)) {
 	StrAllocCopy(HTSearchScript, word2);	/* Search script name */
 
     } else {
-	op =	0==strcasecomp(word1, "map")  ? HT_Map
-	    :	0==strcasecomp(word1, "pass") ? HT_Pass
-	    :	0==strcasecomp(word1, "fail") ? HT_Fail
-	    :	0==strcasecomp(word1, "redirect") ? HT_Redirect
-	    :	0==strncasecomp(word1, "redirectperm", 12) ? HT_RedirectPerm
-	    :	0==strcasecomp(word1, "redirecttemp") ? HT_Redirect
-	    :	0==strcasecomp(word1, "permitredirection") ? HT_PermitRedir
-	    :	0==strcasecomp(word1, "useproxy") ? HT_UseProxy
-	    :	0==strcasecomp(word1, "alert") ? HT_Alert
-	    :	0==strcasecomp(word1, "alwaysalert") ? HT_AlwaysAlert
-	    :	0==strcasecomp(word1, "progress") ? HT_Progress
-	    :	0==strcasecomp(word1, "usermsg") ? HT_UserMsg
-	    :	0==strcasecomp(word1, "infomsg") ? HT_InfoMsg
-	    :	0==strcasecomp(word1, "defprot") ? HT_DefProt
-	    :	0==strcasecomp(word1, "protect") ? HT_Protect
-	    :						HT_Invalid;
-	if (op==HT_Invalid) {
+	op = 0 == strcasecomp(word1, "map") ? HT_Map
+	    : 0 == strcasecomp(word1, "pass") ? HT_Pass
+	    : 0 == strcasecomp(word1, "fail") ? HT_Fail
+	    : 0 == strcasecomp(word1, "redirect") ? HT_Redirect
+	    : 0 == strncasecomp(word1, "redirectperm", 12) ? HT_RedirectPerm
+	    : 0 == strcasecomp(word1, "redirecttemp") ? HT_Redirect
+	    : 0 == strcasecomp(word1, "permitredirection") ? HT_PermitRedir
+	    : 0 == strcasecomp(word1, "useproxy") ? HT_UseProxy
+	    : 0 == strcasecomp(word1, "alert") ? HT_Alert
+	    : 0 == strcasecomp(word1, "alwaysalert") ? HT_AlwaysAlert
+	    : 0 == strcasecomp(word1, "progress") ? HT_Progress
+	    : 0 == strcasecomp(word1, "usermsg") ? HT_UserMsg
+	    : 0 == strcasecomp(word1, "infomsg") ? HT_InfoMsg
+	    : 0 == strcasecomp(word1, "defprot") ? HT_DefProt
+	    : 0 == strcasecomp(word1, "protect") ? HT_Protect
+	    : HT_Invalid;
+	if (op == HT_Invalid) {
 	    fprintf(stderr, "HTRule: %s '%s'\n", RULE_INCORRECT, config);
 	} else {
 	    switch (op) {
@@ -523,29 +547,29 @@ int  HTSetConfiguration (
 		    word3 = NULL;
 		    cond = HTNextField(&pointer);
 		    break;
-		} /* else fall through */
-
+		}
+		/* else fall through */
 	    case HT_Map:	/* always a URL2 (or other 2nd parameter) */
 	    case HT_Redirect:
 	    case HT_RedirectPerm:
 	    case HT_UseProxy:
 		cond_op = HTNextField(&pointer);
 		/* check for extra status word in "Redirect" */
-		if (op==HT_Redirect && 0==strcasecomp(word1, "redirect") &&
+		if (op == HT_Redirect && 0 == strcasecomp(word1, "redirect") &&
 		    cond_op &&
 		    strcasecomp(cond_op, "if") &&
 		    strcasecomp(cond_op, "unless")) {
-		    if (0==strcmp(word2, "301") ||
-			0==strcasecomp(word2, "permanent")) {
+		    if (0 == strcmp(word2, "301") ||
+			0 == strcasecomp(word2, "permanent")) {
 			op = HT_RedirectPerm;
-		    } else if (!(0==strcmp(word2, "302") ||
-				 0==strcmp(word2, "303") ||
-				 0==strcasecomp(word2, "temp") ||
-				 0==strcasecomp(word2, "seeother"))) {
+		    } else if (!(0 == strcmp(word2, "302") ||
+				 0 == strcmp(word2, "303") ||
+				 0 == strcasecomp(word2, "temp") ||
+				 0 == strcasecomp(word2, "seeother"))) {
 			CTRACE((tfp, "Rule: Ignoring `%s' in Redirect\n", word2));
 		    }
 		    word2 = word3;
-		    word3 = cond_op; /* cond_op isn't condition op after all */
+		    word3 = cond_op;	/* cond_op isn't condition op after all */
 		    cond_op = HTNextField(&pointer);
 		}
 		if (cond_op && *cond_op)
@@ -562,30 +586,32 @@ int  HTSetConfiguration (
 		    cond = HTNextField(&pointer);
 		if (word3) {	/* Fix string with too may %s - kw */
 		    char *cp = word3, *cp1, *cp2;
-		    while ((cp1=strchr(cp, '%'))) {
+
+		    while ((cp1 = strchr(cp, '%'))) {
 			if (cp1[1] == '\0') {
 			    *cp1 = '\0';
 			    break;
 			} else if (cp1[1] == '%') {
 			    cp = cp1 + 2;
 			    continue;
-			} else while ((cp2=strchr(cp1+2, '%'))) {
-			    if (cp2[1] == '\0') {
-				*cp2 = '\0';
-				break;
-			    } else if (cp2[1] == '%') {
-				cp1 = cp2;
-			    } else {
-				*cp2 = '?'; /* replace bad % */
-				cp1 = cp2;
+			} else
+			    while ((cp2 = strchr(cp1 + 2, '%'))) {
+				if (cp2[1] == '\0') {
+				    *cp2 = '\0';
+				    break;
+				} else if (cp2[1] == '%') {
+				    cp1 = cp2;
+				} else {
+				    *cp2 = '?';		/* replace bad % */
+				    cp1 = cp2;
+				}
 			    }
-			}
 			break;
 		    }
 		}
 		break;
 
-		default:
+	    default:
 		break;
 	    }
 	    if (cond_op && cond && *cond && !strcasecomp(cond_op, "unless")) {
@@ -599,10 +625,10 @@ int  HTSetConfiguration (
 		return -2;	/* NB unrecognized cond passes here - kw */
 	    }
 	    if (cond && !strncasecomp(cond, "redirected", strlen(cond))) {
-		cond = "redirected"; /* recognized, canonical case - kw */
+		cond = "redirected";	/* recognized, canonical case - kw */
 	    } else if (cond && strlen(cond) >= 8 &&
-		!strncasecomp(cond, "userspecified", strlen(cond))) {
-		cond = "userspec"; /* also allow abbreviation - kw */
+		       !strncasecomp(cond, "userspecified", strlen(cond))) {
+		cond = "userspec";	/* also allow abbreviation - kw */
 	    }
 	    HTAddRule(op, word2, word3, cond_op, cond);
 	}
@@ -611,37 +637,36 @@ int  HTSetConfiguration (
     return 0;
 }
 
-
 /*	Load the rules from a file				HTLoadRules()
-**	--------------------------
-**
-** On entry,
-**	Rules can be in any state
-** On exit,
-**	Any existing rules will have been kept.
-**	Any new rules will have been loaded.
-**	Returns		0 if no error, 0 if error!
-**
-** Bugs:
-**	The strings may not contain spaces.
-*/
-
-int HTLoadRules (
-    const char *	filename)
+ *	--------------------------
+ *
+ * On entry,
+ *	Rules can be in any state
+ * On exit,
+ *	Any existing rules will have been kept.
+ *	Any new rules will have been loaded.
+ *	Returns		0 if no error, 0 if error!
+ *
+ * Bugs:
+ *	The strings may not contain spaces.
+ */
+
+int HTLoadRules(const char *filename)
 {
-    FILE * fp = fopen(filename, TXT_R);
-    char line[LINE_LENGTH+1];
+    FILE *fp = fopen(filename, TXT_R);
+    char line[LINE_LENGTH + 1];
 
     if (!fp) {
 	CTRACE((tfp, "HTRules: Can't open rules file %s\n", filename));
-	return -1; /* File open error */
+	return -1;		/* File open error */
     }
-    for(;;) {
-	if (!fgets(line, LINE_LENGTH+1, fp)) break;	/* EOF or error */
+    for (;;) {
+	if (!fgets(line, LINE_LENGTH + 1, fp))
+	    break;		/* EOF or error */
 	(void) HTSetConfiguration(line);
     }
     fclose(fp);
-    return 0;		/* No error or syntax errors ignored */
+    return 0;			/* No error or syntax errors ignored */
 }
 
 #endif /* NO_RULES */
diff --git a/WWW/Library/Implementation/HTRules.h b/WWW/Library/Implementation/HTRules.h
index c9b299df..5c14aed9 100644
--- a/WWW/Library/Implementation/HTRules.h
+++ b/WWW/Library/Implementation/HTRules.h
@@ -21,23 +21,23 @@
 #ifndef HTUTILS_H
 #include <HTUtils.h>
 #endif
- 
+
 typedef enum {
-        HT_Invalid,
-        HT_Map,
-        HT_Pass,
-        HT_Fail,
-        HT_DefProt,
-        HT_Protect,
-        HT_Progress,
-        HT_InfoMsg,
-        HT_UserMsg,
-        HT_Alert,
-        HT_AlwaysAlert,
-        HT_Redirect,
-        HT_RedirectPerm,
-        HT_PermitRedir,
-        HT_UseProxy
+    HT_Invalid,
+    HT_Map,
+    HT_Pass,
+    HT_Fail,
+    HT_DefProt,
+    HT_Protect,
+    HT_Progress,
+    HT_InfoMsg,
+    HT_UserMsg,
+    HT_Alert,
+    HT_AlwaysAlert,
+    HT_Redirect,
+    HT_RedirectPerm,
+    HT_PermitRedir,
+    HT_UseProxy
 } HTRuleOp;
 
 #ifndef NO_RULES
@@ -54,8 +54,8 @@ Server Side Script Execution
 
  */
 
-extern char * HTBinDir;         /* Physical /htbin location */
-extern char * HTSearchScript;   /* Search script name */
+extern char *HTBinDir;		/* Physical /htbin location */
+extern char *HTSearchScript;	/* Search script name */
 
 /*
 
@@ -84,13 +84,10 @@ HTAddRule:  Add rule to the list
    large.
 
  */
-extern int HTAddRule (
-    HTRuleOp op,
-    const char * pattern,
-    const char * equiv,
-    const char * cond_op,
-    const char * cond);
-
+extern int HTAddRule(HTRuleOp op, const char *pattern,
+		     const char *equiv,
+		     const char *cond_op,
+		     const char *cond);
 
 /*
 
@@ -102,7 +99,7 @@ HTClearRules: Clear all rules
 
  */
 
-extern void HTClearRules (void);
+extern void HTClearRules(void);
 
 /*
 
@@ -123,7 +120,7 @@ HTTranslate: Translate by rules
                          a copy of the original.
 
  */
-extern char * HTTranslate (const char * required);
+extern char *HTTranslate(const char *required);
 
 /*
 
@@ -137,8 +134,7 @@ HTSetConfiguration:  Load one line of configuration information
    the  rule file, for example INI files for X resources.
 
  */
-extern int HTSetConfiguration (char * config);
-
+extern int HTSetConfiguration(char *config);
 
 /*
 
@@ -157,7 +153,8 @@ HtLoadRules:  Load the rules from a file
 
  */
 
-extern int HTLoadRules (const char * filename);
+extern int HTLoadRules(const char *filename);
+
 /*
 
  */
diff --git a/WWW/Library/Implementation/HTStream.h b/WWW/Library/Implementation/HTStream.h
index 25e62570..b2941c94 100644
--- a/WWW/Library/Implementation/HTStream.h
+++ b/WWW/Library/Implementation/HTStream.h
@@ -3,11 +3,11 @@
                                              
    A Stream object is something which accepts a stream of text.
    
-   The creation methods will vary on the type of Stream Object.   All creation methods
-   return a pointer to the stream type below.
+   The creation methods will vary on the type of Stream Object.  All creation
+   methods return a pointer to the stream type below.
    
-   As you can see, but the methods used to write to the stream and close it are pointed to
-   be the object itself.
+   As you can see, but the methods used to write to the stream and close it are
+   pointed to be the object itself.
    
  */
 #ifndef HTSTREAM_H
@@ -16,43 +16,39 @@
 #ifndef HTUTILS_H
 #include <HTUtils.h>
 #endif
- 
+
 typedef struct _HTStream HTStream;
 
 /*
 
-   These are the common methods of all streams.  They should be self-explanatory, except
-   for end_document which must be called before free.  It should be merged with free in
-   fact:  it should be dummy for new streams.
+   These are the common methods of all streams.  They should be
+   self-explanatory, except for end_document which must be called before free. 
+   It should be merged with free in fact:  it should be dummy for new streams.
    
-   The put_block method was write, but this upset systems which had macros for write().
+   The put_block method was write, but this upset systems which had macros for
+   write().
    
  */
 typedef struct _HTStreamClass {
 
-        char*  name;                            /* Just for diagnostics */
-                
-        void (*_free) (
-                HTStream*       me);
-
-        void (*_abort) (
-                HTStream*       me,
-                HTError         e);
-                
-        void (*put_character) (
-                HTStream*       me,
-                char            ch);
-                                
-        void (*put_string) (
-                HTStream*       me,
-                const char *    str);
-                
-        void (*put_block) (
-                HTStream*       me,
-                const char *    str,
-                int             len);
-
-}HTStreamClass;
+    char *name;			/* Just for diagnostics */
+
+    void (*_free) (HTStream *me);
+
+    void (*_abort) (HTStream *me,
+		    HTError e);
+
+    void (*put_character) (HTStream *me,
+			   char ch);
+
+    void (*put_string) (HTStream *me,
+			const char *str);
+
+    void (*put_block) (HTStream *me,
+		       const char *str,
+		       int len);
+
+} HTStreamClass;
 
 /*
 
@@ -63,6 +59,6 @@ typedef struct _HTStreamClass {
    example from the network.
 
  */
-extern HTStream * HTErrorStream (void);
+extern HTStream *HTErrorStream(void);
 
 #endif /* HTSTREAM_H */
diff --git a/WWW/Library/Implementation/HTString.c b/WWW/Library/Implementation/HTString.c
index 898d7504..487513d9 100644
--- a/WWW/Library/Implementation/HTString.c
+++ b/WWW/Library/Implementation/HTString.c
@@ -1,12 +1,12 @@
 /*		Case-independent string comparison		HTString.c
-**
-**	Original version came with listserv implementation.
-**	Version TBL Oct 91 replaces one which modified the strings.
-**	02-Dec-91 (JFG) Added stralloccopy and stralloccat
-**	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
-**	15 Nov 98 (TD)  Added HTSprintf.
-*/
+ *
+ *	Original version came with listserv implementation.
+ *	Version TBL Oct 91 replaces one which modified the strings.
+ *	02-Dec-91 (JFG) Added stralloccopy and stralloccat
+ *	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
+ *	15 Nov 98 (TD)  Added HTSprintf.
+ */
 
 #include <HTUtils.h>
 
@@ -23,256 +23,251 @@ int WWW_TraceMask = 0;		/* Global trace flag for ALL W3 code */
 #endif /* !VC */
 
 #ifdef _WINDOWS
-const char * HTLibraryVersion = "2.14FM"; /* String for help screen etc */
+const char *HTLibraryVersion = "2.14FM";	/* String for help screen etc */
+
 #else
-const char * HTLibraryVersion = VC; /* String for help screen etc */
+const char *HTLibraryVersion = VC;	/* String for help screen etc */
 #endif
 
 /*
-**     strcasecomp8 is a variant of strcasecomp (below)
-**     ------------		    -----------
-**     but uses 8bit upper/lower case information
-**     from the current display charset.
-**     It returns 0 if exact match.
-*/
-int strcasecomp8 (
-       const char*    a,
-       const char *   b)
+ *     strcasecomp8 is a variant of strcasecomp (below)
+ *     ------------		    -----------
+ *     but uses 8bit upper/lower case information
+ *     from the current display charset.
+ *     It returns 0 if exact match.
+ */
+int strcasecomp8(const char *a,
+		 const char *b)
 {
     const char *p = a;
     const char *q = b;
 
-    for ( ; *p && *q; p++, q++) {
+    for (; *p && *q; p++, q++) {
 	int diff = UPPER8(*p, *q);
-	if (diff) return diff;
+
+	if (diff)
+	    return diff;
     }
     if (*p)
-	return 1;	/* p was longer than q */
+	return 1;		/* p was longer than q */
     if (*q)
-	return -1;	/* p was shorter than q */
-    return 0;		/* Exact match */
+	return -1;		/* p was shorter than q */
+    return 0;			/* Exact match */
 }
 
 /*
-**     strncasecomp8 is a variant of strncasecomp (below)
-**     -------------		     ------------
-**     but uses 8bit upper/lower case information
-**     from the current display charset.
-**     It returns 0 if exact match.
-*/
-int strncasecomp8 (
-	const char*	a,
-	const char *	b,
-	int		n)
+ *     strncasecomp8 is a variant of strncasecomp (below)
+ *     -------------		     ------------
+ *     but uses 8bit upper/lower case information
+ *     from the current display charset.
+ *     It returns 0 if exact match.
+ */
+int strncasecomp8(const char *a,
+		  const char *b,
+		  int n)
 {
     const char *p = a;
     const char *q = b;
 
-    for ( ; ; p++, q++) {
+    for (;; p++, q++) {
 	int diff;
-	if (p == (a+n))
-	    return 0;	/*   Match up to n characters */
+
+	if (p == (a + n))
+	    return 0;		/*   Match up to n characters */
 	if (!(*p && *q))
 	    return (*p - *q);
 	diff = UPPER8(*p, *q);
 	if (diff)
 	    return diff;
     }
-    /*NOTREACHED*/
+    /*NOTREACHED */
 }
 
-#ifndef VM		/* VM has these already it seems */
+#ifndef VM			/* VM has these already it seems */
 
-#ifdef SH_EX	/* 1997/12/23 (Tue) 16:40:31 */
+#ifdef SH_EX			/* 1997/12/23 (Tue) 16:40:31 */
 
 /*
  * This array is designed for mapping upper and lower case letter
  * together for a case independent comparison.  The mappings are
  * based upon ascii character sequences.
  */
-static unsigned char charmap[] = {
-	'\000', '\001', '\002', '\003', '\004', '\005', '\006', '\007',
-	'\010', '\011', '\012', '\013', '\014', '\015', '\016', '\017',
-	'\020', '\021', '\022', '\023', '\024', '\025', '\026', '\027',
-	'\030', '\031', '\032', '\033', '\034', '\035', '\036', '\037',
-	'\040', '\041', '\042', '\043', '\044', '\045', '\046', '\047',
-	'\050', '\051', '\052', '\053', '\054', '\055', '\056', '\057',
-	'\060', '\061', '\062', '\063', '\064', '\065', '\066', '\067',
-	'\070', '\071', '\072', '\073', '\074', '\075', '\076', '\077',
-	'\100', '\141', '\142', '\143', '\144', '\145', '\146', '\147',
-	'\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157',
-	'\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167',
-	'\170', '\171', '\172', '\133', '\134', '\135', '\136', '\137',
-	'\140', '\141', '\142', '\143', '\144', '\145', '\146', '\147',
-	'\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157',
-	'\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167',
-	'\170', '\171', '\172', '\173', '\174', '\175', '\176', '\177',
-	'\200', '\201', '\202', '\203', '\204', '\205', '\206', '\207',
-	'\210', '\211', '\212', '\213', '\214', '\215', '\216', '\217',
-	'\220', '\221', '\222', '\223', '\224', '\225', '\226', '\227',
-	'\230', '\231', '\232', '\233', '\234', '\235', '\236', '\237',
-	'\240', '\241', '\242', '\243', '\244', '\245', '\246', '\247',
-	'\250', '\251', '\252', '\253', '\254', '\255', '\256', '\257',
-	'\260', '\261', '\262', '\263', '\264', '\265', '\266', '\267',
-	'\270', '\271', '\272', '\273', '\274', '\275', '\276', '\277',
-	'\340', '\341', '\342', '\343', '\344', '\345', '\346', '\347',
-	'\350', '\351', '\352', '\353', '\354', '\355', '\356', '\357',
-	'\360', '\361', '\362', '\363', '\364', '\365', '\366', '\327',
-	'\370', '\371', '\372', '\373', '\374', '\375', '\376', '\337',
-	'\340', '\341', '\342', '\343', '\344', '\345', '\346', '\347',
-	'\350', '\351', '\352', '\353', '\354', '\355', '\356', '\357',
-	'\360', '\361', '\362', '\363', '\364', '\365', '\366', '\367',
-	'\370', '\371', '\372', '\373', '\374', '\375', '\376', '\377',
+static unsigned char charmap[] =
+{
+    '\000', '\001', '\002', '\003', '\004', '\005', '\006', '\007',
+    '\010', '\011', '\012', '\013', '\014', '\015', '\016', '\017',
+    '\020', '\021', '\022', '\023', '\024', '\025', '\026', '\027',
+    '\030', '\031', '\032', '\033', '\034', '\035', '\036', '\037',
+    '\040', '\041', '\042', '\043', '\044', '\045', '\046', '\047',
+    '\050', '\051', '\052', '\053', '\054', '\055', '\056', '\057',
+    '\060', '\061', '\062', '\063', '\064', '\065', '\066', '\067',
+    '\070', '\071', '\072', '\073', '\074', '\075', '\076', '\077',
+    '\100', '\141', '\142', '\143', '\144', '\145', '\146', '\147',
+    '\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157',
+    '\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167',
+    '\170', '\171', '\172', '\133', '\134', '\135', '\136', '\137',
+    '\140', '\141', '\142', '\143', '\144', '\145', '\146', '\147',
+    '\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157',
+    '\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167',
+    '\170', '\171', '\172', '\173', '\174', '\175', '\176', '\177',
+    '\200', '\201', '\202', '\203', '\204', '\205', '\206', '\207',
+    '\210', '\211', '\212', '\213', '\214', '\215', '\216', '\217',
+    '\220', '\221', '\222', '\223', '\224', '\225', '\226', '\227',
+    '\230', '\231', '\232', '\233', '\234', '\235', '\236', '\237',
+    '\240', '\241', '\242', '\243', '\244', '\245', '\246', '\247',
+    '\250', '\251', '\252', '\253', '\254', '\255', '\256', '\257',
+    '\260', '\261', '\262', '\263', '\264', '\265', '\266', '\267',
+    '\270', '\271', '\272', '\273', '\274', '\275', '\276', '\277',
+    '\340', '\341', '\342', '\343', '\344', '\345', '\346', '\347',
+    '\350', '\351', '\352', '\353', '\354', '\355', '\356', '\357',
+    '\360', '\361', '\362', '\363', '\364', '\365', '\366', '\327',
+    '\370', '\371', '\372', '\373', '\374', '\375', '\376', '\337',
+    '\340', '\341', '\342', '\343', '\344', '\345', '\346', '\347',
+    '\350', '\351', '\352', '\353', '\354', '\355', '\356', '\357',
+    '\360', '\361', '\362', '\363', '\364', '\365', '\366', '\367',
+    '\370', '\371', '\372', '\373', '\374', '\375', '\376', '\377',
 };
 
-int strcasecomp (
-	const char*	s1,
-	const char*	s2)
+int strcasecomp(const char *s1,
+		const char *s2)
 {
     register unsigned char *cm = charmap;
-    register unsigned char *us1 = (unsigned char *)s1;
-    register unsigned char *us2 = (unsigned char *)s2;
+    register unsigned char *us1 = (unsigned char *) s1;
+    register unsigned char *us2 = (unsigned char *) s2;
 
     while (cm[*us1] == cm[*us2++])
 	if (*us1++ == '\0')
-	    return(0);
+	    return (0);
     return (cm[*us1] - cm[*--us2]);
 }
 
-int strncasecomp (
-	const char*	a,
-	const char*	b,
-	int		n)
+int strncasecomp(const char *a,
+		 const char *b,
+		 int n)
 {
     register unsigned char *cm = charmap;
-    register unsigned char *us1 = (unsigned char *)a;
-    register unsigned char *us2 = (unsigned char *)b;
+    register unsigned char *us1 = (unsigned char *) a;
+    register unsigned char *us2 = (unsigned char *) b;
 
-    while ((long)(--n) >= 0 && cm[*us1] == cm[*us2++])
+    while ((long) (--n) >= 0 && cm[*us1] == cm[*us2++])
 	if (*us1++ == '\0')
-	    return(0);
-    return ((long)n < 0 ? 0 : cm[*us1] - cm[*--us2]);
+	    return (0);
+    return ((long) n < 0 ? 0 : cm[*us1] - cm[*--us2]);
 }
 
-#else	/* SH_EX */
+#else /* SH_EX */
 
 /*	Strings of any length
-**	---------------------
-*/
-int strcasecomp (
-	const char*	a,
-	const char *	b)
+ *	---------------------
+ */
+int strcasecomp(const char *a,
+		const char *b)
 {
     const char *p = a;
     const char *q = b;
 
-    for ( ; *p && *q; p++, q++) {
+    for (; *p && *q; p++, q++) {
 	int diff = TOLOWER(*p) - TOLOWER(*q);
-	if (diff) return diff;
+
+	if (diff)
+	    return diff;
     }
     if (*p)
-	return 1;	/* p was longer than q */
+	return 1;		/* p was longer than q */
     if (*q)
-	return -1;	/* p was shorter than q */
-    return 0;		/* Exact match */
+	return -1;		/* p was shorter than q */
+    return 0;			/* Exact match */
 }
 
-
 /*	With count limit
-**	----------------
-*/
-int strncasecomp (
-	const char*	a,
-	const char *	b,
-	int		n)
+ *	----------------
+ */
+int strncasecomp(const char *a,
+		 const char *b,
+		 int n)
 {
     const char *p = a;
     const char *q = b;
 
-    for ( ; ; p++, q++) {
+    for (;; p++, q++) {
 	int diff;
-	if (p == (a+n))
-	    return 0;	/*   Match up to n characters */
+
+	if (p == (a + n))
+	    return 0;		/*   Match up to n characters */
 	if (!(*p && *q))
 	    return (*p - *q);
 	diff = TOLOWER(*p) - TOLOWER(*q);
 	if (diff)
 	    return diff;
     }
-    /*NOTREACHED*/
+    /*NOTREACHED */
 }
 
-#endif	/* SH_EX */
+#endif /* SH_EX */
 #endif /* VM */
 
 #ifdef NOT_ASCII
 
 /*	Case-insensitive with ASCII collating sequence
-**	----------------
-*/
-int AS_casecomp (
-	const char*	p,
-	const char*	q)
+ *	----------------
+ */
+int AS_casecomp(const char *p,
+		const char *q)
 {
     int diff;
 
-    for ( ; ; p++, q++) {
+    for (;; p++, q++) {
 	if (!(*p && *q))
-	    return (UCH(*p)  - UCH(*q));
+	    return (UCH(*p) - UCH(*q));
 	diff = TOASCII(TOLOWER(*p))
-	     - TOASCII(TOLOWER(*q));
+	    - TOASCII(TOLOWER(*q));
 	if (diff)
 	    return diff;
     }
-    /*NOTREACHED*/
+    /*NOTREACHED */
 }
 
-
 /*	With count limit and ASCII collating sequence
-**	----------------
-**	AS_cmp uses n == -1 to compare indefinite length.
-*/
-int AS_ncmp (
-	const char *	p,
-	const char *	q,
-	unsigned int	n)
+ *	----------------
+ *	AS_cmp uses n == -1 to compare indefinite length.
+ */
+int AS_ncmp(const char *p,
+	    const char *q,
+	    unsigned int n)
 {
     const char *a = p;
     int diff;
 
-    for ( ; (p-a) < n; p++, q++) {
+    for (; (p - a) < n; p++, q++) {
 	if (!(*p && *q))
 	    return (UCH(*p) - UCH(*q));
 	diff = TOASCII(*p)
-	     - TOASCII(*q);
+	    - TOASCII(*q);
 	if (diff)
 	    return diff;
     }
-    return 0;	/*   Match up to n characters */
+    return 0;			/*   Match up to n characters */
 }
 
-
 /*	With ASCII collating sequence
-**	----------------
-*/
-int AS_cmp (
-	const char *	p,
-	const char *	q)
+ *	----------------
+ */
+int AS_cmp(const char *p,
+	   const char *q)
 {
-    return( AS_ncmp( p, q, -1 ) );
+    return (AS_ncmp(p, q, -1));
 }
 #endif /* NOT_ASCII */
 
-
 /*	Allocate a new copy of a string, and returns it
 */
-char * HTSACopy (
-	char **	dest,
-	const char *	src)
+char *HTSACopy(char **dest,
+	       const char *src)
 {
     if (src != 0) {
 	if (src != *dest) {
 	    size_t size = strlen(src) + 1;
+
 	    FREE(*dest);
 	    *dest = (char *) malloc(size);
 	    if (*dest == NULL)
@@ -287,58 +282,55 @@ char * HTSACopy (
 
 /*	String Allocate and Concatenate
 */
-char * HTSACat (
-	char **	dest,
-	const char *	src)
+char *HTSACat(char **dest,
+	      const char *src)
 {
     if (src && *src && (src != *dest)) {
 	if (*dest) {
 	    size_t length = strlen(*dest);
-	    *dest = (char *)realloc(*dest, length + strlen(src) + 1);
+
+	    *dest = (char *) realloc(*dest, length + strlen(src) + 1);
 	    if (*dest == NULL)
 		outofmem(__FILE__, "HTSACat");
-	    strcpy (*dest + length, src);
+	    strcpy(*dest + length, src);
 	} else {
-	    *dest = (char *)malloc(strlen(src) + 1);
+	    *dest = (char *) malloc(strlen(src) + 1);
 	    if (*dest == NULL)
 		outofmem(__FILE__, "HTSACat");
-	    strcpy (*dest, src);
+	    strcpy(*dest, src);
 	}
     }
     return *dest;
 }
 
-
 /* optimized for heavily realloc'd strings, store length inside */
 
-#define EXTRA_TYPE size_t		/* type we use for length */
+#define EXTRA_TYPE size_t	/* type we use for length */
 #define EXTRA_SIZE sizeof(void *)	/* alignment >= sizeof(EXTRA_TYPE) */
 
-void   HTSAFree_extra (
-	char *		s)
+void HTSAFree_extra(char *s)
 {
     free(s - EXTRA_SIZE);
 }
 
 /* never shrink */
-char * HTSACopy_extra (
-	char **	dest,
-	const char *	src)
+char *HTSACopy_extra(char **dest,
+		     const char *src)
 {
     if (src != 0) {
 	size_t srcsize = strlen(src) + 1;
 	EXTRA_TYPE size = 0;
 
 	if (*dest != 0) {
-	    size = *(EXTRA_TYPE *)((*dest) - EXTRA_SIZE);
+	    size = *(EXTRA_TYPE *) ((*dest) - EXTRA_SIZE);
 	}
 	if (size < srcsize) {
 	    FREE_extra(*dest);
-	    size = srcsize * 2;   /* x2 step */
+	    size = srcsize * 2;	/* x2 step */
 	    *dest = (char *) malloc(size + EXTRA_SIZE);
 	    if (*dest == NULL)
 		outofmem(__FILE__, "HTSACopy_extra");
-	    *(EXTRA_TYPE *)(*dest) = size;
+	    *(EXTRA_TYPE *) (*dest) = size;
 	    *dest += EXTRA_SIZE;
 	}
 	memcpy(*dest, src, srcsize);
@@ -349,42 +341,41 @@ char * HTSACopy_extra (
 }
 
 /*	Find next Field
-**	---------------
-**
-** On entry,
-**	*pstr	points to a string containig white space separated
-**		field, optionlly quoted.
-**
-** On exit,
-**	*pstr	has been moved to the first delimiter past the
-**		field
-**		THE STRING HAS BEEN MUTILATED by a 0 terminator
-**
-**	returns a pointer to the first field
-*/
-char * HTNextField (
-	char **	pstr)
+ *	---------------
+ *
+ * On entry,
+ *	*pstr	points to a string containig white space separated
+ *		field, optionlly quoted.
+ *
+ * On exit,
+ *	*pstr	has been moved to the first delimiter past the
+ *		field
+ *		THE STRING HAS BEEN MUTILATED by a 0 terminator
+ *
+ *	returns a pointer to the first field
+ */
+char *HTNextField(char **pstr)
 {
-    char * p = *pstr;
-    char * start;			/* start of field */
+    char *p = *pstr;
+    char *start;		/* start of field */
 
     while (*p && WHITE(*p))
-	p++;				/* Strip white space */
+	p++;			/* Strip white space */
     if (!*p) {
 	*pstr = p;
 	return NULL;		/* No first field */
     }
-    if (*p == '"') {			/* quoted field */
+    if (*p == '"') {		/* quoted field */
 	p++;
 	start = p;
-	for (; *p && *p!='"'; p++) {
+	for (; *p && *p != '"'; p++) {
 	    if (*p == '\\' && p[1])
-		p++;			/* Skip escaped chars */
+		p++;		/* Skip escaped chars */
 	}
     } else {
 	start = p;
 	while (*p && !WHITE(*p))
-	    p++;			/* Skip first field */
+	    p++;		/* Skip first field */
     }
     if (*p)
 	*p++ = '\0';
@@ -393,140 +384,167 @@ char * HTNextField (
 }
 
 /*	Find next Token
-**	---------------
-**	Finds the next token in a string
-**	On entry,
-**	*pstr	points to a string to be parsed.
-**	delims	lists characters to be recognized as delimiters.
-**		If NULL, default is white space "," ";" or "=".
-**		The word can optionally be quoted or enclosed with
-**		chars from bracks.
-**		Comments surrrounded by '(' ')' are filtered out
-**		unless they are specifically reqested by including
-**		' ' or '(' in delims or bracks.
-**	bracks	lists bracketing chars.  Some are recognized as
-**		special, for those give the opening char.
-**		If NULL, defaults to <"> and "<" ">".
-**	found	points to location to fill with the ending delimiter
-**		found, or is NULL.
-**
-**	On exit,
-**	*pstr	has been moved to the first delimiter past the
-**		field
-**		THE STRING HAS BEEN MUTILATED by a 0 terminator
-**	found	points to the delimiter found unless it was NULL.
-**	Returns a pointer to the first word or NULL on error
-*/
-char * HTNextTok (
-	char **	pstr,
-	const char *	delims,
-	const char *	bracks,
-	char *		found)
+ *	---------------
+ *	Finds the next token in a string
+ *	On entry,
+ *	*pstr	points to a string to be parsed.
+ *	delims	lists characters to be recognized as delimiters.
+ *		If NULL, default is white space "," ";" or "=".
+ *		The word can optionally be quoted or enclosed with
+ *		chars from bracks.
+ *		Comments surrrounded by '(' ')' are filtered out
+ *		unless they are specifically reqested by including
+ *		' ' or '(' in delims or bracks.
+ *	bracks	lists bracketing chars.  Some are recognized as
+ *		special, for those give the opening char.
+ *		If NULL, defaults to <"> and "<" ">".
+ *	found	points to location to fill with the ending delimiter
+ *		found, or is NULL.
+ *
+ *	On exit,
+ *	*pstr	has been moved to the first delimiter past the
+ *		field
+ *		THE STRING HAS BEEN MUTILATED by a 0 terminator
+ *	found	points to the delimiter found unless it was NULL.
+ *	Returns a pointer to the first word or NULL on error
+ */
+char *HTNextTok(char **pstr,
+		const char *delims,
+		const char *bracks,
+		char *found)
 {
-    char * p = *pstr;
-    char * start = NULL;
+    char *p = *pstr;
+    char *start = NULL;
     BOOL get_blanks, skip_comments;
     BOOL get_comments;
     BOOL get_closing_char_too = FALSE;
     char closer;
 
-    if (isEmpty(pstr)) return NULL;
-    if (!delims) delims = " ;,=" ;
-    if (!bracks) bracks = "<\"" ;
+    if (isEmpty(pstr))
+	return NULL;
+    if (!delims)
+	delims = " ;,=";
+    if (!bracks)
+	bracks = "<\"";
 
-    get_blanks = (BOOL) (!strchr(delims,' ') && !strchr(bracks,' '));
-    get_comments = (BOOL) (strchr(bracks,'(') != NULL);
-    skip_comments = (BOOL) (!get_comments && !strchr(delims,'(') && !get_blanks);
+    get_blanks = (BOOL) (!strchr(delims, ' ') && !strchr(bracks, ' '));
+    get_comments = (BOOL) (strchr(bracks, '(') != NULL);
+    skip_comments = (BOOL) (!get_comments && !strchr(delims, '(') && !get_blanks);
 #define skipWHITE(c) (!get_blanks && WHITE(c))
 
     while (*p && skipWHITE(*p))
-	p++;				/* Strip white space */
+	p++;			/* Strip white space */
     if (!*p) {
 	*pstr = p;
-	if (found) *found = '\0';
+	if (found)
+	    *found = '\0';
 	return NULL;		/* No first field */
     }
     while (1) {
 	/* Strip white space and other delimiters */
-	while (*p && (skipWHITE(*p) || strchr(delims,*p))) p++;
+	while (*p && (skipWHITE(*p) || strchr(delims, *p)))
+	    p++;
 	if (!*p) {
 	    *pstr = p;
-	    if (found) *found = *(p-1);
-	    return NULL;					 /* No field */
+	    if (found)
+		*found = *(p - 1);
+	    return NULL;	/* No field */
 	}
 
-	if (*p == '(' && (skip_comments || get_comments)) {	  /* Comment */
+	if (*p == '(' && (skip_comments || get_comments)) {	/* Comment */
 	    int comment_level = 0;
-	    if (get_comments && !start) start = p+1;
-	    for(;*p && (*p!=')' || --comment_level>0); p++) {
-		if (*p == '(') comment_level++;
-		else if (*p == '"') {	      /* quoted field within Comment */
-		    for(p++; *p && *p!='"'; p++)
-			if (*p == '\\' && *(p+1)) p++; /* Skip escaped chars */
-		    if (!*p) break; /* (invalid) end of string found, leave */
+
+	    if (get_comments && !start)
+		start = p + 1;
+	    for (; *p && (*p != ')' || --comment_level > 0); p++) {
+		if (*p == '(')
+		    comment_level++;
+		else if (*p == '"') {	/* quoted field within Comment */
+		    for (p++; *p && *p != '"'; p++)
+			if (*p == '\\' && *(p + 1))
+			    p++;	/* Skip escaped chars */
+		    if (!*p)
+			break;	/* (invalid) end of string found, leave */
 		}
-		if (*p == '\\' && *(p+1)) p++;	       /* Skip escaped chars */
+		if (*p == '\\' && *(p + 1))
+		    p++;	/* Skip escaped chars */
 	    }
 	    if (get_comments)
 		break;
-	    if (*p) p++;
+	    if (*p)
+		p++;
 	    if (get_closing_char_too) {
-		if (!*p || (!strchr(bracks,*p) && strchr(delims,*p))) {
+		if (!*p || (!strchr(bracks, *p) && strchr(delims, *p))) {
 		    break;
 		} else
-		    get_closing_char_too = (BOOL) (strchr(bracks,*p) != NULL);
+		    get_closing_char_too = (BOOL) (strchr(bracks, *p) != NULL);
 	    }
-	} else if (strchr(bracks,*p)) {	       /* quoted or bracketed field */
+	} else if (strchr(bracks, *p)) {	/* quoted or bracketed field */
 	    switch (*p) {
-	       case '<': closer = '>'; break;
-	       case '[': closer = ']'; break;
-	       case '{': closer = '}'; break;
-	       case ':': closer = ';'; break;
-	    default:	 closer = *p;
+	    case '<':
+		closer = '>';
+		break;
+	    case '[':
+		closer = ']';
+		break;
+	    case '{':
+		closer = '}';
+		break;
+	    case ':':
+		closer = ';';
+		break;
+	    default:
+		closer = *p;
 	    }
-	    if (!start) start = ++p;
-	    for(;*p && *p!=closer; p++)
-		if (*p == '\\' && *(p+1)) p++;	       /* Skip escaped chars */
+	    if (!start)
+		start = ++p;
+	    for (; *p && *p != closer; p++)
+		if (*p == '\\' && *(p + 1))
+		    p++;	/* Skip escaped chars */
 	    if (get_closing_char_too) {
 		p++;
-		if (!*p || (!strchr(bracks,*p) && strchr(delims,*p))) {
+		if (!*p || (!strchr(bracks, *p) && strchr(delims, *p))) {
 		    break;
 		} else
-		    get_closing_char_too = (BOOL) (strchr(bracks,*p) != NULL);
+		    get_closing_char_too = (BOOL) (strchr(bracks, *p) != NULL);
 	    } else
-	    break;			    /* kr95-10-9: needs to stop here */
-	} else {					      /* Spool field */
-	    if (!start) start = p;
-	    while(*p && !skipWHITE(*p) && !strchr(bracks,*p) &&
-					  !strchr(delims,*p))
+		break;		/* kr95-10-9: needs to stop here */
+	} else {		/* Spool field */
+	    if (!start)
+		start = p;
+	    while (*p && !skipWHITE(*p) && !strchr(bracks, *p) &&
+		   !strchr(delims, *p))
 		p++;
-	    if (*p && strchr(bracks,*p)) {
+	    if (*p && strchr(bracks, *p)) {
 		get_closing_char_too = TRUE;
 	    } else {
-		if (*p=='(' && skip_comments) {
+		if (*p == '(' && skip_comments) {
 		    *pstr = p;
-		    HTNextTok(pstr, NULL, "(", found);	/*	Advance pstr */
+		    HTNextTok(pstr, NULL, "(", found);	/*      Advance pstr */
 		    *p = '\0';
-		    if (*pstr && **pstr) (*pstr)++;
+		    if (*pstr && **pstr)
+			(*pstr)++;
 		    return start;
 		}
-		    break;					   /* Got it */
+		break;		/* Got it */
 	    }
 	}
     }
-    if (found) *found = *p;
+    if (found)
+	*found = *p;
 
-    if (*p) *p++ = '\0';
+    if (*p)
+	*p++ = '\0';
     *pstr = p;
     return start;
 }
 
-static char *HTAlloc (char *  ptr, size_t  length)
+static char *HTAlloc(char *ptr, size_t length)
 {
     if (ptr != 0)
-	ptr = (char *)realloc(ptr, length);
+	ptr = (char *) realloc(ptr, length);
     else
-	ptr = (char *)malloc(length);
+	ptr = (char *) malloc(length);
     if (ptr == 0)
 	outofmem(__FILE__, "HTAlloc");
     return ptr;
@@ -547,30 +565,36 @@ static char *HTAlloc (char *  ptr, size_t  length)
  * needed for its arguments.  Unlike sprintf, this always concatenates to the
  * destination buffer, so we do not have to provide both flavors.
  */
-typedef enum { Flags, Width, Prec, Type, Format } PRINTF;
+typedef enum {
+    Flags,
+    Width,
+    Prec,
+    Type,
+    Format
+} PRINTF;
 
 #define VA_INTGR(type) ival = va_arg((*ap), type)
 #define VA_FLOAT(type) fval = va_arg((*ap), type)
 #define VA_POINT(type) pval = (void *)va_arg((*ap), type)
 
-#define NUM_WIDTH 10	/* allow for width substituted for "*" in "%*s" */
+#define NUM_WIDTH 10		/* allow for width substituted for "*" in "%*s" */
 		/* also number of chars assumed to be needed in addition
 		   to a given precision in floating point formats */
 
 #define GROW_EXPR(n) (((n) * 3) / 2)
 #define GROW_SIZE 256
 
-PUBLIC_IF_FIND_LEAKS char * StrAllocVsprintf (
-	char **	pstr,
-	size_t		dst_len,
-	const char *	fmt,
-	va_list *	ap)
+PUBLIC_IF_FIND_LEAKS char *StrAllocVsprintf(char **pstr,
+					    size_t dst_len,
+					    const char *fmt,
+					    va_list * ap)
 {
 #ifdef SAVE_TIME_NOT_SPACE
     static size_t tmp_len = 0;
     static size_t fmt_len = 0;
     static char *tmp_ptr = NULL;
     static char *fmt_ptr = NULL;
+
 #else
     size_t tmp_len = GROW_SIZE;
     char *tmp_ptr = 0;
@@ -588,23 +612,23 @@ PUBLIC_IF_FIND_LEAKS char * StrAllocVsprintf (
 	if (*pstr)
 	    FREE(*pstr);
 	if (vasprintf(pstr, fmt, *ap) >= 0) {
-	    mark_malloced(*pstr, strlen(*pstr)+1);
-	    return(*pstr);
+	    mark_malloced(*pstr, strlen(*pstr) + 1);
+	    return (*pstr);
 	}
     }
 #endif /* USE_VASPRINTF */
 
     need = strlen(fmt) + 1;
 #ifdef SAVE_TIME_NOT_SPACE
-    if (!fmt_ptr || fmt_len < need*NUM_WIDTH) {
-	fmt_ptr = HTAlloc(fmt_ptr, fmt_len = need*NUM_WIDTH);
+    if (!fmt_ptr || fmt_len < need * NUM_WIDTH) {
+	fmt_ptr = HTAlloc(fmt_ptr, fmt_len = need * NUM_WIDTH);
     }
     if (!tmp_ptr || tmp_len < GROW_SIZE) {
 	tmp_ptr = HTAlloc(tmp_ptr, tmp_len = GROW_SIZE);
     }
 #else
-    if ((fmt_ptr = malloc(need*NUM_WIDTH)) == 0
-     || (tmp_ptr = malloc(tmp_len)) == 0) {
+    if ((fmt_ptr = malloc(need * NUM_WIDTH)) == 0
+	|| (tmp_ptr = malloc(tmp_len)) == 0) {
 	outofmem(__FILE__, "StrAllocVsprintf");
     }
 #endif /* SAVE_TIME_NOT_SPACE */
@@ -622,15 +646,15 @@ PUBLIC_IF_FIND_LEAKS char * StrAllocVsprintf (
 	if (*fmt == '%') {
 	    static char dummy[] = "";
 	    PRINTF state = Flags;
-	    char *pval   = dummy;	/* avoid const-cast */
-	    double fval  = 0.0;
-	    int done     = FALSE;
-	    int ival     = 0;
-	    int prec     = -1;
-	    int type     = 0;
-	    int used     = 0;
-	    int width    = -1;
-	    size_t f     = 0;
+	    char *pval = dummy;	/* avoid const-cast */
+	    double fval = 0.0;
+	    int done = FALSE;
+	    int ival = 0;
+	    int prec = -1;
+	    int type = 0;
+	    int used = 0;
+	    int width = -1;
+	    size_t f = 0;
 
 	    fmt_ptr[f++] = *fmt;
 	    while (*++fmt != '\0' && !done) {
@@ -638,6 +662,7 @@ PUBLIC_IF_FIND_LEAKS char * StrAllocVsprintf (
 
 		if (isdigit(UCH(*fmt))) {
 		    int num = *fmt - '0';
+
 		    if (state == Flags && num != 0)
 			state = Width;
 		    if (state == Width) {
@@ -651,6 +676,7 @@ PUBLIC_IF_FIND_LEAKS char * StrAllocVsprintf (
 		    }
 		} else if (*fmt == '*') {
 		    VA_INTGR(int);
+
 		    if (state == Flags)
 			state = Width;
 		    if (state == Width) {
@@ -663,56 +689,63 @@ PUBLIC_IF_FIND_LEAKS char * StrAllocVsprintf (
 		} else if (isalpha(UCH(*fmt))) {
 		    done = TRUE;
 		    switch (*fmt) {
-		    case 'Z': /* FALLTHRU */
-		    case 'h': /* FALLTHRU */
-		    case 'l': /* FALLTHRU */
-		    case 'L': /* FALLTHRU */
+		    case 'Z':	/* FALLTHRU */
+		    case 'h':	/* FALLTHRU */
+		    case 'l':	/* FALLTHRU */
+		    case 'L':	/* FALLTHRU */
 			done = FALSE;
 			type = *fmt;
 			break;
-		    case 'o': /* FALLTHRU */
-		    case 'i': /* FALLTHRU */
-		    case 'd': /* FALLTHRU */
-		    case 'u': /* FALLTHRU */
-		    case 'x': /* FALLTHRU */
-		    case 'X': /* FALLTHRU */
+		    case 'o':	/* FALLTHRU */
+		    case 'i':	/* FALLTHRU */
+		    case 'd':	/* FALLTHRU */
+		    case 'u':	/* FALLTHRU */
+		    case 'x':	/* FALLTHRU */
+		    case 'X':	/* FALLTHRU */
 			if (type == 'l')
 			    VA_INTGR(long);
+
 			else if (type == 'Z')
 			    VA_INTGR(size_t);
 			else
 			    VA_INTGR(int);
+
 			used = 'i';
 			break;
-		    case 'f': /* FALLTHRU */
-		    case 'e': /* FALLTHRU */
-		    case 'E': /* FALLTHRU */
-		    case 'g': /* FALLTHRU */
-		    case 'G': /* FALLTHRU */
-			    VA_FLOAT(double);
+		    case 'f':	/* FALLTHRU */
+		    case 'e':	/* FALLTHRU */
+		    case 'E':	/* FALLTHRU */
+		    case 'g':	/* FALLTHRU */
+		    case 'G':	/* FALLTHRU */
+			VA_FLOAT(double);
+
 			used = 'f';
 			break;
 		    case 'c':
 			VA_INTGR(int);
+
 			used = 'c';
 			break;
 		    case 's':
 			VA_POINT(char *);
+
 			if (prec < 0)
 			    prec = strlen(pval);
 			used = 's';
 			break;
 		    case 'p':
 			VA_POINT(void *);
+
 			used = 'p';
 			break;
 		    case 'n':
 			VA_POINT(int *);
+
 			used = 0;
 			break;
 		    default:
 			CTRACE((tfp, "unknown format character '%c' in %s\n",
-				    *fmt, format));
+				*fmt, format));
 			break;
 		    }
 		} else if (*fmt == '.') {
@@ -734,7 +767,7 @@ PUBLIC_IF_FIND_LEAKS char * StrAllocVsprintf (
 		    /* FALLTHRU */
 		case 'p':
 		    if (width < prec + 2)
-			width = prec + 2; /* leading sign/space/zero, "0x" */
+			width = prec + 2;	/* leading sign/space/zero, "0x" */
 		    break;
 		case 'c':
 		    break;
@@ -746,7 +779,7 @@ PUBLIC_IF_FIND_LEAKS char * StrAllocVsprintf (
 		    break;
 		}
 	    }
-	    if (width >= (int)tmp_len) {
+	    if (width >= (int) tmp_len) {
 		tmp_len = GROW_EXPR(tmp_len + width);
 		tmp_ptr = HTAlloc(tmp_ptr, tmp_len);
 	    }
@@ -799,9 +832,9 @@ PUBLIC_IF_FIND_LEAKS char * StrAllocVsprintf (
 #undef HTSprintf
 #endif
 #if ANSI_VARARGS
-char * HTSprintf (char ** pstr, const char * fmt, ...)
+char *HTSprintf(char **pstr, const char *fmt,...)
 #else
-char * HTSprintf (va_alist)
+char *HTSprintf(va_alist)
     va_dcl
 #endif
 {
@@ -809,11 +842,11 @@ char * HTSprintf (va_alist)
     size_t inuse = 0;
     va_list ap;
 
-    LYva_start(ap,fmt);
+    LYva_start(ap, fmt);
     {
 #if !ANSI_VARARGS
-	char **		pstr = va_arg(ap, char **);
-	const char *	fmt  = va_arg(ap, const char *);
+	char **pstr = va_arg(ap, char **);
+	const char *fmt = va_arg(ap, const char *);
 #endif
 	if (pstr != 0 && *pstr != 0)
 	    inuse = strlen(*pstr);
@@ -835,31 +868,31 @@ char * HTSprintf (va_alist)
 #undef HTSprintf0
 #endif
 #if ANSI_VARARGS
-char * HTSprintf0 (char ** pstr, const char * fmt, ...)
+char *HTSprintf0(char **pstr, const char *fmt,...)
 #else
-char * HTSprintf0 (va_alist)
+char *HTSprintf0(va_alist)
     va_dcl
 #endif
 {
     char *result = 0;
     va_list ap;
 
-    LYva_start(ap,fmt);
+    LYva_start(ap, fmt);
     {
 #if !ANSI_VARARGS
-	char **		pstr = va_arg(ap, char **);
-	const char *	fmt  = va_arg(ap, const char *);
+	char **pstr = va_arg(ap, char **);
+	const char *fmt = va_arg(ap, const char *);
 #endif
 #ifdef USE_VASPRINTF
 	if (pstr) {
 	    if (*pstr)
 		FREE(*pstr);
-	    if (vasprintf(pstr, fmt, ap) >= 0) /* else call outofmem?? */
-		mark_malloced(*pstr, strlen(*pstr)+1);
+	    if (vasprintf(pstr, fmt, ap) >= 0)	/* else call outofmem?? */
+		mark_malloced(*pstr, strlen(*pstr) + 1);
 	    result = *pstr;
 	} else
 #endif /* USE_VASPRINTF */
-	result = StrAllocVsprintf(pstr, 0, fmt, &ap);
+	    result = StrAllocVsprintf(pstr, 0, fmt, &ap);
     }
     va_end(ap);
 
@@ -873,25 +906,24 @@ char * HTSprintf0 (va_alist)
 #if USE_QUOTED_PARAMETER
 #define S_QUOTE '\''
 #define D_QUOTE '"'
-char *HTQuoteParameter (
-    const char *	parameter)
+char *HTQuoteParameter(const char *parameter)
 {
     size_t i;
     size_t last;
     size_t n = 0;
     size_t quoted = 0;
-    char * result;
+    char *result;
 
     if (parameter == 0)
 	parameter = "";
 
     last = strlen(parameter);
-    for (i=0; i < last; ++i)
+    for (i = 0; i < last; ++i)
 	if (strchr("\\&#$^*?(){}<>\"';`|", parameter[i]) != 0
-	 || isspace(UCH(parameter[i])))
+	    || isspace(UCH(parameter[i])))
 	    ++quoted;
 
-    result = (char *)malloc(last + 5*quoted + 3);
+    result = (char *) malloc(last + 5 * quoted + 3);
     if (result == NULL)
 	outofmem(__FILE__, "HTQuoteParameter");
 
@@ -912,7 +944,7 @@ char *HTQuoteParameter (
 	       and compatible shells, so trying to escape a backslash by
 	       doubling it is unnecessary and would be interpreted by the
 	       shell as an additional data character. - kw 2000-05-02
-	       */
+	     */
 	    result[n++] = parameter[i];
 	}
     }
@@ -928,10 +960,10 @@ char *HTQuoteParameter (
 /*
  * Returns the number of "%s" tokens in a system command-template.
  */
-int HTCountCommandArgs (
-    const char *	command)
+int HTCountCommandArgs(const char *command)
 {
     int number = 0;
+
     while (command[0] != 0) {
 	if (HTIsParam(command))
 	    number++;
@@ -943,9 +975,8 @@ int HTCountCommandArgs (
 /*
  * Returns a pointer into the given string after the given parameter number
  */
-static const char *HTAfterCommandArg (
-    const char *	command,
-    int		number)
+static const char *HTAfterCommandArg(const char *command,
+				     int number)
 {
     while (number > 0) {
 	if (command[0] != 0) {
@@ -972,11 +1003,10 @@ static const char *HTAfterCommandArg (
  * This is useful only when we quote parameters, of course.
  */
 #if USE_QUOTED_PARAMETER
-void HTAddXpand (
-    char **		result,
-    const char *	command,
-    int		number,
-    const char *	parameter)
+void HTAddXpand(char **result,
+		const char *command,
+		int number,
+		const char *parameter)
 {
     if (number > 0) {
 	const char *last = HTAfterCommandArg(command, number - 1);
@@ -990,7 +1020,8 @@ void HTAddXpand (
 	    if (HTIsParam(next)) {
 		if (next != last) {
 		    size_t len = (next - last)
-				+ ((*result != 0) ? strlen(*result) : 0);
+		    + ((*result != 0) ? strlen(*result) : 0);
+
 		    HTSACat(result, last);
 		    (*result)[len] = 0;
 		}
@@ -1014,11 +1045,10 @@ void HTAddXpand (
  * Parameters are substituted at "%s" tokens, like printf.  Other printf-style
  * tokens are not substituted; they are passed through without change.
  */
-void HTAddToCmd (
-    char **		result,
-    const char *	command,
-    int		number,
-    const char *	string)
+void HTAddToCmd(char **result,
+		const char *command,
+		int number,
+		const char *string)
 {
     if (number > 0) {
 	const char *last = HTAfterCommandArg(command, number - 1);
@@ -1033,7 +1063,8 @@ void HTAddToCmd (
 	    if (HTIsParam(next)) {
 		if (next != last) {
 		    size_t len = (next - last)
-				+ ((*result != 0) ? strlen(*result) : 0);
+		    + ((*result != 0) ? strlen(*result) : 0);
+
 		    HTSACat(result, last);
 		    (*result)[len] = 0;
 		}
@@ -1051,15 +1082,15 @@ void HTAddToCmd (
  * string is a complete parameter (which is a necessary assumption so we can
  * quote it properly).
  */
-void HTAddParam (
-    char **		result,
-    const char *	command,
-    int		number,
-    const char *	parameter)
+void HTAddParam(char **result,
+		const char *command,
+		int number,
+		const char *parameter)
 {
     if (number > 0) {
 #if USE_QUOTED_PARAMETER
 	char *quoted = HTQuoteParameter(parameter);
+
 	HTAddToCmd(result, command, number, quoted);
 	FREE(quoted);
 #else
@@ -1072,15 +1103,14 @@ void HTAddParam (
  * Append the remaining command-string to a system command (compare with
  * HTAddParam).  Any remaining "%s" tokens are copied as empty strings.
  */
-void HTEndParam (
-    char **		result,
-    const char *	command,
-    int		number)
+void HTEndParam(char **result,
+		const char *command,
+		int number)
 {
     const char *last;
     int count;
 
-    count = HTCountCommandArgs (command);
+    count = HTCountCommandArgs(command);
     if (count < number)
 	number = count;
     last = HTAfterCommandArg(command, number);
@@ -1090,17 +1120,14 @@ void HTEndParam (
     CTRACE((tfp, "PARAM-END:%s\n", *result));
 }
 
-
-/*	Binary-strings (may have embedded nulls).
- *	Some modules (HTGopher) assume there is a null on the end, anyway.
+/* Binary-strings (may have embedded nulls).  Some modules (HTGopher) assume
+ * there is a null on the end, anyway.
  */
 
-/*	Allocate a new bstring, and return it.
+/* Allocate a new bstring, and return it.
 */
-void HTSABCopy (
-	bstring**	dest,
-	const char *	src,
-	int		len)
+void HTSABCopy(bstring **dest, const char *src,
+	       int len)
 {
     bstring *t;
     unsigned need = len + 1;
@@ -1113,11 +1140,12 @@ void HTSABCopy (
 	    trace_bstring2(src, len);
 	    CTRACE((tfp, "\n"));
 	}
-	if ((t = (bstring*) malloc(sizeof(bstring))) == NULL)
-	    outofmem(__FILE__, "HTSABCopy");
-	if ((t->str = (char *) malloc (need)) == NULL)
+	if ((t = (bstring *) malloc(sizeof(bstring))) == NULL)
+	      outofmem(__FILE__, "HTSABCopy");
+
+	if ((t->str = (char *) malloc(need)) == NULL)
 	    outofmem(__FILE__, "HTSABCopy");
-	memcpy (t->str, src, len);
+	memcpy(t->str, src, len);
 	t->len = len;
 	t->str[t->len] = '\0';
 	*dest = t;
@@ -1132,9 +1160,7 @@ void HTSABCopy (
 /*
  * Initialize with a null-terminated string (discards the null).
  */
-void HTSABCopy0 (
-	bstring**	dest,
-	const char *	src)
+void HTSABCopy0(bstring **dest, const char *src)
 {
     HTSABCopy(dest, src, strlen(src));
 }
@@ -1142,10 +1168,8 @@ void HTSABCopy0 (
 /*
  * Append a block of memory to a bstring.
  */
-void HTSABCat (
-	bstring **	dest,
-	const char *	src,
-	int		len)
+void HTSABCat(bstring **dest, const char *src,
+	      int len)
 {
     bstring *t = *dest;
 
@@ -1160,16 +1184,18 @@ void HTSABCat (
 	}
 	if (t) {
 	    unsigned length = t->len + need;
-	    if ((t->str = (char *)realloc(t->str, length)) == NULL)
+
+	    if ((t->str = (char *) realloc(t->str, length)) == NULL)
 		outofmem(__FILE__, "HTSACat");
 	} else {
 	    if ((t = typecalloc(bstring)) == NULL)
-		outofmem(__FILE__, "HTSACat");
-	    t->str = (char *)malloc(need);
+		  outofmem(__FILE__, "HTSACat");
+
+	    t->str = (char *) malloc(need);
 	}
 	if (t->str == NULL)
 	    outofmem(__FILE__, "HTSACat");
-	memcpy (t->str + t->len, src, len);
+	memcpy(t->str + t->len, src, len);
 	t->len += len;
 	t->str[t->len] = '\0';
 	*dest = t;
@@ -1184,9 +1210,7 @@ void HTSABCat (
 /*
  * Append a null-terminated string (discards the null).
  */
-void HTSABCat0 (
-	bstring**	dest,
-	const char *	src)
+void HTSABCat0(bstring **dest, const char *src)
 {
     HTSABCat(dest, src, strlen(src));
 }
@@ -1194,16 +1218,14 @@ void HTSABCat0 (
 /*
  * Compare two bstring's for equality
  */
-BOOL HTSABEql   (
-	bstring *	a,
-	bstring *	b)
+BOOL HTSABEql(bstring *a, bstring *b)
 {
     unsigned len_a = (a != 0) ? a->len : 0;
     unsigned len_b = (b != 0) ? b->len : 0;
 
     if (len_a == len_b) {
 	if (len_a == 0
-	 || memcmp(a->str, b->str, a->len) == 0)
+	    || memcmp(a->str, b->str, a->len) == 0)
 	    return TRUE;
     }
     return FALSE;
@@ -1212,8 +1234,7 @@ BOOL HTSABEql   (
 /*
  * Deallocate a bstring.
  */
-void HTSABFree (
-	bstring **	ptr)
+void HTSABFree(bstring **ptr)
 {
     if (*ptr != NULL) {
 	FREE((*ptr)->str);
@@ -1227,9 +1248,9 @@ void HTSABFree (
  * The bstring may contain embedded nulls; the formatted portions must not.
  */
 #ifdef ANSI_VARARGS
-bstring * HTBprintf (bstring ** pstr, const char * fmt, ...)
+bstring *HTBprintf(bstring **pstr, const char *fmt,...)
 #else
-bstring * HTBprintf (va_alist)
+bstring *HTBprintf(va_alist)
     va_dcl
 #endif
 {
@@ -1237,15 +1258,15 @@ bstring * HTBprintf (va_alist)
     char *temp = 0;
     va_list ap;
 
-    LYva_start(ap,fmt);
+    LYva_start(ap, fmt);
     {
 #if !ANSI_VARARGS
-	bstring **	pstr = va_arg(ap, char **);
-	const char *	fmt  = va_arg(ap, const char *);
+	bstring **pstr = va_arg(ap, char **);
+	const char *fmt = va_arg(ap, const char *);
 #endif
 	temp = StrAllocVsprintf(&temp, 0, fmt, &ap);
 	if (!isEmpty(temp)) {
-	    HTSABCat (pstr, temp, strlen(temp));
+	    HTSABCat(pstr, temp, strlen(temp));
 	}
 	FREE(temp);
 	result = *pstr;
@@ -1260,15 +1281,15 @@ bstring * HTBprintf (va_alist)
  * That is most, since we do not restrict line-length.  Nulls and other
  * non-printing characters are addressed.
  */
-void trace_bstring2 (
-	const char *	text,
-	int		size)
+void trace_bstring2(const char *text,
+		    int size)
 {
     int n;
 
     if (text != 0) {
 	for (n = 0; n < size; ++n) {
 	    int ch = UCH(text[n]);
+
 	    switch (ch) {
 	    case '\\':
 		fputs("\\\\", tfp);
@@ -1294,8 +1315,7 @@ void trace_bstring2 (
     }
 }
 
-void trace_bstring (
-	bstring *	data)
+void trace_bstring(bstring *data)
 {
     trace_bstring2(BStrData(data), BStrLen(data));
 }
diff --git a/WWW/Library/Implementation/HTString.h b/WWW/Library/Implementation/HTString.h
index cb118e58..cee80d57 100644
--- a/WWW/Library/Implementation/HTString.h
+++ b/WWW/Library/Implementation/HTString.h
@@ -11,16 +11,17 @@
 #include <HTUtils.h>
 #endif /* HTUTILS_H */
 
-extern const char * HTLibraryVersion;   /* String for help screen etc */
+extern const char *HTLibraryVersion;	/* String for help screen etc */
 
 /*
     EBCDIC string comparison using ASCII collating sequence
 */
 #ifdef    NOT_ASCII
-extern int AS_casecomp  (const char *a, const char *b);
-extern int AS_ncmp (const char *a, const char *b, unsigned int n);
+extern int AS_casecomp(const char *a, const char *b);
+extern int AS_ncmp(const char *a, const char *b, unsigned int n);
+
 #define    AS_cmp( a, b )  ( AS_ncmp( ( a ), ( b ), -1 ) )
-extern int AS_cmp (const char *a, const char *b);
+extern int AS_cmp(const char *a, const char *b);
 
 #else
 #define AS_casecomp( a, b ) ( strcasecomp( ( a ), ( b ) ) )
@@ -36,17 +37,17 @@ Case-insensitive string comparison
    The usual routines (comp instead of cmp) had some problem.
    
  */
-extern int strcasecomp  (const char *a, const char *b);
-extern int strncasecomp (const char *a, const char *b, int n);
+extern int strcasecomp(const char *a, const char *b);
+extern int strncasecomp(const char *a, const char *b, int n);
 
-extern int strcasecomp8  (const char *a, const char *b);
-extern int strncasecomp8 (const char *a, const char *b, int n);
-       /*
-       **  strcasecomp8 and strncasecomp8 are variants of strcasecomp
-       **  and strncasecomp, but use 8bit upper/lower case information
-       **  from the current display charset
-       */
+extern int strcasecomp8(const char *a, const char *b);
+extern int strncasecomp8(const char *a, const char *b, int n);
 
+       /*
+        * strcasecomp8 and strncasecomp8 are variants of strcasecomp and
+        * strncasecomp, but use 8bit upper/lower case information from the
+        * current display charset
+        */
 
 /*
 
@@ -55,8 +56,8 @@ Malloced string manipulation
  */
 #define StrAllocCopy(dest, src) HTSACopy (&(dest), src)
 #define StrAllocCat(dest, src)  HTSACat  (&(dest), src)
-extern char * HTSACopy (char **dest, const char *src);
-extern char * HTSACat  (char **dest, const char *src);
+extern char *HTSACopy(char **dest, const char *src);
+extern char *HTSACat(char **dest, const char *src);
 
 /*
 optimized for heavily realloc'd strings in temp objects
@@ -64,36 +65,34 @@ optimized for heavily realloc'd strings in temp objects
 #define StrAllocCopy_extra(dest, src) HTSACopy_extra (&(dest), src)
 #define FREE_extra(x)   {if (x != NULL) {HTSAFree_extra(x); x = NULL;}}
 #define Clear_extra(x)  {if (x != NULL) {*x = '\0';}}
-extern char * HTSACopy_extra (char **dest, const char *src);
-extern void   HTSAFree_extra (char *s);
+extern char *HTSACopy_extra(char **dest, const char *src);
+extern void HTSAFree_extra(char *s);
 
 /*
 
 Next word or quoted string
 
  */
-extern char * HTNextField (char** pstr);
+extern char *HTNextField(char **pstr);
 
 /* A more general parser - kw */
-extern char * HTNextTok (char ** pstr,
-		      const char * delims, const char * bracks, char * found);
+extern char *HTNextTok(char **pstr,
+		       const char *delims, const char *bracks, char *found);
 
 #ifdef ANSI_VARARGS
-extern char * HTSprintf (char ** pstr, const char * fmt, ...)
-			GCC_PRINTFLIKE(2,3);
-extern char * HTSprintf0 (char ** pstr, const char * fmt, ...)
-			 GCC_PRINTFLIKE(2,3);
+extern char *HTSprintf(char **pstr, const char *fmt,...) GCC_PRINTFLIKE(2,3);
+extern char *HTSprintf0(char **pstr, const char *fmt,...) GCC_PRINTFLIKE(2,3);
+
 #else
-extern char * HTSprintf () GCC_PRINTFLIKE(2,3);
-extern char * HTSprintf0 () GCC_PRINTFLIKE(2,3);
+extern char *HTSprintf() GCC_PRINTFLIKE(2,3);
+extern char *HTSprintf0() GCC_PRINTFLIKE(2,3);
 #endif
 
 #if defined(LY_FIND_LEAKS)	/* private otherwise */
-extern char * StrAllocVsprintf (
-        char **		pstr,
-        size_t		len,
-        const char *	fmt,
-        va_list *	ap);
+extern char *StrAllocVsprintf(char **pstr,
+			      size_t len,
+			      const char *fmt,
+			      va_list * ap);
 #endif
 
 #if (defined(VMS) || defined(DOSPATH) || defined(__EMX__)) && !defined(__CYGWIN__)
@@ -103,33 +102,34 @@ extern char * StrAllocVsprintf (
 #endif
 
 #if USE_QUOTED_PARAMETER
-extern char *HTQuoteParameter (const char *parameter);
-extern void HTAddXpand (char ** result, const char * command, int number, const char * parameter);
+extern char *HTQuoteParameter(const char *parameter);
+extern void HTAddXpand(char **result, const char *command, int number, const char *parameter);
+
 #else
 #define HTQuoteParameter(parameter) parameter	/* simplify ifdef'ing */
 #define HTAddXpand(result,command,number,parameter)  HTAddParam(result,command,number,parameter)
 #endif
 
-extern int HTCountCommandArgs (const char * command);
-extern void HTAddToCmd (char ** result, const char * command, int number, const char * string);
-extern void HTAddParam (char ** result, const char * command, int number, const char * parameter);
-extern void HTEndParam (char ** result, const char * command, int number);
+extern int HTCountCommandArgs(const char *command);
+extern void HTAddToCmd(char **result, const char *command, int number, const char *string);
+extern void HTAddParam(char **result, const char *command, int number, const char *parameter);
+extern void HTEndParam(char **result, const char *command, int number);
 
 /* Force an option, with leading blanks, to be appended without quoting them */
 #define HTOptParam(result, command, number, parameter) HTSACat(result, parameter)
 
 /* Binary copy and concat */
 typedef struct {
-	char *str;
-	int len;
+    char *str;
+    int len;
 } bstring;
 
-extern void HTSABCopy  (bstring ** dest, const char * src, int len);
-extern void HTSABCopy0 (bstring ** dest, const char * src);
-extern void HTSABCat   (bstring ** dest, const char * src, int len);
-extern void HTSABCat0  (bstring ** dest, const char * src);
-extern BOOL HTSABEql   (bstring * a, bstring * b);
-extern void HTSABFree  (bstring ** ptr);
+extern void HTSABCopy(bstring **dest, const char *src, int len);
+extern void HTSABCopy0(bstring **dest, const char *src);
+extern void HTSABCat(bstring **dest, const char *src, int len);
+extern void HTSABCat0(bstring **dest, const char *src);
+extern BOOL HTSABEql(bstring *a, bstring *b);
+extern void HTSABFree(bstring **ptr);
 
 #define BStrLen(s)    (((s) != 0) ? (s)->len : 0)
 #define BStrData(s)   (((s) != 0) ? (s)->str : 0)
@@ -145,13 +145,13 @@ extern void HTSABFree  (bstring ** ptr);
 #define BStrFree(d)    HTSABFree(  &(d))
 
 #ifdef ANSI_VARARGS
-extern bstring * HTBprintf (bstring ** pstr, const char * fmt, ...)
-			    GCC_PRINTFLIKE(2,3);
+extern bstring *HTBprintf(bstring **pstr, const char *fmt,...) GCC_PRINTFLIKE(2,3);
+
 #else
-extern bstring * HTBprintf () GCC_PRINTFLIKE(2,3);
+extern bstring *HTBprintf() GCC_PRINTFLIKE(2,3);
 #endif
 
-extern void trace_bstring (bstring *data);
-extern void trace_bstring2 (const char *text, int size);
+extern void trace_bstring(bstring *data);
+extern void trace_bstring2(const char *text, int size);
 
 #endif /* HTSTRING_H */
diff --git a/WWW/Library/Implementation/HTStyle.c b/WWW/Library/Implementation/HTStyle.c
index 200c766d..125c13c9 100644
--- a/WWW/Library/Implementation/HTStyle.c
+++ b/WWW/Library/Implementation/HTStyle.c
@@ -1,13 +1,13 @@
 /*	Style Implementation for Hypertext			HTStyle.c
-**	==================================
-**
-**	Styles allow the translation between a logical property
-**	of a piece of text and its physical representation.
-**
-**	A StyleSheet is a collection of styles, defining the
-**	translation necessary to
-**	represent a document.  It is a linked list of styles.
-*/
+ *	==================================
+ *
+ *	Styles allow the translation between a logical property
+ *	of a piece of text and its physical representation.
+ *
+ *	A StyleSheet is a collection of styles, defining the
+ *	translation necessary to
+ *	represent a document.  It is a linked list of styles.
+ */
 
 #include <HTUtils.h>
 #include <HTStyle.h>
@@ -16,9 +16,10 @@
 
 /*	Create a new style
 */
-HTStyle* HTStyleNew (void)
+HTStyle *HTStyleNew(void)
 {
-    HTStyle * self = typecalloc(HTStyle);
+    HTStyle *self = typecalloc(HTStyle);
+
     if (self == NULL)
 	outofmem(__FILE__, "HTStyleNew");
     return self;
@@ -26,18 +27,18 @@ HTStyle* HTStyleNew (void)
 
 /*	Create a new style with a name
 */
-HTStyle* HTStyleNewNamed (const char * name)
+HTStyle *HTStyleNewNamed(const char *name)
 {
-    HTStyle * self = HTStyleNew();
+    HTStyle *self = HTStyleNew();
+
     StrAllocCopy(self->name, name);
-    self->id = -1; /* <0 */
+    self->id = -1;		/* <0 */
     return self;
 }
 
-
 /*	Free a style
 */
-HTStyle * HTStyleFree (HTStyle * self)
+HTStyle *HTStyleFree(HTStyle *self)
 {
     FREE(self->name);
     FREE(self->SGMLTag);
@@ -45,18 +46,17 @@ HTStyle * HTStyleFree (HTStyle * self)
     return NULL;
 }
 
-
-#ifdef SUPPRESS  /* Only on the NeXT */
+#ifdef SUPPRESS			/* Only on the NeXT */
 /*	Read a style from a stream	(without its name)
-**	--------------------------
-**
-**	Reads a style with paragraph information from a stream.
-**	The style name is not read or written by these routines.
-*/
+ *	--------------------------
+ *
+ *	Reads a style with paragraph information from a stream.
+ *	The style name is not read or written by these routines.
+ */
 #define NONE_STRING "(None)"
 #define HTStream NXStream
 
-HTStyle * HTStyleRead (HTStyle * style, HTStream * stream)
+HTStyle *HTStyleRead(HTStyle *style, HTStream *stream)
 {
     char myTag[STYLE_NAME_LENGTH];
     char fontName[STYLE_NAME_LENGTH];
@@ -65,10 +65,10 @@ HTStyle * HTStyleRead (HTStyle * style, HTStream * stream)
     int gotpara;		/* flag: have we got a paragraph definition? */
 
     NXScanf(stream, "%s%s%f%d",
-	myTag,
-	fontName,
-	&style->fontSize,
-	&gotpara);
+	    myTag,
+	    fontName,
+	    &style->fontSize,
+	    &gotpara);
     if (gotpara) {
 	if (!style->paragraph) {
 	    style->paragraph = malloc(sizeof(*(style->paragraph)));
@@ -78,199 +78,212 @@ HTStyle * HTStyleRead (HTStyle * style, HTStream * stream)
 	}
 	p = style->paragraph;
 	NXScanf(stream, "%f%f%f%f%hd%f%f%hd",
-	    &p->indent1st,
-	    &p->indent2nd,
-	    &p->lineHt,
-	    &p->descentLine,
-	    &p->alignment,
-	    &style->spaceBefore,
-	    &style->spaceAfter,
-	    &p->numTabs);
+		&p->indent1st,
+		&p->indent2nd,
+		&p->lineHt,
+		&p->descentLine,
+		&p->alignment,
+		&style->spaceBefore,
+		&style->spaceAfter,
+		&p->numTabs);
 	FREE(p->tabs);
 	p->tabs = malloc(p->numTabs * sizeof(p->tabs[0]));
 	if (!p->tabs)
 	    outofmem(__FILE__, "HTStyleRead");
-	for (tab=0; tab < p->numTabs; tab++) {
+	for (tab = 0; tab < p->numTabs; tab++) {
 	    NXScanf(stream, "%hd%f",
 		    &p->tabs[tab].kind,
 		    &p->tabs[tab].x);
 	}
-    } else { /* No paragraph */
+    } else {			/* No paragraph */
 	FREE(style->paragraph);
-    } /* if no paragraph */
+    }				/* if no paragraph */
     StrAllocCopy(style->SGMLTag, myTag);
-    if (strcmp(fontName, NONE_STRING)==0)
+    if (strcmp(fontName, NONE_STRING) == 0)
 	style->font = 0;
     else
-	style->font = [Font newFont:fontName size:style->fontSize];
+      style->font =[Font newFont: fontName size:style->fontSize];
     return NULL;
 }
 
-
 /*	Write a style to a stream in a compatible way
 */
-HTStyle * HTStyleWrite (HTStyle * style, NXStream * stream)
+HTStyle *HTStyleWrite(HTStyle *style, NXStream * stream)
 {
     int tab;
     NXTextStyle *p = style->paragraph;
+
     NXPrintf(stream, "%s %s %f %d\n",
-	style->SGMLTag,
-	style->font ? [style->font name] : NONE_STRING,
-	style->fontSize,
-	p!=0);
+	     style->SGMLTag,
+	     style->font ?[style->font name] : NONE_STRING,
+	     style->fontSize,
+	     p != 0);
 
     if (p) {
 	NXPrintf(stream, "\t%f %f %f %f %d %f %f\t%d\n",
-	    p->indent1st,
-	    p->indent2nd,
-	    p->lineHt,
-	    p->descentLine,
-	    p->alignment,
-	    style->spaceBefore,
-	    style->spaceAfter,
-	    p->numTabs);
-
-	for (tab=0; tab < p->numTabs; tab++)
+		 p->indent1st,
+		 p->indent2nd,
+		 p->lineHt,
+		 p->descentLine,
+		 p->alignment,
+		 style->spaceBefore,
+		 style->spaceAfter,
+		 p->numTabs);
+
+	for (tab = 0; tab < p->numTabs; tab++)
 	    NXPrintf(stream, "\t%d %f\n",
-		    p->tabs[tab].kind,
-		    p->tabs[tab].x);
-	}
+		     p->tabs[tab].kind,
+		     p->tabs[tab].x);
+    }
     return style;
 }
 
-
 /*	Write a style to stdout for diagnostics
 */
-HTStyle * HTStyleDump (HTStyle * style)
+HTStyle *HTStyleDump(HTStyle *style)
 {
     int tab;
     NXTextStyle *p = style->paragraph;
+
     printf(STYLE_DUMP_FONT,
-	style,
-	style->name,
-	style->SGMLTag,
-	[style->font name],
-	style->fontSize);
+	   style,
+	   style->name,
+	   style->SGMLTag,
+	   [style->font name],
+	   style->fontSize);
     if (p) {
 	printf(STYLE_DUMP_IDENT,
-	    p->indent1st,
-	    p->indent2nd,
-	    p->lineHt,
-	    p->descentLine);
+	       p->indent1st,
+	       p->indent2nd,
+	       p->lineHt,
+	       p->descentLine);
 	printf(STYLE_DUMP_ALIGN,
-	    p->alignment,
-	    p->numTabs,
-	    style->spaceBefore,
-	    style->spaceAfter);
+	       p->alignment,
+	       p->numTabs,
+	       style->spaceBefore,
+	       style->spaceAfter);
 
-	for (tab=0; tab < p->numTabs; tab++) {
+	for (tab = 0; tab < p->numTabs; tab++) {
 	    printf(STYLE_DUMP_TAB,
-		    p->tabs[tab].kind,
-		    p->tabs[tab].x);
+		   p->tabs[tab].kind,
+		   p->tabs[tab].x);
 	}
 	printf("\n");
-    } /* if paragraph */
+    }				/* if paragraph */
     return style;
 }
 #endif /* SUPPRESS */
 
-
 /*			StyleSheet Functions
-**			====================
-*/
+ *			====================
+ */
 
 /*	Searching for styles:
 */
-HTStyle * HTStyleNamed (HTStyleSheet * self, const char * name)
+HTStyle *HTStyleNamed(HTStyleSheet *self, const char *name)
 {
-    HTStyle * scan;
-    for (scan=self->styles; scan; scan=scan->next)
-	if (0==strcmp(scan->name, name)) return scan;
+    HTStyle *scan;
+
+    for (scan = self->styles; scan; scan = scan->next)
+	if (0 == strcmp(scan->name, name))
+	    return scan;
     CTRACE((tfp, "StyleSheet: No style named `%s'\n", name));
     return NULL;
 }
 
 #ifdef NEXT_SUPRESS		/* Not in general common code */
 
-HTStyle * HTStyleMatching (HTStyleSheet * self, HTStyle *style)
+HTStyle *HTStyleMatching(HTStyleSheet *self, HTStyle *style)
 {
-    HTStyle * scan;
-    for (scan=self->styles; scan; scan=scan->next)
-	if (scan->paragraph == para) return scan;
+    HTStyle *scan;
+
+    for (scan = self->styles; scan; scan = scan->next)
+	if (scan->paragraph == para)
+	    return scan;
     return NULL;
 }
 
 /*	Find the style which best fits a given run
-**	------------------------------------------
-**
-**	This heuristic is used for guessing the style for a run of
-**	text which has been pasted in.  In order, we try:
-**
-**	A style whose paragraph structure is actually used by the run.
-**	A style matching in font
-**	A style matching in paragraph style exactly
-**	A style matching in paragraph to a degree
-*/
-
-HTStyle * HTStyleForRun (HTStyleSheet *self, NXRun *run)
+ *	------------------------------------------
+ *
+ *	This heuristic is used for guessing the style for a run of
+ *	text which has been pasted in.  In order, we try:
+ *
+ *	A style whose paragraph structure is actually used by the run.
+ *	A style matching in font
+ *	A style matching in paragraph style exactly
+ *	A style matching in paragraph to a degree
+ */
+
+HTStyle *HTStyleForRun(HTStyleSheet *self, NXRun * run)
 {
-    HTStyle * scan;
-    HTStyle * best = 0;
+    HTStyle *scan;
+    HTStyle *best = 0;
     int bestMatch = 0;
-    NXTextStyle * rp = run->paraStyle;
-    for (scan=self->styles; scan; scan=scan->next)
-	if (scan->paragraph == run->paraStyle) return scan;	/* Exact */
+    NXTextStyle *rp = run->paraStyle;
+
+    for (scan = self->styles; scan; scan = scan->next)
+	if (scan->paragraph == run->paraStyle)
+	    return scan;	/* Exact */
+
+    for (scan = self->styles; scan; scan = scan->next) {
+	NXTextStyle *sp = scan->paragraph;
 
-    for (scan=self->styles; scan; scan=scan->next){
-	NXTextStyle * sp = scan->paragraph;
 	if (sp) {
 	    int match = 0;
-	    if (sp->indent1st ==	rp->indent1st)	match = match+1;
-	    if (sp->indent2nd ==	rp->indent2nd)	match = match+2;
-	    if (sp->lineHt ==		rp->lineHt)	match = match+1;
-	    if (sp->numTabs ==		rp->numTabs)	match = match+1;
-	    if (sp->alignment ==	rp->alignment)	match = match+3;
-	    if (scan->font ==		run->font)	match = match+10;
-	    if (match>bestMatch) {
-		    best=scan;
-		    bestMatch=match;
+
+	    if (sp->indent1st == rp->indent1st)
+		match = match + 1;
+	    if (sp->indent2nd == rp->indent2nd)
+		match = match + 2;
+	    if (sp->lineHt == rp->lineHt)
+		match = match + 1;
+	    if (sp->numTabs == rp->numTabs)
+		match = match + 1;
+	    if (sp->alignment == rp->alignment)
+		match = match + 3;
+	    if (scan->font == run->font)
+		match = match + 10;
+	    if (match > bestMatch) {
+		best = scan;
+		bestMatch = match;
 	    }
 	}
     }
     CTRACE((tfp, "HTStyleForRun: Best match for style is %d out of 18\n",
-		 bestMatch));
+	    bestMatch));
     return best;
 }
 #endif /* NEXT_SUPRESS */
 
-
 /*	Add a style to a sheet
-**	----------------------
-*/
-HTStyleSheet * HTStyleSheetAddStyle (HTStyleSheet * self, HTStyle * style)
+ *	----------------------
+ */
+HTStyleSheet *HTStyleSheetAddStyle(HTStyleSheet *self, HTStyle *style)
 {
     style->next = 0;		/* The style will go on the end */
     if (!self->styles) {
 	self->styles = style;
     } else {
-	HTStyle * scan;
-	for(scan=self->styles; scan->next; scan=scan->next); /* Find end */
-	scan->next=style;
+	HTStyle *scan;
+
+	for (scan = self->styles; scan->next; scan = scan->next) ;	/* Find end */
+	scan->next = style;
     }
     return self;
 }
 
-
 /*	Remove the given object from a style sheet if it exists
 */
-HTStyleSheet * HTStyleSheetRemoveStyle (HTStyleSheet * self, HTStyle * style)
+HTStyleSheet *HTStyleSheetRemoveStyle(HTStyleSheet *self, HTStyle *style)
 {
     if (self->styles == style) {
 	self->styles = style->next;
 	return self;
     } else {
-	HTStyle * scan;
-	for(scan = self->styles; scan; scan = scan->next) {
+	HTStyle *scan;
+
+	for (scan = self->styles; scan; scan = scan->next) {
 	    if (scan->next == style) {
 		scan->next = style->next;
 		return self;
@@ -283,21 +296,22 @@ HTStyleSheet * HTStyleSheetRemoveStyle (HTStyleSheet * self, HTStyle * style)
 /*	Create new style sheet
 */
 
-HTStyleSheet * HTStyleSheetNew (void)
+HTStyleSheet *HTStyleSheetNew(void)
 {
-    HTStyleSheet * self = typecalloc(HTStyleSheet);
+    HTStyleSheet *self = typecalloc(HTStyleSheet);
+
     if (self == NULL)
 	outofmem(__FILE__, "HTStyleSheetNew");
     return self;
 }
 
-
 /*	Free off a style sheet pointer
 */
-HTStyleSheet * HTStyleSheetFree (HTStyleSheet * self)
+HTStyleSheet *HTStyleSheetFree(HTStyleSheet *self)
 {
-    HTStyle * style;
-    while((style=self->styles)!=0) {
+    HTStyle *style;
+
+    while ((style = self->styles) != 0) {
 	self->styles = style->next;
 	HTStyleFree(style);
     }
@@ -305,24 +319,24 @@ HTStyleSheet * HTStyleSheetFree (HTStyleSheet * self)
     return NULL;
 }
 
-
 /*	Read a stylesheet from a typed stream
-**	-------------------------------------
-**
-**	Reads a style sheet from a stream.  If new styles have the same names
-**	as existing styles, they replace the old ones without changing the ids.
-*/
-
-#ifdef NEXT_SUPRESS  /* Only on the NeXT */
-HTStyleSheet * HTStyleSheetRead(HTStyleSheet * self, NXStream * stream)
+ *	-------------------------------------
+ *
+ *	Reads a style sheet from a stream.  If new styles have the same names
+ *	as existing styles, they replace the old ones without changing the ids.
+ */
+
+#ifdef NEXT_SUPRESS		/* Only on the NeXT */
+HTStyleSheet *HTStyleSheetRead(HTStyleSheet *self, NXStream * stream)
 {
     int numStyles;
     int i;
-    HTStyle * style;
+    HTStyle *style;
     char styleName[80];
+
     NXScanf(stream, " %d ", &numStyles);
     CTRACE((tfp, "Stylesheet: Reading %d styles\n", numStyles));
-    for (i=0; i<numStyles; i++) {
+    for (i = 0; i < numStyles; i++) {
 	NXScanf(stream, "%s", styleName);
 	style = HTStyleNamed(self, styleName);
 	if (!style) {
@@ -330,27 +344,29 @@ HTStyleSheet * HTStyleSheetRead(HTStyleSheet * self, NXStream * stream)
 	    (void) HTStyleSheetAddStyle(self, style);
 	}
 	(void) HTStyleRead(style, stream);
-	if (TRACE) HTStyleDump(style);
+	if (TRACE)
+	    HTStyleDump(style);
     }
     return self;
 }
 
 /*	Write a stylesheet to a typed stream
-**	------------------------------------
-**
-**	Writes a style sheet to a stream.
-*/
+ *	------------------------------------
+ *
+ *	Writes a style sheet to a stream.
+ */
 
-HTStyleSheet * HTStyleSheetWrite(HTStyleSheet * self, NXStream * stream)
+HTStyleSheet *HTStyleSheetWrite(HTStyleSheet *self, NXStream * stream)
 {
     int numStyles = 0;
-    HTStyle * style;
+    HTStyle *style;
 
-    for(style=self->styles; style; style=style->next) numStyles++;
+    for (style = self->styles; style; style = style->next)
+	numStyles++;
     NXPrintf(stream, "%d\n", numStyles);
 
     CTRACE((tfp, "StyleSheet: Writing %d styles\n", numStyles));
-    for (style=self->styles; style; style=style->next) {
+    for (style = self->styles; style; style = style->next) {
 	NXPrintf(stream, "%s ", style->name);
 	(void) HTStyleWrite(style, stream);
     }
diff --git a/WWW/Library/Implementation/HTStyle.h b/WWW/Library/Implementation/HTStyle.h
index 2c3096f0..790ad126 100644
--- a/WWW/Library/Implementation/HTStyle.h
+++ b/WWW/Library/Implementation/HTStyle.h
@@ -1,32 +1,35 @@
 /*                                                       HTStyle: Style management for libwww
                               STYLE DEFINITION FOR HYPERTEXT
 
-   Styles allow the translation between a logical property of a piece of text and its
-   physical representation.
+   Styles allow the translation between a logical property of a piece of text
+   and its physical representation.
 
-   A StyleSheet is a collection of styles, defining the translation necessary to represent
-   a document.  It is a linked list of styles.
+   A StyleSheet is a collection of styles, defining the translation necessary
+   to represent a document.  It is a linked list of styles.
 
 Overriding this module
 
-   Why is the style structure declared in the HTStyle.h module, instead of having the user
-   browser define the structure, and the HTStyle routines just use sizeof() for copying?
+   Why is the style structure declared in the HTStyle.h module, instead of
+   having the user browser define the structure, and the HTStyle routines just
+   use sizeof() for copying?
 
-   It's not obvious whether HTStyle.c should be common code.  It's useful to have common
-   code for loading style sheets, especially if the movement toward standard style sheets
-   gets going.
+   It's not obvious whether HTStyle.c should be common code.  It's useful to
+   have common code for loading style sheets, especially if the movement toward
+   standard style sheets gets going.
 
-   If it IS common code, then both the hypertext object and HTStyle.c must know the
-   structure of a style, so HTStyle.h is a suitable place to put that.  HTStyle.c has to
-   be compiled with a knowledge of the
+   If it IS common code, then both the hypertext object and HTStyle.c must know
+   the structure of a style, so HTStyle.h is a suitable place to put that. 
+   HTStyle.c has to be compiled with a knowledge of the
 
-   It we take it out of the library, then of course HTStyle could be declared as an
-   undefined structure.  The only references to it are in the structure-flattening code
-   HTML.c and HTPlain.c, which only use HTStypeNamed().
+   It we take it out of the library, then of course HTStyle could be declared
+   as an undefined structure.  The only references to it are in the
+   structure-flattening code HTML.c and HTPlain.c, which only use
+   HTStypeNamed().
 
-   You can in any case override this function in your own code, which will prevent the
-   HTStyle from being loaded.  You will be able to redefine your style structure in this
-   case without problems, as no other moule needs to know it.
+   You can in any case override this function in your own code, which will
+   prevent the HTStyle from being loaded.  You will be able to redefine your
+   style structure in this case without problems, as no other moule needs to
+   know it.
 
  */
 #ifndef HTStyle_H
@@ -34,83 +37,81 @@ Overriding this module
 
 #include <HTAnchor.h>
 
-typedef long int HTFont;        /* Dummy definition instead */
+typedef long int HTFont;	/* Dummy definition instead */
 
 #ifdef NeXT_suppressed
 #include <appkit/appkit.h>
 typedef NXCoord HTCoord;
+
 #define HTParagraphStyle NXTextStyle
 #define HTCoord NXCoord
 typedef struct _color {
-        float   grey;
-        int     RGBColor;
+    float grey;
+    int RGBColor;
 } HTColor;
+
 #else
 
 typedef int HTCoord;		/* changed from float to int - kw */
 
 typedef struct _HTParagraphStyle {
-    HTCoord     left_indent;            /* @@@@ junk! etc etc*/
+    HTCoord left_indent;	/* @@@@ junk! etc etc */
 } HTParagraphStyle;
 
-typedef int HTColor;            /* Sorry about the US spelling! */
+typedef int HTColor;		/* Sorry about the US spelling! */
 
 #endif
 
-
-
-#define STYLE_NAME_LENGTH       80      /* @@@@@@@@@@@ */
+#define STYLE_NAME_LENGTH       80	/* @@@@@@@@@@@ */
 
 typedef struct {
-    short               kind;           /* only NX_LEFTTAB implemented*/
-    HTCoord             position;       /* x coordinate for stop */
+    short kind;			/* only NX_LEFTTAB implemented */
+    HTCoord position;		/* x coordinate for stop */
 } HTTabStop;
 
-
 /*      The Style Structure
-**      -------------------
-*/
+ *      -------------------
+ */
 
 typedef struct _HTStyle {
 
 /*      Style management information
 */
-    struct _HTStyle     *next;          /* Link for putting into stylesheet */
-    char *              name;           /* Style name */
-    int                 id;             /* equivalent of name, for speed */
-    char *              SGMLTag;        /* Tag name to start */
-
+    struct _HTStyle *next;	/* Link for putting into stylesheet */
+    char *name;			/* Style name */
+    int id;			/* equivalent of name, for speed */
+    char *SGMLTag;		/* Tag name to start */
 
 /*      Character attributes    (a la NXRun)
 */
-    HTFont              font;           /* Font id */
-    HTCoord             fontSize;       /* The size of font, not independent */
-    HTColor             color;		/* text gray of current run */
-    int                 superscript;    /* superscript (-sub) in points */
+    HTFont font;		/* Font id */
+    HTCoord fontSize;		/* The size of font, not independent */
+    HTColor color;		/* text gray of current run */
+    int superscript;		/* superscript (-sub) in points */
 
-    HTAnchor            *anchor;        /* Anchor id if any, else zero */
+    HTAnchor *anchor;		/* Anchor id if any, else zero */
 
 /*      Paragraph Attribtes     (a la NXTextStyle)
 */
-    HTCoord             indent1st;      /* how far first line in paragraph is
-                                 * indented */
-    HTCoord             leftIndent;     /* how far second line is indented */
-    HTCoord             rightIndent;    /* (Missing from NeXT version */
-    short               alignment;      /* quad justification */
-    HTCoord             lineHt;         /* line height */
-    HTCoord             descentLine;    /* descender bottom from baseline */
-    const HTTabStop     *tabs;          /* array of tab stops, 0 terminated */
-
-    BOOL                wordWrap;       /* Yes means wrap at space not char */
-    BOOL                freeFormat;     /* Yes means \n is just white space */
-    HTCoord             spaceBefore;    /* Omissions from NXTextStyle */
-    HTCoord             spaceAfter;
-    int                 paraFlags;      /* Paragraph flags, bits as follows: */
-
-#define PARA_KEEP       1       /* Do not break page within this paragraph */
-#define PARA_WITH_NEXT  2       /* Do not break page after this paragraph */
-
-#define HT_JUSTIFY 0            /* For alignment */
+    HTCoord indent1st;		/* how far first line in paragraph is
+				   * indented */
+    HTCoord leftIndent;		/* how far second line is indented */
+    HTCoord rightIndent;	/* (Missing from NeXT version */
+    short alignment;		/* quad justification */
+    HTCoord lineHt;		/* line height */
+    HTCoord descentLine;	/* descender bottom from baseline */
+    const HTTabStop *tabs;	/* array of tab stops, 0 terminated */
+
+    BOOL wordWrap;		/* Yes means wrap at space not char */
+    BOOL freeFormat;		/* Yes means \n is just white space */
+    HTCoord spaceBefore;	/* Omissions from NXTextStyle */
+    HTCoord spaceAfter;
+    int paraFlags;		/* Paragraph flags, bits as follows: */
+
+#define PARA_KEEP       1	/* Do not break page within this paragraph */
+#define PARA_WITH_NEXT  2	/* Do not break page after this paragraph */
+
+#define HT_JUSTIFY 0		/* For alignment */
 #define HT_LEFT 1
 #define HT_RIGHT 2
 #define HT_CENTER 3
@@ -121,98 +122,95 @@ typedef struct _HTStyle {
 
 /*      Style functions:
 */
-extern HTStyle * HTStyleNew (void);
-extern HTStyle * HTStyleNewNamed (const char * name);
-extern HTStyle * HTStyleFree (HTStyle * self);
+extern HTStyle *HTStyleNew(void);
+extern HTStyle *HTStyleNewNamed(const char *name);
+extern HTStyle *HTStyleFree(HTStyle *self);
+
 #ifdef SUPRESS
-extern HTStyle * HTStyleRead (HTStyle * self, HTStream * stream);
-extern HTStyle * HTStyleWrite (HTStyle * self, HTStream * stream);
+extern HTStyle *HTStyleRead(HTStyle *self, HTStream *stream);
+extern HTStyle *HTStyleWrite(HTStyle *self, HTStream *stream);
 #endif
 /*              Style Sheet
-**              -----------
-*/
+ *              -----------
+ */
 typedef struct _HTStyleSheet {
-        char *          name;
-        HTStyle *       styles;
+    char *name;
+    HTStyle *styles;
 } HTStyleSheet;
 
-
 /*      Stylesheet functions:
 */
-extern HTStyleSheet * HTStyleSheetNew (void);
-extern HTStyleSheet * HTStyleSheetFree (HTStyleSheet * self);
-extern HTStyle * HTStyleNamed (HTStyleSheet * self, const char * name);
-extern HTStyle * HTStyleForParagraph (HTStyleSheet * self,
-        HTParagraphStyle * paraStyle);
-extern HTStyle * HTStyleMatching (HTStyleSheet *self, HTStyle * style);
+extern HTStyleSheet *HTStyleSheetNew(void);
+extern HTStyleSheet *HTStyleSheetFree(HTStyleSheet *self);
+extern HTStyle *HTStyleNamed(HTStyleSheet *self, const char *name);
+extern HTStyle *HTStyleForParagraph(HTStyleSheet *self, HTParagraphStyle * paraStyle);
+extern HTStyle *HTStyleMatching(HTStyleSheet *self, HTStyle *style);
+
 /* extern HTStyle * HTStyleForRun (HTStyleSheet *self, NXRun * run); */
-extern HTStyleSheet * HTStyleSheetAddStyle (HTStyleSheet * self,
-        HTStyle * style);
-extern HTStyleSheet * HTStyleSheetRemoveStyle (HTStyleSheet * self,
-        HTStyle * style);
+extern HTStyleSheet *HTStyleSheetAddStyle(HTStyleSheet *self, HTStyle *style);
+extern HTStyleSheet *HTStyleSheetRemoveStyle(HTStyleSheet *self, HTStyle *style);
+
 #ifdef SUPPRESS
-extern HTStyleSheet * HTStyleSheetRead (HTStyleSheet * self,
-                                                HTStream * stream);
-extern HTStyleSheet * HTStyleSheetWrite (HTStyleSheet * self,
-                                                HTStream * stream);
+extern HTStyleSheet *HTStyleSheetRead(HTStyleSheet *self, HTStream *stream);
+extern HTStyleSheet *HTStyleSheetWrite(HTStyleSheet *self, HTStream *stream);
 #endif
-#define CLEAR_POINTER ((void *)-1)      /* Pointer value means "clear me" */
+#define CLEAR_POINTER ((void *)-1)	/* Pointer value means "clear me" */
 
 /* DefaultStyle.c */
-extern HTStyleSheet * DefaultStyle (HTStyle*** result_array);
+extern HTStyleSheet *DefaultStyle(HTStyle ***result_array);
 
 /* enum, use this instead of HTStyle name comparisons */
 enum HTStyle_Enum {
-	ST_Normal = 0,
-	ST_DivCenter,
-	ST_DivLeft,
-	ST_DivRight,
-	ST_Banner,
-	ST_Blockquote,
-	ST_Bq,
-	ST_Footnote,
-	ST_List,
-	ST_List1,
-	ST_List2,
-	ST_List3,
-	ST_List4,
-	ST_List5,
-	ST_List6,
-	ST_Menu,
-	ST_Menu1,
-	ST_Menu2,
-	ST_Menu3,
-	ST_Menu4,
-	ST_Menu5,
-	ST_Menu6,
-	ST_Glossary,
-	ST_Glossary1,
-	ST_Glossary2,
-	ST_Glossary3,
-	ST_Glossary4,
-	ST_Glossary5,
-	ST_Glossary6,
-	ST_GlossaryCompact,
-	ST_GlossaryCompact1,
-	ST_GlossaryCompact2,
-	ST_GlossaryCompact3,
-	ST_GlossaryCompact4,
-	ST_GlossaryCompact5,
-	ST_GlossaryCompact6,
-	ST_Example,
-	ST_Preformatted,
-	ST_Listing,
-	ST_Address,
-	ST_Note,
-	ST_Heading1,
-	ST_Heading2,
-	ST_Heading3,
-	ST_Heading4,
-	ST_Heading5,
-	ST_Heading6,
-	ST_HeadingCenter,
-	ST_HeadingLeft,
-	ST_HeadingRight
+    ST_Normal = 0,
+    ST_DivCenter,
+    ST_DivLeft,
+    ST_DivRight,
+    ST_Banner,
+    ST_Blockquote,
+    ST_Bq,
+    ST_Footnote,
+    ST_List,
+    ST_List1,
+    ST_List2,
+    ST_List3,
+    ST_List4,
+    ST_List5,
+    ST_List6,
+    ST_Menu,
+    ST_Menu1,
+    ST_Menu2,
+    ST_Menu3,
+    ST_Menu4,
+    ST_Menu5,
+    ST_Menu6,
+    ST_Glossary,
+    ST_Glossary1,
+    ST_Glossary2,
+    ST_Glossary3,
+    ST_Glossary4,
+    ST_Glossary5,
+    ST_Glossary6,
+    ST_GlossaryCompact,
+    ST_GlossaryCompact1,
+    ST_GlossaryCompact2,
+    ST_GlossaryCompact3,
+    ST_GlossaryCompact4,
+    ST_GlossaryCompact5,
+    ST_GlossaryCompact6,
+    ST_Example,
+    ST_Preformatted,
+    ST_Listing,
+    ST_Address,
+    ST_Note,
+    ST_Heading1,
+    ST_Heading2,
+    ST_Heading3,
+    ST_Heading4,
+    ST_Heading5,
+    ST_Heading6,
+    ST_HeadingCenter,
+    ST_HeadingLeft,
+    ST_HeadingRight
 };
 
 #endif /* HTStyle_H */
diff --git a/WWW/Library/Implementation/HTTCP.c b/WWW/Library/Implementation/HTTCP.c
index e11f8070..707863e9 100644
--- a/WWW/Library/Implementation/HTTCP.c
+++ b/WWW/Library/Implementation/HTTCP.c
@@ -1,20 +1,20 @@
 /*			Generic Communication Code		HTTCP.c
-**			==========================
-**
-**	This code is in common between client and server sides.
-**
-**	16 Jan 92  TBL	Fix strtol() undefined on CMU Mach.
-**	25 Jun 92  JFG	Added DECNET option through TCP socket emulation.
-**	13 Sep 93  MD	Added correct return of vmserrorno for HTInetStatus.
-**			Added decoding of vms error message for MULTINET.
-**	7-DEC-1993 Bjorn S. Nilsson, ALEPH, CERN, VMS UCX ioctl() changes
-**			(done of Mosaic)
-**	19 Feb 94  Danny Mayer	Added Bjorn Fixes to Lynx version
-**	 7 Mar 94  Danny Mayer	Added Fix UCX version for full domain name
-**	20 May 94  Andy Harper	Added support for CMU TCP/IP transport
-**	17 Nov 94  Andy Harper	Added support for SOCKETSHR transport
-**	16 Jul 95  S. Bjorndahl added kluge to deal with LIBCMU bug
-*/
+ *			==========================
+ *
+ *	This code is in common between client and server sides.
+ *
+ *	16 Jan 92  TBL	Fix strtol() undefined on CMU Mach.
+ *	25 Jun 92  JFG	Added DECNET option through TCP socket emulation.
+ *	13 Sep 93  MD	Added correct return of vmserrorno for HTInetStatus.
+ *			Added decoding of vms error message for MULTINET.
+ *	7-DEC-1993 Bjorn S. Nilsson, ALEPH, CERN, VMS UCX ioctl() changes
+ *			(done of Mosaic)
+ *	19 Feb 94  Danny Mayer	Added Bjorn Fixes to Lynx version
+ *	 7 Mar 94  Danny Mayer	Added Fix UCX version for full domain name
+ *	20 May 94  Andy Harper	Added support for CMU TCP/IP transport
+ *	17 Nov 94  Andy Harper	Added support for SOCKETSHR transport
+ *	16 Jul 95  S. Bjorndahl added kluge to deal with LIBCMU bug
+ */
 
 #include <HTUtils.h>
 #include <HTParse.h>
@@ -36,15 +36,18 @@
 #include <netdb.h>
 #endif /* __DJGPP__ */
 
+#define LYNX_ADDRINFO	struct addrinfo
+#define LYNX_HOSTENT	struct hostent
+
 #define OK_HOST(p) ((p) != 0 && ((p)->h_length) != 0)
 
 #ifdef SVR4_BSDSELECT
-int BSDselect (
-	int		 nfds,
-	fd_set *	 readfds,
-	fd_set *	 writefds,
-	fd_set *	 exceptfds,
-	struct timeval * select_timeout);
+int BSDselect(int nfds,
+	      fd_set * readfds,
+	      fd_set * writefds,
+	      fd_set * exceptfds,
+	      struct timeval *select_timeout);
+
 #ifdef select
 #undef select
 #endif /* select */
@@ -60,40 +63,40 @@ int BSDselect (
 #include <LYLeaks.h>
 
 /*
-**  Module-Wide variables
-*/
-static char *hostname = NULL;		/* The name of this host */
+ *  Module-Wide variables
+ */
+static char *hostname = NULL;	/* The name of this host */
 
 /*
-**  PUBLIC VARIABLES
-*/
+ *  PUBLIC VARIABLES
+ */
 #ifdef SOCKS
-unsigned long socks_bind_remoteAddr; /* for long Rbind */
+unsigned long socks_bind_remoteAddr;	/* for long Rbind */
 #endif /* SOCKS */
 
-/* PUBLIC SockA HTHostAddress; */	/* The internet address of the host */
+/* PUBLIC SockA HTHostAddress; *//* The internet address of the host */
 					/* Valid after call to HTHostName() */
 
 /*	Encode INET status (as in sys/errno.h)			  inet_status()
-**	------------------
-**
-**  On entry,
-**	where		gives a description of what caused the error
-**	global errno	gives the error number in the Unix way.
-**
-**  On return,
-**	returns		a negative status in the Unix way.
-*/
+ *	------------------
+ *
+ *  On entry,
+ *	where		gives a description of what caused the error
+ *	global errno	gives the error number in the Unix way.
+ *
+ *  On return,
+ *	returns		a negative status in the Unix way.
+ */
 
 #ifdef DECL_SYS_ERRLIST
-extern char *sys_errlist[];		/* see man perror on cernvax */
+extern char *sys_errlist[];	/* see man perror on cernvax */
 extern int sys_nerr;
 #endif /* DECL_SYS_ERRLIST */
 
 #ifdef __DJGPP__
-static int ResolveYield (void)
+static int ResolveYield(void)
 {
-    return HTCheckForInterrupt() ? 0 : 1;
+    return HTCheckForInterrupt()? 0 : 1;
 }
 #endif
 
@@ -102,37 +105,37 @@ static int ResolveYield (void)
  */
 #if defined(_WINDOWS_NSL)
 static char host[512];
-static struct hostent *phost; /* Pointer to host - See netdb.h */
+static LYNX_HOSTENT *phost;	/* Pointer to host - See netdb.h */
 static int donelookup;
 
-static unsigned long _fork_func (void *arglist GCC_UNUSED)
+static unsigned long _fork_func(void *arglist GCC_UNUSED)
 {
 #ifdef SH_EX
     unsigned long addr;
-    addr = (unsigned long)inet_addr(host);
-    if ((int)addr != -1)
-	phost = gethostbyaddr((char *)&addr, sizeof (addr), AF_INET);
+
+    addr = (unsigned long) inet_addr(host);
+    if ((int) addr != -1)
+	phost = gethostbyaddr((char *) &addr, sizeof(addr), AF_INET);
     else
 	phost = gethostbyname(host);
 #else
     phost = gethostbyname(host);
 #endif
     donelookup = TRUE;
-    return (unsigned long)(phost);
+    return (unsigned long) (phost);
 }
 #endif /* _WINDOWS_NSL */
 
 #if defined(VMS) && defined(UCX)
 /*
-**  A routine to mimic the ioctl function for UCX.
-**  Bjorn S. Nilsson, 25-Nov-1993. Based on an example in the UCX manual.
-*/
+ *  A routine to mimic the ioctl function for UCX.
+ *  Bjorn S. Nilsson, 25-Nov-1993. Based on an example in the UCX manual.
+ */
 #include <HTioctl.h>
 
-int HTioctl (
-	int		d,
-	int		request,
-	int *		argp)
+int HTioctl(int d,
+	    int request,
+	    int *argp)
 {
     int sdc, status;
     unsigned short fun, iosb[4];
@@ -147,25 +150,26 @@ int HTioctl (
 	struct comm *addr;
     } ioctl_desc;
 
-    if ((sdc = vaxc$get_sdc (d)) == 0) {
+    if ((sdc = vaxc$get_sdc(d)) == 0) {
 	set_errno(EBADF);
 	return -1;
     }
-    ioctl_desc.opt  = UCX$C_IOCTL;
-    ioctl_desc.len  = sizeof(struct comm);
+    ioctl_desc.opt = UCX$C_IOCTL;
+    ioctl_desc.len = sizeof(struct comm);
+
     ioctl_desc.addr = &ioctl_comm;
     if (request & IOC_OUT) {
 	fun = IO$_SENSEMODE;
 	p5 = 0;
-	p6 = (char *)&ioctl_desc;
+	p6 = (char *) &ioctl_desc;
     } else {
 	fun = IO$_SETMODE;
-	p5 = (char *)&ioctl_desc;
+	p5 = (char *) &ioctl_desc;
 	p6 = 0;
     }
     ioctl_comm.command = request;
-    ioctl_comm.addr = (char *)argp;
-    status = sys$qiow (0, sdc, fun, iosb, 0, 0, 0, 0, 0, 0, p5, p6);
+    ioctl_comm.addr = (char *) argp;
+    status = sys$qiow(0, sdc, fun, iosb, 0, 0, 0, 0, 0, 0, p5, p6);
     if (!(status & 01)) {
 	set_errno(status);
 	return -1;
@@ -182,13 +186,13 @@ int HTioctl (
 	   /* third arg is transport/platform specific */
 
 /*	Report Internet Error
-**	---------------------
-*/
-int HTInetStatus (
-	char *		where)
+ *	---------------------
+ */
+int HTInetStatus(char *where)
 {
     int status;
     int saved_errno = errno;
+
 #ifdef VMS
 #ifdef MULTINET
     SOCKET_ERRNO = vmserrno;
@@ -196,43 +200,43 @@ int HTInetStatus (
 #endif /* VMS */
 
 #ifdef VM
-    CTRACE((tfp, MY_FORMAT, SOCKET_ERRNO,  where,
-	   "(Error number not translated)"));	/* What Is the VM equiv? */
+    CTRACE((tfp, MY_FORMAT, SOCKET_ERRNO, where,
+	    "(Error number not translated)"));	/* What Is the VM equiv? */
 #define ER_NO_TRANS_DONE
 #endif /* VM */
 
 #ifdef VMS
 #ifdef MULTINET
-    CTRACE((tfp, MY_FORMAT, SOCKET_ERRNO,  where,
-	   vms_errno_string()));
+    CTRACE((tfp, MY_FORMAT, SOCKET_ERRNO, where,
+	    vms_errno_string()));
 #else
-    CTRACE((tfp, MY_FORMAT, SOCKET_ERRNO,  where,
-	   ((SOCKET_ERRNO > 0 && SOCKET_ERRNO <= 65) ?
-	    strerror(SOCKET_ERRNO) : "(Error number not translated)")));
+    CTRACE((tfp, MY_FORMAT, SOCKET_ERRNO, where,
+	    ((SOCKET_ERRNO > 0 && SOCKET_ERRNO <= 65) ?
+	     strerror(SOCKET_ERRNO) : "(Error number not translated)")));
 #endif /* MULTINET */
 #define ER_NO_TRANS_DONE
 #endif /* VMS */
 
 #ifdef HAVE_STRERROR
-    CTRACE((tfp, MY_FORMAT, SOCKET_ERRNO,  where,
-	   strerror(SOCKET_ERRNO)));
+    CTRACE((tfp, MY_FORMAT, SOCKET_ERRNO, where,
+	    strerror(SOCKET_ERRNO)));
 #define ER_NO_TRANS_DONE
 #endif /* HAVE_STRERROR */
 
 #ifndef ER_NO_TRANS_DONE
-    CTRACE((tfp, MY_FORMAT, SOCKET_ERRNO,  where,
-	   (SOCKET_ERRNO < sys_nerr ?
-	    sys_errlist[SOCKET_ERRNO] : "Unknown error" )));
+    CTRACE((tfp, MY_FORMAT, SOCKET_ERRNO, where,
+	    (SOCKET_ERRNO < sys_nerr ?
+	     sys_errlist[SOCKET_ERRNO] : "Unknown error")));
 #endif /* !ER_NO_TRANS_DONE */
 
 #ifdef VMS
 #ifndef MULTINET
     CTRACE((tfp,
-	   "         Unix error number (SOCKET_ERRNO) = %ld dec\n",
-	   SOCKET_ERRNO));
+	    "         Unix error number (SOCKET_ERRNO) = %ld dec\n",
+	    SOCKET_ERRNO));
     CTRACE((tfp,
-	   "         VMS error (vaxc$errno)    = %lx hex\n",
-	   vaxc$errno));
+	    "         VMS error (vaxc$errno)    = %lx hex\n",
+	    vaxc$errno));
 #endif /* MULTINET */
 #endif /* VMS */
 
@@ -240,8 +244,8 @@ int HTInetStatus (
 
 #ifdef VMS
     /*
-    **	uerrno and errno happen to be zero if vmserrno <> 0
-    */
+     * uerrno and errno happen to be zero if vmserrno <> 0
+     */
 #ifdef MULTINET
     status = -vmserrno;
 #else
@@ -254,95 +258,96 @@ int HTInetStatus (
 }
 
 /*	Parse a cardinal value				       parse_cardinal()
-**	----------------------
-**
-** On entry,
-**	*pp	    points to first character to be interpreted, terminated by
-**		    non 0:9 character.
-**	*pstatus    points to status already valid
-**	maxvalue    gives the largest allowable value.
-**
-** On exit,
-**	*pp	    points to first unread character
-**	*pstatus    points to status updated iff bad
-*/
-unsigned int HTCardinal (
-	int *		pstatus,
-	char **	pp,
-	unsigned int	max_value)
+ *	----------------------
+ *
+ * On entry,
+ *	*pp	    points to first character to be interpreted, terminated by
+ *		    non 0:9 character.
+ *	*pstatus    points to status already valid
+ *	maxvalue    gives the largest allowable value.
+ *
+ * On exit,
+ *	*pp	    points to first unread character
+ *	*pstatus    points to status updated iff bad
+ */
+unsigned int HTCardinal(int *pstatus,
+			char **pp,
+			unsigned int max_value)
 {
     unsigned int n;
-    if ((**pp<'0') || (**pp>'9')) {	    /* Null string is error */
-	*pstatus = -3;	/* No number where one expected */
+
+    if ((**pp < '0') || (**pp > '9')) {		/* Null string is error */
+	*pstatus = -3;		/* No number where one expected */
 	return 0;
     }
 
     n = 0;
     while ((**pp >= '0') && (**pp <= '9'))
-	n = n*10 + *((*pp)++) - '0';
+	n = n * 10 + *((*pp)++) - '0';
 
     if (n > max_value) {
-	*pstatus = -4;	/* Cardinal outside range */
+	*pstatus = -4;		/* Cardinal outside range */
 	return 0;
     }
 
     return n;
 }
 
-#ifndef DECNET	/* Function only used below for a trace message */
+#ifndef DECNET			/* Function only used below for a trace message */
 /*	Produce a string for an Internet address
-**	----------------------------------------
-**
-**  On exit,
-**	returns a pointer to a static string which must be copied if
-**		it is to be kept.
-*/
-const char * HTInetString (
-	SockA*		soc_in)
+ *	----------------------------------------
+ *
+ *  On exit,
+ *	returns a pointer to a static string which must be copied if
+ *		it is to be kept.
+ */
+const char *HTInetString(SockA * soc_in)
 {
 #ifdef INET6
     static char hostbuf[MAXHOSTNAMELEN];
-    getnameinfo((struct sockaddr *)soc_in,
-	    SOCKADDR_LEN(soc_in),
-	    hostbuf, sizeof(hostbuf), NULL, 0, NI_NUMERICHOST);
+
+    getnameinfo((struct sockaddr *) soc_in,
+		SOCKADDR_LEN(soc_in),
+		hostbuf, sizeof(hostbuf), NULL, 0, NI_NUMERICHOST);
     return hostbuf;
 #else
     static char string[20];
+
     sprintf(string, "%d.%d.%d.%d",
-	    (int)*((unsigned char *)(&soc_in->sin_addr)+0),
-	    (int)*((unsigned char *)(&soc_in->sin_addr)+1),
-	    (int)*((unsigned char *)(&soc_in->sin_addr)+2),
-	    (int)*((unsigned char *)(&soc_in->sin_addr)+3));
+	    (int) *((unsigned char *) (&soc_in->sin_addr) + 0),
+	    (int) *((unsigned char *) (&soc_in->sin_addr) + 1),
+	    (int) *((unsigned char *) (&soc_in->sin_addr) + 2),
+	    (int) *((unsigned char *) (&soc_in->sin_addr) + 3));
     return string;
 #endif /* INET6 */
 }
 #endif /* !DECNET */
 
 /*	Check whether string is a valid Internet hostname - kw
-**	-------------------------------------------------
-**
-**  Checks whether
-**  - contains only valid chars for domain names (actually, the
-**    restrictions are somewhat relaxed),
-**  - no leading dots or empty segments,
-**  - no segment starts with '-' or '+' [this protects telnet command],
-**  - max. length of dot-separated segment <= 63 (RFC 1034,1035),
-**  - total length <= 254 (if it ends with dot) or 253 (otherwise)
-**     [an interpretation of RFC 1034,1035, although RFC 1123
-**      suggests 255 as limit - kw].
-**
-**  Note: user (before '@') and port (after ':') components from
-**      host part of URL should be already stripped (if appropriate)
-**      from the input string.
-**
-**  On exit,
-**	returns 1 if valid, otherwise 0.
-*/
-BOOL valid_hostname (
-	char *	name)
+ *	-------------------------------------------------
+ *
+ *  Checks whether
+ *  - contains only valid chars for domain names (actually, the
+ *    restrictions are somewhat relaxed),
+ *  - no leading dots or empty segments,
+ *  - no segment starts with '-' or '+' [this protects telnet command],
+ *  - max. length of dot-separated segment <= 63 (RFC 1034,1035),
+ *  - total length <= 254 (if it ends with dot) or 253 (otherwise)
+ *     [an interpretation of RFC 1034,1035, although RFC 1123
+ *      suggests 255 as limit - kw].
+ *
+ *  Note: user (before '@') and port (after ':') components from
+ *      host part of URL should be already stripped (if appropriate)
+ *      from the input string.
+ *
+ *  On exit,
+ *	returns 1 if valid, otherwise 0.
+ */
+BOOL valid_hostname(char *name)
 {
-    int i=1, iseg = 0;
+    int i = 1, iseg = 0;
     char *cp = name;
+
     if (!(name && *name))
 	return NO;
     for (; (*cp && i <= 253); cp++, i++) {
@@ -369,12 +374,11 @@ BOOL valid_hostname (
 
 #ifdef NSL_FORK
 /*
-**  Function to allow us to be killed with a normal signal (not
-**  SIGKILL), but don't go through normal libc exit() processing, which
-**  would screw up parent's stdio.  -BL
-*/
-static void quench (
-	int	sig GCC_UNUSED)
+ *  Function to allow us to be killed with a normal signal (not
+ *  SIGKILL), but don't go through normal libc exit() processing, which
+ *  would screw up parent's stdio.  -BL
+ */
+static void quench(int sig GCC_UNUSED)
 {
     _exit(2);
 }
@@ -383,56 +387,56 @@ static void quench (
 int lynx_nsl_status = HT_OK;
 
 #define DEBUG_HOSTENT		/* disable in case of problems */
-#define DEBUG_HOSTENT_CHILD  /* for NSL_FORK, may screw up trace file */
+#define DEBUG_HOSTENT_CHILD	/* for NSL_FORK, may screw up trace file */
 
 /*
-**  Two auxiliary functions for name lookup and struct hostent.
-**
-**  dump_hostent - dumps the contents of a struct hostent to the
-**  trace log or stderr, including all pointer values, strings, and
-**  addresses, in a format inspired by gdb's print format. - kw
-*/
-static void dump_hostent (
-    const char *		msgprefix,
-    const struct hostent *	phost)
+ *  Two auxiliary functions for name lookup and LYNX_HOSTENT.
+ *
+ *  dump_hostent - dumps the contents of a LYNX_HOSTENT to the
+ *  trace log or stderr, including all pointer values, strings, and
+ *  addresses, in a format inspired by gdb's print format. - kw
+ */
+static void dump_hostent(const char *msgprefix,
+			 const LYNX_HOSTENT *phost)
 {
     if (TRACE) {
 	int i;
 	char **pcnt;
-	CTRACE((tfp,"%s: %p ", msgprefix, phost));
+
+	CTRACE((tfp, "%s: %p ", msgprefix, phost));
 	if (phost) {
-	    CTRACE((tfp,"{ h_name = %p", phost->h_name));
+	    CTRACE((tfp, "{ h_name = %p", phost->h_name));
 	    if (phost->h_name) {
 		CTRACE((tfp, " \"%s\",", phost->h_name));
 	    } else {
 		CTRACE((tfp, ","));
 	    }
-	    CTRACE((tfp,"\n\t h_aliases = %p", phost->h_aliases));
+	    CTRACE((tfp, "\n\t h_aliases = %p", phost->h_aliases));
 	    if (phost->h_aliases) {
 		CTRACE((tfp, " {"));
 		for (pcnt = phost->h_aliases; *pcnt; pcnt++) {
-		    CTRACE((tfp,"%s %p \"%s\"",
-			   (pcnt == phost->h_aliases ? " " : ", "),
-			   *pcnt, *pcnt));
+		    CTRACE((tfp, "%s %p \"%s\"",
+			    (pcnt == phost->h_aliases ? " " : ", "),
+			    *pcnt, *pcnt));
 		}
 		CTRACE((tfp, "%s0x0 },\n\t",
-		       (*phost->h_aliases ? ", " : " ")));
+			(*phost->h_aliases ? ", " : " ")));
 	    } else {
 		CTRACE((tfp, ",\n\t"));
 	    }
-	    CTRACE((tfp," h_addrtype = %d,", phost->h_addrtype));
-	    CTRACE((tfp," h_length = %d,\n\t", phost->h_length));
-	    CTRACE((tfp," h_addr_list = %p", phost->h_addr_list));
+	    CTRACE((tfp, " h_addrtype = %d,", phost->h_addrtype));
+	    CTRACE((tfp, " h_length = %d,\n\t", phost->h_length));
+	    CTRACE((tfp, " h_addr_list = %p", phost->h_addr_list));
 	    if (phost->h_addr_list) {
 		CTRACE((tfp, " {"));
 		for (pcnt = phost->h_addr_list; *pcnt; pcnt++) {
-		    CTRACE((tfp,"%s %p",
-			   (pcnt == phost->h_addr_list ? "" : ","),
-			   *pcnt));
+		    CTRACE((tfp, "%s %p",
+			    (pcnt == phost->h_addr_list ? "" : ","),
+			    *pcnt));
 		    for (i = 0; i < phost->h_length; i++) {
-			CTRACE((tfp, "%s%d%s", (i==0 ? " \"" : "."),
-			       (int)*((unsigned char *)(*pcnt)+i),
-			       (i+1 == phost->h_length ? "\"" : "")));
+			CTRACE((tfp, "%s%d%s", (i == 0 ? " \"" : "."),
+				(int) *((unsigned char *) (*pcnt) + i),
+				(i + 1 == phost->h_length ? "\"" : "")));
 		    }
 		}
 		if (*phost->h_addr_list) {
@@ -444,34 +448,33 @@ static void dump_hostent (
 		CTRACE((tfp, "}"));
 	    }
 	}
-	CTRACE((tfp,"\n"));
+	CTRACE((tfp, "\n"));
 	fflush(tfp);
     }
 }
 
 /*
-**  fill_rehostent - copies as much as possible relevant content from
-**  the struct hostent pointed to by phost to the char buffer given
-**  by rehostent, subject to maximum output length rehostentsize,
-**  following pointers and building self-contained output which can be
-**  cast to a struct hostent. - kw
-**  See also description of LYGetHostByName.
-*/
+ *  fill_rehostent - copies as much as possible relevant content from
+ *  the LYNX_HOSTENT pointed to by phost to the char buffer given
+ *  by rehostent, subject to maximum output length rehostentsize,
+ *  following pointers and building self-contained output which can be
+ *  cast to a LYNX_HOSTENT. - kw
+ *  See also description of LYGetHostByName.
+ */
 #ifdef NSL_FORK
 
-#define REHOSTENT_SIZE 128		/* not bigger than pipe buffer! */
+#define REHOSTENT_SIZE 128	/* not bigger than pipe buffer! */
 
 typedef struct {
-	struct hostent	h;
-	char		rest[REHOSTENT_SIZE];
-    } AlignedHOSTENT;
-
-static size_t fill_rehostent (
-    char *			rehostent,
-    size_t			rehostentsize,
-    const struct hostent *	phost)
+    LYNX_HOSTENT h;
+    char rest[REHOSTENT_SIZE];
+} AlignedHOSTENT;
+
+static size_t fill_rehostent(char *rehostent,
+			     size_t rehostentsize,
+			     const LYNX_HOSTENT *phost)
 {
-    AlignedHOSTENT *data = (AlignedHOSTENT *)rehostent;
+    AlignedHOSTENT *data = (AlignedHOSTENT *) rehostent;
     int num_addrs = 0;
     int num_aliases = 0;
     char **pcnt;
@@ -479,7 +482,7 @@ static size_t fill_rehostent (
     char **p_next_charptr;
     size_t name_len = 0;
     size_t required_per_addr;
-    size_t curlen = sizeof(struct hostent);
+    size_t curlen = sizeof(LYNX_HOSTENT);
     size_t available = rehostentsize - curlen;
     size_t chk_available, mem_this_alias, required_this_alias;
     int i_addr, i_alias;
@@ -487,6 +490,7 @@ static size_t fill_rehostent (
     if (!phost)
 	return 0;
     required_per_addr = phost->h_length + sizeof(char *);
+
     if (phost->h_addr_list)
 	available -= sizeof(phost->h_addr_list[0]);
     if (phost->h_aliases)
@@ -510,7 +514,7 @@ static size_t fill_rehostent (
 	}
     }
     if (num_addrs) {
-	for (pcnt=phost->h_addr_list+1; *pcnt; pcnt++) {
+	for (pcnt = phost->h_addr_list + 1; *pcnt; pcnt++) {
 	    if (available >= required_per_addr) {
 		num_addrs++;
 		available -= required_per_addr;
@@ -521,7 +525,7 @@ static size_t fill_rehostent (
     }
     chk_available = available;
     if (phost->h_aliases) {
-	for (pcnt=phost->h_aliases; *pcnt; pcnt++) {
+	for (pcnt = phost->h_aliases; *pcnt; pcnt++) {
 	    required_this_alias = sizeof(phost->h_aliases[0]) +
 		strlen(*pcnt) + 1;
 	    if (chk_available >= required_this_alias) {
@@ -533,16 +537,16 @@ static size_t fill_rehostent (
 
     data->h.h_addrtype = phost->h_addrtype;
     data->h.h_length = phost->h_length;
-    p_next_charptr = (char **)(rehostent + curlen);
+    p_next_charptr = (char **) (rehostent + curlen);
     p_next_char = rehostent + curlen;
     if (phost->h_addr_list)
-	p_next_char += (num_addrs+1) * sizeof(phost->h_addr_list[0]);
+	p_next_char += (num_addrs + 1) * sizeof(phost->h_addr_list[0]);
     if (phost->h_aliases)
-	p_next_char += (num_aliases+1) * sizeof(phost->h_aliases[0]);
+	p_next_char += (num_aliases + 1) * sizeof(phost->h_aliases[0]);
 
     if (phost->h_addr_list) {
 	data->h.h_addr_list = p_next_charptr;
-	for (pcnt=phost->h_addr_list, i_addr = 0;
+	for (pcnt = phost->h_addr_list, i_addr = 0;
 	     i_addr < num_addrs;
 	     pcnt++, i_addr++) {
 	    memcpy(p_next_char, *pcnt, sizeof(phost->h_addr_list[0]));
@@ -568,7 +572,7 @@ static size_t fill_rehostent (
 
     if (phost->h_aliases) {
 	data->h.h_aliases = p_next_charptr;
-	for (pcnt=phost->h_aliases, i_alias = 0;
+	for (pcnt = phost->h_aliases, i_alias = 0;
 	     (*pcnt && i_alias < num_addrs);
 	     pcnt++, i_alias++) {
 	    mem_this_alias = strlen(*pcnt) + 1;
@@ -587,7 +591,7 @@ static size_t fill_rehostent (
     } else {
 	data->h.h_aliases = NULL;
     }
-    curlen = p_next_char - (char *)rehostent;
+    curlen = p_next_char - (char *) rehostent;
     return curlen;
 }
 #endif /* NSL_FORK */
@@ -596,48 +600,48 @@ static size_t fill_rehostent (
 #undef  h_errno
 #define h_errno my_errno
 static int my_errno;
+
 #else /* we do HAVE_H_ERRNO: */
-#ifndef h_errno		/* there may be a macro as well as the extern data */
+#ifndef h_errno			/* there may be a macro as well as the extern data */
 extern int h_errno;
 #endif
 #endif
 
 /*	Resolve an internet hostname, like gethostbyname
-**	------------------------------------------------
-**
-**  On entry,
-**	str	points to the given host name, not numeric address,
-**		without colon or port number.
-**
-**  On exit,
-**	returns a pointer to a struct hostent in static storage,
-**	or NULL in case of error or user interruption.
-**
-**  The interface is intended to be exactly the same as for (Unix)
-**  gethostbyname(), except for the following:
-**
-**  If NSL_FORK is not used, the result of gethostbyname is returned
-**  directly.  Otherwise:
-**  All lists, addresses, and strings referred to by pointers in the
-**  returned struct are located, together with the returned struct
-**  itself, in a buffer of size REHOSTENT_SIZE.  If not everything fits,
-**  some info is omitted, but the function is careful to still return
-**  a valid structure, without truncating strings; it tries to return,
-**  in order of decreasing priority, the first address (h_addr), the
-**  official name (h_name), the additional addresses, then alias names.
-**
-**  If NULL is returned, the reason is made available in the global
-**  variable lynx_nsl_status, with one of the following values:
-**	HT_INTERRUPTED		Interrupted by user
-**	HT_NOT_ACCEPTABLE	Hostname detected as invalid
-**				(also sets h_errno)
-**	HT_H_ERRNO_VALID	An error occurred, and h_errno holds
-**				an appropriate value
-**	HT_ERROR		Resolver error, reason not known
-**	HT_INTERNAL		Internal error
-*/
-struct hostent * LYGetHostByName (
-	char *	str)
+ *	------------------------------------------------
+ *
+ *  On entry,
+ *	str	points to the given host name, not numeric address,
+ *		without colon or port number.
+ *
+ *  On exit,
+ *	returns a pointer to a LYNX_HOSTENT in static storage,
+ *	or NULL in case of error or user interruption.
+ *
+ *  The interface is intended to be exactly the same as for (Unix)
+ *  gethostbyname(), except for the following:
+ *
+ *  If NSL_FORK is not used, the result of gethostbyname is returned
+ *  directly.  Otherwise:
+ *  All lists, addresses, and strings referred to by pointers in the
+ *  returned struct are located, together with the returned struct
+ *  itself, in a buffer of size REHOSTENT_SIZE.  If not everything fits,
+ *  some info is omitted, but the function is careful to still return
+ *  a valid structure, without truncating strings; it tries to return,
+ *  in order of decreasing priority, the first address (h_addr), the
+ *  official name (h_name), the additional addresses, then alias names.
+ *
+ *  If NULL is returned, the reason is made available in the global
+ *  variable lynx_nsl_status, with one of the following values:
+ *	HT_INTERRUPTED		Interrupted by user
+ *	HT_NOT_ACCEPTABLE	Hostname detected as invalid
+ *				(also sets h_errno)
+ *	HT_H_ERRNO_VALID	An error occurred, and h_errno holds
+ *				an appropriate value
+ *	HT_ERROR		Resolver error, reason not known
+ *	HT_INTERNAL		Internal error
+ */
+LYNX_HOSTENT *LYGetHostByName(char *str)
 {
 #ifndef _WINDOWS_NSL
     char *host = str;
@@ -646,27 +650,26 @@ struct hostent * LYGetHostByName (
 #ifdef NSL_FORK
     /* for transfer of result between from child to parent: */
     static AlignedHOSTENT aligned_full_rehostent;
+
     /*
-     * We could define rehosten directly as a
-     * static char rehostent[REHOSTENT_SIZE],
-     * but the indirect approach via the above struct
-     * should automatically take care of alignment requirements.
+     * We could define rehosten directly as a static char
+     * rehostent[REHOSTENT_SIZE], but the indirect approach via the above
+     * struct should automatically take care of alignment requirements.
      * Note that, in addition,
-     *  - this must be static, as we shall return a pointer to it
-     *    which must remain valid, and
-     *  - we have to use the same rehostent in the child process as
-     *    in the parent (its address in the parent's address space
-     *    must be the same as in the child's, otherwise the internal
-     *    pointers built by the child's call to fill_rehostent would
-     *    be invalid when seen by the parent). - kw
+     * - this must be static, as we shall return a pointer to it which must
+     *   remain valid, and
+     * - we have to use the same rehostent in the child process as in the
+     *   parent (its address in the parent's address space must be the same as
+     *   in the child's, otherwise the internal pointers built by the child's
+     *   call to fill_rehostent would be invalid when seen by the parent).  -kw
      */
-    char *rehostent = (char *)&aligned_full_rehostent;
+    char *rehostent = (char *) &aligned_full_rehostent;
 
     /* for transfer of status from child to parent: */
     struct _statuses {
 	size_t rehostentlen;
 	int h_length;
-	int child_errno;  /* sometimes useful to pass this on */
+	int child_errno;	/* sometimes useful to pass this on */
 	int child_h_errno;
 	BOOL h_errno_valid;
     } statuses;
@@ -674,7 +677,7 @@ struct hostent * LYGetHostByName (
     size_t rehostentlen = 0;
 #endif /* NSL_FORK */
 
-    struct hostent *result_phost = NULL;
+    LYNX_HOSTENT *result_phost = NULL;
 
 #ifdef __DJGPP__
     _resolve_hook = ResolveYield;
@@ -687,13 +690,12 @@ struct hostent * LYGetHostByName (
     }
     CTRACE((tfp, "LYGetHostByName: parsing `%s'.\n", str));
 
-	/*  Could disable this if all our callers already check - kw */
+    /*  Could disable this if all our callers already check - kw */
     if (HTCheckForInterrupt()) {
 	CTRACE((tfp, "LYGetHostByName: INTERRUPTED for '%s'.\n", str));
 	lynx_nsl_status = HT_INTERRUPTED;
 	return NULL;
     }
-
 #ifdef _WINDOWS_NSL
     strncpy(host, str, sizeof(host));
 #endif /*  _WINDOWS_NSL */
@@ -709,53 +711,54 @@ struct hostent * LYGetHostByName (
 #endif
 	return NULL;
     }
-
-#ifdef MVS	/* Outstanding problem with crash in MVS gethostbyname */
+#ifdef MVS			/* Outstanding problem with crash in MVS gethostbyname */
     CTRACE((tfp, "LYGetHostByName: Calling gethostbyname(%s)\n", host));
 #endif /* MVS */
 
-    CTRACE_FLUSH(tfp);  /* so child messages will not mess up parent log */
+    CTRACE_FLUSH(tfp);		/* so child messages will not mess up parent log */
 
     lynx_nsl_status = HT_INTERNAL;	/* should be set to something else below */
 
 #ifdef NSL_FORK
     statuses.h_errno_valid = NO;
-	/*
-	**  Start block for fork-based gethostbyname() with
-	**  checks for interrupts. - Tom Zerucha (tz@execpc.com) & FM
-	*/
+    /*
+     * Start block for fork-based gethostbyname() with checks for interrupts. 
+     * - Tom Zerucha (tz@execpc.com) & FM
+     */
     {
 	int got_rehostent = 0;
+
 #if HAVE_SIGACTION
 	sigset_t old_sigset;
 	sigset_t new_sigset;
 #endif
 	/*
-	**	Pipe, child pid, status buffers, start time, select()
-	**	control variables.
-	*/
+	 * Pipe, child pid, status buffers, start time, select() control
+	 * variables.
+	 */
 	int fpid, waitret;
 	int pfd[2], selret, readret;
+
 #ifdef HAVE_TYPE_UNIONWAIT
 	union wait waitstat;
+
 #else
 	int waitstat = 0;
 #endif
-	time_t start_time = time((time_t *)0);
+	time_t start_time = time((time_t *) 0);
 	fd_set readfds;
 	struct timeval one_second;
-	long dns_patience = 30; /* how many seconds will we wait for DNS? */
+	long dns_patience = 30;	/* how many seconds will we wait for DNS? */
 	int child_exited = 0;
 
-	    /*
-	    **  Reap any children that have terminated since last time
-	    **  through.  This might include children that we killed,
-	    **  then waited with WNOHANG before they were actually ready
-	    **  to be reaped.  (Should be max of 1 in this state, but
-	    **  the loop is safe if waitpid() is implemented correctly:
-	    **  returns 0 when children exist but none have exited; -1
-	    **  with errno == ECHILD when no children.)  -BL
-	    */
+	/*
+	 * Reap any children that have terminated since last time through. 
+	 * This might include children that we killed, then waited with WNOHANG
+	 * before they were actually ready to be reaped.  (Should be max of 1
+	 * in this state, but the loop is safe if waitpid() is implemented
+	 * correctly:  returns 0 when children exist but none have exited; -1
+	 * with errno == ECHILD when no children.) -BL
+	 */
 	do {
 	    waitret = waitpid(-1, 0, WNOHANG);
 	} while (waitret > 0 || (waitret == -1 && errno == EINTR));
@@ -765,14 +768,13 @@ struct hostent * LYGetHostByName (
 
 #if HAVE_SIGACTION
 	/*
-	 *  Attempt to prevent a rare situation where the child
-	 *  could execute the Lynx signal handlers because it gets
-	 *  killed before it even has a chance to reset its handlers,
-	 *  resulting in bogus 'Exiting via interrupt' message and
-	 *  screen corruption or worse.
-	 *  Should that continue to be reported, for systems without
-	 *  sigprocmask(), we need to find a different solutions for
-	 *  those. - kw 19990430
+	 * Attempt to prevent a rare situation where the child could execute
+	 * the Lynx signal handlers because it gets killed before it even has a
+	 * chance to reset its handlers, resulting in bogus 'Exiting via
+	 * interrupt' message and screen corruption or worse.
+	 * Should that continue to be reported, for systems without
+	 * sigprocmask(), we need to find a different solutions for those.  -
+	 * kw 19990430
 	 */
 	sigemptyset(&new_sigset);
 	sigaddset(&new_sigset, SIGTERM);
@@ -789,22 +791,22 @@ struct hostent * LYGetHostByName (
 	sigprocmask(SIG_BLOCK, &new_sigset, &old_sigset);
 #endif /* HAVE_SIGACTION */
 
-	if ((fpid = fork()) == 0 ) {
-	    struct hostent  *phost;	/* Pointer to host - See netdb.h */
+	if ((fpid = fork()) == 0) {
+	    LYNX_HOSTENT *phost;	/* Pointer to host - See netdb.h */
+
 	    /*
-	    **  Child - for the long call.
-	    **
-	    **  Make sure parent can kill us at will.  -BL
-	    */
+	     * Child - for the long call.
+	     *
+	     * Make sure parent can kill us at will.  -BL
+	     */
 	    (void) signal(SIGTERM, quench);
 
 	    /*
-	    **  Also make sure the child does not run one of the
-	    **  signal handlers that may have been installed by
-	    **  Lynx if one of those signals occurs.  For example
-	    **  we don't want the child to remove temp files on
-	    **  ^C, let the parent deal with that. - kw
-	    */
+	     * Also make sure the child does not run one of the signal handlers
+	     * that may have been installed by Lynx if one of those signals
+	     * occurs.  For example we don't want the child to remove temp
+	     * files on ^C, let the parent deal with that.  - kw
+	     */
 	    (void) signal(SIGINT, quench);
 #ifndef NOSIGHUP
 	    (void) signal(SIGHUP, quench);
@@ -832,8 +834,8 @@ struct hostent * LYGetHostByName (
 #endif /* HAVE_SIGACTION */
 
 	    /*
-	    **  Child won't use read side.  -BL
-	    */
+	     * Child won't use read side.  -BL
+	     */
 	    close(pfd[0]);
 #ifdef HAVE_H_ERRNO
 	    /* to detect cases when it doesn't get set although it should */
@@ -856,80 +858,79 @@ struct hostent * LYGetHostByName (
 	    if (OK_HOST(phost)) {
 		rehostentlen = fill_rehostent(rehostent, REHOSTENT_SIZE, phost);
 #ifdef DEBUG_HOSTENT_CHILD
-		dump_hostent("CHILD fill_rehostent", (struct hostent *)rehostent);
+		dump_hostent("CHILD fill_rehostent", (LYNX_HOSTENT *) rehostent);
 #endif
 	    }
-	    if (rehostentlen <= sizeof(struct hostent) ||
-		!OK_HOST((struct hostent *)rehostent)) {
+	    if (rehostentlen <= sizeof(LYNX_HOSTENT) ||
+		!OK_HOST((LYNX_HOSTENT *) rehostent)) {
 		rehostentlen = 0;
 		statuses.h_length = 0;
 	    } else {
-		statuses.h_length = ((struct hostent *)rehostent)->h_length;
+		statuses.h_length = ((LYNX_HOSTENT *) rehostent)->h_length;
 #ifdef HAVE_H_ERRNO
-		if (h_errno == -2) /* success, but h_errno unchanged? */
+		if (h_errno == -2)	/* success, but h_errno unchanged? */
 		    statuses.h_errno_valid = NO;
 #endif
 	    }
 	    /*
-	    **  Send variables indicating status of lookup to parent.
-	    **  That includes rehostentlen, which the parent will use
-	    **  as the size for the second read (if > 0).
-	    */
+	     * Send variables indicating status of lookup to parent.  That
+	     * includes rehostentlen, which the parent will use as the size for
+	     * the second read (if > 0).
+	     */
 	    if (!statuses.child_errno)
-	    statuses.child_errno = errno;
+		statuses.child_errno = errno;
 	    statuses.rehostentlen = rehostentlen;
 	    write(pfd[1], &statuses, sizeof(statuses));
 
-
 	    if (rehostentlen) {
 		/*
-		**  Return our resulting rehostent through pipe...
-		*/
+		 * Return our resulting rehostent through pipe...
+		 */
 		write(pfd[1], rehostent, rehostentlen);
 		_exit(0);
 	    } else {
 		/*
-		**  ... or return error as exit code.
-		*/
+		 * ...  or return error as exit code.
+		 */
 		_exit(1);
 	    }
 	}
-
 #if HAVE_SIGACTION
 	/*
-	**  (parent) Restore signal mask to whatever it was
-	**  before the fork. - kw
-	*/
+	 * (parent) Restore signal mask to whatever it was before the fork.  -
+	 * kw
+	 */
 	sigprocmask(SIG_SETMASK, &old_sigset, NULL);
 #endif /* HAVE_SIGACTION */
 
 	/*
-	**	(parent) Wait until lookup finishes, or interrupt,
-	**	or cycled too many times (just in case) -BL
-	*/
+	 * (parent) Wait until lookup finishes, or interrupt, or cycled too
+	 * many times (just in case) -BL
+	 */
 
-	close(pfd[1]);      /* parent won't use write side -BL */
+	close(pfd[1]);		/* parent won't use write side -BL */
 
-	if (fpid < 0) {     /* fork failed */
-		close(pfd[0]);
-		goto failed;
+	if (fpid < 0) {		/* fork failed */
+	    close(pfd[0]);
+	    goto failed;
 	}
 
-	while (child_exited || (long)(time((time_t *)0) - start_time) < dns_patience) {
+	while (child_exited || (long) (time((time_t *) 0) - start_time) < dns_patience) {
 
 	    FD_ZERO(&readfds);
 	    /*
-	    **  This allows us to abort immediately, not after 1-second
-	    **  timeout, when user hits abort key.  Can't do this when
-	    **  using SLANG (or at least I don't know how), so SLANG
-	    **  users must live with up-to-1s timeout.  -BL
-	    **
-	    **  Whoops -- we need to make sure stdin is actually
-	    **  selectable!  /dev/null isn't, on some systems, which
-	    **  makes some useful Lynx invocations fail.  -BL
-	    */
+	     * This allows us to abort immediately, not after 1-second timeout,
+	     * when user hits abort key.  Can't do this when using SLANG (or at
+	     * least I don't know how), so SLANG users must live with up-to-1s
+	     * timeout.  -BL
+	     *
+	     * Whoops -- we need to make sure stdin is actually selectable! 
+	     * /dev/null isn't, on some systems, which makes some useful Lynx
+	     * invocations fail.  -BL
+	     */
 	    {
 		int kbd_fd = LYConsoleInputFD(TRUE);
+
 		if (kbd_fd != INVSOC) {
 		    FD_SET(kbd_fd, &readfds);
 		}
@@ -939,22 +940,22 @@ struct hostent * LYGetHostByName (
 	    one_second.tv_usec = 0;
 	    FD_SET(pfd[0], &readfds);
 
-		/*
-		**  Return when data received, interrupted, or failed.
-		**  If nothing is waiting, we sleep for 1 second in
-		**  select(), to be nice to the system.  -BL
-		*/
+	    /*
+	     * Return when data received, interrupted, or failed.  If nothing
+	     * is waiting, we sleep for 1 second in select(), to be nice to the
+	     * system.  -BL
+	     */
 #ifdef SOCKS
 	    if (socks_flag)
-		selret = Rselect(pfd[0] + 1, (void *)&readfds, NULL, NULL, &one_second);
+		selret = Rselect(pfd[0] + 1, (void *) &readfds, NULL, NULL, &one_second);
 	    else
 #endif /* SOCKS */
-		selret = select(pfd[0] + 1, (void *)&readfds, NULL, NULL, &one_second);
+		selret = select(pfd[0] + 1, (void *) &readfds, NULL, NULL, &one_second);
 
 	    if ((selret > 0) && FD_ISSET(pfd[0], &readfds)) {
 		/*
-		**	First get status, including length of address.  -BL, kw
-		*/
+		 * First get status, including length of address.  -BL, kw
+		 */
 		readret = read(pfd[0], &statuses, sizeof(statuses));
 		if (readret == sizeof(statuses)) {
 		    h_errno = statuses.child_h_errno;
@@ -963,51 +964,50 @@ struct hostent * LYGetHostByName (
 		    if (statuses.h_errno_valid) {
 			lynx_nsl_status = HT_H_ERRNO_VALID;
 			/*
-			 *  If something went wrong in the child process
-			 *  other than normal lookup errors, and it appears
-			 *  that we have enough info to know what went wrong,
-			 *  generate diagnostic output.
-			 *  ENOMEM observed on linux in processes constrained
-			 *  with ulimit.  It would be too unkind to abort
-			 *  the session, access to local files or through a
-			 *  proxy may still work. - kw
+			 * If something went wrong in the child process other
+			 * than normal lookup errors, and it appears that we
+			 * have enough info to know what went wrong, generate
+			 * diagnostic output.  ENOMEM observed on linux in
+			 * processes constrained with ulimit.  It would be too
+			 * unkind to abort the session, access to local files
+			 * or through a proxy may still work.  - kw
 			 */
 			if (
 #ifdef NETDB_INTERNAL		/* linux glibc: defined in netdb.h */
-			    (errno && h_errno == NETDB_INTERNAL) ||
+			       (errno && h_errno == NETDB_INTERNAL) ||
 #endif
-			    (errno == ENOMEM &&
-			     statuses.rehostentlen == 0 &&
-			     /* should probably be NETDB_INTERNAL if child
-				memory exhausted, but we may find that
-				h_errno remains unchanged. - kw */
-			     h_errno == -2)) {
+			       (errno == ENOMEM &&
+				statuses.rehostentlen == 0 &&
+			/* should probably be NETDB_INTERNAL if child
+			   memory exhausted, but we may find that
+			   h_errno remains unchanged. - kw */
+				h_errno == -2)) {
 #ifndef MULTINET
 			    HTInetStatus("CHILD gethostbyname");
 #endif
 			    HTAlert(LYStrerror(statuses.child_errno));
 			    if (errno == ENOMEM) {
 				/*
-				 *  Not much point in continuing, right?
-				 *  Fake a 'z', should shorten pointless
-				 *  guessing cycle. - kw
+				 * Not much point in continuing, right?  Fake a
+				 * 'z', should shorten pointless guessing
+				 * cycle.  - kw
 				 */
 				LYFakeZap(YES);
 			    }
 			}
 		    }
 #endif /* HAVE_H_ERRNO */
-		    if (statuses.rehostentlen > sizeof(struct hostent)) {
+		    if (statuses.rehostentlen > sizeof(LYNX_HOSTENT)) {
 			/*
-			**  Then get the full reorganized hostent.  -BL, kw
-			*/
+			 * Then get the full reorganized hostent.  -BL, kw
+			 */
 			readret = read(pfd[0], rehostent, statuses.rehostentlen);
 #ifdef DEBUG_HOSTENT
-			dump_hostent("Read from pipe", (struct hostent *)rehostent);
+			dump_hostent("Read from pipe", (LYNX_HOSTENT *) rehostent);
 #endif
 			if (readret == (int) statuses.rehostentlen) {
 			    got_rehostent = 1;
-			    result_phost = (struct hostent *)rehostent;
+			    result_phost = (LYNX_HOSTENT *) rehostent;
 			    lynx_nsl_status = HT_OK;
 			} else if (!statuses.h_errno_valid) {
 			    lynx_nsl_status = HT_INTERNAL;
@@ -1017,8 +1017,8 @@ struct hostent * LYGetHostByName (
 		    lynx_nsl_status = HT_ERROR;
 		}
 		/*
-		**  Make sure child is cleaned up.  -BL
-		*/
+		 * Make sure child is cleaned up.  -BL
+		 */
 		if (!child_exited)
 		    waitret = waitpid(fpid, &waitstat, WNOHANG);
 		if (!WIFEXITED(waitstat) && !WIFSIGNALED(waitstat)) {
@@ -1029,28 +1029,28 @@ struct hostent * LYGetHostByName (
 	    }
 
 	    /*
-	    **  Clean up if child exited before & no data received.  -BL
-	    */
+	     * Clean up if child exited before & no data received.  -BL
+	     */
 	    if (child_exited) {
 		waitret = waitpid(fpid, &waitstat, WNOHANG);
 		break;
 	    }
 	    /*
-	    **  If child exited, loop once more looking for data.  -BL
-	    */
+	     * If child exited, loop once more looking for data.  -BL
+	     */
 	    if ((waitret = waitpid(fpid, &waitstat, WNOHANG)) > 0) {
 		/*
-		**	Data will be arriving right now, so make sure we
-		**	don't short-circuit out for too many loops, and
-		**	skip the interrupt check.  -BL
-		*/
+		 * Data will be arriving right now, so make sure we don't
+		 * short-circuit out for too many loops, and skip the interrupt
+		 * check.  -BL
+		 */
 		child_exited = 1;
 		continue;
 	    }
 
 	    /*
-	    **  Abort if interrupt key pressed.
-	    */
+	     * Abort if interrupt key pressed.
+	     */
 	    if (HTCheckForInterrupt()) {
 		CTRACE((tfp, "LYGetHostByName: INTERRUPTED gethostbyname.\n"));
 		kill(fpid, SIGTERM);
@@ -1067,20 +1067,24 @@ struct hostent * LYGetHostByName (
 	}
 	if (waitret > 0) {
 	    if (WIFEXITED(waitstat)) {
-		CTRACE((tfp, "LYGetHostByName: NSL_FORK child %d exited, status 0x%x.\n",
-			(int)waitret, WEXITSTATUS(waitstat)));
+		CTRACE((tfp,
+			"LYGetHostByName: NSL_FORK child %d exited, status 0x%x.\n",
+			(int) waitret, WEXITSTATUS(waitstat)));
 	    } else if (WIFSIGNALED(waitstat)) {
-		CTRACE((tfp, "LYGetHostByName: NSL_FORK child %d got signal, status 0x%x!\n",
-		       (int)waitret, WTERMSIG(waitstat)));
+		CTRACE((tfp,
+			"LYGetHostByName: NSL_FORK child %d got signal, status 0x%x!\n",
+			(int) waitret, WTERMSIG(waitstat)));
 #ifdef WCOREDUMP
 		if (WCOREDUMP(waitstat)) {
-		    CTRACE((tfp, "LYGetHostByName: NSL_FORK child %d dumped core!\n",
-			   (int)waitret));
+		    CTRACE((tfp,
+			    "LYGetHostByName: NSL_FORK child %d dumped core!\n",
+			    (int) waitret));
 		}
 #endif /* WCOREDUMP */
 	    } else if (WIFSTOPPED(waitstat)) {
-		CTRACE((tfp, "LYGetHostByName: NSL_FORK child %d is stopped, status 0x%x!\n",
-			(int)waitret, WSTOPSIG(waitstat)));
+		CTRACE((tfp,
+			"LYGetHostByName: NSL_FORK child %d is stopped, status 0x%x!\n",
+			(int) waitret, WSTOPSIG(waitstat)));
 	    }
 	}
 	if (!got_rehostent) {
@@ -1096,20 +1100,21 @@ struct hostent * LYGetHostByName (
 #ifndef __CYGWIN__
 	if (!system_is_NT) {	/* for Windows9x */
 	    unsigned long t;
-	    t = (unsigned long)inet_addr(host);
-	    if ((int)t != -1)
-		phost = gethostbyaddr((char *)&t, sizeof (t), AF_INET);
+
+	    t = (unsigned long) inet_addr(host);
+	    if ((int) t != -1)
+		phost = gethostbyaddr((char *) &t, sizeof(t), AF_INET);
 	    else
 		phost = gethostbyname(host);
 	} else {		/* for Windows NT */
 #endif /* !__CYGWIN__ */
-	    phost = (struct hostent *) NULL;
+	    phost = (LYNX_HOSTENT *) NULL;
 	    donelookup = FALSE;
-	    hThread = CreateThread((void *)NULL, 4096UL,
-		(LPTHREAD_START_ROUTINE)_fork_func,
-		(void *)NULL, 0UL, (unsigned long *)&dwThreadID);
+	    hThread = CreateThread((void *) NULL, 4096UL,
+				   (LPTHREAD_START_ROUTINE) _fork_func,
+				   (void *) NULL, 0UL, (unsigned long *) &dwThreadID);
 	    if (!hThread)
-		MessageBox((void *)NULL, "CreateThread",
+		MessageBox((void *) NULL, "CreateThread",
 			   "CreateThread Failed", 0L);
 
 	    while (!donelookup) {
@@ -1117,8 +1122,8 @@ struct hostent * LYGetHostByName (
 		    /* Note that host is a character array and is not freed */
 		    /* to avoid possible subthread problems: */
 		    if (!CloseHandle(hThread)) {
-			MessageBox((void *)NULL,
-				   "CloseHandle","CloseHandle Failed", 0L);
+			MessageBox((void *) NULL,
+				   "CloseHandle", "CloseHandle Failed", 0L);
 		    }
 		    lynx_nsl_status = HT_INTERRUPTED;
 		    return NULL;
@@ -1138,7 +1143,8 @@ struct hostent * LYGetHostByName (
 
 #else /* !NSL_FORK, !_WINDOWS_NSL: */
     {
-	struct hostent  *phost;
+	LYNX_HOSTENT *phost;
+
 	phost = gethostbyname(host);	/* See netdb.h */
 #ifdef MVS
 	CTRACE((tfp, "LYGetHostByName: gethostbyname() returned %d\n", phost));
@@ -1161,33 +1167,31 @@ struct hostent * LYGetHostByName (
 
     return result_phost;	/* OK */
 
-failed:
+  failed:
     CTRACE((tfp, "LYGetHostByName: Can't find internet node name `%s'.\n",
-		host));
+	    host));
     return NULL;
 }
 
-
 /*	Parse a network node address and port
-**	-------------------------------------
-**
-**  On entry,
-**	str	points to a string with a node name or number,
-**		with optional trailing colon and port number.
-**	soc_in	points to the binary internet or decnet address field.
-**
-**  On exit,
-**	*soc_in is filled in.  If no port is specified in str, that
-**		field is left unchanged in *soc_in.
-*/
+ *	-------------------------------------
+ *
+ *  On entry,
+ *	str	points to a string with a node name or number,
+ *		with optional trailing colon and port number.
+ *	soc_in	points to the binary internet or decnet address field.
+ *
+ *  On exit,
+ *	*soc_in is filled in.  If no port is specified in str, that
+ *		field is left unchanged in *soc_in.
+ */
 #ifndef INET6
-static int HTParseInet (
-	SockA *	soc_in,
-	const char *	str)
+static int HTParseInet(SockA * soc_in, const char *str)
 {
     char *port;
     int dotcount_ip = 0;	/* for dotted decimal IP addr */
     char *strptr;
+
 #ifndef _WINDOWS_NSL
     char *host = NULL;
 #endif /* _WINDOWS_NSL */
@@ -1207,24 +1211,25 @@ static int HTParseInet (
     StrAllocCopy(host, str);	/* Make a copy we can mutilate */
 #endif /*  _WINDOWS_NSL */
     /*
-    **	Parse port number if present.
-    */
+     * Parse port number if present.
+     */
     if ((port = strchr(host, ':')) != NULL) {
 	*port++ = 0;		/* Chop off port */
 	strptr = port;
 	if (port[0] >= '0' && port[0] <= '9') {
 #ifdef UNIX
-	    soc_in->sin_port = (PortNumber)htons(strtol(port, &strptr, 10));
+	    soc_in->sin_port = (PortNumber) htons(strtol(port, &strptr, 10));
 #else /* VMS: */
 #ifdef DECNET
-	    soc_in->sdn_objnum = (unsigned char)(strtol(port, &strptr, 10));
+	    soc_in->sdn_objnum = (unsigned char) (strtol(port, &strptr, 10));
 #else
-	    soc_in->sin_port = htons((PortNumber)strtol(port, &strptr, 10));
+	    soc_in->sin_port = htons((PortNumber) strtol(port, &strptr, 10));
 #endif /* Decnet */
 #endif /* Unix vs. VMS */
-#ifdef SUPPRESS		/* 1. crashes!?!.  2. URL syntax has number not name */
+#ifdef SUPPRESS			/* 1. crashes!?!.  2. URL syntax has number not name */
 	} else {
-	    struct servent * serv = getservbyname(port, (char*)0);
+	    struct servent *serv = getservbyname(port, (char *) 0);
+
 	    if (serv) {
 		soc_in->sin_port = serv->s_port;
 	    } else {
@@ -1240,19 +1245,19 @@ static int HTParseInet (
 	    return -1;
 	}
     }
-
 #ifdef DECNET
     /*
-    **	Read Decnet node name. @@ Should know about DECnet addresses, but
-    **	it's probably worth waiting until the Phase transition from IV to V.
-    */
-    soc_in->sdn_nam.n_len = min(DN_MAXNAML, strlen(host));  /* <=6 in phase 4 */
+     * Read Decnet node name.  @@ Should know about DECnet addresses, but it's
+     * probably worth waiting until the Phase transition from IV to V.
+     */
+    soc_in->sdn_nam.n_len = min(DN_MAXNAML, strlen(host));	/* <=6 in phase 4 */
     strncpy(soc_in->sdn_nam.n_name, host, soc_in->sdn_nam.n_len + 1);
-    CTRACE((tfp, "DECnet: Parsed address as object number %d on host %.6s...\n",
-		soc_in->sdn_objnum, host));
-#else  /* parse Internet host: */
+    CTRACE((tfp,
+	    "DECnet: Parsed address as object number %d on host %.6s...\n",
+	    soc_in->sdn_objnum, host));
+#else /* parse Internet host: */
 
-    if (*host >= '0' && *host <= '9') {   /* Test for numeric node address: */
+    if (*host >= '0' && *host <= '9') {		/* Test for numeric node address: */
 	strptr = host;
 	while (*strptr) {
 	    if (*strptr == '.') {
@@ -1268,15 +1273,15 @@ static int HTParseInet (
     }
 
     /*
-    **	Parse host number if present.
-    */
-    if (dotcount_ip == 3)   /* Numeric node address: */
+     * Parse host number if present.
+     */
+    if (dotcount_ip == 3)	/* Numeric node address: */
     {
 #ifdef DGUX_OLD
-	soc_in->sin_addr.s_addr = inet_addr(host).s_addr; /* See arpa/inet.h */
+	soc_in->sin_addr.s_addr = inet_addr(host).s_addr;	/* See arpa/inet.h */
 #else
 #ifdef GUSI
-	soc_in->sin_addr = inet_addr(host);		/* See netinet/in.h */
+	soc_in->sin_addr = inet_addr(host);	/* See netinet/in.h */
 #else
 #ifdef HAVE_INET_ATON
 	if (!inet_aton(host, &(soc_in->sin_addr))) {
@@ -1294,39 +1299,43 @@ static int HTParseInet (
 #ifndef _WINDOWS_NSL
 	FREE(host);
 #endif /* _WINDOWS_NSL */
-    } else
-    {			    /* Alphanumeric node name: */
+    } else {			/* Alphanumeric node name: */
 
-#ifdef MVS	/* Outstanding problem with crash in MVS gethostbyname */
+#ifdef MVS			/* Outstanding problem with crash in MVS gethostbyname */
 	CTRACE((tfp, "HTParseInet: Calling LYGetHostByName(%s)\n", host));
 #endif /* MVS */
 
 #ifdef _WINDOWS_NSL
 	phost = LYGetHostByName(host);	/* See above */
-	if (!phost) goto failed;
-	memcpy((void *)&soc_in->sin_addr, phost->h_addr, phost->h_length);
+	if (!phost)
+	    goto failed;
+	memcpy((void *) &soc_in->sin_addr, phost->h_addr, phost->h_length);
 #else /* !_WINDOWS_NSL */
 	{
-	    struct hostent  *phost;
+	    LYNX_HOSTENT *phost;
+
 	    phost = LYGetHostByName(host);	/* See above */
 
-	    if (!phost) goto failed;
+	    if (!phost)
+		goto failed;
 #if defined(VMS) && defined(CMU_TCP)
 	    /*
-	    **  In LIBCMU, phost->h_length contains not the length of one address
-	    **  (four bytes) but the number of bytes in *h_addr, i.e., some multiple
-	    **  of four.  Thus we need to hard code the value here, and remember to
-	    **  change it if/when IP addresses change in size. :-(	LIBCMU is no
-	    **  longer supported, and CMU users are encouraged to obtain and use
-	    **  SOCKETSHR/NETLIB instead. - S. Bjorndahl
-	    */
-	    memcpy((void *)&soc_in->sin_addr, phost->h_addr, 4);
+	     * In LIBCMU, phost->h_length contains not the length of one
+	     * address (four bytes) but the number of bytes in *h_addr, i.e.,
+	     * some multiple of four.  Thus we need to hard code the value
+	     * here, and remember to change it if/when IP addresses change in
+	     * size.  :-( LIBCMU is no longer supported, and CMU users are
+	     * encouraged to obtain and use SOCKETSHR/NETLIB instead.  - S. 
+	     * Bjorndahl
+	     */
+	    memcpy((void *) &soc_in->sin_addr, phost->h_addr, 4);
 #else
-	    if (!phost) goto failed;
+	    if (!phost)
+		goto failed;
 	    if (phost->h_length != sizeof soc_in->sin_addr) {
 		HTAlwaysAlert(host, gettext("Address length looks invalid"));
 	    }
-	    memcpy((void *)&soc_in->sin_addr, phost->h_addr, phost->h_length);
+	    memcpy((void *) &soc_in->sin_addr, phost->h_addr, phost->h_length);
 #endif /* VMS && CMU_TCP */
 	}
 #endif /* _WINDOWS_NSL */
@@ -1335,41 +1344,40 @@ static int HTParseInet (
 	FREE(host);
 #endif /* _WINDOWS_NSL */
 
-    }	/* Alphanumeric node name */
+    }				/* Alphanumeric node name */
 
-    CTRACE((tfp, "HTParseInet: Parsed address as port %d, IP address %d.%d.%d.%d\n",
-		(int)ntohs(soc_in->sin_port),
-		(int)*((unsigned char *)(&soc_in->sin_addr)+0),
-		(int)*((unsigned char *)(&soc_in->sin_addr)+1),
-		(int)*((unsigned char *)(&soc_in->sin_addr)+2),
-		(int)*((unsigned char *)(&soc_in->sin_addr)+3)));
-#endif	/* Internet vs. Decnet */
+    CTRACE((tfp,
+	    "HTParseInet: Parsed address as port %d, IP address %d.%d.%d.%d\n",
+	    (int) ntohs(soc_in->sin_port),
+	    (int) *((unsigned char *) (&soc_in->sin_addr) + 0),
+	    (int) *((unsigned char *) (&soc_in->sin_addr) + 1),
+	    (int) *((unsigned char *) (&soc_in->sin_addr) + 2),
+	    (int) *((unsigned char *) (&soc_in->sin_addr) + 3)));
+#endif /* Internet vs. Decnet */
 
-    return 0;	/* OK */
+    return 0;			/* OK */
 
-failed:
+  failed:
     CTRACE((tfp, "HTParseInet: Can't find internet node name `%s'.\n",
-		host));
+	    host));
 #ifndef _WINDOWS_NSL
     FREE(host);
 #endif /* _WINDOWS_NSL */
     switch (lynx_nsl_status) {
-	case HT_NOT_ACCEPTABLE:
-	case HT_INTERRUPTED:
-	    return lynx_nsl_status;
-	default:
+    case HT_NOT_ACCEPTABLE:
+    case HT_INTERRUPTED:
+	return lynx_nsl_status;
+    default:
 	return -1;
     }
 }
 #endif /* !INET6 */
 
 #ifdef INET6
-static struct addrinfo *
-HTGetAddrInfo (
-    const char * str,
-    const int defport)
+static LYNX_ADDRINFO *HTGetAddrInfo(const char *str,
+				    const int defport)
 {
-    struct addrinfo hints, *res;
+    LYNX_ADDRINFO hints, *res;
     int error;
     char *p;
     char *s;
@@ -1409,37 +1417,39 @@ HTGetAddrInfo (
 
 #ifdef LY_FIND_LEAKS
 /*	Free our name for the host on which we are - FM
-**	-------------------------------------------
-**
-*/
-static void free_HTTCP_hostname (void)
+ *	-------------------------------------------
+ *
+ */
+static void free_HTTCP_hostname(void)
 {
     FREE(hostname);
 }
 #endif /* LY_FIND_LEAKS */
 
 /*	Derive the name of the host on which we are
-**	-------------------------------------------
-**
-*/
-static void get_host_details (void)
+ *	-------------------------------------------
+ *
+ */
+static void get_host_details(void)
 {
-    char name[MAXHOSTNAMELEN+1];	/* The name of this host */
+    char name[MAXHOSTNAMELEN + 1];	/* The name of this host */
+
 #ifdef UCX
-    char *domain_name;			/* The name of this host domain */
+    char *domain_name;		/* The name of this host domain */
 #endif /* UCX */
-#ifdef NEED_HOST_ADDRESS		/* no -- needs name server! */
+#ifdef NEED_HOST_ADDRESS	/* no -- needs name server! */
 #ifdef INET6
-    struct addrinfo hints, *res;
+    LYNX_ADDRINFO hints, *res;
     int error;
+
 #else
-    struct hostent * phost;		/* Pointer to host -- See netdb.h */
+    LYNX_HOSTENT *phost;	/* Pointer to host -- See netdb.h */
 #endif /* INET6 */
 #endif /* NEED_HOST_ADDRESS */
     int namelength = sizeof(name);
 
     if (hostname)
-	return;				/* Already done */
+	return;			/* Already done */
     gethostname(name, namelength);	/* Without domain */
     StrAllocCopy(hostname, name);
 #ifdef LY_FIND_LEAKS
@@ -1447,10 +1457,10 @@ static void get_host_details (void)
 #endif
 #ifdef UCX
     /*
-    **	UCX doesn't give the complete domain name.
-    **	Get rest from UCX$BIND_DOM logical.
-    */
-    if (strchr(hostname,'.') == NULL) {		  /* Not full address */
+     * UCX doesn't give the complete domain name.  Get rest from UCX$BIND_DOM
+     * logical.
+     */
+    if (strchr(hostname, '.') == NULL) {	/* Not full address */
 	domain_name = LYGetEnv("UCX$BIND_DOMAIN");
 	if (domain_name == NULL)
 	    domain_name = LYGetEnv("TCPIP$BIND_DOMAIN");
@@ -1458,12 +1468,12 @@ static void get_host_details (void)
 	    StrAllocCat(hostname, ".");
 	    StrAllocCat(hostname, domain_name);
 	}
-     }
+    }
 #endif /* UCX */
     CTRACE((tfp, "TCP: Local host name is %s\n", hostname));
 
-#ifndef DECNET	/* Decnet ain't got no damn name server 8#OO */
-#ifdef NEED_HOST_ADDRESS		/* no -- needs name server! */
+#ifndef DECNET			/* Decnet ain't got no damn name server 8#OO */
+#ifdef NEED_HOST_ADDRESS	/* no -- needs name server! */
 #ifdef INET6
     memset(&hints, 0, sizeof(hints));
     hints.ai_family = PF_UNSPEC;
@@ -1474,7 +1484,7 @@ static void get_host_details (void)
 	CTRACE((tfp, "TCP: %s: `%s'\n", gai_strerror(error), name));
 	if (res)
 	    freeaddrinfo(res);
-	return;  /* Fail! */
+	return;			/* Fail! */
     }
     StrAllocCopy(hostname, res->ai_canonname);
     memcpy(&HTHostAddress, res->ai_addr, res->ai_addrlen);
@@ -1482,82 +1492,84 @@ static void get_host_details (void)
 #else
     phost = gethostbyname(name);	/* See netdb.h */
     if (!OK_HOST(phost)) {
-	CTRACE((tfp, "TCP: Can't find my own internet node address for `%s'!!\n",
-		    name));
-	return;  /* Fail! */
+	CTRACE((tfp,
+		"TCP: Can't find my own internet node address for `%s'!!\n",
+		name));
+	return;			/* Fail! */
     }
     StrAllocCopy(hostname, phost->h_name);
     memcpy(&HTHostAddress, &phost->h_addr, phost->h_length);
 #endif /* INET6 */
     CTRACE((tfp, "     Name server says that I am `%s' = %s\n",
-		hostname, HTInetString(&HTHostAddress)));
+	    hostname, HTInetString(&HTHostAddress)));
 #endif /* NEED_HOST_ADDRESS */
 
 #endif /* !DECNET */
 }
 
-const char * HTHostName (void)
+const char *HTHostName(void)
 {
     get_host_details();
     return hostname;
 }
 
 #ifndef MULTINET		/* SOCKET_ERRNO != errno ? */
-#if !defined(UCX) || !defined(VAXC) /* errno not modifiable ? */
-#define SOCKET_DEBUG_TRACE    /* show errno status after some system calls */
-#endif  /* UCX && VAXC */
+#if !defined(UCX) || !defined(VAXC)	/* errno not modifiable ? */
+#define SOCKET_DEBUG_TRACE	/* show errno status after some system calls */
+#endif /* UCX && VAXC */
 #endif /* MULTINET */
 /*
-**  Interruptible connect as implemented for Mosaic by Marc Andreesen
-**  and hacked in for Lynx years ago by Lou Montulli, and further
-**  modified over the years by numerous Lynx lovers. - FM
-*/
-int HTDoConnect (
-	const char *	url,
-	char *		protocol,
-	int		default_port,
-	int *		s)
+ *  Interruptible connect as implemented for Mosaic by Marc Andreesen
+ *  and hacked in for Lynx years ago by Lou Montulli, and further
+ *  modified over the years by numerous Lynx lovers. - FM
+ */
+int HTDoConnect(const char *url,
+		char *protocol,
+		int default_port,
+		int *s)
 {
     int status = 0;
     char *line = NULL;
     char *p1 = NULL;
     char *at_sign = NULL;
     char *host = NULL;
+
 #ifdef INET6
-    struct addrinfo *res = 0, *res0 = 0;
+    LYNX_ADDRINFO *res = 0, *res0 = 0;
+
 #else
     struct sockaddr_in soc_address;
     struct sockaddr_in *soc_in = &soc_address;
 
     /*
-    **	Set up defaults.
-    */
+     * Set up defaults.
+     */
     memset(soc_in, 0, sizeof(*soc_in));
     soc_in->sin_family = AF_INET;
     soc_in->sin_port = htons((PortNumber) default_port);
 #endif /* INET6 */
 
     /*
-    **	Get node name and optional port number.
-    */
+     * Get node name and optional port number.
+     */
     p1 = HTParse(url, "", PARSE_HOST);
     if ((at_sign = strchr(p1, '@')) != NULL) {
 	/*
-	**  If there's an @ then use the stuff after it as a hostname.
-	*/
+	 * If there's an @ then use the stuff after it as a hostname.
+	 */
 	StrAllocCopy(host, (at_sign + 1));
     } else {
 	StrAllocCopy(host, p1);
     }
     FREE(p1);
 
-    HTSprintf0 (&line, "%s%s", WWW_FIND_MESSAGE, host);
-    _HTProgress (line);
+    HTSprintf0(&line, "%s%s", WWW_FIND_MESSAGE, host);
+    _HTProgress(line);
 #ifdef INET6
     /* HTParseInet() is useless! */
     res0 = HTGetAddrInfo(host, default_port);
     if (res0 == NULL) {
-	HTSprintf0 (&line, gettext("Unable to locate remote host %s."), host);
+	HTSprintf0(&line, gettext("Unable to locate remote host %s."), host);
 	_HTProgress(line);
 	FREE(host);
 	FREE(line);
@@ -1568,14 +1580,14 @@ int HTDoConnect (
     if (status) {
 	if (status != HT_INTERRUPTED) {
 	    if (status == HT_NOT_ACCEPTABLE) {
-		/*  Not HTProgress, so warning won't be overwritten
-		 *  immediately; but not HTAlert, because typically
-		 *  there will be other alerts from the callers. - kw
+		/* Not HTProgress, so warning won't be overwritten immediately;
+		 * but not HTAlert, because typically there will be other
+		 * alerts from the callers.  - kw
 		 */
 		HTUserMsg2(gettext("Invalid hostname %s"), host);
 	    } else {
-		HTSprintf0 (&line,
-			 gettext("Unable to locate remote host %s."), host);
+		HTSprintf0(&line,
+			   gettext("Unable to locate remote host %s."), host);
 		_HTProgress(line);
 	    }
 	    status = HT_NO_DATA;
@@ -1586,284 +1598,292 @@ int HTDoConnect (
     }
 #endif /* INET6 */
 
-    HTSprintf0 (&line, gettext("Making %s connection to %s"), protocol, host);
-    _HTProgress (line);
+    HTSprintf0(&line, gettext("Making %s connection to %s"), protocol, host);
+    _HTProgress(line);
     FREE(host);
     FREE(line);
 
     /*
-    **	Now, let's get a socket set up from the server for the data.
-    */
+     * Now, let's get a socket set up from the server for the data.
+     */
+#ifndef INET6
+    *s = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
+    if (*s == -1) {
+	HTAlert(gettext("socket failed."));
+	return HT_NO_DATA;
+    }
+#endif /* INET6 */
 #ifdef INET6
     for (res = res0; res; res = res->ai_next) {
 	*s = socket(res->ai_family, res->ai_socktype, res->ai_protocol);
 	if (*s == -1) {
 	    char hostbuf[1024], portbuf[1024];
+
 	    getnameinfo(res->ai_addr, res->ai_addrlen,
-		    hostbuf, sizeof(hostbuf), portbuf, sizeof(portbuf),
-		    NI_NUMERICHOST|NI_NUMERICSERV);
-	    HTSprintf0 (&line, gettext("socket failed: family %d addr %s port %s."),
-		    res->ai_family, hostbuf, portbuf);
-	    _HTProgress (line);
+			hostbuf, sizeof(hostbuf), portbuf, sizeof(portbuf),
+			NI_NUMERICHOST | NI_NUMERICSERV);
+	    HTSprintf0(&line,
+		       gettext("socket failed: family %d addr %s port %s."),
+		       res->ai_family, hostbuf, portbuf);
+	    _HTProgress(line);
 	    FREE(line);
 	    continue;
 	}
-#else
-    *s = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
-    if (*s == -1) {
-	HTAlert(gettext("socket failed."));
-	return HT_NO_DATA;
-    }
 #endif /* INET6 */
 
 #if !defined(DOSPATH) || defined(__DJGPP__)
 #if !defined(NO_IOCTL) || defined(USE_FCNTL)
-    /*
-    **	Make the socket non-blocking, so the connect can be canceled.
-    **	This means that when we issue the connect we should NOT
-    **	have to wait for the accept on the other end.
-    */
-    {
+	/*
+	 * Make the socket non-blocking, so the connect can be canceled.  This
+	 * means that when we issue the connect we should NOT have to wait for
+	 * the accept on the other end.
+	 */
+	{
 #ifdef USE_FCNTL
-	int ret = fcntl(*s, F_SETFL, O_NONBLOCK);
+	    int ret = fcntl(*s, F_SETFL, O_NONBLOCK);
+
 #else
-	int val = 1;
-	int ret = IOCTL(*s, FIONBIO, &val);
+	    int val = 1;
+	    int ret = IOCTL(*s, FIONBIO, &val);
 #endif /* USE_FCNTL */
-	if (ret == -1)
-	    _HTProgress(gettext("Could not make connection non-blocking."));
-    }
+	    if (ret == -1)
+		_HTProgress(gettext("Could not make connection non-blocking."));
+	}
 #endif /* !NO_IOCTL || USE_FCNTL */
 #endif /* !DOSPATH || __DJGPP__ */
 
-    /*
-    **	Issue the connect.  Since the server can't do an instantaneous
-    **	accept and we are non-blocking, this will almost certainly return
-    **	a negative status.
-    */
+	/*
+	 * Issue the connect.  Since the server can't do an instantaneous
+	 * accept and we are non-blocking, this will almost certainly return a
+	 * negative status.
+	 */
 #ifdef SOCKS
-    if (socks_flag) {
+	if (socks_flag) {
 #ifdef INET6
-	status = Rconnect(*s, res->ai_addr, res->ai_addrlen);
+	    status = Rconnect(*s, res->ai_addr, res->ai_addrlen);
 #else
-	status = Rconnect(*s, (struct sockaddr*)&soc_address,
-			  sizeof(soc_address));
+	    status = Rconnect(*s, (struct sockaddr *) &soc_address,
+			      sizeof(soc_address));
 #endif /* INET6 */
-	/*
-	**  For long Rbind.
-	*/
-	socks_bind_remoteAddr = soc_address.sin_addr.s_addr;
-    } else
+	    /*
+	     * For long Rbind.
+	     */
+	    socks_bind_remoteAddr = soc_address.sin_addr.s_addr;
+	} else
 #endif /* SOCKS */
 #ifdef INET6
-    status = connect(*s, res->ai_addr, res->ai_addrlen);
+	    status = connect(*s, res->ai_addr, res->ai_addrlen);
 #else
-    status = connect(*s, (struct sockaddr*)&soc_address, sizeof(soc_address));
+	    status = connect(*s, (struct sockaddr *) &soc_address, sizeof(soc_address));
 #endif /* INET6 */
 
-    /*
-    **	According to the Sun man page for connect:
-    **	   EINPROGRESS	       The socket is non-blocking and the  con-
-    **			       nection cannot be completed immediately.
-    **			       It is possible to select(2) for	comple-
-    **			       tion  by  selecting the socket for writ-
-    **			       ing.
-    **	According to the Motorola SVR4 man page for connect:
-    **	   EAGAIN	       The socket is non-blocking and the  con-
-    **			       nection cannot be completed immediately.
-    **			       It is possible to select for  completion
-    **			       by  selecting  the  socket  for writing.
-    **			       However, this is only  possible	if  the
-    **			       socket  STREAMS	module	is  the topmost
-    **			       module on  the  protocol  stack	with  a
-    **			       write  service  procedure.  This will be
-    **			       the normal case.
-    */
-    if ((status < 0) &&
-	(SOCKET_ERRNO == EINPROGRESS
+	/*
+	 * According to the Sun man page for connect:
+	 *  EINPROGRESS         The socket is non-blocking and the  con-
+	 *                      nection cannot be completed immediately.
+	 *                      It is possible to select(2) for  comple-
+	 *                      tion  by  selecting the socket for writ-
+	 *                      ing.
+	 * According to the Motorola SVR4 man page for connect:
+	 *  EAGAIN              The socket is non-blocking and the  con-
+	 *                      nection cannot be completed immediately.
+	 *                      It is possible to select for  completion
+	 *                      by  selecting  the  socket  for writing.
+	 *                      However, this is only  possible  if  the
+	 *                      socket  STREAMS  module  is  the topmost
+	 *                      module on  the  protocol  stack  with  a
+	 *                      write  service  procedure.  This will be
+	 *                      the normal case.
+	 */
+	if ((status < 0) &&
+	    (SOCKET_ERRNO == EINPROGRESS
 #ifdef EAGAIN
-	 || SOCKET_ERRNO == EAGAIN
+	     || SOCKET_ERRNO == EAGAIN
 #endif
-	 )) {
-	struct timeval select_timeout;
-	int ret;
-	int tries=0;
+	    )) {
+	    struct timeval select_timeout;
+	    int ret;
+	    int tries = 0;
 
 #ifdef SOCKET_DEBUG_TRACE
-	HTInetStatus("this socket's first connect");
+	    HTInetStatus("this socket's first connect");
 #endif /* SOCKET_DEBUG_TRACE */
-	ret = 0;
-	while (ret <= 0) {
-	    fd_set writefds;
+	    ret = 0;
+	    while (ret <= 0) {
+		fd_set writefds;
 
-	    /*
-	    **	Protect against an infinite loop.
-	    */
-	    if ((tries++/10) >= connect_timeout) {
-		HTAlert(gettext("Connection failed (too many retries)."));
+		/*
+		 * Protect against an infinite loop.
+		 */
+		if ((tries++ / 10) >= connect_timeout) {
+		    HTAlert(gettext("Connection failed (too many retries)."));
 #ifdef INET6
-		FREE(line);
-		if (res0)
-		    freeaddrinfo(res0);
+		    FREE(line);
+		    if (res0)
+			freeaddrinfo(res0);
 #endif /* INET6 */
-		return HT_NO_DATA;
-	    }
-
+		    return HT_NO_DATA;
+		}
 #ifdef _WINDOWS_NSL
-	    select_timeout.tv_sec = connect_timeout;
-	    select_timeout.tv_usec = 0;
+		select_timeout.tv_sec = connect_timeout;
+		select_timeout.tv_usec = 0;
 #else
-	    select_timeout.tv_sec = 0;
-	    select_timeout.tv_usec = 100000;
+		select_timeout.tv_sec = 0;
+		select_timeout.tv_usec = 100000;
 #endif /* _WINDOWS_NSL */
-	    FD_ZERO(&writefds);
-	    FD_SET((unsigned) *s, &writefds);
+		FD_ZERO(&writefds);
+		FD_SET((unsigned) *s, &writefds);
 #ifdef SOCKS
-	    if (socks_flag)
-		ret = Rselect((unsigned)*s + 1, NULL,
-			      (void *)&writefds, NULL, &select_timeout);
-	    else
+		if (socks_flag)
+		    ret = Rselect((unsigned) *s + 1, NULL,
+				  (void *) &writefds, NULL, &select_timeout);
+		else
 #endif /* SOCKS */
-	    ret = select((unsigned)*s + 1, NULL, (void *)&writefds, NULL, &select_timeout);
+		    ret = select((unsigned) *s + 1,
+				 NULL,
+				 (void *) &writefds,
+				 NULL,
+				 &select_timeout);
 
 #ifdef SOCKET_DEBUG_TRACE
-	    if (tries == 1) {
-		HTInetStatus("this socket's first select");
-	    }
+		if (tries == 1) {
+		    HTInetStatus("this socket's first select");
+		}
 #endif /* SOCKET_DEBUG_TRACE */
-	    /*
-	    **  If we suspend, then it is possible that select will be
-	    **  interrupted.  Allow for this possibility. - JED
-	    */
-	    if ((ret == -1) && (errno == EINTR))
-		continue;
+		/*
+		 * If we suspend, then it is possible that select will be
+		 * interrupted.  Allow for this possibility.  - JED
+		 */
+		if ((ret == -1) && (errno == EINTR))
+		    continue;
 
 #ifdef SOCKET_DEBUG_TRACE
-	    if (ret < 0) {
-		HTInetStatus("failed select");
-	    }
+		if (ret < 0) {
+		    HTInetStatus("failed select");
+		}
 #endif /* SOCKET_DEBUG_TRACE */
-	    /*
-	    **	Again according to the Sun and Motorola man pages for connect:
-	    **	   EALREADY	       The socket is non-blocking and a  previ-
-	    **			       ous  connection attempt has not yet been
-	    **			       completed.
-	    **	Thus if the SOCKET_ERRNO is NOT EALREADY we have a real error,
-	    **	and should break out here and return that error.
-	    **	Otherwise if it is EALREADY keep on trying to complete the
-	    **	connection.
-	    */
-	    if ((ret < 0) && (SOCKET_ERRNO != EALREADY)) {
-		status = ret;
-		break;
-	    } else if (ret > 0) {
 		/*
-		**  Extra check here for connection success, if we try to
-		**  connect again, and get EISCONN, it means we have a
-		**  successful connection.  But don't check with SOCKS.
-		*/
+		 * Again according to the Sun and Motorola man pages for
+		 * connect:
+		 *  EALREADY    The socket is non-blocking and a  previ-
+		 *              ous  connection attempt has not yet been
+		 *              completed.
+		 * Thus if the SOCKET_ERRNO is NOT EALREADY we have a real
+		 * error, and should break out here and return that error. 
+		 * Otherwise if it is EALREADY keep on trying to complete the
+		 * connection.
+		 */
+		if ((ret < 0) && (SOCKET_ERRNO != EALREADY)) {
+		    status = ret;
+		    break;
+		} else if (ret > 0) {
+		    /*
+		     * Extra check here for connection success, if we try to
+		     * connect again, and get EISCONN, it means we have a
+		     * successful connection.  But don't check with SOCKS.
+		     */
 #ifdef SOCKS
-		if (socks_flag) {
-		    status = 0;
-		} else {
+		    if (socks_flag) {
+			status = 0;
+		    } else {
 #endif /* SOCKS */
 #ifdef INET6
-		status = connect(*s, res->ai_addr, res->ai_addrlen);
+			status = connect(*s, res->ai_addr, res->ai_addrlen);
 #else
-		status = connect(*s, (struct sockaddr*)&soc_address,
-				 sizeof(soc_address));
+			status = connect(*s, (struct sockaddr *) &soc_address,
+					 sizeof(soc_address));
 #endif /* INET6 */
 #ifdef UCX
-		/*
-		**  A UCX feature: Instead of returning EISCONN
-		**		 UCX returns EADDRINUSE.
-		**  Test for this status also.
-		*/
-		if ((status < 0) && ((SOCKET_ERRNO == EISCONN) ||
-				     (SOCKET_ERRNO == EADDRINUSE)))
+			/*
+			 * A UCX feature:  Instead of returning EISCONN UCX
+			 * returns EADDRINUSE.  Test for this status also.
+			 */
+			if ((status < 0) && ((SOCKET_ERRNO == EISCONN) ||
+					     (SOCKET_ERRNO == EADDRINUSE)))
 #else
-		if ((status < 0) && (SOCKET_ERRNO == EISCONN))
+			if ((status < 0) && (SOCKET_ERRNO == EISCONN))
 #endif /* UCX */
-		{
-		    status = 0;
-		}
+			{
+			    status = 0;
+			}
 
-		if (status && (SOCKET_ERRNO == EALREADY)) /* new stuff LJM */
-		    ret = 0; /* keep going */
-		else {
+			if (status && (SOCKET_ERRNO == EALREADY))	/* new stuff LJM */
+			    ret = 0;	/* keep going */
+			else {
 #ifdef SOCKET_DEBUG_TRACE
-		    if (status < 0) {
-			HTInetStatus("confirm-ready connect");
-		    }
+			    if (status < 0) {
+				HTInetStatus("confirm-ready connect");
+			    }
 #endif /* SOCKET_DEBUG_TRACE */
-		    break;
-		}
+			    break;
+			}
 #ifdef SOCKS
-		}
+		    }
 #endif /* SOCKS */
-	    }
+		}
 #ifdef SOCKS
-	    else if (!socks_flag)
+		else if (!socks_flag)
 #else
-	    else
+		else
 #endif /* SOCKS */
-	    {
-		/*
-		**  The select says we aren't ready yet.  Try to connect
-		**  again to make sure.  If we don't get EALREADY or EISCONN,
-		**  something has gone wrong.  Break out and report it.
-		**
-		**  For some reason, SVR4 returns EAGAIN here instead of
-		**  EALREADY, even though the man page says it should be
-		**  EALREADY.
-		**
-		**  For some reason, UCX pre 3 apparently returns
-		**  errno = 18242 instead the EALREADY or EISCONN.
-		*/
+		{
+		    /*
+		     * The select says we aren't ready yet.  Try to connect
+		     * again to make sure.  If we don't get EALREADY or
+		     * EISCONN, something has gone wrong.  Break out and report
+		     * it.
+		     *
+		     * For some reason, SVR4 returns EAGAIN here instead of
+		     * EALREADY, even though the man page says it should be
+		     * EALREADY.
+		     *
+		     * For some reason, UCX pre 3 apparently returns errno =
+		     * 18242 instead the EALREADY or EISCONN.
+		     */
 #ifdef INET6
-		status = connect(*s, res->ai_addr, res->ai_addrlen);
+		    status = connect(*s, res->ai_addr, res->ai_addrlen);
 #else
-		status = connect(*s, (struct sockaddr*)&soc_address,
-				 sizeof(soc_address));
+		    status = connect(*s, (struct sockaddr *) &soc_address,
+				     sizeof(soc_address));
 #endif /* INET6 */
-		if ((status < 0) &&
-		    (SOCKET_ERRNO != EALREADY
+		    if ((status < 0) &&
+			(SOCKET_ERRNO != EALREADY
 #ifdef EAGAIN
-		    && SOCKET_ERRNO != EAGAIN
+			 && SOCKET_ERRNO != EAGAIN
 #endif
-		    ) &&
+			) &&
 #ifdef UCX
-		    (SOCKET_ERRNO != 18242) &&
+			(SOCKET_ERRNO != 18242) &&
 #endif /* UCX */
-		    (SOCKET_ERRNO != EISCONN)) {
+			(SOCKET_ERRNO != EISCONN)) {
 #ifdef SOCKET_DEBUG_TRACE
-		    HTInetStatus("confirm-not-ready connect");
+			HTInetStatus("confirm-not-ready connect");
 #endif /* SOCKET_DEBUG_TRACE */
-		    break;
+			break;
+		    }
 		}
-	    }
-	    if (HTCheckForInterrupt()) {
-		CTRACE((tfp, "*** INTERRUPTED in middle of connect.\n"));
-		status = HT_INTERRUPTED;
+		if (HTCheckForInterrupt()) {
+		    CTRACE((tfp, "*** INTERRUPTED in middle of connect.\n"));
+		    status = HT_INTERRUPTED;
 #ifdef _WINDOWS
-		WSASetLastError(EINTR);
+		    WSASetLastError(EINTR);
 #else
-		SOCKET_ERRNO = EINTR;
+		    SOCKET_ERRNO = EINTR;
 #endif
-		break;
+		    break;
+		}
 	    }
 	}
-    }
 #ifdef SOCKET_DEBUG_TRACE
-    else if (status < 0) {
-	HTInetStatus("this socket's first and only connect");
-    }
+	else if (status < 0) {
+	    HTInetStatus("this socket's first and only connect");
+	}
 #endif /* SOCKET_DEBUG_TRACE */
 #ifdef INET6
 	if (status < 0) {
-		NETCLOSE(*s);
-		*s = -1;
-		continue;
+	    NETCLOSE(*s);
+	    *s = -1;
+	    continue;
 	}
 	break;
     }
@@ -1876,19 +1896,20 @@ int HTDoConnect (
 #endif /* INET6 */
     {
 	/*
-	**  The connect attempt failed or was interrupted,
-	**  so close up the socket.
-	*/
+	 * The connect attempt failed or was interrupted, so close up the
+	 * socket.
+	 */
 	NETCLOSE(*s);
     }
 #if !defined(DOSPATH) || defined(__DJGPP__)
 #if !defined(NO_IOCTL) || defined(USE_FCNTL)
     else {
 	/*
-	**  Make the socket blocking again on good connect.
-	*/
+	 * Make the socket blocking again on good connect.
+	 */
 #ifdef USE_FCNTL
 	int ret = fcntl(*s, F_SETFL, 0);
+
 #else
 	int val = 0;
 	int ret = IOCTL(*s, FIONBIO, &val);
@@ -1908,20 +1929,20 @@ int HTDoConnect (
 }
 
 /*
-**  This is so interruptible reads can be implemented cleanly.
-*/
-int HTDoRead (
-	int		fildes,
-	void *		buf,
-	unsigned	nbyte)
+ *  This is so interruptible reads can be implemented cleanly.
+ */
+int HTDoRead(int fildes,
+	     void *buf,
+	     unsigned nbyte)
 {
     int ready, ret;
     fd_set readfds;
     struct timeval select_timeout;
-    int tries=0;
+    int tries = 0;
+
 #ifdef USE_READPROGRESS
     int otries = 0;
-    time_t otime = time((time_t *)0);
+    time_t otime = time((time_t *) 0);
 #endif
 #if defined(UNIX) || defined(UCX)
     int nb;
@@ -1930,8 +1951,8 @@ int HTDoRead (
 #ifdef UNIX
     if (fildes == 0) {
 	/*
-	 *  0 can be a valid socket fd, but if it's a tty something must
-	 *  have gone wrong. - kw
+	 * 0 can be a valid socket fd, but if it's a tty something must have
+	 * gone wrong.  - kw
 	 */
 	if (isatty(fildes)) {
 	    CTRACE((tfp, "HTDoRead - refusing to read fd 0 which is a tty!\n"));
@@ -1950,7 +1971,6 @@ int HTDoRead (
 #endif
 	return (HT_INTERRUPTED);
     }
-
 #if !defined(NO_IOCTL)
     ready = 0;
 #else
@@ -1958,8 +1978,8 @@ int HTDoRead (
 #endif /* bypass for NO_IOCTL */
     while (!ready) {
 	/*
-	**  Protect against an infinite loop.
-	*/
+	 * Protect against an infinite loop.
+	 */
 	if (tries++ >= 180000) {
 	    HTAlert(gettext("Socket read failed for 180,000 tries."));
 #ifdef _WINDOWS
@@ -1969,10 +1989,9 @@ int HTDoRead (
 #endif
 	    return HT_INTERRUPTED;
 	}
-
 #ifdef USE_READPROGRESS
 	if (tries - otries > 10) {
-	    time_t t = time((time_t *)0);
+	    time_t t = time((time_t *) 0);
 
 	    otries = tries;
 	    if (t - otime >= 5) {
@@ -1983,22 +2002,22 @@ int HTDoRead (
 #endif
 
 	/*
-	**  If we suspend, then it is possible that select will be
-	**  interrupted.  Allow for this possibility. - JED
-	*/
+	 * If we suspend, then it is possible that select will be interrupted. 
+	 * Allow for this possibility.  - JED
+	 */
 	do {
 	    select_timeout.tv_sec = 0;
 	    select_timeout.tv_usec = 100000;
 	    FD_ZERO(&readfds);
-	    FD_SET((unsigned)fildes, &readfds);
+	    FD_SET((unsigned) fildes, &readfds);
 #ifdef SOCKS
 	    if (socks_flag)
-		ret = Rselect((unsigned)fildes + 1,
-			      (void *)&readfds, NULL, NULL, &select_timeout);
+		ret = Rselect((unsigned) fildes + 1,
+			      (void *) &readfds, NULL, NULL, &select_timeout);
 	    else
 #endif /* SOCKS */
-		ret = select((unsigned)fildes + 1,
-			     (void *)&readfds, NULL, NULL, &select_timeout);
+		ret = select((unsigned) fildes + 1,
+			     (void *) &readfds, NULL, NULL, &select_timeout);
 	} while ((ret == -1) && (errno == EINTR));
 
 	if (ret < 0) {
@@ -2017,7 +2036,7 @@ int HTDoRead (
 
 #if !defined(UCX) || !defined(VAXC)
 #ifdef UNIX
-    while ((nb = SOCKET_READ (fildes, buf, nbyte)) == -1) {
+    while ((nb = SOCKET_READ(fildes, buf, nbyte)) == -1) {
 	if (errno == EINTR)
 	    continue;
 #ifdef ERESTARTSYS
@@ -2028,23 +2047,23 @@ int HTDoRead (
 	break;
     }
     return nb;
-#else  /* UNIX */
-    return SOCKET_READ (fildes, buf, nbyte);
+#else /* UNIX */
+    return SOCKET_READ(fildes, buf, nbyte);
 #endif /* !UNIX */
 
-#else  /* UCX && VAXC */
+#else /* UCX && VAXC */
     /*
-    **	VAXC and UCX problem only.
-    */
+     * VAXC and UCX problem only.
+     */
     errno = vaxc$errno = 0;
-    nb = SOCKET_READ (fildes, buf, nbyte);
+    nb = SOCKET_READ(fildes, buf, nbyte);
     CTRACE((tfp,
-	   "Read - nb,errno,vaxc$errno: %d %d %d\n", nb,errno,vaxc$errno));
+	    "Read - nb,errno,vaxc$errno: %d %d %d\n", nb, errno, vaxc$errno));
     if ((nb <= 0) && TRACE)
-	perror ("HTTCP.C:HTDoRead:read");	   /* RJF */
+	perror("HTTCP.C:HTDoRead:read");	/* RJF */
     /*
-    **	An errno value of EPIPE and nb < 0 indicates end-of-file on VAXC.
-    */
+     * An errno value of EPIPE and nb < 0 indicates end-of-file on VAXC.
+     */
     if ((nb <= 0) && (errno == EPIPE)) {
 	nb = 0;
 	set_errno(0);
@@ -2055,20 +2074,20 @@ int HTDoRead (
 
 #ifdef SVR4_BSDSELECT
 /*
-**  This is a fix for the difference between BSD's select() and
-**  SVR4's select().  SVR4's select() can never return a value larger
-**  than the total number of file descriptors being checked.  So, if
-**  you select for read and write on one file descriptor, and both
-**  are true, SVR4 select() will only return 1.  BSD select in the
-**  same situation will return 2.
-**
-**	Additionally, BSD select() on timing out, will zero the masks,
-**	while SVR4 does not.  This is fixed here as well.
-**
-**	Set your tabstops to 4 characters to have this code nicely formatted.
-**
-**	Jerry Whelan, guru@bradley.edu, June 12th, 1993
-*/
+ *  This is a fix for the difference between BSD's select() and
+ *  SVR4's select().  SVR4's select() can never return a value larger
+ *  than the total number of file descriptors being checked.  So, if
+ *  you select for read and write on one file descriptor, and both
+ *  are true, SVR4 select() will only return 1.  BSD select in the
+ *  same situation will return 2.
+ *
+ *	Additionally, BSD select() on timing out, will zero the masks,
+ *	while SVR4 does not.  This is fixed here as well.
+ *
+ *	Set your tabstops to 4 characters to have this code nicely formatted.
+ *
+ *	Jerry Whelan, guru@bradley.edu, June 12th, 1993
+ */
 #ifdef select
 #undef select
 #endif /* select */
@@ -2083,47 +2102,45 @@ int HTDoRead (
 #include <sys/time.h>
 #include <sys/select.h>
 
-int BSDselect (
-	int			nfds,
-	fd_set *		readfds,
-	fd_set *		writefds,
-	fd_set *		exceptfds,
-	struct timeval *	select_timeout)
+int BSDselect(int nfds,
+	      fd_set * readfds,
+	      fd_set * writefds,
+	      fd_set * exceptfds,
+	      struct timeval *select_timeout)
 {
-    int rval,
-    i;
+    int rval, i;
 
 #ifdef SOCKS
     if (socks_flag)
 	rval = Rselect(nfds, readfds, writefds, exceptfds, select_timeout);
     else
 #endif /* SOCKS */
-    rval = select(nfds, readfds, writefds, exceptfds, select_timeout);
+	rval = select(nfds, readfds, writefds, exceptfds, select_timeout);
 
     switch (rval) {
-	case -1:
-	    return(rval);
-
-	case 0:
-	    if (readfds != NULL)
-		FD_ZERO(readfds);
-	    if (writefds != NULL)
-		FD_ZERO(writefds);
-	    if (exceptfds != NULL)
-		FD_ZERO(exceptfds);
-	    return(rval);
-
-	default:
-	    for (i = 0, rval = 0; i < nfds; i++) {
-		if ((readfds != NULL) && FD_ISSET(i, readfds))
-		    rval++;
-		if ((writefds != NULL) && FD_ISSET(i, writefds))
-		    rval++;
-		if ((exceptfds != NULL) && FD_ISSET(i, exceptfds))
-		    rval++;
+    case -1:
+	return (rval);
+
+    case 0:
+	if (readfds != NULL)
+	    FD_ZERO(readfds);
+	if (writefds != NULL)
+	    FD_ZERO(writefds);
+	if (exceptfds != NULL)
+	    FD_ZERO(exceptfds);
+	return (rval);
+
+    default:
+	for (i = 0, rval = 0; i < nfds; i++) {
+	    if ((readfds != NULL) && FD_ISSET(i, readfds))
+		rval++;
+	    if ((writefds != NULL) && FD_ISSET(i, writefds))
+		rval++;
+	    if ((exceptfds != NULL) && FD_ISSET(i, exceptfds))
+		rval++;
 
-	    }
-	    return(rval);
+	}
+	return (rval);
     }
 /* Should never get here */
 }
diff --git a/WWW/Library/Implementation/HTTCP.h b/WWW/Library/Implementation/HTTCP.h
index 0bc9915a..a86a8931 100644
--- a/WWW/Library/Implementation/HTTCP.h
+++ b/WWW/Library/Implementation/HTTCP.h
@@ -12,95 +12,93 @@
 #endif
 
 /*      Produce a string for an internet address
-**      ---------------------------------------
-**
-** On exit:
-**           returns a pointer to a static string which must be copied if
-**                it is to be kept.
-*/
+ *      ---------------------------------------
+ *
+ * On exit:
+ *           returns a pointer to a static string which must be copied if
+ *                it is to be kept.
+ */
 #ifdef INET6
-extern const char * HTInetString (SockA* mysin);
+extern const char *HTInetString(SockA * mysin);
+
 #else
-extern const char * HTInetString (struct sockaddr_in* mysin);
+extern const char *HTInetString(struct sockaddr_in *mysin);
 #endif /* INET6 */
 
 /*      Encode INET status (as in sys/errno.h)                    inet_status()
-**      ------------------
-**
-** On entry:
-**              where gives a description of what caused the error
-**      global errno gives the error number in the unix way.
-**
-** On return:
-**      returns a negative status in the unix way.
-*/
+ *      ------------------
+ *
+ * On entry:
+ *              where gives a description of what caused the error
+ *      global errno gives the error number in the unix way.
+ *
+ * On return:
+ *      returns a negative status in the unix way.
+ */
 extern int HTInetStatus(char *where);
 
 /*      Publicly accessible variables
 */
 /* extern struct sockaddr_in HTHostAddress; */
-                        /* The internet address of the host */
-                        /* Valid after call to HTHostName() */
-
+			/* The internet address of the host */
+			/* Valid after call to HTHostName() */
 
 /*      Parse a cardinal value                                 parse_cardinal()
-**      ----------------------
-**
-** On entry:
-**      *pp points to first character to be interpreted, terminated by
-**      non 0..9 character.
-**      *pstatus points to status already valid,
-**      maxvalue gives the largest allowable value.
-**
-** On exit:
-**      *pp points to first unread character,
-**      *pstatus points to status updated iff bad
-*/
+ *      ----------------------
+ *
+ * On entry:
+ *      *pp points to first character to be interpreted, terminated by
+ *      non 0..9 character.
+ *      *pstatus points to status already valid,
+ *      maxvalue gives the largest allowable value.
+ *
+ * On exit:
+ *      *pp points to first unread character,
+ *      *pstatus points to status updated iff bad
+ */
 
-extern unsigned int HTCardinal (int *pstatus,
-                char            **pp,
-                unsigned int    max_value);
+extern unsigned int HTCardinal(int *pstatus,
+			       char **pp,
+			       unsigned int max_value);
 
 /*	Check whether string is a valid Internet hostname
-**	-------------------------------------------------
-*/
+ *	-------------------------------------------------
+ */
 
-extern BOOL valid_hostname (char * name);
+extern BOOL valid_hostname(char *name);
 
 /*	Resolve an internet hostname, like gethostbyname
-**	------------------------------------------------
-**
-**  On entry,
-**	str	points to the given host name, not numeric address,
-**		without colon or port number.
-**
-**  On exit,
-**	returns a pointer to a struct hostent in static storage,
-**	or NULL in case of error or user interruption.
-**
-**  The interface is intended to be the same as for gethostbyname(),
-**  but additional status is returned in lynx_nsl_status.
-*/
+ *	------------------------------------------------
+ *
+ *  On entry,
+ *	str	points to the given host name, not numeric address,
+ *		without colon or port number.
+ *
+ *  On exit,
+ *	returns a pointer to a struct hostent in static storage,
+ *	or NULL in case of error or user interruption.
+ *
+ *  The interface is intended to be the same as for gethostbyname(),
+ *  but additional status is returned in lynx_nsl_status.
+ */
 extern int lynx_nsl_status;
 
-extern struct hostent * LYGetHostByName (char * str);
+extern struct hostent *LYGetHostByName(char *str);
 
 /*      Get Name of This Machine
-**      ------------------------
-**
-*/
+ *      ------------------------
+ *
+ */
 
-extern const char * HTHostName (void);
+extern const char *HTHostName(void);
 
-extern int HTDoConnect (
-	const char *	url,
-	char *		protocol,
-	int		default_port,
-	int *		s);
+extern int HTDoConnect(const char *url,
+		       char *protocol,
+		       int default_port,
+		       int *s);
 
-extern int HTDoRead (
-	int		fildes,
-	void *		buf,
-	unsigned	nbyte);
+extern int HTDoRead(int fildes,
+		    void *buf,
+		    unsigned nbyte);
 
-#endif   /* HTTCP_H */
+#endif /* HTTCP_H */
diff --git a/WWW/Library/Implementation/HTTP.c b/WWW/Library/Implementation/HTTP.c
index dde86e66..1b987374 100644
--- a/WWW/Library/Implementation/HTTP.c
+++ b/WWW/Library/Implementation/HTTP.c
@@ -1,10 +1,10 @@
 /*	HyperText Tranfer Protocol	- Client implementation		HTTP.c
-**	==========================
-** Modified:
-** 27 Jan 1994	PDM  Added Ari Luotonen's Fix for Reload when using proxy
-**		     servers.
-** 28 Apr 1997	AJL,FM Do Proxy Authorisation.
-*/
+ *	==========================
+ * Modified:
+ * 27 Jan 1994	PDM  Added Ari Luotonen's Fix for Reload when using proxy
+ *		     servers.
+ * 28 Apr 1997	AJL,FM Do Proxy Authorisation.
+ */
 
 #include <HTUtils.h>
 #include <HTTP.h>
@@ -41,31 +41,30 @@
 #include <LYStrings.h>
 #include <LYLeaks.h>
 
-struct _HTStream
-{
-  HTStreamClass * isa;
+struct _HTStream {
+    HTStreamClass *isa;
 };
 
-extern char * HTAppName;	/* Application name: please supply */
-extern char * HTAppVersion;	/* Application version: please supply */
+extern char *HTAppName;		/* Application name: please supply */
+extern char *HTAppVersion;	/* Application version: please supply */
 
-BOOL reloading = FALSE;	/* Reloading => send no-cache pragma to proxy */
-char * redirecting_url = NULL;	    /* Location: value. */
-BOOL permanent_redirection = FALSE;  /* Got 301 status? */
-BOOL redirect_post_content = FALSE;  /* Don't convert to GET? */
+BOOL reloading = FALSE;		/* Reloading => send no-cache pragma to proxy */
+char *redirecting_url = NULL;	/* Location: value. */
+BOOL permanent_redirection = FALSE;	/* Got 301 status? */
+BOOL redirect_post_content = FALSE;	/* Don't convert to GET? */
 
 #ifdef USE_SSL
-SSL_CTX * ssl_ctx = NULL;	/* SSL ctx */
-SSL * SSL_handle = NULL;
+SSL_CTX *ssl_ctx = NULL;	/* SSL ctx */
+SSL *SSL_handle = NULL;
 int ssl_okay;
 
-static void free_ssl_ctx (void)
+static void free_ssl_ctx(void)
 {
     if (ssl_ctx != NULL)
 	SSL_CTX_free(ssl_ctx);
 }
 
-static int HTSSLCallback(int preverify_ok, X509_STORE_CTX *x509_ctx)
+static int HTSSLCallback(int preverify_ok, X509_STORE_CTX * x509_ctx)
 {
     char *msg = NULL;
     int result = 1;
@@ -85,11 +84,11 @@ static int HTSSLCallback(int preverify_ok, X509_STORE_CTX *x509_ctx)
     return result;
 }
 
-SSL * HTGetSSLHandle (void)
+SSL *HTGetSSLHandle(void)
 {
     if (ssl_ctx == NULL) {
 	/*
-	 *  First time only.
+	 * First time only.
 	 */
 #if SSLEAY_VERSION_NUMBER < 0x0800
 	ssl_ctx = SSL_CTX_new();
@@ -104,37 +103,38 @@ SSL * HTGetSSLHandle (void)
 	atexit(free_ssl_ctx);
     }
     ssl_okay = 0;
-    return(SSL_new(ssl_ctx));
+    return (SSL_new(ssl_ctx));
 }
 
-void HTSSLInitPRNG (void)
+void HTSSLInitPRNG(void)
 {
 #if SSLEAY_VERSION_NUMBER >= 0x00905100
     if (RAND_status() == 0) {
 	char rand_file[256];
 	time_t t;
 	int pid;
-	long l,seed;
+	long l, seed;
 
 	t = time(NULL);
 	pid = getpid();
 	RAND_file_name(rand_file, 256);
-	CTRACE((tfp,"HTTP: Seeding PRNG\n"));
-	if(rand_file != NULL) {
+	CTRACE((tfp, "HTTP: Seeding PRNG\n"));
+	if (rand_file != NULL) {
 	    /* Seed as much as 1024 bytes from RAND_file_name */
 	    RAND_load_file(rand_file, 1024);
 	}
 	/* Seed in time (mod_ssl does this) */
-	RAND_seed((unsigned char *)&t, sizeof(time_t));
+	RAND_seed((unsigned char *) &t, sizeof(time_t));
 	/* Seed in pid (mod_ssl does this) */
-	RAND_seed((unsigned char *)&pid, sizeof(pid));
+	RAND_seed((unsigned char *) &pid, sizeof(pid));
 	/* Initialize system's random number generator */
-	RAND_bytes((unsigned char *)&seed, sizeof(long));
+	RAND_bytes((unsigned char *) &seed, sizeof(long));
+
 	lynx_srand(seed);
 	while (RAND_status() == 0) {
 	    /* Repeatedly seed the PRNG using the system's random number generator until it has been seeded with enough data */
 	    l = lynx_rand();
-	    RAND_seed((unsigned char *)&l, sizeof(long));
+	    RAND_seed((unsigned char *) &l, sizeof(long));
 	}
 	if (rand_file != NULL) {
 	    /* Write a rand_file */
@@ -158,15 +158,15 @@ void HTSSLInitPRNG (void)
 #define HTTP_NETCLOSE(a, b)  (void)NETCLOSE(a)
 #endif /* USE_SSL */
 
-#ifdef _WINDOWS		/* 1997/11/06 (Thu) 13:00:08 */
+#ifdef _WINDOWS			/* 1997/11/06 (Thu) 13:00:08 */
 
 #define	BOX_TITLE	"Lynx " __FILE__
 #define	BOX_FLAG	(MB_ICONINFORMATION | MB_SETFOREGROUND)
 
 typedef struct {
-	int fd;
-	char *buf;
-	int len;
+    int fd;
+    char *buf;
+    int len;
 } recv_data_t;
 
 int ws_read_per_sec = 0;
@@ -175,14 +175,13 @@ static int ws_errno = 0;
 static DWORD g_total_times = 0;
 static DWORD g_total_bytes = 0;
 
-
-char * str_speed(void)
+char *str_speed(void)
 {
     static char buff[32];
 
     if (ws_read_per_sec > 1000)
 	sprintf(buff, "%d.%03dkB", ws_read_per_sec / 1000,
-			(ws_read_per_sec % 1000) );
+		(ws_read_per_sec % 1000));
     else
 	sprintf(buff, "%3d", ws_read_per_sec);
 
@@ -194,25 +193,25 @@ char * str_speed(void)
 
 static int ws_read(int fd, char *buf, int len)
 {
-     int res;
-     int retry = 3;
+    int res;
+    int retry = 3;
 
-     do {
+    do {
 	res = recv(fd, buf, len, 0);
 	if (WSAEWOULDBLOCK == WSAGetLastError()) {
-	  Sleep(100);
-	  if (retry-- > 0)
-	    continue;
+	    Sleep(100);
+	    if (retry-- > 0)
+		continue;
 	}
-     } while (res == SOCKET_ERROR && SOCKET_ERRNO == EINTR);
+    } while (res == SOCKET_ERROR && SOCKET_ERRNO == EINTR);
 
-     return res;
+    return res;
 }
 
-static void _thread_func (void *p)
+static void _thread_func(void *p)
 {
     int i, val, ret;
-    recv_data_t *q = (recv_data_t *)p;
+    recv_data_t *q = (recv_data_t *) p;
 
     i = 0;
     i++;
@@ -222,6 +221,7 @@ static void _thread_func (void *p)
 	ws_errno = WSAGetLastError();
 #if 0
 	char buff[256];
+
 	sprintf(buff, "Thread read: %d, error (%ld), fd = %d, len = %d",
 		i, ws_errno, q->fd, q->len);
 	MessageBox(NULL, buff, BOX_TITLE, BOX_FLAG);
@@ -231,7 +231,7 @@ static void _thread_func (void *p)
 	ret = val;
     }
 
-    ExitThread((DWORD)ret);
+    ExitThread((DWORD) ret);
 }
 
 /* The same like read, but takes care of EINTR and uses select to
@@ -242,7 +242,7 @@ int ws_netread(int fd, char *buf, int len)
     int i;
     char buff[256];
 
-     /* 1998/03/30 (Mon) 09:01:21 */
+    /* 1998/03/30 (Mon) 09:01:21 */
     HANDLE hThread;
     DWORD dwThreadID;
     DWORD exitcode = 0;
@@ -251,7 +251,7 @@ int ws_netread(int fd, char *buf, int len)
     static recv_data_t para;
 
     extern int win32_check_interrupt(void);	/* LYUtil.c */
-    extern int lynx_timeout;			/* LYMain.c */
+    extern int lynx_timeout;	/* LYMain.c */
     extern CRITICAL_SECTION critSec_READ;	/* LYMain.c */
 
 #define TICK	5
@@ -266,9 +266,9 @@ int ws_netread(int fd, char *buf, int len)
     ws_read_per_sec = 0;
     save_TickCount = GetTickCount();
 
-    hThread = CreateThread((void *)NULL, STACK_SIZE,
-		 (LPTHREAD_START_ROUTINE)_thread_func,
-		 (void *)&para, 0UL, &dwThreadID);
+    hThread = CreateThread((void *) NULL, STACK_SIZE,
+			   (LPTHREAD_START_ROUTINE) _thread_func,
+			   (void *) &para, 0UL, &dwThreadID);
 
     if (hThread == 0) {
 	HTInfoMsg("CreateThread Failed (read)");
@@ -277,7 +277,7 @@ int ws_netread(int fd, char *buf, int len)
 
     i = 0;
     while (1) {
-	val = WaitForSingleObject(hThread, 1000/TICK);
+	val = WaitForSingleObject(hThread, 1000 / TICK);
 	i++;
 	if (val == WAIT_FAILED) {
 	    HTInfoMsg("Wait Failed");
@@ -285,12 +285,12 @@ int ws_netread(int fd, char *buf, int len)
 	    break;
 	} else if (val == WAIT_TIMEOUT) {
 	    i++;
-	    if (i/TICK > (AlertSecs + 2)) {
+	    if (i / TICK > (AlertSecs + 2)) {
 		sprintf(buff, "Read Waiting (%2d.%01d) for %d Bytes",
-			i/TICK, (i%TICK) * 10 / TICK, len);
+			i / TICK, (i % TICK) * 10 / TICK, len);
 		SetConsoleTitle(buff);
 	    }
-	    if (win32_check_interrupt() || ((i/TICK) > lynx_timeout)) {
+	    if (win32_check_interrupt() || ((i / TICK) > lynx_timeout)) {
 		if (CloseHandle(hThread) == FALSE) {
 		    HTInfoMsg("Thread terminate Failed");
 		}
@@ -315,16 +315,16 @@ int ws_netread(int fd, char *buf, int len)
 	    g_total_bytes += exitcode;
 
 	    if (g_total_bytes > 2000000) {
-		ws_read_per_sec = g_total_bytes / (g_total_times/1000);
+		ws_read_per_sec = g_total_bytes / (g_total_times / 1000);
 	    } else {
 		ws_read_per_sec = g_total_bytes * 1000 / g_total_times;
 	    }
 	    ret_val = exitcode;
 	    break;
 	}
-    }	/* end while(1) */
+    }				/* end while(1) */
 
-    read_exit:
+  read_exit:
     LeaveCriticalSection(&critSec_READ);
     return ret_val;
 }
@@ -334,8 +334,7 @@ int ws_netread(int fd, char *buf, int len)
  * Strip any username from the given string so we retain only the host.
  * If the
  */
-static void strip_userid (
-	char *		host)
+static void strip_userid(char *host)
 {
     char *p1 = host;
     char *p2 = strchr(host, '@');
@@ -358,177 +357,175 @@ static void strip_userid (
 }
 
 /*		Load Document from HTTP Server			HTLoadHTTP()
-**		==============================
-**
-**	Given a hypertext address, this routine loads a document.
-**
-**
-**  On entry,
-**	arg	is the hypertext reference of the article to be loaded.
-**
-**  On exit,
-**	returns >=0	If no error, a good socket number
-**		<0	Error.
-**
-**	The socket must be closed by the caller after the document has been
-**	read.
-**
-*/
-static int HTLoadHTTP (
-	const char *		arg,
-	HTParentAnchor *	anAnchor,
-	HTFormat		format_out,
-	HTStream*		sink)
+ *		==============================
+ *
+ *	Given a hypertext address, this routine loads a document.
+ *
+ *
+ *  On entry,
+ *	arg	is the hypertext reference of the article to be loaded.
+ *
+ *  On exit,
+ *	returns >=0	If no error, a good socket number
+ *		<0	Error.
+ *
+ *	The socket must be closed by the caller after the document has been
+ *	read.
+ *
+ */
+static int HTLoadHTTP(const char *arg,
+		      HTParentAnchor *anAnchor,
+		      HTFormat format_out,
+		      HTStream *sink)
 {
-  int s;			/* Socket number for returned data */
-  const char *url = arg;	/* The URL which get_physical() returned */
-  bstring *command = NULL;	/* The whole command */
-  char *eol;			/* End of line if found */
-  char *start_of_data;		/* Start of body of reply */
-  int status;			/* tcp return */
-  int bytes_already_read;
-  char crlf[3];			/* A CR LF equivalent string */
-  HTStream *target;		/* Unconverted data */
-  HTFormat format_in;		/* Format arriving in the message */
-  BOOL do_head = FALSE;		/* Whether or not we should do a head */
-  BOOL do_post = FALSE;		/* ARE WE posting ? */
-  char *METHOD;
-
-  BOOL had_header;		/* Have we had at least one header? */
-  char *line_buffer;
-  char *line_kept_clean;
-  int real_length_of_line;
-  BOOL extensions;		/* Assume good HTTP server */
-  char *linebuf = NULL;
-  char temp[80];
-  BOOL first_Accept = TRUE;
-  BOOL show_401 = FALSE;
-  BOOL show_407 = FALSE;
-  BOOL auth_proxy = NO;		/* Generate a proxy authorization. - AJL */
-
-  int length, rawlength, rv;
-  int server_status;
-  BOOL doing_redirect, already_retrying = FALSE;
-  int len = 0;
+    int s;			/* Socket number for returned data */
+    const char *url = arg;	/* The URL which get_physical() returned */
+    bstring *command = NULL;	/* The whole command */
+    char *eol;			/* End of line if found */
+    char *start_of_data;	/* Start of body of reply */
+    int status;			/* tcp return */
+    int bytes_already_read;
+    char crlf[3];		/* A CR LF equivalent string */
+    HTStream *target;		/* Unconverted data */
+    HTFormat format_in;		/* Format arriving in the message */
+    BOOL do_head = FALSE;	/* Whether or not we should do a head */
+    BOOL do_post = FALSE;	/* ARE WE posting ? */
+    char *METHOD;
+
+    BOOL had_header;		/* Have we had at least one header? */
+    char *line_buffer;
+    char *line_kept_clean;
+    int real_length_of_line;
+    BOOL extensions;		/* Assume good HTTP server */
+    char *linebuf = NULL;
+    char temp[80];
+    BOOL first_Accept = TRUE;
+    BOOL show_401 = FALSE;
+    BOOL show_407 = FALSE;
+    BOOL auth_proxy = NO;	/* Generate a proxy authorization. - AJL */
+
+    int length, rawlength, rv;
+    int server_status;
+    BOOL doing_redirect, already_retrying = FALSE;
+    int len = 0;
 
 #ifdef USE_SSL
-  BOOL do_connect = FALSE;	/* ARE WE going to use a proxy tunnel ? */
-  BOOL did_connect = FALSE;	/* ARE WE actually using a proxy tunnel ? */
-  const char *connect_url = NULL; /* The URL being proxied */
-  char *connect_host = NULL;	/* The host being proxied */
-  SSL * handle = NULL;		/* The SSL handle */
-  char ssl_dn[256];
-  char *cert_host;
-  char *ssl_host;
-  char *p;
-  char *msg = NULL;
+    BOOL do_connect = FALSE;	/* ARE WE going to use a proxy tunnel ? */
+    BOOL did_connect = FALSE;	/* ARE WE actually using a proxy tunnel ? */
+    const char *connect_url = NULL;	/* The URL being proxied */
+    char *connect_host = NULL;	/* The host being proxied */
+    SSL *handle = NULL;		/* The SSL handle */
+    char ssl_dn[256];
+    char *cert_host;
+    char *ssl_host;
+    char *p;
+    char *msg = NULL;
+
 #if SSLEAY_VERSION_NUMBER >= 0x0900
-  BOOL try_tls = TRUE;
+    BOOL try_tls = TRUE;
 #endif /* SSLEAY_VERSION_NUMBER >= 0x0900 */
-  SSL_handle = NULL;
+    SSL_handle = NULL;
 #else
-  void * handle = NULL;
+    void *handle = NULL;
 #endif /* USE_SSL */
 
-  if (anAnchor->isHEAD)
-      do_head = TRUE;
-  else if (anAnchor->post_data)
-      do_post = TRUE;
-
-  if (!url) {
-      status = -3;
-      _HTProgress (BAD_REQUEST);
-      goto done;
-  }
-  if (!*url) {
-      status = -2;
-      _HTProgress (BAD_REQUEST);
-      goto done;
-  }
+    if (anAnchor->isHEAD)
+	do_head = TRUE;
+    else if (anAnchor->post_data)
+	do_post = TRUE;
 
+    if (!url) {
+	status = -3;
+	_HTProgress(BAD_REQUEST);
+	goto done;
+    }
+    if (!*url) {
+	status = -2;
+	_HTProgress(BAD_REQUEST);
+	goto done;
+    }
 #ifdef USE_SSL
-  if (using_proxy && !strncmp(url, "http://", 7)) {
-      if ((connect_url = strstr((url+7), "https://"))) {
-	  do_connect = TRUE;
-	  connect_host = HTParse(connect_url, "https", PARSE_HOST);
-	  if (!strchr(connect_host, ':')) {
-	      sprintf(temp, ":%d", HTTPS_PORT);
-	      StrAllocCat(connect_host, temp);
-	  }
-	  CTRACE((tfp, "HTTP: connect_url = '%s'\n", connect_url));
-	  CTRACE((tfp, "HTTP: connect_host = '%s'\n", connect_host));
-      } else if ((connect_url = strstr((url+7), "snews://"))) {
-	  do_connect = TRUE;
-	  connect_host = HTParse(connect_url, "snews", PARSE_HOST);
-	  if (!strchr(connect_host, ':')) {
-	      sprintf(temp, ":%d", SNEWS_PORT);
-	      StrAllocCat(connect_host, temp);
-	  }
-	  CTRACE((tfp, "HTTP: connect_url = '%s'\n", connect_url));
-	  CTRACE((tfp, "HTTP: connect_host = '%s'\n", connect_host));
-      }
-  }
+    if (using_proxy && !strncmp(url, "http://", 7)) {
+	if ((connect_url = strstr((url + 7), "https://"))) {
+	    do_connect = TRUE;
+	    connect_host = HTParse(connect_url, "https", PARSE_HOST);
+	    if (!strchr(connect_host, ':')) {
+		sprintf(temp, ":%d", HTTPS_PORT);
+		StrAllocCat(connect_host, temp);
+	    }
+	    CTRACE((tfp, "HTTP: connect_url = '%s'\n", connect_url));
+	    CTRACE((tfp, "HTTP: connect_host = '%s'\n", connect_host));
+	} else if ((connect_url = strstr((url + 7), "snews://"))) {
+	    do_connect = TRUE;
+	    connect_host = HTParse(connect_url, "snews", PARSE_HOST);
+	    if (!strchr(connect_host, ':')) {
+		sprintf(temp, ":%d", SNEWS_PORT);
+		StrAllocCat(connect_host, temp);
+	    }
+	    CTRACE((tfp, "HTTP: connect_url = '%s'\n", connect_url));
+	    CTRACE((tfp, "HTTP: connect_host = '%s'\n", connect_host));
+	}
+    }
 #endif /* USE_SSL */
 
-  sprintf(crlf, "%c%c", CR, LF);
-
-  /*
-  **  At this point, we're talking HTTP/1.0.
-  */
-  extensions = YES;
-
-try_again:
-  /*
-  **  All initializations are moved down here from up above,
-  **  so we can start over here...
-  */
-  eol = 0;
-  had_header = NO;
-  length = 0;
-  doing_redirect = FALSE;
-  permanent_redirection = FALSE;
-  redirect_post_content = FALSE;
-  target = NULL;
-  line_buffer = NULL;
-  line_kept_clean = NULL;
+    sprintf(crlf, "%c%c", CR, LF);
+
+    /*
+     * At this point, we're talking HTTP/1.0.
+     */
+    extensions = YES;
+
+  try_again:
+    /*
+     * All initializations are moved down here from up above, so we can start
+     * over here...
+     */
+    eol = 0;
+    had_header = NO;
+    length = 0;
+    doing_redirect = FALSE;
+    permanent_redirection = FALSE;
+    redirect_post_content = FALSE;
+    target = NULL;
+    line_buffer = NULL;
+    line_kept_clean = NULL;
 
 #ifdef USE_SSL
-  if (!strncmp(url, "https", 5))
-    status = HTDoConnect (url, "HTTPS", HTTPS_PORT, &s);
-  else
-    status = HTDoConnect (url, "HTTP", HTTP_PORT, &s);
+    if (!strncmp(url, "https", 5))
+	status = HTDoConnect(url, "HTTPS", HTTPS_PORT, &s);
+    else
+	status = HTDoConnect(url, "HTTP", HTTP_PORT, &s);
 #else
-  if (!strncmp(url, "https", 5))
-    {
-      HTAlert(gettext("This client does not contain support for HTTPS URLs."));
-      status = HT_NOT_LOADED;
-      goto done;
+    if (!strncmp(url, "https", 5)) {
+	HTAlert(gettext("This client does not contain support for HTTPS URLs."));
+	status = HT_NOT_LOADED;
+	goto done;
     }
-  status = HTDoConnect (arg, "HTTP", HTTP_PORT, &s);
+    status = HTDoConnect(arg, "HTTP", HTTP_PORT, &s);
 #endif /* USE_SSL */
-  if (status == HT_INTERRUPTED) {
-      /*
-      **  Interrupt cleanly.
-      */
-       CTRACE((tfp, "HTTP: Interrupted on connect; recovering cleanly.\n"));
-       _HTProgress (CONNECTION_INTERRUPTED);
-       status = HT_NOT_LOADED;
-       goto done;
-   }
-   if (status < 0) {
+    if (status == HT_INTERRUPTED) {
+	/*
+	 * Interrupt cleanly.
+	 */
+	CTRACE((tfp, "HTTP: Interrupted on connect; recovering cleanly.\n"));
+	_HTProgress(CONNECTION_INTERRUPTED);
+	status = HT_NOT_LOADED;
+	goto done;
+    }
+    if (status < 0) {
 #ifdef _WINDOWS
-      CTRACE((tfp, "HTTP: Unable to connect to remote host for `%s'\n"
-			  " (status = %d, sock_errno = %d).\n",
-			  url, status, SOCKET_ERRNO));
+	CTRACE((tfp, "HTTP: Unable to connect to remote host for `%s'\n"
+		" (status = %d, sock_errno = %d).\n",
+		url, status, SOCKET_ERRNO));
 #else
-      CTRACE((tfp,
-	    "HTTP: Unable to connect to remote host for `%s' (errno = %d).\n",
-	    url, SOCKET_ERRNO));
+	CTRACE((tfp,
+		"HTTP: Unable to connect to remote host for `%s' (errno = %d).\n",
+		url, SOCKET_ERRNO));
 #endif
-      HTAlert(gettext("Unable to connect to remote host."));
-      status = HT_NOT_LOADED;
-      goto done;
-  }
+	HTAlert(gettext("Unable to connect to remote host."));
+	status = HT_NOT_LOADED;
+	goto done;
+    }
 
 /* *sob*  All this needs to be converted to handle binary strings
  * if we're going to be able to handle binary form uploads...
@@ -536,543 +533,546 @@ try_again:
  */
 
 #ifdef USE_SSL
-use_tunnel:
-  /*
-  ** If this is an https document
-  ** then do the SSL stuff here
-  */
-  if (did_connect || !strncmp(url, "https", 5)) {
-      SSL_handle = handle = HTGetSSLHandle();
-      SSL_set_fd(handle, s);
+  use_tunnel:
+    /*
+     * If this is an https document
+     * then do the SSL stuff here
+     */
+    if (did_connect || !strncmp(url, "https", 5)) {
+	SSL_handle = handle = HTGetSSLHandle();
+	SSL_set_fd(handle, s);
 #if SSLEAY_VERSION_NUMBER >= 0x0900
-      if (!try_tls)
-	  handle->options|=SSL_OP_NO_TLSv1;
+	if (!try_tls)
+	    handle->options |= SSL_OP_NO_TLSv1;
 #endif /* SSLEAY_VERSION_NUMBER >= 0x0900 */
-      HTSSLInitPRNG();
-      status = SSL_connect(handle);
+	HTSSLInitPRNG();
+	status = SSL_connect(handle);
 
-      if (status <= 0) {
+	if (status <= 0) {
 #if SSLEAY_VERSION_NUMBER >= 0x0900
-	  if (try_tls) {
-	      _HTProgress(gettext("Retrying connection without TLS."));
-	      try_tls = FALSE;
-	      if (did_connect)
-		  HTTP_NETCLOSE(s, handle);
-	      goto try_again;
-	  } else {
-	      unsigned long SSLerror;
-	      CTRACE((tfp,
-"HTTP: Unable to complete SSL handshake for '%s', SSL_connect=%d, SSL error stack dump follows\n",
-				url, status));
-	      SSL_load_error_strings();
-	      while((SSLerror=ERR_get_error())!=0) {
-		  CTRACE((tfp,"HTTP: SSL: %s\n",ERR_error_string(SSLerror,NULL)));
-	      }
-	      HTAlert("Unable to make secure connection to remote host.");
-	      if (did_connect)
-		  HTTP_NETCLOSE(s, handle);
-	      status = HT_NOT_LOADED;
-	      goto done;
-	  }
+	    if (try_tls) {
+		_HTProgress(gettext("Retrying connection without TLS."));
+		try_tls = FALSE;
+		if (did_connect)
+		    HTTP_NETCLOSE(s, handle);
+		goto try_again;
+	    } else {
+		unsigned long SSLerror;
+
+		CTRACE((tfp,
+			"HTTP: Unable to complete SSL handshake for '%s', SSL_connect=%d, SSL error stack dump follows\n",
+			url, status));
+		SSL_load_error_strings();
+		while ((SSLerror = ERR_get_error()) != 0) {
+		    CTRACE((tfp, "HTTP: SSL: %s\n", ERR_error_string(SSLerror, NULL)));
+		}
+		HTAlert("Unable to make secure connection to remote host.");
+		if (did_connect)
+		    HTTP_NETCLOSE(s, handle);
+		status = HT_NOT_LOADED;
+		goto done;
+	    }
 #else
-	  unsigned long SSLerror;
-	  CTRACE((tfp,
-"HTTP: Unable to complete SSL handshake for '%s', SSL_connect=%d, SSL error stack dump follows\n",
-				url, status));
-	  SSL_load_error_strings();
-	  while((SSLerror=ERR_get_error())!=0) {
-	      CTRACE((tfp,"HTTP: SSL: %s\n",ERR_error_string(SSLerror,NULL)));
-	  }
-	  HTAlert("Unable to make secure connection to remote host.");
-	  if (did_connect)
-	      HTTP_NETCLOSE(s, handle);
-	  status = HT_NOT_LOADED;
-	  goto done;
+	    unsigned long SSLerror;
+
+	    CTRACE((tfp,
+		    "HTTP: Unable to complete SSL handshake for '%s', SSL_connect=%d, SSL error stack dump follows\n",
+		    url, status));
+	    SSL_load_error_strings();
+	    while ((SSLerror = ERR_get_error()) != 0) {
+		CTRACE((tfp, "HTTP: SSL: %s\n", ERR_error_string(SSLerror, NULL)));
+	    }
+	    HTAlert("Unable to make secure connection to remote host.");
+	    if (did_connect)
+		HTTP_NETCLOSE(s, handle);
+	    status = HT_NOT_LOADED;
+	    goto done;
 #endif /* SSLEAY_VERSION_NUMBER >= 0x0900 */
-      }
-
-      X509_NAME_oneline(X509_get_subject_name(SSL_get_peer_certificate(handle)),
-		        ssl_dn, sizeof(ssl_dn));
-      if ((cert_host = strstr(ssl_dn, "/CN=")) == NULL) {
-	  HTSprintf0(&msg,
-		     gettext("SSL error:Can't find common name in certificate-Continue?"));
-	   if (! HTForcedPrompt(ssl_noprompt, msg, YES)) {
-	      status = HT_NOT_LOADED;
-	      FREE(msg);
-	      goto done;
-	  }
-      } else {
-	  cert_host += 4;
-	  if ((p = strchr(cert_host, '/')) != NULL)
-	      *p = '\0';
-	  if ((p = strchr(cert_host, ':')) != NULL)
-	      *p = '\0';
-	  ssl_host = HTParse(url, "", PARSE_HOST);
-	  if ((p = strchr(ssl_host, ':')) != NULL)
-	      *p = '\0';
-	  if (strcasecomp(ssl_host, cert_host)) {
-	      HTSprintf0(&msg,
-			 gettext("SSL error:host(%s)!=cert(%s)-Continue?"),
-			 ssl_host,
-			 cert_host);
-	      if (! HTForcedPrompt(ssl_noprompt, msg, YES)) {
-		  status = HT_NOT_LOADED;
-		  FREE(msg);
-		  goto done;
-	      }
-	  }
-      }
-
-      HTSprintf0(&msg,
-		 gettext("Secure %d-bit %s (%s) HTTP connection"),
-		 SSL_get_cipher_bits(handle, NULL),
-		 SSL_get_cipher_version(handle),
-		 SSL_get_cipher(handle));
-      _HTProgress(msg);
-      FREE(msg);
-  }
+	}
+
+	X509_NAME_oneline(X509_get_subject_name(SSL_get_peer_certificate(handle)),
+			  ssl_dn, sizeof(ssl_dn));
+	if ((cert_host = strstr(ssl_dn, "/CN=")) == NULL) {
+	    HTSprintf0(&msg,
+		       gettext("SSL error:Can't find common name in certificate-Continue?"));
+	    if (!HTForcedPrompt(ssl_noprompt, msg, YES)) {
+		status = HT_NOT_LOADED;
+		FREE(msg);
+		goto done;
+	    }
+	} else {
+	    cert_host += 4;
+	    if ((p = strchr(cert_host, '/')) != NULL)
+		*p = '\0';
+	    if ((p = strchr(cert_host, ':')) != NULL)
+		*p = '\0';
+	    ssl_host = HTParse(url, "", PARSE_HOST);
+	    if ((p = strchr(ssl_host, ':')) != NULL)
+		*p = '\0';
+	    if (strcasecomp(ssl_host, cert_host)) {
+		HTSprintf0(&msg,
+			   gettext("SSL error:host(%s)!=cert(%s)-Continue?"),
+			   ssl_host,
+			   cert_host);
+		if (!HTForcedPrompt(ssl_noprompt, msg, YES)) {
+		    status = HT_NOT_LOADED;
+		    FREE(msg);
+		    goto done;
+		}
+	    }
+	}
+
+	HTSprintf0(&msg,
+		   gettext("Secure %d-bit %s (%s) HTTP connection"),
+		   SSL_get_cipher_bits(handle, NULL),
+		   SSL_get_cipher_version(handle),
+		   SSL_get_cipher(handle));
+	_HTProgress(msg);
+	FREE(msg);
+    }
 #endif /* USE_SSL */
 
-  /*	Ask that node for the document,
-  **	omitting the host name & anchor
-  */
-  {
-    char * p1 = (HTParse(url, "", PARSE_PATH|PARSE_PUNCTUATION));
+    /*    Ask that node for the document,
+     * omitting the host name & anchor
+     */
+    {
+	char *p1 = (HTParse(url, "", PARSE_PATH | PARSE_PUNCTUATION));
 
 #ifdef USE_SSL
-    if (do_connect) {
-	METHOD = "CONNECT";
-	BStrCopy0(command, "CONNECT ");
-    } else
+	if (do_connect) {
+	    METHOD = "CONNECT";
+	    BStrCopy0(command, "CONNECT ");
+	} else
 #endif /* USE_SSL */
-    if (do_post) {
-	METHOD = "POST";
-	BStrCopy0(command, "POST ");
-    } else if (do_head) {
-	METHOD = "HEAD";
-	BStrCopy0(command, "HEAD ");
-    } else {
-	METHOD = "GET";
-	BStrCopy0(command, "GET ");
-    }
+	if (do_post) {
+	    METHOD = "POST";
+	    BStrCopy0(command, "POST ");
+	} else if (do_head) {
+	    METHOD = "HEAD";
+	    BStrCopy0(command, "HEAD ");
+	} else {
+	    METHOD = "GET";
+	    BStrCopy0(command, "GET ");
+	}
 
-    /*
-    **	If we are using a proxy gateway don't copy in the first slash
-    **	of say: /gopher://a;lkdjfl;ajdf;lkj/;aldk/adflj
-    **	so that just gopher://.... is sent.
-    */
+	/*
+	 * If we are using a proxy gateway don't copy in the first slash of
+	 * say:  /gopher://a;lkdjfl;ajdf;lkj/;aldk/adflj so that just
+	 * gopher://....  is sent.
+	 */
 #ifdef USE_SSL
-    if (using_proxy && !did_connect) {
-	if (do_connect)
-	    BStrCat0(command, connect_host);
-	else
-	    BStrCat0(command, p1+1);
-    }
+	if (using_proxy && !did_connect) {
+	    if (do_connect)
+		BStrCat0(command, connect_host);
+	    else
+		BStrCat0(command, p1 + 1);
+	}
 #else
-    if (using_proxy)
-	BStrCat0(command, p1+1);
+	if (using_proxy)
+	    BStrCat0(command, p1 + 1);
 #endif /* USE_SSL */
-    else
-	BStrCat0(command, p1);
-    FREE(p1);
-  }
-  if (extensions) {
-      BStrCat0(command, " ");
-      BStrCat0(command, HTTP_VERSION);
-  }
-
-  BStrCat0(command, crlf);	/* CR LF, as in rfc 977 */
-
-  if (extensions) {
-      int n, i;
-      char * host = NULL;
-
-      if ((host = HTParse(anAnchor->address, "", PARSE_HOST)) != NULL) {
-	  strip_userid(host);
-	  HTBprintf(&command, "Host: %s%c%c", host, CR,LF);
-	  FREE(host);
-      }
-
-      if (!HTPresentations)
-	  HTFormatInit();
-      n = HTList_count(HTPresentations);
-
-      first_Accept = TRUE;
-      len = 0;
-      for (i = 0; i < n; i++) {
-	  HTPresentation *pres =
-			(HTPresentation *)HTList_objectAt(HTPresentations, i);
-	  if (pres->get_accept) {
-	      if (pres->quality < 1.0) {
-		  if (pres->maxbytes > 0) {
-		      sprintf(temp, ";q=%4.3f;mxb=%ld",
-				    pres->quality, pres->maxbytes);
-		  } else {
-		      sprintf(temp, ";q=%4.3f", pres->quality);
-		  }
-	      } else if (pres->maxbytes > 0) {
-		  sprintf(temp, ";mxb=%ld", pres->maxbytes);
-	      } else {
-		  temp[0] = '\0';
-	      }
-	      HTSprintf0(&linebuf, "%s%s%s",
-			    (first_Accept ?
-			       "Accept: " : ", "),
-			    HTAtom_name(pres->rep),
-			    temp);
-	      len += strlen(linebuf);
-	      if (len > 252 && !first_Accept) {
-		  BStrCat0(command, crlf);
-		  HTSprintf0(&linebuf, "Accept: %s%s",
-				HTAtom_name(pres->rep),
-				temp);
-		  len = strlen(linebuf);
-	      }
-	      BStrCat0(command, linebuf);
-	      first_Accept = FALSE;
-	  }
-      }
-      HTBprintf(&command, "%s*/*;q=0.01%c%c",
-		    (first_Accept ?
-		       "Accept: " : ", "), CR, LF);
-      first_Accept = FALSE;
-      len = 0;
-
-      /*
-       * FIXME:  suppressing the "Accept-Encoding" in this case is done to work
-       * around limitations of the presentation logic used for the command-line
-       * "-base" option.  The remote site may transmit the document gzip'd, but
-       * the ensuing logic in HTSaveToFile() would see the mime-type as gzip
-       * rather than text/html, and not prepend the base URL.  This is less
-       * efficient than accepting the compressed data and uncompressing it,
-       * adding the base URL but is simpler than augmenting the dump's
-       * presentation logic -TD
-       */
-      if (LYPrependBaseToSource && dump_output_immediately) {
-	  CTRACE((tfp, "omit Accept-Encoding to work-around interaction with -source\n"));
-      } else {
-	  char *list = 0;
+	else
+	    BStrCat0(command, p1);
+	FREE(p1);
+    }
+    if (extensions) {
+	BStrCat0(command, " ");
+	BStrCat0(command, HTTP_VERSION);
+    }
+
+    BStrCat0(command, crlf);	/* CR LF, as in rfc 977 */
+
+    if (extensions) {
+	int n, i;
+	char *host = NULL;
+
+	if ((host = HTParse(anAnchor->address, "", PARSE_HOST)) != NULL) {
+	    strip_userid(host);
+	    HTBprintf(&command, "Host: %s%c%c", host, CR, LF);
+	    FREE(host);
+	}
+
+	if (!HTPresentations)
+	    HTFormatInit();
+	n = HTList_count(HTPresentations);
+
+	first_Accept = TRUE;
+	len = 0;
+	for (i = 0; i < n; i++) {
+	    HTPresentation *pres =
+	    (HTPresentation *) HTList_objectAt(HTPresentations, i);
+
+	    if (pres->get_accept) {
+		if (pres->quality < 1.0) {
+		    if (pres->maxbytes > 0) {
+			sprintf(temp, ";q=%4.3f;mxb=%ld",
+				pres->quality, pres->maxbytes);
+		    } else {
+			sprintf(temp, ";q=%4.3f", pres->quality);
+		    }
+		} else if (pres->maxbytes > 0) {
+		    sprintf(temp, ";mxb=%ld", pres->maxbytes);
+		} else {
+		    temp[0] = '\0';
+		}
+		HTSprintf0(&linebuf, "%s%s%s",
+			   (first_Accept ?
+			    "Accept: " : ", "),
+			   HTAtom_name(pres->rep),
+			   temp);
+		len += strlen(linebuf);
+		if (len > 252 && !first_Accept) {
+		    BStrCat0(command, crlf);
+		    HTSprintf0(&linebuf, "Accept: %s%s",
+			       HTAtom_name(pres->rep),
+			       temp);
+		    len = strlen(linebuf);
+		}
+		BStrCat0(command, linebuf);
+		first_Accept = FALSE;
+	    }
+	}
+	HTBprintf(&command, "%s*/*;q=0.01%c%c",
+		  (first_Accept ?
+		   "Accept: " : ", "), CR, LF);
+	first_Accept = FALSE;
+	len = 0;
+
+	/*
+	 * FIXME:  suppressing the "Accept-Encoding" in this case is done to work
+	 * around limitations of the presentation logic used for the command-line
+	 * "-base" option.  The remote site may transmit the document gzip'd, but
+	 * the ensuing logic in HTSaveToFile() would see the mime-type as gzip
+	 * rather than text/html, and not prepend the base URL.  This is less
+	 * efficient than accepting the compressed data and uncompressing it,
+	 * adding the base URL but is simpler than augmenting the dump's
+	 * presentation logic -TD
+	 */
+	if (LYPrependBaseToSource && dump_output_immediately) {
+	    CTRACE((tfp,
+		    "omit Accept-Encoding to work-around interaction with -source\n"));
+	} else {
+	    char *list = 0;
+
 #if defined(USE_ZLIB) || defined(GZIP_PATH)
-	  StrAllocCopy(list, "gzip");
+	    StrAllocCopy(list, "gzip");
 #endif
 #if defined(USE_ZLIB) || defined(COMPRESS_PATH)
-	  if (list != 0)
-	      StrAllocCat(list, ", ");
-	  StrAllocCat(list, "compress");
+	    if (list != 0)
+		StrAllocCat(list, ", ");
+	    StrAllocCat(list, "compress");
 #endif
-	  if (list != 0) {
-	      HTBprintf(&command, "Accept-Encoding: %s%c%c", list, CR, LF);
-	      free(list);
-	  }
-      }
-
-      if (language && *language) {
-	  HTBprintf(&command, "Accept-Language: %s%c%c", language, CR, LF);
-      }
-
-      if (pref_charset && *pref_charset) {
-	  BStrCat0(command, "Accept-Charset: ");
-	  StrAllocCopy(linebuf, pref_charset);
-	  if (linebuf[strlen(linebuf)-1] == ',')
-	      linebuf[strlen(linebuf)-1] = '\0';
-	  LYLowerCase(linebuf);
-	  if (strstr(linebuf, "iso-8859-1") == NULL)
-	      StrAllocCat(linebuf, ", iso-8859-1;q=0.01");
-	  if (strstr(linebuf, "us-ascii") == NULL)
-	      StrAllocCat(linebuf, ", us-ascii;q=0.01");
-	  BStrCat0(command, linebuf);
-	  HTBprintf(&command, "%c%c", CR, LF);
-      }
+	    if (list != 0) {
+		HTBprintf(&command, "Accept-Encoding: %s%c%c", list, CR, LF);
+		free(list);
+	    }
+	}
+
+	if (language && *language) {
+	    HTBprintf(&command, "Accept-Language: %s%c%c", language, CR, LF);
+	}
 
+	if (pref_charset && *pref_charset) {
+	    BStrCat0(command, "Accept-Charset: ");
+	    StrAllocCopy(linebuf, pref_charset);
+	    if (linebuf[strlen(linebuf) - 1] == ',')
+		linebuf[strlen(linebuf) - 1] = '\0';
+	    LYLowerCase(linebuf);
+	    if (strstr(linebuf, "iso-8859-1") == NULL)
+		StrAllocCat(linebuf, ", iso-8859-1;q=0.01");
+	    if (strstr(linebuf, "us-ascii") == NULL)
+		StrAllocCat(linebuf, ", us-ascii;q=0.01");
+	    BStrCat0(command, linebuf);
+	    HTBprintf(&command, "%c%c", CR, LF);
+	}
 #if 0
-      /*
-      **  Promote 300 (Multiple Choices) replies, if supported,
-      **  over 406 (Not Acceptable) replies. - FM
-      **
-      **  This used to be done in versions 2.7 and 2.8*, but violates
-      **  the specs for transparent content negotiation and has the
-      **  effect that servers supporting those specs will send 300
-      **  (Multiple Choices) instead of a normal response (e.g. 200 OK),
-      **  since they will assume that the client wants to make the
-      **  choice.  It is not clear whether there are any servers or sites
-      **  for which sending this header really improves anything.
-      **
-      **  If there ever is a need to send "Negotiate: trans" and really
-      **  mean it, we should send "Negotiate: trans,trans" or similar,
-      **  since that is semantically equivalent and some servers may
-      **  ignore "Negotiate: trans" as a special case when it comes from
-      **  Lynx (to work around the old faulty behavior). - kw
-      **
-      **  References:
-      **  RFC 2295 (see also RFC 2296), and mail to lynx-dev and
-      **  new-httpd@apache.org from Koen Holtman, Jan 1999.
-      */
-      if (!do_post) {
-	  HTBprintf(&command, "Negotiate: trans%c%c", CR, LF);
-      }
+	/*
+	 * Promote 300 (Multiple Choices) replies, if supported, over 406 (Not
+	 * Acceptable) replies.  - FM
+	 *
+	 * This used to be done in versions 2.7 and 2.8*, but violates the
+	 * specs for transparent content negotiation and has the effect that
+	 * servers supporting those specs will send 300 (Multiple Choices)
+	 * instead of a normal response (e.g.  200 OK), since they will assume
+	 * that the client wants to make the choice.  It is not clear whether
+	 * there are any servers or sites for which sending this header really
+	 * improves anything.
+	 *
+	 * If there ever is a need to send "Negotiate:  trans" and really mean
+	 * it, we should send "Negotiate:  trans,trans" or similar, since that
+	 * is semantically equivalent and some servers may ignore "Negotiate: 
+	 * trans" as a special case when it comes from Lynx (to work around the
+	 * old faulty behavior).  - kw
+	 *
+	 * References:
+	 * RFC 2295 (see also RFC 2296), and mail to lynx-dev and
+	 * new-httpd@apache.org from Koen Holtman, Jan 1999.
+	 */
+	if (!do_post) {
+	    HTBprintf(&command, "Negotiate: trans%c%c", CR, LF);
+	}
 #endif /* 0 */
 
-      /*
-      **  When reloading give no-cache pragma to proxy server to make
-      **  it refresh its cache. -- Ari L. <luotonen@dxcern.cern.ch>
-      **
-      **  Also send it as a Cache-Control header for HTTP/1.1. - FM
-      */
-      if (reloading) {
-	  HTBprintf(&command, "Pragma: no-cache%c%c", CR, LF);
-	  HTBprintf(&command, "Cache-Control: no-cache%c%c", CR, LF);
-      }
-
-      if (LYUserAgent && *LYUserAgent) {
-	  char *cp = LYSkipBlanks(LYUserAgent);
-	  /* Won't send it at all if all blank - kw */
-	  if (*cp != '\0')
-	      HTBprintf(&command, "User-Agent: %.*s%c%c",
-		      INIT_LINE_SIZE-15, LYUserAgent, CR, LF);
-      } else {
-	  HTBprintf(&command, "User-Agent: %s/%s  libwww-FM/%s%c%c",
-		  HTAppName ? HTAppName : "unknown",
-		  HTAppVersion ? HTAppVersion : "0.0",
-		  HTLibraryVersion, CR, LF);
-      }
-
-      if (personal_mail_address && !LYNoFromHeader) {
-	  HTBprintf(&command, "From: %s%c%c", personal_mail_address, CR,LF);
-      }
-
-      if (!(LYUserSpecifiedURL ||
-	    LYNoRefererHeader || LYNoRefererForThis) &&
-	  strcmp(HTLoadedDocumentURL(), "")) {
-	  char *cp = LYRequestReferer;
-	  if (!cp) cp = HTLoadedDocumentURL(); /* @@@ Try both? - kw */
-	  BStrCat0(command, "Referer: ");
-	  if (isLYNXIMGMAP(cp)) {
-	      char *cp1 = trimPoundSelector(cp);
-	      BStrCat0(command, cp + LEN_LYNXIMGMAP);
-	      restorePoundSelector(cp1);
-	  } else {
-	      BStrCat0(command, cp);
-	  }
-	  HTBprintf(&command, "%c%c", CR, LF);
-      }
-
-      {
-	char *abspath;
-	char *docname;
-	char *hostname;
-	char *colon;
-	int portnumber;
-	char *auth, *cookie = NULL;
-	BOOL secure = (BOOL) (strncmp(anAnchor->address, "https", 5) ?
-							FALSE : TRUE);
-
-	abspath = HTParse(arg, "", PARSE_PATH|PARSE_PUNCTUATION);
-	docname = HTParse(arg, "", PARSE_PATH);
-	hostname = HTParse(arg, "", PARSE_HOST);
-	if (hostname &&
-	    NULL != (colon = strchr(hostname, ':'))) {
-	    *(colon++) = '\0';	/* Chop off port number */
-	    portnumber = atoi(colon);
-	} else if (!strncmp(arg, "https", 5)) {
-	    portnumber = HTTPS_PORT;
-	} else	{
-	    portnumber = HTTP_PORT;
+	/*
+	 * When reloading give no-cache pragma to proxy server to make it
+	 * refresh its cache.  -- Ari L.  <luotonen@dxcern.cern.ch>
+	 *
+	 * Also send it as a Cache-Control header for HTTP/1.1.  - FM
+	 */
+	if (reloading) {
+	    HTBprintf(&command, "Pragma: no-cache%c%c", CR, LF);
+	    HTBprintf(&command, "Cache-Control: no-cache%c%c", CR, LF);
 	}
 
-	/*
-	**  Add Authorization, Proxy-Authorization,
-	**  and/or Cookie headers, if applicable.
-	*/
-	if (using_proxy) {
+	if (LYUserAgent && *LYUserAgent) {
+	    char *cp = LYSkipBlanks(LYUserAgent);
+
+	    /* Won't send it at all if all blank - kw */
+	    if (*cp != '\0')
+		HTBprintf(&command, "User-Agent: %.*s%c%c",
+			  INIT_LINE_SIZE - 15, LYUserAgent, CR, LF);
+	} else {
+	    HTBprintf(&command, "User-Agent: %s/%s  libwww-FM/%s%c%c",
+		      HTAppName ? HTAppName : "unknown",
+		      HTAppVersion ? HTAppVersion : "0.0",
+		      HTLibraryVersion, CR, LF);
+	}
+
+	if (personal_mail_address && !LYNoFromHeader) {
+	    HTBprintf(&command, "From: %s%c%c", personal_mail_address, CR, LF);
+	}
+
+	if (!(LYUserSpecifiedURL ||
+	      LYNoRefererHeader || LYNoRefererForThis) &&
+	    strcmp(HTLoadedDocumentURL(), "")) {
+	    char *cp = LYRequestReferer;
+
+	    if (!cp)
+		cp = HTLoadedDocumentURL();	/* @@@ Try both? - kw */
+	    BStrCat0(command, "Referer: ");
+	    if (isLYNXIMGMAP(cp)) {
+		char *cp1 = trimPoundSelector(cp);
+
+		BStrCat0(command, cp + LEN_LYNXIMGMAP);
+		restorePoundSelector(cp1);
+	    } else {
+		BStrCat0(command, cp);
+	    }
+	    HTBprintf(&command, "%c%c", CR, LF);
+	} {
+	    char *abspath;
+	    char *docname;
+	    char *hostname;
+	    char *colon;
+	    int portnumber;
+	    char *auth, *cookie = NULL;
+	    BOOL secure = (BOOL) (strncmp(anAnchor->address, "https", 5) ?
+				  FALSE : TRUE);
+
+	    abspath = HTParse(arg, "", PARSE_PATH | PARSE_PUNCTUATION);
+	    docname = HTParse(arg, "", PARSE_PATH);
+	    hostname = HTParse(arg, "", PARSE_HOST);
+	    if (hostname &&
+		NULL != (colon = strchr(hostname, ':'))) {
+		*(colon++) = '\0';	/* Chop off port number */
+		portnumber = atoi(colon);
+	    } else if (!strncmp(arg, "https", 5)) {
+		portnumber = HTTPS_PORT;
+	    } else {
+		portnumber = HTTP_PORT;
+	    }
+
 	    /*
-	    **	If we are using a proxy, first determine if
-	    **	we should include an Authorization header
-	    **	and/or Cookie header for the ultimate target
-	    **	of this request. - FM & AJL
-	    */
-	    char *host2 = NULL, *path2 = NULL;
-	    int port2 = (strncmp(docname, "https", 5) ?
-					   HTTP_PORT : HTTPS_PORT);
-	    host2 = HTParse(docname, "", PARSE_HOST);
-	    path2 = HTParse(docname, "", PARSE_PATH|PARSE_PUNCTUATION);
-	    if (host2) {
-		if ((colon = strchr(host2, ':')) != NULL) {
-		    /* Use non-default port number */
-		    *colon = '\0';
-		    colon++;
-		    port2 = atoi(colon);
+	     * Add Authorization, Proxy-Authorization, and/or Cookie headers,
+	     * if applicable.
+	     */
+	    if (using_proxy) {
+		/*
+		 * If we are using a proxy, first determine if we should
+		 * include an Authorization header and/or Cookie header for the
+		 * ultimate target of this request.  - FM & AJL
+		 */
+		char *host2 = NULL, *path2 = NULL;
+		int port2 = (strncmp(docname, "https", 5) ?
+			     HTTP_PORT : HTTPS_PORT);
+
+		host2 = HTParse(docname, "", PARSE_HOST);
+		path2 = HTParse(docname, "", PARSE_PATH | PARSE_PUNCTUATION);
+		if (host2) {
+		    if ((colon = strchr(host2, ':')) != NULL) {
+			/* Use non-default port number */
+			*colon = '\0';
+			colon++;
+			port2 = atoi(colon);
+		    }
 		}
+		/*
+		 * This composeAuth() does file access, i.e., for the ultimate
+		 * target of the request.  - AJL
+		 */
+		auth_proxy = NO;
+		if ((auth = HTAA_composeAuth(host2, port2, path2,
+					     auth_proxy)) != NULL &&
+		    *auth != '\0') {
+		    /*
+		     * If auth is not NULL nor zero-length, it's an
+		     * Authorization header to be included.  - FM
+		     */
+		    HTBprintf(&command, "%s%c%c", auth, CR, LF);
+		    CTRACE((tfp, "HTTP: Sending authorization: %s\n", auth));
+		} else if (auth && *auth == '\0') {
+		    /*
+		     * If auth is a zero-length string, the user either
+		     * cancelled or goofed at the username and password prompt. 
+		     * - FM
+		     */
+		    if (!(traversal || dump_output_immediately) &&
+			HTConfirm(CONFIRM_WO_PASSWORD)) {
+			show_401 = TRUE;
+		    } else {
+			if (traversal || dump_output_immediately)
+			    HTAlert(FAILED_NEED_PASSWD);
+#ifdef USE_SSL
+			if (did_connect)
+			    HTTP_NETCLOSE(s, handle);
+#endif /* USE_SSL */
+			BStrFree(command);
+			FREE(hostname);
+			FREE(docname);
+			FREE(abspath);
+			FREE(host2);
+			FREE(path2);
+			status = HT_NOT_LOADED;
+			goto done;
+		    }
+		} else {
+		    CTRACE((tfp, "HTTP: Not sending authorization (yet).\n"));
+		}
+		/*
+		 * Add 'Cookie:' header, if it's HTTP or HTTPS document being
+		 * proxied.
+		 */
+		if (!strncmp(docname, "http", 4)) {
+		    cookie = LYAddCookieHeader(host2, path2, port2, secure);
+		}
+		FREE(host2);
+		FREE(path2);
+		/*
+		 * The next composeAuth() will be for the proxy.  - AJL
+		 */
+		auth_proxy = YES;
+	    } else {
+		/*
+		 * Add cookie for a non-proxied request.  - FM
+		 */
+		cookie = LYAddCookieHeader(hostname, abspath, portnumber, secure);
+		auth_proxy = NO;
 	    }
 	    /*
-	    **	This composeAuth() does file access, i.e., for
-	    **	the ultimate target of the request. - AJL
-	    */
-	    auth_proxy = NO;
-	    if ((auth = HTAA_composeAuth(host2, port2, path2,
+	     * If we do have a cookie set, add it to the request buffer.  - FM
+	     */
+	    if (cookie != NULL) {
+		if (*cookie != '$') {
+		    /*
+		     * It's a historical cookie, so signal to the server that
+		     * we support modern cookies.  - FM
+		     */
+		    BStrCat0(command, "Cookie2: $Version=\"1\"");
+		    BStrCat0(command, crlf);
+		    CTRACE((tfp, "HTTP: Sending Cookie2: $Version =\"1\"\n"));
+		}
+		if (*cookie != '\0') {
+		    /*
+		     * It's not a zero-length string, so add the header.  Note
+		     * that any folding of long strings has been done already
+		     * in LYCookie.c.  - FM
+		     */
+		    BStrCat0(command, "Cookie: ");
+		    BStrCat0(command, cookie);
+		    BStrCat0(command, crlf);
+		    CTRACE((tfp, "HTTP: Sending Cookie: %s\n", cookie));
+		}
+		FREE(cookie);
+	    }
+	    FREE(abspath);
+
+	    /*
+	     * If we are using a proxy, auth_proxy should be YES, and we check
+	     * here whether we want a Proxy-Authorization header for it.  If we
+	     * are not using a proxy, auth_proxy should still be NO, and we
+	     * check here for whether we want an Authorization header.  - FM &
+	     * AJL
+	     */
+	    if ((auth = HTAA_composeAuth(hostname,
+					 portnumber,
+					 docname,
 					 auth_proxy)) != NULL &&
 		*auth != '\0') {
 		/*
-		**  If auth is not NULL nor zero-length, it's
-		**  an Authorization header to be included. - FM
-		*/
+		 * If auth is not NULL nor zero-length, it's an Authorization
+		 * or Proxy-Authorization header to be included.  - FM
+		 */
 		HTBprintf(&command, "%s%c%c", auth, CR, LF);
-		CTRACE((tfp, "HTTP: Sending authorization: %s\n", auth));
+		CTRACE((tfp, (auth_proxy ?
+			      "HTTP: Sending proxy authorization: %s\n" :
+			      "HTTP: Sending authorization: %s\n"),
+			auth));
 	    } else if (auth && *auth == '\0') {
 		/*
-		**  If auth is a zero-length string, the user either
-		**  cancelled or goofed at the username and password
-		**  prompt. - FM
-		*/
-		if (!(traversal || dump_output_immediately) &&
-			HTConfirm(CONFIRM_WO_PASSWORD)) {
-		    show_401 = TRUE;
+		 * If auth is a zero-length string, the user either cancelled
+		 * or goofed at the username and password prompt.  - FM
+		 */
+		if (!(traversal || dump_output_immediately) && HTConfirm(CONFIRM_WO_PASSWORD)) {
+		    if (auth_proxy == TRUE) {
+			show_407 = TRUE;
+		    } else {
+			show_401 = TRUE;
+		    }
 		} else {
 		    if (traversal || dump_output_immediately)
 			HTAlert(FAILED_NEED_PASSWD);
-#ifdef USE_SSL
-		    if (did_connect)
-			HTTP_NETCLOSE(s, handle);
-#endif /* USE_SSL */
 		    BStrFree(command);
 		    FREE(hostname);
 		    FREE(docname);
-		    FREE(abspath);
-		    FREE(host2);
-		    FREE(path2);
 		    status = HT_NOT_LOADED;
 		    goto done;
 		}
 	    } else {
-		CTRACE((tfp, "HTTP: Not sending authorization (yet).\n"));
-	    }
-	    /*
-	    **	Add 'Cookie:' header, if it's HTTP or HTTPS
-	    **	document being proxied.
-	    */
-	    if (!strncmp(docname, "http", 4)) {
-		cookie = LYAddCookieHeader(host2, path2, port2, secure);
-	    }
-	    FREE(host2);
-	    FREE(path2);
-	    /*
-	    **	The next composeAuth() will be for the proxy. - AJL
-	    */
-	    auth_proxy = YES;
-	} else {
-	    /*
-	    **	Add cookie for a non-proxied request. - FM
-	    */
-	    cookie = LYAddCookieHeader(hostname, abspath, portnumber, secure);
-	    auth_proxy = NO;
-	}
-	/*
-	**  If we do have a cookie set, add it to the request buffer. - FM
-	*/
-	if (cookie != NULL) {
-	    if (*cookie != '$') {
-		/*
-		**  It's a historical cookie, so signal to the
-		**  server that we support modern cookies. - FM
-		*/
-		BStrCat0(command, "Cookie2: $Version=\"1\"");
-		BStrCat0(command, crlf);
-		CTRACE((tfp, "HTTP: Sending Cookie2: $Version =\"1\"\n"));
-	    }
-	    if (*cookie != '\0') {
-		/*
-		**  It's not a zero-length string, so add the header.
-		**  Note that any folding of long strings has been
-		**  done already in LYCookie.c. - FM
-		*/
-		BStrCat0(command, "Cookie: ");
-		BStrCat0(command, cookie);
-		BStrCat0(command, crlf);
-		CTRACE((tfp, "HTTP: Sending Cookie: %s\n", cookie));
-	    }
-	    FREE(cookie);
-	}
-	FREE(abspath);
-
-	/*
-	**  If we are using a proxy, auth_proxy should be YES, and
-	**  we check here whether we want a Proxy-Authorization header
-	**  for it.  If we are not using a proxy, auth_proxy should
-	**  still be NO, and we check here for whether we want an
-	**  Authorization header. - FM & AJL
-	*/
-	if ((auth = HTAA_composeAuth(hostname,
-				     portnumber,
-				     docname,
-				     auth_proxy)) != NULL &&
-	    *auth != '\0') {
-	    /*
-	    **	If auth is not NULL nor zero-length, it's
-	    **	an Authorization or Proxy-Authorization
-	    **	header to be included. - FM
-	    */
-	    HTBprintf(&command, "%s%c%c", auth, CR, LF);
-	    CTRACE((tfp, (auth_proxy ?
-			 "HTTP: Sending proxy authorization: %s\n" :
-			 "HTTP: Sending authorization: %s\n"),
-			auth));
-	} else if (auth && *auth == '\0') {
-	    /*
-	    **	If auth is a zero-length string, the user either
-	    **	cancelled or goofed at the username and password
-	    **	prompt. - FM
-	    */
-	    if (!(traversal || dump_output_immediately) && HTConfirm(CONFIRM_WO_PASSWORD)) {
-		if (auth_proxy == TRUE) {
-		    show_407 = TRUE;
-		} else {
-		    show_401 = TRUE;
-		}
-	    } else {
-		if (traversal || dump_output_immediately)
-		    HTAlert(FAILED_NEED_PASSWD);
-		BStrFree(command);
-		FREE(hostname);
-		FREE(docname);
-		status = HT_NOT_LOADED;
-		goto done;
+		CTRACE((tfp, (auth_proxy ?
+			      "HTTP: Not sending proxy authorization (yet).\n" :
+			      "HTTP: Not sending authorization (yet).\n")));
 	    }
-	} else {
-	    CTRACE((tfp, (auth_proxy ?
-			 "HTTP: Not sending proxy authorization (yet).\n" :
-			 "HTTP: Not sending authorization (yet).\n")));
+	    FREE(hostname);
+	    FREE(docname);
 	}
-	FREE(hostname);
-	FREE(docname);
-      }
-      auth_proxy = NO;
-  }
+	auth_proxy = NO;
+    }
 
     if (
 #ifdef USE_SSL
-	!do_connect &&
+	   !do_connect &&
 #endif /* USE_SSL */
-	do_post) {
+	   do_post) {
 	CTRACE((tfp, "HTTP: Doing post, content-type '%s'\n",
-		     anAnchor->post_content_type
-		     ? anAnchor->post_content_type
-		     : "lose"));
+		anAnchor->post_content_type
+		? anAnchor->post_content_type
+		: "lose"));
 	HTBprintf(&command, "Content-type: %s%c%c",
-		   anAnchor->post_content_type
-		   ? anAnchor->post_content_type
-		   : "lose",
+		  anAnchor->post_content_type
+		  ? anAnchor->post_content_type
+		  : "lose",
 		  CR, LF);
 
 	HTBprintf(&command, "Content-length: %d%c%c",
 		  !isBEmpty(anAnchor->post_data)
-		   ? BStrLen(anAnchor->post_data)
-		   : 0,
+		  ? BStrLen(anAnchor->post_data)
+		  : 0,
 		  CR, LF);
 
 	BStrCat0(command, crlf);	/* Blank line means "end" of headers */
 
 	BStrCat(command, anAnchor->post_data);
-    }
-    else
+    } else
 	BStrCat0(command, crlf);	/* Blank line means "end" of headers */
 
     if (TRACE) {
@@ -1080,702 +1080,748 @@ use_tunnel:
 	trace_bstring(command);
 #ifdef USE_SSL
 	CTRACE((tfp, "%s",
-	       (anAnchor->post_data && !do_connect ? crlf : "")));
+		(anAnchor->post_data && !do_connect ? crlf : "")));
 #else
 	CTRACE((tfp, "%s",
-	       (anAnchor->post_data ? crlf : "")));
+		(anAnchor->post_data ? crlf : "")));
 #endif /* USE_SSL */
 	CTRACE((tfp, "----------------------------------\n"));
     }
 
-  _HTProgress (gettext("Sending HTTP request."));
+    _HTProgress(gettext("Sending HTTP request."));
 
-#ifdef    NOT_ASCII  /* S/390 -- gil -- 0548 */
-  {   char *p;
+#ifdef    NOT_ASCII		/* S/390 -- gil -- 0548 */
+    {
+	char *p;
 
-      for ( p = BStrData(command); p < BStrData(command) + BStrLen(command); p++ )
-	  *p = TOASCII(*p);
-  }
+	for (p = BStrData(command);
+	     p < BStrData(command) + BStrLen(command);
+	     p++)
+	    *p = TOASCII(*p);
+    }
 #endif /* NOT_ASCII */
-  status = HTTP_NETWRITE(s, BStrData(command), BStrLen(command), handle);
-  BStrFree(command);
-  FREE(linebuf);
-  if (status <= 0) {
-      if (status == 0) {
-	  CTRACE((tfp, "HTTP: Got status 0 in initial write\n"));
-	  /* Do nothing. */
-      } else if ((SOCKET_ERRNO == ENOTCONN ||
-		  SOCKET_ERRNO == ECONNRESET ||
-		  SOCKET_ERRNO == EPIPE) &&
-		 !already_retrying &&
-		 /* Don't retry if we're posting. */ !do_post) {
+    status = HTTP_NETWRITE(s, BStrData(command), BStrLen(command), handle);
+    BStrFree(command);
+    FREE(linebuf);
+    if (status <= 0) {
+	if (status == 0) {
+	    CTRACE((tfp, "HTTP: Got status 0 in initial write\n"));
+	    /* Do nothing. */
+	} else if ((SOCKET_ERRNO == ENOTCONN ||
+		    SOCKET_ERRNO == ECONNRESET ||
+		    SOCKET_ERRNO == EPIPE) &&
+		   !already_retrying &&
+	    /* Don't retry if we're posting. */ !do_post) {
 	    /*
-	    **	Arrrrgh, HTTP 0/1 compatibility problem, maybe.
-	    */
-	    CTRACE((tfp, "HTTP: BONZO ON WRITE Trying again with HTTP0 request.\n"));
-	    _HTProgress (RETRYING_AS_HTTP0);
+	     * Arrrrgh, HTTP 0/1 compatibility problem, maybe.
+	     */
+	    CTRACE((tfp,
+		    "HTTP: BONZO ON WRITE Trying again with HTTP0 request.\n"));
+	    _HTProgress(RETRYING_AS_HTTP0);
 	    HTTP_NETCLOSE(s, handle);
 	    extensions = NO;
 	    already_retrying = TRUE;
 	    goto try_again;
-      } else {
-	  CTRACE((tfp, "HTTP: Hit unexpected network WRITE error; aborting connection.\n"));
-	  HTTP_NETCLOSE(s, handle);
-	  status = -1;
-	  HTAlert(gettext("Unexpected network write error; connection aborted."));
-	  goto done;
-      }
-  }
-
-  CTRACE((tfp, "HTTP: WRITE delivered OK\n"));
-  _HTProgress (gettext("HTTP request sent; waiting for response."));
-
-  /*	Read the first line of the response
-  **	-----------------------------------
-  */
-  {
-    /* Get numeric status etc */
-    BOOL end_of_file = NO;
-    int buffer_length = INIT_LINE_SIZE;
-
-    line_buffer = typecallocn(char, buffer_length);
-    if (line_buffer == NULL)
-	outofmem(__FILE__, "HTLoadHTTP");
-
-    HTReadProgress (bytes_already_read = 0, 0);
-    do {/* Loop to read in the first line */
-	/*
-	**  Extend line buffer if necessary for those crazy WAIS URLs ;-)
-	*/
-	if (buffer_length - length < LINE_EXTEND_THRESH) {
-	    buffer_length = buffer_length + buffer_length;
-	    line_buffer =
-	      (char *)realloc(line_buffer, (buffer_length * sizeof(char)));
-	    if (line_buffer == NULL)
-		outofmem(__FILE__, "HTLoadHTTP");
+	} else {
+	    CTRACE((tfp,
+		    "HTTP: Hit unexpected network WRITE error; aborting connection.\n"));
+	    HTTP_NETCLOSE(s, handle);
+	    status = -1;
+	    HTAlert(gettext("Unexpected network write error; connection aborted."));
+	    goto done;
 	}
-	CTRACE((tfp, "HTTP: Trying to read %d\n", buffer_length - length - 1));
-	status = HTTP_NETREAD(s, line_buffer + length,
-			      buffer_length - length - 1, handle);
-	CTRACE((tfp, "HTTP: Read %d\n", status));
-	if (status <= 0) {
+    }
+
+    CTRACE((tfp, "HTTP: WRITE delivered OK\n"));
+    _HTProgress(gettext("HTTP request sent; waiting for response."));
+
+    /*    Read the first line of the response
+     * -----------------------------------
+     */
+    {
+	/* Get numeric status etc */
+	BOOL end_of_file = NO;
+	int buffer_length = INIT_LINE_SIZE;
+
+	line_buffer = typecallocn(char, buffer_length);
+
+	if (line_buffer == NULL)
+	    outofmem(__FILE__, "HTLoadHTTP");
+
+	HTReadProgress(bytes_already_read = 0, 0);
+	do {			/* Loop to read in the first line */
 	    /*
-	     *	Retry if we get nothing back too.
-	     *	Bomb out if we get nothing twice.
+	     * Extend line buffer if necessary for those crazy WAIS URLs ;-)
 	     */
-	    if (status == HT_INTERRUPTED) {
-		CTRACE((tfp, "HTTP: Interrupted initial read.\n"));
-		_HTProgress (CONNECTION_INTERRUPTED);
-		HTTP_NETCLOSE(s, handle);
-		status = HT_NO_DATA;
-		goto clean_up;
-	    } else if  (status < 0 &&
-			(SOCKET_ERRNO == ENOTCONN ||
-#ifdef _WINDOWS	/* 1997/11/09 (Sun) 16:59:58 */
-			 SOCKET_ERRNO == ETIMEDOUT ||
-#endif
-			 SOCKET_ERRNO == ECONNRESET ||
-			 SOCKET_ERRNO == EPIPE) &&
-			!already_retrying && !do_post) {
-		/*
-		**  Arrrrgh, HTTP 0/1 compability problem, maybe.
-		*/
-		CTRACE((tfp, "HTTP: BONZO Trying again with HTTP0 request.\n"));
-		HTTP_NETCLOSE(s, handle);
-		FREE(line_buffer);
-		FREE(line_kept_clean);
+	    if (buffer_length - length < LINE_EXTEND_THRESH) {
+		buffer_length = buffer_length + buffer_length;
+		line_buffer =
+		    (char *) realloc(line_buffer, (buffer_length * sizeof(char)));
 
-		extensions = NO;
-		already_retrying = TRUE;
-		_HTProgress (RETRYING_AS_HTTP0);
-		goto try_again;
-	    } else {
-		CTRACE((tfp, "HTTP: Hit unexpected network read error; aborting connection; status %d.\n",
-			   status));
-		HTAlert(gettext("Unexpected network read error; connection aborted."));
-		HTTP_NETCLOSE(s, handle);
-		status = -1;
-		goto clean_up;
+		if (line_buffer == NULL)
+		    outofmem(__FILE__, "HTLoadHTTP");
 	    }
-	}
+	    CTRACE((tfp, "HTTP: Trying to read %d\n", buffer_length - length - 1));
+	    status = HTTP_NETREAD(s, line_buffer + length,
+				  buffer_length - length - 1, handle);
+	    CTRACE((tfp, "HTTP: Read %d\n", status));
+	    if (status <= 0) {
+		/*
+		 * Retry if we get nothing back too.
+		 * Bomb out if we get nothing twice.
+		 */
+		if (status == HT_INTERRUPTED) {
+		    CTRACE((tfp, "HTTP: Interrupted initial read.\n"));
+		    _HTProgress(CONNECTION_INTERRUPTED);
+		    HTTP_NETCLOSE(s, handle);
+		    status = HT_NO_DATA;
+		    goto clean_up;
+		} else if (status < 0 &&
+			   (SOCKET_ERRNO == ENOTCONN ||
+#ifdef _WINDOWS			/* 1997/11/09 (Sun) 16:59:58 */
+			    SOCKET_ERRNO == ETIMEDOUT ||
+#endif
+			    SOCKET_ERRNO == ECONNRESET ||
+			    SOCKET_ERRNO == EPIPE) &&
+			   !already_retrying && !do_post) {
+		    /*
+		     * Arrrrgh, HTTP 0/1 compability problem, maybe.
+		     */
+		    CTRACE((tfp,
+			    "HTTP: BONZO Trying again with HTTP0 request.\n"));
+		    HTTP_NETCLOSE(s, handle);
+		    FREE(line_buffer);
+		    FREE(line_kept_clean);
 
-#ifdef    NOT_ASCII  /* S/390 -- gil -- 0564 */
-	{   char *p;
+		    extensions = NO;
+		    already_retrying = TRUE;
+		    _HTProgress(RETRYING_AS_HTTP0);
+		    goto try_again;
+		} else {
+		    CTRACE((tfp,
+			    "HTTP: Hit unexpected network read error; aborting connection; status %d.\n",
+			    status));
+		    HTAlert(gettext("Unexpected network read error; connection aborted."));
+		    HTTP_NETCLOSE(s, handle);
+		    status = -1;
+		    goto clean_up;
+		}
+	    }
+#ifdef    NOT_ASCII		/* S/390 -- gil -- 0564 */
+	    {
+		char *p;
 
-	    for ( p = line_buffer + length; p < line_buffer + length + status; p++ )
-		*p = FROMASCII(*p);
-	}
+		for (p = line_buffer + length;
+		     p < line_buffer + length + status;
+		     p++)
+		    *p = FROMASCII(*p);
+	    }
 #endif /* NOT_ASCII */
 
-	bytes_already_read += status;
-	HTReadProgress (bytes_already_read, 0);
+	    bytes_already_read += status;
+	    HTReadProgress(bytes_already_read, 0);
 
-#ifdef UCX  /* UCX returns -1 on EOF */
-	if (status == 0 || status == -1)
+#ifdef UCX			/* UCX returns -1 on EOF */
+	    if (status == 0 || status == -1)
 #else
-	if (status == 0)
+	    if (status == 0)
 #endif
-	{
-	    end_of_file = YES;
-	    break;
-	}
-	line_buffer[length+status] = 0;
-
-	if (line_buffer) {
-	    FREE(line_kept_clean);
-	    line_kept_clean = (char *)malloc(buffer_length * sizeof(char));
-	    if (line_kept_clean == NULL)
-		outofmem(__FILE__, "HTLoadHTTP");
-	    memcpy(line_kept_clean, line_buffer, buffer_length);
-	    real_length_of_line = length + status;
+	    {
+		end_of_file = YES;
+		break;
+	    }
+	    line_buffer[length + status] = 0;
+
+	    if (line_buffer) {
+		FREE(line_kept_clean);
+		line_kept_clean = (char *) malloc(buffer_length * sizeof(char));
+
+		if (line_kept_clean == NULL)
+		    outofmem(__FILE__, "HTLoadHTTP");
+		memcpy(line_kept_clean, line_buffer, buffer_length);
+		real_length_of_line = length + status;
+	    }
+
+	    eol = strchr(line_buffer + length, LF);
+	    /* Do we *really* want to do this? */
+	    if (eol && eol != line_buffer && *(eol - 1) == CR)
+		*(eol - 1) = ' ';
+
+	    length = length + status;
+
+	    /* Do we really want to do *this*? */
+	    if (eol)
+		*eol = 0;	/* Terminate the line */
 	}
+	/* All we need is the first line of the response.  If it's a HTTP/1.0
+	 * response, then the first line will be absurdly short and therefore
+	 * we can safely gate the number of bytes read through this code (as
+	 * opposed to below) to ~1000.
+	 *
+	 * Well, let's try 100.
+	 */
+	while (!eol && !end_of_file && bytes_already_read < 100);
+    }				/* Scope of loop variables */
 
-	eol = strchr(line_buffer + length, LF);
-	/* Do we *really* want to do this? */
-	if (eol && eol != line_buffer && *(eol-1) == CR)
-	    *(eol-1) = ' ';
+    /* save total length, in case we decide later to show it all - kw */
+    rawlength = length;
 
-	length = length + status;
+    /*    We now have a terminated unfolded line.  Parse it.
+     * --------------------------------------------------
+     */
+    CTRACE((tfp, "HTTP: Rx: %s\n", line_buffer));
+
+    /*
+     * Kludge to work with old buggy servers and the VMS Help gateway.  They
+     * can't handle the third word, so we try again without it.
+     */
+    if (extensions &&		/* Old buggy server or Help gateway? */
+	(0 == strncmp(line_buffer, "<TITLE>Bad File Request</TITLE>", 31) ||
+	 0 == strncmp(line_buffer, "Address should begin with", 25) ||
+	 0 == strncmp(line_buffer, "<TITLE>Help ", 12) ||
+	 0 == strcmp(line_buffer,
+		     "Document address invalid or access not authorised"))) {
+	FREE(line_buffer);
+	FREE(line_kept_clean);
+	extensions = NO;
+	already_retrying = TRUE;
+	CTRACE((tfp, "HTTP: close socket %d to retry with HTTP0\n", s));
+	HTTP_NETCLOSE(s, handle);
+	/* print a progress message */
+	_HTProgress(RETRYING_AS_HTTP0);
+	goto try_again;
+    } {
+	int fields;
+	char server_version[VERSION_LENGTH + 1];
+
+	server_version[0] = 0;
+
+	fields = sscanf(line_buffer, "%20s %d",
+			server_version,
+			&server_status);
+
+	CTRACE((tfp, "HTTP: Scanned %d fields from line_buffer\n", fields));
+
+	if (http_error_file) {	/* Make the status code externally available */
+	    FILE *error_file;
 
-	/* Do we really want to do *this*? */
-	if (eol)
-	    *eol = 0;		/* Terminate the line */
-    }
-    /*	All we need is the first line of the response.	If it's a HTTP/1.0
-    **	response, then the first line will be absurdly short and therefore
-    **	we can safely gate the number of bytes read through this code
-    **	(as opposed to below) to ~1000.
-    **
-    **	Well, let's try 100.
-    */
-    while (!eol && !end_of_file && bytes_already_read < 100);
-  } /* Scope of loop variables */
-
-  /* save total length, in case we decide later to show it all - kw */
-  rawlength = length;
-
-  /*	We now have a terminated unfolded line.  Parse it.
-  **	--------------------------------------------------
-  */
-  CTRACE((tfp, "HTTP: Rx: %s\n", line_buffer));
-
-  /*
-  **  Kludge to work with old buggy servers and the VMS Help gateway.
-  **  They can't handle the third word, so we try again without it.
-  */
-  if (extensions &&	  /* Old buggy server or Help gateway? */
-      (0==strncmp(line_buffer,"<TITLE>Bad File Request</TITLE>",31) ||
-       0==strncmp(line_buffer,"Address should begin with",25) ||
-       0==strncmp(line_buffer,"<TITLE>Help ",12) ||
-       0==strcmp(line_buffer,
-		 "Document address invalid or access not authorised"))) {
-      FREE(line_buffer);
-      FREE(line_kept_clean);
-      extensions = NO;
-      already_retrying = TRUE;
-      CTRACE((tfp, "HTTP: close socket %d to retry with HTTP0\n", s));
-      HTTP_NETCLOSE(s, handle);
-      /* print a progress message */
-      _HTProgress (RETRYING_AS_HTTP0);
-      goto try_again;
-  }
-
-
-  {
-    int fields;
-    char server_version[VERSION_LENGTH+1];
-
-    server_version[0] = 0;
-
-    fields = sscanf(line_buffer, "%20s %d",
-		    server_version,
-		    &server_status);
-
-    CTRACE((tfp, "HTTP: Scanned %d fields from line_buffer\n", fields));
-
-    if (http_error_file) {     /* Make the status code externally available */
-	FILE *error_file;
 #ifdef SERVER_STATUS_ONLY
-	error_file = fopen(http_error_file, TXT_W);
-	if (error_file) {		/* Managed to open the file */
-	    fprintf(error_file, "error=%d\n", server_status);
-	    fclose(error_file);
-	}
+	    error_file = fopen(http_error_file, TXT_W);
+	    if (error_file) {	/* Managed to open the file */
+		fprintf(error_file, "error=%d\n", server_status);
+		fclose(error_file);
+	    }
 #else
-	error_file = fopen(http_error_file, TXT_A);
-	if (error_file) {		/* Managed to open the file */
-	    fprintf(error_file, "   URL=%s (%s)\n", url, METHOD);
-	    fprintf(error_file, "STATUS=%s\n", line_buffer);
-	    fclose(error_file);
-	}
+	    error_file = fopen(http_error_file, TXT_A);
+	    if (error_file) {	/* Managed to open the file */
+		fprintf(error_file, "   URL=%s (%s)\n", url, METHOD);
+		fprintf(error_file, "STATUS=%s\n", line_buffer);
+		fclose(error_file);
+	    }
 #endif /* SERVER_STATUS_ONLY */
-    }
+	}
 
-    /*
-    **	Rule out a non-HTTP/1.n reply as best we can.
-    */
-    if (fields < 2 || !server_version[0] || server_version[0] != 'H' ||
-	server_version[1] != 'T' || server_version[2] != 'T' ||
-	server_version[3] != 'P' || server_version[4] != '/' ||
-	server_version[6] != '.') {
 	/*
-	 *  Ugh!  An HTTP0 reply,
+	 * Rule out a non-HTTP/1.n reply as best we can.
 	 */
-	HTAtom * encoding;
+	if (fields < 2 || !server_version[0] || server_version[0] != 'H' ||
+	    server_version[1] != 'T' || server_version[2] != 'T' ||
+	    server_version[3] != 'P' || server_version[4] != '/' ||
+	    server_version[6] != '.') {
+	    /*
+	     * Ugh!  An HTTP0 reply,
+	     */
+	    HTAtom *encoding;
 
-	CTRACE((tfp, "--- Talking HTTP0.\n"));
+	    CTRACE((tfp, "--- Talking HTTP0.\n"));
 
-	format_in = HTFileFormat(url, &encoding, NULL);
-	/*
-	**  Treat all plain text as HTML.
-	**  This sucks but its the only solution without
-	**  without looking at content.
-	*/
-	if (!strncmp(HTAtom_name(format_in), "text/plain",10)) {
-	    CTRACE((tfp, "HTTP: format_in being changed to text/HTML\n"));
-	    format_in = WWW_HTML;
-	}
-	if (!IsUnityEnc(encoding)) {
+	    format_in = HTFileFormat(url, &encoding, NULL);
 	    /*
-	    **	Change the format to that for "www/compressed".
-	    */
-	    CTRACE((tfp, "HTTP: format_in is '%s',\n", HTAtom_name(format_in)));
-	    StrAllocCopy(anAnchor->content_type, HTAtom_name(format_in));
-	    StrAllocCopy(anAnchor->content_encoding, HTAtom_name(encoding));
-	    format_in = HTAtom_for("www/compressed");
-	    CTRACE((tfp, "        Treating as '%s' with encoding '%s'\n",
+	     * Treat all plain text as HTML.  This sucks but its the only
+	     * solution without without looking at content.
+	     */
+	    if (!strncmp(HTAtom_name(format_in), "text/plain", 10)) {
+		CTRACE((tfp, "HTTP: format_in being changed to text/HTML\n"));
+		format_in = WWW_HTML;
+	    }
+	    if (!IsUnityEnc(encoding)) {
+		/*
+		 * Change the format to that for "www/compressed".
+		 */
+		CTRACE((tfp, "HTTP: format_in is '%s',\n", HTAtom_name(format_in)));
+		StrAllocCopy(anAnchor->content_type, HTAtom_name(format_in));
+		StrAllocCopy(anAnchor->content_encoding, HTAtom_name(encoding));
+		format_in = HTAtom_for("www/compressed");
+		CTRACE((tfp, "        Treating as '%s' with encoding '%s'\n",
 			"www/compressed", HTAtom_name(encoding)));
-	}
-
-	start_of_data = line_kept_clean;
-    } else {
-	/*
-	**  Set up to decode full HTTP/1.n response. - FM
-	*/
-	format_in = HTAtom_for("www/mime");
-	CTRACE((tfp, "--- Talking HTTP1.\n"));
+	    }
 
-	/*
-	**  We set start_of_data to "" when !eol here because there
-	**  will be a put_block done below; we do *not* use the value
-	**  of start_of_data (as a pointer) in the computation of
-	**  length (or anything else) when !eol.  Otherwise, set the
-	**  value of length to what we have beyond eol (i.e., beyond
-	**  the status line). - FM
-	*/
-	start_of_data = eol ? eol + 1 : "";
-	length = eol ? length - (start_of_data - line_buffer) : 0;
+	    start_of_data = line_kept_clean;
+	} else {
+	    /*
+	     * Set up to decode full HTTP/1.n response.  - FM
+	     */
+	    format_in = HTAtom_for("www/mime");
+	    CTRACE((tfp, "--- Talking HTTP1.\n"));
 
-	/*
-	**  Trim trailing spaces in line_buffer so that we can use
-	**  it in messages which include the status line. - FM
-	*/
-	while (line_buffer[strlen(line_buffer)-1] == ' ')
-	       line_buffer[strlen(line_buffer)-1] = '\0';
+	    /*
+	     * We set start_of_data to "" when !eol here because there will be
+	     * a put_block done below; we do *not* use the value of
+	     * start_of_data (as a pointer) in the computation of length (or
+	     * anything else) when !eol.  Otherwise, set the value of length to
+	     * what we have beyond eol (i.e., beyond the status line).  - FM
+	     */
+	    start_of_data = eol ? eol + 1 : "";
+	    length = eol ? length - (start_of_data - line_buffer) : 0;
 
-	/*
-	**  Take appropriate actions based on the status. - FM
-	*/
-	switch (server_status/100) {
-	  case 1:
 	    /*
-	    **	HTTP/1.1 Informational statuses.
-	    **	100 Continue.
-	    **	101 Switching Protocols.
-	    **	> 101 is unknown.
-	    **	We should never get these, and they have only
-	    **	the status line and possibly other headers,
-	    **	so we'll deal with them by showing the full
-	    **	header to the user as text/plain. - FM
-	    */
-	    HTAlert(gettext("Got unexpected Informational Status."));
-	    do_head = TRUE;
-	    break;
+	     * Trim trailing spaces in line_buffer so that we can use it in
+	     * messages which include the status line.  - FM
+	     */
+	    while (line_buffer[strlen(line_buffer) - 1] == ' ')
+		line_buffer[strlen(line_buffer) - 1] = '\0';
 
-	  case 2:
 	    /*
-	    **	Good: Got MIME object! (Successful) - FM
-	    */
-	    if (do_head) {
+	     * Take appropriate actions based on the status.  - FM
+	     */
+	    switch (server_status / 100) {
+	    case 1:
 		/*
-		 *  If HEAD was requested, show headers (and possibly
-		 *  bogus body) for all 2xx status codes as text/plain - KW
+		 * HTTP/1.1 Informational statuses.
+		 * 100 Continue.
+		 * 101 Switching Protocols.
+		 * > 101 is unknown.
+		 * We should never get these, and they have only the status
+		 * line and possibly other headers, so we'll deal with them by
+		 * showing the full header to the user as text/plain.  - FM
 		 */
-		HTProgress(line_buffer);
+		HTAlert(gettext("Got unexpected Informational Status."));
+		do_head = TRUE;
 		break;
-	    }
-	    switch (server_status) {
-	      case 204:
-		/*
-		 *  No Content.
-		 */
-		HTAlert(line_buffer);
-		HTTP_NETCLOSE(s, handle);
-		HTNoDataOK = 1;
-		status = HT_NO_DATA;
-		goto clean_up;
 
-	      case 205:
+	    case 2:
 		/*
-		 *  Reset Content.  The server has fulfilled the
-		 *  request but nothing is returned and we should
-		 *  reset any form content.  We'll instruct the
-		 *  user to do that, and restore the current
-		 *  document. - FM
+		 * Good:  Got MIME object!  (Successful) - FM
 		 */
-		HTAlert(gettext("Request fulfilled.  Reset Content."));
-		HTTP_NETCLOSE(s, handle);
-		status = HT_NO_DATA;
-		goto clean_up;
+		if (do_head) {
+		    /*
+		     * If HEAD was requested, show headers (and possibly bogus
+		     * body) for all 2xx status codes as text/plain - KW
+		     */
+		    HTProgress(line_buffer);
+		    break;
+		}
+		switch (server_status) {
+		case 204:
+		    /*
+		     * No Content.
+		     */
+		    HTAlert(line_buffer);
+		    HTTP_NETCLOSE(s, handle);
+		    HTNoDataOK = 1;
+		    status = HT_NO_DATA;
+		    goto clean_up;
 
-	      case 206:
-		/*
-		 *  Partial Content.  We didn't send a Range
-		 *  so something went wrong somewhere.	Show
-		 *  the status message and restore the current
-		 *  document. - FM
-		 */
-		HTAlert(line_buffer);
-		HTTP_NETCLOSE(s, handle);
-		status = HT_NO_DATA;
-		goto clean_up;
+		case 205:
+		    /*
+		     * Reset Content.  The server has fulfilled the request but
+		     * nothing is returned and we should reset any form
+		     * content.  We'll instruct the user to do that, and
+		     * restore the current document.  - FM
+		     */
+		    HTAlert(gettext("Request fulfilled.  Reset Content."));
+		    HTTP_NETCLOSE(s, handle);
+		    status = HT_NO_DATA;
+		    goto clean_up;
 
-	      default:
-		/*
-		 *  200 OK.
-		 *  201 Created.
-		 *  202 Accepted.
-		 *  203 Non-Authoritative Information.
-		 *  > 206 is unknown.
-		 *  All should return something to display.
-		 */
+		case 206:
+		    /*
+		     * Partial Content.  We didn't send a Range so something
+		     * went wrong somewhere.  Show the status message and
+		     * restore the current document.  - FM
+		     */
+		    HTAlert(line_buffer);
+		    HTTP_NETCLOSE(s, handle);
+		    status = HT_NO_DATA;
+		    goto clean_up;
+
+		default:
+		    /*
+		     * 200 OK.
+		     * 201 Created.
+		     * 202 Accepted.
+		     * 203 Non-Authoritative Information.
+		     * > 206 is unknown.
+		     * All should return something to display.
+		     */
 #if defined(USE_SSL) && !defined(DISABLE_NEWS)
-		if (do_connect) {
-		    CTRACE((tfp, "HTTP: Proxy tunnel to '%s' established.\n",
+		    if (do_connect) {
+			CTRACE((tfp,
+				"HTTP: Proxy tunnel to '%s' established.\n",
 				connect_host));
-		    do_connect = FALSE;
-		    url = connect_url;
-		    FREE(line_buffer);
-		    FREE(line_kept_clean);
-		    if (!strncmp(connect_url, "snews", 5)) {
+			do_connect = FALSE;
+			url = connect_url;
+			FREE(line_buffer);
+			FREE(line_kept_clean);
+			if (!strncmp(connect_url, "snews", 5)) {
+			    CTRACE((tfp,
+				    "      Will attempt handshake and snews connection.\n"));
+			    status = HTNewsProxyConnect(s, url, anAnchor,
+							format_out, sink);
+			    goto done;
+			}
+			did_connect = TRUE;
+			already_retrying = TRUE;
+			eol = 0;
+			bytes_already_read = 0;
+			had_header = NO;
+			length = 0;
+			doing_redirect = FALSE;
+			permanent_redirection = FALSE;
+			target = NULL;
 			CTRACE((tfp,
-			"      Will attempt handshake and snews connection.\n"));
-			status = HTNewsProxyConnect(s, url, anAnchor,
-						    format_out, sink);
-			goto done;
+				"      Will attempt handshake and resubmit headers.\n"));
+			goto use_tunnel;
 		    }
-		    did_connect = TRUE;
-		    already_retrying = TRUE;
-		    eol = 0;
-		    bytes_already_read = 0;
-		    had_header = NO;
-		    length = 0;
-		    doing_redirect = FALSE;
-		    permanent_redirection = FALSE;
-		    target = NULL;
-		    CTRACE((tfp,
-			"      Will attempt handshake and resubmit headers.\n"));
-		    goto use_tunnel;
-		}
 #endif /* USE_SSL */
-		HTProgress(line_buffer);
-	    } /* case 2 switch */
-	    break;
-
-	  case 3:
-	    /*
-	    **	Various forms of Redirection. - FM
-	    **	300 Multiple Choices.
-	    **	301 Moved Permanently.
-	    **	302 Found (temporary; we can, and do, use GET).
-	    **	303 See Other (temporary; always use GET).
-	    **	304 Not Modified.
-	    **	305 Use Proxy.
-	    **	306 Set Proxy.
-	    **	307 Temporary Redirect with method retained.
-	    **	> 308 is unknown.
-	    */
-	    if (no_url_redirection || do_head || keep_mime_headers) {
-		/*
-		 *  If any of these flags are set, we do not redirect,
-		 *  but instead show what was returned to the user as
-		 *  text/plain. - FM
-		 */
-		HTProgress(line_buffer);
+		    HTProgress(line_buffer);
+		}		/* case 2 switch */
 		break;
-	    }
 
-	    if (server_status == 300) { /* Multiple Choices */
+	    case 3:
 		/*
-		 *  For client driven content negotiation.  The server
-		 *  should be sending some way for the user-agent to
-		 *  make a selection, so we'll show the user whatever
-		 *  the server returns.  There might be a Location:
-		 *  header with the server's preference present, but
-		 *  the choice should be up to the user, someday based
-		 *  on an Alternates: header, and a body always should
-		 *  be present with descriptions and links for the
-		 *  choices (i.e., we use the latter, for now). - FM
+		 * Various forms of Redirection.  - FM
+		 * 300 Multiple Choices.
+		 * 301 Moved Permanently.
+		 * 302 Found (temporary; we can, and do, use GET).
+		 * 303 See Other (temporary; always use GET).
+		 * 304 Not Modified.
+		 * 305 Use Proxy.
+		 * 306 Set Proxy.
+		 * 307 Temporary Redirect with method retained.
+		 * > 308 is unknown.
 		 */
-		HTAlert(line_buffer);
-		if (traversal) {
-		    HTTP_NETCLOSE(s, handle);
-		    status = -1;
-		    goto clean_up;
-		}
-		if (!dump_output_immediately &&
-		    format_out == HTAtom_for("www/download")) {
+		if (no_url_redirection || do_head || keep_mime_headers) {
 		    /*
-		     *	Convert a download request to
-		     *	a presentation request for
-		     *	interactive users. - FM
+		     * If any of these flags are set, we do not redirect, but
+		     * instead show what was returned to the user as
+		     * text/plain.  - FM
 		     */
-		    format_out = WWW_PRESENT;
+		    HTProgress(line_buffer);
+		    break;
 		}
-		break;
-	    }
 
-	    if (server_status == 304) { /* Not Modified */
-		/*
-		 *  We didn't send an "If-Modified-Since" header,
-		 *  so this status is inappropriate.  We'll deal
-		 *  with it by showing the full header to the user
-		 *  as text/plain. - FM
-		 */
-		HTAlert(gettext("Got unexpected 304 Not Modified status."));
-		do_head = TRUE;
-		break;
-	    }
+		if (server_status == 300) {	/* Multiple Choices */
+		    /*
+		     * For client driven content negotiation.  The server
+		     * should be sending some way for the user-agent to make a
+		     * selection, so we'll show the user whatever the server
+		     * returns.  There might be a Location:  header with the
+		     * server's preference present, but the choice should be up
+		     * to the user, someday based on an Alternates:  header,
+		     * and a body always should be present with descriptions
+		     * and links for the choices (i.e., we use the latter, for
+		     * now).  - FM
+		     */
+		    HTAlert(line_buffer);
+		    if (traversal) {
+			HTTP_NETCLOSE(s, handle);
+			status = -1;
+			goto clean_up;
+		    }
+		    if (!dump_output_immediately &&
+			format_out == HTAtom_for("www/download")) {
+			/*
+			 * Convert a download request to a presentation request
+			 * for interactive users.  - FM
+			 */
+			format_out = WWW_PRESENT;
+		    }
+		    break;
+		}
 
-	    if (server_status == 305 ||
-		server_status == 306 ||
-		server_status > 307) {
-		/*
-		 *  Show user the content, if any, for 305, 306,
-		 *  or unknown status. - FM
-		 */
-		HTAlert(line_buffer);
-		if (traversal) {
-		    HTTP_NETCLOSE(s, handle);
-		    status = -1;
-		    goto clean_up;
+		if (server_status == 304) {	/* Not Modified */
+		    /*
+		     * We didn't send an "If-Modified-Since" header, so this
+		     * status is inappropriate.  We'll deal with it by showing
+		     * the full header to the user as text/plain.  - FM
+		     */
+		    HTAlert(gettext("Got unexpected 304 Not Modified status."));
+		    do_head = TRUE;
+		    break;
 		}
-		if (!dump_output_immediately &&
-		    format_out == HTAtom_for("www/download")) {
+
+		if (server_status == 305 ||
+		    server_status == 306 ||
+		    server_status > 307) {
 		    /*
-		     *	Convert a download request to
-		     *	a presentation request for
-		     *	interactive users. - FM
+		     * Show user the content, if any, for 305, 306, or unknown
+		     * status.  - FM
 		     */
-		    format_out = WWW_PRESENT;
+		    HTAlert(line_buffer);
+		    if (traversal) {
+			HTTP_NETCLOSE(s, handle);
+			status = -1;
+			goto clean_up;
+		    }
+		    if (!dump_output_immediately &&
+			format_out == HTAtom_for("www/download")) {
+			/*
+			 * Convert a download request to a presentation request
+			 * for interactive users.  - FM
+			 */
+			format_out = WWW_PRESENT;
+		    }
+		    break;
 		}
-		break;
-	    }
 
-	    /*
-	     *	We do not load the file, but read the headers for
-	     *	the "Location:", check out that redirecting_url
-	     *	and if it's acceptible (e.g., not a telnet URL
-	     *	when we have that disabled), initiate a new fetch.
-	     *	If that's another redirecting_url, we'll repeat the
-	     *	checks, and fetch initiations if acceptible, until
-	     *	we reach the actual URL, or the redirection limit
-	     *	set in HTAccess.c is exceeded.	If the status was 301
-	     *	indicating that the relocation is permanent, we set
-	     *	the permanent_redirection flag to make it permanent
-	     *	for the current anchor tree (i.e., will persist until
-	     *	the tree is freed or the client exits).  If the
-	     *	redirection would include POST content, we seek
-	     *	confirmation from an interactive user, with option to
-	     *	use 303 for 301 (but not for 307), and otherwise refuse
-	     *	the redirection.  We also don't allow permanent
-	     *	redirection if we keep POST content.  If we don't find
-	     *	the Location header or it's value is zero-length, we
-	     *	display whatever the server returned, and the user
-	     *	should RELOAD that to try again, or make a selection
-	     *	from it if it contains links, or Left-Arrow to the
-	     *	previous document. - FM
-	     */
-	    {
-	      if ((dump_output_immediately || traversal) &&
-		  do_post &&
-		  server_status != 303 &&
-		  server_status != 302 &&
-		  server_status != 301) {
-		  /*
-		   *  Don't redirect POST content without approval
-		   *  from an interactive user. - FM
-		   */
-		  HTTP_NETCLOSE(s, handle);
-		  status = -1;
-		  HTAlert(
-		       gettext("Redirection of POST content requires user approval."));
-		  if (traversal)
-		      HTProgress(line_buffer);
-		  goto clean_up;
-	      }
-
-	      HTProgress(line_buffer);
-	      if (server_status == 301) { /* Moved Permanently */
-		  if (do_post) {
-		      /*
-		       *  Don't make the redirection permanent
-		       *  if we have POST content. - FM
-		       */
-		      CTRACE((tfp, "HTTP: Have POST content.  Treating 301 (Permanent) as Temporary.\n"));
-		      HTAlert(
-	 gettext("Have POST content.  Treating Permanent Redirection as Temporary.\n"));
-		  } else {
-		      permanent_redirection = TRUE;
-		  }
-	      }
-	      doing_redirect = TRUE;
-
-	      break;
-	   }
-
-	  case 4:
-	    /*
-	    **	"I think I goofed!" (Client Error) - FM
-	    */
-	    switch (server_status) {
-	      case 401:  /* Unauthorized */
 		/*
-		 *  Authorization for orgin server required.
-		 *  If show_401 is set, proceed to showing the
-		 *  401 body.  Otherwise, if we can set up
-		 *  authorization based on the WWW-Authenticate
-		 *  header, and the user provides a username and
-		 *  password, try again.  Otherwise, check whether
-		 *  to show the 401 body or restore the current
-		 *  document. - FM
+		 * We do not load the file, but read the headers for the
+		 * "Location:", check out that redirecting_url and if it's
+		 * acceptible (e.g., not a telnet URL when we have that
+		 * disabled), initiate a new fetch.  If that's another
+		 * redirecting_url, we'll repeat the checks, and fetch
+		 * initiations if acceptible, until we reach the actual URL, or
+		 * the redirection limit set in HTAccess.c is exceeded.  If the
+		 * status was 301 indicating that the relocation is permanent,
+		 * we set the permanent_redirection flag to make it permanent
+		 * for the current anchor tree (i.e., will persist until the
+		 * tree is freed or the client exits).  If the redirection
+		 * would include POST content, we seek confirmation from an
+		 * interactive user, with option to use 303 for 301 (but not
+		 * for 307), and otherwise refuse the redirection.  We also
+		 * don't allow permanent redirection if we keep POST content. 
+		 * If we don't find the Location header or it's value is
+		 * zero-length, we display whatever the server returned, and
+		 * the user should RELOAD that to try again, or make a
+		 * selection from it if it contains links, or Left-Arrow to the
+		 * previous document.  - FM
 		 */
-		if (show_401)
-		    break;
-		if (HTAA_shouldRetryWithAuth(start_of_data, length, s, NO)) {
-
-		    HTTP_NETCLOSE(s, handle);
-		    if (dump_output_immediately && !authentication_info[0]) {
-			fprintf(stderr,
-				"HTTP: Access authorization required.\n");
-			fprintf(stderr,
-				"       Use the -auth=id:pw parameter.\n");
-			status = HT_NO_DATA;
+		{
+		    if ((dump_output_immediately || traversal) &&
+			do_post &&
+			server_status != 303 &&
+			server_status != 302 &&
+			server_status != 301) {
+			/*
+			 * Don't redirect POST content without approval from an
+			 * interactive user.  - FM
+			 */
+			HTTP_NETCLOSE(s, handle);
+			status = -1;
+			HTAlert(gettext("Redirection of POST content requires user approval."));
+			if (traversal)
+			    HTProgress(line_buffer);
 			goto clean_up;
 		    }
 
-		    CTRACE((tfp, "%s %d %s\n",
-				"HTTP: close socket", s,
-				"to retry with Access Authorization"));
-
-		    _HTProgress (
-			gettext("Retrying with access authorization information."));
-		    FREE(line_buffer);
-		    FREE(line_kept_clean);
-#ifdef USE_SSL
-		    if (using_proxy && !strncmp(url, "https://", 8)) {
-			url = arg;
-			do_connect = TRUE;
-			did_connect = FALSE;
+		    HTProgress(line_buffer);
+		    if (server_status == 301) {		/* Moved Permanently */
+			if (do_post) {
+			    /*
+			     * Don't make the redirection permanent if we have
+			     * POST content.  - FM
+			     */
+			    CTRACE((tfp,
+				    "HTTP: Have POST content.  Treating 301 (Permanent) as Temporary.\n"));
+			    HTAlert(gettext("Have POST content.  Treating Permanent Redirection as Temporary.\n"));
+			} else {
+			    permanent_redirection = TRUE;
+			}
 		    }
-#endif /* USE_SSL */
-		    goto try_again;
-		} else if (!(traversal || dump_output_immediately) &&
-			   HTConfirm(gettext("Show the 401 message body?"))) {
+		    doing_redirect = TRUE;
+
 		    break;
-		} else {
-		    if (traversal || dump_output_immediately)
-			HTAlert(FAILED_RETRY_WITH_AUTH);
-		    HTTP_NETCLOSE(s, handle);
-		    status = -1;
-		    goto clean_up;
 		}
 
-	      case 407:
+	    case 4:
 		/*
-		 *  Authorization for proxy server required.
-		 *  If we are not in fact using a proxy, or
-		 *  show_407 is set, proceed to showing the
-		 *  407 body.  Otherwise, if we can set up
-		 *  authorization based on the Proxy-Authenticate
-		 *  header, and the user provides a username and
-		 *  password, try again.  Otherwise, check whether
-		 *  to show the 401 body or restore the current
-		 *  document. - FM & AJL
+		 * "I think I goofed!" (Client Error) - FM
 		 */
-		if (!using_proxy || show_407)
-		    break;
-		if (HTAA_shouldRetryWithAuth(start_of_data, length, s, YES)) {
+		switch (server_status) {
+		case 401:	/* Unauthorized */
+		    /*
+		     * Authorization for orgin server required.  If show_401 is
+		     * set, proceed to showing the 401 body.  Otherwise, if we
+		     * can set up authorization based on the WWW-Authenticate
+		     * header, and the user provides a username and password,
+		     * try again.  Otherwise, check whether to show the 401
+		     * body or restore the current document.  - FM
+		     */
+		    if (show_401)
+			break;
+		    if (HTAA_shouldRetryWithAuth(start_of_data, length, s, NO)) {
 
-		    HTTP_NETCLOSE(s, handle);
-		    if (dump_output_immediately && !proxyauth_info[0]) {
-			fprintf(stderr,
-				"HTTP: Proxy authorization required.\n");
-			fprintf(stderr,
-				"       Use the -pauth=id:pw parameter.\n");
-			status = HT_NO_DATA;
+			HTTP_NETCLOSE(s, handle);
+			if (dump_output_immediately && !authentication_info[0]) {
+			    fprintf(stderr,
+				    "HTTP: Access authorization required.\n");
+			    fprintf(stderr,
+				    "       Use the -auth=id:pw parameter.\n");
+			    status = HT_NO_DATA;
+			    goto clean_up;
+			}
+
+			CTRACE((tfp, "%s %d %s\n",
+				"HTTP: close socket", s,
+				"to retry with Access Authorization"));
+
+			_HTProgress(gettext("Retrying with access authorization information."));
+			FREE(line_buffer);
+			FREE(line_kept_clean);
+#ifdef USE_SSL
+			if (using_proxy && !strncmp(url, "https://", 8)) {
+			    url = arg;
+			    do_connect = TRUE;
+			    did_connect = FALSE;
+			}
+#endif /* USE_SSL */
+			goto try_again;
+		    } else if (!(traversal || dump_output_immediately) &&
+			       HTConfirm(gettext("Show the 401 message body?"))) {
+			break;
+		    } else {
+			if (traversal || dump_output_immediately)
+			    HTAlert(FAILED_RETRY_WITH_AUTH);
+			HTTP_NETCLOSE(s, handle);
+			status = -1;
 			goto clean_up;
 		    }
 
-		    CTRACE((tfp, "%s %d %s\n",
+		case 407:
+		    /*
+		     * Authorization for proxy server required.  If we are not
+		     * in fact using a proxy, or show_407 is set, proceed to
+		     * showing the 407 body.  Otherwise, if we can set up
+		     * authorization based on the Proxy-Authenticate header,
+		     * and the user provides a username and password, try
+		     * again.  Otherwise, check whether to show the 401 body or
+		     * restore the current document.  - FM & AJL
+		     */
+		    if (!using_proxy || show_407)
+			break;
+		    if (HTAA_shouldRetryWithAuth(start_of_data, length, s, YES)) {
+
+			HTTP_NETCLOSE(s, handle);
+			if (dump_output_immediately && !proxyauth_info[0]) {
+			    fprintf(stderr,
+				    "HTTP: Proxy authorization required.\n");
+			    fprintf(stderr,
+				    "       Use the -pauth=id:pw parameter.\n");
+			    status = HT_NO_DATA;
+			    goto clean_up;
+			}
+
+			CTRACE((tfp, "%s %d %s\n",
 				"HTTP: close socket", s,
 				"to retry with Proxy Authorization"));
 
-		    _HTProgress (HTTP_RETRY_WITH_PROXY);
-		    FREE(line_buffer);
-		    FREE(line_kept_clean);
-		    goto try_again;
-		} else if (!(traversal || dump_output_immediately) &&
-			   HTConfirm(gettext("Show the 407 message body?"))) {
+			_HTProgress(HTTP_RETRY_WITH_PROXY);
+			FREE(line_buffer);
+			FREE(line_kept_clean);
+			goto try_again;
+		    } else if (!(traversal || dump_output_immediately) &&
+			       HTConfirm(gettext("Show the 407 message body?"))) {
+			if (!dump_output_immediately &&
+			    format_out == HTAtom_for("www/download")) {
+			    /*
+			     * Convert a download request to a presentation
+			     * request for interactive users.  - FM
+			     */
+			    format_out = WWW_PRESENT;
+			}
+			break;
+		    } else {
+			if (traversal || dump_output_immediately)
+			    HTAlert(FAILED_RETRY_WITH_PROXY);
+			HTTP_NETCLOSE(s, handle);
+			status = -1;
+			goto clean_up;
+		    }
+
+		case 408:
+		    /*
+		     * Request Timeout.  Show the status message and restore
+		     * the current document.  - FM
+		     */
+		    HTAlert(line_buffer);
+		    HTTP_NETCLOSE(s, handle);
+		    status = HT_NO_DATA;
+		    goto done;
+
+		default:
+		    /*
+		     * 400 Bad Request.
+		     * 402 Payment Required.
+		     * 403 Forbidden.
+		     * 404 Not Found.
+		     * 405 Method Not Allowed.
+		     * 406 Not Acceptable.
+		     * 409 Conflict.
+		     * 410 Gone.
+		     * 411 Length Required.
+		     * 412 Precondition Failed.
+		     * 413 Request Entity Too Large.
+		     * 414 Request-URI Too Long.
+		     * 415 Unsupported Media Type.
+		     * 416 List Response (for content negotiation).
+		     * > 416 is unknown.
+		     * Show the status message, and display the returned text
+		     * if we are not doing a traversal.  - FM
+		     */
+		    HTAlert(line_buffer);
+		    if (traversal) {
+			HTTP_NETCLOSE(s, handle);
+			status = -1;
+			goto clean_up;
+		    }
 		    if (!dump_output_immediately &&
 			format_out == HTAtom_for("www/download")) {
 			/*
-			 *  Convert a download request to
-			 *  a presentation request for
-			 *  interactive users. - FM
+			 * Convert a download request to a presentation request
+			 * for interactive users.  - FM
 			 */
 			format_out = WWW_PRESENT;
 		    }
 		    break;
-		} else {
-		    if (traversal || dump_output_immediately)
-			HTAlert(FAILED_RETRY_WITH_PROXY);
-		    HTTP_NETCLOSE(s, handle);
-		    status = -1;
-		    goto clean_up;
-		}
+		}		/* case 4 switch */
+		break;
 
-	      case 408:
+	    case 5:
 		/*
-		 *  Request Timeout.  Show the status message
-		 *  and restore the current document. - FM
+		 * "I think YOU goofed!" (server error)
+		 * 500 Internal Server Error
+		 * 501 Not Implemented
+		 * 502 Bad Gateway
+		 * 503 Service Unavailable
+		 * 504 Gateway Timeout
+		 * 505 HTTP Version Not Supported
+		 * > 505 is unknown.
+		 * Should always include a message, which we always should
+		 * display.  - FM
 		 */
 		HTAlert(line_buffer);
-		HTTP_NETCLOSE(s, handle);
-		status = HT_NO_DATA;
-		goto done;
+		if (traversal) {
+		    HTTP_NETCLOSE(s, handle);
+		    status = -1;
+		    goto clean_up;
+		}
+		if (!dump_output_immediately &&
+		    format_out == HTAtom_for("www/download")) {
+		    /*
+		     * Convert a download request to a presentation request for
+		     * interactive users.  - FM
+		     */
+		    format_out = WWW_PRESENT;
+		}
+		break;
 
-	      default:
+	    default:
 		/*
-		 *  400 Bad Request.
-		 *  402 Payment Required.
-		 *  403 Forbidden.
-		 *  404 Not Found.
-		 *  405 Method Not Allowed.
-		 *  406 Not Acceptable.
-		 *  409 Conflict.
-		 *  410 Gone.
-		 *  411 Length Required.
-		 *  412 Precondition Failed.
-		 *  413 Request Entity Too Large.
-		 *  414 Request-URI Too Long.
-		 *  415 Unsupported Media Type.
-		 *  416 List Response (for content negotiation).
-		 *  > 416 is unknown.
-		 *  Show the status message, and display
-		 *  the returned text if we are not doing
-		 *  a traversal. - FM
+		 * Bad or unknown server_status number.  Take a chance and hope
+		 * there is something to display.  - FM
 		 */
+		HTAlert(gettext("Unknown status reply from server!"));
 		HTAlert(line_buffer);
 		if (traversal) {
 		    HTTP_NETCLOSE(s, handle);
@@ -1785,354 +1831,294 @@ use_tunnel:
 		if (!dump_output_immediately &&
 		    format_out == HTAtom_for("www/download")) {
 		    /*
-		     *	Convert a download request to
-		     *	a presentation request for
-		     *	interactive users. - FM
+		     * Convert a download request to a presentation request for
+		     * interactive users.  - FM
 		     */
 		    format_out = WWW_PRESENT;
 		}
 		break;
-	    } /* case 4 switch */
-	    break;
+	    }			/* Switch on server_status/100 */
 
-	  case 5:
+	}			/* Full HTTP reply */
+    }				/* scope of fields */
+
+    /*
+     * The user may have pressed the 'z'ap key during the pause caused by one
+     * of the HTAlerts above if the server reported an error, to skip loading
+     * of the error response page.  Checking here before setting up the stream
+     * stack and feeding it data avoids doing unnecessary work, it also can
+     * avoid unnecessarily pushing a loaded document out of the cache to make
+     * room for the unwanted error page.  - kw
+     */
+    if (HTCheckForInterrupt()) {
+	HTTP_NETCLOSE(s, handle);
+	if (doing_redirect) {
 	    /*
-	    **	"I think YOU goofed!" (server error)
-	    **	500 Internal Server Error
-	    **	501 Not Implemented
-	    **	502 Bad Gateway
-	    **	503 Service Unavailable
-	    **	504 Gateway Timeout
-	    **	505 HTTP Version Not Supported
-	    **	> 505 is unknown.
-	    **	Should always include a message, which
-	    **	we always should display. - FM
-	    */
-	    HTAlert(line_buffer);
-	    if (traversal) {
-		HTTP_NETCLOSE(s, handle);
-		status = -1;
-		goto clean_up;
-	    }
-	    if (!dump_output_immediately &&
-		format_out == HTAtom_for("www/download")) {
+	     * Impatient user.  - FM
+	     */
+	    CTRACE((tfp, "HTTP: Interrupted followup read.\n"));
+	    _HTProgress(CONNECTION_INTERRUPTED);
+	}
+	status = HT_INTERRUPTED;
+	goto clean_up;
+    }
+    /*
+     * Set up the stream stack to handle the body of the message.
+     */
+    if (do_head || keep_mime_headers) {
+	/*
+	 * It was a HEAD request, or we want the headers and source.
+	 */
+	start_of_data = line_kept_clean;
+#ifdef SH_EX			/* FIX BUG by kaz@maczuka.hitachi.ibaraki.jp */
+/* GIF file contains \0, so strlen does not return the data length */
+	length = real_length_of_line;
+#else
+	length = rawlength;
+#endif
+	format_in = HTAtom_for("text/plain");
+
+    } else if (doing_redirect) {
+
+	format_in = HTAtom_for("message/x-http-redirection");
+	StrAllocCopy(anAnchor->content_type, HTAtom_name(format_in));
+	if (traversal) {
+	    format_out = WWW_DEBUG;
+	    if (!sink)
+		sink = HTErrorStream();
+	} else if (!dump_output_immediately &&
+		   format_out == HTAtom_for("www/download")) {
+	    /*
+	     * Convert a download request to a presentation request for
+	     * interactive users.  - FM
+	     */
+	    format_out = WWW_PRESENT;
+	}
+    }
+
+    target = HTStreamStack(format_in,
+			   format_out,
+			   sink, anAnchor);
+
+    if (!target || target == NULL) {
+	char *buffer = NULL;
+
+	HTTP_NETCLOSE(s, handle);
+	HTSprintf0(&buffer, CANNOT_CONVERT_I_TO_O,
+		   HTAtom_name(format_in), HTAtom_name(format_out));
+	_HTProgress(buffer);
+	FREE(buffer);
+	status = -1;
+	goto clean_up;
+    }
+
+    /*
+     * Recycle the first chunk of data, in all cases.
+     */
+    (*target->isa->put_block) (target, start_of_data, length);
+
+    /*
+     * Go pull the bulk of the data down.
+     */
+    rv = HTCopy(anAnchor, s, (void *) handle, target);
+
+    /*
+     * If we get here with doing_redirect set, it means that we were looking
+     * for a Location header.  We either have got it now in redirecting_url -
+     * in that case the stream should not have loaded any data.  Or we didn't
+     * get it, in that case the stream may have presented the message body
+     * normally.  - kw
+     */
+
+    if (rv == -1) {
+	/*
+	 * Intentional interrupt before data were received, not an error
+	 */
+/* (*target->isa->_abort)(target, NULL); *//* already done in HTCopy */
+	if (doing_redirect && traversal)
+	    status = -1;
+	else
+	    status = HT_INTERRUPTED;
+	HTTP_NETCLOSE(s, handle);
+	goto clean_up;
+    }
+
+    if (rv == -2) {
+	/*
+	 * Aw hell, a REAL error, maybe cuz it's a dumb HTTP0 server
+	 */
+	(*target->isa->_abort) (target, NULL);
+	if (doing_redirect && redirecting_url) {
+	    /*
+	     * Got a location before the error occurred?  Then consider it an
+	     * interrupt but proceed below as normal.  - kw
+	     */
+	    /* do nothing here */
+	} else {
+	    HTTP_NETCLOSE(s, handle);
+	    if (!doing_redirect && !already_retrying && !do_post) {
+		CTRACE((tfp, "HTTP: Trying again with HTTP0 request.\n"));
 		/*
-		 *  Convert a download request to
-		 *  a presentation request for
-		 *  interactive users. - FM
+		 * May as well consider it an interrupt -- right?
 		 */
-		format_out = WWW_PRESENT;
+		FREE(line_buffer);
+		FREE(line_kept_clean);
+		extensions = NO;
+		already_retrying = TRUE;
+		_HTProgress(RETRYING_AS_HTTP0);
+		goto try_again;
+	    } else {
+		status = HT_NOT_LOADED;
+		goto clean_up;
 	    }
-	    break;
+	}
+    }
+
+    /*
+     * Free if complete transmission (socket was closed before return).  Close
+     * socket if partial transmission (was freed on abort).
+     */
+    if (rv != HT_INTERRUPTED && rv != -2) {
+	(*target->isa->_free) (target);
+    } else {
+	HTTP_NETCLOSE(s, handle);
+    }
 
-	  default:
+    if (doing_redirect) {
+	if (redirecting_url) {
 	    /*
-	    **	Bad or unknown server_status number.
-	    **	Take a chance and hope there is
-	    **	something to display. - FM
-	    */
-	    HTAlert(gettext("Unknown status reply from server!"));
-	    HTAlert(line_buffer);
-	    if (traversal) {
-		HTTP_NETCLOSE(s, handle);
-		status = -1;
+	     * Set up for checking redirecting_url in LYGetFile.c for
+	     * restrictions before we seek the document at that Location.  - FM
+	     */
+	    CTRACE((tfp, "HTTP: Picked up location '%s'\n",
+		    redirecting_url));
+	    if (rv == HT_INTERRUPTED) {
+		/*
+		 * Intentional interrupt after data were received, not an error
+		 * (probably).  We take it as a user request to abandon the
+		 * redirection chain.
+		 *
+		 * This could reasonably be changed (by just removing this
+		 * block), it would make sense if there are redirecting
+		 * resources that "hang" after sending the headers.  - kw
+		 */
+		FREE(redirecting_url);
+		CTRACE((tfp, "HTTP: Interrupted followup read.\n"));
+		status = HT_INTERRUPTED;
 		goto clean_up;
 	    }
-	    if (!dump_output_immediately &&
-		format_out == HTAtom_for("www/download")) {
+	    HTProgress(line_buffer);
+	    if (server_status == 305) {		/* Use Proxy */
 		/*
-		 *  Convert a download request to
-		 *  a presentation request for
-		 *  interactive users. - FM
+		 * Make sure the proxy field ends with a slash.  - FM
 		 */
-		format_out = WWW_PRESENT;
+		if (redirecting_url[strlen(redirecting_url) - 1]
+		    != '/')
+		    StrAllocCat(redirecting_url, "/");
+		/*
+		 * Append our URL.  - FM
+		 */
+		StrAllocCat(redirecting_url, anAnchor->address);
+		CTRACE((tfp, "HTTP: Proxy URL is '%s'\n",
+			redirecting_url));
 	    }
-	    break;
-	} /* Switch on server_status/100 */
-
-      } /* Full HTTP reply */
-  } /* scope of fields */
-
-  /*
-  **  The user may have pressed the 'z'ap key during the pause caused
-  **  by one of the HTAlerts above if the server reported an error,
-  **  to skip loading of the error response page.  Checking here before
-  **  setting up the stream stack and feeding it data avoids doing
-  **  unnecessary work, it also can avoid unnecessarily pushing a
-  **  loaded document out of the cache to make room for the unwanted
-  **  error page. - kw
-  */
-  if (HTCheckForInterrupt()) {
-      HTTP_NETCLOSE(s, handle);
-      if (doing_redirect) {
-	  /*
-	   *  Impatient user. - FM
-	   */
-	  CTRACE((tfp, "HTTP: Interrupted followup read.\n"));
-	  _HTProgress (CONNECTION_INTERRUPTED);
-      }
-      status = HT_INTERRUPTED;
-      goto clean_up;
-  }
-  /*
-  **  Set up the stream stack to handle the body of the message.
-  */
-  if (do_head || keep_mime_headers) {
-      /*
-      **  It was a HEAD request, or we want the headers and source.
-      */
-      start_of_data = line_kept_clean;
-#ifdef SH_EX	/* FIX BUG by kaz@maczuka.hitachi.ibaraki.jp */
-/* GIF file contains \0, so strlen does not return the data length */
-      length = real_length_of_line;
-#else
-      length = rawlength;
-#endif
-      format_in = HTAtom_for("text/plain");
-
-  } else if (doing_redirect) {
-
-      format_in = HTAtom_for("message/x-http-redirection");
-      StrAllocCopy(anAnchor->content_type, HTAtom_name(format_in));
-      if (traversal) {
-	  format_out = WWW_DEBUG;
-	  if (!sink)
-	      sink = HTErrorStream();
-      } else if (!dump_output_immediately &&
-	  format_out == HTAtom_for("www/download")) {
-	  /*
-	   *  Convert a download request to
-	   *  a presentation request for
-	   *  interactive users. - FM
-	   */
-	  format_out = WWW_PRESENT;
-      }
-  }
-
-  target = HTStreamStack(format_in,
-			 format_out,
-			 sink, anAnchor);
-
-  if (!target || target == NULL) {
-      char *buffer = NULL;
-
-      HTTP_NETCLOSE(s, handle);
-      HTSprintf0(&buffer, CANNOT_CONVERT_I_TO_O,
-	      HTAtom_name(format_in), HTAtom_name(format_out));
-      _HTProgress (buffer);
-      FREE(buffer);
-      status = -1;
-      goto clean_up;
-  }
-
-  /*
-  **  Recycle the first chunk of data, in all cases.
-  */
-  (*target->isa->put_block)(target, start_of_data, length);
-
-  /*
-  **  Go pull the bulk of the data down.
-  */
-  rv = HTCopy(anAnchor, s, (void *)handle, target);
-
-  /*
-  **  If we get here with doing_redirect set, it means that we were
-  **  looking for a Location header.  We either have got it now in
-  **  redirecting_url - in that case the stream should not have loaded
-  **  any data.  Or we didn't get it, in that case the stream may have
-  **  presented the message body normally. - kw
-  */
-
-  if (rv == -1) {
-      /*
-      **  Intentional interrupt before data were received, not an error
-      */
-      /* (*target->isa->_abort)(target, NULL); */ /* already done in HTCopy */
-      if (doing_redirect && traversal)
-	  status = -1;
-      else
-	  status = HT_INTERRUPTED;
-      HTTP_NETCLOSE(s, handle);
-      goto clean_up;
-  }
-
-  if (rv == -2) {
-      /*
-      **  Aw hell, a REAL error, maybe cuz it's a dumb HTTP0 server
-      */
-      (*target->isa->_abort)(target, NULL);
-      if (doing_redirect && redirecting_url) {
-	  /*
-	  **  Got a location before the error occurred?  Then consider it
-	  **  an interrupt but proceed below as normal. - kw
-	  */
-	  /* do nothing here */
-      } else {
-	  HTTP_NETCLOSE(s, handle);
-	  if (!doing_redirect && !already_retrying && !do_post) {
-	      CTRACE((tfp, "HTTP: Trying again with HTTP0 request.\n"));
-	      /*
-	      **  May as well consider it an interrupt -- right?
-	      */
-	      FREE(line_buffer);
-	      FREE(line_kept_clean);
-	      extensions = NO;
-	      already_retrying = TRUE;
-	      _HTProgress (RETRYING_AS_HTTP0);
-	      goto try_again;
-	  } else {
-	      status = HT_NOT_LOADED;
-	      goto clean_up;
-	  }
-      }
-  }
-
-  /*
-  **  Free if complete transmission (socket was closed before return).
-  **  Close socket if partial transmission (was freed on abort).
-  */
-  if (rv != HT_INTERRUPTED && rv != -2) {
-      (*target->isa->_free)(target);
-  } else {
-      HTTP_NETCLOSE(s, handle);
-  }
-
-  if (doing_redirect) {
-      if (redirecting_url) {
-	  /*
-	   *  Set up for checking redirecting_url in
-	   *  LYGetFile.c for restrictions before we
-	   *  seek the document at that Location. - FM
-	   */
-	  CTRACE((tfp, "HTTP: Picked up location '%s'\n",
-		  redirecting_url));
-	  if (rv == HT_INTERRUPTED) {
-	      /*
-	      **  Intentional interrupt after data were received, not an
-	      **  error (probably).  We take it as a user request to
-	      **  abandon the redirection chain.
-	      **  This could reasonably be changed (by just removing this
-	      **  block), it would make sense if there are redirecting
-	      **  resources that "hang" after sending the headers. - kw
-	      */
-	      FREE(redirecting_url);
-	      CTRACE((tfp, "HTTP: Interrupted followup read.\n"));
-	      status = HT_INTERRUPTED;
-	      goto clean_up;
-	  }
-	  HTProgress(line_buffer);
-	  if (server_status == 305) { /* Use Proxy */
-	      /*
-	       *	Make sure the proxy field ends with
-	       *	a slash. - FM
-	       */
-	      if (redirecting_url[strlen(redirecting_url)-1]
-		  != '/')
-		  StrAllocCat(redirecting_url, "/");
-	      /*
-	       *	Append our URL. - FM
-	       */
-	      StrAllocCat(redirecting_url, anAnchor->address);
-	      CTRACE((tfp, "HTTP: Proxy URL is '%s'\n",
-		      redirecting_url));
-	  }
-	  if (!do_post ||
-	      server_status == 303 ||
-	      server_status == 302) {
-	      /*
-	       *	We don't have POST content (nor support PUT
-	       *	or DELETE), or the status is "See Other"  or
-	       *	"General Redirection" and we can convert to
-	       *	GET, so go back and check out the new URL. - FM
-	       */
-	      status = HT_REDIRECTING;
-	      goto clean_up;
-	  }
-	  /*
-	   *  Make sure the user wants to redirect
-	   *  the POST content, or treat as GET - FM & DK
-	   */
-	  switch (HTConfirmPostRedirect(redirecting_url,
-					server_status)) {
-	      /*
-	       *	User failed to confirm.
-	       *	Abort the fetch.
-	       */
-	  case 0:
-	      doing_redirect = FALSE;
-	      FREE(redirecting_url);
-	      status = HT_NO_DATA;
-	      goto clean_up;
-
-	      /*
-	       *	User wants to treat as GET with no content.
-	       *	Go back to check out the URL.
-	       */
-	  case 303:
-	      break;
-
-	      /*
-	       *	Set the flag to retain the POST
-	       *	content and go back to check out
-	       *	the URL. - FM
-	       */
-	  default:
-	      redirect_post_content = TRUE;
-	  }
-
-	  /* Lou's old comment:  - FM */
-	  /* OK, now we've got the redirection URL temporarily stored
-	     in external variable redirecting_url, exported from HTMIME.c,
-	     since there's no straightforward way to do this in the library
-	     currently.  Do the right thing. */
-
-	  status = HT_REDIRECTING;
-
-      } else {
-	  status = traversal ? -1 : HT_LOADED;
-      }
-
-  } else {
-      /*
-      **  If any data were received, treat as a complete transmission
-      */
-      status = HT_LOADED;
-  }
-
-  /*
-  **  Clean up
-  */
-clean_up:
-  FREE(line_buffer);
-  FREE(line_kept_clean);
-
-done:
-  /*
-  **  Clear out on exit, just in case.
-  */
-  do_head = FALSE;
-  do_post = FALSE;
-  reloading = FALSE;
+	    if (!do_post ||
+		server_status == 303 ||
+		server_status == 302) {
+		/*
+		 * We don't have POST content (nor support PUT or DELETE), or
+		 * the status is "See Other" or "General Redirection" and we
+		 * can convert to GET, so go back and check out the new URL.  -
+		 * FM
+		 */
+		status = HT_REDIRECTING;
+		goto clean_up;
+	    }
+	    /*
+	     * Make sure the user wants to redirect the POST content, or treat
+	     * as GET - FM & DK
+	     */
+	    switch (HTConfirmPostRedirect(redirecting_url,
+					  server_status)) {
+		/*
+		 * User failed to confirm.  Abort the fetch.
+		 */
+	    case 0:
+		doing_redirect = FALSE;
+		FREE(redirecting_url);
+		status = HT_NO_DATA;
+		goto clean_up;
+
+		/*
+		 * User wants to treat as GET with no content.  Go back to
+		 * check out the URL.
+		 */
+	    case 303:
+		break;
+
+		/*
+		 * Set the flag to retain the POST content and go back to check
+		 * out the URL.  - FM
+		 */
+	    default:
+		redirect_post_content = TRUE;
+	    }
+
+	    /* Lou's old comment:  - FM */
+	    /* OK, now we've got the redirection URL temporarily stored
+	       in external variable redirecting_url, exported from HTMIME.c,
+	       since there's no straightforward way to do this in the library
+	       currently.  Do the right thing. */
+
+	    status = HT_REDIRECTING;
+
+	} else {
+	    status = traversal ? -1 : HT_LOADED;
+	}
+
+    } else {
+	/*
+	 * If any data were received, treat as a complete transmission
+	 */
+	status = HT_LOADED;
+    }
+
+    /*
+     * Clean up
+     */
+  clean_up:
+    FREE(line_buffer);
+    FREE(line_kept_clean);
+
+  done:
+    /*
+     * Clear out on exit, just in case.
+     */
+    do_head = FALSE;
+    do_post = FALSE;
+    reloading = FALSE;
 #ifdef USE_SSL
-  do_connect = FALSE;
-  did_connect = FALSE;
-  FREE(connect_host);
-  if (handle) {
-    SSL_free(handle);
-    SSL_handle = handle = NULL;
-  }
+    do_connect = FALSE;
+    did_connect = FALSE;
+    FREE(connect_host);
+    if (handle) {
+	SSL_free(handle);
+	SSL_handle = handle = NULL;
+    }
 #endif /* USE_SSL */
-  return status;
+    return status;
 }
 
 /*	Protocol descriptor
 */
 #ifdef GLOBALDEF_IS_MACRO
 #define _HTTP_C_GLOBALDEF_1_INIT { "http", HTLoadHTTP, 0}
-GLOBALDEF (HTProtocol,HTTP,_HTTP_C_GLOBALDEF_1_INIT);
+GLOBALDEF(HTProtocol, HTTP, _HTTP_C_GLOBALDEF_1_INIT);
 #define _HTTP_C_GLOBALDEF_2_INIT { "https", HTLoadHTTP, 0}
-GLOBALDEF (HTProtocol,HTTPS,_HTTP_C_GLOBALDEF_2_INIT);
+GLOBALDEF(HTProtocol, HTTPS, _HTTP_C_GLOBALDEF_2_INIT);
 #else
-GLOBALDEF HTProtocol HTTP = { "http", HTLoadHTTP, 0 };
-GLOBALDEF HTProtocol HTTPS = { "https", HTLoadHTTP, 0 };
+GLOBALDEF HTProtocol HTTP =
+{"http", HTLoadHTTP, 0};
+GLOBALDEF HTProtocol HTTPS =
+{"https", HTLoadHTTP, 0};
 #endif /* GLOBALDEF_IS_MACRO */
diff --git a/WWW/Library/Implementation/HTTP.h b/WWW/Library/Implementation/HTTP.h
index 971305f9..43ef29e1 100644
--- a/WWW/Library/Implementation/HTTP.h
+++ b/WWW/Library/Implementation/HTTP.h
@@ -8,8 +8,9 @@
 #include <HTAccess.h>
 
 #ifdef GLOBALREF_IS_MACRO
-extern GLOBALREF (HTProtocol,HTTP);
-extern GLOBALREF (HTProtocol,HTTPS);
+extern GLOBALREF (HTProtocol, HTTP);
+extern GLOBALREF (HTProtocol, HTTPS);
+
 #else
 GLOBALREF HTProtocol HTTP;
 GLOBALREF HTProtocol HTTPS;
@@ -21,12 +22,12 @@ GLOBALREF HTProtocol HTTPS;
 
 extern int ws_read_per_sec;
 extern BOOL reloading;
-extern char * redirecting_url;
+extern char *redirecting_url;
 extern BOOL permanent_redirection;
 extern BOOL redirect_post_content;
 
 #ifdef USE_SSL
-extern SSL * SSL_handle;
+extern SSL *SSL_handle;
 #endif
 
 #endif /* HTTP_H */
diff --git a/WWW/Library/Implementation/HTTelnet.c b/WWW/Library/Implementation/HTTelnet.c
index 347739d3..9474998a 100644
--- a/WWW/Library/Implementation/HTTelnet.c
+++ b/WWW/Library/Implementation/HTTelnet.c
@@ -1,17 +1,17 @@
 /*		Telnet Acees, Roligin, etc			HTTelnet.c
-**		==========================
-**
-** Authors
-**	TBL	Tim Berners-Lee timbl@info.cern.ch
-**	JFG	Jean-Francois Groff jgh@next.com
-**	DD	Denis DeLaRoca (310) 825-4580  <CSP1DWD@mvs.oac.ucla.edu>
-** History
-**	 8 Jun 92 Telnet hopping prohibited as telnet is not secure (TBL)
-**	26 Jun 92 When over DECnet, suppressed FTP, Gopher and News. (JFG)
-**	 6 Oct 92 Moved HTClientHost and logfile into here. (TBL)
-**	17 Dec 92 Tn3270 added, bug fix. (DD)
-**	 2 Feb 93 Split from HTAccess.c.  Registration.(TBL)
-*/
+ *		==========================
+ *
+ * Authors
+ *	TBL	Tim Berners-Lee timbl@info.cern.ch
+ *	JFG	Jean-Francois Groff jgh@next.com
+ *	DD	Denis DeLaRoca (310) 825-4580  <CSP1DWD@mvs.oac.ucla.edu>
+ * History
+ *	 8 Jun 92 Telnet hopping prohibited as telnet is not secure (TBL)
+ *	26 Jun 92 When over DECnet, suppressed FTP, Gopher and News. (JFG)
+ *	 6 Oct 92 Moved HTClientHost and logfile into here. (TBL)
+ *	17 Dec 92 Tn3270 added, bug fix. (DD)
+ *	 2 Feb 93 Split from HTAccess.c.  Registration.(TBL)
+ */
 
 #include <HTUtils.h>
 #include <LYUtils.h>
@@ -35,7 +35,7 @@
 #include <LYClean.h>
 #include <LYLeaks.h>
 
-static void do_system (char *  command)
+static void do_system(char *command)
 {
     if (!isEmpty(command)) {
 	CTRACE((tfp, "HTTelnet: Command is: %s\n\n", command));
@@ -45,110 +45,118 @@ static void do_system (char *  command)
 }
 
 /*	Telnet or "rlogin" access
-**	-------------------------
-*/
-static int remote_session (char *  acc_method, char *  host)
+ *	-------------------------
+ */
+static int remote_session(char *acc_method, char *host)
 {
     const char *program;
-	char * user = host;
-	char * password = NULL;
-	char * cp;
-	char * hostname;
-	char * port;
-	char * command = NULL;
-	enum _login_protocol { telnet, rlogin, tn3270 } login_protocol =
-		strcmp(acc_method, "rlogin") == 0 ? rlogin :
-		strcmp(acc_method, "tn3270") == 0 ? tn3270 : telnet;
-
-	/*
-	 *	Modified to allow for odd chars in a username only if exists.
-	 *	05-28-94 Lynx 2-3-1 Garrett Arch Blythe
-	 */
-	/* prevent telnet://hostname;rm -rf *  URL's (VERY BAD)
-	 *  *cp=0;  / * terminate at any ;,<,>,`,|,",' or space or return
-	 *  or tab to prevent security whole
-	 */
-	for(cp = (strchr(host, '@') ? strchr(host, '@') : host); *cp != '\0';
-		cp++)	{
-	    if(!isalnum(UCH(*cp)) && *cp != '_' && *cp != '-' &&
-				*cp != ':' && *cp != '.' && *cp != '@') {
-		*cp = '\0';
-		break;
-	    }
+    char *user = host;
+    char *password = NULL;
+    char *cp;
+    char *hostname;
+    char *port;
+    char *command = NULL;
+    enum _login_protocol {
+	telnet,
+	rlogin,
+	tn3270
+    } login_protocol =
+      strcmp(acc_method, "rlogin") == 0 ? rlogin :
+      strcmp(acc_method, "tn3270") == 0 ? tn3270 : telnet;
+
+    /*
+     * Modified to allow for odd chars in a username only if exists.
+     * 05-28-94 Lynx 2-3-1 Garrett Arch Blythe
+     */
+    /* prevent telnet://hostname;rm -rf *  URL's (VERY BAD)
+     *  *cp=0;        // terminate at any ;,<,>,`,|,",' or space or return
+     * or tab to prevent security whole
+     */
+    for (cp = (strchr(host, '@') ? strchr(host, '@') : host); *cp != '\0';
+	 cp++) {
+	if (!isalnum(UCH(*cp)) && *cp != '_' && *cp != '-' &&
+	    *cp != ':' && *cp != '.' && *cp != '@') {
+	    *cp = '\0';
+	    break;
 	}
+    }
 
-	hostname = strchr(host, '@');
+    hostname = strchr(host, '@');
 
-	if (hostname) {
-	    *hostname++ = '\0'; /* Split */
-	} else {
-	    hostname = host;
-	    user = NULL;	/* No user specified */
-	}
+    if (hostname) {
+	*hostname++ = '\0';	/* Split */
+    } else {
+	hostname = host;
+	user = NULL;		/* No user specified */
+    }
 
-	port = strchr(hostname, ':');
-	if (port)
-	    *port++ = '\0';	/* Split */
-
-	if (!hostname || *hostname == '\0') {
-	    CTRACE((tfp, "HTTelnet: No host specified!\n"));
-	    return HT_NO_DATA;
-	} else if (!valid_hostname(hostname)) {
-	    char *prefix = NULL;
-	    char *line = NULL;
-	    CTRACE((tfp, "HTTelnet: Invalid hostname %s!\n", host));
-	    HTSprintf0(&prefix,
-		       gettext("remote %s session:"), acc_method);
-	    HTSprintf0(&line,
-		       gettext("Invalid hostname %s"), host);
-	    HTAlwaysAlert(prefix, line);
-	    FREE(prefix);
-	    FREE(line);
-	    return HT_NO_DATA;
-	}
+    port = strchr(hostname, ':');
+    if (port)
+	*port++ = '\0';		/* Split */
 
-	if (user) {
-	    password = strchr(user, ':');
-	    if (password) {
-		*password++ = '\0';
-	    }
+    if (!hostname || *hostname == '\0') {
+	CTRACE((tfp, "HTTelnet: No host specified!\n"));
+	return HT_NO_DATA;
+    } else if (!valid_hostname(hostname)) {
+	char *prefix = NULL;
+	char *line = NULL;
+
+	CTRACE((tfp, "HTTelnet: Invalid hostname %s!\n", host));
+	HTSprintf0(&prefix,
+		   gettext("remote %s session:"), acc_method);
+	HTSprintf0(&line,
+		   gettext("Invalid hostname %s"), host);
+	HTAlwaysAlert(prefix, line);
+	FREE(prefix);
+	FREE(line);
+	return HT_NO_DATA;
+    }
+
+    if (user) {
+	password = strchr(user, ':');
+	if (password) {
+	    *password++ = '\0';
 	}
+    }
 
-	/* If the person is already telnetting etc, forbid hopping */
-	/* This is a security precaution, for us and remote site */
+    /* If the person is already telnetting etc, forbid hopping */
+    /* This is a security precaution, for us and remote site */
 
-	if (HTSecure) {
+    if (HTSecure) {
 
 #ifdef TELNETHOPPER_MAIL
-	    HTSprintf0(&command,
-	      "finger @%s | mail -s \"**telnethopper %s\" tbl@dxcern.cern.ch",
-	       HTClientHost, HTClientHost);
-	    do_system(command);
+	HTSprintf0(&command,
+		   "finger @%s | mail -s \"**telnethopper %s\" tbl@dxcern.cern.ch",
+		   HTClientHost, HTClientHost);
+	do_system(command);
 #endif
-	    printf("\n\nSorry, but the service you have selected is one\n");
-	    printf("to which you have to log in.  If you were running www\n");
-	    printf("on your own computer, you would be automatically connected.\n");
-	    printf("For security reasons, this is not allowed when\n");
-	    printf("you log in to this information service remotely.\n\n");
-
-	    printf("You can manually connect to this service using %s\n",
-		   acc_method);
-	    printf("to host %s", hostname);
-	    if (user) printf(", user name %s", user);
-	    if (password) printf(", password %s", password);
-	    if (port) printf(", port %s", port);
-	    printf(".\n\n");
-	    return HT_NO_DATA;
-	}
+	printf("\n\nSorry, but the service you have selected is one\n");
+	printf("to which you have to log in.  If you were running www\n");
+	printf("on your own computer, you would be automatically connected.\n");
+	printf("For security reasons, this is not allowed when\n");
+	printf("you log in to this information service remotely.\n\n");
+
+	printf("You can manually connect to this service using %s\n",
+	       acc_method);
+	printf("to host %s", hostname);
+	if (user)
+	    printf(", user name %s", user);
+	if (password)
+	    printf(", password %s", password);
+	if (port)
+	    printf(", port %s", port);
+	printf(".\n\n");
+	return HT_NO_DATA;
+    }
 
-	/* Not all telnet servers get it even if user name is specified
-	** so we always tell the guy what to log in as
-	*/
-	if (user && login_protocol != rlogin)
-	    printf("When you are connected, log in as:  %s\n", user);
-	if (password && login_protocol != rlogin)
-	    printf("                  The password is:  %s\n", password);
-	fflush(stdout);
+    /* Not all telnet servers get it even if user name is specified so we
+     * always tell the guy what to log in as.
+     */
+    if (user && login_protocol != rlogin)
+	printf("When you are connected, log in as:  %s\n", user);
+    if (password && login_protocol != rlogin)
+	printf("                  The password is:  %s\n", password);
+    fflush(stdout);
 
 /*
  *	NeXTSTEP is the implied version of the NeXT operating system.
@@ -157,15 +165,15 @@ static int remote_session (char *  acc_method, char *  host)
 #if	!defined(TELNET_DONE) && (defined(NeXT) && defined(NeXTSTEP) && NeXTSTEP<=20100)
 #define FMT_TELNET "%s%s%s %s %s"
 
-	if ((program = HTGetProgramPath(ppTELNET)) != NULL) {
-	    HTAddParam(&command, FMT_TELNET, 1, program);
-	    HTOptParam(&command, FMT_TELNET, 2, user ? " -l " : "");
-	    HTAddParam(&command, FMT_TELNET, 3, user);
-	    HTAddParam(&command, FMT_TELNET, 4, hostname);
-	    HTAddParam(&command, FMT_TELNET, 5, port);
-	    HTEndParam(&command, FMT_TELNET, 5);
-	}
-	do_system(command);
+    if ((program = HTGetProgramPath(ppTELNET)) != NULL) {
+	HTAddParam(&command, FMT_TELNET, 1, program);
+	HTOptParam(&command, FMT_TELNET, 2, user ? " -l " : "");
+	HTAddParam(&command, FMT_TELNET, 3, user);
+	HTAddParam(&command, FMT_TELNET, 4, hostname);
+	HTAddParam(&command, FMT_TELNET, 5, port);
+	HTEndParam(&command, FMT_TELNET, 5);
+    }
+    do_system(command);
 #define TELNET_DONE
 #endif
 
@@ -176,279 +184,269 @@ static int remote_session (char *  acc_method, char *  host)
 #define FMT_TN3270 "%s %s %s"
 #define FMT_TELNET "%s %s %s"
 
-	switch (login_protocol) {
-	case rlogin:
-	    if ((program = HTGetProgramPath(ppRLOGIN)) != NULL) {
-		HTAddParam(&command, FMT_RLOGIN, 1, program);
-		HTAddParam(&command, FMT_RLOGIN, 2, hostname);
-		HTOptParam(&command, FMT_RLOGIN, 3, user ? " -l " : "");
-		HTAddParam(&command, FMT_RLOGIN, 4, user);
-		HTEndParam(&command, FMT_RLOGIN, 4);
-	    }
-	    break;
-
-	case tn3270:
-	    if ((program = HTGetProgramPath(ppTN3270)) != NULL) {
-		HTAddParam(&command, FMT_TN3270, 1, program);
-		HTAddParam(&command, FMT_TN3270, 2, hostname);
-		HTAddParam(&command, FMT_TN3270, 3, port);
-		HTEndParam(&command, FMT_TN3270, 3);
-	    }
-	    break;
+    switch (login_protocol) {
+    case rlogin:
+	if ((program = HTGetProgramPath(ppRLOGIN)) != NULL) {
+	    HTAddParam(&command, FMT_RLOGIN, 1, program);
+	    HTAddParam(&command, FMT_RLOGIN, 2, hostname);
+	    HTOptParam(&command, FMT_RLOGIN, 3, user ? " -l " : "");
+	    HTAddParam(&command, FMT_RLOGIN, 4, user);
+	    HTEndParam(&command, FMT_RLOGIN, 4);
+	}
+	break;
+
+    case tn3270:
+	if ((program = HTGetProgramPath(ppTN3270)) != NULL) {
+	    HTAddParam(&command, FMT_TN3270, 1, program);
+	    HTAddParam(&command, FMT_TN3270, 2, hostname);
+	    HTAddParam(&command, FMT_TN3270, 3, port);
+	    HTEndParam(&command, FMT_TN3270, 3);
+	}
+	break;
 
-	case telnet:
-	    if ((program = HTGetProgramPath(ppTELNET)) != NULL) {
-		HTAddParam(&command, FMT_TELNET, 1, program);
-		HTAddParam(&command, FMT_TELNET, 2, hostname);
-		HTAddParam(&command, FMT_TELNET, 3, port);
-		HTEndParam(&command, FMT_TELNET, 3);
-	    }
-	    break;
+    case telnet:
+	if ((program = HTGetProgramPath(ppTELNET)) != NULL) {
+	    HTAddParam(&command, FMT_TELNET, 1, program);
+	    HTAddParam(&command, FMT_TELNET, 2, hostname);
+	    HTAddParam(&command, FMT_TELNET, 3, port);
+	    HTEndParam(&command, FMT_TELNET, 3);
 	}
+	break;
+    }
 
-        LYSystem(command);
+    LYSystem(command);
 #define TELNET_DONE
 #endif /* unix */
 
 /* VMS varieties */
 #if !defined(TELNET_DONE) && (defined(MULTINET))
-	if (login_protocol == rlogin) {
-	    HTSprintf0(&command, "RLOGIN%s%s%s%s%s %s",  /*lm 930713 */
-		user ? "/USERNAME=\"" : "",
-		NonNull(user),
-		user ? "\"" : "",
-		port ? "/PORT=" : "",
-		NonNull(port),
-		hostname);
-
-	} else if (login_protocol == tn3270) {
-	    HTSprintf0(&command, "TELNET/TN3270 %s%s %s",
-		port ? "/PORT=" : "",
-		NonNull(port),
-		hostname);
-
-	} else {  /* TELNET */
-	    HTSprintf0(&command, "TELNET %s%s %s",
-		port ? "/PORT=" : "",
-		NonNull(port),
-		hostname);
-	}
+    if (login_protocol == rlogin) {
+	HTSprintf0(&command, "RLOGIN%s%s%s%s%s %s",	/*lm 930713 */
+		   user ? "/USERNAME=\"" : "",
+		   NonNull(user),
+		   user ? "\"" : "",
+		   port ? "/PORT=" : "",
+		   NonNull(port),
+		   hostname);
+
+    } else if (login_protocol == tn3270) {
+	HTSprintf0(&command, "TELNET/TN3270 %s%s %s",
+		   port ? "/PORT=" : "",
+		   NonNull(port),
+		   hostname);
+
+    } else {			/* TELNET */
+	HTSprintf0(&command, "TELNET %s%s %s",
+		   port ? "/PORT=" : "",
+		   NonNull(port),
+		   hostname);
+    }
 
-	do_system(command);
+    do_system(command);
 #define TELNET_DONE
 #endif /* MULTINET */
 
 #if !defined(TELNET_DONE) && defined(WIN_TCP)
-	if ((cp=getenv("WINTCP_COMMAND_STYLE")) != NULL &&
-	    0==strncasecomp(cp, "VMS", 3)) { /* VMS command syntax */
-	    if (login_protocol == rlogin) {
-		HTSprintf0(&command, "RLOGIN%s%s%s%s%s %s",  /*lm 930713 */
-		    user ? "/USERNAME=\"" : "",
-		    NonNull(user),
-		    user ? "\"" : "",
-		    port ? "/PORT=" : "",
-		    NonNull(port),
-		    hostname);
+    if ((cp = getenv("WINTCP_COMMAND_STYLE")) != NULL &&
+	0 == strncasecomp(cp, "VMS", 3)) {	/* VMS command syntax */
+	if (login_protocol == rlogin) {
+	    HTSprintf0(&command, "RLOGIN%s%s%s%s%s %s",		/*lm 930713 */
+		       user ? "/USERNAME=\"" : "",
+		       NonNull(user),
+		       user ? "\"" : "",
+		       port ? "/PORT=" : "",
+		       NonNull(port),
+		       hostname);
 
-	    } else if (login_protocol == tn3270) {
-		HTSprintf0(&command, "TELNET/TN3270 %s%s %s",
-		    port ? "/PORT=" : "",
-		    NonNull(port),
-		    hostname);
+	} else if (login_protocol == tn3270) {
+	    HTSprintf0(&command, "TELNET/TN3270 %s%s %s",
+		       port ? "/PORT=" : "",
+		       NonNull(port),
+		       hostname);
 
-	    } else {  /* TELNET */
-		HTSprintf0(&command, "TELNET %s%s %s",
-		    port ? "/PORT=" : "",
-		    NonNull(port),
-		    hostname);
-	    }
+	} else {		/* TELNET */
+	    HTSprintf0(&command, "TELNET %s%s %s",
+		       port ? "/PORT=" : "",
+		       NonNull(port),
+		       hostname);
+	}
 
-	} else { /* UNIX command syntax */
-	   if (login_protocol == rlogin) {
-	       HTSprintf0(&command, "RLOGIN %s%s%s%s%s",
-		   hostname,
-		   user ? " -l " : "",
-		   user ? "\"" : "",
-		   NonNull(user),
-		   user ? "\"" : "");
+    } else {			/* UNIX command syntax */
+	if (login_protocol == rlogin) {
+	    HTSprintf0(&command, "RLOGIN %s%s%s%s%s",
+		       hostname,
+		       user ? " -l " : "",
+		       user ? "\"" : "",
+		       NonNull(user),
+		       user ? "\"" : "");
 
-	    } else if (login_protocol == tn3270) {
-		HTSprintf0(&command, "TN3270 %s %s",
-		    hostname,
-		    NonNull(port));
+	} else if (login_protocol == tn3270) {
+	    HTSprintf0(&command, "TN3270 %s %s",
+		       hostname,
+		       NonNull(port));
 
-	    } else {  /* TELNET */
-		HTSprintf0(&command, "TELNET %s %s",
-		    hostname,
-		    NonNull(port));
-	    }
+	} else {		/* TELNET */
+	    HTSprintf0(&command, "TELNET %s %s",
+		       hostname,
+		       NonNull(port));
 	}
+    }
 
-	do_system(command);
+    do_system(command);
 #define TELNET_DONE
 #endif /* WIN_TCP */
 
 #if !defined(TELNET_DONE) && defined(UCX)
-	if (login_protocol == rlogin) {
-	    HTSprintf0(&command, "RLOGIN%s%s%s %s %s",
-		user ? "/USERNAME=\"" : "",
-		NonNull(user),
-		user ? "\"" : "",
-		hostname,
-		NonNull(port));
+    if (login_protocol == rlogin) {
+	HTSprintf0(&command, "RLOGIN%s%s%s %s %s",
+		   user ? "/USERNAME=\"" : "",
+		   NonNull(user),
+		   user ? "\"" : "",
+		   hostname,
+		   NonNull(port));
 
-	} else if (login_protocol == tn3270) {
-	    HTSprintf0(&command, "TN3270 %s %s",
-		hostname,
-		NonNull(port));
+    } else if (login_protocol == tn3270) {
+	HTSprintf0(&command, "TN3270 %s %s",
+		   hostname,
+		   NonNull(port));
 
-	} else {  /* TELNET */
-	    HTSprintf0(&command, "TELNET %s %s",
-		hostname,
-		NonNull(port));
-	}
+    } else {			/* TELNET */
+	HTSprintf0(&command, "TELNET %s %s",
+		   hostname,
+		   NonNull(port));
+    }
 
-	do_system(command);
+    do_system(command);
 #define TELNET_DONE
 #endif /* UCX */
 
 #if !defined(TELNET_DONE) && defined(CMU_TCP)
-	if (login_protocol == telnet) {
-	    HTSprintf0(&command, "TELNET %s%s %s",
-		port ? "/PORT=" : "",
-		NonNull(port),
-		hostname);
-	    do_system(command);
-	}
-	else {
-	    printf(
-	"\nSorry, this browser was compiled without the %s access option.\n",
-		acc_method);
-	    printf("\nPress <return> to return to Lynx.");
-	    LYgetch();
-	    HadVMSInterrupt = FALSE;
-	}
+    if (login_protocol == telnet) {
+	HTSprintf0(&command, "TELNET %s%s %s",
+		   port ? "/PORT=" : "",
+		   NonNull(port),
+		   hostname);
+	do_system(command);
+    } else {
+	printf("\nSorry, this browser was compiled without the %s access option.\n",
+	       acc_method);
+	printf("\nPress <return> to return to Lynx.");
+	LYgetch();
+	HadVMSInterrupt = FALSE;
+    }
 #define TELNET_DONE
 #endif /* CMU_TCP */
 
 #if !defined(TELNET_DONE) && defined(SOCKETSHR_TCP)
     if (getenv("MULTINET_SOCKET_LIBRARY") != NULL) {
 	if (login_protocol == rlogin) {
-	    HTSprintf0(&command, "MULTINET RLOGIN%s%s%s%s %s",  /*lm 930713 */
-		user ? "/USERNAME=" : "",
-		NonNull(user),
-		port ? "/PORT=" : "",
-		NonNull(port),
-		hostname);
+	    HTSprintf0(&command, "MULTINET RLOGIN%s%s%s%s %s",	/*lm 930713 */
+		       user ? "/USERNAME=" : "",
+		       NonNull(user),
+		       port ? "/PORT=" : "",
+		       NonNull(port),
+		       hostname);
 
 	} else if (login_protocol == tn3270) {
 	    HTSprintf0(&command, "MULTINET TELNET/TN3270 %s%s %s",
-		port ? "/PORT=" : "",
-		NonNull(port),
-		hostname);
+		       port ? "/PORT=" : "",
+		       NonNull(port),
+		       hostname);
 
-	} else {  /* TELNET */
+	} else {		/* TELNET */
 	    HTSprintf0(&command, "MULTINET TELNET %s%s %s",
-		port ? "/PORT=" : "",
-		NonNull(port),
-		hostname);
+		       port ? "/PORT=" : "",
+		       NonNull(port),
+		       hostname);
 	}
 
 	do_system(command);
-	return HT_NO_DATA;		/* Ok - it was done but no data */
-    }
-    else if ((cp=getenv("WINTCP_COMMAND_STYLE")) != NULL) {
-	if (0==strncasecomp(cp, "VMS", 3)) { /* VMS command syntax */
+	return HT_NO_DATA;	/* Ok - it was done but no data */
+    } else if ((cp = getenv("WINTCP_COMMAND_STYLE")) != NULL) {
+	if (0 == strncasecomp(cp, "VMS", 3)) {	/* VMS command syntax */
 	    if (login_protocol == rlogin) {
-		HTSprintf0(&command, "RLOGIN%s%s%s%s %s",  /*lm 930713 */
-		    user ? "/USERNAME=" : "",
-		    NonNull(user),
-		    port ? "/PORT=" : "",
-		    NonNull(port),
-		    hostname);
+		HTSprintf0(&command, "RLOGIN%s%s%s%s %s",	/*lm 930713 */
+			   user ? "/USERNAME=" : "",
+			   NonNull(user),
+			   port ? "/PORT=" : "",
+			   NonNull(port),
+			   hostname);
 	    } else if (login_protocol == tn3270) {
 		HTSprintf0(&command, "TELNET/TN3270 %s%s %s",
-		    port ? "/PORT=" : "",
-		    NonNull(port),
-		    hostname);
-	    } else {  /* TELNET */
+			   port ? "/PORT=" : "",
+			   NonNull(port),
+			   hostname);
+	    } else {		/* TELNET */
 		HTSprintf0(&command, "TELNET %s%s %s",
-		    port ? "/PORT=" : "",
-		    NonNull(port),
-		    hostname);
+			   port ? "/PORT=" : "",
+			   NonNull(port),
+			   hostname);
 	    }
-	} else { /* UNIX command syntax */
+	} else {		/* UNIX command syntax */
 	    if (login_protocol == rlogin) {
 		HTSprintf0(&command, "RLOGIN %s%s%s",
-		    hostname,
-		    user ? " -l " : "",
-		    NonNull(user));
+			   hostname,
+			   user ? " -l " : "",
+			   NonNull(user));
 	    } else if (login_protocol == tn3270) {
 		HTSprintf0(&command, "TN3270 %s %s",
-		    hostname,
-		    NonNull(port));
-	    } else {  /* TELNET */
+			   hostname,
+			   NonNull(port));
+	    } else {		/* TELNET */
 		HTSprintf0(&command, "TELNET %s %s",
-		    hostname,
-		    NonNull(port));
+			   hostname,
+			   NonNull(port));
 	    }
 	}
 
 	do_system(command);
-	return HT_NO_DATA;		/* Ok - it was done but no data */
-    }
-    else if (getenv("UCX$DEVICE") != NULL
-          || getenv("TCPIP$DEVICE") != NULL) {
+	return HT_NO_DATA;	/* Ok - it was done but no data */
+    } else if (getenv("UCX$DEVICE") != NULL
+	       || getenv("TCPIP$DEVICE") != NULL) {
 	if (login_protocol == rlogin) {
 	    HTSprintf0(&command, "RLOGIN%s%s %s %s",
-		user ? "/USERNAME=" : "",
-		NonNull(user),
-		hostname,
-		NonNull(port));
+		       user ? "/USERNAME=" : "",
+		       NonNull(user),
+		       hostname,
+		       NonNull(port));
 
 	} else if (login_protocol == tn3270) {
 	    HTSprintf0(&command, "TN3270 %s %s",
-		hostname,
-		NonNull(port));
+		       hostname,
+		       NonNull(port));
 
-	} else {  /* TELNET */
+	} else {		/* TELNET */
 	    HTSprintf0(&command, "TELNET %s %s",
-		hostname,
-		NonNull(port));
+		       hostname,
+		       NonNull(port));
 	}
 
 	do_system(command);
-	return HT_NO_DATA;		/* Ok - it was done but no data */
-    }
-    else if (getenv("CMUTEK_ROOT") != NULL) {
+	return HT_NO_DATA;	/* Ok - it was done but no data */
+    } else if (getenv("CMUTEK_ROOT") != NULL) {
 	if (login_protocol == telnet) {
 	    HTSprintf0(&command, "TELNET %s%s %s",
-		port ? "/PORT=" : "",
-		NonNull(port),
-		hostname);
+		       port ? "/PORT=" : "",
+		       NonNull(port),
+		       hostname);
 	    do_system(command);
-	}
-	else {
-	    printf(
-	  "\nSorry, this browser was compiled without the %s access option.\n",
-		acc_method);
+	} else {
+	    printf("\nSorry, this browser was compiled without the %s access option.\n",
+		   acc_method);
 	    printf("\nPress <return> to return to Lynx.");
 	    LYgetch();
 	    HadVMSInterrupt = FALSE;
 	}
-    }
-    else {
+    } else {
 	if (login_protocol == telnet) {
 	    HTSprintf0(&command, "TELNET %s%s %s",
-		port ? "/PORT=" : "",
-		NonNull(port),
-		hostname);
+		       port ? "/PORT=" : "",
+		       NonNull(port),
+		       hostname);
 	    do_system(command);
-	}
-	else {
-	    printf(
-	  "\nSorry, this browser was compiled without the %s access option.\n",
-		acc_method);
+	} else {
+	    printf("\nSorry, this browser was compiled without the %s access option.\n",
+		   acc_method);
 	    printf("\nPress <return> to return to Lynx.");
 	    LYgetch();
 	    HadVMSInterrupt = FALSE;
@@ -458,69 +456,65 @@ static int remote_session (char *  acc_method, char *  host)
 #endif /* SOCKETSHR_TCP */
 
 #if !defined(TELNET_DONE) && (defined(SIMPLE_TELNET) || defined(VM))
-	if (login_protocol == telnet) {			/* telnet only */
-	    HTSprintf0(&command, "TELNET  %s",	/* @@ Bug: port ignored */
-		hostname);
-	    do_system(command);
-	    return HT_NO_DATA;		/* Ok - it was done but no data */
-	}
+    if (login_protocol == telnet) {	/* telnet only */
+	HTSprintf0(&command, "TELNET  %s",	/* @@ Bug: port ignored */
+		   hostname);
+	do_system(command);
+	return HT_NO_DATA;	/* Ok - it was done but no data */
+    }
 #define TELNET_DONE
 #endif
 
 #ifndef TELNET_DONE
-	printf(
-	"\nSorry, this browser was compiled without the %s access option.\n",
-		acc_method);
-	printf(
-	"\nTo access the information you must %s to %s", acc_method, hostname);
-	if (port)
-	    printf(" (port %s)", port);
-	if (user)
-	    printf("\nlogging in with username %s", user);
-	printf(".\n");
-	{
-	    printf("\nPress <return> to return to Lynx.");
-	    fflush(stdout);
-	    LYgetch();
+    printf("\nSorry, this browser was compiled without the %s access option.\n",
+	   acc_method);
+    printf("\nTo access the information you must %s to %s", acc_method, hostname);
+    if (port)
+	printf(" (port %s)", port);
+    if (user)
+	printf("\nlogging in with username %s", user);
+    printf(".\n");
+    {
+	printf("\nPress <return> to return to Lynx.");
+	fflush(stdout);
+	LYgetch();
 #ifdef VMS
-	    HadVMSInterrupt = FALSE;
+	HadVMSInterrupt = FALSE;
 #endif /* VMS */
-	}
+    }
 #endif /* !TELNET_DONE */
-	return HT_NO_DATA;
+    return HT_NO_DATA;
 }
 
 /*	"Load a document" -- establishes a session
-**	------------------------------------------
-**
-** On entry,
-**	addr		must point to the fully qualified hypertext reference.
-**
-** On exit,
-**	returns		<0	Error has occured.
-**			>=0	Value of file descriptor or socket to be used
-**				 to read data.
-**	*pFormat	Set to the format of the file, if known.
-**			(See WWW.h)
-**
-*/
-static int HTLoadTelnet
-(
- const char *		addr,
- HTParentAnchor *	anchor GCC_UNUSED,
- HTFormat		format_out GCC_UNUSED,
- HTStream *		sink			/* Ignored */
-)
+ *	------------------------------------------
+ *
+ * On entry,
+ *	addr		must point to the fully qualified hypertext reference.
+ *
+ * On exit,
+ *	returns		<0	Error has occured.
+ *			>=0	Value of file descriptor or socket to be used
+ *				 to read data.
+ *	*pFormat	Set to the format of the file, if known.
+ *			(See WWW.h)
+ *
+ */
+static int HTLoadTelnet(const char *addr,
+			HTParentAnchor *anchor GCC_UNUSED,
+			HTFormat format_out GCC_UNUSED,
+			HTStream *sink)		/* Ignored */
 {
-    char * acc_method;
-    char * host;
+    char *acc_method;
+    char *host;
     int status;
 
     if (sink) {
-	CTRACE((tfp, "HTTelnet: Can't output a live session -- must be interactive!\n"));
+	CTRACE((tfp,
+		"HTTelnet: Can't output a live session -- must be interactive!\n"));
 	return HT_NO_DATA;
     }
-    acc_method =  HTParse(addr, STR_FILE_URL, PARSE_ACCESS);
+    acc_method = HTParse(addr, STR_FILE_URL, PARSE_ACCESS);
 
     host = HTParse(addr, "", PARSE_HOST);
     if (!host || *host == '\0') {
@@ -535,16 +529,18 @@ static int HTLoadTelnet
     return status;
 }
 
-
 #ifdef GLOBALDEF_IS_MACRO
 #define _HTTELNET_C_1_INIT { "telnet", HTLoadTelnet, NULL }
 #define _HTTELNET_C_2_INIT { "rlogin", HTLoadTelnet, NULL }
 #define _HTTELNET_C_3_INIT { "tn3270", HTLoadTelnet, NULL }
-GLOBALDEF (HTProtocol, HTTelnet, _HTTELNET_C_1_INIT );
-GLOBALDEF (HTProtocol, HTRlogin, _HTTELNET_C_2_INIT );
-GLOBALDEF (HTProtocol, HTTn3270, _HTTELNET_C_3_INIT );
+GLOBALDEF(HTProtocol, HTTelnet, _HTTELNET_C_1_INIT);
+GLOBALDEF(HTProtocol, HTRlogin, _HTTELNET_C_2_INIT);
+GLOBALDEF(HTProtocol, HTTn3270, _HTTELNET_C_3_INIT);
 #else
-GLOBALDEF HTProtocol HTTelnet = { "telnet", HTLoadTelnet, NULL };
-GLOBALDEF HTProtocol HTRlogin = { "rlogin", HTLoadTelnet, NULL };
-GLOBALDEF HTProtocol HTTn3270 = { "tn3270", HTLoadTelnet, NULL };
+GLOBALDEF HTProtocol HTTelnet =
+{"telnet", HTLoadTelnet, NULL};
+GLOBALDEF HTProtocol HTRlogin =
+{"rlogin", HTLoadTelnet, NULL};
+GLOBALDEF HTProtocol HTTn3270 =
+{"tn3270", HTLoadTelnet, NULL};
 #endif /* GLOBALDEF_IS_MACRO */
diff --git a/WWW/Library/Implementation/HTTelnet.h b/WWW/Library/Implementation/HTTelnet.h
index 92dbf2ff..2f84bd8d 100644
--- a/WWW/Library/Implementation/HTTelnet.h
+++ b/WWW/Library/Implementation/HTTelnet.h
@@ -9,9 +9,10 @@
 #include <HTAccess.h>
 
 #ifdef GLOBALREF_IS_MACRO
-extern GLOBALREF(HTProtocol,HTTelnet);
-extern GLOBALREF(HTProtocol,HTRlogin);
-extern GLOBALREF(HTProtocol,HTTn3270);
+extern GLOBALREF (HTProtocol, HTTelnet);
+extern GLOBALREF (HTProtocol, HTRlogin);
+extern GLOBALREF (HTProtocol, HTTn3270);
+
 #else
 GLOBALREF HTProtocol HTTelnet;
 GLOBALREF HTProtocol HTRlogin;
diff --git a/WWW/Library/Implementation/HTUU.c b/WWW/Library/Implementation/HTUU.c
index 24cf4588..55f4575c 100644
--- a/WWW/Library/Implementation/HTUU.c
+++ b/WWW/Library/Implementation/HTUU.c
@@ -1,59 +1,59 @@
 
 /* MODULE							HTUU.c
-**			UUENCODE AND UUDECODE
-**
-** ACKNOWLEDGEMENT:
-**	This code is taken from rpem distribution, and was originally
-**	written by Mark Riordan.
-**
-** AUTHORS:
-**	MR	Mark Riordan	riordanmr@clvax1.cl.msu.edu
-**	AL	Ari Luotonen	luotonen@dxcern.cern.ch
-**
-** HISTORY:
-**	Added as part of the WWW library and edited to conform
-**	with the WWW project coding standards by:	AL  5 Aug 1993
-**	Originally written by:				MR 12 Aug 1990
-**	Original header text:
-** -------------------------------------------------------------
-**  File containing routines to convert a buffer
-**  of bytes to/from RFC 1113 printable encoding format.
-**
-**  This technique is similar to the familiar Unix uuencode
-**  format in that it maps 6 binary bits to one ASCII
-**  character (or more aptly, 3 binary bytes to 4 ASCII
-**  characters).  However, RFC 1113 does not use the same
-**  mapping to printable characters as uuencode.
-**
-**  Mark Riordan   12 August 1990 and 17 Feb 1991.
-**  This code is hereby placed in the public domain.
-** -------------------------------------------------------------
-**
-** BUGS:
-**
-**
-*/
+ *			UUENCODE AND UUDECODE
+ *
+ * ACKNOWLEDGEMENT:
+ *	This code is taken from rpem distribution, and was originally
+ *	written by Mark Riordan.
+ *
+ * AUTHORS:
+ *	MR	Mark Riordan	riordanmr@clvax1.cl.msu.edu
+ *	AL	Ari Luotonen	luotonen@dxcern.cern.ch
+ *
+ * HISTORY:
+ *	Added as part of the WWW library and edited to conform
+ *	with the WWW project coding standards by:	AL  5 Aug 1993
+ *	Originally written by:				MR 12 Aug 1990
+ *	Original header text:
+ * -------------------------------------------------------------
+ *  File containing routines to convert a buffer
+ *  of bytes to/from RFC 1113 printable encoding format.
+ *
+ *  This technique is similar to the familiar Unix uuencode
+ *  format in that it maps 6 binary bits to one ASCII
+ *  character (or more aptly, 3 binary bytes to 4 ASCII
+ *  characters).  However, RFC 1113 does not use the same
+ *  mapping to printable characters as uuencode.
+ *
+ *  Mark Riordan   12 August 1990 and 17 Feb 1991.
+ *  This code is hereby placed in the public domain.
+ * -------------------------------------------------------------
+ *
+ * BUGS:
+ *
+ *
+ */
 
 #include <HTUtils.h>
 #include <HTUU.h>
 
 #include <LYLeaks.h>
 
-static char six2pr[64] = {
-    'A','B','C','D','E','F','G','H','I','J','K','L','M',
-    'N','O','P','Q','R','S','T','U','V','W','X','Y','Z',
-    'a','b','c','d','e','f','g','h','i','j','k','l','m',
-    'n','o','p','q','r','s','t','u','v','w','x','y','z',
-    '0','1','2','3','4','5','6','7','8','9','+','/'
+static char six2pr[64] =
+{
+    'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',
+    'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
+    'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm',
+    'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
+    '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '+', '/'
 };
 
 static unsigned char pr2six[256];
 
-
 /*--- function HTUU_encode -----------------------------------------------
  *
- *   Encode a single line of binary data to a standard format that
- *   uses only printing ASCII characters (but takes up 33% more bytes).
+ * Encode a single line of binary data to a standard format that
+ * uses only printing ASCII characters (but takes up 33% more bytes).
  *
  *    Entry    bufin    points to a buffer of bytes.  If nbytes is not
  *                      a multiple of three, then the byte just beyond
@@ -70,45 +70,45 @@ static unsigned char pr2six[256];
  *                      The last byte is a zero byte.
  *             Returns the number of ASCII characters in "bufcoded".
  */
-int HTUU_encode (unsigned char *	bufin,
-			     unsigned int	nbytes,
-			     char *		bufcoded)
+int HTUU_encode(unsigned char *bufin,
+		unsigned int nbytes,
+		char *bufcoded)
 {
 /* ENC is the basic 1 character encoding function to make a char printing */
 #define ENC(c) six2pr[c]
 
-   register char *outptr = bufcoded;
-   unsigned int i;
-   /* This doesn't seem to be needed (AL):   register unsigned char *inptr  = bufin; */
-
-   for (i=0; i<nbytes; i += 3) {
-      *(outptr++) = ENC(*bufin >> 2);            /* c1 */
-      *(outptr++) = ENC(((*bufin << 4) & 060) | ((bufin[1] >> 4) & 017)); /*c2*/
-      *(outptr++) = ENC(((bufin[1] << 2) & 074) | ((bufin[2] >> 6) & 03));/*c3*/
-      *(outptr++) = ENC(bufin[2] & 077);         /* c4 */
-
-      bufin += 3;
-   }
-
-   /* If nbytes was not a multiple of 3, then we have encoded too
-    * many characters.  Adjust appropriately.
-    */
-   if(i == nbytes+1) {
-      /* There were only 2 bytes in that last group */
-      outptr[-1] = '=';
-   } else if(i == nbytes+2) {
-      /* There was only 1 byte in that last group */
-      outptr[-1] = '=';
-      outptr[-2] = '=';
-   }
-   *outptr = '\0';
-   return(outptr - bufcoded);
+    register char *outptr = bufcoded;
+    unsigned int i;
+
+    /* This doesn't seem to be needed (AL):   register unsigned char *inptr  = bufin; */
+
+    for (i = 0; i < nbytes; i += 3) {
+	*(outptr++) = ENC(*bufin >> 2);		/* c1 */
+	*(outptr++) = ENC(((*bufin << 4) & 060) | ((bufin[1] >> 4) & 017));	/*c2 */
+	*(outptr++) = ENC(((bufin[1] << 2) & 074) | ((bufin[2] >> 6) & 03));	/*c3 */
+	*(outptr++) = ENC(bufin[2] & 077);	/* c4 */
+
+	bufin += 3;
+    }
+
+    /* If nbytes was not a multiple of 3, then we have encoded too
+     * many characters.  Adjust appropriately.
+     */
+    if (i == nbytes + 1) {
+	/* There were only 2 bytes in that last group */
+	outptr[-1] = '=';
+    } else if (i == nbytes + 2) {
+	/* There was only 1 byte in that last group */
+	outptr[-1] = '=';
+	outptr[-2] = '=';
+    }
+    *outptr = '\0';
+    return (outptr - bufcoded);
 }
 
-
 /*--- function HTUU_decode ------------------------------------------------
  *
- *  Decode an ASCII-encoded buffer back to its original binary form.
+ * Decode an ASCII-encoded buffer back to its original binary form.
  *
  *    Entry    bufcoded    points to a uuencoded string.  It is
  *                         terminated by any character not in
@@ -125,30 +125,33 @@ int HTUU_encode (unsigned char *	bufin,
  *    Exit     Returns the number of binary bytes decoded.
  *             bufplain    contains these bytes.
  */
-int HTUU_decode (char *		bufcoded,
-			     unsigned char *	bufplain,
-			     int		outbufsize)
+int HTUU_decode(char *bufcoded,
+		unsigned char *bufplain,
+		int outbufsize)
 {
 /* single character decode */
 #define DEC(c) pr2six[(int)c]
 #define MAXVAL 63
 
-   static int first = 1;
+    static int first = 1;
 
-   int nbytesdecoded, j;
-   register char *bufin = bufcoded;
-   register unsigned char *bufout = bufplain;
-   register int nprbytes;
+    int nbytesdecoded, j;
+    register char *bufin = bufcoded;
+    register unsigned char *bufout = bufplain;
+    register int nprbytes;
 
-   /* If this is the first call, initialize the mapping table.
-    * This code should work even on non-ASCII machines.
-    */
-   if(first) {
-      first = 0;
-      for(j=0; j<256; j++) pr2six[j] = MAXVAL+1;
+    /* If this is the first call, initialize the mapping table.
+     * This code should work even on non-ASCII machines.
+     */
+    if (first) {
+	first = 0;
+	for (j = 0; j < 256; j++)
+	    pr2six[j] = MAXVAL + 1;
 
-      for(j=0; j<64; j++) pr2six[UCH(six2pr[j])] = UCH(j);
+	for (j = 0; j < 64; j++)
+	    pr2six[UCH(six2pr[j])] = UCH(j);
 #if 0
+      /* *INDENT-OFF* */
       pr2six['A']= 0; pr2six['B']= 1; pr2six['C']= 2; pr2six['D']= 3;
       pr2six['E']= 4; pr2six['F']= 5; pr2six['G']= 6; pr2six['H']= 7;
       pr2six['I']= 8; pr2six['J']= 9; pr2six['K']=10; pr2six['L']=11;
@@ -165,43 +168,45 @@ int HTUU_decode (char *		bufcoded,
       pr2six['0']=52; pr2six['1']=53; pr2six['2']=54; pr2six['3']=55;
       pr2six['4']=56; pr2six['5']=57; pr2six['6']=58; pr2six['7']=59;
       pr2six['8']=60; pr2six['9']=61; pr2six['+']=62; pr2six['/']=63;
+      /* *INDENT-ON* */
+
 #endif
-   }
-
-   /* Strip leading whitespace. */
-
-   while(*bufcoded==' ' || *bufcoded == '\t') bufcoded++;
-
-   /* Figure out how many characters are in the input buffer.
-    * If this would decode into more bytes than would fit into
-    * the output buffer, adjust the number of input bytes downwards.
-    */
-   bufin = bufcoded;
-   while(pr2six[UCH(*(bufin++))] <= MAXVAL);
-   nprbytes = bufin - bufcoded - 1;
-   nbytesdecoded = ((nprbytes+3)/4) * 3;
-   if(nbytesdecoded > outbufsize) {
-      nprbytes = (outbufsize*4)/3;
-   }
-
-   bufin = bufcoded;
-
-   while (nprbytes > 0) {
-      *(bufout++) = UCH((DEC(bufin[0]) << 2) | (DEC(bufin[1]) >> 4));
-      *(bufout++) = UCH((DEC(bufin[1]) << 4) | (DEC(bufin[2]) >> 2));
-      *(bufout++) = UCH((DEC(bufin[2]) << 6) | (DEC(bufin[3])));
-      bufin += 4;
-      nprbytes -= 4;
-   }
-
-   if(nprbytes & 03) {
-      if(pr2six[(int)bufin[-2]] > MAXVAL) {
-	 nbytesdecoded -= 2;
-      } else {
-	 nbytesdecoded -= 1;
-      }
-   }
-
-   return(nbytesdecoded);
+    }
+
+    /* Strip leading whitespace. */
+
+    while (*bufcoded == ' ' || *bufcoded == '\t')
+	bufcoded++;
+
+    /* Figure out how many characters are in the input buffer.
+     * If this would decode into more bytes than would fit into
+     * the output buffer, adjust the number of input bytes downwards.
+     */
+    bufin = bufcoded;
+    while (pr2six[UCH(*(bufin++))] <= MAXVAL) ;
+    nprbytes = bufin - bufcoded - 1;
+    nbytesdecoded = ((nprbytes + 3) / 4) * 3;
+    if (nbytesdecoded > outbufsize) {
+	nprbytes = (outbufsize * 4) / 3;
+    }
+
+    bufin = bufcoded;
+
+    while (nprbytes > 0) {
+	*(bufout++) = UCH((DEC(bufin[0]) << 2) | (DEC(bufin[1]) >> 4));
+	*(bufout++) = UCH((DEC(bufin[1]) << 4) | (DEC(bufin[2]) >> 2));
+	*(bufout++) = UCH((DEC(bufin[2]) << 6) | (DEC(bufin[3])));
+	bufin += 4;
+	nprbytes -= 4;
+    }
+
+    if (nprbytes & 03) {
+	if (pr2six[(int) bufin[-2]] > MAXVAL) {
+	    nbytesdecoded -= 2;
+	} else {
+	    nbytesdecoded -= 1;
+	}
+    }
+
+    return (nbytesdecoded);
 }
-
diff --git a/WWW/Library/Implementation/HTUU.h b/WWW/Library/Implementation/HTUU.h
index e3cc02f9..6a0d4a7c 100644
--- a/WWW/Library/Implementation/HTUU.h
+++ b/WWW/Library/Implementation/HTUU.h
@@ -1,10 +1,11 @@
 /*                              ENCODING TO PRINTABLE CHARACTERS
 
-   File module provides functions HTUU_encode() and HTUU_decode() which convert a buffer
-   of bytes to/from RFC 1113 printable encoding format.  This technique is similar to the
-   familiar Unix uuencode format in that it maps 6 binary bits to one ASCII character (or
-   more aptly, 3 binary bytes to 4 ASCII characters).  However, RFC 1113 does not use the
-   same mapping to printable characters as uuencode.
+   File module provides functions HTUU_encode() and HTUU_decode() which convert
+   a buffer of bytes to/from RFC 1113 printable encoding format.  This
+   technique is similar to the familiar Unix uuencode format in that it maps 6
+   binary bits to one ASCII character (or more aptly, 3 binary bytes to 4 ASCII
+   characters).  However, RFC 1113 does not use the same mapping to printable
+   characters as uuencode.
 
  */
 
@@ -14,13 +15,13 @@
 #ifndef HTUTILS_H
 #include <HTUtils.h>
 #endif
- 
-extern int HTUU_encode (unsigned char *bufin,
-                               unsigned int nbytes,
-                               char *bufcoded);
 
-extern int HTUU_decode (char *bufcoded,
-                               unsigned char *bufplain,
-                               int outbufsize);
+extern int HTUU_encode(unsigned char *bufin,
+		       unsigned int nbytes,
+		       char *bufcoded);
+
+extern int HTUU_decode(char *bufcoded,
+		       unsigned char *bufplain,
+		       int outbufsize);
 
 #endif /* HTUU_H */
diff --git a/WWW/Library/Implementation/HTUtils.h b/WWW/Library/Implementation/HTUtils.h
index 0b6cbee8..9e3734b6 100644
--- a/WWW/Library/Implementation/HTUtils.h
+++ b/WWW/Library/Implementation/HTUtils.h
@@ -6,14 +6,14 @@
  */
 
 #ifndef NO_LYNX_TRACE
-#define DEBUG   /* Turns on trace; turn off for smaller binary */
+#define DEBUG			/* Turns on trace; turn off for smaller binary */
 #endif
 
 #ifndef HTUTILS_H
 #define HTUTILS_H
 
 #ifdef HAVE_CONFIG_H
-#include <lynx_cfg.h>	/* generated by autoconf 'configure' script */
+#include <lynx_cfg.h>		/* generated by autoconf 'configure' script */
 
 /* see AC_FUNC_ALLOCA macro */
 #ifdef __GNUC__
@@ -27,10 +27,11 @@
 #   include <alloca.h>
 #  else
 #   ifdef _AIX
- #pragma alloca
+#pragma alloca
 #   else
-#    ifndef alloca /* predefined by HP cc +Olibcalls */
-char *alloca ();
+#    ifndef alloca		/* predefined by HP cc +Olibcalls */
+char *alloca();
+
 #    endif
 #   endif
 #  endif
@@ -40,10 +41,10 @@ char *alloca ();
 #include <sys/types.h>
 #include <stdio.h>
 
-#else  /* HAVE_CONFIG_H */
+#else /* HAVE_CONFIG_H */
 
 #ifdef DJGPP
-#include <sys/config.h>	/* pseudo-autoconf values for DJGPP libc/headers */
+#include <sys/config.h>		/* pseudo-autoconf values for DJGPP libc/headers */
 #define HAVE_TRUNCATE 1
 #define HAVE_ALLOCA 1
 #include <limits.h>
@@ -57,13 +58,13 @@ char *alloca ();
 #ifdef VMS
 #define NO_SIZECHANGE
 #if defined(VAXC) && !defined(__DECC)
-#define NO_UNISTD_H	/* DEC C has unistd.h, but not VAX C */
+#define NO_UNISTD_H		/* DEC C has unistd.h, but not VAX C */
 #endif
 #define NO_KEYPAD
 #define NO_UTMP
 #define NO_FILIO_H
 #define NOUSERS
-#define DISP_PARTIAL	/* experimental */
+#define DISP_PARTIAL		/* experimental */
 #endif
 
 /* since 2.8.6dev.1, Lynx requires an ANSI C (c89) compiler */
@@ -146,16 +147,13 @@ char *alloca ();
 #endif
 
 #ifndef	GCC_NORETURN
-#define	GCC_NORETURN /* nothing */
+#define	GCC_NORETURN		/* nothing */
 #endif
 
 #ifndef	GCC_UNUSED
-#define	GCC_UNUSED /* nothing */
+#define	GCC_UNUSED		/* nothing */
 #endif
 
-/* since 2.8.6dev.1, Lynx requires an ANSI C (c89) compiler */
-#define ANSI_PREPRO 1
-
 #if defined(__CYGWIN32__) && ! defined(__CYGWIN__)
 #define __CYGWIN__ 1
 #endif
@@ -180,6 +178,7 @@ char *alloca ();
 #endif
 #undef sleep			/* 1998/06/23 (Tue) 16:54:53 */
 extern void sleep(unsigned __seconds);
+
 #define popen _popen
 #define pclose _pclose
 
@@ -223,7 +222,7 @@ typedef unsigned short mode_t;
    placeholder for something more sophisticated.
 
  */
-typedef void * HTError;                 /* Unused at present -- best definition? */
+typedef void *HTError;		/* Unused at present -- best definition? */
 
 /*
 
@@ -243,14 +242,14 @@ Standard C library for malloc() etc
 #endif
 
 #ifdef __EMX__
-#include <unistd.h> /* should be re-include protected under EMX */
+#include <unistd.h>		/* should be re-include protected under EMX */
 #define getcwd _getcwd2
 #define chdir _chdir2
 #endif
 
 #ifdef vax
 #ifdef unix
-#define ultrix  /* Assume vax+unix=ultrix */
+#define ultrix			/* Assume vax+unix=ultrix */
 #endif /* unix */
 #endif /* vax */
 
@@ -258,7 +257,7 @@ Standard C library for malloc() etc
 #ifndef ultrix
 
 #ifdef NeXT
-#include <libc.h>       /* NeXT */
+#include <libc.h>		/* NeXT */
 #endif /* NeXT */
 
 #else /* ultrix: */
@@ -267,7 +266,7 @@ Standard C library for malloc() etc
 #include <memory.h>
 
 #endif /* !ultrix */
-#else   /* VMS: */
+#else /* VMS: */
 
 #include <unixlib.h>
 #if defined(VAXC) && !defined(__DECC)
@@ -320,16 +319,17 @@ Booleans
 
 #ifndef _WINDOWS
 #ifndef BOOLEAN_DEFINED
-    typedef char    BOOLEAN;	/* Logical value */
+typedef char BOOLEAN;		/* Logical value */
+
 #ifndef CURSES
 #ifndef TRUE
 #define TRUE    (BOOLEAN)1
 #define FALSE   (BOOLEAN)0
 #endif
-#endif   /*  CURSES  */
-#endif	 /*  BOOLEAN_DEFINED */
+#endif /*  CURSES  */
+#endif /*  BOOLEAN_DEFINED */
 #define BOOLEAN_DEFINED
-#endif   /* _WINDOWS */
+#endif /* _WINDOWS */
 
 #ifndef BOOL
 #define BOOL BOOLEAN
@@ -342,10 +342,10 @@ Booleans
 
 extern BOOL LYOutOfMemory;	/* Declared in LYexit.c - FM */
 
-#define TCP_PORT 80     /* Allocated to http by Jon Postel/ISI 24-Jan-92 */
-#define OLD_TCP_PORT 2784       /* Try the old one if no answer on 80 */
-#define DNP_OBJ 80      /* This one doesn't look busy, but we must check */
-                        /* That one was for decnet */
+#define TCP_PORT 80		/* Allocated to http by Jon Postel/ISI 24-Jan-92 */
+#define OLD_TCP_PORT 2784	/* Try the old one if no answer on 80 */
+#define DNP_OBJ 80		/* This one doesn't look busy, but we must check */
+			/* That one was for decnet */
 
 /*      Inline Function WHITE: Is character c white space? */
 /*      For speed, include all control characters */
@@ -353,7 +353,7 @@ extern BOOL LYOutOfMemory;	/* Declared in LYexit.c - FM */
 #define WHITE(c) ((UCH(TOASCII(c))) <= 32)
 
 /*     Inline Function LYIsASCII: Is character c a traditional ASCII
-**     character (i.e. <128) after converting from host character set.  */
+ *     character (i.e. <128) after converting from host character set.  */
 
 #define LYIsASCII(c) (TOASCII(UCH(c)) < 128)
 
@@ -367,28 +367,28 @@ are generally not the response status from any specific protocol.
  */
 
 #define HT_REDIRECTING 399
-#define HT_LOADED 200                   /* Instead of a socket */
-#define HT_PARTIAL_CONTENT      206     /* Partial Content */
+#define HT_LOADED 200		/* Instead of a socket */
+#define HT_PARTIAL_CONTENT      206	/* Partial Content */
 #define HT_INTERRUPTED -29998
 #define HT_NOT_LOADED -29999
-#define HT_OK           0               /* Generic success*/
+#define HT_OK           0	/* Generic success */
 
-#define HT_ERROR                -1      /* Generic failure */
+#define HT_ERROR                -1	/* Generic failure */
 
 #define HT_CANNOT_TRANSLATE -4
 
 #define HT_NO_DATA		-204	/* OK but no data was loaded - */
 					/* possibly other app started or forked */
-#define HT_NO_ACCESS            -401    /* Access not available */
-#define HT_FORBIDDEN            -403    /* Access forbidden */
-#define HT_NOT_ACCEPTABLE       -406    /* Not Acceptable */
+#define HT_NO_ACCESS            -401	/* Access not available */
+#define HT_FORBIDDEN            -403	/* Access forbidden */
+#define HT_NOT_ACCEPTABLE       -406	/* Not Acceptable */
 
-#define HT_PARSER_REOPEN_ELT     700    /* tells SGML parser to keep tag open */
-#define HT_PARSER_OTHER_CONTENT  701    /* tells SGML to change content model */
-#define HT_H_ERRNO_VALID        -800    /* see h_errno for resolver error */
+#define HT_PARSER_REOPEN_ELT     700	/* tells SGML parser to keep tag open */
+#define HT_PARSER_OTHER_CONTENT  701	/* tells SGML to change content model */
+#define HT_H_ERRNO_VALID        -800	/* see h_errno for resolver error */
 
-#define HT_INTERNAL             -900    /* Weird -- should never happen. */
-#define HT_BAD_EOF      -12             /* Premature EOF */
+#define HT_INTERNAL             -900	/* Weird -- should never happen. */
+#define HT_BAD_EOF      -12	/* Premature EOF */
 
 #ifndef va_arg
 # if defined(HAVE_STDARG_H) && defined(ANSI_VARARGS)
@@ -414,11 +414,11 @@ are generally not the response status from any specific protocol.
 #if defined(GCC_PRINTF) && !defined(printf) && !defined(HAVE_LIBUTF8_H)
 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
 #else
-#define GCC_PRINTFLIKE(fmt,var) /*nothing*/
+#define GCC_PRINTFLIKE(fmt,var)	/*nothing */
 #endif
 #endif
 
-#include <HTString.h>   /* String utilities */
+#include <HTString.h>		/* String utilities */
 
 /*
 
@@ -432,7 +432,7 @@ Out Of Memory checking for malloc() return:
 
 #include <LYexit.h>
 
-extern void outofmem (const char *fname, const char *func);
+extern void outofmem(const char *fname, const char *func);
 
 /*
  * Upper- and Lowercase macros
@@ -454,9 +454,9 @@ extern void outofmem (const char *fname, const char *func);
 #define TOUPPER(c) ascii_toupper(UCH(c))
 #define ISUPPER(c) ascii_isupper(UCH(c))
 
-extern int ascii_toupper (int);
-extern int ascii_tolower (int);
-extern int ascii_isupper (int);
+extern int ascii_toupper(int);
+extern int ascii_tolower(int);
+extern int ascii_isupper(int);
 
 #else
 
@@ -479,8 +479,8 @@ The local equivalents of CR and LF
    translation.
 
  */
-#define LF   FROMASCII('\012')  /* ASCII line feed LOCAL EQUIVALENT */
-#define CR   FROMASCII('\015')  /* Will be converted to ^M for transmission */
+#define LF   FROMASCII('\012')	/* ASCII line feed LOCAL EQUIVALENT */
+#define CR   FROMASCII('\015')	/* Will be converted to ^M for transmission */
 
 /*
  * Debug message control.
@@ -509,7 +509,7 @@ extern int WWW_TraceMask;
 #if defined(LY_TRACELINE)
 #define LY_SHOWWHERE fprintf( tfp, "%s: %d: ", __FILE__, LY_TRACELINE ),
 #else
-#define LY_SHOWWHERE /* nothing */
+#define LY_SHOWWHERE		/* nothing */
 #endif
 
 #define CTRACE(p)         ((void)((TRACE) && ( LY_SHOWWHERE fprintf p )))
@@ -518,7 +518,7 @@ extern int WWW_TraceMask;
 #define CTRACE_SLEEP(secs) if (TRACE && LYTraceLogFP == 0) sleep(secs)
 #define CTRACE_FLUSH(fp)   if (TRACE) fflush(fp)
 
-extern FILE *TraceFP (void);
+extern FILE *TraceFP(void);
 
 #include <www_tcp.h>
 
@@ -529,7 +529,7 @@ extern FILE *TraceFP (void);
  * for the stdio functions as well as the network functions.
  */
 #if defined(USE_SOCKS5) && !defined(DONT_USE_SOCKS5)
-#define SOCKS4TO5	/* turn on the Rxxxx definitions used in Lynx */
+#define SOCKS4TO5		/* turn on the Rxxxx definitions used in Lynx */
 #include <socks.h>
 
 /*
@@ -568,7 +568,7 @@ extern FILE *TraceFP (void);
 
 #endif /* USE_SOCKS5 */
 
-#define SHORTENED_RBIND	/* FIXME: do this in configure-script */
+#define SHORTENED_RBIND		/* FIXME: do this in configure-script */
 
 #ifdef USE_SSL
 #define free_func free__func
@@ -591,7 +591,7 @@ extern FILE *TraceFP (void);
 #define SSL_VERIFY_PEER			0x01
 #endif
 
-#else	/* assume SSLeay */
+#else /* assume SSLeay */
 #include <ssl.h>
 #include <crypto.h>
 #include <rand.h>
@@ -601,24 +601,24 @@ extern FILE *TraceFP (void);
 
 #undef free_func
 
-extern SSL * HTGetSSLHandle (void);
-extern void HTSSLInitPRNG (void);
-extern char HTGetSSLCharacter (void * handle);
+extern SSL *HTGetSSLHandle(void);
+extern void HTSSLInitPRNG(void);
+extern char HTGetSSLCharacter(void *handle);
 
 #endif /* USE_SSL */
 
 #ifdef HAVE_LIBDMALLOC
-#include <dmalloc.h>    /* Gray Watson's library */
+#include <dmalloc.h>		/* Gray Watson's library */
 #define show_alloc() dmalloc_log_unfreed()
 #endif
 
 #ifdef HAVE_LIBDBMALLOC
-#include <dbmalloc.h>   /* Conor Cahill's library */
+#include <dbmalloc.h>		/* Conor Cahill's library */
 #define show_alloc() malloc_dump(fileno(stderr))
 #endif
 
 #ifndef show_alloc
-#define show_alloc()	/* nothing */
+#define show_alloc()		/* nothing */
 #endif
 
 #include <userdefs.h>
diff --git a/WWW/Library/Implementation/HTVMSUtils.c b/WWW/Library/Implementation/HTVMSUtils.c
index 3a918646..64319071 100644
--- a/WWW/Library/Implementation/HTVMSUtils.c
+++ b/WWW/Library/Implementation/HTVMSUtils.c
@@ -1,19 +1,20 @@
 
 /* MODULE							HTVMSUtil.c
-**		VMS Utility Routines
-**
-** AUTHORS:
-**	MD	Mark Donszelmann    duns@vxdeop.cern.ch
-**
-** HISTORY:
-**	14 Nov 93  MD	Written
-**
-** BUGS:
-**
-**
-*/
+ *		VMS Utility Routines
+ *
+ * AUTHORS:
+ *	MD	Mark Donszelmann    duns@vxdeop.cern.ch
+ *
+ * HISTORY:
+ *	14 Nov 93  MD	Written
+ *
+ * BUGS:
+ *
+ *
+ */
 
 #include <HTUtils.h>
+#ifdef VMS
 #include <HTFormat.h>
 #include <HTStream.h>
 #include <UCDefs.h>
@@ -37,341 +38,334 @@
 #include <LYLeaks.h>
 #include <LYStrings.h>
 
-BOOL HTVMSFileVersions = FALSE; /* Include version numbers in listing? */
+BOOL HTVMSFileVersions = FALSE;	/* Include version numbers in listing? */
 
 typedef struct {
-   unsigned long BufferLength : 16;
-   unsigned long ItemCode : 16;
-   unsigned long BufferAddress : 32;
-   unsigned long ReturnLengthAddress : 32;
+    unsigned long BufferLength:16;
+    unsigned long ItemCode:16;
+    unsigned long BufferAddress:32;
+    unsigned long ReturnLengthAddress:32;
 } ItemStruct;
 
 /* PUBLIC							HTVMS_authSysPrv()
-**		CHECKS IF THIS PROCESS IS AUTHORIZED TO ENABLE SYSPRV
-** ON ENTRY:
-**	No arguments.
-**
-** ON EXIT:
-**	returns	YES if SYSPRV is authorized
-*/
-BOOL HTVMS_authSysPrv (void)
+ *		CHECKS IF THIS PROCESS IS AUTHORIZED TO ENABLE SYSPRV
+ * ON ENTRY:
+ *	No arguments.
+ *
+ * ON EXIT:
+ *	returns	YES if SYSPRV is authorized
+ */
+BOOL HTVMS_authSysPrv(void)
 {
-unsigned long Result;
-ItemStruct ItemList[2];
-unsigned long Length;
-unsigned long Buffer[2];
+    unsigned long Result;
+    ItemStruct ItemList[2];
+    unsigned long Length;
+    unsigned long Buffer[2];
 
-  /* fill Item */
-  ItemList[0].BufferLength = sizeof(Buffer);
-  ItemList[0].BufferAddress = (unsigned long)Buffer;
-  ItemList[0].ReturnLengthAddress = (unsigned long)&Length;
-  ItemList[0].ItemCode = JPI$_AUTHPRIV;
+    /* fill Item */
+    ItemList[0].BufferLength = sizeof(Buffer);
+    ItemList[0].BufferAddress = (unsigned long) Buffer;
+    ItemList[0].ReturnLengthAddress = (unsigned long) &Length;
+    ItemList[0].ItemCode = JPI$_AUTHPRIV;
 
-  /* terminate list */
-  ItemList[1].ItemCode = 0;
-  ItemList[1].BufferLength = 0;
+    /* terminate list */
+    ItemList[1].ItemCode = 0;
+    ItemList[1].BufferLength = 0;
 
-  /* call system */
-  Result = sys$getjpiw(0, 0, 0, ItemList, 0, 0, 0);
+    /* call system */
+    Result = sys$getjpiw(0, 0, 0, ItemList, 0, 0, 0);
 
-  if (Result != SS$_NORMAL)
-     return(NO);
+    if (Result != SS$_NORMAL)
+	return (NO);
 
-  if (Buffer[0] & PRV$M_SYSPRV)
-     return(YES);
+    if (Buffer[0] & PRV$M_SYSPRV)
+	return (YES);
 
-  return(NO);
+    return (NO);
 }
 
-
-
 /* PUBLIC							HTVMS_enableSysPrv()
-**		ENABLES SYSPRV
-** ON ENTRY:
-**	No arguments.
-**
-** ON EXIT:
-**
-*/
-void HTVMS_enableSysPrv (void)
+ *		ENABLES SYSPRV
+ * ON ENTRY:
+ *	No arguments.
+ *
+ * ON EXIT:
+ *
+ */
+void HTVMS_enableSysPrv(void)
 {
-unsigned long Result;
-unsigned long Prv[2], PreviousPrv[2];
-
-   Prv[0] = PRV$M_SYSPRV;
-   Prv[1] = 0;
-   Result = sys$setprv(1,&Prv,0,&PreviousPrv);
-
-   if (Result == SS$_NORMAL) {
-       if (!(PreviousPrv[0] & PRV$M_SYSPRV)) {
-	   CTRACE((tfp, "HTVMS_enableSysPrv: Enabled SYSPRV\n"));
-       }
-   }
-}
+    unsigned long Result;
+    unsigned long Prv[2], PreviousPrv[2];
 
+    Prv[0] = PRV$M_SYSPRV;
+    Prv[1] = 0;
+    Result = sys$setprv(1, &Prv, 0, &PreviousPrv);
 
+    if (Result == SS$_NORMAL) {
+	if (!(PreviousPrv[0] & PRV$M_SYSPRV)) {
+	    CTRACE((tfp, "HTVMS_enableSysPrv: Enabled SYSPRV\n"));
+	}
+    }
+}
 
 /* PUBLIC							HTVMS_disableSysPrv()
-**		DISABLES SYSPRV
-** ON ENTRY:
-**	No arguments.
-**
-** ON EXIT:
-**
-*/
-void HTVMS_disableSysPrv (void)
+ *		DISABLES SYSPRV
+ * ON ENTRY:
+ *	No arguments.
+ *
+ * ON EXIT:
+ *
+ */
+void HTVMS_disableSysPrv(void)
 {
-unsigned long Result;
-unsigned long Prv[2], PreviousPrv[2];
-
-   Prv[0] = PRV$M_SYSPRV;
-   Prv[1] = 0;
-   Result = sys$setprv(0,&Prv,0,&PreviousPrv);
-
-   if (Result == SS$_NORMAL) {
-       if (PreviousPrv[0] & PRV$M_SYSPRV) {
-	   CTRACE((tfp, "HTVMS_disableSysPrv: Disabled SYSPRV\n"));
-       }
-   }
-}
+    unsigned long Result;
+    unsigned long Prv[2], PreviousPrv[2];
 
+    Prv[0] = PRV$M_SYSPRV;
+    Prv[1] = 0;
+    Result = sys$setprv(0, &Prv, 0, &PreviousPrv);
 
+    if (Result == SS$_NORMAL) {
+	if (PreviousPrv[0] & PRV$M_SYSPRV) {
+	    CTRACE((tfp, "HTVMS_disableSysPrv: Disabled SYSPRV\n"));
+	}
+    }
+}
 
 /* PUBLIC							HTVMS_checkAccess()
-**		CHECKS ACCESS TO FILE FOR CERTAIN USER
-** ON ENTRY:
-**	FileName	The file to be accessed
-**	UserName	Name of the user to check access for.
-**			User nobody, represented by "" is given NO for an answer
-**	Method		Name of the method to be chceked
-**
-** ON EXIT:
-**	returns YES if access is allowed
-**
-*/
-BOOL HTVMS_checkAccess (
-	const char * FileName,
-	const char * UserName,
-	const char * Method)
+ *		CHECKS ACCESS TO FILE FOR CERTAIN USER
+ * ON ENTRY:
+ *	FileName	The file to be accessed
+ *	UserName	Name of the user to check access for.
+ *			User nobody, represented by "" is given NO for an answer
+ *	Method		Name of the method to be chceked
+ *
+ * ON EXIT:
+ *	returns YES if access is allowed
+ *
+ */
+BOOL HTVMS_checkAccess(const char *FileName,
+		       const char *UserName,
+		       const char *Method)
 {
-unsigned long Result;
-ItemStruct ItemList[2];
-unsigned long Length;
-unsigned long Buffer;
-unsigned long ObjType;
-
-char *VmsName;
-
-struct dsc$descriptor_s FileNameDesc;
-struct dsc$descriptor_s UserNameDesc;
-
-char *colon;
-
-   /* user nobody should access as from account under which server is running */
-   if (0 == strcmp(UserName,""))
-      return(NO);
-
-   /* check Filename and convert */
-   colon = strchr(FileName,':');
-   if (colon)
-      VmsName = HTVMS_name("",colon+1);
-   else
-      VmsName = HTVMS_name("",FileName);
-
-   /* check for GET */
-   if (0 == strcmp(Method,"GET"))
-   {
-     /* fill Item */
-     ItemList[0].BufferLength = sizeof(Buffer);
-     ItemList[0].BufferAddress = (unsigned long)&Buffer;
-     ItemList[0].ReturnLengthAddress = (unsigned long)&Length;
-     ItemList[0].ItemCode = CHP$_FLAGS;
-
-     /* terminate list */
-     ItemList[1].ItemCode = 0;
-     ItemList[1].BufferLength = 0;
-
-     /* fill input */
-     ObjType = ACL$C_FILE;
-     Buffer = CHP$M_READ;
-     UserNameDesc.dsc$w_length = strlen(UserName);
-     UserNameDesc.dsc$b_dtype = DSC$K_DTYPE_T;
-     UserNameDesc.dsc$b_class = DSC$K_CLASS_S;
-     UserNameDesc.dsc$a_pointer = (char *)UserName;
-     FileNameDesc.dsc$w_length = strlen(VmsName);
-     FileNameDesc.dsc$b_dtype = DSC$K_DTYPE_T;
-     FileNameDesc.dsc$b_class = DSC$K_CLASS_S;
-     FileNameDesc.dsc$a_pointer = VmsName;
-
-     /* call system */
-     Result = sys$check_access(&ObjType,&FileNameDesc,&UserNameDesc,ItemList);
-
-     if (Result == SS$_NORMAL)
-	return(YES);
-     else
-	return(NO);
-   }
-
-   return(NO);
-}
-
+    unsigned long Result;
+    ItemStruct ItemList[2];
+    unsigned long Length;
+    unsigned long Buffer;
+    unsigned long ObjType;
+
+    char *VmsName;
+
+    struct dsc$descriptor_s FileNameDesc;
+    struct dsc$descriptor_s UserNameDesc;
+
+    char *colon;
+
+    /* user nobody should access as from account under which server is running */
+    if (0 == strcmp(UserName, ""))
+	return (NO);
+
+    /* check Filename and convert */
+    colon = strchr(FileName, ':');
+    if (colon)
+	VmsName = HTVMS_name("", colon + 1);
+    else
+	VmsName = HTVMS_name("", FileName);
+
+    /* check for GET */
+    if (0 == strcmp(Method, "GET")) {
+	/* fill Item */
+	ItemList[0].BufferLength = sizeof(Buffer);
+	ItemList[0].BufferAddress = (unsigned long) &Buffer;
+	ItemList[0].ReturnLengthAddress = (unsigned long) &Length;
+	ItemList[0].ItemCode = CHP$_FLAGS;
+
+	/* terminate list */
+	ItemList[1].ItemCode = 0;
+	ItemList[1].BufferLength = 0;
+
+	/* fill input */
+	ObjType = ACL$C_FILE;
+	Buffer = CHP$M_READ;
+	UserNameDesc.dsc$w_length = strlen(UserName);
+	UserNameDesc.dsc$b_dtype = DSC$K_DTYPE_T;
+	UserNameDesc.dsc$b_class = DSC$K_CLASS_S;
+	UserNameDesc.dsc$a_pointer = (char *) UserName;
+	FileNameDesc.dsc$w_length = strlen(VmsName);
+	FileNameDesc.dsc$b_dtype = DSC$K_DTYPE_T;
+	FileNameDesc.dsc$b_class = DSC$K_CLASS_S;
+	FileNameDesc.dsc$a_pointer = VmsName;
+
+	/* call system */
+	Result = sys$check_access(&ObjType, &FileNameDesc, &UserNameDesc, ItemList);
+
+	if (Result == SS$_NORMAL)
+	    return (YES);
+	else
+	    return (NO);
+    }
 
+    return (NO);
+}
 
 /* PUBLIC							HTVMS_wwwName()
-**		CONVERTS VMS Name into WWW Name
-** ON ENTRY:
-**	vmsname		VMS file specification (NO NODE)
-**
-** ON EXIT:
-**	returns		www file specification
-**
-** EXAMPLES:
-**	vmsname				wwwname
-**	DISK$USER			disk$user
-**	DISK$USER:			/disk$user/
-**	DISK$USER:[DUNS]		/disk$user/duns
-**	DISK$USER:[DUNS.ECHO]		/disk$user/duns/echo
-**	[DUNS]				duns
-**	[DUNS.ECHO]			duns/echo
-**	[DUNS.ECHO.-.TRANS]		duns/echo/../trans
-**	[DUNS.ECHO.--.TRANS]		duns/echo/../../trans
-**	[.DUNS]				duns
-**	[.DUNS.ECHO]			duns/echo
-**	[.DUNS.ECHO]TEST.COM		duns/echo/test.com
-**	TEST.COM			test.com
-**
-**
-*/
-char * HTVMS_wwwName (const char *	vmsname)
+ *		CONVERTS VMS Name into WWW Name
+ * ON ENTRY:
+ *	vmsname		VMS file specification (NO NODE)
+ *
+ * ON EXIT:
+ *	returns		www file specification
+ *
+ * EXAMPLES:
+ *	vmsname				wwwname
+ *	DISK$USER			disk$user
+ *	DISK$USER:			/disk$user/
+ *	DISK$USER:[DUNS]		/disk$user/duns
+ *	DISK$USER:[DUNS.ECHO]		/disk$user/duns/echo
+ *	[DUNS]				duns
+ *	[DUNS.ECHO]			duns/echo
+ *	[DUNS.ECHO.-.TRANS]		duns/echo/../trans
+ *	[DUNS.ECHO.--.TRANS]		duns/echo/../../trans
+ *	[.DUNS]				duns
+ *	[.DUNS.ECHO]			duns/echo
+ *	[.DUNS.ECHO]TEST.COM		duns/echo/test.com
+ *	TEST.COM			test.com
+ *
+ *
+ */
+char *HTVMS_wwwName(const char *vmsname)
 {
-static char wwwname[LY_MAXPATH];
-const char *src;
-char *dst;
-int dir;
-   dst = wwwname;
-   src = vmsname;
-   dir = 0;
-   if (strchr(src,':')) *(dst++) = '/';
-   for ( ; *src != '\0' ; src++)
-   {
-      switch(*src)
-      {
-	 case ':':  *(dst++) = '/'; break;
-	 case '-': if (dir)
-		   {
-		      if ((*(src-1)=='[' || *(src-1)=='.' || *(src-1)=='-') &&
-			  (*(src+1)=='.' || *(src+1)=='-'))
-		      {
-			  *(dst++) = '/';
-			  *(dst++) = '.';
-			  *(dst++) = '.';
-		      }
-		      else
-			  *(dst++) = '-';
-		   }
-		   else
-		   {
-		      if (*(src-1) == ']') *(dst++) = '/';
-		      *(dst++) = '-';
-		   }
-		   break;
-	 case '.': if (dir)
-		   {
-		      if (*(src-1) != '[') *(dst++) = '/';
-		   }
-		   else
-		   {
-		      if (*(src-1) == ']') *(dst++) = '/';
-		      *(dst++) = '.';
-		   }
-		   break;
-	 case '[': dir = 1; break;
-	 case ']': dir = 0; break;
-	 default:  if (*(src-1) == ']') *(dst++) = '/';
-		   *(dst++) = *src;
-		   break;
-      }
-   }
-   *(dst++) = '\0';
-   return(wwwname);
+    static char wwwname[LY_MAXPATH];
+    const char *src;
+    char *dst;
+    int dir;
+
+    dst = wwwname;
+    src = vmsname;
+    dir = 0;
+    if (strchr(src, ':'))
+	*(dst++) = '/';
+    for (; *src != '\0'; src++) {
+	switch (*src) {
+	case ':':
+	    *(dst++) = '/';
+	    break;
+	case '-':
+	    if (dir) {
+		if ((*(src - 1) == '[' ||
+		     *(src - 1) == '.' ||
+		     *(src - 1) == '-') &&
+		    (*(src + 1) == '.' ||
+		     *(src + 1) == '-')) {
+		    *(dst++) = '/';
+		    *(dst++) = '.';
+		    *(dst++) = '.';
+		} else
+		    *(dst++) = '-';
+	    } else {
+		if (*(src - 1) == ']')
+		    *(dst++) = '/';
+		*(dst++) = '-';
+	    }
+	    break;
+	case '.':
+	    if (dir) {
+		if (*(src - 1) != '[')
+		    *(dst++) = '/';
+	    } else {
+		if (*(src - 1) == ']')
+		    *(dst++) = '/';
+		*(dst++) = '.';
+	    }
+	    break;
+	case '[':
+	    dir = 1;
+	    break;
+	case ']':
+	    dir = 0;
+	    break;
+	default:
+	    if (*(src - 1) == ']')
+		*(dst++) = '/';
+	    *(dst++) = *src;
+	    break;
+	}
+    }
+    *(dst++) = '\0';
+    return (wwwname);
 }
 
-
 /*
-**	The code below is for directory browsing by VMS Curses clients.
-**	It is based on the newer WWWLib's HTDirBrw.c. - Foteos Macrides
-*/
-int HTStat (
-	const char * filename,
-	struct stat * info)
+ *	The code below is for directory browsing by VMS Curses clients.
+ *	It is based on the newer WWWLib's HTDirBrw.c. - Foteos Macrides
+ */
+int HTStat(const char *filename,
+	   struct stat *info)
 {
-   /*
-      the following stuff does not work in VMS with a normal stat...
-      -->   /disk$user/duns/www if www is a directory
-		is statted like:	/disk$user/duns/www.dir
-		after a normal stat has failed
-      -->   /disk$user/duns	if duns is a toplevel directory
-		is statted like:	/disk$user/000000/duns.dir
-      -->   /disk$user since disk$user is a device
-		is statted like:	/disk$user/000000/000000.dir
-      -->   /
-		searches all devices, no solution yet...
-      -->   /vxcern!/disk$cr/wwwteam/login.com
-		is not statted but granted with fake information...
-   */
-int Result;
-int Len;
-char *Ptr, *Ptr2;
-static char *Name;
-
-   /* try normal stat... */
-   Result = stat((char *)filename,info);
-   if (Result == 0)
-      return(Result);
-
-   /* make local copy */
-   StrAllocCopy(Name,filename);
-
-   /* failed,so do device search in case root is requested */
-   if (!strcmp(Name,"/"))
-   {  /* root requested */
-      return(-1);
-   }
-
-   /* failed so this might be a directory, add '.dir' */
-   Len = strlen(Name);
-   if (Name[Len-1] == '/')
-      Name[Len-1] = '\0';
-
-   /* fail in case of device */
-   Ptr = strchr(Name+1,'/');
-   if ((Ptr == NULL) && (Name[0] == '/'))
-   {  /* device only... */
-      StrAllocCat(Name, "/000000/000000");
-   }
-
-   if (Ptr != NULL)
-   {  /* correct filename in case of toplevel dir */
-      Ptr2 = strchr(Ptr+1,'/');
-      if ((Ptr2 == NULL) && (Name[0] == '/'))
-      {
-	 char End[256];
-	 LYstrncpy(End, Ptr, sizeof(End) - 1);
-	 *(Ptr+1) = '\0';
-	 StrAllocCat(Name, "000000");
-	 StrAllocCat(Name, End);
-      }
-   }
-
-   /* try in case a file on toplevel directory or .DIR was already specified */
-   Result = stat(Name,info);
-   if (Result == 0)
-      return(Result);
-
-   /* add .DIR and try again */
-   StrAllocCat(Name, ".dir");
-   Result = stat(Name,info);
-   return(Result);
+    /*
+       the following stuff does not work in VMS with a normal stat...
+       -->   /disk$user/duns/www if www is a directory
+       is statted like:  /disk$user/duns/www.dir
+       after a normal stat has failed
+       -->   /disk$user/duns     if duns is a toplevel directory
+       is statted like:  /disk$user/000000/duns.dir
+       -->   /disk$user since disk$user is a device
+       is statted like:  /disk$user/000000/000000.dir
+       -->   /
+       searches all devices, no solution yet...
+       -->   /vxcern!/disk$cr/wwwteam/login.com
+       is not statted but granted with fake information...
+     */
+    int Result;
+    int Len;
+    char *Ptr, *Ptr2;
+    static char *Name;
+
+    /* try normal stat... */
+    Result = stat((char *) filename, info);
+    if (Result == 0)
+	return (Result);
+
+    /* make local copy */
+    StrAllocCopy(Name, filename);
+
+    /* failed,so do device search in case root is requested */
+    if (!strcmp(Name, "/")) {	/* root requested */
+	return (-1);
+    }
+
+    /* failed so this might be a directory, add '.dir' */
+    Len = strlen(Name);
+    if (Name[Len - 1] == '/')
+	Name[Len - 1] = '\0';
+
+    /* fail in case of device */
+    Ptr = strchr(Name + 1, '/');
+    if ((Ptr == NULL) && (Name[0] == '/')) {	/* device only... */
+	StrAllocCat(Name, "/000000/000000");
+    }
+
+    if (Ptr != NULL) {		/* correct filename in case of toplevel dir */
+	Ptr2 = strchr(Ptr + 1, '/');
+	if ((Ptr2 == NULL) && (Name[0] == '/')) {
+	    char End[256];
+
+	    LYstrncpy(End, Ptr, sizeof(End) - 1);
+	    *(Ptr + 1) = '\0';
+	    StrAllocCat(Name, "000000");
+	    StrAllocCat(Name, End);
+	}
+    }
+
+    /* try in case a file on toplevel directory or .DIR was already specified */
+    Result = stat(Name, info);
+    if (Result == 0)
+	return (Result);
+
+    /* add .DIR and try again */
+    StrAllocCat(Name, ".dir");
+    Result = stat(Name, info);
+    return (Result);
 }
 
 #ifndef	_POSIX_SOURCE
@@ -379,24 +373,24 @@ static char *Name;
 #ifndef	NULL
 #define	NULL	0
 #endif
-#endif	/* !_POSIX_SOURCE */
+#endif /* !_POSIX_SOURCE */
 
-typedef	struct __dirdesc {
-	long	context;	/* context descriptor for LIB$FIND_FILE calls */
-	char	dirname[255+1];	/* keeps the directory name, including *.* */
-	struct dsc$descriptor_s dirname_desc;	/* descriptor of dirname */
+typedef struct __dirdesc {
+    long context;		/* context descriptor for LIB$FIND_FILE calls */
+    char dirname[255 + 1];	/* keeps the directory name, including *.* */
+    struct dsc$descriptor_s dirname_desc;	/* descriptor of dirname */
 } DIR;
 
-static	DIR *HTVMSopendir(char *dirname);
-static	struct dirent *HTVMSreaddir(DIR *dirp);
-static	int HTVMSclosedir(DIR *dirp);
+static DIR *HTVMSopendir(char *dirname);
+static struct dirent *HTVMSreaddir(DIR *dirp);
+static int HTVMSclosedir(DIR *dirp);
 
 /*** #include <sys_dirent.h> ***/
 /*** "sys_dirent.h" ***/
-struct	dirent {
-	unsigned long	d_fileno;	/* file number of entry */
-	unsigned short	d_namlen;	/* length of string in d_name */
-	char		d_name[255+1];	/* name (up to MAXNAMLEN + 1) */
+struct dirent {
+    unsigned long d_fileno;	/* file number of entry */
+    unsigned short d_namlen;	/* length of string in d_name */
+    char d_name[255 + 1];	/* name (up to MAXNAMLEN + 1) */
 };
 
 #ifndef	_POSIX_SOURCE
@@ -415,164 +409,157 @@ struct	dirent {
 #define	DIRSIZ(dp) \
 	(((sizeof(struct dirent) - (MAXNAMLEN+1) + ((dp)->d_namlen+1)) +3) & ~3)
 
-#endif	/* !_POSIX_SOURCE */
-
+#endif /* !_POSIX_SOURCE */
 
 static DIR *HTVMSopendir(char *dirname)
 {
-static DIR dir;
-char *closebracket;
-long status;
-struct dsc$descriptor_s entryname_desc;
-struct dsc$descriptor_s dirname_desc;
-static char *DirEntry;
-char Actual[256];
-char VMSentry[256];
-char UnixEntry[256];
-int index;
-char *dot;
-
-   /* check if directory exists */
-   /* dirname can look like /disk$user/duns/www/test/multi    */
-   /* or like               /disk$user/duns/www/test/multi/   */
-   /* DirEntry should look like     disk$user:[duns.www.test]multi in both cases */
-   /* dir.dirname should look like  disk$user:[duns.www.test.multi] */
-   sprintf(UnixEntry, "%.*s", sizeof(UnixEntry) - 2, dirname);
-   if (UnixEntry[strlen(UnixEntry)-1] != '/')
-      strcat(UnixEntry,"/");
-
-   StrAllocCopy(DirEntry, HTVMS_name("",UnixEntry));
-   if (strlen(DirEntry) > sizeof(dir.dirname) - 1)
-      return (NULL);
-   strcpy(dir.dirname, DirEntry);
-   index = strlen(DirEntry) - 1;
-
-   if (DirEntry[index] == ']')
-      DirEntry[index] = '\0';
-
-   if ((dot = strrchr(DirEntry,'.')) == NULL)
-   {  /* convert disk$user:[duns] into disk$user:[000000]duns.dir */
-      char *openbr = strrchr(DirEntry,'[');
-      if (!openbr)
-      { /* convert disk$user: into disk$user:[000000]000000.dir */
-         if (strlen(dir.dirname) > sizeof(dir.dirname) - 10)
-            return (NULL);
-         sprintf(dir.dirname, "%.*s[000000]", sizeof(dir.dirname) - 9, DirEntry);
-	 StrAllocCat(DirEntry,"[000000]000000.dir");
-      }
-      else
-      {
-	 char End[256];
-	 strcpy(End,openbr+1);
-	 *(openbr+1) = '\0';
-	 StrAllocCat(DirEntry,"000000]");
-	 StrAllocCat(DirEntry,End);
-	 StrAllocCat(DirEntry,".dir");
-      }
-   }
-   else
-   {
-      *dot = ']';
-      StrAllocCat(DirEntry,".dir");
-   }
-   /* lib$find_file needs a fixed-size buffer */
-   LYstrncpy(Actual, DirEntry, sizeof(Actual)-1);
-
-   dir.context = 0;
-   dirname_desc.dsc$w_length = strlen(Actual);
-   dirname_desc.dsc$b_dtype = DSC$K_DTYPE_T;
-   dirname_desc.dsc$b_class = DSC$K_CLASS_S;
-   dirname_desc.dsc$a_pointer = (char *)&(Actual);
-
-   /* look for the directory */
-   entryname_desc.dsc$w_length = 255;
-   entryname_desc.dsc$b_dtype = DSC$K_DTYPE_T;
-   entryname_desc.dsc$b_class = DSC$K_CLASS_S;
-   entryname_desc.dsc$a_pointer = VMSentry;
-
-   status = lib$find_file(&(dirname_desc),
-			  &entryname_desc,
-			  &(dir.context),
-			  0,0,0,0);
-   if (!(status & 0x01))
-   { /* directory not found */
-      return(NULL);
-   }
-
-   if (strlen(dir.dirname) > sizeof(dir.dirname) - 10)
-       return (NULL);
-   if (HTVMSFileVersions)
-       strcat(dir.dirname,"*.*;*");
-   else
-       strcat(dir.dirname,"*.*");
-   dir.context = 0;
-   dir.dirname_desc.dsc$w_length = strlen(dir.dirname);
-   dir.dirname_desc.dsc$b_dtype = DSC$K_DTYPE_T;
-   dir.dirname_desc.dsc$b_class = DSC$K_CLASS_S;
-   dir.dirname_desc.dsc$a_pointer = (char *)&(dir.dirname);
-   return(&dir);
+    static DIR dir;
+    char *closebracket;
+    long status;
+    struct dsc$descriptor_s entryname_desc;
+    struct dsc$descriptor_s dirname_desc;
+    static char *DirEntry;
+    char Actual[256];
+    char VMSentry[256];
+    char UnixEntry[256];
+    int index;
+    char *dot;
+
+    /* check if directory exists */
+    /* dirname can look like /disk$user/duns/www/test/multi    */
+    /* or like               /disk$user/duns/www/test/multi/   */
+    /* DirEntry should look like     disk$user:[duns.www.test]multi in both cases */
+    /* dir.dirname should look like  disk$user:[duns.www.test.multi] */
+    sprintf(UnixEntry, "%.*s", sizeof(UnixEntry) - 2, dirname);
+    if (UnixEntry[strlen(UnixEntry) - 1] != '/')
+	strcat(UnixEntry, "/");
+
+    StrAllocCopy(DirEntry, HTVMS_name("", UnixEntry));
+    if (strlen(DirEntry) > sizeof(dir.dirname) - 1)
+	return (NULL);
+    strcpy(dir.dirname, DirEntry);
+    index = strlen(DirEntry) - 1;
+
+    if (DirEntry[index] == ']')
+	DirEntry[index] = '\0';
+
+    if ((dot = strrchr(DirEntry, '.')) == NULL) {	/* convert disk$user:[duns] into disk$user:[000000]duns.dir */
+	char *openbr = strrchr(DirEntry, '[');
+
+	if (!openbr) {		/* convert disk$user: into disk$user:[000000]000000.dir */
+	    if (strlen(dir.dirname) > sizeof(dir.dirname) - 10)
+		return (NULL);
+	    sprintf(dir.dirname, "%.*s[000000]", sizeof(dir.dirname) - 9, DirEntry);
+	    StrAllocCat(DirEntry, "[000000]000000.dir");
+	} else {
+	    char End[256];
+
+	    strcpy(End, openbr + 1);
+	    *(openbr + 1) = '\0';
+	    StrAllocCat(DirEntry, "000000]");
+	    StrAllocCat(DirEntry, End);
+	    StrAllocCat(DirEntry, ".dir");
+	}
+    } else {
+	*dot = ']';
+	StrAllocCat(DirEntry, ".dir");
+    }
+    /* lib$find_file needs a fixed-size buffer */
+    LYstrncpy(Actual, DirEntry, sizeof(Actual) - 1);
+
+    dir.context = 0;
+    dirname_desc.dsc$w_length = strlen(Actual);
+    dirname_desc.dsc$b_dtype = DSC$K_DTYPE_T;
+    dirname_desc.dsc$b_class = DSC$K_CLASS_S;
+    dirname_desc.dsc$a_pointer = (char *) &(Actual);
+
+    /* look for the directory */
+    entryname_desc.dsc$w_length = 255;
+    entryname_desc.dsc$b_dtype = DSC$K_DTYPE_T;
+    entryname_desc.dsc$b_class = DSC$K_CLASS_S;
+    entryname_desc.dsc$a_pointer = VMSentry;
+
+    status = lib$find_file(&(dirname_desc),
+			   &entryname_desc,
+			   &(dir.context),
+			   0, 0, 0, 0);
+    if (!(status & 0x01)) {	/* directory not found */
+	return (NULL);
+    }
+
+    if (strlen(dir.dirname) > sizeof(dir.dirname) - 10)
+	return (NULL);
+    if (HTVMSFileVersions)
+	strcat(dir.dirname, "*.*;*");
+    else
+	strcat(dir.dirname, "*.*");
+    dir.context = 0;
+    dir.dirname_desc.dsc$w_length = strlen(dir.dirname);
+    dir.dirname_desc.dsc$b_dtype = DSC$K_DTYPE_T;
+    dir.dirname_desc.dsc$b_class = DSC$K_CLASS_S;
+    dir.dirname_desc.dsc$a_pointer = (char *) &(dir.dirname);
+    return (&dir);
 }
 
 static struct dirent *HTVMSreaddir(DIR *dirp)
 {
-static struct dirent entry;
-long status;
-struct dsc$descriptor_s entryname_desc;
-char *space, *slash;
-char VMSentry[256];
-char *UnixEntry;
-
-   entryname_desc.dsc$w_length = 255;
-   entryname_desc.dsc$b_dtype = DSC$K_DTYPE_T;
-   entryname_desc.dsc$b_class = DSC$K_CLASS_S;
-   entryname_desc.dsc$a_pointer = VMSentry;
-
-   status = lib$find_file(&(dirp->dirname_desc),
-			  &entryname_desc,
-			  &(dirp->context),
-			  0,0,0,0);
-   if (status == RMS$_NMF)
-   { /* no more files */
-      return(NULL);
-   }
-   else
-   { /* ok */
-      if (!(status & 0x01)) return(0);
-      if (HTVMSFileVersions)
-	  space = strchr(VMSentry,' ');
-      else
-	  space = strchr(VMSentry,';');
-      if (space)
-	 *space = '\0';
-
-      /* convert to unix style... */
-      UnixEntry = HTVMS_wwwName(VMSentry);
-      slash = strrchr(UnixEntry,'/') + 1;
-      strcpy(entry.d_name,slash);
-      entry.d_namlen = strlen(entry.d_name);
-      entry.d_fileno = 1;
-      return(&entry);
-   }
+    static struct dirent entry;
+    long status;
+    struct dsc$descriptor_s entryname_desc;
+    char *space, *slash;
+    char VMSentry[256];
+    char *UnixEntry;
+
+    entryname_desc.dsc$w_length = 255;
+    entryname_desc.dsc$b_dtype = DSC$K_DTYPE_T;
+    entryname_desc.dsc$b_class = DSC$K_CLASS_S;
+    entryname_desc.dsc$a_pointer = VMSentry;
+
+    status = lib$find_file(&(dirp->dirname_desc),
+			   &entryname_desc,
+			   &(dirp->context),
+			   0, 0, 0, 0);
+    if (status == RMS$_NMF) {	/* no more files */
+	return (NULL);
+    } else {			/* ok */
+	if (!(status & 0x01))
+	    return (0);
+	if (HTVMSFileVersions)
+	    space = strchr(VMSentry, ' ');
+	else
+	    space = strchr(VMSentry, ';');
+	if (space)
+	    *space = '\0';
+
+	/* convert to unix style... */
+	UnixEntry = HTVMS_wwwName(VMSentry);
+	slash = strrchr(UnixEntry, '/') + 1;
+	strcpy(entry.d_name, slash);
+	entry.d_namlen = strlen(entry.d_name);
+	entry.d_fileno = 1;
+	return (&entry);
+    }
 }
 
 static int HTVMSclosedir(DIR *dirp)
 {
-long status;
+    long status;
 
-   status = lib$find_file_end(&(dirp->context));
-   if (!(status & 0x01)) exit(status);
-   dirp->context = 0;
-   return(0);
+    status = lib$find_file_end(&(dirp->context));
+    if (!(status & 0x01))
+	exit(status);
+    dirp->context = 0;
+    return (0);
 }
 
 #include <HTAnchor.h>
 #include <HTParse.h>
 #include <HTBTree.h>
-#include <HTFile.h>	/* For HTFileFormat() */
+#include <HTFile.h>		/* For HTFileFormat() */
 #include <HTAlert.h>
 /*
-**  Hypertext object building machinery.
-*/
+ *  Hypertext object building machinery.
+ */
 #include <HTML.h>
 #define PUTC(c) (*targetClass.put_character)(target, c)
 #define PUTS(s) (*targetClass.put_string)(target, s)
@@ -581,163 +568,159 @@ long status;
 #define FREE_TARGET (*targetClass._free)(target)
 #define ABORT_TARGET (*targetClass._free)(target)
 struct _HTStructured {
-	const HTStructuredClass *	isa;
-	/* ... */
+    const HTStructuredClass *isa;
+    /* ... */
 };
 
 #define STRUCT_DIRENT struct dirent
 
-static char * months[12] = {
-    "Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"
+static char *months[12] =
+{
+    "Jan", "Feb", "Mar", "Apr", "May", "Jun",
+    "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
 };
 
 typedef struct _VMSEntryInfo {
-    char *       filename;
-    char *       type;
-    char *       date;
+    char *filename;
+    char *type;
+    char *date;
     unsigned int size;
-    BOOLEAN      display;  /* show this entry? */
+    BOOLEAN display;		/* show this entry? */
 } VMSEntryInfo;
 
-static void free_VMSEntryInfo_contents (VMSEntryInfo * entry_info)
+static void free_VMSEntryInfo_contents(VMSEntryInfo * entry_info)
 {
     if (entry_info) {
 	FREE(entry_info->filename);
 	FREE(entry_info->type);
 	FREE(entry_info->date);
     }
-   /* dont free the struct */
+    /* dont free the struct */
 }
 
-int compare_VMSEntryInfo_structs (VMSEntryInfo * entry1,
-					      VMSEntryInfo * entry2)
+int compare_VMSEntryInfo_structs(VMSEntryInfo * entry1, VMSEntryInfo * entry2)
 {
     int i, status;
     char date1[16], date2[16], time1[8], time2[8], month[4];
 
-    switch(HTfileSortMethod)
-      {
-	case FILE_BY_SIZE:
-			/* both equal or both 0 */
-			if(entry1->size == entry2->size)
-			    return(strcasecomp(entry1->filename,
-					       entry2->filename));
-			else
-			    if(entry1->size > entry2->size)
-				return(1);
-			    else
-				return(-1);
-	case FILE_BY_TYPE:
-			if(entry1->type && entry2->type) {
-			    status = strcasecomp(entry1->type, entry2->type);
-			    if(status)
-				return(status);
-			    /* else fall to filename comparison */
-			}
-			return (strcasecomp(entry1->filename,
-					    entry2->filename));
-	case FILE_BY_DATE:
-			if(entry1->date && entry2->date) {
-			    /*
-			    ** Make sure we have the correct length. - FM
-			    */
-			    if (strlen(entry1->date) != 12 ||
-				strlen(entry2->date) != 12) {
-				return (strcasecomp(entry1->filename,
-						    entry2->filename));
-			    }
-			    /*
-			    ** Set up for sorting in reverse
-			    ** chronological order. - FM
-			    */
-			    if (entry1->date[7] != ' ') {
-				strcpy(date1, "9999");
-				strcpy(time1, (char *)&entry1->date[7]);
-			    } else {
-				strcpy(date1, (char *)&entry1->date[8]);
-				strcpy(time1, "00:00");
-			    }
-			    strncpy(month, entry1->date, 3);
-			    month[3] = '\0';
-			    for (i = 0; i < 12; i++) {
-				if (!strcasecomp(month, months[i])) {
-				    break;
-				}
-			    }
-			    i++;
-			    sprintf(month, "%02d", i);
-			    strcat(date1, month);
-			    strncat(date1, (char *)&entry1->date[4], 2);
-			    date1[8] = '\0';
-			    if (date1[6] == ' ') {
-				date1[6] = '0';
-			    }
-			    strcat(date1, time1);
-			    if (entry2->date[7] != ' ') {
-				strcpy(date2, "9999");
-				strcpy(time2, (char *)&entry2->date[7]);
-			    } else {
-				strcpy(date2, (char *)&entry2->date[8]);
-				strcpy(time2, "00:00");
-			    }
-			    strncpy(month, entry2->date, 3);
-			    month[3] = '\0';
-			    for (i = 0; i < 12; i++) {
-				if (!strcasecomp(month, months[i])) {
-				    break;
-				}
-			    }
-			    i++;
-			    sprintf(month, "%02d", i);
-			    strcat(date2, month);
-			    strncat(date2, (char *)&entry2->date[4], 2);
-			    date2[8] = '\0';
-			    if (date2[6] == ' ') {
-				date2[6] = '0';
-			    }
-			    strcat(date2, time2);
-			    /*
-			    ** Do the comparison. - FM
-			    */
-			    status = strcasecomp(date2, date1);
-			    if(status)
-				return(status);
-			    /* else fall to filename comparison */
-			}
-			return (strcasecomp(entry1->filename,
-					    entry2->filename));
-	case FILE_BY_NAME:
-	default:
-			return (strcmp(entry1->filename,
-					    entry2->filename));
-      }
+    switch (HTfileSortMethod) {
+    case FILE_BY_SIZE:
+	/* both equal or both 0 */
+	if (entry1->size == entry2->size)
+	    return (strcasecomp(entry1->filename,
+				entry2->filename));
+	else if (entry1->size > entry2->size)
+	    return (1);
+	else
+	    return (-1);
+    case FILE_BY_TYPE:
+	if (entry1->type && entry2->type) {
+	    status = strcasecomp(entry1->type, entry2->type);
+	    if (status)
+		return (status);
+	    /* else fall to filename comparison */
+	}
+	return (strcasecomp(entry1->filename,
+			    entry2->filename));
+    case FILE_BY_DATE:
+	if (entry1->date && entry2->date) {
+	    /*
+	     * Make sure we have the correct length. - FM
+	     */
+	    if (strlen(entry1->date) != 12 ||
+		strlen(entry2->date) != 12) {
+		return (strcasecomp(entry1->filename,
+				    entry2->filename));
+	    }
+	    /*
+	     * Set up for sorting in reverse
+	     * chronological order. - FM
+	     */
+	    if (entry1->date[7] != ' ') {
+		strcpy(date1, "9999");
+		strcpy(time1, (char *) &entry1->date[7]);
+	    } else {
+		strcpy(date1, (char *) &entry1->date[8]);
+		strcpy(time1, "00:00");
+	    }
+	    strncpy(month, entry1->date, 3);
+	    month[3] = '\0';
+	    for (i = 0; i < 12; i++) {
+		if (!strcasecomp(month, months[i])) {
+		    break;
+		}
+	    }
+	    i++;
+	    sprintf(month, "%02d", i);
+	    strcat(date1, month);
+	    strncat(date1, (char *) &entry1->date[4], 2);
+	    date1[8] = '\0';
+	    if (date1[6] == ' ') {
+		date1[6] = '0';
+	    }
+	    strcat(date1, time1);
+	    if (entry2->date[7] != ' ') {
+		strcpy(date2, "9999");
+		strcpy(time2, (char *) &entry2->date[7]);
+	    } else {
+		strcpy(date2, (char *) &entry2->date[8]);
+		strcpy(time2, "00:00");
+	    }
+	    strncpy(month, entry2->date, 3);
+	    month[3] = '\0';
+	    for (i = 0; i < 12; i++) {
+		if (!strcasecomp(month, months[i])) {
+		    break;
+		}
+	    }
+	    i++;
+	    sprintf(month, "%02d", i);
+	    strcat(date2, month);
+	    strncat(date2, (char *) &entry2->date[4], 2);
+	    date2[8] = '\0';
+	    if (date2[6] == ' ') {
+		date2[6] = '0';
+	    }
+	    strcat(date2, time2);
+	    /*
+	     * Do the comparison. - FM
+	     */
+	    status = strcasecomp(date2, date1);
+	    if (status)
+		return (status);
+	    /* else fall to filename comparison */
+	}
+	return (strcasecomp(entry1->filename,
+			    entry2->filename));
+    case FILE_BY_NAME:
+    default:
+	return (strcmp(entry1->filename,
+		       entry2->filename));
+    }
 }
 
-
 /*							HTVMSBrowseDir()
-**
-**	This function generates a directory listing as an HTML-object
-**	for local file URL's.  It assumes the first two elements of
-**	of the path are a device followed by a directory:
-**
-**		file://localhost/device/directory[/[foo]]
-**
-**	Will not accept 000000 as a directory name.
-**	Will offer links to parent through the top directory, unless
-**	a terminal slash was included in the calling URL.
-**
-**	Returns HT_LOADED on success, HTLoadError() messages on error.
-**
-**	Developed for Lynx by Foteos Macrides (macrides@sci.wfeb.edu).
-*/
-int HTVMSBrowseDir (
-	const char *		address,
-	HTParentAnchor *	anchor,
-	HTFormat		format_out,
-	HTStream *		sink
-)
+ *
+ *	This function generates a directory listing as an HTML-object
+ *	for local file URL's.  It assumes the first two elements of
+ *	of the path are a device followed by a directory:
+ *
+ *		file://localhost/device/directory[/[foo]]
+ *
+ *	Will not accept 000000 as a directory name.
+ *	Will offer links to parent through the top directory, unless
+ *	a terminal slash was included in the calling URL.
+ *
+ *	Returns HT_LOADED on success, HTLoadError() messages on error.
+ *
+ *	Developed for Lynx by Foteos Macrides (macrides@sci.wfeb.edu).
+ */
+int HTVMSBrowseDir(const char *address,
+		   HTParentAnchor *anchor,
+		   HTFormat format_out,
+		   HTStream *sink)
 {
-    HTStructured* target;
+    HTStructured *target;
     HTStructuredClass targetClass;
     char *pathname = HTParse(address, "", PARSE_PATH + PARSE_PUNCTUATION);
     char *tail = NULL;
@@ -746,7 +729,7 @@ int HTVMSBrowseDir (
     char *parent = NULL;
     char *relative = NULL;
     char *cp, *cp1;
-    int  pathend, len;
+    int pathend, len;
     DIR *dp;
     struct stat file_info;
     time_t NowTime;
@@ -755,16 +738,16 @@ int HTVMSBrowseDir (
     char string_buffer[64];
 
     HTUnEscape(pathname);
-    CTRACE((tfp,"HTVMSBrowseDir: Browsing `%s\'\n", pathname));
+    CTRACE((tfp, "HTVMSBrowseDir: Browsing `%s\'\n", pathname));
 
     /*
-     *  Require at least two elements (presumably a device and directory)
-     *  and disallow the device root (000000 directory).  Symbolic paths
-     *  (e.g., sys$help) should have been translated and expanded (e.g.,
-     *  to /sys$sysroot/syshlp) before calling this routine.
+     * Require at least two elements (presumably a device and directory) and
+     * disallow the device root (000000 directory).  Symbolic paths (e.g.,
+     * sys$help) should have been translated and expanded (e.g., to
+     * /sys$sysroot/syshlp) before calling this routine.
      */
     if (((*pathname != '/') ||
-	 (cp = strchr(pathname+1, '/')) == NULL ||
+	 (cp = strchr(pathname + 1, '/')) == NULL ||
 	 *(cp + 1) == '\0' ||
 	 0 == strncmp((cp + 1), "000000", 6)) ||
 	(dp = HTVMSopendir(pathname)) == NULL) {
@@ -773,9 +756,9 @@ int HTVMSBrowseDir (
     }
 
     /*
-     *  Set up the output stream.
+     * Set up the output stream.
      */
-    _HTProgress (BUILDING_DIR_LIST);
+    _HTProgress(BUILDING_DIR_LIST);
     if (UCLYhndl_HTFile_for_unspec >= 0) {
 	HTAnchor_setUCInfoStage(anchor,
 				UCLYhndl_HTFile_for_unspec,
@@ -786,38 +769,38 @@ int HTVMSBrowseDir (
     targetClass = *(target->isa);
 
     /*
-     *  Set up the offset string of the anchor reference,
-     *  and strings for the title and header.
+     * Set up the offset string of the anchor reference, and strings for the
+     * title and header.
      */
-    cp = strrchr(pathname, '/');  /* find lastslash */
-    StrAllocCopy(tail, (cp+1)); /* take slash off the beginning */
+    cp = strrchr(pathname, '/');	/* find lastslash */
+    StrAllocCopy(tail, (cp + 1));	/* take slash off the beginning */
     if (*tail != '\0') {
 	StrAllocCopy(title, tail);
 	*cp = '\0';
-	if ((cp1=strrchr(pathname, '/')) != NULL &&
+	if ((cp1 = strrchr(pathname, '/')) != NULL &&
 	    cp1 != pathname &&
-	    strncmp((cp1+1), "000000", 6))
-	    StrAllocCopy(parent, (cp1+1));
+	    strncmp((cp1 + 1), "000000", 6))
+	    StrAllocCopy(parent, (cp1 + 1));
 	*cp = '/';
     } else {
-	pathname[strlen(pathname)-1] = '\0';
+	pathname[strlen(pathname) - 1] = '\0';
 	cp = strrchr(pathname, '/');
-	StrAllocCopy(title, (cp+1));
+	StrAllocCopy(title, (cp + 1));
 	pathname[strlen(pathname)] = '/';
     }
     StrAllocCopy(header, pathname);
 
     /*
-     *  Initialize path name for HTStat().
+     * Initialize path name for HTStat().
      */
     pathend = strlen(pathname);
-    if (*(pathname+pathend-1) != '/') {
+    if (*(pathname + pathend - 1) != '/') {
 	StrAllocCat(pathname, "/");
 	pathend++;
     }
 
     /*
-     *  Output the title and header.
+     * Output the title and header.
      */
     START(HTML_HTML);
     PUTC('\n');
@@ -840,29 +823,31 @@ int HTVMSBrowseDir (
     END(HTML_H1);
     PUTC('\n');
     if (HTDirReadme == HT_DIR_README_TOP) {
-	FILE * fp;
-	if (header[strlen(header)-1] != '/')
+	FILE *fp;
+
+	if (header[strlen(header) - 1] != '/')
 	    StrAllocCat(header, "/");
 	StrAllocCat(header, HT_DIR_README_FILE);
-	if ((fp = fopen(header,	 "r")) != NULL) {
+	if ((fp = fopen(header, "r")) != NULL) {
 	    START(HTML_PRE);
-	    for(;;) {
+	    for (;;) {
 		char c = fgetc(fp);
-		if (c == (char)EOF)
+
+		if (c == (char) EOF)
 		    break;
 #ifdef NOTDEFINED
 		switch (c) {
-		    case '&':
-		    case '<':
-		    case '>':
-			PUTC('&');
-			PUTC('#');
-			PUTC((char)(c / 10));
-			PUTC((char) (c % 10));
-			PUTC(';');
-			break;
-		    default:
-			PUTC(c);
+		case '&':
+		case '<':
+		case '>':
+		    PUTC('&');
+		    PUTC('#');
+		    PUTC((char) (c / 10));
+		    PUTC((char) (c % 10));
+		    PUTC(';');
+		    break;
+		default:
+		    PUTC(c);
 		}
 #else
 		PUTC(c);
@@ -887,10 +872,10 @@ int HTVMSBrowseDir (
     }
 
     /*
-     *  Set up the date comparison.
+     * Set up the date comparison.
      */
     NowTime = time(NULL);
-    strcpy(ThisYear, (char *)ctime(&NowTime)+20);
+    strcpy(ThisYear, (char *) ctime(&NowTime) + 20);
     ThisYear[4] = '\0';
 
     /*
@@ -910,7 +895,7 @@ int HTVMSBrowseDir (
 	    HTFormat format;
 
 	    /* Skip if not used */
-	    if (!dirbuf->d_ino)	{
+	    if (!dirbuf->d_ino) {
 		continue;
 	    }
 
@@ -933,14 +918,14 @@ int HTVMSBrowseDir (
 	    }
 
 	    /* OK, make an lstat() and get a key ready. */
-	    *(pathname+pathend) = '\0';
+	    *(pathname + pathend) = '\0';
 	    StrAllocCat(pathname, dirbuf->d_name);
 	    if (HTStat(pathname, &file_info)) {
 		/* for VMS the failure here means the file is not readable...
 		   we however continue to browse through the directory... */
 		continue;
 	    }
-	    entry_info = (VMSEntryInfo *)malloc(sizeof(VMSEntryInfo));
+	    entry_info = (VMSEntryInfo *) malloc(sizeof(VMSEntryInfo));
 	    if (entry_info == NULL)
 		outofmem(__FILE__, "HTVMSBrowseDir");
 	    entry_info->type = 0;
@@ -951,15 +936,13 @@ int HTVMSBrowseDir (
 
 	    /* Get the type */
 	    format = HTFileFormat(dirbuf->d_name, &encoding,
-				  (const char **)&cp);
+				  (const char **) &cp);
 	    if (!cp) {
-		if(!strncmp(HTAtom_name(format), "application",11))
-		{
+		if (!strncmp(HTAtom_name(format), "application", 11)) {
 		    cp = HTAtom_name(format) + 12;
-		    if(!strncmp(cp,"x-", 2))
+		    if (!strncmp(cp, "x-", 2))
 			cp += 2;
-		}
-		else
+		} else
 		    cp = HTAtom_name(format);
 	    }
 	    StrAllocCopy(entry_info->type, cp);
@@ -968,9 +951,10 @@ int HTVMSBrowseDir (
 	    if (S_ISDIR(file_info.st_mode)) {
 		/* strip .DIR part... */
 		char *dot;
+
 		dot = strstr(entry_info->filename, ".DIR");
 		if (dot)
-		   *dot = '\0';
+		    *dot = '\0';
 		LYLowerCase(entry_info->filename);
 		StrAllocCopy(entry_info->type, "Directory");
 	    } else {
@@ -992,43 +976,43 @@ int HTVMSBrowseDir (
 		}
 		LYLowerCase(cp);
 		if (((len = strlen(entry_info->filename)) > 2) &&
-		    entry_info->filename[len-1] == 'z') {
-		    if (entry_info->filename[len-2] == '.' ||
-			entry_info->filename[len-2] == '_')
-			entry_info->filename[len-1] = 'Z';
+		    entry_info->filename[len - 1] == 'z') {
+		    if (entry_info->filename[len - 2] == '.' ||
+			entry_info->filename[len - 2] == '_')
+			entry_info->filename[len - 1] = 'Z';
 		}
 	    }
 
 	    /* Get the date */
 	    {
-		char *t = (char *)ctime((const time_t *)&file_info.st_ctime);
-		*(t+24) = '\0';
+		char *t = (char *) ctime((const time_t *) &file_info.st_ctime);
+
+		*(t + 24) = '\0';
 
-		StrAllocCopy(entry_info->date, (t+4));
-		*((entry_info->date)+7) = '\0';
-		if ((atoi((t+19))) < atoi(ThisYear))
-		    StrAllocCat(entry_info->date,  (t+19));
+		StrAllocCopy(entry_info->date, (t + 4));
+		*((entry_info->date) + 7) = '\0';
+		if ((atoi((t + 19))) < atoi(ThisYear))
+		    StrAllocCat(entry_info->date, (t + 19));
 		else {
-		    StrAllocCat(entry_info->date, (t+11));
-		    *((entry_info->date)+12) = '\0';
+		    StrAllocCat(entry_info->date, (t + 11));
+		    *((entry_info->date) + 12) = '\0';
 		}
 	    }
 
 	    /* Get the size */
 	    if (!S_ISDIR(file_info.st_mode))
-		entry_info->size = (unsigned int)file_info.st_size;
+		entry_info->size = (unsigned int) file_info.st_size;
 	    else
 		entry_info->size = 0;
 
 	    /* Now, update the BTree etc. */
-	    if(entry_info->display)
-	      {
-		 CTRACE((tfp,"Adding file to BTree: %s\n",
-						      entry_info->filename));
-		 HTBTree_add(bt, entry_info);
-	      }
+	    if (entry_info->display) {
+		CTRACE((tfp, "Adding file to BTree: %s\n",
+			entry_info->filename));
+		HTBTree_add(bt, entry_info);
+	    }
 
-	} /* End while HTVMSreaddir() */
+	}			/* End while HTVMSreaddir() */
 
 	FREE(pathname);
 	HTVMSclosedir(dp);
@@ -1038,32 +1022,29 @@ int HTVMSBrowseDir (
 	 * Run through the BTree printing out in order
 	 */
 	{
-	    HTBTElement * ele;
+	    HTBTElement *ele;
 	    int i;
+
 	    for (ele = HTBTree_next(bt, NULL);
 		 ele != NULL;
-		 ele = HTBTree_next(bt, ele))
-	    {
-		entry_info = (VMSEntryInfo *)HTBTree_object(ele);
+		 ele = HTBTree_next(bt, ele)) {
+		entry_info = (VMSEntryInfo *) HTBTree_object(ele);
 
 		/* Output the date */
-		if(entry_info->date)
-		       {
-			     PUTS(entry_info->date);
-			     PUTS("  ");
-		       }
-		else
-			PUTS("     * ");
+		if (entry_info->date) {
+		    PUTS(entry_info->date);
+		    PUTS("  ");
+		} else
+		    PUTS("     * ");
 
 		/* Output the type */
-		if(entry_info->type)
-		  {
-		    for(i = 0; entry_info->type[i] != '\0' && i < 15; i++)
+		if (entry_info->type) {
+		    for (i = 0; entry_info->type[i] != '\0' && i < 15; i++)
 			PUTC(entry_info->type[i]);
-		    for(; i < 17; i++)
+		    for (; i < 17; i++)
 			PUTC(' ');
 
-		  }
+		}
 
 		/* Output the link for the name */
 		HTDirEntry(target, tail, entry_info->filename);
@@ -1071,18 +1052,17 @@ int HTVMSBrowseDir (
 		END(HTML_A);
 
 		/* Output the size */
-		if(entry_info->size)
-		  {
-			  if(entry_info->size < 1024)
-			      sprintf(string_buffer,"  %d bytes",
-							entry_info->size);
-			  else
-			      sprintf(string_buffer,"  %dKb",
-							entry_info->size/1024);
-			  PUTS(string_buffer);
-		  }
-
-		PUTC('\n'); /* end of this entry */
+		if (entry_info->size) {
+		    if (entry_info->size < 1024)
+			sprintf(string_buffer, "  %d bytes",
+				entry_info->size);
+		    else
+			sprintf(string_buffer, "  %dKb",
+				entry_info->size / 1024);
+		    PUTS(string_buffer);
+		}
+
+		PUTC('\n');	/* end of this entry */
 
 		free_VMSEntryInfo_contents(entry_info);
 	    }
@@ -1090,10 +1070,10 @@ int HTVMSBrowseDir (
 
 	HTBTreeAndObject_free(bt);
 
-    } /* End of both BTree loops */
+    }				/* End of both BTree loops */
 
     /*
-     *  Complete the output stream.
+     * Complete the output stream.
      */
     END(HTML_PRE);
     PUTC('\n');
@@ -1106,7 +1086,7 @@ int HTVMSBrowseDir (
 
     return HT_LOADED;
 
-} /* End of directory reading section */
+}				/* End of directory reading section */
 
 /*
  * Remove all versions of the given file.  We assume there are no permissions
@@ -1115,8 +1095,8 @@ int HTVMSBrowseDir (
 int HTVMS_remove(char *filename)
 {
     int code = remove(filename);	/* return the first status code */
-    while (remove(filename) == 0)
-	;
+
+    while (remove(filename) == 0) ;
     return code;
 }
 
@@ -1134,8 +1114,7 @@ void HTVMS_purge(char *filename)
     StrAllocCopy(older_file, filename);
     StrAllocCat(older_file, ";-1");
 
-    while (remove(older_file) == 0)
-	;
+    while (remove(older_file) == 0) ;
     /*
      * If we do not have any more older versions, it is safe to rename the
      * current file to version #1.
@@ -1149,3 +1128,4 @@ void HTVMS_purge(char *filename)
 
     FREE(older_file);
 }
+#endif /* VMS */
diff --git a/WWW/Library/Implementation/HTVMSUtils.h b/WWW/Library/Implementation/HTVMSUtils.h
index 3efc9259..78e26dae 100644
--- a/WWW/Library/Implementation/HTVMSUtils.h
+++ b/WWW/Library/Implementation/HTVMSUtils.h
@@ -14,86 +14,80 @@
 extern BOOL HTVMSFileVersions;	/* Include version numbers in listing? */
 
 /* PUBLIC							HTVMS_authSysPrv()
-**		CHECKS IF THIS PROCESS IS AUTHORIZED TO ENABLE SYSPRV
-** ON ENTRY:
-**	No arguments.
-**
-** ON EXIT:
-**	returns	YES if SYSPRV is authorized
-*/
-extern BOOL HTVMS_authSysPrv (void);
-
+ *		CHECKS IF THIS PROCESS IS AUTHORIZED TO ENABLE SYSPRV
+ * ON ENTRY:
+ *	No arguments.
+ *
+ * ON EXIT:
+ *	returns	YES if SYSPRV is authorized
+ */
+extern BOOL HTVMS_authSysPrv(void);
 
 /* PUBLIC							HTVMS_enableSysPrv()
-**		ENABLES SYSPRV
-** ON ENTRY:
-**	No arguments.
-**
-** ON EXIT:
-**
-*/
-extern void HTVMS_enableSysPrv (void);
-
+ *		ENABLES SYSPRV
+ * ON ENTRY:
+ *	No arguments.
+ *
+ * ON EXIT:
+ *
+ */
+extern void HTVMS_enableSysPrv(void);
 
 /* PUBLIC							HTVMS_disableSysPrv()
-**		DISABLES SYSPRV
-** ON ENTRY:
-**	No arguments.
-**
-** ON EXIT:
-**
-*/
-extern void HTVMS_disableSysPrv (void);
+ *		DISABLES SYSPRV
+ * ON ENTRY:
+ *	No arguments.
+ *
+ * ON EXIT:
+ *
+ */
+extern void HTVMS_disableSysPrv(void);
 
 /* PUBLIC							HTVMS_checkAccess()
-**		CHECKS ACCESS TO FILE FOR CERTAIN USER
-** ON ENTRY:
-**	FileName	The file to be accessed
-**	UserName	Name of the user to check access for
-**
-** ON EXIT:
-**	returns YES if access is allowed
-**
-*/
-extern BOOL HTVMS_checkAccess (
-	const char * FileName,
-	const char * UserName,
-	const char * Method);
-
+ *		CHECKS ACCESS TO FILE FOR CERTAIN USER
+ * ON ENTRY:
+ *	FileName	The file to be accessed
+ *	UserName	Name of the user to check access for
+ *
+ * ON EXIT:
+ *	returns YES if access is allowed
+ *
+ */
+extern BOOL HTVMS_checkAccess(const char *FileName,
+			      const char *UserName,
+			      const char *Method);
 
 /* PUBLIC							HTVMS_wwwName()
-**		CONVERTS VMS Name into WWW Name
-** ON ENTRY:
-**	vmsname		VMS file specification (NO NODE)
-**
-** ON EXIT:
-**	returns		www file specification
-**
-** EXAMPLES:
-**	vmsname				wwwname
-**	DISK$USER			disk$user
-**	DISK$USER:			/disk$user/
-**	DISK$USER:[DUNS]		/disk$user/duns
-**	DISK$USER:[DUNS.ECHO]		/disk$user/duns/echo
-**	[DUNS]				duns
-**	[DUNS.ECHO]			duns/echo
-**	[DUNS.ECHO.-.TRANS]		duns/echo/../trans
-**	[DUNS.ECHO.--.TRANS]		duns/echo/../../trans
-**	[.DUNS]				duns
-**	[.DUNS.ECHO]			duns/echo
-**	[.DUNS.ECHO]TEST.COM		duns/echo/test.com
-**	TEST.COM			test.com
-**
-**
-*/
-extern char * HTVMS_wwwName (
-	const char *	vmsname);
+ *		CONVERTS VMS Name into WWW Name
+ * ON ENTRY:
+ *	vmsname		VMS file specification (NO NODE)
+ *
+ * ON EXIT:
+ *	returns		www file specification
+ *
+ * EXAMPLES:
+ *	vmsname				wwwname
+ *	DISK$USER			disk$user
+ *	DISK$USER:			/disk$user/
+ *	DISK$USER:[DUNS]		/disk$user/duns
+ *	DISK$USER:[DUNS.ECHO]		/disk$user/duns/echo
+ *	[DUNS]				duns
+ *	[DUNS.ECHO]			duns/echo
+ *	[DUNS.ECHO.-.TRANS]		duns/echo/../trans
+ *	[DUNS.ECHO.--.TRANS]		duns/echo/../../trans
+ *	[.DUNS]				duns
+ *	[.DUNS.ECHO]			duns/echo
+ *	[.DUNS.ECHO]TEST.COM		duns/echo/test.com
+ *	TEST.COM			test.com
+ *
+ *
+ */
+extern char *HTVMS_wwwName(const char *vmsname);
 
-extern int HTVMSBrowseDir (
-	const char * address,
-	HTParentAnchor * anchor,
-	HTFormat format_out,
-	HTStream * sink);
+extern int HTVMSBrowseDir(const char *address,
+			  HTParentAnchor *anchor,
+			  HTFormat format_out,
+			  HTStream *sink);
 
 extern int HTVMS_remove(char *filename);
 extern void HTVMS_purge(char *filename);
diff --git a/WWW/Library/Implementation/HTVMS_WaisProt.c b/WWW/Library/Implementation/HTVMS_WaisProt.c
index 62a36a50..fbd24867 100644
--- a/WWW/Library/Implementation/HTVMS_WaisProt.c
+++ b/WWW/Library/Implementation/HTVMS_WaisProt.c
@@ -1,30 +1,30 @@
 /*							HTVMS_WAISProt.c
-**
-**	Adaptation for Lynx by F.Macrides (macrides@sci.wfeb.edu)
-**
-**	31-May-1994 FM	Initial version.
-**
-**----------------------------------------------------------------------*/
+ *
+ *	Adaptation for Lynx by F.Macrides (macrides@sci.wfeb.edu)
+ *
+ *	31-May-1994 FM	Initial version.
+ *
+ *----------------------------------------------------------------------*/
 
 /*
-**	Routines originally from WProt.c -- FM
-**
-**----------------------------------------------------------------------*/
+ *	Routines originally from WProt.c -- FM
+ *
+ *----------------------------------------------------------------------*/
 /* WIDE AREA INFORMATION SERVER SOFTWARE:
-   No guarantees or restrictions.  See the readme file for the full standard
-   disclaimer.
-
-   3.26.90	Harry Morris, morris@think.com
-   3.30.90  Harry Morris
-   -	removed chunk code from WAISSearchAPDU,
-   -	added makeWAISQueryType1Query() and readWAISType1Query() which replace
-   makeWAISQueryTerms() and makeWAISQueryDocs().
-   4.11.90  HWM - generalized conditional includes (see c-dialect.h)
-   - renamed makeWAISType1Query() to makeWAISTextQuery()
-   renamed readWAISType1Query() to readWAISTextQuery()
-   5.29.90  TS - fixed bug in makeWAISQueryDocs
-   added CSTFreeWAISFoo functions
-*/
+ * No guarantees or restrictions.  See the readme file for the full standard
+ * disclaimer.
+
+ * 3.26.90	Harry Morris, morris@think.com
+ * 3.30.90  Harry Morris
+ * -	removed chunk code from WAISSearchAPDU,
+ * -	added makeWAISQueryType1Query() and readWAISType1Query() which replace
+ * makeWAISQueryTerms() and makeWAISQueryDocs().
+ * 4.11.90  HWM - generalized conditional includes (see c-dialect.h)
+ * - renamed makeWAISType1Query() to makeWAISTextQuery()
+ * renamed readWAISType1Query() to readWAISTextQuery()
+ * 5.29.90  TS - fixed bug in makeWAISQueryDocs
+ * added CSTFreeWAISFoo functions
+ */
 
 #define _C_WAIS_protocol_
 
@@ -37,7 +37,6 @@
 
 #include <LYLeaks.h>
 
-
 /* very rough estimates of the size of an object */
 #define DefWAISInitResponseSize		(size_t)200
 #define DefWAISSearchSize			(size_t)3000
@@ -55,41 +54,35 @@
      if (*len > 0)				\
 	*len -= header_len;
 
-/*----------------------------------------------------------------------*/
+#define S_MALLOC(type) (type*)s_malloc(sizeof(type))
+#define S_MALLOC2(type) (type*)s_malloc(sizeof(type) * 2)
 
-static unsigned long userInfoTagSize (data_tag tag,
-					  unsigned long length);
+#define S_REALLOC2(type, ptr, num) (type*)s_realloc((char*)ptr, (sizeof(type) * (num + 2)))
 
-static unsigned long
-userInfoTagSize(tag,length)
-data_tag tag;
-unsigned long length;
+/*----------------------------------------------------------------------*/
+
+static unsigned long userInfoTagSize(data_tag tag,
+				     unsigned long length)
 /* return the number of bytes required to write the user info tag and
    length
  */
 {
-  unsigned long size;
+    unsigned long size;
 
-  /* calculate bytes required to represent tag.  max tag is 16K */
-  size = writtenCompressedIntSize(tag);
-  size += writtenCompressedIntSize(length);
+    /* calculate bytes required to represent tag.  max tag is 16K */
+    size = writtenCompressedIntSize(tag);
+    size += writtenCompressedIntSize(length);
 
-  return(size);
+    return (size);
 }
 
 /*----------------------------------------------------------------------*/
 
-static char* writeUserInfoHeader PARAMS((data_tag tag,long infoSize,
-				      long estHeaderSize,char* buffer,
-				      long* len));
-
-static char*
-writeUserInfoHeader(tag,infoSize,estHeaderSize,buffer,len)
-data_tag tag;
-long infoSize;
-long estHeaderSize;
-char* buffer;
-long* len;
+static char *writeUserInfoHeader(data_tag tag,
+				 long infoSize,
+				 long estHeaderSize,
+				 char *buffer,
+				 long *len)
 /* write the tag and size, making sure the info fits.  return the true end
    of the info (after adjustment) note that the argument infoSize includes
    estHeaderSize.  Note that the argument len is the number of bytes remaining
@@ -98,787 +91,762 @@ long* len;
    do that writing.
  */
 {
-  long dummyLen = 100;		/* plenty of space for a tag and size */
-  char* buf = buffer;
-  long realSize = infoSize - estHeaderSize;
-  long realHeaderSize = userInfoTagSize(tag,realSize);
+    long dummyLen = 100;	/* plenty of space for a tag and size */
+    char *buf = buffer;
+    long realSize = infoSize - estHeaderSize;
+    long realHeaderSize = userInfoTagSize(tag, realSize);
 
-  if (buffer == NULL || *len == 0)
-    return(NULL);
+    if (buffer == NULL || *len == 0)
+	return (NULL);
 
-  /* write the tag */
-  buf = writeTag(tag,buf,&dummyLen);
+    /* write the tag */
+    buf = writeTag(tag, buf, &dummyLen);
 
-  /* see if the if the header size was correct. if not,
-     we have to shift the info to fit the real header size */
-  if (estHeaderSize != realHeaderSize)
-    {				/* make sure there is enough space */
-      CHECK_FOR_SPACE_LEFT(realHeaderSize - estHeaderSize,len);
-      memmove(buffer + realHeaderSize,buffer + estHeaderSize,(size_t)(realSize));
+    /* see if the if the header size was correct. if not,
+       we have to shift the info to fit the real header size */
+    if (estHeaderSize != realHeaderSize) {	/* make sure there is enough space */
+	CHECK_FOR_SPACE_LEFT(realHeaderSize - estHeaderSize, len);
+	memmove(buffer + realHeaderSize, buffer + estHeaderSize, (size_t) (realSize));
     }
 
-  /* write the size */
-  writeCompressedInteger(realSize,buf,&dummyLen);
+    /* write the size */
+    writeCompressedInteger(realSize, buf, &dummyLen);
 
-  /* return the true end of buffer */
-  return(buffer + realHeaderSize + realSize);
+    /* return the true end of buffer */
+    return (buffer + realHeaderSize + realSize);
 }
 
 /*----------------------------------------------------------------------*/
 
-static char* readUserInfoHeader (data_tag* tag,unsigned long* num,
-				     char* buffer);
-
-static char*
-readUserInfoHeader(tag,num,buffer)
-data_tag* tag;
-unsigned long* num;
-char* buffer;
+static char *readUserInfoHeader(data_tag *tag,
+				unsigned long *num,
+				char *buffer)
 /* read the tag and size */
 {
-  char* buf = buffer;
-  buf = readTag(tag,buf);
-  buf = readCompressedInteger(num,buf);
-  return(buf);
+    char *buf = buffer;
+
+    buf = readTag(tag, buf);
+    buf = readCompressedInteger(num, buf);
+    return (buf);
 }
 
 /*----------------------------------------------------------------------*/
 
-WAISInitResponse*
-makeWAISInitResponse(chunkCode,
-		     chunkIDLen,
-		     chunkMarker,
-		     highlightMarker,
-		     deHighlightMarker,
-		     newLineChars)
-long chunkCode;
-long chunkIDLen;
-char* chunkMarker;
-char* highlightMarker;
-char* deHighlightMarker;
-char* newLineChars;
+WAISInitResponse *makeWAISInitResponse(long chunkCode,
+				       long chunkIDLen,
+				       char *chunkMarker,
+				       char *highlightMarker,
+				       char *deHighlightMarker,
+				       char *newLineChars)
 /* create a WAIS init response object */
 {
-  WAISInitResponse* init = (WAISInitResponse*)s_malloc((size_t)sizeof(WAISInitResponse));
+    WAISInitResponse *init = S_MALLOC(WAISInitResponse);
 
-  init->ChunkCode = chunkCode;	/* note: none are copied! */
-  init->ChunkIDLength = chunkIDLen;
-  init->ChunkMarker = chunkMarker;
-  init->HighlightMarker = highlightMarker;
-  init->DeHighlightMarker = deHighlightMarker;
-  init->NewlineCharacters = newLineChars;
+    init->ChunkCode = chunkCode;	/* note: none are copied! */
+    init->ChunkIDLength = chunkIDLen;
+    init->ChunkMarker = chunkMarker;
+    init->HighlightMarker = highlightMarker;
+    init->DeHighlightMarker = deHighlightMarker;
+    init->NewlineCharacters = newLineChars;
 
-  return(init);
+    return (init);
 }
 
 /*----------------------------------------------------------------------*/
 
-void
-freeWAISInitResponse(init)
-WAISInitResponse* init;
+void freeWAISInitResponse(WAISInitResponse *init)
 /* free an object made with makeWAISInitResponse */
 {
-  s_free(init->ChunkMarker);
-  s_free(init->HighlightMarker);
-  s_free(init->DeHighlightMarker);
-  s_free(init->NewlineCharacters);
-  s_free(init);
+    s_free(init->ChunkMarker);
+    s_free(init->HighlightMarker);
+    s_free(init->DeHighlightMarker);
+    s_free(init->NewlineCharacters);
+    s_free(init);
 }
 
 /*----------------------------------------------------------------------*/
 
-char*
-writeInitResponseInfo(init,buffer,len)
-InitResponseAPDU* init;
-char* buffer;
-long* len;
+char *writeInitResponseInfo(InitResponseAPDU *init,
+			    char *buffer,
+			    long *len)
 /* write an init response object */
 {
-  unsigned long header_len = userInfoTagSize(DT_UserInformationLength,
-					     DefWAISInitResponseSize);
-  char* buf = buffer + header_len;
-  WAISInitResponse* info = (WAISInitResponse*)init->UserInformationField;
-  unsigned long size;
+    unsigned long header_len = userInfoTagSize(DT_UserInformationLength,
+					       DefWAISInitResponseSize);
+    char *buf = buffer + header_len;
+    WAISInitResponse *info = (WAISInitResponse *) init->UserInformationField;
+    unsigned long size;
 
-  RESERVE_SPACE_FOR_WAIS_HEADER(len);
+    RESERVE_SPACE_FOR_WAIS_HEADER(len);
 
-  buf = writeNum(info->ChunkCode,DT_ChunkCode,buf,len);
-  buf = writeNum(info->ChunkIDLength,DT_ChunkIDLength,buf,len);
-  buf = writeString(info->ChunkMarker,DT_ChunkMarker,buf,len);
-  buf = writeString(info->HighlightMarker,DT_HighlightMarker,buf,len);
-  buf = writeString(info->DeHighlightMarker,DT_DeHighlightMarker,buf,len);
-  buf = writeString(info->NewlineCharacters,DT_NewlineCharacters,buf,len);
+    buf = writeNum(info->ChunkCode, DT_ChunkCode, buf, len);
+    buf = writeNum(info->ChunkIDLength, DT_ChunkIDLength, buf, len);
+    buf = writeString(info->ChunkMarker, DT_ChunkMarker, buf, len);
+    buf = writeString(info->HighlightMarker, DT_HighlightMarker, buf, len);
+    buf = writeString(info->DeHighlightMarker, DT_DeHighlightMarker, buf, len);
+    buf = writeString(info->NewlineCharacters, DT_NewlineCharacters, buf, len);
 
-  /* now write the header and size */
-  size = buf - buffer;
-  buf = writeUserInfoHeader(DT_UserInformationLength,size,header_len,buffer,len);
+    /* now write the header and size */
+    size = buf - buffer;
+    buf = writeUserInfoHeader(DT_UserInformationLength,
+			      size,
+			      header_len,
+			      buffer,
+			      len);
 
-  return(buf);
+    return (buf);
 }
 
 /*----------------------------------------------------------------------*/
 
-char*
-readInitResponseInfo(info,buffer)
-void** info;
-char* buffer;
+char *readInitResponseInfo(void **info,
+			   char *buffer)
 /* read an init response object */
 {
-  char* buf = buffer;
-  unsigned long size;
-  unsigned long headerSize;
-  long chunkCode,chunkIDLen;
-  data_tag tag1;
-  char* chunkMarker = NULL;
-  char* highlightMarker = NULL;
-  char* deHighlightMarker = NULL;
-  char* newLineChars = NULL;
+    char *buf = buffer;
+    unsigned long size;
+    unsigned long headerSize;
+    long chunkCode, chunkIDLen;
+    data_tag tag1;
+    char *chunkMarker = NULL;
+    char *highlightMarker = NULL;
+    char *deHighlightMarker = NULL;
+    char *newLineChars = NULL;
+
+    chunkCode = chunkIDLen = UNUSED;
 
-  chunkCode = chunkIDLen = UNUSED;
+    buf = readUserInfoHeader(&tag1, &size, buf);
+    headerSize = buf - buffer;
 
-  buf = readUserInfoHeader(&tag1,&size,buf);
-  headerSize = buf - buffer;
+    while (buf < (buffer + size + headerSize)) {
+	data_tag tag = peekTag(buf);
 
-  while (buf < (buffer + size + headerSize))
-    { data_tag tag = peekTag(buf);
-      switch (tag)
-	{ case DT_ChunkCode:
-	    buf = readNum(&chunkCode,buf);
+	switch (tag) {
+	case DT_ChunkCode:
+	    buf = readNum(&chunkCode, buf);
 	    break;
-	  case DT_ChunkIDLength:
-	    buf = readNum(&chunkIDLen,buf);
+	case DT_ChunkIDLength:
+	    buf = readNum(&chunkIDLen, buf);
 	    break;
-	  case DT_ChunkMarker:
-	    buf = readString(&chunkMarker,buf);
+	case DT_ChunkMarker:
+	    buf = readString(&chunkMarker, buf);
 	    break;
-	  case DT_HighlightMarker:
-	    buf = readString(&highlightMarker,buf);
+	case DT_HighlightMarker:
+	    buf = readString(&highlightMarker, buf);
 	    break;
-	  case DT_DeHighlightMarker:
-	    buf = readString(&deHighlightMarker,buf);
+	case DT_DeHighlightMarker:
+	    buf = readString(&deHighlightMarker, buf);
 	    break;
-	  case DT_NewlineCharacters:
-	    buf = readString(&newLineChars,buf);
+	case DT_NewlineCharacters:
+	    buf = readString(&newLineChars, buf);
 	    break;
-	  default:
+	default:
 	    s_free(highlightMarker);
 	    s_free(deHighlightMarker);
 	    s_free(newLineChars);
 	    REPORT_READ_ERROR(buf);
 	    break;
-	  }
+	}
     }
 
-  *info = (void *)makeWAISInitResponse(chunkCode,chunkIDLen,chunkMarker,
-			       highlightMarker,deHighlightMarker,
-			       newLineChars);
-  return(buf);
+    *info = (void *) makeWAISInitResponse(chunkCode, chunkIDLen, chunkMarker,
+					  highlightMarker, deHighlightMarker,
+					  newLineChars);
+    return (buf);
 }
 
 /*----------------------------------------------------------------------*/
 
-WAISSearch*
-makeWAISSearch(seedWords,
-	       docs,
-	       textList,
-	       dateFactor,
-	       beginDateRange,
-	       endDateRange,
-	       maxDocsRetrieved)
-char* seedWords;
-DocObj** docs;
-char** textList;
-long dateFactor;
-char* beginDateRange;
-char* endDateRange;
-long maxDocsRetrieved;
+WAISSearch *makeWAISSearch(char *seedWords,
+			   DocObj **docs,
+			   char **textList,
+			   long dateFactor,
+			   char *beginDateRange,
+			   char *endDateRange,
+			   long maxDocsRetrieved)
 
 /* create a type 3 query object */
 {
-  WAISSearch* query = (WAISSearch*)s_malloc((size_t)sizeof(WAISSearch));
+    WAISSearch *query = S_MALLOC(WAISSearch);
 
-  query->SeedWords = seedWords;	/* not copied! */
-  query->Docs = docs;		/* not copied! */
-  query->TextList = textList;	/* not copied! */
-  query->DateFactor = dateFactor;
-  query->BeginDateRange = beginDateRange;
-  query->EndDateRange = endDateRange;
-  query->MaxDocumentsRetrieved = maxDocsRetrieved;
+    query->SeedWords = seedWords;	/* not copied! */
+    query->Docs = docs;		/* not copied! */
+    query->TextList = textList;	/* not copied! */
+    query->DateFactor = dateFactor;
+    query->BeginDateRange = beginDateRange;
+    query->EndDateRange = endDateRange;
+    query->MaxDocumentsRetrieved = maxDocsRetrieved;
 
-  return(query);
+    return (query);
 }
 
 /*----------------------------------------------------------------------*/
 
-void
-freeWAISSearch(query)
-WAISSearch* query;
+void freeWAISSearch(WAISSearch *query)
 
 /* destroy an object made with makeWAISSearch() */
 {
-  void* ptr = NULL;
-  long i;
+    void *ptr = NULL;
+    long i;
 
-  s_free(query->SeedWords);
+    s_free(query->SeedWords);
 
-  if (query->Docs != NULL)
-    for (i = 0,ptr = (void *)query->Docs[i]; ptr != NULL; ptr = (void *)query->Docs[++i])
-      freeDocObj((DocObj*)ptr);
-  s_free(query->Docs);
+    if (query->Docs != NULL)
+	for (i = 0, ptr = (void *) query->Docs[i];
+	     ptr != NULL;
+	     ptr = (void *) query->Docs[++i])
+	    freeDocObj((DocObj *) ptr);
+    s_free(query->Docs);
 
-  if (query->TextList != NULL)	/* XXX revisit when textlist is fully defined */
-    for (i = 0,ptr = (void *)query->TextList[i]; ptr != NULL; ptr = (void *)query->TextList[++i])
-      s_free(ptr);
-  s_free(query->TextList);
+    if (query->TextList != NULL)	/* XXX revisit when textlist is fully defined */
+	for (i = 0, ptr = (void *) query->TextList[i];
+	     ptr != NULL;
+	     ptr = (void *) query->TextList[++i])
+	    s_free(ptr);
+    s_free(query->TextList);
 
-  s_free(query->BeginDateRange);
-  s_free(query->EndDateRange);
-  s_free(query);
+    s_free(query->BeginDateRange);
+    s_free(query->EndDateRange);
+    s_free(query);
 }
 
 /*----------------------------------------------------------------------*/
 
-DocObj*
-makeDocObjUsingWholeDocument(docID,type)
-any* docID;
-char* type;
+DocObj *makeDocObjUsingWholeDocument(any *docID,
+				     char *type)
 
 /* construct a document object using byte chunks - only for use by
    servers */
 {
-  DocObj* doc = (DocObj*)s_malloc((size_t)sizeof(DocObj));
-  doc->DocumentID = docID;		/* not copied! */
-  doc->Type = type;		/* not copied! */
-  doc->ChunkCode = CT_document;
-  return(doc);
+    DocObj *doc = S_MALLOC(DocObj);
+
+    doc->DocumentID = docID;	/* not copied! */
+    doc->Type = type;		/* not copied! */
+    doc->ChunkCode = CT_document;
+    return (doc);
 }
 
 /*----------------------------------------------------------------------*/
 
-DocObj*
-makeDocObjUsingLines(docID,type,start,end)
-any* docID;
-char* type;
-long start;
-long end;
+DocObj *makeDocObjUsingLines(any *docID,
+			     char *type,
+			     long start,
+			     long end)
 
 /* construct a document object using line chunks - only for use by
    servers */
 {
-  DocObj* doc = (DocObj*)s_malloc((size_t)sizeof(DocObj));
-  doc->ChunkCode = CT_line;
-  doc->DocumentID = docID;		/* not copied */
-  doc->Type = type;		/* not copied! */
-  doc->ChunkStart.Pos = start;
-  doc->ChunkEnd.Pos = end;
-  return(doc);
+    DocObj *doc = S_MALLOC(DocObj);
+
+    doc->ChunkCode = CT_line;
+    doc->DocumentID = docID;	/* not copied */
+    doc->Type = type;		/* not copied! */
+    doc->ChunkStart.Pos = start;
+    doc->ChunkEnd.Pos = end;
+    return (doc);
 }
 
 /*----------------------------------------------------------------------*/
 
-DocObj*
-makeDocObjUsingBytes(docID,type,start,end)
-any* docID;
-char* type;
-long start;
-long end;
+DocObj *makeDocObjUsingBytes(any *docID,
+			     char *type,
+			     long start,
+			     long end)
 
 /* construct a document object using byte chunks - only for use by
    servers */
 {
-  DocObj* doc = (DocObj*)s_malloc((size_t)sizeof(DocObj));
-  doc->ChunkCode = CT_byte;
-  doc->DocumentID = docID;		/* not copied */
-  doc->Type = type;		/* not copied! */
-  doc->ChunkStart.Pos = start;
-  doc->ChunkEnd.Pos = end;
-  return(doc);
+    DocObj *doc = S_MALLOC(DocObj);
+
+    doc->ChunkCode = CT_byte;
+    doc->DocumentID = docID;	/* not copied */
+    doc->Type = type;		/* not copied! */
+    doc->ChunkStart.Pos = start;
+    doc->ChunkEnd.Pos = end;
+    return (doc);
 }
 
 /*----------------------------------------------------------------------*/
 
-DocObj*
-makeDocObjUsingParagraphs(docID,type,start,end)
-any* docID;
-char* type;
-any* start;
-any* end;
+DocObj *makeDocObjUsingParagraphs(any *docID,
+				  char *type,
+				  any *start,
+				  any *end)
 
 /* construct a document object using byte chunks - only for use by
    servers */
 {
-  DocObj* doc = (DocObj*)s_malloc((size_t)sizeof(DocObj));
-  doc->ChunkCode = CT_paragraph;
-  doc->DocumentID = docID;		/* not copied */
-  doc->Type = type;
-  doc->ChunkStart.ID = start;
-  doc->ChunkEnd.ID = end;
-  return(doc);
+    DocObj *doc = S_MALLOC(DocObj);
+
+    doc->ChunkCode = CT_paragraph;
+    doc->DocumentID = docID;	/* not copied */
+    doc->Type = type;
+    doc->ChunkStart.ID = start;
+    doc->ChunkEnd.ID = end;
+    return (doc);
 }
 
 /*----------------------------------------------------------------------*/
 
-void
-freeDocObj(doc)
-DocObj* doc;
+void freeDocObj(DocObj *doc)
 
 /* free a docObj */
 {
-  freeAny(doc->DocumentID);
-  s_free(doc->Type);
-  if (doc->ChunkCode == CT_paragraph)
-    { freeAny(doc->ChunkStart.ID);
-      freeAny(doc->ChunkEnd.ID);
+    freeAny(doc->DocumentID);
+    s_free(doc->Type);
+    if (doc->ChunkCode == CT_paragraph) {
+	freeAny(doc->ChunkStart.ID);
+	freeAny(doc->ChunkEnd.ID);
     }
-  s_free(doc);
+    s_free(doc);
 }
 
 /*----------------------------------------------------------------------*/
 
-static char* writeDocObj (DocObj* doc,char* buffer,long* len);
-
-static char*
-writeDocObj(doc,buffer,len)
-DocObj* doc;
-char* buffer;
-long* len;
+static char *writeDocObj(DocObj *doc,
+			 char *buffer,
+			 long *len)
 
 /* write as little as we can about the doc obj */
 {
-  char* buf = buffer;
+    char *buf = buffer;
 
-  /* we alwasy have to write the id, but its tag depends on if its a chunk */
-  if (doc->ChunkCode == CT_document)
-    buf = writeAny(doc->DocumentID,DT_DocumentID,buf,len);
-  else
-    buf = writeAny(doc->DocumentID,DT_DocumentIDChunk,buf,len);
+    /* we alwasy have to write the id, but its tag depends on if its a chunk */
+    if (doc->ChunkCode == CT_document)
+	buf = writeAny(doc->DocumentID, DT_DocumentID, buf, len);
+    else
+	buf = writeAny(doc->DocumentID, DT_DocumentIDChunk, buf, len);
 
-  if (doc->Type != NULL)
-    buf = writeString(doc->Type,DT_TYPE,buf,len);
+    if (doc->Type != NULL)
+	buf = writeString(doc->Type, DT_TYPE, buf, len);
 
-  switch (doc->ChunkCode)
-    { case CT_document:
+    switch (doc->ChunkCode) {
+    case CT_document:
 	/* do nothing - there is no chunk data */
 	break;
-      case CT_byte:
-      case CT_line:
-	buf = writeNum(doc->ChunkCode,DT_ChunkCode,buf,len);
-	buf = writeNum(doc->ChunkStart.Pos,DT_ChunkStartID,buf,len);
-	buf = writeNum(doc->ChunkEnd.Pos,DT_ChunkEndID,buf,len);
+    case CT_byte:
+    case CT_line:
+	buf = writeNum(doc->ChunkCode, DT_ChunkCode, buf, len);
+	buf = writeNum(doc->ChunkStart.Pos, DT_ChunkStartID, buf, len);
+	buf = writeNum(doc->ChunkEnd.Pos, DT_ChunkEndID, buf, len);
 	break;
-      case CT_paragraph:
-	buf = writeNum(doc->ChunkCode,DT_ChunkCode,buf,len);
-	buf = writeAny(doc->ChunkStart.ID,DT_ChunkStartID,buf,len);
-	buf = writeAny(doc->ChunkEnd.ID,DT_ChunkEndID,buf,len);
+    case CT_paragraph:
+	buf = writeNum(doc->ChunkCode, DT_ChunkCode, buf, len);
+	buf = writeAny(doc->ChunkStart.ID, DT_ChunkStartID, buf, len);
+	buf = writeAny(doc->ChunkEnd.ID, DT_ChunkEndID, buf, len);
 	break;
-      default:
+    default:
 	panic("Implementation error: unknown chuck type %ld",
 	      doc->ChunkCode);
 	break;
-      }
+    }
 
-  return(buf);
+    return (buf);
 }
 
 /*----------------------------------------------------------------------*/
 
-static char* readDocObj (DocObj** doc,char* buffer);
-
-static char*
-readDocObj(doc,buffer)
-DocObj** doc;
-char* buffer;
+static char *readDocObj(DocObj **doc,
+			char *buffer)
 
 /* read whatever we have about the new document */
 {
-  char* buf = buffer;
-  data_tag tag;
-
-  *doc = (DocObj*)s_malloc((size_t)sizeof(DocObj));
-
-  tag = peekTag(buf);
-  buf = readAny(&((*doc)->DocumentID),buf);
-
-  if (tag == DT_DocumentID)
-    { (*doc)->ChunkCode = CT_document;
-      tag = peekTag(buf);
-      if (tag == DT_TYPE)	/* XXX depends on DT_TYPE != what comes next */
-	buf = readString(&((*doc)->Type),buf);
-      /* ChunkStart and ChunkEnd are undefined */
-    }
-  else if (tag == DT_DocumentIDChunk)
-    { boolean readParagraphs = false; /* for cleanup */
-      tag = peekTag(buf);
-      if (tag == DT_TYPE)	/* XXX depends on DT_TYPE != CT_FOO */
-	buf = readString(&((*doc)->Type),buf);
-      buf = readNum(&((*doc)->ChunkCode),buf);
-      switch ((*doc)->ChunkCode)
-	{ case CT_byte:
-	  case CT_line:
-	    buf = readNum(&((*doc)->ChunkStart.Pos),buf);
-	    buf = readNum(&((*doc)->ChunkEnd.Pos),buf);
-	    break;
-	  case CT_paragraph:
+    char *buf = buffer;
+    data_tag tag;
+
+    *doc = S_MALLOC(DocObj);
+
+    tag = peekTag(buf);
+    buf = readAny(&((*doc)->DocumentID), buf);
+
+    if (tag == DT_DocumentID) {
+	(*doc)->ChunkCode = CT_document;
+	tag = peekTag(buf);
+	if (tag == DT_TYPE)	/* XXX depends on DT_TYPE != what comes next */
+	    buf = readString(&((*doc)->Type), buf);
+	/* ChunkStart and ChunkEnd are undefined */
+    } else if (tag == DT_DocumentIDChunk) {
+	boolean readParagraphs = false;		/* for cleanup */
+
+	tag = peekTag(buf);
+	if (tag == DT_TYPE)	/* XXX depends on DT_TYPE != CT_FOO */
+	    buf = readString(&((*doc)->Type), buf);
+	buf = readNum(&((*doc)->ChunkCode), buf);
+	switch ((*doc)->ChunkCode) {
+	case CT_byte:
+	case CT_line:
+	    buf = readNum(&((*doc)->ChunkStart.Pos), buf);
+	    buf = readNum(&((*doc)->ChunkEnd.Pos), buf);
+	    break;
+	case CT_paragraph:
 	    readParagraphs = true;
-	    buf = readAny(&((*doc)->ChunkStart.ID),buf);
-	    buf = readAny(&((*doc)->ChunkEnd.ID),buf);
+	    buf = readAny(&((*doc)->ChunkStart.ID), buf);
+	    buf = readAny(&((*doc)->ChunkEnd.ID), buf);
 	    break;
-	  default:
+	default:
 	    freeAny((*doc)->DocumentID);
-	    if (readParagraphs)
-	      { freeAny((*doc)->ChunkStart.ID);
+	    if (readParagraphs) {
+		freeAny((*doc)->ChunkStart.ID);
 		freeAny((*doc)->ChunkEnd.ID);
-	      }
+	    }
 	    s_free(doc);
 	    REPORT_READ_ERROR(buf);
 	    break;
-	  }
-    }
-  else
-    { freeAny((*doc)->DocumentID);
-      s_free(*doc);
-      REPORT_READ_ERROR(buf);
+	}
+    } else {
+	freeAny((*doc)->DocumentID);
+	s_free(*doc);
+	REPORT_READ_ERROR(buf);
     }
-  return(buf);
+    return (buf);
 }
 
 /*----------------------------------------------------------------------*/
 
-char*
-writeSearchInfo(query,buffer,len)
-SearchAPDU* query;
-char* buffer;
-long* len;
+char *writeSearchInfo(SearchAPDU *query,
+		      char *buffer,
+		      long *len)
 
 /* write out a WAIS query (type 1 or 3) */
 {
-  if (strcmp(query->QueryType,QT_TextRetrievalQuery) == 0)
-    { return(writeAny((any*)query->Query,DT_Query,buffer,len));
-    }
-  else
-    { unsigned long header_len = userInfoTagSize(DT_UserInformationLength,
-						 DefWAISSearchSize);
-      char* buf = buffer + header_len;
-      WAISSearch* info = (WAISSearch*)query->Query;
-      unsigned long size;
-      long i;
-
-      RESERVE_SPACE_FOR_WAIS_HEADER(len);
-
-      buf = writeString(info->SeedWords,DT_SeedWords,buf,len);
-
-      if (info->Docs != NULL)
-      { for (i = 0; info->Docs[i] != NULL; i++)
-	  { buf = writeDocObj(info->Docs[i],buf,len);
-	  }
-	}
+    if (strcmp(query->QueryType, QT_TextRetrievalQuery) == 0) {
+	return (writeAny((any *) query->Query, DT_Query, buffer, len));
+    } else {
+	unsigned long header_len = userInfoTagSize(DT_UserInformationLength,
+						   DefWAISSearchSize);
+	char *buf = buffer + header_len;
+	WAISSearch *info = (WAISSearch *) query->Query;
+	unsigned long size;
+	long i;
 
-      /* XXX text list */
+	RESERVE_SPACE_FOR_WAIS_HEADER(len);
 
-      buf = writeNum(info->DateFactor,DT_DateFactor,buf,len);
-      buf = writeString(info->BeginDateRange,DT_BeginDateRange,buf,len);
-      buf = writeString(info->EndDateRange,DT_EndDateRange,buf,len);
-      buf = writeNum(info->MaxDocumentsRetrieved,DT_MaxDocumentsRetrieved,buf,len);
+	buf = writeString(info->SeedWords, DT_SeedWords, buf, len);
 
-      /* now write the header and size */
-      size = buf - buffer;
-      buf = writeUserInfoHeader(DT_UserInformationLength,size,header_len,buffer,len);
+	if (info->Docs != NULL) {
+	    for (i = 0; info->Docs[i] != NULL; i++) {
+		buf = writeDocObj(info->Docs[i], buf, len);
+	    }
+	}
 
-      return(buf);
+	/* XXX text list */
+
+	buf = writeNum(info->DateFactor,
+		       DT_DateFactor,
+		       buf,
+		       len);
+	buf = writeString(info->BeginDateRange,
+			  DT_BeginDateRange,
+			  buf,
+			  len);
+	buf = writeString(info->EndDateRange,
+			  DT_EndDateRange,
+			  buf,
+			  len);
+	buf = writeNum(info->MaxDocumentsRetrieved,
+		       DT_MaxDocumentsRetrieved,
+		       buf,
+		       len);
+
+	/* now write the header and size */
+	size = buf - buffer;
+	buf = writeUserInfoHeader(DT_UserInformationLength,
+				  size,
+				  header_len,
+				  buffer,
+				  len);
+
+	return (buf);
     }
 }
 
 /*----------------------------------------------------------------------*/
 
-char*
-readSearchInfo(info,buffer)
-void** info;
-char* buffer;
+char *readSearchInfo(void **info,
+		     char *buffer)
 
 /* read a WAIS query (type 1 or 3) */
 {
-  data_tag type = peekTag(buffer);
-  if (type == DT_Query)		/* this is a type 1 query */
-    { char* buf = buffer;
-      any* query = NULL;
-      buf = readAny(&query,buf);
-      *info = (void *)query;
-      return(buf);
-    }
-  else				/* a type 3 query */
-    { char* buf = buffer;
-      unsigned long size;
-      unsigned long headerSize;
-      data_tag tag1;
-      char* seedWords = NULL;
-      char* beginDateRange = NULL;
-      char* endDateRange = NULL;
-      long dateFactor,maxDocsRetrieved;
-      char** textList = NULL;
-      DocObj** docIDs = NULL;
-      DocObj* doc = NULL;
-      long docs = 0;
-      long i;
-      void* ptr = NULL;
-
-      dateFactor = maxDocsRetrieved = UNUSED;
-
-      buf = readUserInfoHeader(&tag1,&size,buf);
-      headerSize = buf - buffer;
-
-      while (buf < (buffer + size + headerSize))
-	{ data_tag tag = peekTag(buf);
-	  switch (tag)
-	    { case DT_SeedWords:
-		buf = readString(&seedWords,buf);
+    data_tag type = peekTag(buffer);
+
+    if (type == DT_Query)	/* this is a type 1 query */
+    {
+	char *buf = buffer;
+	any *query = NULL;
+
+	buf = readAny(&query, buf);
+	*info = (void *) query;
+	return (buf);
+    } else {			/* a type 3 query */
+	char *buf = buffer;
+	unsigned long size;
+	unsigned long headerSize;
+	data_tag tag1;
+	char *seedWords = NULL;
+	char *beginDateRange = NULL;
+	char *endDateRange = NULL;
+	long dateFactor, maxDocsRetrieved;
+	char **textList = NULL;
+	DocObj **docIDs = NULL;
+	DocObj *doc = NULL;
+	long docs = 0;
+	long i;
+	void *ptr = NULL;
+
+	dateFactor = maxDocsRetrieved = UNUSED;
+
+	buf = readUserInfoHeader(&tag1, &size, buf);
+	headerSize = buf - buffer;
+
+	while (buf < (buffer + size + headerSize)) {
+	    data_tag tag = peekTag(buf);
+
+	    switch (tag) {
+	    case DT_SeedWords:
+		buf = readString(&seedWords, buf);
 		break;
-	      case DT_DocumentID:
-	      case DT_DocumentIDChunk:
-		if (docIDs == NULL) /* create a new doc list */
-		  { docIDs = (DocObj**)s_malloc((size_t)sizeof(DocObj*) * 2);
-		  }
-		else		/* grow the doc list */
-		  { docIDs = (DocObj**)s_realloc((char*)docIDs,(size_t)(sizeof(DocObj*) * (docs + 2)));
-		  }
-		buf = readDocObj(&doc,buf);
-		if (buf == NULL)
-		  { s_free(seedWords);
+	    case DT_DocumentID:
+	    case DT_DocumentIDChunk:
+		if (docIDs == NULL)	/* create a new doc list */
+		{
+		    docIDs = S_MALLOC2(DocObj *);
+		} else {	/* grow the doc list */
+		    docIDs = S_REALLOC2(DocObj *, docIDs, docs);
+		}
+		buf = readDocObj(&doc, buf);
+		if (buf == NULL) {
+		    s_free(seedWords);
 		    s_free(beginDateRange);
 		    s_free(endDateRange);
 		    if (docIDs != NULL)
-		      for (i = 0,ptr = (void *)docIDs[i]; ptr != NULL; ptr = (void *)docIDs[++i])
-			freeDocObj((DocObj*)ptr);
+			for (i = 0, ptr = (void *) docIDs[i];
+			     ptr != NULL;
+			     ptr = (void *) docIDs[++i])
+			    freeDocObj((DocObj *) ptr);
 		    s_free(docIDs);
 		    /* XXX should also free textlist when it is fully defined */
-		  }
+		}
 		RETURN_ON_NULL(buf);
-		docIDs[docs++] = doc; /* put it in the list */
+		docIDs[docs++] = doc;	/* put it in the list */
 		docIDs[docs] = NULL;
 		break;
-	      case DT_TextList:
+	    case DT_TextList:
 		/* XXX */
 		break;
-	      case DT_DateFactor:
-		buf = readNum(&dateFactor,buf);
+	    case DT_DateFactor:
+		buf = readNum(&dateFactor, buf);
 		break;
-	      case DT_BeginDateRange:
-		buf = readString(&beginDateRange,buf);
+	    case DT_BeginDateRange:
+		buf = readString(&beginDateRange, buf);
 		break;
-	      case DT_EndDateRange:
-		buf = readString(&endDateRange,buf);
+	    case DT_EndDateRange:
+		buf = readString(&endDateRange, buf);
 		break;
-	      case DT_MaxDocumentsRetrieved:
-		buf = readNum(&maxDocsRetrieved,buf);
+	    case DT_MaxDocumentsRetrieved:
+		buf = readNum(&maxDocsRetrieved, buf);
 		break;
-	      default:
+	    default:
 		s_free(seedWords);
 		s_free(beginDateRange);
 		s_free(endDateRange);
 		if (docIDs != NULL)
-		  for (i = 0,ptr = (void *)docIDs[i]; ptr != NULL; ptr = (void *)docIDs[++i])
-		    freeDocObj((DocObj*)ptr);
+		    for (i = 0, ptr = (void *) docIDs[i];
+			 ptr != NULL;
+			 ptr = (void *) docIDs[++i])
+			freeDocObj((DocObj *) ptr);
 		s_free(docIDs);
 		/* XXX should also free textlist when it is fully defined */
 		REPORT_READ_ERROR(buf);
 		break;
-	      }
+	    }
 	}
 
-      *info = (void *)makeWAISSearch(seedWords,docIDs,textList,
-				     dateFactor,beginDateRange,endDateRange,
-				     maxDocsRetrieved);
-      return(buf);
+	*info = (void *) makeWAISSearch(seedWords, docIDs, textList,
+					dateFactor, beginDateRange, endDateRange,
+					maxDocsRetrieved);
+	return (buf);
     }
 }
 
 /*----------------------------------------------------------------------*/
 
-WAISDocumentHeader*
-makeWAISDocumentHeader(docID,
-		       versionNumber,
-		       score,
-		       bestMatch,
-		       docLen,
-		       lines,
-		       types,
-		       source,
-		       date,
-		       headline,
-		       originCity)
-any* docID;
-long versionNumber;
-long score;
-long bestMatch;
-long docLen;
-long lines;
-char** types;
-char* source;
-char* date;
-char* headline;
-char* originCity;
+WAISDocumentHeader *makeWAISDocumentHeader(any *docID,
+					   long versionNumber,
+					   long score,
+					   long bestMatch,
+					   long docLen,
+					   long lines,
+					   char **types,
+					   char *source,
+					   char *date,
+					   char *headline,
+					   char *originCity)
 
 /* construct a standard document header, note that no fields are copied!
    if the application needs to save these fields, it should copy them,
    or set the field in this object to NULL before freeing it.
  */
 {
-  WAISDocumentHeader* header =
-    (WAISDocumentHeader*)s_malloc((size_t)sizeof(WAISDocumentHeader));
+    WAISDocumentHeader *header = S_MALLOC(WAISDocumentHeader);
 
-  header->DocumentID = docID;
-  header->VersionNumber = versionNumber;
-  header->Score = score;
-  header->BestMatch = bestMatch;
-  header->DocumentLength = docLen;
-  header->Lines = lines;
-  header->Types = types;
-  header->Source = source;
-  header->Date = date;
-  header->Headline = headline;
-  header->OriginCity = originCity;
+    header->DocumentID = docID;
+    header->VersionNumber = versionNumber;
+    header->Score = score;
+    header->BestMatch = bestMatch;
+    header->DocumentLength = docLen;
+    header->Lines = lines;
+    header->Types = types;
+    header->Source = source;
+    header->Date = date;
+    header->Headline = headline;
+    header->OriginCity = originCity;
 
-  return(header);
+    return (header);
 }
 
 /*----------------------------------------------------------------------*/
 
-void
-freeWAISDocumentHeader(header)
-WAISDocumentHeader* header;
-
+void freeWAISDocumentHeader(WAISDocumentHeader *header)
 {
-  freeAny(header->DocumentID);
-  doList((void**)header->Types,fs_free); /* can't use the macro here ! */
-  s_free(header->Types);
-  s_free(header->Source);
-  s_free(header->Date);
-  s_free(header->Headline);
-  s_free(header->OriginCity);
-  s_free(header);
+    freeAny(header->DocumentID);
+    doList((void **) header->Types, fs_free);	/* can't use the macro here ! */
+    s_free(header->Types);
+    s_free(header->Source);
+    s_free(header->Date);
+    s_free(header->Headline);
+    s_free(header->OriginCity);
+    s_free(header);
 }
 
 /*----------------------------------------------------------------------*/
 
-char*
-writeWAISDocumentHeader(header,buffer,len)
-WAISDocumentHeader* header;
-char* buffer;
-long* len;
+char *writeWAISDocumentHeader(WAISDocumentHeader *header, char *buffer,
+			      long *len)
 {
-  unsigned long header_len = userInfoTagSize(DT_DocumentHeaderGroup ,
-					     DefWAISDocHeaderSize);
-  char* buf = buffer + header_len;
-  unsigned long size1;
+    unsigned long header_len = userInfoTagSize(DT_DocumentHeaderGroup,
+					       DefWAISDocHeaderSize);
+    char *buf = buffer + header_len;
+    unsigned long size1;
+
+    RESERVE_SPACE_FOR_WAIS_HEADER(len);
+
+    buf = writeAny(header->DocumentID, DT_DocumentID, buf, len);
+    buf = writeNum(header->VersionNumber, DT_VersionNumber, buf, len);
+    buf = writeNum(header->Score, DT_Score, buf, len);
+    buf = writeNum(header->BestMatch, DT_BestMatch, buf, len);
+    buf = writeNum(header->DocumentLength, DT_DocumentLength, buf, len);
+    buf = writeNum(header->Lines, DT_Lines, buf, len);
+    if (header->Types != NULL) {
+	long size;
+	char *ptr = NULL;
+	long i;
 
-  RESERVE_SPACE_FOR_WAIS_HEADER(len);
+	buf = writeTag(DT_TYPE_BLOCK, buf, len);
+	for (i = 0, size = 0, ptr = header->Types[i];
+	     ptr != NULL;
+	     ptr = header->Types[++i]) {
+	    long typeSize = strlen(ptr);
 
-  buf = writeAny(header->DocumentID,DT_DocumentID,buf,len);
-  buf = writeNum(header->VersionNumber,DT_VersionNumber,buf,len);
-  buf = writeNum(header->Score,DT_Score,buf,len);
-  buf = writeNum(header->BestMatch,DT_BestMatch,buf,len);
-  buf = writeNum(header->DocumentLength,DT_DocumentLength,buf,len);
-  buf = writeNum(header->Lines,DT_Lines,buf,len);
-  if (header->Types != NULL)
-    { long size;
-      char* ptr = NULL;
-      long i;
-      buf = writeTag(DT_TYPE_BLOCK,buf,len);
-      for (i = 0,size = 0,ptr = header->Types[i]; ptr != NULL; ptr = header->Types[++i])
-	{ long typeSize = strlen(ptr);
-	  size += writtenTagSize(DT_TYPE);
-	  size += writtenCompressedIntSize(typeSize);
-	  size += typeSize;
+	    size += writtenTagSize(DT_TYPE);
+	    size += writtenCompressedIntSize(typeSize);
+	    size += typeSize;
 	}
-      buf = writeCompressedInteger((unsigned long)size,buf,len);
-      for (i = 0,ptr = header->Types[i]; ptr != NULL; ptr = header->Types[++i])
-	buf = writeString(ptr,DT_TYPE,buf,len);
+	buf = writeCompressedInteger((unsigned long) size, buf, len);
+	for (i = 0, ptr = header->Types[i]; ptr != NULL; ptr = header->Types[++i])
+	    buf = writeString(ptr, DT_TYPE, buf, len);
     }
-  buf = writeString(header->Source,DT_Source,buf,len);
-  buf = writeString(header->Date,DT_Date,buf,len);
-  buf = writeString(header->Headline,DT_Headline,buf,len);
-  buf = writeString(header->OriginCity,DT_OriginCity,buf,len);
-
-  /* now write the header and size */
-  size1 = buf - buffer;
-  buf = writeUserInfoHeader(DT_DocumentHeaderGroup,size1,header_len,buffer,len);
-
-  return(buf);
-}
-
-/*----------------------------------------------------------------------*/
-
-char*
-readWAISDocumentHeader(header,buffer)
-WAISDocumentHeader** header;
-char* buffer;
-{
-  char* buf = buffer;
-  unsigned long size1;
-  unsigned long headerSize;
-  data_tag tag1;
-  any* docID = NULL;
-  long versionNumber,score,bestMatch,docLength,lines;
-  char** types = NULL;
-  char *source = NULL;
-  char *date = NULL;
-  char *headline = NULL;
-  char *originCity = NULL;
-
-  versionNumber = score = bestMatch = docLength = lines = UNUSED;
-
-  buf = readUserInfoHeader(&tag1,&size1,buf);
-  headerSize = buf - buffer;
-
-  while (buf < (buffer + size1 + headerSize))
-    { data_tag tag = peekTag(buf);
-      switch (tag)
-	{ case DT_DocumentID:
-	    buf = readAny(&docID,buf);
-	    break;
-	  case DT_VersionNumber:
-	    buf = readNum(&versionNumber,buf);
-	    break;
-	  case DT_Score:
-	    buf = readNum(&score,buf);
-	    break;
-	  case DT_BestMatch:
-	    buf = readNum(&bestMatch,buf);
-	    break;
-	  case DT_DocumentLength:
-	    buf = readNum(&docLength,buf);
-	    break;
-	  case DT_Lines:
-	    buf = readNum(&lines,buf);
-	    break;
-	  case DT_TYPE_BLOCK:
-	    { unsigned long size = -1;
-	      long numTypes = 0;
-	      buf = readTag(&tag,buf);
-	      buf = readCompressedInteger(&size,buf);
-	      while (size > 0)
-		{ char* type = NULL;
-		  char* originalBuf = buf;
-		  buf = readString(&type,buf);
-		  types = (char**)s_realloc(types,(size_t)(sizeof(char*) * (numTypes + 2)));
-		  types[numTypes++] = type;
-		  types[numTypes] = NULL;
-		  size -= (buf - originalBuf);
+    buf = writeString(header->Source, DT_Source, buf, len);
+    buf = writeString(header->Date, DT_Date, buf, len);
+    buf = writeString(header->Headline, DT_Headline, buf, len);
+    buf = writeString(header->OriginCity, DT_OriginCity, buf, len);
+
+    /* now write the header and size */
+    size1 = buf - buffer;
+    buf = writeUserInfoHeader(DT_DocumentHeaderGroup,
+			      size1,
+			      header_len,
+			      buffer,
+			      len);
+
+    return (buf);
+}
+
+/*----------------------------------------------------------------------*/
+
+char *readWAISDocumentHeader(WAISDocumentHeader **header, char *buffer)
+{
+    char *buf = buffer;
+    unsigned long size1;
+    unsigned long headerSize;
+    data_tag tag1;
+    any *docID = NULL;
+    long versionNumber, score, bestMatch, docLength, lines;
+    char **types = NULL;
+    char *source = NULL;
+    char *date = NULL;
+    char *headline = NULL;
+    char *originCity = NULL;
+
+    versionNumber = score = bestMatch = docLength = lines = UNUSED;
+
+    buf = readUserInfoHeader(&tag1, &size1, buf);
+    headerSize = buf - buffer;
+
+    while (buf < (buffer + size1 + headerSize)) {
+	data_tag tag = peekTag(buf);
+
+	switch (tag) {
+	case DT_DocumentID:
+	    buf = readAny(&docID, buf);
+	    break;
+	case DT_VersionNumber:
+	    buf = readNum(&versionNumber, buf);
+	    break;
+	case DT_Score:
+	    buf = readNum(&score, buf);
+	    break;
+	case DT_BestMatch:
+	    buf = readNum(&bestMatch, buf);
+	    break;
+	case DT_DocumentLength:
+	    buf = readNum(&docLength, buf);
+	    break;
+	case DT_Lines:
+	    buf = readNum(&lines, buf);
+	    break;
+	case DT_TYPE_BLOCK:
+	    {
+		unsigned long size = -1;
+		long numTypes = 0;
+
+		buf = readTag(&tag, buf);
+		buf = readCompressedInteger(&size, buf);
+		while (size > 0) {
+		    char *type = NULL;
+		    char *originalBuf = buf;
+
+		    buf = readString(&type, buf);
+		    types = S_REALLOC2(char *, types, numTypes);
+
+		    types[numTypes++] = type;
+		    types[numTypes] = NULL;
+		    size -= (buf - originalBuf);
 		}
 	    }
 	    /* FALLTHRU */
-	  case DT_Source:
-	    buf = readString(&source,buf);
+	case DT_Source:
+	    buf = readString(&source, buf);
 	    break;
-	  case DT_Date:
-	    buf = readString(&date,buf);
+	case DT_Date:
+	    buf = readString(&date, buf);
 	    break;
-	  case DT_Headline:
-	    buf = readString(&headline,buf);
+	case DT_Headline:
+	    buf = readString(&headline, buf);
 	    break;
-	  case DT_OriginCity:
-	    buf = readString(&originCity,buf);
+	case DT_OriginCity:
+	    buf = readString(&originCity, buf);
 	    break;
-	  default:
+	default:
 	    freeAny(docID);
 	    s_free(source);
 	    s_free(date);
@@ -886,348 +854,336 @@ char* buffer;
 	    s_free(originCity);
 	    REPORT_READ_ERROR(buf);
 	    break;
-	  }
+	}
     }
 
-  *header = makeWAISDocumentHeader(docID,versionNumber,score,bestMatch,
-				   docLength,lines,types,source,date,headline,
-				   originCity);
-  return(buf);
+    *header = makeWAISDocumentHeader(docID, versionNumber, score, bestMatch,
+				     docLength, lines, types, source, date, headline,
+				     originCity);
+    return (buf);
 }
 
 /*----------------------------------------------------------------------*/
 
-WAISDocumentShortHeader*
-makeWAISDocumentShortHeader(docID,
-			    versionNumber,
-			    score,
-			    bestMatch,
-			    docLen,
-			    lines)
-any* docID;
-long versionNumber;
-long score;
-long bestMatch;
-long docLen;
-long lines;
+WAISDocumentShortHeader *makeWAISDocumentShortHeader(any *docID,
+						     long versionNumber,
+						     long score,
+						     long bestMatch,
+						     long docLen,
+						     long lines)
 /* construct a short document header, note that no fields are copied!
    if the application needs to save these fields, it should copy them,
    or set the field in this object to NULL before freeing it.
  */
 {
-  WAISDocumentShortHeader* header =
-    (WAISDocumentShortHeader*)s_malloc((size_t)sizeof(WAISDocumentShortHeader));
+    WAISDocumentShortHeader *header = S_MALLOC(WAISDocumentShortHeader);
 
-  header->DocumentID = docID;
-  header->VersionNumber = versionNumber;
-  header->Score = score;
-  header->BestMatch = bestMatch;
-  header->DocumentLength = docLen;
-  header->Lines = lines;
+    header->DocumentID = docID;
+    header->VersionNumber = versionNumber;
+    header->Score = score;
+    header->BestMatch = bestMatch;
+    header->DocumentLength = docLen;
+    header->Lines = lines;
 
-  return(header);
+    return (header);
 }
 
 /*----------------------------------------------------------------------*/
 
-void
-freeWAISDocumentShortHeader(header)
-WAISDocumentShortHeader* header;
+void freeWAISDocumentShortHeader(WAISDocumentShortHeader *header)
 {
-  freeAny(header->DocumentID);
-  s_free(header);
+    freeAny(header->DocumentID);
+    s_free(header);
 }
 
 /*----------------------------------------------------------------------*/
 
-char*
-writeWAISDocumentShortHeader(header,buffer,len)
-WAISDocumentShortHeader* header;
-char* buffer;
-long* len;
+char *writeWAISDocumentShortHeader(WAISDocumentShortHeader *header, char *buffer,
+				   long *len)
 {
-  unsigned long header_len = userInfoTagSize(DT_DocumentShortHeaderGroup ,
-					     DefWAISShortHeaderSize);
-  char* buf = buffer + header_len;
-  unsigned long size;
+    unsigned long header_len = userInfoTagSize(DT_DocumentShortHeaderGroup,
+					       DefWAISShortHeaderSize);
+    char *buf = buffer + header_len;
+    unsigned long size;
 
-  RESERVE_SPACE_FOR_WAIS_HEADER(len);
+    RESERVE_SPACE_FOR_WAIS_HEADER(len);
 
-  buf = writeAny(header->DocumentID,DT_DocumentID,buf,len);
-  buf = writeNum(header->VersionNumber,DT_VersionNumber,buf,len);
-  buf = writeNum(header->Score,DT_Score,buf,len);
-  buf = writeNum(header->BestMatch,DT_BestMatch,buf,len);
-  buf = writeNum(header->DocumentLength,DT_DocumentLength,buf,len);
-  buf = writeNum(header->Lines,DT_Lines,buf,len);
+    buf = writeAny(header->DocumentID, DT_DocumentID, buf, len);
+    buf = writeNum(header->VersionNumber, DT_VersionNumber, buf, len);
+    buf = writeNum(header->Score, DT_Score, buf, len);
+    buf = writeNum(header->BestMatch, DT_BestMatch, buf, len);
+    buf = writeNum(header->DocumentLength, DT_DocumentLength, buf, len);
+    buf = writeNum(header->Lines, DT_Lines, buf, len);
 
-  /* now write the header and size */
-  size = buf - buffer;
-  buf = writeUserInfoHeader(DT_DocumentShortHeaderGroup,size,header_len,buffer,len);
+    /* now write the header and size */
+    size = buf - buffer;
+    buf = writeUserInfoHeader(DT_DocumentShortHeaderGroup,
+			      size,
+			      header_len,
+			      buffer,
+			      len);
 
-  return(buf);
+    return (buf);
 }
 
 /*----------------------------------------------------------------------*/
 
-char*
-readWAISDocumentShortHeader(header,buffer)
-WAISDocumentShortHeader** header;
-char* buffer;
+char *readWAISDocumentShortHeader(WAISDocumentShortHeader **header, char *buffer)
 {
-  char* buf = buffer;
-  unsigned long size;
-  unsigned long headerSize;
-  data_tag tag1;
-  any* docID = NULL;
-  long versionNumber,score,bestMatch,docLength,lines;
+    char *buf = buffer;
+    unsigned long size;
+    unsigned long headerSize;
+    data_tag tag1;
+    any *docID = NULL;
+    long versionNumber, score, bestMatch, docLength, lines;
 
-  versionNumber = score = bestMatch = docLength = lines = UNUSED;
+    versionNumber = score = bestMatch = docLength = lines = UNUSED;
 
-  buf = readUserInfoHeader(&tag1,&size,buf);
-  headerSize = buf - buffer;
+    buf = readUserInfoHeader(&tag1, &size, buf);
+    headerSize = buf - buffer;
 
-  while (buf < (buffer + size + headerSize))
-    { data_tag tag = peekTag(buf);
-      switch (tag)
-	{ case DT_DocumentID:
-	    buf = readAny(&docID,buf);
+    while (buf < (buffer + size + headerSize)) {
+	data_tag tag = peekTag(buf);
+
+	switch (tag) {
+	case DT_DocumentID:
+	    buf = readAny(&docID, buf);
 	    break;
-	  case DT_VersionNumber:
-	    buf = readNum(&versionNumber,buf);
+	case DT_VersionNumber:
+	    buf = readNum(&versionNumber, buf);
 	    break;
-	  case DT_Score:
-	    buf = readNum(&score,buf);
+	case DT_Score:
+	    buf = readNum(&score, buf);
 	    break;
-	  case DT_BestMatch:
-	    buf = readNum(&bestMatch,buf);
+	case DT_BestMatch:
+	    buf = readNum(&bestMatch, buf);
 	    break;
-	  case DT_DocumentLength:
-	    buf = readNum(&docLength,buf);
+	case DT_DocumentLength:
+	    buf = readNum(&docLength, buf);
 	    break;
-	  case DT_Lines:
-	    buf = readNum(&lines,buf);
+	case DT_Lines:
+	    buf = readNum(&lines, buf);
 	    break;
-	  default:
+	default:
 	    freeAny(docID);
 	    REPORT_READ_ERROR(buf);
 	    break;
-	  }
+	}
     }
 
-  *header = makeWAISDocumentShortHeader(docID,versionNumber,score,bestMatch,
-					docLength,lines);
-  return(buf);
-}
-
-/*----------------------------------------------------------------------*/
-
-WAISDocumentLongHeader*
-makeWAISDocumentLongHeader(docID,
-			   versionNumber,
-			   score,
-			   bestMatch,
-			   docLen,
-			   lines,
-			   types,
-			   source,
-			   date,
-			   headline,
-			   originCity,
-			   stockCodes,
-			   companyCodes,
-			   industryCodes)
-any* docID;
-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;
+    *header = makeWAISDocumentShortHeader(docID, versionNumber, score, bestMatch,
+					  docLength, lines);
+    return (buf);
+}
+
+/*----------------------------------------------------------------------*/
+
+WAISDocumentLongHeader *makeWAISDocumentLongHeader(any *docID,
+						   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)
 /* construct a long document header, note that no fields are copied!
    if the application needs to save these fields, it should copy them,
    or set the field in this object to NULL before freeing it.
  */
 {
-  WAISDocumentLongHeader* header =
-    (WAISDocumentLongHeader*)s_malloc((size_t)sizeof(WAISDocumentLongHeader));
-
-  header->DocumentID = docID;
-  header->VersionNumber = versionNumber;
-  header->Score = score;
-  header->BestMatch = bestMatch;
-  header->DocumentLength = docLen;
-  header->Lines = lines;
-  header->Types = types;
-  header->Source = source;
-  header->Date = date;
-  header->Headline = headline;
-  header->OriginCity = originCity;
-  header->StockCodes = stockCodes;
-  header->CompanyCodes = companyCodes;
-  header->IndustryCodes = industryCodes;
-
-  return(header);
-}
-
-/*----------------------------------------------------------------------*/
-
-void
-freeWAISDocumentLongHeader(header)
-WAISDocumentLongHeader* header;
-{
-  freeAny(header->DocumentID);
-  doList((void**)header->Types,fs_free); /* can't use the macro here! */
-  s_free(header->Source);
-  s_free(header->Date);
-  s_free(header->Headline);
-  s_free(header->OriginCity);
-  s_free(header->StockCodes);
-  s_free(header->CompanyCodes);
-  s_free(header->IndustryCodes);
-  s_free(header);
-}
-
-/*----------------------------------------------------------------------*/
-
-char*
-writeWAISDocumentLongHeader(header,buffer,len)
-WAISDocumentLongHeader* header;
-char* buffer;
-long* len;
-{
-  unsigned long header_len = userInfoTagSize(DT_DocumentLongHeaderGroup ,
-					     DefWAISLongHeaderSize);
-  char* buf = buffer + header_len;
-  unsigned long size1;
-
-  RESERVE_SPACE_FOR_WAIS_HEADER(len);
-
-  buf = writeAny(header->DocumentID,DT_DocumentID,buf,len);
-  buf = writeNum(header->VersionNumber,DT_VersionNumber,buf,len);
-  buf = writeNum(header->Score,DT_Score,buf,len);
-  buf = writeNum(header->BestMatch,DT_BestMatch,buf,len);
-  buf = writeNum(header->DocumentLength,DT_DocumentLength,buf,len);
-  buf = writeNum(header->Lines,DT_Lines,buf,len);
-  if (header->Types != NULL)
-    { long size;
-      char* ptr = NULL;
-      long i;
-      buf = writeTag(DT_TYPE_BLOCK,buf,len);
-      for (i = 0,size = 0,ptr = header->Types[i]; ptr != NULL; ptr = header->Types[++i])
-	{ long typeSize = strlen(ptr);
-	  size += writtenTagSize(DT_TYPE);
-	  size += writtenCompressedIntSize(typeSize);
-	  size += typeSize;
+    WAISDocumentLongHeader *header = S_MALLOC(WAISDocumentLongHeader);
+
+    header->DocumentID = docID;
+    header->VersionNumber = versionNumber;
+    header->Score = score;
+    header->BestMatch = bestMatch;
+    header->DocumentLength = docLen;
+    header->Lines = lines;
+    header->Types = types;
+    header->Source = source;
+    header->Date = date;
+    header->Headline = headline;
+    header->OriginCity = originCity;
+    header->StockCodes = stockCodes;
+    header->CompanyCodes = companyCodes;
+    header->IndustryCodes = industryCodes;
+
+    return (header);
+}
+
+/*----------------------------------------------------------------------*/
+
+void freeWAISDocumentLongHeader(WAISDocumentLongHeader *header)
+{
+    freeAny(header->DocumentID);
+    doList((void **) header->Types, fs_free);	/* can't use the macro here! */
+    s_free(header->Source);
+    s_free(header->Date);
+    s_free(header->Headline);
+    s_free(header->OriginCity);
+    s_free(header->StockCodes);
+    s_free(header->CompanyCodes);
+    s_free(header->IndustryCodes);
+    s_free(header);
+}
+
+/*----------------------------------------------------------------------*/
+
+char *writeWAISDocumentLongHeader(WAISDocumentLongHeader *header, char *buffer,
+				  long *len)
+{
+    unsigned long header_len = userInfoTagSize(DT_DocumentLongHeaderGroup,
+					       DefWAISLongHeaderSize);
+    char *buf = buffer + header_len;
+    unsigned long size1;
+
+    RESERVE_SPACE_FOR_WAIS_HEADER(len);
+
+    buf = writeAny(header->DocumentID, DT_DocumentID, buf, len);
+    buf = writeNum(header->VersionNumber, DT_VersionNumber, buf, len);
+    buf = writeNum(header->Score, DT_Score, buf, len);
+    buf = writeNum(header->BestMatch, DT_BestMatch, buf, len);
+    buf = writeNum(header->DocumentLength, DT_DocumentLength, buf, len);
+    buf = writeNum(header->Lines, DT_Lines, buf, len);
+    if (header->Types != NULL) {
+	long size;
+	char *ptr = NULL;
+	long i;
+
+	buf = writeTag(DT_TYPE_BLOCK, buf, len);
+	for (i = 0, size = 0, ptr = header->Types[i];
+	     ptr != NULL;
+	     ptr = header->Types[++i]) {
+	    long typeSize = strlen(ptr);
+
+	    size += writtenTagSize(DT_TYPE);
+	    size += writtenCompressedIntSize(typeSize);
+	    size += typeSize;
 	}
-      buf = writeCompressedInteger((unsigned long)size,buf,len);
-      for (i = 0,ptr = header->Types[i]; ptr != NULL; ptr = header->Types[++i])
-	buf = writeString(ptr,DT_TYPE,buf,len);
+	buf = writeCompressedInteger((unsigned long) size, buf, len);
+	for (i = 0, ptr = header->Types[i]; ptr != NULL; ptr = header->Types[++i])
+	    buf = writeString(ptr, DT_TYPE, buf, len);
     }
-  buf = writeString(header->Source,DT_Source,buf,len);
-  buf = writeString(header->Date,DT_Date,buf,len);
-  buf = writeString(header->Headline,DT_Headline,buf,len);
-  buf = writeString(header->OriginCity,DT_OriginCity,buf,len);
-  buf = writeString(header->StockCodes,DT_StockCodes,buf,len);
-  buf = writeString(header->CompanyCodes,DT_CompanyCodes,buf,len);
-  buf = writeString(header->IndustryCodes,DT_IndustryCodes,buf,len);
-
-  /* now write the header and size */
-  size1 = buf - buffer;
-  buf = writeUserInfoHeader(DT_DocumentLongHeaderGroup,size1,header_len,buffer,len);
-
-  return(buf);
-}
-
-/*----------------------------------------------------------------------*/
-
-char*
-readWAISDocumentLongHeader(header,buffer)
-WAISDocumentLongHeader** header;
-char* buffer;
-{
-  char* buf = buffer;
-  unsigned long size1;
-  unsigned long headerSize;
-  data_tag tag1;
-  any* docID;
-  long versionNumber,score,bestMatch,docLength,lines;
-  char **types;
-  char *source,*date,*headline,*originCity,*stockCodes,*companyCodes,*industryCodes;
-
-  docID = NULL;
-  versionNumber = score = bestMatch = docLength = lines = UNUSED;
-  types = NULL;
-  source = date = headline = originCity = stockCodes = companyCodes = industryCodes = NULL;
-
-  buf = readUserInfoHeader(&tag1,&size1,buf);
-  headerSize = buf - buffer;
-
-  while (buf < (buffer + size1 + headerSize))
-    { data_tag tag = peekTag(buf);
-      switch (tag)
-	{ case DT_DocumentID:
-	    buf = readAny(&docID,buf);
-	    break;
-	  case DT_VersionNumber:
-	    buf = readNum(&versionNumber,buf);
-	    break;
-	  case DT_Score:
-	    buf = readNum(&score,buf);
-	    break;
-	  case DT_BestMatch:
-	    buf = readNum(&bestMatch,buf);
-	    break;
-	  case DT_DocumentLength:
-	    buf = readNum(&docLength,buf);
-	    break;
-	  case DT_Lines:
-	    buf = readNum(&lines,buf);
-	    break;
-	  case DT_TYPE_BLOCK:
-	    { unsigned long size = -1;
-	      long numTypes = 0;
-	      buf = readTag(&tag,buf);
-	      readCompressedInteger(&size,buf);
-	      while (size > 0)
-		{ char* type = NULL;
-		  char* originalBuf = buf;
-		  buf = readString(&type,buf);
-		  types = (char**)s_realloc(types,(size_t)(sizeof(char*) * (numTypes + 2)));
-		  types[numTypes++] = type;
-		  types[numTypes] = NULL;
-		  size -= (buf - originalBuf);
+    buf = writeString(header->Source, DT_Source, buf, len);
+    buf = writeString(header->Date, DT_Date, buf, len);
+    buf = writeString(header->Headline, DT_Headline, buf, len);
+    buf = writeString(header->OriginCity, DT_OriginCity, buf, len);
+    buf = writeString(header->StockCodes, DT_StockCodes, buf, len);
+    buf = writeString(header->CompanyCodes, DT_CompanyCodes, buf, len);
+    buf = writeString(header->IndustryCodes, DT_IndustryCodes, buf, len);
+
+    /* now write the header and size */
+    size1 = buf - buffer;
+    buf = writeUserInfoHeader(DT_DocumentLongHeaderGroup,
+			      size1,
+			      header_len,
+			      buffer,
+			      len);
+
+    return (buf);
+}
+
+/*----------------------------------------------------------------------*/
+
+char *readWAISDocumentLongHeader(WAISDocumentLongHeader **header, char *buffer)
+{
+    char *buf = buffer;
+    unsigned long size1;
+    unsigned long headerSize;
+    data_tag tag1;
+    any *docID;
+    long versionNumber, score, bestMatch, docLength, lines;
+    char **types;
+    char *source, *date, *headline, *originCity, *stockCodes, *companyCodes, *industryCodes;
+
+    docID = NULL;
+    versionNumber =
+	score =
+	bestMatch =
+	docLength =
+	lines = UNUSED;
+    types = NULL;
+    source =
+	date =
+	headline =
+	originCity =
+	stockCodes =
+	companyCodes =
+	industryCodes = NULL;
+
+    buf = readUserInfoHeader(&tag1, &size1, buf);
+    headerSize = buf - buffer;
+
+    while (buf < (buffer + size1 + headerSize)) {
+	data_tag tag = peekTag(buf);
+
+	switch (tag) {
+	case DT_DocumentID:
+	    buf = readAny(&docID, buf);
+	    break;
+	case DT_VersionNumber:
+	    buf = readNum(&versionNumber, buf);
+	    break;
+	case DT_Score:
+	    buf = readNum(&score, buf);
+	    break;
+	case DT_BestMatch:
+	    buf = readNum(&bestMatch, buf);
+	    break;
+	case DT_DocumentLength:
+	    buf = readNum(&docLength, buf);
+	    break;
+	case DT_Lines:
+	    buf = readNum(&lines, buf);
+	    break;
+	case DT_TYPE_BLOCK:
+	    {
+		unsigned long size = -1;
+		long numTypes = 0;
+
+		buf = readTag(&tag, buf);
+		readCompressedInteger(&size, buf);
+		while (size > 0) {
+		    char *type = NULL;
+		    char *originalBuf = buf;
+
+		    buf = readString(&type, buf);
+		    types = S_REALLOC2(char *, types, numTypes);
+
+		    types[numTypes++] = type;
+		    types[numTypes] = NULL;
+		    size -= (buf - originalBuf);
 		}
 	    }
 	    /* FALLTHRU */
-	  case DT_Source:
-	    buf = readString(&source,buf);
+	case DT_Source:
+	    buf = readString(&source, buf);
 	    break;
-	  case DT_Date:
-	    buf = readString(&date,buf);
+	case DT_Date:
+	    buf = readString(&date, buf);
 	    break;
-	  case DT_Headline:
-	    buf = readString(&headline,buf);
+	case DT_Headline:
+	    buf = readString(&headline, buf);
 	    break;
-	  case DT_OriginCity:
-	    buf = readString(&originCity,buf);
+	case DT_OriginCity:
+	    buf = readString(&originCity, buf);
 	    break;
-	  case DT_StockCodes:
-	    buf = readString(&stockCodes,buf);
+	case DT_StockCodes:
+	    buf = readString(&stockCodes, buf);
 	    break;
-	  case DT_CompanyCodes:
-	    buf = readString(&companyCodes,buf);
+	case DT_CompanyCodes:
+	    buf = readString(&companyCodes, buf);
 	    break;
-	  case DT_IndustryCodes:
-	    buf = readString(&industryCodes,buf);
+	case DT_IndustryCodes:
+	    buf = readString(&industryCodes, buf);
 	    break;
-	  default:
+	default:
 	    freeAny(docID);
 	    s_free(source);
 	    s_free(date);
@@ -1238,773 +1194,831 @@ char* buffer;
 	    s_free(industryCodes);
 	    REPORT_READ_ERROR(buf);
 	    break;
-	  }
+	}
     }
 
-  *header = makeWAISDocumentLongHeader(docID,versionNumber,score,bestMatch,
-				       docLength,lines,types,source,date,headline,
-				       originCity,stockCodes,companyCodes,
-				       industryCodes);
-  return(buf);
-}
-
-/*----------------------------------------------------------------------*/
-
-WAISSearchResponse*
-makeWAISSearchResponse(seedWordsUsed,
-		       docHeaders,
-		       shortHeaders,
-		       longHeaders,
-		       text,
-		       headlines,
-		       codes,
-		       diagnostics)
-char* seedWordsUsed;
-WAISDocumentHeader** docHeaders;
-WAISDocumentShortHeader** shortHeaders;
-WAISDocumentLongHeader** longHeaders;
-WAISDocumentText** text;
-WAISDocumentHeadlines** headlines;
-WAISDocumentCodes** codes;
-diagnosticRecord** diagnostics;
+    *header = makeWAISDocumentLongHeader(docID,
+					 versionNumber,
+					 score,
+					 bestMatch,
+					 docLength,
+					 lines,
+					 types,
+					 source,
+					 date,
+					 headline,
+					 originCity,
+					 stockCodes,
+					 companyCodes,
+					 industryCodes);
+    return (buf);
+}
+
+/*----------------------------------------------------------------------*/
+
+WAISSearchResponse *
+  makeWAISSearchResponse(
+			    char *seedWordsUsed,
+			    WAISDocumentHeader **docHeaders,
+			    WAISDocumentShortHeader **shortHeaders,
+			    WAISDocumentLongHeader **longHeaders,
+			    WAISDocumentText **text,
+			    WAISDocumentHeadlines **headlines,
+			    WAISDocumentCodes **codes,
+			    diagnosticRecord ** diagnostics)
+{
+    WAISSearchResponse *response = S_MALLOC(WAISSearchResponse);
+
+    response->SeedWordsUsed = seedWordsUsed;
+    response->DocHeaders = docHeaders;
+    response->ShortHeaders = shortHeaders;
+    response->LongHeaders = longHeaders;
+    response->Text = text;
+    response->Headlines = headlines;
+    response->Codes = codes;
+    response->Diagnostics = diagnostics;
+
+    return (response);
+}
+
+/*----------------------------------------------------------------------*/
+
+void freeWAISSearchResponse(WAISSearchResponse * response)
+{
+    void *ptr = NULL;
+    long i;
+
+    s_free(response->SeedWordsUsed);
+
+    if (response->DocHeaders != NULL)
+	for (i = 0, ptr = (void *) response->DocHeaders[i];
+	     ptr != NULL;
+	     ptr = (void *) response->DocHeaders[++i])
+	    freeWAISDocumentHeader((WAISDocumentHeader *) ptr);
+    s_free(response->DocHeaders);
+
+    if (response->ShortHeaders != NULL)
+	for (i = 0, ptr = (void *) response->ShortHeaders[i];
+	     ptr != NULL;
+	     ptr = (void *) response->ShortHeaders[++i])
+	    freeWAISDocumentShortHeader((WAISDocumentShortHeader *) ptr);
+    s_free(response->ShortHeaders);
+
+    if (response->LongHeaders != NULL)
+	for (i = 0, ptr = (void *) response->LongHeaders[i];
+	     ptr != NULL;
+	     ptr = (void *) response->LongHeaders[++i])
+	    freeWAISDocumentLongHeader((WAISDocumentLongHeader *) ptr);
+    s_free(response->LongHeaders);
+
+    if (response->Text != NULL)
+	for (i = 0, ptr = (void *) response->Text[i];
+	     ptr != NULL;
+	     ptr = (void *) response->Text[++i])
+	    freeWAISDocumentText((WAISDocumentText *) ptr);
+    s_free(response->Text);
+
+    if (response->Headlines != NULL)
+	for (i = 0, ptr = (void *) response->Headlines[i];
+	     ptr != NULL;
+	     ptr = (void *) response->Headlines[++i])
+	    freeWAISDocumentHeadlines((WAISDocumentHeadlines *) ptr);
+    s_free(response->Headlines);
+
+    if (response->Codes != NULL)
+	for (i = 0, ptr = (void *) response->Codes[i];
+	     ptr != NULL;
+	     ptr = (void *) response->Codes[++i])
+	    freeWAISDocumentCodes((WAISDocumentCodes *) ptr);
+    s_free(response->Codes);
+
+    if (response->Diagnostics != NULL)
+	for (i = 0, ptr = (void *) response->Diagnostics[i];
+	     ptr != NULL;
+	     ptr = (void *) response->Diagnostics[++i])
+	    freeDiag((diagnosticRecord *) ptr);
+    s_free(response->Diagnostics);
+
+    s_free(response);
+}
+
+/*----------------------------------------------------------------------*/
+
+char *writeSearchResponseInfo(SearchResponseAPDU *query,
+			      char *buffer,
+			      long *len)
 {
-  WAISSearchResponse* response = (WAISSearchResponse*)s_malloc((size_t)sizeof(WAISSearchResponse));
-
-  response->SeedWordsUsed = seedWordsUsed;
-  response->DocHeaders = docHeaders;
-  response->ShortHeaders = shortHeaders;
-  response->LongHeaders = longHeaders;
-  response->Text = text;
-  response->Headlines = headlines;
-  response->Codes = codes;
-  response->Diagnostics = diagnostics;
-
-  return(response);
-}
-
-/*----------------------------------------------------------------------*/
-
-void
-freeWAISSearchResponse(response)
-WAISSearchResponse* response;
-{
-  void* ptr = NULL;
-  long i;
+    unsigned long header_len = userInfoTagSize(DT_UserInformationLength,
+					       DefWAISSearchResponseSize);
+    char *buf = buffer + header_len;
+    WAISSearchResponse *info = (WAISSearchResponse *) query->DatabaseDiagnosticRecords;
+    unsigned long size;
+    void *header = NULL;
+    long i;
+
+    RESERVE_SPACE_FOR_WAIS_HEADER(len);
+
+    buf = writeString(info->SeedWordsUsed, DT_SeedWordsUsed, buf, len);
+
+    /* write out all the headers */
+    if (info->DocHeaders != NULL) {
+	for (i = 0, header = (void *) info->DocHeaders[i];
+	     header != NULL;
+	     header = (void *) info->DocHeaders[++i])
+	    buf = writeWAISDocumentHeader((WAISDocumentHeader *) header, buf, len);
+    }
 
-  s_free(response->SeedWordsUsed);
+    if (info->ShortHeaders != NULL) {
+	for (i = 0, header = (void *) info->ShortHeaders[i];
+	     header != NULL;
+	     header = (void *) info->ShortHeaders[++i])
+	    buf = writeWAISDocumentShortHeader((WAISDocumentShortHeader *) header,
+					       buf,
+					       len);
+    }
 
-  if (response->DocHeaders != NULL)
-    for (i = 0,ptr = (void *)response->DocHeaders[i]; ptr != NULL; ptr = (void *)response->DocHeaders[++i])
-      freeWAISDocumentHeader((WAISDocumentHeader*)ptr);
-  s_free(response->DocHeaders);
+    if (info->LongHeaders != NULL) {
+	for (i = 0, header = (void *) info->LongHeaders[i];
+	     header != NULL;
+	     header = (void *) info->LongHeaders[++i])
+	    buf = writeWAISDocumentLongHeader((WAISDocumentLongHeader *) header,
+					      buf,
+					      len);
+    }
 
-  if (response->ShortHeaders != NULL)
-    for (i = 0,ptr = (void *)response->ShortHeaders[i]; ptr != NULL; ptr = (void *)response->ShortHeaders[++i])
-      freeWAISDocumentShortHeader((WAISDocumentShortHeader*)ptr);
-  s_free(response->ShortHeaders);
+    if (info->Text != NULL) {
+	for (i = 0, header = (void *) info->Text[i];
+	     header != NULL;
+	     header = (void *) info->Text[++i])
+	    buf = writeWAISDocumentText((WAISDocumentText *) header, buf, len);
+    }
 
-  if (response->LongHeaders != NULL)
-    for (i = 0,ptr = (void *)response->LongHeaders[i]; ptr != NULL; ptr = (void *)response->LongHeaders[++i])
-      freeWAISDocumentLongHeader((WAISDocumentLongHeader*)ptr);
-  s_free(response->LongHeaders);
+    if (info->Headlines != NULL) {
+	for (i = 0, header = (void *) info->Headlines[i];
+	     header != NULL;
+	     header = (void *) info->Headlines[++i])
+	    buf = writeWAISDocumentHeadlines((WAISDocumentHeadlines *) header,
+					     buf,
+					     len);
+    }
 
-  if (response->Text != NULL)
-    for (i = 0,ptr = (void *)response->Text[i]; ptr != NULL; ptr = (void *)response->Text[++i])
-      freeWAISDocumentText((WAISDocumentText*)ptr);
-  s_free(response->Text);
+    if (info->Codes != NULL) {
+	for (i = 0, header = (void *) info->Codes[i];
+	     header != NULL;
+	     header = (void *) info->Codes[++i])
+	    buf = writeWAISDocumentCodes((WAISDocumentCodes *) header, buf, len);
+    }
 
-  if (response->Headlines != NULL)
-    for (i = 0,ptr = (void *)response->Headlines[i]; ptr != NULL; ptr = (void *)response->Headlines[++i])
-      freeWAISDocumentHeadlines((WAISDocumentHeadlines*)ptr);
-  s_free(response->Headlines);
-
-  if (response->Codes != NULL)
-    for (i = 0,ptr = (void *)response->Codes[i]; ptr != NULL; ptr = (void *)response->Codes[++i])
-      freeWAISDocumentCodes((WAISDocumentCodes*)ptr);
-  s_free(response->Codes);
-
-  if (response->Diagnostics != NULL)
-    for (i = 0,ptr = (void *)response->Diagnostics[i]; ptr != NULL; ptr = (void *)response->Diagnostics[++i])
-      freeDiag((diagnosticRecord*)ptr);
-  s_free(response->Diagnostics);
-
-  s_free(response);
-}
-
-/*----------------------------------------------------------------------*/
-
-char*
-writeSearchResponseInfo(query,buffer,len)
-SearchResponseAPDU* query;
-char* buffer;
-long* len;
-{
-  unsigned long header_len = userInfoTagSize(DT_UserInformationLength,
-					     DefWAISSearchResponseSize);
-  char* buf = buffer + header_len;
-  WAISSearchResponse* info = (WAISSearchResponse*)query->DatabaseDiagnosticRecords;
-  unsigned long size;
-  void* header = NULL;
-  long i;
-
-  RESERVE_SPACE_FOR_WAIS_HEADER(len);
-
-  buf = writeString(info->SeedWordsUsed,DT_SeedWordsUsed,buf,len);
-
-  /* write out all the headers */
-  if (info->DocHeaders != NULL)
-    { for (i = 0,header = (void *)info->DocHeaders[i]; header != NULL; header = (void *)info->DocHeaders[++i])
-	buf = writeWAISDocumentHeader((WAISDocumentHeader*)header,buf,len);
-      }
-
-  if (info->ShortHeaders != NULL)
-    { for (i = 0,header = (void *)info->ShortHeaders[i]; header != NULL; header = (void *)info->ShortHeaders[++i])
-	buf = writeWAISDocumentShortHeader((WAISDocumentShortHeader*)header,buf,len);
-      }
-
-  if (info->LongHeaders != NULL)
-    { for (i = 0,header = (void *)info->LongHeaders[i]; header != NULL; header = (void *)info->LongHeaders[++i])
-	buf = writeWAISDocumentLongHeader((WAISDocumentLongHeader*)header,buf,len);
-      }
+    if (info->Diagnostics != NULL) {
+	for (i = 0, header = (void *) info->Diagnostics[i];
+	     header != NULL;
+	     header = (void *) info->Diagnostics[++i])
+	    buf = writeDiag((diagnosticRecord *) header, buf, len);
+    }
 
-  if (info->Text != NULL)
-    { for (i = 0,header = (void *)info->Text[i]; header != NULL; header = (void *)info->Text[++i])
-	buf = writeWAISDocumentText((WAISDocumentText*)header,buf,len);
-      }
+    /* now write the header and size */
+    size = buf - buffer;
+    buf = writeUserInfoHeader(DT_UserInformationLength,
+			      size,
+			      header_len,
+			      buffer,
+			      len);
 
-  if (info->Headlines != NULL)
-    { for (i = 0,header = (void *)info->Headlines[i]; header != NULL; header = (void *)info->Headlines[++i])
-	buf = writeWAISDocumentHeadlines((WAISDocumentHeadlines*)header,buf,len);
-      }
+    return (buf);
+}
 
-  if (info->Codes != NULL)
-    { for (i = 0,header = (void *)info->Codes[i]; header != NULL;header = (void *)info->Codes[++i])
-	buf = writeWAISDocumentCodes((WAISDocumentCodes*)header,buf,len);
-      }
+/*----------------------------------------------------------------------*/
 
-  if (info->Diagnostics != NULL)
-    { for (i = 0, header = (void *)info->Diagnostics[i]; header != NULL; header = (void *)info->Diagnostics[++i])
-	buf = writeDiag((diagnosticRecord*)header,buf,len);
-      }
-
-  /* now write the header and size */
-  size = buf - buffer;
-  buf = writeUserInfoHeader(DT_UserInformationLength,size,header_len,buffer,len);
-
-  return(buf);
-}
-
-/*----------------------------------------------------------------------*/
-
-static void
-cleanUpWaisSearchResponse (char* buf,char* seedWordsUsed,
-			       WAISDocumentHeader** docHeaders,
-			       WAISDocumentShortHeader** shortHeaders,
-			       WAISDocumentLongHeader** longHeaders,
-			       WAISDocumentText** text,
-			       WAISDocumentHeadlines** headlines,
-			       WAISDocumentCodes** codes,
-			       diagnosticRecord**diags);
-
-static void
-cleanUpWaisSearchResponse (buf,seedWordsUsed,docHeaders,shortHeaders,
-			   longHeaders,text,headlines,codes,diags)
-char* buf;
-char* seedWordsUsed;
-WAISDocumentHeader** docHeaders;
-WAISDocumentShortHeader** shortHeaders;
-WAISDocumentLongHeader** longHeaders;
-WAISDocumentText** text;
-WAISDocumentHeadlines** headlines;
-WAISDocumentCodes** codes;
-diagnosticRecord** diags;
+static void cleanUpWaisSearchResponse(char *buf,
+				      char *seedWordsUsed,
+				      WAISDocumentHeader **docHeaders,
+				      WAISDocumentShortHeader **shortHeaders,
+				      WAISDocumentLongHeader **longHeaders,
+				      WAISDocumentText **text,
+				      WAISDocumentHeadlines **headlines,
+				      WAISDocumentCodes **codes,
+				      diagnosticRecord ** diags)
 /* if buf is NULL, we have just gotten a read error, and need to clean up
    any state we have built.  If not, then everything is going fine, and
    we should just hang loose
  */
 {
-  void* ptr = NULL;
-  long i;
-
-  if (buf == NULL)
-   { s_free(seedWordsUsed);
-     if (docHeaders != NULL)
-       for (i = 0,ptr = (void *)docHeaders[i]; ptr != NULL;
-	    ptr = (void *)docHeaders[++i])
-	 freeWAISDocumentHeader((WAISDocumentHeader*)ptr);
-     s_free(docHeaders);
-     if (shortHeaders != NULL)
-       for (i = 0,ptr = (void *)shortHeaders[i]; ptr != NULL;
-	    ptr = (void *)shortHeaders[++i])
-	 freeWAISDocumentShortHeader((WAISDocumentShortHeader*)ptr);
-     s_free(shortHeaders);
-     if (longHeaders != NULL)
-       for (i = 0,ptr = (void *)longHeaders[i]; ptr != NULL;
-	    ptr = (void *)longHeaders[++i])
-	 freeWAISDocumentLongHeader((WAISDocumentLongHeader*)ptr);
-     s_free(longHeaders);
-     if (text != NULL)
-       for (i = 0,ptr = (void *)text[i]; ptr != NULL; ptr = (void *)text[++i])
-	 freeWAISDocumentText((WAISDocumentText*)ptr);
-     s_free(text);
-     if (headlines != NULL)
-       for (i = 0,ptr = (void *)headlines[i]; ptr != NULL;
-	    ptr = (void *)headlines[++i])
-	 freeWAISDocumentHeadlines((WAISDocumentHeadlines*)ptr);
-     s_free(headlines);
-     if (codes != NULL)
-       for (i = 0,ptr = (void *)codes[i]; ptr != NULL;
-	    ptr = (void *)codes[++i])
-	 freeWAISDocumentCodes((WAISDocumentCodes*)ptr);
-     s_free(codes);
-     if (diags != NULL)
-       for (i = 0,ptr = (void *)diags[i]; ptr != NULL;
-	    ptr = (void *)diags[++i])
-	 freeDiag((diagnosticRecord*)ptr);
-     s_free(diags);
-   }
-}
-
-/*----------------------------------------------------------------------*/
-
-char*
-readSearchResponseInfo(info,buffer)
-void** info;
-char* buffer;
-{
-  char* buf = buffer;
-  unsigned long size;
-  unsigned long headerSize;
-  data_tag tag1;
-  void* header = NULL;
-  WAISDocumentHeader** docHeaders = NULL;
-  WAISDocumentShortHeader** shortHeaders = NULL;
-  WAISDocumentLongHeader** longHeaders = NULL;
-  WAISDocumentText** text = NULL;
-  WAISDocumentHeadlines** headlines = NULL;
-  WAISDocumentCodes** codes = NULL;
-  long numDocHeaders,numLongHeaders,numShortHeaders,numText,numHeadlines;
-  long numCodes;
-  char* seedWordsUsed = NULL;
-  diagnosticRecord** diags = NULL;
-  diagnosticRecord* diag = NULL;
-  long numDiags = 0;
-
-  numDocHeaders = numLongHeaders = numShortHeaders = numText = numHeadlines = numCodes = 0;
-
-  buf = readUserInfoHeader(&tag1,&size,buf);
-  headerSize = buf - buffer;
-
-  while (buf < (buffer + size + headerSize))
-   { data_tag tag = peekTag(buf);
-     switch (tag)
-      { case DT_SeedWordsUsed:
-	  buf = readString(&seedWordsUsed,buf);
-	  break;
+    void *ptr = NULL;
+    long i;
+
+    if (buf == NULL) {
+	s_free(seedWordsUsed);
+	if (docHeaders != NULL)
+	    for (i = 0, ptr = (void *) docHeaders[i]; ptr != NULL;
+		 ptr = (void *) docHeaders[++i])
+		freeWAISDocumentHeader((WAISDocumentHeader *) ptr);
+	s_free(docHeaders);
+	if (shortHeaders != NULL)
+	    for (i = 0, ptr = (void *) shortHeaders[i]; ptr != NULL;
+		 ptr = (void *) shortHeaders[++i])
+		freeWAISDocumentShortHeader((WAISDocumentShortHeader *) ptr);
+	s_free(shortHeaders);
+	if (longHeaders != NULL)
+	    for (i = 0, ptr = (void *) longHeaders[i]; ptr != NULL;
+		 ptr = (void *) longHeaders[++i])
+		freeWAISDocumentLongHeader((WAISDocumentLongHeader *) ptr);
+	s_free(longHeaders);
+	if (text != NULL)
+	    for (i = 0, ptr = (void *) text[i];
+		 ptr != NULL;
+		 ptr = (void *) text[++i])
+		freeWAISDocumentText((WAISDocumentText *) ptr);
+	s_free(text);
+	if (headlines != NULL)
+	    for (i = 0, ptr = (void *) headlines[i]; ptr != NULL;
+		 ptr = (void *) headlines[++i])
+		freeWAISDocumentHeadlines((WAISDocumentHeadlines *) ptr);
+	s_free(headlines);
+	if (codes != NULL)
+	    for (i = 0, ptr = (void *) codes[i]; ptr != NULL;
+		 ptr = (void *) codes[++i])
+		freeWAISDocumentCodes((WAISDocumentCodes *) ptr);
+	s_free(codes);
+	if (diags != NULL)
+	    for (i = 0, ptr = (void *) diags[i]; ptr != NULL;
+		 ptr = (void *) diags[++i])
+		freeDiag((diagnosticRecord *) ptr);
+	s_free(diags);
+    }
+}
+
+/*----------------------------------------------------------------------*/
+
+char *readSearchResponseInfo(void **info,
+			     char *buffer)
+{
+    char *buf = buffer;
+    unsigned long size;
+    unsigned long headerSize;
+    data_tag tag1;
+    void *header = NULL;
+    WAISDocumentHeader **docHeaders = NULL;
+    WAISDocumentShortHeader **shortHeaders = NULL;
+    WAISDocumentLongHeader **longHeaders = NULL;
+    WAISDocumentText **text = NULL;
+    WAISDocumentHeadlines **headlines = NULL;
+    WAISDocumentCodes **codes = NULL;
+    long numDocHeaders, numLongHeaders, numShortHeaders, numText, numHeadlines;
+    long numCodes;
+    char *seedWordsUsed = NULL;
+    diagnosticRecord **diags = NULL;
+    diagnosticRecord *diag = NULL;
+    long numDiags = 0;
+
+    numDocHeaders =
+	numLongHeaders =
+	numShortHeaders =
+	numText =
+	numHeadlines =
+	numCodes = 0;
+
+    buf = readUserInfoHeader(&tag1, &size, buf);
+    headerSize = buf - buffer;
+
+    while (buf < (buffer + size + headerSize)) {
+	data_tag tag = peekTag(buf);
+
+	switch (tag) {
+	case DT_SeedWordsUsed:
+	    buf = readString(&seedWordsUsed, buf);
+	    break;
 	case DT_DatabaseDiagnosticRecords:
-	  if (diags == NULL) /* create a new diag list */
-	   { diags = (diagnosticRecord**)s_malloc((size_t)sizeof(diagnosticRecord*) * 2);
-	   }
-	  else /* grow the diag list */
-	   { diags = (diagnosticRecord**)s_realloc((char*)diags,(size_t)(sizeof(diagnosticRecord*) * (numDiags + 2)));
-	   }
-	  buf = readDiag(&diag,buf);
-	  diags[numDiags++] = diag; /* put it in the list */
-	  diags[numDiags] = NULL;
-	  break;
+	    if (diags == NULL)	/* create a new diag list */
+	    {
+		diags = S_MALLOC2(diagnosticRecord *);
+	    } else {		/* grow the diag list */
+		diags = S_REALLOC2(diagnosticRecord *, diags, numDiags);
+	    }
+	    buf = readDiag(&diag, buf);
+	    diags[numDiags++] = diag;	/* put it in the list */
+	    diags[numDiags] = NULL;
+	    break;
 	case DT_DocumentHeaderGroup:
-		  if (docHeaders == NULL) /* create a new header list */
-		   { docHeaders = (WAISDocumentHeader**)s_malloc((size_t)sizeof(WAISDocumentHeader*) * 2);
-		   }
-		  else /* grow the doc list */
-		   { docHeaders = (WAISDocumentHeader**)s_realloc((char*)docHeaders,(size_t)(sizeof(WAISDocumentHeader*) * (numDocHeaders + 2)));
-		   }
-		  buf = readWAISDocumentHeader((WAISDocumentHeader**)&header,buf);
-		  cleanUpWaisSearchResponse(buf,seedWordsUsed,docHeaders,shortHeaders,longHeaders,text,headlines,codes,diags);
-		  RETURN_ON_NULL(buf);
-		  docHeaders[numDocHeaders++] =
-		    (WAISDocumentHeader*)header; /* put it in the list */
-		  docHeaders[numDocHeaders] = NULL;
-		  break;
-		case DT_DocumentShortHeaderGroup:
-		  if (shortHeaders == NULL) /* create a new header list */
-		   { shortHeaders = (WAISDocumentShortHeader**)s_malloc((size_t)sizeof(WAISDocumentShortHeader*) * 2);
-		   }
-		  else /* grow the doc list */
-		   { shortHeaders = (WAISDocumentShortHeader**)s_realloc((char*)shortHeaders,(size_t)(sizeof(WAISDocumentShortHeader*) * (numShortHeaders + 2)));
-		   }
-		  buf = readWAISDocumentShortHeader((WAISDocumentShortHeader**)&header,buf);
-		  cleanUpWaisSearchResponse(buf,seedWordsUsed,docHeaders,shortHeaders,longHeaders,text,headlines,codes,diags);
-		  RETURN_ON_NULL(buf);
-		  shortHeaders[numShortHeaders++] =
-		    (WAISDocumentShortHeader*)header; /* put it in the list */
-		  shortHeaders[numShortHeaders] = NULL;
-		  break;
-		case DT_DocumentLongHeaderGroup:
-		  if (longHeaders == NULL) /* create a new header list */
-		   { longHeaders = (WAISDocumentLongHeader**)s_malloc((size_t)sizeof(WAISDocumentLongHeader*) * 2);
-		   }
-		  else /* grow the doc list */
-		   { longHeaders = (WAISDocumentLongHeader**)s_realloc((char*)longHeaders,(size_t)(sizeof(WAISDocumentLongHeader*) * (numLongHeaders + 2)));
-		   }
-		  buf = readWAISDocumentLongHeader((WAISDocumentLongHeader**)&header,buf);
-		  cleanUpWaisSearchResponse(buf,seedWordsUsed,docHeaders,shortHeaders,longHeaders,text,headlines,codes,diags);
-		  RETURN_ON_NULL(buf);
-		  longHeaders[numLongHeaders++] =
-		    (WAISDocumentLongHeader*)header; /* put it in the list */
-		  longHeaders[numLongHeaders] = NULL;
-		  break;
+	    if (docHeaders == NULL)	/* create a new header list */
+	    {
+		docHeaders = S_MALLOC2(WAISDocumentHeader *);
+	    } else {		/* grow the doc list */
+		docHeaders = S_REALLOC2(WAISDocumentHeader *, docHeaders, numDocHeaders);
+	    }
+	    buf = readWAISDocumentHeader((WAISDocumentHeader **) &header, buf);
+	    cleanUpWaisSearchResponse(buf,
+				      seedWordsUsed,
+				      docHeaders,
+				      shortHeaders,
+				      longHeaders,
+				      text,
+				      headlines,
+				      codes,
+				      diags);
+	    RETURN_ON_NULL(buf);
+	    docHeaders[numDocHeaders++] =
+		(WAISDocumentHeader *) header;	/* put it in the list */
+	    docHeaders[numDocHeaders] = NULL;
+	    break;
+	case DT_DocumentShortHeaderGroup:
+	    if (shortHeaders == NULL)	/* create a new header list */
+	    {
+		shortHeaders = S_MALLOC2(WAISDocumentShortHeader *);
+	    } else {		/* grow the doc list */
+		shortHeaders = S_REALLOC2(WAISDocumentShortHeader *,
+					  shortHeaders,
+					  numShortHeaders);
+	    }
+	    buf = readWAISDocumentShortHeader((WAISDocumentShortHeader **) &header,
+					      buf);
+	    cleanUpWaisSearchResponse(buf,
+				      seedWordsUsed,
+				      docHeaders,
+				      shortHeaders,
+				      longHeaders,
+				      text,
+				      headlines,
+				      codes,
+				      diags);
+	    RETURN_ON_NULL(buf);
+	    shortHeaders[numShortHeaders++] =
+		(WAISDocumentShortHeader *) header;	/* put it in the list */
+	    shortHeaders[numShortHeaders] = NULL;
+	    break;
+	case DT_DocumentLongHeaderGroup:
+	    if (longHeaders == NULL)	/* create a new header list */
+	    {
+		longHeaders = S_MALLOC2(WAISDocumentLongHeader *);
+	    } else {		/* grow the doc list */
+		longHeaders = S_REALLOC2(WAISDocumentLongHeader *,
+					 longHeaders,
+					 numLongHeaders);
+	    }
+	    buf = readWAISDocumentLongHeader((WAISDocumentLongHeader **) &header,
+					     buf);
+	    cleanUpWaisSearchResponse(buf,
+				      seedWordsUsed,
+				      docHeaders,
+				      shortHeaders,
+				      longHeaders,
+				      text,
+				      headlines,
+				      codes,
+				      diags);
+	    RETURN_ON_NULL(buf);
+	    longHeaders[numLongHeaders++] =
+		(WAISDocumentLongHeader *) header;	/* put it in the list */
+	    longHeaders[numLongHeaders] = NULL;
+	    break;
 	case DT_DocumentTextGroup:
-		  if (text == NULL) /* create a new list */
-		   { text = (WAISDocumentText**)s_malloc((size_t)sizeof(WAISDocumentText*) * 2);
-		   }
-		  else /* grow the list */
-		   { text = (WAISDocumentText**)s_realloc((char*)text,(size_t)(sizeof(WAISDocumentText*) * (numText + 2)));
-		   }
-		  buf = readWAISDocumentText((WAISDocumentText**)&header,buf);
-		  cleanUpWaisSearchResponse(buf,seedWordsUsed,docHeaders,shortHeaders,longHeaders,text,headlines,codes,diags);
-		  RETURN_ON_NULL(buf);
-		  text[numText++] =
-		    (WAISDocumentText*)header; /* put it in the list */
-		  text[numText] = NULL;
-		  break;
-		case DT_DocumentHeadlineGroup:
-		  if (headlines == NULL) /* create a new list */
-		   { headlines = (WAISDocumentHeadlines**)s_malloc((size_t)sizeof(WAISDocumentHeadlines*) * 2);
-		   }
-		  else /* grow the list */
-		   { headlines = (WAISDocumentHeadlines**)s_realloc((char*)headlines,(size_t)(sizeof(WAISDocumentHeadlines*) * (numHeadlines + 2)));
-		   }
-		  buf = readWAISDocumentHeadlines((WAISDocumentHeadlines**)&header,buf);
-		  cleanUpWaisSearchResponse(buf,seedWordsUsed,docHeaders,shortHeaders,longHeaders,text,headlines,codes,diags);
-		  RETURN_ON_NULL(buf);
-		  headlines[numHeadlines++] =
-		    (WAISDocumentHeadlines*)header; /* put it in the list */
-		  headlines[numHeadlines] = NULL;
-		  break;
-		case DT_DocumentCodeGroup:
-		  if (codes == NULL) /* create a new list */
-		   { codes = (WAISDocumentCodes**)s_malloc((size_t)sizeof(WAISDocumentCodes*) * 2);
-		   }
-		  else /* grow the list */
-		   { codes = (WAISDocumentCodes**)s_realloc((char*)codes,(size_t)(sizeof(WAISDocumentCodes*) * (numCodes + 2)));
-		   }
-		  buf = readWAISDocumentCodes((WAISDocumentCodes**)&header,buf);
-		  cleanUpWaisSearchResponse(buf,seedWordsUsed,docHeaders,shortHeaders,longHeaders,text,headlines,codes,diags);
-		  RETURN_ON_NULL(buf);
-		  codes[numCodes++] =
-		    (WAISDocumentCodes*)header; /* put it in the list */
-		  codes[numCodes] = NULL;
-		  break;
+	    if (text == NULL)	/* create a new list */
+	    {
+		text = S_MALLOC2(WAISDocumentText *);
+	    } else {		/* grow the list */
+		text = S_REALLOC2(WAISDocumentText *, text, numText);
+	    }
+	    buf = readWAISDocumentText((WAISDocumentText **) &header, buf);
+	    cleanUpWaisSearchResponse(buf,
+				      seedWordsUsed,
+				      docHeaders,
+				      shortHeaders,
+				      longHeaders,
+				      text,
+				      headlines,
+				      codes,
+				      diags);
+	    RETURN_ON_NULL(buf);
+	    text[numText++] =
+		(WAISDocumentText *) header;	/* put it in the list */
+	    text[numText] = NULL;
+	    break;
+	case DT_DocumentHeadlineGroup:
+	    if (headlines == NULL)	/* create a new list */
+	    {
+		headlines = S_MALLOC2(WAISDocumentHeadlines *);
+	    } else {		/* grow the list */
+		headlines = S_REALLOC2(WAISDocumentHeadlines *, headlines, numHeadlines);
+	    }
+	    buf = readWAISDocumentHeadlines((WAISDocumentHeadlines **) &header,
+					    buf);
+	    cleanUpWaisSearchResponse(buf,
+				      seedWordsUsed,
+				      docHeaders,
+				      shortHeaders,
+				      longHeaders,
+				      text,
+				      headlines,
+				      codes,
+				      diags);
+	    RETURN_ON_NULL(buf);
+	    headlines[numHeadlines++] =
+		(WAISDocumentHeadlines *) header;	/* put it in the list */
+	    headlines[numHeadlines] = NULL;
+	    break;
+	case DT_DocumentCodeGroup:
+	    if (codes == NULL)	/* create a new list */
+	    {
+		codes = S_MALLOC2(WAISDocumentCodes *);
+	    } else {		/* grow the list */
+		codes = S_REALLOC2(WAISDocumentCodes *, codes, numCodes);
+	    }
+	    buf = readWAISDocumentCodes((WAISDocumentCodes **) &header, buf);
+	    cleanUpWaisSearchResponse(buf,
+				      seedWordsUsed,
+				      docHeaders,
+				      shortHeaders,
+				      longHeaders,
+				      text,
+				      headlines,
+				      codes,
+				      diags);
+	    RETURN_ON_NULL(buf);
+	    codes[numCodes++] =
+		(WAISDocumentCodes *) header;	/* put it in the list */
+	    codes[numCodes] = NULL;
+	    break;
 	default:
-	  cleanUpWaisSearchResponse(buf,seedWordsUsed,docHeaders,shortHeaders,longHeaders,text,headlines,codes,diags);
-	  REPORT_READ_ERROR(buf);
-	  break;
-      }
-   }
+	    cleanUpWaisSearchResponse(buf,
+				      seedWordsUsed,
+				      docHeaders,
+				      shortHeaders,
+				      longHeaders,
+				      text,
+				      headlines,
+				      codes,
+				      diags);
+	    REPORT_READ_ERROR(buf);
+	    break;
+	}
+    }
 
-  *info = (void *)makeWAISSearchResponse(seedWordsUsed,docHeaders,shortHeaders,
-				 longHeaders,text,headlines,codes,diags);
+    *info = (void *) makeWAISSearchResponse(seedWordsUsed,
+					    docHeaders,
+					    shortHeaders,
+					    longHeaders,
+					    text,
+					    headlines,
+					    codes,
+					    diags);
 
-  return(buf);
+    return (buf);
 }
 
 /*----------------------------------------------------------------------*/
 
-WAISDocumentText*
-makeWAISDocumentText(docID,versionNumber,documentText)
-any* docID;
-long versionNumber;
-any* documentText;
+WAISDocumentText *makeWAISDocumentText(any *docID,
+				       long versionNumber,
+				       any *documentText)
 {
-  WAISDocumentText* docText = (WAISDocumentText*)s_malloc((size_t)sizeof(WAISDocumentText));
+    WAISDocumentText *docText = S_MALLOC(WAISDocumentText);
 
-  docText->DocumentID = docID;
-  docText->VersionNumber = versionNumber;
-  docText->DocumentText = documentText;
+    docText->DocumentID = docID;
+    docText->VersionNumber = versionNumber;
+    docText->DocumentText = documentText;
 
-  return(docText);
+    return (docText);
 }
 
 /*----------------------------------------------------------------------*/
 
-void
-freeWAISDocumentText(docText)
-WAISDocumentText* docText;
+void freeWAISDocumentText(WAISDocumentText *docText)
 {
-  freeAny(docText->DocumentID);
-  freeAny(docText->DocumentText);
-  s_free(docText);
+    freeAny(docText->DocumentID);
+    freeAny(docText->DocumentText);
+    s_free(docText);
 }
 
 /*----------------------------------------------------------------------*/
 
-char*
-writeWAISDocumentText(docText,buffer,len)
-WAISDocumentText* docText;
-char* buffer;
-long* len;
+char *writeWAISDocumentText(WAISDocumentText *docText, char *buffer,
+			    long *len)
 {
-  unsigned long header_len = userInfoTagSize(DT_DocumentTextGroup,
-											DefWAISDocTextSize);
-  char* buf = buffer + header_len;
-  unsigned long size;
+    unsigned long header_len = userInfoTagSize(DT_DocumentTextGroup,
+					       DefWAISDocTextSize);
+    char *buf = buffer + header_len;
+    unsigned long size;
 
-  RESERVE_SPACE_FOR_WAIS_HEADER(len);
+    RESERVE_SPACE_FOR_WAIS_HEADER(len);
 
-  buf = writeAny(docText->DocumentID,DT_DocumentID,buf,len);
-  buf = writeNum(docText->VersionNumber,DT_VersionNumber,buf,len);
-  buf = writeAny(docText->DocumentText,DT_DocumentText,buf,len);
+    buf = writeAny(docText->DocumentID, DT_DocumentID, buf, len);
+    buf = writeNum(docText->VersionNumber, DT_VersionNumber, buf, len);
+    buf = writeAny(docText->DocumentText, DT_DocumentText, buf, len);
 
-  /* now write the header and size */
-  size = buf - buffer;
-  buf = writeUserInfoHeader(DT_DocumentTextGroup,size,header_len,buffer,len);
+    /* now write the header and size */
+    size = buf - buffer;
+    buf = writeUserInfoHeader(DT_DocumentTextGroup, size, header_len, buffer, len);
 
-  return(buf);
+    return (buf);
 }
 
 /*----------------------------------------------------------------------*/
 
-char*
-readWAISDocumentText(docText,buffer)
-WAISDocumentText** docText;
-char* buffer;
+char *readWAISDocumentText(WAISDocumentText **docText, char *buffer)
 {
-  char* buf = buffer;
-  unsigned long size;
-  unsigned long headerSize;
-  data_tag tag1;
-  any *docID,*documentText;
-  long versionNumber;
+    char *buf = buffer;
+    unsigned long size;
+    unsigned long headerSize;
+    data_tag tag1;
+    any *docID, *documentText;
+    long versionNumber;
+
+    docID = documentText = NULL;
+    versionNumber = UNUSED;
 
-  docID = documentText = NULL;
-  versionNumber = UNUSED;
+    buf = readUserInfoHeader(&tag1, &size, buf);
+    headerSize = buf - buffer;
 
-  buf = readUserInfoHeader(&tag1,&size,buf);
-  headerSize = buf - buffer;
+    while (buf < (buffer + size + headerSize)) {
+	data_tag tag = peekTag(buf);
 
-  while (buf < (buffer + size + headerSize))
-   { data_tag tag = peekTag(buf);
-     switch (tag)
-      { case DT_DocumentID:
-		  buf = readAny(&docID,buf);
-		  break;
-		case DT_VersionNumber:
-		  buf = readNum(&versionNumber,buf);
-		  break;
-		case DT_DocumentText:
-		  buf = readAny(&documentText,buf);
-		  break;
+	switch (tag) {
+	case DT_DocumentID:
+	    buf = readAny(&docID, buf);
+	    break;
+	case DT_VersionNumber:
+	    buf = readNum(&versionNumber, buf);
+	    break;
+	case DT_DocumentText:
+	    buf = readAny(&documentText, buf);
+	    break;
 	default:
-	  freeAny(docID);
-	  freeAny(documentText);
-	  REPORT_READ_ERROR(buf);
-	  break;
-      }
-   }
+	    freeAny(docID);
+	    freeAny(documentText);
+	    REPORT_READ_ERROR(buf);
+	    break;
+	}
+    }
 
-  *docText = makeWAISDocumentText(docID,versionNumber,documentText);
-  return(buf);
+    *docText = makeWAISDocumentText(docID, versionNumber, documentText);
+    return (buf);
 }
 
 /*----------------------------------------------------------------------*/
 
-WAISDocumentHeadlines*
-makeWAISDocumentHeadlines(docID,
-			  versionNumber,
-			  source,
-			  date,
-			  headline,
-			  originCity)
-any* docID;
-long versionNumber;
-char* source;
-char* date;
-char* headline;
-char* originCity;
-{
-  WAISDocumentHeadlines* docHeadline =
-    (WAISDocumentHeadlines*)s_malloc((size_t)sizeof(WAISDocumentHeadlines));
-
-  docHeadline->DocumentID = docID;
-  docHeadline->VersionNumber = versionNumber;
-  docHeadline->Source = source;
-  docHeadline->Date = date;
-  docHeadline->Headline = headline;
-  docHeadline->OriginCity = originCity;
-
-  return(docHeadline);
-}
-
-/*----------------------------------------------------------------------*/
-
-void
-freeWAISDocumentHeadlines(docHeadline)
-WAISDocumentHeadlines* docHeadline;
-{
-  freeAny(docHeadline->DocumentID);
-  s_free(docHeadline->Source);
-  s_free(docHeadline->Date);
-  s_free(docHeadline->Headline);
-  s_free(docHeadline->OriginCity);
-  s_free(docHeadline);
-}
-
-/*----------------------------------------------------------------------*/
-
-char*
-writeWAISDocumentHeadlines(docHeadline,buffer,len)
-WAISDocumentHeadlines* docHeadline;
-char* buffer;
-long* len;
-{
-  unsigned long header_len = userInfoTagSize(DT_DocumentHeadlineGroup,
-											DefWAISDocHeadlineSize);
-  char* buf = buffer + header_len;
-  unsigned long size;
-
-  RESERVE_SPACE_FOR_WAIS_HEADER(len);
-
-  buf = writeAny(docHeadline->DocumentID,DT_DocumentID,buf,len);
-  buf = writeNum(docHeadline->VersionNumber,DT_VersionNumber,buf,len);
-  buf = writeString(docHeadline->Source,DT_Source,buf,len);
-  buf = writeString(docHeadline->Date,DT_Date,buf,len);
-  buf = writeString(docHeadline->Headline,DT_Headline,buf,len);
-  buf = writeString(docHeadline->OriginCity,DT_OriginCity,buf,len);
-
-  /* now write the header and size */
-  size = buf - buffer;
-  buf = writeUserInfoHeader(DT_DocumentHeadlineGroup,size,header_len,buffer,len);
-
-  return(buf);
-}
-
-/*----------------------------------------------------------------------*/
-
-char*
-readWAISDocumentHeadlines(docHeadline,buffer)
-WAISDocumentHeadlines** docHeadline;
-char* buffer;
-{
-  char* buf = buffer;
-  unsigned long size;
-  unsigned long headerSize;
-  data_tag tag1;
-  any* docID;
-  long versionNumber;
-  char *source,*date,*headline,*originCity;
-
-  docID = NULL;
-  versionNumber = UNUSED;
-  source = date = headline = originCity = NULL;
-
-  buf = readUserInfoHeader(&tag1,&size,buf);
-  headerSize = buf - buffer;
+WAISDocumentHeadlines *makeWAISDocumentHeadlines(any *docID,
+						 long versionNumber,
+						 char *source,
+						 char *date,
+						 char *headline,
+						 char *originCity)
+{
+    WAISDocumentHeadlines *docHeadline = S_MALLOC(WAISDocumentHeadlines);
+
+    docHeadline->DocumentID = docID;
+    docHeadline->VersionNumber = versionNumber;
+    docHeadline->Source = source;
+    docHeadline->Date = date;
+    docHeadline->Headline = headline;
+    docHeadline->OriginCity = originCity;
 
-  while (buf < (buffer + size + headerSize))
-   { data_tag tag = peekTag(buf);
-     switch (tag)
-      { case DT_DocumentID:
-		  buf = readAny(&docID,buf);
-		  break;
-		case DT_VersionNumber:
-		  buf = readNum(&versionNumber,buf);
-		  break;
-		case DT_Source:
-		  buf = readString(&source,buf);
-		  break;
-		case DT_Date:
-		  buf = readString(&date,buf);
-		  break;
-		case DT_Headline:
-		  buf = readString(&headline,buf);
-		  break;
-		case DT_OriginCity:
-		  buf = readString(&originCity,buf);
-		  break;
+    return (docHeadline);
+}
+
+/*----------------------------------------------------------------------*/
+
+void freeWAISDocumentHeadlines(WAISDocumentHeadlines *docHeadline)
+{
+    freeAny(docHeadline->DocumentID);
+    s_free(docHeadline->Source);
+    s_free(docHeadline->Date);
+    s_free(docHeadline->Headline);
+    s_free(docHeadline->OriginCity);
+    s_free(docHeadline);
+}
+
+/*----------------------------------------------------------------------*/
+
+char *writeWAISDocumentHeadlines(WAISDocumentHeadlines *docHeadline, char *buffer,
+				 long *len)
+{
+    unsigned long header_len = userInfoTagSize(DT_DocumentHeadlineGroup,
+					       DefWAISDocHeadlineSize);
+    char *buf = buffer + header_len;
+    unsigned long size;
+
+    RESERVE_SPACE_FOR_WAIS_HEADER(len);
+
+    buf = writeAny(docHeadline->DocumentID, DT_DocumentID, buf, len);
+    buf = writeNum(docHeadline->VersionNumber, DT_VersionNumber, buf, len);
+    buf = writeString(docHeadline->Source, DT_Source, buf, len);
+    buf = writeString(docHeadline->Date, DT_Date, buf, len);
+    buf = writeString(docHeadline->Headline, DT_Headline, buf, len);
+    buf = writeString(docHeadline->OriginCity, DT_OriginCity, buf, len);
+
+    /* now write the header and size */
+    size = buf - buffer;
+    buf = writeUserInfoHeader(DT_DocumentHeadlineGroup,
+			      size,
+			      header_len,
+			      buffer,
+			      len);
+
+    return (buf);
+}
+
+/*----------------------------------------------------------------------*/
+
+char *readWAISDocumentHeadlines(WAISDocumentHeadlines **docHeadline, char *buffer)
+{
+    char *buf = buffer;
+    unsigned long size;
+    unsigned long headerSize;
+    data_tag tag1;
+    any *docID;
+    long versionNumber;
+    char *source, *date, *headline, *originCity;
+
+    docID = NULL;
+    versionNumber = UNUSED;
+    source = date = headline = originCity = NULL;
+
+    buf = readUserInfoHeader(&tag1, &size, buf);
+    headerSize = buf - buffer;
+
+    while (buf < (buffer + size + headerSize)) {
+	data_tag tag = peekTag(buf);
+
+	switch (tag) {
+	case DT_DocumentID:
+	    buf = readAny(&docID, buf);
+	    break;
+	case DT_VersionNumber:
+	    buf = readNum(&versionNumber, buf);
+	    break;
+	case DT_Source:
+	    buf = readString(&source, buf);
+	    break;
+	case DT_Date:
+	    buf = readString(&date, buf);
+	    break;
+	case DT_Headline:
+	    buf = readString(&headline, buf);
+	    break;
+	case DT_OriginCity:
+	    buf = readString(&originCity, buf);
+	    break;
 	default:
-	  freeAny(docID);
-	  s_free(source);
-	  s_free(date);
-	  s_free(headline);
-	  s_free(originCity);
-	  REPORT_READ_ERROR(buf);
-	  break;
-      }
-   }
+	    freeAny(docID);
+	    s_free(source);
+	    s_free(date);
+	    s_free(headline);
+	    s_free(originCity);
+	    REPORT_READ_ERROR(buf);
+	    break;
+	}
+    }
 
-  *docHeadline = makeWAISDocumentHeadlines(docID,versionNumber,source,date,
-									       headline,originCity);
-  return(buf);
+    *docHeadline = makeWAISDocumentHeadlines(docID, versionNumber, source, date,
+					     headline, originCity);
+    return (buf);
 }
 
 /*----------------------------------------------------------------------*/
 
-WAISDocumentCodes*
-makeWAISDocumentCodes(docID,
-		      versionNumber,
-		      stockCodes,
-		      companyCodes,
-		      industryCodes)
-any* docID;
-long versionNumber;
-char* stockCodes;
-char* companyCodes;
-char* industryCodes;
+WAISDocumentCodes *makeWAISDocumentCodes(any *docID,
+					 long versionNumber,
+					 char *stockCodes,
+					 char *companyCodes,
+					 char *industryCodes)
 {
-  WAISDocumentCodes* docCodes = (WAISDocumentCodes*)s_malloc((size_t)sizeof(WAISDocumentCodes));
+    WAISDocumentCodes *docCodes = S_MALLOC(WAISDocumentCodes);
 
-  docCodes->DocumentID = docID;
-  docCodes->VersionNumber = versionNumber;
-  docCodes->StockCodes = stockCodes;
-  docCodes->CompanyCodes = companyCodes;
-  docCodes->IndustryCodes = industryCodes;
+    docCodes->DocumentID = docID;
+    docCodes->VersionNumber = versionNumber;
+    docCodes->StockCodes = stockCodes;
+    docCodes->CompanyCodes = companyCodes;
+    docCodes->IndustryCodes = industryCodes;
 
-  return(docCodes);
+    return (docCodes);
 }
 
 /*----------------------------------------------------------------------*/
 
-void
-freeWAISDocumentCodes(docCodes)
-WAISDocumentCodes* docCodes;
+void freeWAISDocumentCodes(WAISDocumentCodes *docCodes)
 {
-  freeAny(docCodes->DocumentID);
-  s_free(docCodes->StockCodes);
-  s_free(docCodes->CompanyCodes);
-  s_free(docCodes->IndustryCodes);
-  s_free(docCodes);
+    freeAny(docCodes->DocumentID);
+    s_free(docCodes->StockCodes);
+    s_free(docCodes->CompanyCodes);
+    s_free(docCodes->IndustryCodes);
+    s_free(docCodes);
 }
 
 /*----------------------------------------------------------------------*/
 
-char*
-writeWAISDocumentCodes(docCodes,buffer,len)
-WAISDocumentCodes* docCodes;
-char* buffer;
-long* len;
+char *writeWAISDocumentCodes(WAISDocumentCodes *docCodes,
+			     char *buffer,
+			     long *len)
 {
-  unsigned long header_len = userInfoTagSize(DT_DocumentCodeGroup ,
-											DefWAISDocCodeSize);
-  char* buf = buffer + header_len;
-  unsigned long size;
+    unsigned long header_len = userInfoTagSize(DT_DocumentCodeGroup,
+					       DefWAISDocCodeSize);
+    char *buf = buffer + header_len;
+    unsigned long size;
 
-  RESERVE_SPACE_FOR_WAIS_HEADER(len);
+    RESERVE_SPACE_FOR_WAIS_HEADER(len);
 
-  buf = writeAny(docCodes->DocumentID,DT_DocumentID,buf,len);
-  buf = writeNum(docCodes->VersionNumber,DT_VersionNumber,buf,len);
-  buf = writeString(docCodes->StockCodes,DT_StockCodes,buf,len);
-  buf = writeString(docCodes->CompanyCodes,DT_CompanyCodes,buf,len);
-  buf = writeString(docCodes->IndustryCodes,DT_IndustryCodes,buf,len);
+    buf = writeAny(docCodes->DocumentID, DT_DocumentID, buf, len);
+    buf = writeNum(docCodes->VersionNumber, DT_VersionNumber, buf, len);
+    buf = writeString(docCodes->StockCodes, DT_StockCodes, buf, len);
+    buf = writeString(docCodes->CompanyCodes, DT_CompanyCodes, buf, len);
+    buf = writeString(docCodes->IndustryCodes, DT_IndustryCodes, buf, len);
 
-  /* now write the header and size */
-  size = buf - buffer;
-  buf = writeUserInfoHeader(DT_DocumentCodeGroup,size,header_len,buffer,len);
+    /* now write the header and size */
+    size = buf - buffer;
+    buf = writeUserInfoHeader(DT_DocumentCodeGroup, size, header_len, buffer, len);
 
-  return(buf);
+    return (buf);
 }
 
 /*----------------------------------------------------------------------*/
 
-char*
-readWAISDocumentCodes(docCodes,buffer)
-WAISDocumentCodes** docCodes;
-char* buffer;
+char *readWAISDocumentCodes(WAISDocumentCodes **docCodes,
+			    char *buffer)
 {
-  char* buf = buffer;
-  unsigned long size;
-  unsigned long headerSize;
-  data_tag tag1;
-  any* docID;
-  long versionNumber;
-  char *stockCodes,*companyCodes,*industryCodes;
+    char *buf = buffer;
+    unsigned long size;
+    unsigned long headerSize;
+    data_tag tag1;
+    any *docID;
+    long versionNumber;
+    char *stockCodes, *companyCodes, *industryCodes;
+
+    docID = NULL;
+    versionNumber = UNUSED;
+    stockCodes = companyCodes = industryCodes = NULL;
 
-  docID = NULL;
-  versionNumber = UNUSED;
-  stockCodes = companyCodes = industryCodes = NULL;
+    buf = readUserInfoHeader(&tag1, &size, buf);
+    headerSize = buf - buffer;
 
-  buf = readUserInfoHeader(&tag1,&size,buf);
-  headerSize = buf - buffer;
+    while (buf < (buffer + size + headerSize)) {
+	data_tag tag = peekTag(buf);
 
-  while (buf < (buffer + size + headerSize))
-   { data_tag tag = peekTag(buf);
-     switch (tag)
-      { case DT_DocumentID:
-		  buf = readAny(&docID,buf);
-		  break;
-		case DT_VersionNumber:
-		  buf = readNum(&versionNumber,buf);
-		  break;
-		case DT_StockCodes:
-		  buf = readString(&stockCodes,buf);
-		  break;
-		case DT_CompanyCodes:
-		  buf = readString(&companyCodes,buf);
-		  break;
-		case DT_IndustryCodes:
-		  buf = readString(&industryCodes,buf);
-		  break;
+	switch (tag) {
+	case DT_DocumentID:
+	    buf = readAny(&docID, buf);
+	    break;
+	case DT_VersionNumber:
+	    buf = readNum(&versionNumber, buf);
+	    break;
+	case DT_StockCodes:
+	    buf = readString(&stockCodes, buf);
+	    break;
+	case DT_CompanyCodes:
+	    buf = readString(&companyCodes, buf);
+	    break;
+	case DT_IndustryCodes:
+	    buf = readString(&industryCodes, buf);
+	    break;
 	default:
-	  freeAny(docID);
-	  s_free(stockCodes);
-	  s_free(companyCodes);
-	  s_free(industryCodes);
-	  REPORT_READ_ERROR(buf);
-	  break;
-      }
-   }
+	    freeAny(docID);
+	    s_free(stockCodes);
+	    s_free(companyCodes);
+	    s_free(industryCodes);
+	    REPORT_READ_ERROR(buf);
+	    break;
+	}
+    }
 
-  *docCodes = makeWAISDocumentCodes(docID,versionNumber,stockCodes,
-									companyCodes,industryCodes);
-  return(buf);
+    *docCodes = makeWAISDocumentCodes(docID, versionNumber, stockCodes,
+				      companyCodes, industryCodes);
+    return (buf);
 }
 
 /*----------------------------------------------------------------------*/
 
-char*
-writePresentInfo(present,buffer,len)
-PresentAPDU* present GCC_UNUSED;
-char* buffer;
-long* len GCC_UNUSED;
+char *writePresentInfo(PresentAPDU * present GCC_UNUSED, char *buffer,
+		       long *len GCC_UNUSED)
 {
-  /* The WAIS protocol doesn't use present info */
-  return(buffer);
+    /* The WAIS protocol doesn't use present info */
+    return (buffer);
 }
 
 /*----------------------------------------------------------------------*/
 
-char*
-readPresentInfo(info,buffer)
-void** info;
-char* buffer;
+char *readPresentInfo(void **info,
+		      char *buffer)
 {
-  /* The WAIS protocol doesn't use present info */
-  *info = NULL;
-  return(buffer);
+    /* The WAIS protocol doesn't use present info */
+    *info = NULL;
+    return (buffer);
 }
 
 /*----------------------------------------------------------------------*/
 
-char*
-writePresentResponseInfo(response,buffer,len)
-PresentResponseAPDU* response GCC_UNUSED;
-char* buffer;
-long* len GCC_UNUSED;
+char *writePresentResponseInfo(PresentResponseAPDU * response GCC_UNUSED, char *buffer,
+			       long *len GCC_UNUSED)
 {
-  /* The WAIS protocol doesn't use presentResponse info */
-  return(buffer);
+    /* The WAIS protocol doesn't use presentResponse info */
+    return (buffer);
 }
 
 /*----------------------------------------------------------------------*/
 
-char*
-readPresentResponseInfo(info,buffer)
-void** info;
-char* buffer;
+char *readPresentResponseInfo(void **info,
+			      char *buffer)
 {
-  /* The WAIS protocol doesn't use presentResponse info */
-  *info = NULL;
-  return(buffer);
+    /* The WAIS protocol doesn't use presentResponse info */
+    *info = NULL;
+    return (buffer);
 }
 
 /*----------------------------------------------------------------------*/
@@ -2046,263 +2060,246 @@ char* buffer;
 	( XXX return type could be in the element set)
 */
 
-static query_term** makeWAISQueryTerms (DocObj** docs);
-
-static query_term**
-makeWAISQueryTerms(docs)
-DocObj** docs;
+static query_term **makeWAISQueryTerms(DocObj **docs)
 /* given a null terminated list of docObjs, construct the appropriate
    query of the form given above
  */
 {
-  query_term** terms = NULL;
-  long numTerms = 0;
-  DocObj* doc = NULL;
-  long i;
-
-  if (docs == NULL)
-    return((query_term**)NULL);
-
-  terms = (query_term**)s_malloc((size_t)(sizeof(query_term*) * 1));
-  terms[numTerms] = NULL;
-
-  /* loop through the docs making terms for them all */
-  for (i = 0,doc = docs[i]; doc != NULL; doc = docs[++i])
-    { any* type = NULL;
-
-      if (doc->Type != NULL)
-	type = stringToAny(doc->Type);
-
-      if (doc->ChunkCode == CT_document) /* a whole document */
-	{ terms = (query_term**)s_realloc((char*)terms,
-					  (size_t)(sizeof(query_term*) *
-						   (numTerms + 3 + 1)));
-	  terms[numTerms++] = makeAttributeTerm(SYSTEM_CONTROL_NUMBER,
-						EQUAL,IGNORE,IGNORE,
-						IGNORE,IGNORE,doc->DocumentID);
-	  if (type != NULL)
-	   { terms[numTerms++] = makeAttributeTerm(DATA_TYPE,EQUAL,
-						   IGNORE,IGNORE,IGNORE,
-						   IGNORE,type);
-	     terms[numTerms++] = makeOperatorTerm(AND);
-	   }
-	  terms[numTerms] = NULL;
-	}
-      else			/* a document fragment */
-	{	char chunk_att[ATTRIBUTE_SIZE];
-		any* startChunk = NULL;
-		any* endChunk = NULL;
-
-		terms = (query_term**)s_realloc((char*)terms,
-						(size_t)(sizeof(query_term*) *
-							 (numTerms + 7 + 1)));
-
-		switch (doc->ChunkCode)
-		  { case CT_byte:
-		    case CT_line:
-		      { char start[20],end[20];
-			(doc->ChunkCode == CT_byte) ?
-			  strncpy(chunk_att,BYTE,ATTRIBUTE_SIZE) :
-			strncpy(chunk_att,LINE,ATTRIBUTE_SIZE);
-			sprintf(start,"%ld",doc->ChunkStart.Pos);
-			startChunk = stringToAny(start);
-			sprintf(end,"%ld",doc->ChunkEnd.Pos);
-			endChunk = stringToAny(end);
-		      }
-		      break;
-		    case CT_paragraph:
-		      strncpy(chunk_att,PARAGRAPH,ATTRIBUTE_SIZE);
-		      startChunk = doc->ChunkStart.ID;
-		      endChunk = doc->ChunkEnd.ID;
-		      break;
-		    default:
-		      /* error */
-		      break;
-		    }
-
-		terms[numTerms++] = makeAttributeTerm(SYSTEM_CONTROL_NUMBER,
-						      EQUAL,IGNORE,IGNORE,
-						      IGNORE,
-						      IGNORE,doc->DocumentID);
-		if (type != NULL)
-		 { terms[numTerms++] = makeAttributeTerm(DATA_TYPE,EQUAL,IGNORE,
-							 IGNORE,IGNORE,IGNORE,
-							 type);
-		   terms[numTerms++] = makeOperatorTerm(AND);
-		 }
-		terms[numTerms++] = makeAttributeTerm(chunk_att,
-						      GREATER_THAN_OR_EQUAL,
-						      IGNORE,IGNORE,IGNORE,
-						      IGNORE,
-						      startChunk);
+    query_term **terms = NULL;
+    long numTerms = 0;
+    DocObj *doc = NULL;
+    long i;
+
+    if (docs == NULL)
+	return ((query_term **) NULL);
+
+    terms = (query_term **) s_malloc((size_t) (sizeof(query_term *) * 1));
+
+    terms[numTerms] = NULL;
+
+    /* loop through the docs making terms for them all */
+    for (i = 0, doc = docs[i]; doc != NULL; doc = docs[++i]) {
+	any *type = NULL;
+
+	if (doc->Type != NULL)
+	    type = stringToAny(doc->Type);
+
+	if (doc->ChunkCode == CT_document)	/* a whole document */
+	{
+	    terms = S_REALLOC2(query_term *, terms, numTerms + 2);
+
+	    terms[numTerms++] = makeAttributeTerm(SYSTEM_CONTROL_NUMBER,
+						  EQUAL, IGNORE, IGNORE,
+						  IGNORE, IGNORE, doc->DocumentID);
+	    if (type != NULL) {
+		terms[numTerms++] = makeAttributeTerm(DATA_TYPE, EQUAL,
+						      IGNORE, IGNORE, IGNORE,
+						      IGNORE, type);
 		terms[numTerms++] = makeOperatorTerm(AND);
-		terms[numTerms++] = makeAttributeTerm(chunk_att,LESS_THAN,
-						      IGNORE,IGNORE,IGNORE,
-						      IGNORE,
-						      endChunk);
+	    }
+	    terms[numTerms] = NULL;
+	} else {		/* a document fragment */
+	    char chunk_att[ATTRIBUTE_SIZE];
+	    any *startChunk = NULL;
+	    any *endChunk = NULL;
+
+	    terms = S_REALLOC2(query_term *, terms, numTerms + 6);
+
+	    switch (doc->ChunkCode) {
+	    case CT_byte:
+	    case CT_line:
+		{
+		    char start[20], end[20];
+
+		    (doc->ChunkCode == CT_byte) ?
+			strncpy(chunk_att, BYTE, ATTRIBUTE_SIZE) :
+			strncpy(chunk_att, LINE, ATTRIBUTE_SIZE);
+		    sprintf(start, "%ld", doc->ChunkStart.Pos);
+		    startChunk = stringToAny(start);
+		    sprintf(end, "%ld", doc->ChunkEnd.Pos);
+		    endChunk = stringToAny(end);
+		}
+		break;
+	    case CT_paragraph:
+		strncpy(chunk_att, PARAGRAPH, ATTRIBUTE_SIZE);
+		startChunk = doc->ChunkStart.ID;
+		endChunk = doc->ChunkEnd.ID;
+		break;
+	    default:
+		/* error */
+		break;
+	    }
+
+	    terms[numTerms++] = makeAttributeTerm(SYSTEM_CONTROL_NUMBER,
+						  EQUAL, IGNORE, IGNORE,
+						  IGNORE,
+						  IGNORE, doc->DocumentID);
+	    if (type != NULL) {
+		terms[numTerms++] = makeAttributeTerm(DATA_TYPE, EQUAL, IGNORE,
+						      IGNORE, IGNORE, IGNORE,
+						      type);
 		terms[numTerms++] = makeOperatorTerm(AND);
-		terms[numTerms] = NULL;
-
-		if (doc->ChunkCode == CT_byte || doc->ChunkCode == CT_line)
-		  { freeAny(startChunk);
-		    freeAny(endChunk);
-		  }
-	      }
-
-      freeAny(type);
-
-     if (i != 0) /* multiple independent queries, need a disjunction */
-	{ terms = (query_term**)s_realloc((char*)terms,
-					  (size_t)(sizeof(query_term*) *
-						   (numTerms + 1 + 1)));
-	  terms[numTerms++] = makeOperatorTerm(OR);
-	  terms[numTerms] = NULL;
+	    }
+	    terms[numTerms++] = makeAttributeTerm(chunk_att,
+						  GREATER_THAN_OR_EQUAL,
+						  IGNORE, IGNORE, IGNORE,
+						  IGNORE,
+						  startChunk);
+	    terms[numTerms++] = makeOperatorTerm(AND);
+	    terms[numTerms++] = makeAttributeTerm(chunk_att, LESS_THAN,
+						  IGNORE, IGNORE, IGNORE,
+						  IGNORE,
+						  endChunk);
+	    terms[numTerms++] = makeOperatorTerm(AND);
+	    terms[numTerms] = NULL;
+
+	    if (doc->ChunkCode == CT_byte || doc->ChunkCode == CT_line) {
+		freeAny(startChunk);
+		freeAny(endChunk);
+	    }
+	}
+
+	freeAny(type);
+
+	if (i != 0)		/* multiple independent queries, need a disjunction */
+	{
+	    terms = S_REALLOC2(query_term *, terms, numTerms);
+
+	    terms[numTerms++] = makeOperatorTerm(OR);
+	    terms[numTerms] = NULL;
 	}
     }
 
-  return(terms);
+    return (terms);
 }
 
 /*----------------------------------------------------------------------*/
 
-static DocObj** makeWAISQueryDocs (query_term** terms);
-
-static DocObj**
-makeWAISQueryDocs(terms)
-query_term** terms;
+static DocObj **makeWAISQueryDocs(query_term **terms)
 /* given a list of terms in the form given above, convert them to
    DocObjs.
  */
 {
-  query_term* docTerm = NULL;
-  query_term* fragmentTerm = NULL;
-  DocObj** docs = NULL;
-  DocObj* doc = NULL;
-  long docNum,termNum;
+    query_term *docTerm = NULL;
+    query_term *fragmentTerm = NULL;
+    DocObj **docs = NULL;
+    DocObj *doc = NULL;
+    long docNum, termNum;
 
-  docNum = termNum = 0;
+    docNum = termNum = 0;
 
-  docs = (DocObj**)s_malloc((size_t)(sizeof(DocObj*) * 1));
-  docs[docNum] = NULL;
+    docs = S_MALLOC(DocObj *);
 
-  /* translate the terms into DocObjs */
-  while (true)
-    {
-      query_term* typeTerm = NULL;
-      char* type = NULL;
-      long startTermOffset;
-
-      docTerm = terms[termNum];
-
-      if (docTerm == NULL)
-	break;			/* we're done converting */
-
-      typeTerm = terms[termNum + 1]; /* get the lead Term if it exists */
-
-      if (strcmp(typeTerm->Use,DATA_TYPE) == 0)	/* we do have a type */
-       { startTermOffset = 3;
-	 type = anyToString(typeTerm->Term);
-       }
-      else			/* no type */
-       { startTermOffset = 1;
-	 typeTerm = NULL;
-	 type = NULL;
-       }
-
-      /* grow the doc list */
-      docs = (DocObj**)s_realloc((char*)docs,(size_t)(sizeof(DocObj*) *
-						      (docNum + 1 + 1)));
-
-      /* figure out what kind of docObj to build - and build it */
-      fragmentTerm = terms[termNum + startTermOffset];
-      if (fragmentTerm != NULL && fragmentTerm->TermType == TT_Attribute)
-	{			/* build a document fragment */
-	  query_term* startTerm = fragmentTerm;
-	  query_term* endTerm = terms[termNum + startTermOffset + 2];
-
-	  if (strcmp(startTerm->Use,BYTE) == 0){ /* a byte chunk */
-	    doc = makeDocObjUsingBytes(duplicateAny(docTerm->Term),
-				       type,
-				       anyToLong(startTerm->Term),
-				       anyToLong(endTerm->Term));
-	   log_write("byte");
-	  }else if (strcmp(startTerm->Use,LINE) == 0){ /* a line chunk */
-	    doc = makeDocObjUsingLines(duplicateAny(docTerm->Term),
-				       type,
-				       anyToLong(startTerm->Term),
-				       anyToLong(endTerm->Term));
-	    log_write("line");
-	  }else{
-	log_write("chunk");			/* a paragraph chunk */
-	    doc = makeDocObjUsingParagraphs(duplicateAny(docTerm->Term),
-					    type,
-					    duplicateAny(startTerm->Term),
-					    duplicateAny(endTerm->Term));
-}
-	  termNum += (startTermOffset + 4);	/* point to next term */
-	}
-      else			/* build a full document */
+    docs[docNum] = NULL;
+
+    /* translate the terms into DocObjs */
+    while (true) {
+	query_term *typeTerm = NULL;
+	char *type = NULL;
+	long startTermOffset;
+
+	docTerm = terms[termNum];
+
+	if (docTerm == NULL)
+	    break;		/* we're done converting */
+
+	typeTerm = terms[termNum + 1];	/* get the lead Term if it exists */
+
+	if (strcmp(typeTerm->Use, DATA_TYPE) == 0)	/* we do have a type */
 	{
-	  doc = makeDocObjUsingWholeDocument(duplicateAny(docTerm->Term),
-					     type);
-log_write("whole doc");
-	  termNum += startTermOffset;	/* point to next term */
+	    startTermOffset = 3;
+	    type = anyToString(typeTerm->Term);
+	} else {		/* no type */
+	    startTermOffset = 1;
+	    typeTerm = NULL;
+	    type = NULL;
 	}
 
-      docs[docNum++] = doc;	/* insert the new document */
+	/* grow the doc list */
+	docs = S_REALLOC2(DocObj *, docs, docNum);
+
+	/* figure out what kind of docObj to build - and build it */
+	fragmentTerm = terms[termNum + startTermOffset];
+	if (fragmentTerm != NULL && fragmentTerm->TermType == TT_Attribute) {	/* build a document fragment */
+	    query_term *startTerm = fragmentTerm;
+	    query_term *endTerm = terms[termNum + startTermOffset + 2];
+
+	    if (strcmp(startTerm->Use, BYTE) == 0) {	/* a byte chunk */
+		doc = makeDocObjUsingBytes(duplicateAny(docTerm->Term),
+					   type,
+					   anyToLong(startTerm->Term),
+					   anyToLong(endTerm->Term));
+		log_write("byte");
+	    } else if (strcmp(startTerm->Use, LINE) == 0) {	/* a line chunk */
+		doc = makeDocObjUsingLines(duplicateAny(docTerm->Term),
+					   type,
+					   anyToLong(startTerm->Term),
+					   anyToLong(endTerm->Term));
+		log_write("line");
+	    } else {
+		log_write("chunk");	/* a paragraph chunk */
+		doc = makeDocObjUsingParagraphs(duplicateAny(docTerm->Term),
+						type,
+						duplicateAny(startTerm->Term),
+						duplicateAny(endTerm->Term));
+	    }
+	    termNum += (startTermOffset + 4);	/* point to next term */
+	} else {		/* build a full document */
+	    doc = makeDocObjUsingWholeDocument(duplicateAny(docTerm->Term),
+					       type);
+	    log_write("whole doc");
+	    termNum += startTermOffset;		/* point to next term */
+	}
 
-      docs[docNum] = NULL;	/* keep the doc list terminated */
+	docs[docNum++] = doc;	/* insert the new document */
 
+	docs[docNum] = NULL;	/* keep the doc list terminated */
 
-      if (terms[termNum] != NULL)
-	termNum++; /* skip the OR operator it necessary */
-      else
-	break; /* we are done */
+	if (terms[termNum] != NULL)
+	    termNum++;		/* skip the OR operator it necessary */
+	else
+	    break;		/* we are done */
     }
 
-  return(docs);
+    return (docs);
 }
 
 /*----------------------------------------------------------------------*/
 
-any*
-makeWAISTextQuery(docs)
-DocObj** docs;
+any *makeWAISTextQuery(DocObj **docs)
 /* given a list of DocObjs, return an any whose contents is the corresponding
    type 1 query
  */
 {
-  any *buf = NULL;
-  query_term** terms = NULL;
+    any *buf = NULL;
+    query_term **terms = NULL;
 
-  terms = makeWAISQueryTerms(docs);
-  buf = writeQuery(terms);
+    terms = makeWAISQueryTerms(docs);
+    buf = writeQuery(terms);
 
-  doList((void**)terms,freeTerm);
-  s_free(terms);
+    doList((void **) terms, freeTerm);
+    s_free(terms);
 
-  return(buf);
+    return (buf);
 }
 
 /*----------------------------------------------------------------------*/
 
-DocObj**
-readWAISTextQuery(buf)
-any* buf;
+DocObj **readWAISTextQuery(any *buf)
 /* given an any whose contents are type 1 queries of the WAIS sort,
    construct a list of the corresponding DocObjs
  */
 {
-  query_term** terms = NULL;
-  DocObj** docs = NULL;
+    query_term **terms = NULL;
+    DocObj **docs = NULL;
 
-  terms = readQuery(buf);
-  docs = makeWAISQueryDocs(terms);
+    terms = readQuery(buf);
+    docs = makeWAISQueryDocs(terms);
 
-  doList((void**)terms,freeTerm);
-  s_free(terms);
+    doList((void **) terms, freeTerm);
+    s_free(terms);
 
-  return(docs);
+    return (docs);
 }
 
 /*----------------------------------------------------------------------*/
@@ -2315,29 +2312,23 @@ any* buf;
 /*   caller to assign nulls to the pointer fields of the WAIS object.  */
 /*----------------------------------------------------------------------*/
 
-void
-CSTFreeWAISInitResponse(init)
-WAISInitResponse* init;
+void CSTFreeWAISInitResponse(WAISInitResponse *init)
 /* free an object made with makeWAISInitResponse */
 {
-  s_free(init);
+    s_free(init);
 }
 
 /*----------------------------------------------------------------------*/
 
-void
-CSTFreeWAISSearch(query)
-WAISSearch* query;
+void CSTFreeWAISSearch(WAISSearch *query)
 /* destroy an object made with makeWAISSearch() */
 {
-  s_free(query);
+    s_free(query);
 }
 
 /*----------------------------------------------------------------------*/
 
-void
-CSTFreeDocObj(doc)
-DocObj* doc;
+void CSTFreeDocObj(DocObj *doc)
 /* free a docObj */
 {
     s_free(doc);
@@ -2345,87 +2336,71 @@ DocObj* doc;
 
 /*----------------------------------------------------------------------*/
 
-void
-CSTFreeWAISDocumentHeader(header)
-WAISDocumentHeader* header;
+void CSTFreeWAISDocumentHeader(WAISDocumentHeader *header)
 {
     s_free(header);
 }
 
 /*----------------------------------------------------------------------*/
 
-void
-CSTFreeWAISDocumentShortHeader(header)
-WAISDocumentShortHeader* header;
+void CSTFreeWAISDocumentShortHeader(WAISDocumentShortHeader *header)
 {
-  s_free(header);
+    s_free(header);
 }
+
 /*----------------------------------------------------------------------*/
 
-void
-CSTFreeWAISDocumentLongHeader(header)
-WAISDocumentLongHeader* header;
+void CSTFreeWAISDocumentLongHeader(WAISDocumentLongHeader *header)
 {
-  s_free(header);
+    s_free(header);
 }
 
 /*----------------------------------------------------------------------*/
 
-void
-CSTFreeWAISSearchResponse(response)
-WAISSearchResponse* response;
+void CSTFreeWAISSearchResponse(WAISSearchResponse * response)
 {
-  s_free(response);
+    s_free(response);
 }
 
 /*----------------------------------------------------------------------*/
 
-void
-CSTFreeWAISDocumentText(docText)
-WAISDocumentText* docText;
+void CSTFreeWAISDocumentText(WAISDocumentText *docText)
 {
-  s_free(docText);
+    s_free(docText);
 }
 
 /*----------------------------------------------------------------------*/
 
-void
-CSTFreeWAISDocHeadlines(docHeadline)
-WAISDocumentHeadlines* docHeadline;
+void CSTFreeWAISDocHeadlines(WAISDocumentHeadlines *docHeadline)
 {
-  s_free(docHeadline);
+    s_free(docHeadline);
 }
 
 /*----------------------------------------------------------------------*/
 
-void
-CSTFreeWAISDocumentCodes(docCodes)
-WAISDocumentCodes* docCodes;
+void CSTFreeWAISDocumentCodes(WAISDocumentCodes *docCodes)
 {
-  s_free(docCodes);
+    s_free(docCodes);
 }
 
 /*----------------------------------------------------------------------*/
 
-void
-CSTFreeWAISTextQuery(query)
-any* query;
+void CSTFreeWAISTextQuery(any *query)
 {
-   freeAny(query);
+    freeAny(query);
 }
 
 /*----------------------------------------------------------------------*/
 
-
 /*
-**	Routines originally from WMessage.c -- FM
-**
-**----------------------------------------------------------------------*/
+ *	Routines originally from WMessage.c -- FM
+ *
+ *----------------------------------------------------------------------*/
 /* WIDE AREA INFORMATION SERVER SOFTWARE
-   No guarantees or restrictions.  See the readme file for the full standard
-   disclaimer.
-   3.26.90
-*/
+ * No guarantees or restrictions.  See the readme file for the full standard
+ * disclaimer.
+ * 3.26.90
+ */
 
 /* This file is for reading and writing the wais packet header.
  * Morris@think.com
@@ -2438,20 +2413,18 @@ any* query;
 
 /*---------------------------------------------------------------------*/
 
-void
-readWAISPacketHeader(msgBuffer,header_struct)
-char* msgBuffer;
-WAISMessage *header_struct;
+void readWAISPacketHeader(char *msgBuffer,
+			  WAISMessage * header_struct)
 {
-  /* msgBuffer is a string containing at least HEADER_LENGTH bytes. */
+    /* msgBuffer is a string containing at least HEADER_LENGTH bytes. */
 
-  memmove(header_struct->msg_len,msgBuffer,(size_t)10);
-  header_struct->msg_type = char_downcase((unsigned long)msgBuffer[10]);
-  header_struct->hdr_vers = char_downcase((unsigned long)msgBuffer[11]);
-  memmove(header_struct->server,(void*)(msgBuffer + 12),(size_t)10);
-  header_struct->compression = char_downcase((unsigned long)msgBuffer[22]);
-  header_struct->encoding = char_downcase((unsigned long)msgBuffer[23]);
-  header_struct->msg_checksum = char_downcase((unsigned long)msgBuffer[24]);
+    memmove(header_struct->msg_len, msgBuffer, (size_t) 10);
+    header_struct->msg_type = char_downcase((unsigned long) msgBuffer[10]);
+    header_struct->hdr_vers = char_downcase((unsigned long) msgBuffer[11]);
+    memmove(header_struct->server, (void *) (msgBuffer + 12), (size_t) 10);
+    header_struct->compression = char_downcase((unsigned long) msgBuffer[22]);
+    header_struct->encoding = char_downcase((unsigned long) msgBuffer[23]);
+    header_struct->msg_checksum = char_downcase((unsigned long) msgBuffer[24]);
 }
 
 /*---------------------------------------------------------------------*/
@@ -2460,43 +2433,35 @@ WAISMessage *header_struct;
  * options for the arguments.
  */
 
-void
-writeWAISPacketHeader(header,
-		      dataLen,
-		      type,
-		      server,
-		      compression,
-		      encoding,
-		      version)
-char* header;
-long dataLen;
-long type;
-char* server;
-long compression;
-long encoding;
-long version;
+void writeWAISPacketHeader(char *header,
+			   long dataLen,
+			   long type,
+			   char *server,
+			   long compression,
+			   long encoding,
+			   long version)
 /* Puts together the new wais before-the-z39-packet header. */
 {
-  char lengthBuf[11];
-  char serverBuf[11];
+    char lengthBuf[11];
+    char serverBuf[11];
+
+    long serverLen = strlen(server);
 
-  long serverLen = strlen(server);
-  if (serverLen > 10)
-    serverLen = 10;
+    if (serverLen > 10)
+	serverLen = 10;
 
-  sprintf(lengthBuf, "%010ld", dataLen);
-  strncpy(header,lengthBuf,10);
+    sprintf(lengthBuf, "%010ld", dataLen);
+    strncpy(header, lengthBuf, 10);
 
-  header[10] = type & 0xFF;
-  header[11] = version & 0xFF;
+    header[10] = type & 0xFF;
+    header[11] = version & 0xFF;
 
-  strncpy(serverBuf,server,serverLen);
-  strncpy((char*)(header + 12),serverBuf,serverLen);
+    strncpy(serverBuf, server, serverLen);
+    strncpy((char *) (header + 12), serverBuf, serverLen);
 
-  header[22] = compression & 0xFF;
-  header[23] = encoding & 0xFF;
-  header[24] = '0'; /* checkSum(header + HEADER_LENGTH,dataLen);   XXX the result must be ascii */
+    header[22] = compression & 0xFF;
+    header[23] = encoding & 0xFF;
+    header[24] = '0';		/* checkSum(header + HEADER_LENGTH,dataLen);   XXX the result must be ascii */
 }
 
 /*---------------------------------------------------------------------*/
-
diff --git a/WWW/Library/Implementation/HTVMS_WaisProt.h b/WWW/Library/Implementation/HTVMS_WaisProt.h
index 81b996f7..457d3cbb 100644
--- a/WWW/Library/Implementation/HTVMS_WaisProt.h
+++ b/WWW/Library/Implementation/HTVMS_WaisProt.h
@@ -1,32 +1,32 @@
 /*							HTVMS_WAISProt.h
-**
-**	Adaptation for Lynx by F.Macrides (macrides@sci.wfeb.edu)
-**
-**	31-May-1994 FM	Initial version.
-**
-**----------------------------------------------------------------------*/
+ *
+ *	Adaptation for Lynx by F.Macrides (macrides@sci.wfeb.edu)
+ *
+ *	31-May-1994 FM	Initial version.
+ *
+ *----------------------------------------------------------------------*/
 
 /*
-**	Routines originally from WProt.h -- FM
-**
-**----------------------------------------------------------------------*/
+ *	Routines originally from WProt.h -- FM
+ *
+ *----------------------------------------------------------------------*/
 /* WIDE AREA INFORMATION SERVER SOFTWARE:
-   No guarantees or restrictions.  See the readme file for the full standard
-   disclaimer.
-
-   3.26.90	Harry Morris, morris@think.com
-   3.30.90  Harry Morris
-			-	removed chunk code from WAISSearchAPDU,
-			-	added makeWAISQueryType1Query() and readWAISType1Query() which
-				replace makeWAISQueryTerms() and makeWAISQueryDocs().
-   4.11.90  HWM - added definitions of wais element set names
-   4.14.90  HWM - changed symbol for relevance feedback query from QT_3 to
-				  QT_RelevanceFeedbackQuery added QT_TextRetrievalQuery as a
-				  synonym for QT_BooleanQuery
-				- renamed makeWAISType1Query() to makeWAISTextQuery()
-				  renamed readWAISType1Query() to readWAISTextQuery()
-   5.29.90  TS - added CSTFreeWAISFoo functions
-*/
+ * No guarantees or restrictions.  See the readme file for the full standard
+ * disclaimer.
+ *
+ *  3.26.90	Harry Morris, morris@think.com
+ *  3.30.90  Harry Morris
+ *			-	removed chunk code from WAISSearchAPDU,
+ *			-	added makeWAISQueryType1Query() and readWAISType1Query() which
+ *				replace makeWAISQueryTerms() and makeWAISQueryDocs().
+ *  4.11.90  HWM - added definitions of wais element set names
+ *  4.14.90  HWM - changed symbol for relevance feedback query from QT_3 to
+ *				  QT_RelevanceFeedbackQuery added QT_TextRetrievalQuery as a
+ *				  synonym for QT_BooleanQuery
+ *				- renamed makeWAISType1Query() to makeWAISTextQuery()
+ *				  renamed readWAISType1Query() to readWAISTextQuery()
+ *  5.29.90  TS - added CSTFreeWAISFoo functions
+ */
 
 #ifndef _H_WAIS_protocol_
 #define _H_WAIS_protocol_
@@ -109,226 +109,256 @@
 #define ES_DocumentHeadline		"Document Headline"
 #define ES_DocumentCodes		"Document Codes"
 
-typedef struct DocObj { /* specifies a section of a document */
-	any*	DocumentID;
-	char*   Type;
-	long	ChunkCode;
-	union {
-		long	Pos;
-		any*	ID;
-	} ChunkStart;
-	union {
-		long	Pos;
-		any*	ID;
-	} ChunkEnd;
-	} DocObj;
+typedef struct DocObj {		/* specifies a section of a document */
+    any *DocumentID;
+    char *Type;
+    long ChunkCode;
+    union {
+	long Pos;
+	any *ID;
+    } ChunkStart;
+    union {
+	long Pos;
+	any *ID;
+    } ChunkEnd;
+} DocObj;
 
 /*----------------------------------------------------------------------*/
 /* WAIS APDU extensions */
 
 typedef struct WAISInitResponse {
-	long				ChunkCode;
-	long				ChunkIDLength;
-	char*				ChunkMarker;
-	char*				HighlightMarker;
-	char*				DeHighlightMarker;
-	char*				NewlineCharacters;
-	/* XXX  need to add UpdateFrequency and Update Time */
-	} WAISInitResponse;
+    long ChunkCode;
+    long ChunkIDLength;
+    char *ChunkMarker;
+    char *HighlightMarker;
+    char *DeHighlightMarker;
+    char *NewlineCharacters;
+    /* XXX  need to add UpdateFrequency and Update Time */
+} WAISInitResponse;
 
 typedef struct WAISSearch {
-	char*				SeedWords;
-	DocObj**			Docs;
-	char**				TextList;
-	long				DateFactor;
-	char*				BeginDateRange;
-	char*				EndDateRange;
-	long				MaxDocumentsRetrieved;
-	} WAISSearch;
+    char *SeedWords;
+    DocObj **Docs;
+    char **TextList;
+    long DateFactor;
+    char *BeginDateRange;
+    char *EndDateRange;
+    long MaxDocumentsRetrieved;
+} WAISSearch;
 
 typedef struct WAISDocumentHeader {
-	any*				DocumentID;
-	long				VersionNumber;
-	long				Score;
-	long				BestMatch;
-	long				DocumentLength;
-	long				Lines;
-	char**				Types;
-	char*				Source;
-	char*				Date;
-	char*				Headline;
-	char*				OriginCity;
-	} WAISDocumentHeader;
+    any *DocumentID;
+    long VersionNumber;
+    long Score;
+    long BestMatch;
+    long DocumentLength;
+    long Lines;
+    char **Types;
+    char *Source;
+    char *Date;
+    char *Headline;
+    char *OriginCity;
+} WAISDocumentHeader;
 
 typedef struct WAISDocumentShortHeader {
-	any*				DocumentID;
-	long				VersionNumber;
-	long				Score;
-	long				BestMatch;
-	long				DocumentLength;
-	long				Lines;
-	} WAISDocumentShortHeader;
+    any *DocumentID;
+    long VersionNumber;
+    long Score;
+    long BestMatch;
+    long DocumentLength;
+    long Lines;
+} WAISDocumentShortHeader;
 
 typedef struct WAISDocumentLongHeader {
-	any*				DocumentID;
-	long				VersionNumber;
-	long				Score;
-	long				BestMatch;
-	long				DocumentLength;
-	long				Lines;
-	char**				Types;
-	char*				Source;
-	char*				Date;
-	char*				Headline;
-	char*				OriginCity;
-	char*				StockCodes;
-	char*				CompanyCodes;
-	char*				IndustryCodes;
-	} WAISDocumentLongHeader;
+    any *DocumentID;
+    long VersionNumber;
+    long Score;
+    long BestMatch;
+    long DocumentLength;
+    long Lines;
+    char **Types;
+    char *Source;
+    char *Date;
+    char *Headline;
+    char *OriginCity;
+    char *StockCodes;
+    char *CompanyCodes;
+    char *IndustryCodes;
+} WAISDocumentLongHeader;
 
 typedef struct WAISDocumentText {
-	any*				DocumentID;
-	long				VersionNumber;
-	any*				DocumentText;
-	} WAISDocumentText;
+    any *DocumentID;
+    long VersionNumber;
+    any *DocumentText;
+} WAISDocumentText;
 
 typedef struct WAISDocumentHeadlines {
-	any*				DocumentID;
-	long				VersionNumber;
-	char*				Source;
-	char*				Date;
-	char*				Headline;
-	char*				OriginCity;
-	} WAISDocumentHeadlines;
+    any *DocumentID;
+    long VersionNumber;
+    char *Source;
+    char *Date;
+    char *Headline;
+    char *OriginCity;
+} WAISDocumentHeadlines;
 
 typedef struct WAISDocumentCodes {
-	any*				DocumentID;
-	long				VersionNumber;
-	char*				StockCodes;
-	char*				CompanyCodes;
-	char*				IndustryCodes;
-	} WAISDocumentCodes;
+    any *DocumentID;
+    long VersionNumber;
+    char *StockCodes;
+    char *CompanyCodes;
+    char *IndustryCodes;
+} WAISDocumentCodes;
 
 typedef struct WAISSearchResponse {
-	char*					SeedWordsUsed;
-	WAISDocumentHeader**		DocHeaders;
-	WAISDocumentShortHeader**	ShortHeaders;
-	WAISDocumentLongHeader**	LongHeaders;
-	WAISDocumentText**			Text;
-	WAISDocumentHeadlines**		Headlines;
-	WAISDocumentCodes**			Codes;
-	diagnosticRecord**			Diagnostics;
-	} WAISSearchResponse;
+    char *SeedWordsUsed;
+    WAISDocumentHeader **DocHeaders;
+    WAISDocumentShortHeader **ShortHeaders;
+    WAISDocumentLongHeader **LongHeaders;
+    WAISDocumentText **Text;
+    WAISDocumentHeadlines **Headlines;
+    WAISDocumentCodes **Codes;
+    diagnosticRecord **Diagnostics;
+} WAISSearchResponse;
 
 /*----------------------------------------------------------------------*/
 /* Functions */
 
-char *
-generate_search_apdu (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 (any* aDocID,char* type);
-DocObj* makeDocObjUsingBytes (any* aDocID,char* type,long start,long end);
-DocObj* makeDocObjUsingLines (any* aDocID,char* type,long start,long end);
-DocObj* makeDocObjUsingParagraphs (any* aDocID,char* type,any* start,any* end);
-void freeDocObj (DocObj* doc);
-
-WAISInitResponse* makeWAISInitResponse (long chunkCode,long chunkIDLen,
-					    char* chunkMarker,char* highlightMarker,
-					    char* deHighlightMarker,char* newLineChars);
-void freeWAISInitResponse (WAISInitResponse* init);
-
-WAISSearch* makeWAISSearch (
-	char* seedWords,DocObj** docs,char** textList,
-	long dateFactor,char* beginDateRange,char* endDateRange,
-	long maxDocsRetrieved);
-void freeWAISSearch (WAISSearch* query);
-
-WAISDocumentHeader* makeWAISDocumentHeader (
-	any* aDocID,long versionNumber,long score,long bestMatch,long docLen,
-	long lines,char** types,char* source,char* date,char* headline,char* originCity);
-void freeWAISDocumentHeader (WAISDocumentHeader* header);
-char* writeWAISDocumentHeader (WAISDocumentHeader* header,char* buffer,long* len);
-char* readWAISDocumentHeader (WAISDocumentHeader** header,char* buffer);
-
-WAISDocumentShortHeader* makeWAISDocumentShortHeader (
-	any* aDocID,long versionNumber,long score,long bestMatch,long docLen,long lines);
-void freeWAISDocumentShortHeader (WAISDocumentShortHeader* header);
-char* writeWAISDocumentShortHeader (WAISDocumentShortHeader* header,
-                                   char* buffer,long* len);
-char* readWAISDocumentShortHeader (WAISDocumentShortHeader** header,char* buffer);
-
-WAISDocumentLongHeader* makeWAISDocumentLongHeader (
-	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 (WAISDocumentLongHeader* header);
-char* writeWAISDocumentLongHeader (WAISDocumentLongHeader* header,char* buffer,long* len);
-char* readWAISDocumentLongHeader (WAISDocumentLongHeader** header,char* buffer);
-
-WAISSearchResponse* makeWAISSearchResponse (
-	char* seedWordsUsed,WAISDocumentHeader** docHeaders,
-	WAISDocumentShortHeader** shortHeaders,
-	WAISDocumentLongHeader** longHeaders,
-	WAISDocumentText** text,WAISDocumentHeadlines** headlines,
-	WAISDocumentCodes** codes,
-	diagnosticRecord** diagnostics);
-void freeWAISSearchResponse (WAISSearchResponse* response);
-
-WAISDocumentText* makeWAISDocumentText (any* aDocID,long versionNumber,
-				       any* documentText);
-void freeWAISDocumentText (WAISDocumentText* docText);
-char* writeWAISDocumentText (WAISDocumentText* docText,char* buffer,long* len);
-char* readWAISDocumentText (WAISDocumentText** docText,char* buffer);
-
-WAISDocumentHeadlines* makeWAISDocumentHeadlines (
-	any* aDocID,long versionNumber,char* source,char* date,char* headline,
-	char* originCity);
-void freeWAISDocumentHeadlines (WAISDocumentHeadlines* docHeadline);
-char* writeWAISDocumentHeadlines (WAISDocumentHeadlines* docHeadline,char* buffer,long* len);
-char* readWAISDocumentHeadlines (WAISDocumentHeadlines** docHeadline,char* buffer);
-
-WAISDocumentCodes* makeWAISDocumentCodes (
-	any* aDocID,long versionNumber,char* stockCodes,char* companyCodes,
-	char* industryCodes);
-void freeWAISDocumentCodes (WAISDocumentCodes* docCodes);
-char* writeWAISDocumentCodes (WAISDocumentCodes* docCodes,char* buffer,long* len);
-char* readWAISDocumentCodes (WAISDocumentCodes** docCodes,char* buffer);
-
-any* makeWAISTextQuery (DocObj** docs);
-DocObj** readWAISTextQuery (any* terms);
-
-void CSTFreeWAISInitResponse (WAISInitResponse* init);
-void CSTFreeWAISSearch (WAISSearch* query);
-void CSTFreeDocObj (DocObj* doc);
-void CSTFreeWAISDocumentHeader (WAISDocumentHeader* header);
-void CSTFreeWAISDocumentShortHeader (WAISDocumentShortHeader* header);
-void CSTFreeWAISDocumentLongHeader (WAISDocumentLongHeader* header);
-void CSTFreeWAISSearchResponse (WAISSearchResponse* response);
-void CSTFreeWAISDocumentText (WAISDocumentText* docText);
-void CSTFreeWAISDocHeadlines (WAISDocumentHeadlines* docHeadline);
-void CSTFreeWAISDocumentCodes (WAISDocumentCodes* docCodes);
-void CSTFreeWAISTextQuery ( any* query);
+char *generate_search_apdu(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(any *aDocID, char *type);
+DocObj *makeDocObjUsingBytes(any *aDocID, char *type, long start, long end);
+DocObj *makeDocObjUsingLines(any *aDocID, char *type, long start, long end);
+DocObj *makeDocObjUsingParagraphs(any *aDocID, char *type, any *start, any *end);
+void freeDocObj(DocObj *doc);
+
+WAISInitResponse *makeWAISInitResponse(long chunkCode, long chunkIDLen,
+				       char *chunkMarker, char *highlightMarker,
+				       char *deHighlightMarker, char *newLineChars);
+void freeWAISInitResponse(WAISInitResponse *init);
+
+WAISSearch *makeWAISSearch(char *seedWords,
+			   DocObj **docs,
+			   char **textList,
+			   long dateFactor,
+			   char *beginDateRange,
+			   char *endDateRange,
+			   long maxDocsRetrieved);
+void freeWAISSearch(WAISSearch *query);
+
+WAISDocumentHeader *makeWAISDocumentHeader(any *aDocID,
+					   long versionNumber,
+					   long score,
+					   long bestMatch,
+					   long docLen,
+					   long lines,
+					   char **types,
+					   char *source,
+					   char *date,
+					   char *headline,
+					   char *originCity);
+void freeWAISDocumentHeader(WAISDocumentHeader *header);
+char *writeWAISDocumentHeader(WAISDocumentHeader *header, char *buffer, long *len);
+char *readWAISDocumentHeader(WAISDocumentHeader **header, char *buffer);
+
+WAISDocumentShortHeader *makeWAISDocumentShortHeader(any *aDocID,
+						     long versionNumber,
+						     long score,
+						     long bestMatch,
+						     long docLen,
+						     long lines);
+void freeWAISDocumentShortHeader(WAISDocumentShortHeader *header);
+char *writeWAISDocumentShortHeader(WAISDocumentShortHeader *header,
+				   char *buffer, long *len);
+char *readWAISDocumentShortHeader(WAISDocumentShortHeader **header, char *buffer);
+
+WAISDocumentLongHeader *makeWAISDocumentLongHeader(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(WAISDocumentLongHeader *header);
+char *writeWAISDocumentLongHeader(WAISDocumentLongHeader *header,
+				  char *buffer,
+				  long *len);
+char *readWAISDocumentLongHeader(WAISDocumentLongHeader **header, char *buffer);
+
+WAISSearchResponse *makeWAISSearchResponse(char *seedWordsUsed,
+					   WAISDocumentHeader **docHeaders,
+					   WAISDocumentShortHeader **shortHeaders,
+					   WAISDocumentLongHeader **longHeaders,
+					   WAISDocumentText **text, WAISDocumentHeadlines **headlines,
+					   WAISDocumentCodes **codes,
+					   diagnosticRecord ** diagnostics);
+void freeWAISSearchResponse(WAISSearchResponse * response);
+
+WAISDocumentText *makeWAISDocumentText(any *aDocID, long versionNumber,
+				       any *documentText);
+void freeWAISDocumentText(WAISDocumentText *docText);
+char *writeWAISDocumentText(WAISDocumentText *docText, char *buffer, long *len);
+char *readWAISDocumentText(WAISDocumentText **docText, char *buffer);
+
+WAISDocumentHeadlines *makeWAISDocumentHeadlines(any *aDocID,
+						 long versionNumber,
+						 char *source,
+						 char *date,
+						 char *headline,
+						 char *originCity);
+void freeWAISDocumentHeadlines(WAISDocumentHeadlines *docHeadline);
+char *writeWAISDocumentHeadlines(WAISDocumentHeadlines *docHeadline,
+				 char *buffer,
+				 long *len);
+char *readWAISDocumentHeadlines(WAISDocumentHeadlines **docHeadline, char *buffer);
+
+WAISDocumentCodes *makeWAISDocumentCodes(any *aDocID,
+					 long versionNumber,
+					 char *stockCodes,
+					 char *companyCodes,
+					 char *industryCodes);
+void freeWAISDocumentCodes(WAISDocumentCodes *docCodes);
+char *writeWAISDocumentCodes(WAISDocumentCodes *docCodes, char *buffer, long *len);
+char *readWAISDocumentCodes(WAISDocumentCodes **docCodes, char *buffer);
+
+any *makeWAISTextQuery(DocObj **docs);
+DocObj **readWAISTextQuery(any *terms);
+
+void CSTFreeWAISInitResponse(WAISInitResponse *init);
+void CSTFreeWAISSearch(WAISSearch *query);
+void CSTFreeDocObj(DocObj *doc);
+void CSTFreeWAISDocumentHeader(WAISDocumentHeader *header);
+void CSTFreeWAISDocumentShortHeader(WAISDocumentShortHeader *header);
+void CSTFreeWAISDocumentLongHeader(WAISDocumentLongHeader *header);
+void CSTFreeWAISSearchResponse(WAISSearchResponse * response);
+void CSTFreeWAISDocumentText(WAISDocumentText *docText);
+void CSTFreeWAISDocHeadlines(WAISDocumentHeadlines *docHeadline);
+void CSTFreeWAISDocumentCodes(WAISDocumentCodes *docCodes);
+void CSTFreeWAISTextQuery(any *query);
 
 /*----------------------------------------------------------------------*/
 
 #endif /* ndef _H_WAIS_protocol_ */
 
-
 /*
-**	Routines originally from WMessage.h -- FM
-**
-**----------------------------------------------------------------------*/
+ *	Routines originally from WMessage.h -- FM
+ *
+ *----------------------------------------------------------------------*/
 /* WIDE AREA INFORMATION SERVER SOFTWARE
-   No guarantees or restrictions.  See the readme file for the full standard
-   disclaimer.
-   3.26.90
-*/
+ * No guarantees or restrictions.  See the readme file for the full standard
+ * disclaimer.
+ * 3.26.90
+ */
 
 /* wais-message.h
  *
@@ -355,16 +385,16 @@ void CSTFreeWAISTextQuery ( any* query);
 #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,
-                                   'a'=ACK, 'n'=NACK */
-        char    hdr_vers;       /* version of this header, currently = '2' */
-        char    server[10];     /* name or address of server */
-        char    compression;    /* <sp>=no compression, 'u'=unix compress */
-        char    encoding;       /* <sp>=no encoding, 'h'=hexize,
+    char msg_len[10];		/* length in bytes of following message */
+    char msg_type;		/* type of message: 'z'=Z39.50 APDU,
+				   'a'=ACK, 'n'=NACK */
+    char hdr_vers;		/* version of this header, currently = '2' */
+    char server[10];		/* name or address of server */
+    char compression;		/* <sp>=no compression, 'u'=unix compress */
+    char encoding;		/* <sp>=no encoding, 'h'=hexize,
 				   'u'=uuencode */
-        char    msg_checksum;   /* XOR of every byte of message */
-        } WAISMessage;
+    char msg_checksum;		/* XOR of every byte of message */
+} WAISMessage;
 
 #define HEADER_LENGTH	25	/* number of bytes needed to write a
 				   wais-header (not sizeof(wais_header)) */
@@ -382,15 +412,14 @@ typedef struct wais_header {
 
 /* encoding */
 #define NO_ENCODING		' '
-#define HEX_ENCODING		'h'  /* Swartz 4/3 encoding */
-#define IBM_HEXCODING		'i'  /* same as h but uses characters acceptable for IBM mainframes */
+#define HEX_ENCODING		'h'	/* Swartz 4/3 encoding */
+#define IBM_HEXCODING		'i'	/* same as h but uses characters acceptable for IBM mainframes */
 #define UUENCODE		'u'
 
-
-void readWAISPacketHeader (char* msgBuffer,WAISMessage *header_struct);
-long getWAISPacketLength (WAISMessage* header);
-void writeWAISPacketHeader (char* header,long dataLen,long type,
-				char* server,long compression,
-				long encoding,long version);
+void readWAISPacketHeader(char *msgBuffer, WAISMessage * header_struct);
+long getWAISPacketLength(WAISMessage * header);
+void writeWAISPacketHeader(char *header, long dataLen, long type,
+			   char *server, long compression,
+			   long encoding, long version);
 
 #endif /* ndef WMESSAGE_H */
diff --git a/WWW/Library/Implementation/HTVMS_WaisUI.c b/WWW/Library/Implementation/HTVMS_WaisUI.c
index 0c703acf..1b131dd9 100644
--- a/WWW/Library/Implementation/HTVMS_WaisUI.c
+++ b/WWW/Library/Implementation/HTVMS_WaisUI.c
@@ -1,21 +1,21 @@
 /*							HTVMS_WAISUI.c
-**
-**	Adaptation for Lynx by F.Macrides (macrides@sci.wfeb.edu)
-**
-**	30-May-1994 FM	Initial version.
-**
-**----------------------------------------------------------------------*/
+ *
+ *	Adaptation for Lynx by F.Macrides (macrides@sci.wfeb.edu)
+ *
+ *	30-May-1994 FM	Initial version.
+ *
+ *----------------------------------------------------------------------*/
 
 /*
-**	Routines originally from UI.c -- FM
-**
-**----------------------------------------------------------------------*/
+ *	Routines originally from UI.c -- FM
+ *
+ *----------------------------------------------------------------------*/
 /* WIDE AREA INFORMATION SERVER SOFTWARE:
-   No guarantees or restrictions.  See the readme file for the full standard
-   disclaimer.
-
-   Brewster@think.com
-*/
+ * No guarantees or restrictions.  See the readme file for the full standard
+ * disclaimer.
+ *
+ * Brewster@think.com
+ */
 
 /*
  * this is a simple ui toolkit for building other ui's on top.
@@ -36,18 +36,19 @@
  */
 
 #include <HTUtils.h>
+
+#ifdef VMS
 #include <HTVMS_WaisUI.h>
 #include <HTVMS_WaisProt.h>
 #include <HTTCP.h>
 
-#undef MAXINT	/* we don't need it here, and www_tcp.h may conflict */
+#undef MAXINT			/* we don't need it here, and www_tcp.h may conflict */
 #include <math.h>
 
 #include <LYexit.h>
 #include <LYLeaks.h>
 
-void
-log_write(char *s GCC_UNUSED)
+void log_write(char *s GCC_UNUSED)
 {
     return;
 }
@@ -57,51 +58,51 @@ log_write(char *s GCC_UNUSED)
 /* returns a pointer in the buffer of the first free byte.
    if it overflows, then NULL is returned
  */
-char *
-generate_search_apdu(
-char* buff,     /* buffer to hold the apdu */
-long *buff_len,    /* length of the buffer changed to reflect new data written */
-char *seed_words,    /* string of the seed words */
-char *database_name,
-DocObj** docobjs,
-long maxDocsRetrieved)
-{
-  /* local variables */
-
-  SearchAPDU *search3;
-  char  *end_ptr;
-  static char *database_names[2] = {"", 0};
-  any refID;
-  WAISSearch *query;
-  refID.size = 1;
-  refID.bytes = "3";
-
-  database_names[0] = database_name;
-  query = makeWAISSearch(seed_words,
-                         docobjs, /* DocObjsPtr */
-                         0,
-                         1,     /* DateFactor */
-                         0,     /* BeginDateRange */
-                         0,     /* EndDateRange */
-                         maxDocsRetrieved
-                         );
-
-  search3 = makeSearchAPDU(30,
-			   5000, /* should be large */
-			   30,
-                           1,	/* replace indicator */
-                           "",	/* result set name */
-                           database_names, /* database name */
-                           QT_RelevanceFeedbackQuery, /* query_type */
-                           0,   /* element name */
-                           NULL, /* reference ID */
-                           query);
-
-  end_ptr = writeSearchAPDU(search3, buff, buff_len);
-
-  CSTFreeWAISSearch(query);
-  freeSearchAPDU(search3);
-  return(end_ptr);
+char *generate_search_apdu(char *buff,	/* buffer to hold the apdu */
+			   long *buff_len,	/* length of the buffer changed to reflect new data written */
+			   char *seed_words,	/* string of the seed words */
+			   char *database_name,
+			   DocObj **docobjs,
+			   long maxDocsRetrieved)
+{
+    /* local variables */
+
+    SearchAPDU *search3;
+    char *end_ptr;
+    static char *database_names[2] =
+    {"", 0};
+    any refID;
+    WAISSearch *query;
+
+    refID.size = 1;
+    refID.bytes = "3";
+
+    database_names[0] = database_name;
+    query = makeWAISSearch(seed_words,
+			   docobjs,	/* DocObjsPtr */
+			   0,
+			   1,	/* DateFactor */
+			   0,	/* BeginDateRange */
+			   0,	/* EndDateRange */
+			   maxDocsRetrieved
+	);
+
+    search3 = makeSearchAPDU(30,
+			     5000,	/* should be large */
+			     30,
+			     1,	/* replace indicator */
+			     "",	/* result set name */
+			     database_names,	/* database name */
+			     QT_RelevanceFeedbackQuery,		/* query_type */
+			     0,	/* element name */
+			     NULL,	/* reference ID */
+			     query);
+
+    end_ptr = writeSearchAPDU(search3, buff, buff_len);
+
+    CSTFreeWAISSearch(query);
+    freeSearchAPDU(search3);
+    return (end_ptr);
 }
 
 /*----------------------------------------------------------------------*/
@@ -110,63 +111,61 @@ long maxDocsRetrieved)
    if it overflowed, then NULL is returned
  */
 
-char *
-generate_retrieval_apdu(
-char *buff,
-long *buff_len,    /* length of the buffer changed to reflect new data written */
-any *docID,
-long chunk_type,
-long start,
-long end,
-char *type,
-char *database_name)
-{
-  SearchAPDU *search;
-  char  *end_ptr;
-
-  static char *database_names[2];
-  static char *element_names[3];
-  any refID;
-
-  DocObj *DocObjs[2];
-  any *query;			/* changed from char* by brewster */
-
-  if(NULL == type)
-    type = s_strdup("TEXT");
-
-  database_names[0] = database_name;
-  database_names[1] = NULL;
-
-  element_names[0] = " ";
-  element_names[1] = ES_DocumentText;
-  element_names[2] = NULL;
-
-  refID.size = 1;
-  refID.bytes = "3";
-
-  switch(chunk_type){
-  case CT_line:
-    DocObjs[0] = makeDocObjUsingLines(docID, type, start, end);
-    break;
-  case CT_byte:
-    DocObjs[0] = makeDocObjUsingBytes(docID, type, start, end);
-    break;
-  }
-  DocObjs[1] = NULL;
-
-  query = makeWAISTextQuery(DocObjs);
-  search = makeSearchAPDU( 10, 16, 15,
-			  1,	/* replace indicator */
-			  "FOO", /* result set name */
-			  database_names, /* database name */
-			  QT_TextRetrievalQuery, /* query_type */
-			  element_names, /* element name */
-			  &refID, /* reference ID */
-			  query);
-  end_ptr = writeSearchAPDU(search, buff, buff_len);
-  CSTFreeWAISTextQuery(query);
-  freeSearchAPDU(search);
-  return(end_ptr);
+char *generate_retrieval_apdu(char *buff,
+			      long *buff_len,	/* length of the buffer changed to reflect new data written */
+			      any *docID,
+			      long chunk_type,
+			      long start,
+			      long end,
+			      char *type,
+			      char *database_name)
+{
+    SearchAPDU *search;
+    char *end_ptr;
+
+    static char *database_names[2];
+    static char *element_names[3];
+    any refID;
+
+    DocObj *DocObjs[2];
+    any *query;			/* changed from char* by brewster */
+
+    if (NULL == type)
+	type = s_strdup("TEXT");
+
+    database_names[0] = database_name;
+    database_names[1] = NULL;
+
+    element_names[0] = " ";
+    element_names[1] = ES_DocumentText;
+    element_names[2] = NULL;
+
+    refID.size = 1;
+    refID.bytes = "3";
+
+    switch (chunk_type) {
+    case CT_line:
+	DocObjs[0] = makeDocObjUsingLines(docID, type, start, end);
+	break;
+    case CT_byte:
+	DocObjs[0] = makeDocObjUsingBytes(docID, type, start, end);
+	break;
+    }
+    DocObjs[1] = NULL;
+
+    query = makeWAISTextQuery(DocObjs);
+    search = makeSearchAPDU(10, 16, 15,
+			    1,	/* replace indicator */
+			    "FOO",	/* result set name */
+			    database_names,	/* database name */
+			    QT_TextRetrievalQuery,	/* query_type */
+			    element_names,	/* element name */
+			    &refID,	/* reference ID */
+			    query);
+    end_ptr = writeSearchAPDU(search, buff, buff_len);
+    CSTFreeWAISTextQuery(query);
+    freeSearchAPDU(search);
+    return (end_ptr);
 }
 
 /*----------------------------------------------------------------------*/
@@ -178,153 +177,149 @@ char *database_name)
  */
 static long read_from_stream(int d, char *buf, long nbytes)
 {
-  long didRead;
-  long toRead = nbytes;
-  long totalRead = 0;		/* paranoia */
-
-  while (toRead > 0){
-    didRead = NETREAD (d, buf, (int)toRead);
-    if(didRead == HT_INTERRUPTED)
-      return(HT_INTERRUPTED);
-    if(didRead == -1)		/* error*/
-      return(-1);
-    if(didRead == 0)		/* eof */
-      return(-2);		/* maybe this should return 0? */
-    toRead -= didRead;
-    buf += didRead;
-    totalRead += didRead;
-  }
-  if(totalRead != nbytes)	/* we overread for some reason */
-    return(- totalRead);	/* bad news */
-  return(totalRead);
+    long didRead;
+    long toRead = nbytes;
+    long totalRead = 0;		/* paranoia */
+
+    while (toRead > 0) {
+	didRead = NETREAD(d, buf, (int) toRead);
+	if (didRead == HT_INTERRUPTED)
+	    return (HT_INTERRUPTED);
+	if (didRead == -1)	/* error */
+	    return (-1);
+	if (didRead == 0)	/* eof */
+	    return (-2);	/* maybe this should return 0? */
+	toRead -= didRead;
+	buf += didRead;
+	totalRead += didRead;
+    }
+    if (totalRead != nbytes)	/* we overread for some reason */
+	return (-totalRead);	/* bad news */
+    return (totalRead);
 }
 
 /*----------------------------------------------------------------------*/
 
 /* returns the length of the response, 0 if an error */
 
-static long
-transport_message(
-	long connection,
-	char *request_message,
-	long request_length,
-	char *response_message,
-	long response_buffer_length)
+static 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;
+    WAISMessage header;
+    long response_length;
+    int rv;
 
+    /* Write out message.  Read back header.  Figure out response length. */
 
-  /* Write out message.  Read back header.  Figure out response length. */
+    if (request_length + HEADER_LENGTH !=
+	NETWRITE(connection, request_message,
+		 (int) (request_length + HEADER_LENGTH)))
+	return 0;
 
-  if( request_length + HEADER_LENGTH !=
-      NETWRITE(connection,request_message,
-		  (int)( request_length +HEADER_LENGTH)) )
-    return 0;
+    /* read for the first '0' */
 
-  /* read for the first '0' */
+    while (1) {
+	rv = read_from_stream(connection, response_message, 1);
+	if (rv == HT_INTERRUPTED)
+	    return HT_INTERRUPTED;
+	if (rv < 0)
+	    return 0;
+	if ('0' == response_message[0])
+	    break;
+    }
 
-  while(1){
-    rv = read_from_stream(connection, response_message, 1);
+    rv = read_from_stream(connection, response_message + 1, HEADER_LENGTH - 1);
     if (rv == HT_INTERRUPTED)
-      return HT_INTERRUPTED;
+	return HT_INTERRUPTED;
     if (rv < 0)
-      return 0;
-    if('0' == response_message[0])
-      break;
-  }
-
-  rv = read_from_stream(connection, response_message + 1, HEADER_LENGTH -1);
-  if (rv == HT_INTERRUPTED)
-    return HT_INTERRUPTED;
-  if (rv < 0)
-    return 0;
-
-  readWAISPacketHeader(response_message, &header);
-  {
-    char length_array[11];
-    strncpy(length_array, header.msg_len, 10);
-    length_array[10] = '\0';
-    response_length = atol(length_array);
-    /*
-      if(verbose){
-      printf("WAIS header: '%s' length_array: '%s'\n",
-      response_message, length_array);
-      }
-      */
-    if(response_length > response_buffer_length){
-      /* we got a message that is too long, therefore empty the message out,
-	 and return 0 */
-      long i;
-      for(i = 0; i < response_length; i++){
-	rv = read_from_stream(connection,
-			      response_message + HEADER_LENGTH,
-			      1);
-	if (rv == HT_INTERRUPTED)
-	  return HT_INTERRUPTED;
-	if (rv < 0)
-	  return 0;
-      }
-      return(0);
+	return 0;
+
+    readWAISPacketHeader(response_message, &header);
+    {
+	char length_array[11];
+
+	strncpy(length_array, header.msg_len, 10);
+	length_array[10] = '\0';
+	response_length = atol(length_array);
+	/*
+	   if(verbose){
+	   printf("WAIS header: '%s' length_array: '%s'\n",
+	   response_message, length_array);
+	   }
+	 */
+	if (response_length > response_buffer_length) {
+	    /* we got a message that is too long, therefore empty the message out,
+	       and return 0 */
+	    long i;
+
+	    for (i = 0; i < response_length; i++) {
+		rv = read_from_stream(connection,
+				      response_message + HEADER_LENGTH,
+				      1);
+		if (rv == HT_INTERRUPTED)
+		    return HT_INTERRUPTED;
+		if (rv < 0)
+		    return 0;
+	    }
+	    return (0);
+	}
     }
-  }
-  rv = read_from_stream(connection,
-			response_message + HEADER_LENGTH,
-			response_length);
-  if (rv == HT_INTERRUPTED)
-    return HT_INTERRUPTED;
-  if (rv < 0)
-    return 0;
-  return(response_length);
+    rv = read_from_stream(connection,
+			  response_message + HEADER_LENGTH,
+			  response_length);
+    if (rv == HT_INTERRUPTED)
+	return HT_INTERRUPTED;
+    if (rv < 0)
+	return 0;
+    return (response_length);
 }
 
 /*----------------------------------------------------------------------*/
 
 /* returns the number of bytes written.  0 if an error */
-long
-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;
-
-  /* ?
-  if(verbose){
-    printf ("sending");
-    if(hostname_internal && strlen(hostname_internal) > 0)
-      printf(" to host %s", hostname_internal);
-    if(service_name && strlen(service_name) > 0)
-      printf(" for service %s", service_name);
-    printf("\n");
-    twais_dsply_rsp_apdu(request_message + HEADER_LENGTH,
-			 request_length);
-  }
-
-  */
-
-  writeWAISPacketHeader(request_message,
-			request_length,
-			(long)'z',	/* Z39.50 */
-			"wais      ", /* server name */
-			(long)NO_COMPRESSION,	/* no compression */
-			(long)NO_ENCODING,(long)HEADER_VERSION);
-  if(connection != 0) {
-    response_length = transport_message(connection, request_message,
-					request_length,
-					response_message,
-					response_buffer_length);
-    if (response_length == HT_INTERRUPTED)
-      return(HT_INTERRUPTED);
-  }
-  else
-      return(0);
-
-  return(response_length);
+long 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;
+
+    /* ?
+       if(verbose){
+       printf ("sending");
+       if(hostname_internal && strlen(hostname_internal) > 0)
+       printf(" to host %s", hostname_internal);
+       if(service_name && strlen(service_name) > 0)
+       printf(" for service %s", service_name);
+       printf("\n");
+       twais_dsply_rsp_apdu(request_message + HEADER_LENGTH,
+       request_length);
+       }
+
+     */
+
+    writeWAISPacketHeader(request_message,
+			  request_length,
+			  (long) 'z',	/* Z39.50 */
+			  "wais      ",		/* server name */
+			  (long) NO_COMPRESSION,	/* no compression */
+			  (long) NO_ENCODING, (long) HEADER_VERSION);
+    if (connection != 0) {
+	response_length = transport_message(connection, request_message,
+					    request_length,
+					    response_message,
+					    response_buffer_length);
+	if (response_length == HT_INTERRUPTED)
+	    return (HT_INTERRUPTED);
+    } else
+	return (0);
+
+    return (response_length);
 }
 
 /*----------------------------------------------------------------------*/
@@ -333,26 +328,28 @@ interpret_message(
    the new length. */
 static 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 */
-  for(original_count = 0; original_count < *length; original_count++){
-    if(27 == string[original_count]){
-      /* then we have an escape code */
-      /* if the next letter is '(' or ')', then ignore two letters */
-      if('(' == string[original_count + 1] ||
-    ')' == string[original_count + 1])
-     original_count += 1;    /* it is a term marker */
-      else original_count += 4; /* it is a paragraph marker */
+    long original_count;	/* index into the original string */
+    long new_count = 0;		/* index into the collapsed string */
+
+    for (original_count = 0; original_count < *length; original_count++) {
+	if (27 == string[original_count]) {
+	    /* then we have an escape code */
+	    /* if the next letter is '(' or ')', then ignore two letters */
+	    if ('(' == string[original_count + 1] ||
+		')' == string[original_count + 1])
+		original_count += 1;	/* it is a term marker */
+	    else
+		original_count += 4;	/* it is a paragraph marker */
+	} else
+	    string[new_count++] = string[original_count];
     }
-    else string[new_count++] = string[original_count];
-  }
-  *length = new_count;
-  return(string);
+    *length = new_count;
+    return (string);
 }
 
 /*----------------------------------------------------------------------*/
 
-#if defined(VMS) && defined(__GNUC__)			/* 10-AUG-1995 [pr] */
+#if defined(VMS) && defined(__GNUC__)	/* 10-AUG-1995 [pr] */
 /*
   Workaround for an obscure bug in gcc's 2.6.[123] and 2.7.0 vax/vms port;
   sometimes global variables will end up not being defined properly,
@@ -365,47 +362,48 @@ static char *delete_seeker_codes(char *string, long *length)
    Make a reference to VAXCRTL's _ctype_[], and also one to this dummy
    variable itself to prevent any "defined but not used" warning.
  */
-static __const void *__const ctype_dummy[] = { &_ctype_, &ctype_dummy };
+static __const void *__const ctype_dummy[] =
+{&_ctype_, &ctype_dummy};
 #endif /* VMS && __GNUC__ */
 
 /* returns a pointer to a string with good stuff */
 char *trim_junk(char *headline)
 {
-  long length = strlen(headline) + 1; /* include the trailing null */
-  size_t i;
-  headline = delete_seeker_codes(headline, &length);
-  /* delete leading spaces */
-  for(i=0; i < strlen(headline); i++){
-    if(isprint(headline[i])){
-      break;
+    long length = strlen(headline) + 1;		/* include the trailing null */
+    size_t i;
+
+    headline = delete_seeker_codes(headline, &length);
+    /* delete leading spaces */
+    for (i = 0; i < strlen(headline); i++) {
+	if (isprint(headline[i])) {
+	    break;
+	}
     }
-  }
-  headline = headline + i;
-  /* delete trailing stuff */
-  for(i=strlen(headline) - 1 ; i > 0; i--){
-    if(isprint(headline[i])){
-      break;
+    headline = headline + i;
+    /* delete trailing stuff */
+    for (i = strlen(headline) - 1; i > 0; i--) {
+	if (isprint(headline[i])) {
+	    break;
+	}
+	headline[i] = '\0';
     }
-    headline[i] = '\0';
-  }
-  return(headline);
+    return (headline);
 }
 
 /*----------------------------------------------------------------------*/
 
-
 /*
-**	Routines originally from ZProt.c -- FM
-**
-**----------------------------------------------------------------------*/
+ *	Routines originally from ZProt.c -- FM
+ *
+ *----------------------------------------------------------------------*/
 /* WIDE AREA INFORMATION SERVER SOFTWARE:`
-   No guarantees or restrictions.  See the readme file for the full standard
-   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)
-*/
+ * No guarantees or restrictions.  See the readme file for the full standard
+ * 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)
+ */
 
 #define RESERVE_SPACE_FOR_HEADER(spaceLeft)		\
 	*spaceLeft -= HEADER_LEN;
@@ -416,156 +414,173 @@ char *trim_junk(char *headline)
 
 /*----------------------------------------------------------------------*/
 
-InitResponseAPDU*
-makeInitResponseAPDU(
-boolean result,
-boolean search,
-boolean present,
-boolean deleteIt,
-boolean accessControl,
-boolean resourceControl,
-long prefSize,
-long maxMsgSize,
-char* auth,
-char* id,
-char* name,
-char* version,
-any* refID,
-void* userInfo)
+InitResponseAPDU *makeInitResponseAPDU(boolean result,
+				       boolean search,
+				       boolean present,
+				       boolean deleteIt,
+				       boolean accessControl,
+				       boolean resourceControl,
+				       long prefSize,
+				       long maxMsgSize,
+				       char *auth,
+				       char *id,
+				       char *name,
+				       char *version,
+				       any *refID,
+				       void *userInfo)
 /* build an initResponse APDU with user specified information */
 {
-  InitResponseAPDU* init = (InitResponseAPDU*)s_malloc((size_t)sizeof(InitResponseAPDU));
+    InitResponseAPDU *init = (InitResponseAPDU *) s_malloc((size_t) sizeof(InitResponseAPDU));
 
-  init->PDUType = initResponseAPDU;
-  init->Result = result;
-  init->willSearch = search;
-  init->willPresent = present;
-  init->willDelete = deleteIt;
-  init->supportAccessControl = accessControl;
-  init->supportResourceControl = resourceControl;
-  init->PreferredMessageSize = prefSize;
-  init->MaximumRecordSize = maxMsgSize;
-  init->IDAuthentication = s_strdup(auth);
-  init->ImplementationID = s_strdup(id);
-  init->ImplementationName = s_strdup(name);
-  init->ImplementationVersion = s_strdup(version);
-  init->ReferenceID = duplicateAny(refID);
-  init->UserInformationField = userInfo; /* not copied! */
+    init->PDUType = initResponseAPDU;
+    init->Result = result;
+    init->willSearch = search;
+    init->willPresent = present;
+    init->willDelete = deleteIt;
+    init->supportAccessControl = accessControl;
+    init->supportResourceControl = resourceControl;
+    init->PreferredMessageSize = prefSize;
+    init->MaximumRecordSize = maxMsgSize;
+    init->IDAuthentication = s_strdup(auth);
+    init->ImplementationID = s_strdup(id);
+    init->ImplementationName = s_strdup(name);
+    init->ImplementationVersion = s_strdup(version);
+    init->ReferenceID = duplicateAny(refID);
+    init->UserInformationField = userInfo;	/* not copied! */
 
-  return(init);
+    return (init);
 }
 
 /*----------------------------------------------------------------------*/
 
-void
-freeInitResponseAPDU(InitResponseAPDU* init)
+void freeInitResponseAPDU(InitResponseAPDU *init)
 /* free an initAPDU */
 {
-  s_free(init->IDAuthentication);
-  s_free(init->ImplementationID);
-  s_free(init->ImplementationName);
-  s_free(init->ImplementationVersion);
-  freeAny(init->ReferenceID);
-  s_free(init);
+    s_free(init->IDAuthentication);
+    s_free(init->ImplementationID);
+    s_free(init->ImplementationName);
+    s_free(init->ImplementationVersion);
+    freeAny(init->ReferenceID);
+    s_free(init);
 }
 
 /*----------------------------------------------------------------------*/
 
-char*
-writeInitResponseAPDU(InitResponseAPDU* init, char* buffer, long* len)
+char *writeInitResponseAPDU(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);
-  buf = writeBitMap(optionsBM,DT_Options,buf,len);
-  freeBitMap(optionsBM);
-
-  buf = writeNum(init->PreferredMessageSize,DT_PreferredMessageSize,buf,len);
-  buf = writeNum(init->MaximumRecordSize,DT_MaximumRecordSize,buf,len);
-  buf = writeString(init->IDAuthentication,DT_IDAuthentication,buf,len);
-  buf = writeString(init->ImplementationID,DT_ImplementationID,buf,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;
-  writeBinaryInteger(size,HEADER_LEN,buffer,len);
-
-  if (init->UserInformationField != NULL)
-    buf = writeInitResponseInfo(init,buf,len);
-
-  return(buf);
-}
-
-/*----------------------------------------------------------------------*/
-
-char*
-readInitResponseAPDU(InitResponseAPDU** init, char* buffer)
-{
-  char* buf = buffer;
-  boolean search,present,delete,accessControl,resourceControl;
-  long prefSize,maxMsgSize;
-  char *auth,*id,*name,*version;
-  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 = readPDUType(&pduType,buf);
-  buf = readBoolean(&result,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))
-    { data_tag tag = peekTag(buf);
-      switch (tag)
-	{ case DT_IDAuthentication:
-	    buf = readString(&auth,buf);
+    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);
+    buf = writeBitMap(optionsBM, DT_Options, buf, len);
+    freeBitMap(optionsBM);
+
+    buf = writeNum(init->PreferredMessageSize,
+		   DT_PreferredMessageSize,
+		   buf,
+		   len);
+    buf = writeNum(init->MaximumRecordSize,
+		   DT_MaximumRecordSize,
+		   buf,
+		   len);
+    buf = writeString(init->IDAuthentication,
+		      DT_IDAuthentication,
+		      buf,
+		      len);
+    buf = writeString(init->ImplementationID,
+		      DT_ImplementationID,
+		      buf,
+		      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;
+    writeBinaryInteger(size, HEADER_LEN, buffer, len);
+
+    if (init->UserInformationField != NULL)
+	buf = writeInitResponseInfo(init, buf, len);
+
+    return (buf);
+}
+
+/*----------------------------------------------------------------------*/
+
+char *readInitResponseAPDU(InitResponseAPDU **init, char *buffer)
+{
+    char *buf = buffer;
+    boolean search, present, delete, accessControl, resourceControl;
+    long prefSize, maxMsgSize;
+    char *auth, *id, *name, *version;
+    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 = readPDUType(&pduType, buf);
+    buf = readBoolean(&result, 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)) {
+	data_tag tag = peekTag(buf);
+
+	switch (tag) {
+	case DT_IDAuthentication:
+	    buf = readString(&auth, buf);
 	    break;
-	  case DT_ImplementationID:
-	    buf = readString(&id,buf);
+	case DT_ImplementationID:
+	    buf = readString(&id, buf);
 	    break;
-	  case DT_ImplementationName:
-	    buf = readString(&name,buf);
+	case DT_ImplementationName:
+	    buf = readString(&name, buf);
 	    break;
-	  case DT_ImplementationVersion:
-	    buf = readString(&version,buf);
+	case DT_ImplementationVersion:
+	    buf = readString(&version, buf);
 	    break;
-	  case DT_ReferenceID:
-	    buf = readAny(&refID,buf);
+	case DT_ReferenceID:
+	    buf = readAny(&refID, buf);
 	    break;
-	  default:
+	default:
 	    freeBitMap(versionBM);
 	    freeBitMap(optionsBM);
 	    s_free(auth);
@@ -575,123 +590,150 @@ readInitResponseAPDU(InitResponseAPDU** init, char* buffer)
 	    freeAny(refID);
 	    REPORT_READ_ERROR(buf);
 	    break;
-	  }
+	}
     }
 
-  buf = readInitResponseInfo(&userInfo,buf);
-  if (buf == NULL)
-    { freeBitMap(versionBM);
-      freeBitMap(optionsBM);
-      s_free(auth);
-      s_free(id);
-      s_free(name);
-      s_free(version);
-      freeAny(refID);
+    buf = readInitResponseInfo(&userInfo, buf);
+    if (buf == NULL) {
+	freeBitMap(versionBM);
+	freeBitMap(optionsBM);
+	s_free(auth);
+	s_free(id);
+	s_free(name);
+	s_free(version);
+	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);
-  s_free(id);
-  s_free(name);
-  s_free(version);
-  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);
+    s_free(id);
+    s_free(name);
+    s_free(version);
+    freeAny(refID);
 
-  return(buf);
+    return (buf);
 }
 
 /*----------------------------------------------------------------------*/
 
-InitResponseAPDU*
-replyToInitAPDU(InitAPDU* init, boolean result, void* userInfo)
+InitResponseAPDU *replyToInitAPDU(InitAPDU * init, boolean result, void *userInfo)
 /* respond to an init message in the default way - echoing back
    the init info
  */
 {
-  InitResponseAPDU* initResp;
-  initResp = makeInitResponseAPDU(result,
-				  init->willSearch,init->willPresent,init->willDelete,
-				  init->supportAccessControl,init->supportResourceControl,
-				  init->PreferredMessageSize,init->MaximumRecordSize,
-				  init->IDAuthentication,defaultImplementationID(),defaultImplementationName(),
-				  defaultImplementationVersion(),
-				  init->ReferenceID,userInfo);
-  return(initResp);
-}
-
-/*----------------------------------------------------------------------*/
-
-SearchAPDU*
-makeSearchAPDU(
-long small,
-long large,
-long medium,
-boolean replace,
-char* name,
-char** databases,
-char* type,
-char** elements,
-any* refID,
-void* queryInfo)
-{
-  char* ptr = NULL;
-  long i;
-  SearchAPDU* query = (SearchAPDU*)s_malloc((size_t)sizeof(SearchAPDU));
-  query->PDUType = searchAPDU;
-  query->SmallSetUpperBound = small;
-  query->LargeSetLowerBound = large;
-  query->MediumSetPresentNumber = medium;
-  query->ReplaceIndicator = replace;
-  query->ResultSetName = s_strdup(name);
-  query->DatabaseNames = NULL;
-  if (databases != NULL) {
-    for (i = 0, ptr = databases[i]; ptr != NULL; ptr = databases[++i]) {
-	if (query->DatabaseNames == NULL)
-	    query->DatabaseNames = (char**)s_malloc((size_t)(sizeof(char*) * 2));
-        else
-          query->DatabaseNames = (char**)s_realloc((char*)query->DatabaseNames,
-						   (size_t)(sizeof(char*) * (i + 2)));
+    InitResponseAPDU *initResp;
+
+    initResp = makeInitResponseAPDU(result,
+				    init->willSearch,
+				    init->willPresent,
+				    init->willDelete,
+				    init->supportAccessControl,
+				    init->supportResourceControl,
+				    init->PreferredMessageSize,
+				    init->MaximumRecordSize,
+				    init->IDAuthentication,
+				    defaultImplementationID(),
+				    defaultImplementationName(),
+				    defaultImplementationVersion(),
+				    init->ReferenceID,
+				    userInfo);
+    return (initResp);
+}
+
+/*----------------------------------------------------------------------*/
+
+SearchAPDU *makeSearchAPDU(long small,
+			   long large,
+			   long medium,
+			   boolean replace,
+			   char *name,
+			   char **databases,
+			   char *type,
+			   char **elements,
+			   any *refID,
+			   void *queryInfo)
+{
+    char *ptr = NULL;
+    long i;
+    SearchAPDU *query = (SearchAPDU *) s_malloc((size_t) sizeof(SearchAPDU));
+
+    query->PDUType = searchAPDU;
+    query->SmallSetUpperBound = small;
+    query->LargeSetLowerBound = large;
+    query->MediumSetPresentNumber = medium;
+    query->ReplaceIndicator = replace;
+    query->ResultSetName = s_strdup(name);
+    query->DatabaseNames = NULL;
+    if (databases != NULL) {
+	for (i = 0, ptr = databases[i]; ptr != NULL; ptr = databases[++i]) {
+	    if (query->DatabaseNames == NULL)
+		query->DatabaseNames = (char **) s_malloc((size_t) (sizeof(char
+									   *)
+								    * 2));
+
+	    else
+		query->DatabaseNames = (char **) s_realloc((char *) query->DatabaseNames,
+							   (size_t) (sizeof(char
+									    *) *
+								       (i + 2)));
+
 	    query->DatabaseNames[i] = s_strdup(ptr);
-	    query->DatabaseNames[i+1] = NULL;
+	    query->DatabaseNames[i + 1] = NULL;
 	}
     }
-  query->QueryType = s_strdup(type);
-  query->ElementSetNames = NULL;
-  if (elements != NULL) {
-    for (i = 0, ptr = elements[i]; ptr != NULL; ptr = elements[++i]) {
-	if (query->ElementSetNames == NULL)
-	    query->ElementSetNames = (char**)s_malloc((size_t)(sizeof(char*) * 2));
-        else
-          query->ElementSetNames = (char**)s_realloc((char*)query->ElementSetNames,
-						     (size_t)(sizeof(char*) * (i + 2)));
+    query->QueryType = s_strdup(type);
+    query->ElementSetNames = NULL;
+    if (elements != NULL) {
+	for (i = 0, ptr = elements[i]; ptr != NULL; ptr = elements[++i]) {
+	    if (query->ElementSetNames == NULL)
+		query->ElementSetNames =
+		    (char **) s_malloc((size_t) (sizeof(char *) * 2));
+
+	    else
+		query->ElementSetNames = (char **) s_realloc((char *) query->ElementSetNames,
+							     (size_t) (sizeof(char
+									      *) *
+								         (i + 2)));
+
 	    query->ElementSetNames[i] = s_strdup(ptr);
-	    query->ElementSetNames[i+1] = NULL;
-	  }
-      }
-  query->ReferenceID = duplicateAny(refID);
-  query->Query = queryInfo;	/* not copied! */
-  return(query);
+	    query->ElementSetNames[i + 1] = NULL;
+	}
+    }
+    query->ReferenceID = duplicateAny(refID);
+    query->Query = queryInfo;	/* not copied! */
+    return (query);
 }
 
 /*----------------------------------------------------------------------*/
 
-void
-freeSearchAPDU(SearchAPDU* query)
+void freeSearchAPDU(SearchAPDU *query)
 {
-  s_free(query->ResultSetName);
-  s_free(query->QueryType);
-  doList((void**)query->DatabaseNames,fs_free); /* can't use the macro here ! */
-  s_free(query->DatabaseNames);
-  doList((void**)query->ElementSetNames,fs_free); /* can't use the macro here ! */
-  s_free(query->ElementSetNames);
-  freeAny(query->ReferenceID);
-  s_free(query);
+    s_free(query->ResultSetName);
+    s_free(query->QueryType);
+    doList((void **) query->DatabaseNames, fs_free);	/* can't use the macro here ! */
+    s_free(query->DatabaseNames);
+    doList((void **) query->ElementSetNames, fs_free);	/* can't use the macro here ! */
+    s_free(query->ElementSetNames);
+    freeAny(query->ReferenceID);
+    s_free(query);
 }
 
 /*----------------------------------------------------------------------*/
@@ -700,224 +742,262 @@ freeSearchAPDU(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*
-writeSearchAPDU(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);
-  buf = writeBinaryInteger(query->MediumSetPresentNumber,(size_t)3,buf,len);
-  buf = writeBoolean(query->ReplaceIndicator,buf,len);
-  buf = writeString(query->ResultSetName,DT_ResultSetName,buf,len);
-  /* write database names */
-  if (query->DatabaseNames != NULL) {
-    for (i = 0,scratch = NULL, ptr = query->DatabaseNames[i]; ptr != NULL; ptr = query->DatabaseNames[++i]) {
-	if (scratch == NULL)
-	    scratch = s_strdup(ptr);
-        else
-	  { size_t newScratchSize = (size_t)(strlen(scratch) + strlen(ptr) + 2);
-	    scratch = (char*)s_realloc(scratch,newScratchSize);
-	    s_strncat(scratch,DB_DELIMITER,2,newScratchSize);
-	    s_strncat(scratch,ptr,strlen(ptr) + 1,newScratchSize);
-	  }
+char *writeSearchAPDU(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);
+    buf = writeBinaryInteger(query->MediumSetPresentNumber, (size_t) 3, buf, len);
+    buf = writeBoolean(query->ReplaceIndicator, buf, len);
+    buf = writeString(query->ResultSetName, DT_ResultSetName, buf, len);
+    /* write database names */
+    if (query->DatabaseNames != NULL) {
+	for (i = 0, scratch = NULL, ptr = query->DatabaseNames[i]; ptr != NULL;
+	     ptr = query->DatabaseNames[++i]) {
+	    if (scratch == NULL)
+		scratch = s_strdup(ptr);
+	    else {
+		size_t newScratchSize = (size_t) (strlen(scratch) +
+						  strlen(ptr) + 2);
+
+		scratch = (char *) s_realloc(scratch, newScratchSize);
+		s_strncat(scratch, DB_DELIMITER, 2, newScratchSize);
+		s_strncat(scratch, ptr, strlen(ptr) + 1, newScratchSize);
+	    }
 	}
-	buf = writeString(scratch,DT_DatabaseNames,buf,len);
+	buf = writeString(scratch, DT_DatabaseNames, buf, len);
 	s_free(scratch);
-      }
-  buf = writeString(query->QueryType,DT_QueryType,buf,len);
-  /* write element set names */
-  if (query->ElementSetNames != NULL) {
-    for (i = 0,scratch = NULL, ptr = query->ElementSetNames[i]; ptr != NULL; ptr = query->ElementSetNames[++i]) {
-	if (scratch == NULL) {
-	    if (query->ElementSetNames[i+1] == NULL) /* there is a single element set name */
-		{ scratch = (char*)s_malloc((size_t)strlen(ptr) + 2);
-		  strncpy(scratch,ES_DELIMITER_1,2);
-		  s_strncat(scratch,ptr,strlen(ptr) + 1,strlen(ptr) + 2);
+    }
+    buf = writeString(query->QueryType, DT_QueryType, buf, len);
+    /* write element set names */
+    if (query->ElementSetNames != NULL) {
+	for (i = 0, scratch = NULL, ptr = query->ElementSetNames[i];
+	     ptr != NULL;
+	     ptr = query->ElementSetNames[++i]) {
+	    if (scratch == NULL) {
+		if (query->ElementSetNames[i + 1] == NULL)	/* there is a single element set name */
+		{
+		    scratch = (char *) s_malloc((size_t) strlen(ptr) + 2);
+		    strncpy(scratch, ES_DELIMITER_1, 2);
+		    s_strncat(scratch, ptr, strlen(ptr) + 1, strlen(ptr) + 2);
+		} else {	/* this is the first of a series of element set names */
+		    size_t newScratchSize = (size_t) (strlen(ptr) +
+						      strlen(query->ElementSetNames[i
+										    + 1])
+						      + 2);
+
+		    scratch = s_strdup(ptr);	/* the database name */
+		    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);
 		}
-	    else		/* this is the first of a series of element set names */
-	      { size_t newScratchSize = (size_t)(strlen(ptr) + strlen(query->ElementSetNames[i + 1]) + 2);
-		scratch = s_strdup(ptr); /* the database name */
-		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);
-	      }
-	  }
-        else
-	  { char* esPtr = query->ElementSetNames[++i]; /* the element set name */
-	    size_t newScratchSize = (size_t)(strlen(scratch) + strlen(ptr) + strlen(esPtr) + 3);
-	    scratch = (char*)s_realloc(scratch,newScratchSize);
-	    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);
-	  }
-	  }
-	buf = writeString(scratch,DT_ElementSetNames,buf,len);
+	    } else {
+		char *esPtr = query->ElementSetNames[++i];	/* the element set name */
+		size_t newScratchSize = (size_t) (strlen(scratch) +
+						  strlen(ptr) +
+						  strlen(esPtr) +
+						  3);
+
+		scratch = (char *) s_realloc(scratch, newScratchSize);
+		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);
+	    }
+	}
+	buf = writeString(scratch, DT_ElementSetNames, buf, len);
 	s_free(scratch);
-      }
-  buf = writeAny(query->ReferenceID,DT_ReferenceID,buf,len);
+    }
+    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;
-  writeBinaryInteger(size,HEADER_LEN,buffer,len);
+    /* go back and write the header-length-indicator */
+    RELEASE_HEADER_SPACE(len);
+    size = buf - buffer - HEADER_LEN;
+    writeBinaryInteger(size, HEADER_LEN, buffer, len);
 
-  if (query->Query != NULL)
-    buf = writeSearchInfo(query,buf,len);
+    if (query->Query != NULL)
+	buf = writeSearchInfo(query, buf, len);
 
-  return(buf);
+    return (buf);
 }
 
 /*----------------------------------------------------------------------*/
 
-SearchResponseAPDU*
-makeSearchResponseAPDU(
-long result,
-long count,
-long recordsReturned,
-long nextPos,
-long resultStatus,
-long presentStatus,
-any* refID,
-void* records)
+SearchResponseAPDU *makeSearchResponseAPDU(long result,
+					   long count,
+					   long recordsReturned,
+					   long nextPos,
+					   long resultStatus,
+					   long presentStatus,
+					   any *refID,
+					   void *records)
 {
-  SearchResponseAPDU* query = (SearchResponseAPDU*)s_malloc((size_t)sizeof(SearchResponseAPDU));
-  query->PDUType = searchResponseAPDU;
-  query->SearchStatus = result;
-  query->ResultCount = count;
-  query->NumberOfRecordsReturned = recordsReturned;
-  query->NextResultSetPosition = nextPos;
-  query->ResultSetStatus = resultStatus;
-  query->PresentStatus = presentStatus;
-  query->ReferenceID = duplicateAny(refID);
-  query->DatabaseDiagnosticRecords = records;
-  return(query);
+    SearchResponseAPDU *query =
+    (SearchResponseAPDU *) s_malloc((size_t) sizeof(SearchResponseAPDU));
+
+    query->PDUType = searchResponseAPDU;
+    query->SearchStatus = result;
+    query->ResultCount = count;
+    query->NumberOfRecordsReturned = recordsReturned;
+    query->NextResultSetPosition = nextPos;
+    query->ResultSetStatus = resultStatus;
+    query->PresentStatus = presentStatus;
+    query->ReferenceID = duplicateAny(refID);
+    query->DatabaseDiagnosticRecords = records;
+    return (query);
 }
 
 /*----------------------------------------------------------------------*/
 
-void
-freeSearchResponseAPDU(SearchResponseAPDU* queryResponse)
+void freeSearchResponseAPDU(SearchResponseAPDU *queryResponse)
 {
-  freeAny(queryResponse->ReferenceID);
-  s_free(queryResponse);
+    freeAny(queryResponse->ReferenceID);
+    s_free(queryResponse);
 }
 
 /*----------------------------------------------------------------------*/
 
-char*
-writeSearchResponseAPDU(SearchResponseAPDU* queryResponse, char* buffer, long* len)
+char *writeSearchResponseAPDU(SearchResponseAPDU *queryResponse, char *buffer,
+			      long *len)
 {
-  char* buf = buffer + HEADER_LEN; /* leave room for the header-length-indicator */
-  long size;
+    char *buf = buffer + HEADER_LEN;	/* leave room for the header-length-indicator */
+    long size;
 
-  RESERVE_SPACE_FOR_HEADER(len);
+    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);
-  buf = writeBinaryInteger(queryResponse->NumberOfRecordsReturned,(size_t)3,buf,len);
-  buf = writeBinaryInteger(queryResponse->NextResultSetPosition,(size_t)3,buf,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);
+    buf = writePDUType(queryResponse->PDUType,
+		       buf,
+		       len);
+    buf = writeBinaryInteger(queryResponse->SearchStatus,
+			     (size_t) 1,
+			     buf,
+			     len);
+    buf = writeBinaryInteger(queryResponse->ResultCount,
+			     (size_t) 3,
+			     buf,
+			     len);
+    buf = writeBinaryInteger(queryResponse->NumberOfRecordsReturned,
+			     (size_t) 3,
+			     buf,
+			     len);
+    buf = writeBinaryInteger(queryResponse->NextResultSetPosition,
+			     (size_t) 3,
+			     buf,
+			     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;
-  writeBinaryInteger(size,HEADER_LEN,buffer,len);
+    /* go back and write the header-length-indicator */
+    RELEASE_HEADER_SPACE(len);
+    size = buf - buffer - HEADER_LEN;
+    writeBinaryInteger(size, HEADER_LEN, buffer, len);
 
-  if (queryResponse->DatabaseDiagnosticRecords != NULL)
-    buf = writeSearchResponseInfo(queryResponse,buf,len);
+    if (queryResponse->DatabaseDiagnosticRecords != NULL)
+	buf = writeSearchResponseInfo(queryResponse, buf, len);
 
-  return(buf);
+    return (buf);
 }
 
 /*----------------------------------------------------------------------*/
 
-char*
-readSearchResponseAPDU(SearchResponseAPDU** queryResponse, char* buffer)
+char *readSearchResponseAPDU(SearchResponseAPDU **queryResponse, char *buffer)
 {
-  char* buf = buffer;
-  long size;
-  pdu_type pduType;
-  long result,count,recordsReturned,nextPos;
-  long resultStatus,presentStatus;
-  any *refID = NULL;
-  void* userInfo = NULL;
-
-  /* read required part */
-  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;
+    char *buf = buffer;
+    long size;
+    pdu_type pduType;
+    long result, count, recordsReturned, nextPos;
+    long resultStatus, presentStatus;
+    any *refID = NULL;
+    void *userInfo = NULL;
 
-  /* read optional part */
-  while (buf < (buffer + size + HEADER_LEN))
-    { data_tag tag = peekTag(buf);
-      switch (tag)
-	{ case DT_ResultSetStatus:
-	    buf = readNum(&resultStatus,buf);
+    /* read required part */
+    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)) {
+	data_tag tag = peekTag(buf);
+
+	switch (tag) {
+	case DT_ResultSetStatus:
+	    buf = readNum(&resultStatus, buf);
 	    break;
-	  case DT_PresentStatus:
-	    buf = readNum(&presentStatus,buf);
+	case DT_PresentStatus:
+	    buf = readNum(&presentStatus, buf);
 	    break;
-	  case DT_ReferenceID:
-	    buf = readAny(&refID,buf);
+	case DT_ReferenceID:
+	    buf = readAny(&refID, buf);
 	    break;
-	  default:
+	default:
 	    freeAny(refID);
 	    REPORT_READ_ERROR(buf);
 	    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);
+    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);
+    freeAny(refID);
 
-  return(buf);
+    return (buf);
 }
 
-
 /*
-**	Routines originally from ZUtil.c -- FM
-**
-**----------------------------------------------------------------------*/
+ *	Routines originally from ZUtil.c -- FM
+ *
+ *----------------------------------------------------------------------*/
 /* WIDE AREA INFORMATION SERVER SOFTWARE:
-   No guarantees or restrictions.  See the readme file for the full standard
-   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
-		- writeCompressedIntegerWithPadding() to
-		  writeCompressedIntWithPadding()
-		- generalized conditional includes (see c-dialect.h)
-   3.7.91   Jonny Goldman.  Replaced "short" in makeBitMap with "int" line 632.
-*/
+ * No guarantees or restrictions.  See the readme file for the full standard
+ * 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
+ *		- writeCompressedIntegerWithPadding() to
+ *		  writeCompressedIntWithPadding()
+ *		- generalized conditional includes (see c-dialect.h)
+ * 3.7.91   Jonny Goldman.  Replaced "short" in makeBitMap with "int" line 632.
+ */
 
-char* readErrorPosition = NULL; /* pos where buf stoped making sense */
+char *readErrorPosition = NULL;	/* pos where buf stoped making sense */
 
 /*----------------------------------------------------------------------*/
 /* A note on error handling
@@ -935,118 +1015,113 @@ char* readErrorPosition = NULL; /* pos where buf stoped making sense */
  */
 /*----------------------------------------------------------------------*/
 
-diagnosticRecord*
-makeDiag(boolean surrogate, char* code, char* addInfo)
+diagnosticRecord *makeDiag(boolean surrogate, char *code, char *addInfo)
 {
-  diagnosticRecord* diag =
-    (diagnosticRecord*)s_malloc((size_t)sizeof(diagnosticRecord));
+    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->SURROGATE = surrogate;
+    memcpy(diag->DIAG, code, DIAGNOSTIC_CODE_SIZE);
+    diag->ADDINFO = s_strdup(addInfo);
 
-  return(diag);
+    return (diag);
 }
 
 /*----------------------------------------------------------------------*/
 
-void
-freeDiag(diagnosticRecord* diag)
+void freeDiag(diagnosticRecord * diag)
 {
-  if (diag != NULL) {
-    if (diag->ADDINFO != NULL)
-	s_free(diag->ADDINFO);
-    s_free(diag);
-  }
+    if (diag != NULL) {
+	if (diag->ADDINFO != NULL)
+	    s_free(diag->ADDINFO);
+	s_free(diag);
+    }
 }
 
 /*----------------------------------------------------------------------*/
 
 #define END_OF_RECORD	0x1D
 
-char*
-writeDiag(diagnosticRecord* diag, char* buffer, long* len)
+char *writeDiag(diagnosticRecord * diag, char *buffer, long *len)
 /* diagnostics (as per Appendix D) have a very weird format - this changes
    in SR-1
  */
 {
-  char* buf = buffer;
-  long  length;
+    char *buf = buffer;
+    long length;
 
-  if (diag == NULL)		/* handle unspecified optional args */
-    return(buf);
+    if (diag == NULL)		/* handle unspecified optional args */
+	return (buf);
 
-  buf = writeTag(DT_DatabaseDiagnosticRecords,buf,len);
-  CHECK_FOR_SPACE_LEFT(0,len);
+    buf = writeTag(DT_DatabaseDiagnosticRecords, buf, len);
+    CHECK_FOR_SPACE_LEFT(0, len);
 
-  length = 3;
-  if (diag->ADDINFO != NULL)
-    length += strlen(diag->ADDINFO);
+    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';
+    if (length >= 0xFFFF)	/* make sure the length is reasonable */
+    {
+	length = 0xFFFF - 1;
+	diag->ADDINFO[0xFFFF - 3 - 1] = '\0';
     }
 
-  buf = writeBinaryInteger(length,2,buf,len);
+    buf = writeBinaryInteger(length, 2, buf, len);
 
-  CHECK_FOR_SPACE_LEFT(1,len);
-  buf[0] = diag->DIAG[0];
-  buf++;
+    CHECK_FOR_SPACE_LEFT(1, len);
+    buf[0] = diag->DIAG[0];
+    buf++;
 
-  CHECK_FOR_SPACE_LEFT(1,len);
-  buf[0] = diag->DIAG[1];
-  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;
+    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] = diag->SURROGATE;
+    buf++;
 
-  CHECK_FOR_SPACE_LEFT(1,len);
-  buf[0] = END_OF_RECORD;
-  buf++;
+    CHECK_FOR_SPACE_LEFT(1, len);
+    buf[0] = END_OF_RECORD;
+    buf++;
 
-  return(buf);
+    return (buf);
 }
 
 /*----------------------------------------------------------------------*/
 
-char*
-readDiag(diagnosticRecord** diag, char* buffer)
+char *readDiag(diagnosticRecord ** diag, char *buffer)
 {
-  char* buf = buffer;
-  diagnosticRecord* d
-    = (diagnosticRecord*)s_malloc((size_t)sizeof(diagnosticRecord));
-  data_tag tag;
-  long len;
+    char *buf = buffer;
+    diagnosticRecord *d = (diagnosticRecord *) s_malloc((size_t) sizeof(diagnosticRecord));
+    data_tag tag;
+    long len;
 
-  buf = readTag(&tag,buf);
+    buf = readTag(&tag, buf);
 
-  buf = readBinaryInteger(&len,2,buf);
+    buf = readBinaryInteger(&len, 2, buf);
 
-  d->DIAG[0] = buf[0];
-  d->DIAG[1] = buf[1];
-  d->DIAG[2] = '\0';
+    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));
-      d->ADDINFO[len - 3] = '\0';
-    }
-  else
-    d->ADDINFO = NULL;
+    if (len > 3) {
+	d->ADDINFO = (char *) s_malloc((size_t) (len - 3 + 1));
+	memcpy(d->ADDINFO, (char *) (buf + 2), (size_t) (len - 3));
+	d->ADDINFO[len - 3] = '\0';
+    } else
+	d->ADDINFO = NULL;
 
-  d->SURROGATE = buf[len - 1];
+    d->SURROGATE = buf[len - 1];
 
-  *diag = d;
+    *diag = d;
 
-  return(buf + len + 1);
+    return (buf + len + 1);
 }
 
 /*----------------------------------------------------------------------*/
@@ -1055,417 +1130,404 @@ readDiag(diagnosticRecord** diag, char* buffer)
 #define dataMask	0x7F
 #define dataBits	7
 
-char*
-writeCompressedInteger(unsigned long num, char* buf, long* len)
+char *writeCompressedInteger(unsigned long num, char *buf, long *len)
 /* write a binary integer in the format described on p. 40.
    this might be sped up
 */
 {
-  char byte;
-  unsigned long i;
-  unsigned long size;
+    char byte;
+    unsigned long i;
+    unsigned long size;
 
-  size = writtenCompressedIntSize(num);
-  CHECK_FOR_SPACE_LEFT(size,len);
+    size = writtenCompressedIntSize(num);
+    CHECK_FOR_SPACE_LEFT(size, len);
 
-  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 */
+    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);
+    return (buf + size);
 }
 
 /*----------------------------------------------------------------------*/
 
-char*
-readCompressedInteger(unsigned long *num, char* buf)
+char *readCompressedInteger(unsigned long *num, char *buf)
 /* read a binary integer in the format described on p. 40.
    this might be sped up
 */
 {
-  long i = 0;
-  unsigned char byte;
+    long i = 0;
+    unsigned char byte;
 
-  *num = 0;
+    *num = 0;
 
-  do
-    { byte = buf[i++];
-      *num = *num << dataBits;
-      *num += (byte & dataMask);
+    do {
+	byte = buf[i++];
+	*num = *num << dataBits;
+	*num += (byte & dataMask);
     }
-  while (byte & continueBit);
+    while (byte & continueBit);
 
-  return(buf + i);
+    return (buf + i);
 }
 
 /*----------------------------------------------------------------------*/
 
-#define pad	128 /* high bit is set */
+#define pad	128		/* high bit is set */
 
-char*
-writeCompressedIntWithPadding(
-unsigned long num,
-unsigned long size,
-char* buffer,
-long* len)
+char *writeCompressedIntWithPadding(unsigned long num,
+				    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
    readCompressedInteger()
 */
 {
-  char* buf = buffer;
-  unsigned long needed,padding;
-  long i;
+    char *buf = buffer;
+    unsigned long needed, padding;
+    long i;
 
-  CHECK_FOR_SPACE_LEFT(size,len);
+    CHECK_FOR_SPACE_LEFT(size, len);
 
-  needed = writtenCompressedIntSize(num);
-  padding = size - needed;
-  i = padding - 1;
+    needed = writtenCompressedIntSize(num);
+    padding = size - needed;
+    i = padding - 1;
 
-  for (i = padding - 1;i >= 0;i--)
-    { buf[i] = pad;
+    for (i = padding - 1; i >= 0; i--) {
+	buf[i] = pad;
     }
 
-  buf = writeCompressedInteger(num,buf + padding,len);
+    buf = writeCompressedInteger(num, buf + padding, len);
 
-  return(buf);
+    return (buf);
 }
 
 /*----------------------------------------------------------------------*/
 
-unsigned long
-writtenCompressedIntSize(unsigned long num)
+unsigned long writtenCompressedIntSize(unsigned long num)
 /* return the number of bytes needed to represnet the value num in
    compressed format.  curently limited to 4 bytes
  */
 {
-  if (num < CompressedInt1Byte)
-    return(1);
-  else if (num < CompressedInt2Byte)
-    return(2);
-  else if (num < CompressedInt3Byte)
-    return(3);
-  else
-    return(4);
+    if (num < CompressedInt1Byte)
+	return (1);
+    else if (num < CompressedInt2Byte)
+	return (2);
+    else if (num < CompressedInt3Byte)
+	return (3);
+    else
+	return (4);
 }
 
 /*----------------------------------------------------------------------*/
 
-char*
-writeTag(data_tag tag, char* buf, long* len)
+char *writeTag(data_tag tag, char *buf, long *len)
 /* write out a data tag */
 {
-  return(writeCompressedInteger(tag,buf,len));
+    return (writeCompressedInteger(tag, buf, len));
 }
 
 /*----------------------------------------------------------------------*/
 
-char*
-readTag(data_tag* tag, char* buf)
+char *readTag(data_tag *tag, char *buf)
 /* read a data tag */
 {
-  return(readCompressedInteger(tag,buf));
+    return (readCompressedInteger(tag, buf));
 }
 
 /*----------------------------------------------------------------------*/
 
-unsigned long
-writtenTagSize(data_tag tag)
+unsigned long writtenTagSize(data_tag tag)
 {
-  return(writtenCompressedIntSize(tag));
+    return (writtenCompressedIntSize(tag));
 }
 
 /*----------------------------------------------------------------------*/
 
-data_tag
-peekTag(char* buf)
+data_tag peekTag(char *buf)
 /* read a data tag without advancing the buffer */
 {
-  data_tag tag;
-  readTag(&tag,buf);
-  return(tag);
+    data_tag tag;
+
+    readTag(&tag, buf);
+    return (tag);
 }
 
 /*----------------------------------------------------------------------*/
 
-any*
-makeAny(unsigned long size, char* data)
+any *makeAny(unsigned long size, char *data)
 {
-  any* a = (any*)s_malloc((size_t)sizeof(any));
-  a->size = size;
-  a->bytes = data;
-  return(a);
+    any *a = (any *) s_malloc((size_t) sizeof(any));
+
+    a->size = size;
+    a->bytes = data;
+    return (a);
 }
 
 /*----------------------------------------------------------------------*/
 
-void
-freeAny(any* a)
+void freeAny(any *a)
 /* destroy an any and its associated data.  Assumes a->bytes was
    allocated using the s_malloc family of libraries
  */
 {
-  if (a != NULL)
-    { if (a->bytes != NULL)
-	s_free(a->bytes);
-      s_free(a);
+    if (a != NULL) {
+	if (a->bytes != NULL)
+	    s_free(a->bytes);
+	s_free(a);
     }
 }
 
 /*----------------------------------------------------------------------*/
 
-any*
-duplicateAny(any* a)
+any *duplicateAny(any *a)
 {
-  any* copy = NULL;
+    any *copy = NULL;
 
-  if (a == NULL)
-    return(NULL);
+    if (a == NULL)
+	return (NULL);
 
-  copy = (any*)s_malloc((size_t)sizeof(any));
-  copy->size = a->size;
-  if (a->bytes == NULL)
-    copy->bytes = NULL;
-  else
-    { copy->bytes = (char*)s_malloc((size_t)copy->size);
-      memcpy(copy->bytes,a->bytes,(size_t)copy->size);
+    copy = (any *) s_malloc((size_t) sizeof(any));
+
+    copy->size = a->size;
+    if (a->bytes == NULL)
+	copy->bytes = NULL;
+    else {
+	copy->bytes = (char *) s_malloc((size_t) copy->size);
+	memcpy(copy->bytes, a->bytes, (size_t) copy->size);
     }
-  return(copy);
+    return (copy);
 }
 
 /*----------------------------------------------------------------------*/
 
-char*
-writeAny(any* a, data_tag tag, char* buffer, long* len)
+char *writeAny(any *a, data_tag tag, char *buffer, long *len)
 /* write an any + tag and size info */
 {
-  char* buf = buffer;
+    char *buf = buffer;
 
-  if (a == NULL)		/* handle unspecified optional args */
-    return(buf);
+    if (a == NULL)		/* handle unspecified optional args */
+	return (buf);
 
-  /* write the tags */
-  buf = writeTag(tag,buf,len);
-  buf = writeCompressedInteger(a->size,buf,len);
+    /* write the tags */
+    buf = writeTag(tag, buf, len);
+    buf = writeCompressedInteger(a->size, buf, len);
 
-  /* write the bytes */
-  CHECK_FOR_SPACE_LEFT(a->size,len);
-  memcpy(buf,a->bytes,(size_t)a->size);
+    /* write the bytes */
+    CHECK_FOR_SPACE_LEFT(a->size, len);
+    memcpy(buf, a->bytes, (size_t) a->size);
 
-  return(buf+a->size);
+    return (buf + a->size);
 }
 
 /*----------------------------------------------------------------------*/
 
-
-char *readAny(any** anAny, char* buffer)
+char *readAny(any **anAny, char *buffer)
 /* read an any + tag and size info */
 {
-  char *buf;
-  any* a;
-  data_tag tag;
+    char *buf;
+    any *a;
+    data_tag tag;
 
+    a = (any *) s_malloc((size_t) sizeof(any));
 
+    buf = buffer;
 
-a=(any*)s_malloc((size_t)sizeof(any));
+    buf = readTag(&tag, buf);
 
-  buf=buffer;
+    buf = readCompressedInteger(&a->size, buf);
 
-  buf = readTag(&tag,buf);
+    /* now simply copy the bytes */
+    a->bytes = (char *) s_malloc((size_t) a->size);
+    memcpy(a->bytes, buf, (size_t) a->size);
+    *anAny = a;
 
-  buf = readCompressedInteger(&a->size,buf);
-
-  /* now simply copy the bytes */
-  a->bytes = (char*)s_malloc((size_t)a->size);
-  memcpy(a->bytes,buf,(size_t)a->size);
-  *anAny = a;
-
-  return(buf+a->size);
+    return (buf + a->size);
 }
 
 /*----------------------------------------------------------------------*/
 
-unsigned long
-writtenAnySize(data_tag tag, any* a)
+unsigned long writtenAnySize(data_tag tag, any *a)
 {
-  unsigned long size;
+    unsigned long size;
 
-  if (a == NULL)
-    return(0);
+    if (a == NULL)
+	return (0);
 
-  size = writtenTagSize(tag);
-  size += writtenCompressedIntSize(a->size);
-  size += a->size;
-  return(size);
+    size = writtenTagSize(tag);
+    size += writtenCompressedIntSize(a->size);
+    size += a->size;
+    return (size);
 }
 
 /*----------------------------------------------------------------------*/
 
-any*
-stringToAny(char* s)
+any *stringToAny(char *s)
 {
-  any* a = NULL;
+    any *a = NULL;
 
-  if (s == NULL)
-    return(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);
-  memcpy(a->bytes,s,(size_t)a->size);
-  return(a);
+    a = (any *) s_malloc((size_t) sizeof(any));
+
+    a->size = strlen(s);
+    a->bytes = (char *) s_malloc((size_t) a->size);
+    memcpy(a->bytes, s, (size_t) a->size);
+    return (a);
 }
 
 /*----------------------------------------------------------------------*/
 
-char*
-anyToString(any* a)
+char *anyToString(any *a)
 {
-  char* s = NULL;
+    char *s = NULL;
 
-  if (a == NULL)
-    return(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';
-  return(s);
+    s = s_malloc((size_t) (a->size + 1));
+    memcpy(s, a->bytes, (size_t) a->size);
+    s[a->size] = '\0';
+    return (s);
 }
 
 /*----------------------------------------------------------------------*/
 
-char*
-writeString(char* s, data_tag tag, char* buffer, long* len)
+char *writeString(char *s, data_tag tag, char *buffer, long *len)
 /* 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
    the place of an any.
  */
 {
-  char* buf = buffer;
-  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->size = strlen(s);
-  data->bytes = s;		/* save a copy here by not using stringToAny() */
-  buf = writeAny(data,tag,buf,len);
-  s_free(data);			/* don't use freeAny() since it will free s too */
-  return(buf);
+    char *buf = buffer;
+    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->size = strlen(s);
+    data->bytes = s;		/* save a copy here by not using stringToAny() */
+    buf = writeAny(data, tag, buf, len);
+    s_free(data);		/* don't use freeAny() since it will free s too */
+    return (buf);
 }
 
 /*----------------------------------------------------------------------*/
 
-char*
-readString(char** s, char* buffer)
+char *readString(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.
  */
 {
-  any* data = NULL;
-  char* buf = readAny(&data,buffer);
-  *s = anyToString(data);
-  freeAny(data);
-  return(buf);
+    any *data = NULL;
+    char *buf = readAny(&data, buffer);
+
+    *s = anyToString(data);
+    freeAny(data);
+    return (buf);
 }
 
 /*----------------------------------------------------------------------*/
 
-unsigned long
-writtenStringSize(data_tag tag, char* s)
+unsigned long writtenStringSize(data_tag tag, char *s)
 {
-  unsigned long size;
+    unsigned long size;
 
-  if (s == NULL)
-   return(0);
+    if (s == NULL)
+	return (0);
 
-  size = writtenTagSize(tag);
-  size += writtenCompressedIntSize(size);
-  size += strlen(s);
-  return(size);
+    size = writtenTagSize(tag);
+    size += writtenCompressedIntSize(size);
+    size += strlen(s);
+    return (size);
 }
 
 /*----------------------------------------------------------------------*/
 
-any*
-longToAny(long num)
+any *longToAny(long num)
 /* a convienience function */
 {
-  char s[40];
+    char s[40];
 
-  sprintf(s,"%ld",num);
+    sprintf(s, "%ld", num);
 
-  return(stringToAny(s));
+    return (stringToAny(s));
 }
 
 /*----------------------------------------------------------------------*/
 
-long
-anyToLong(any* a)
+long anyToLong(any *a)
 /* a convienience function */
 {
-  long num;
-  char* str = NULL;
-  str = anyToString(a);
-  sscanf(str,"%ld",&num);	/* could check the result and return
+    long num;
+    char *str = NULL;
+
+    str = anyToString(a);
+    sscanf(str, "%ld", &num);	/* could check the result and return
 				   an error */
-  s_free(str);
-  return(num);
+    s_free(str);
+    return (num);
 }
 
 /*----------------------------------------------------------------------*/
 
 #define bitsPerByte	8
 
-bit_map*
-makeBitMap(unsigned long numBits, ...)
+bit_map *makeBitMap(unsigned long numBits,...)
 /* construct and return a bitmap with numBits elements */
 {
-  va_list ap;
-  unsigned long i,j;
-  bit_map* bm = NULL;
-
-  LYva_start(ap,numBits);
-
-  bm = (bit_map*)s_malloc((size_t)sizeof(bit_map));
-  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);
-	      if (bit)
-	        { byte = byte | (1 << (bitsPerByte - j - 1));
-	        }
+    va_list ap;
+    unsigned long i, j;
+    bit_map *bm = NULL;
+
+    LYva_start(ap, numBits);
+
+    bm = (bit_map *) s_malloc((size_t) sizeof(bit_map));
+
+    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);
+
+		if (bit) {
+		    byte = byte | (1 << (bitsPerByte - j - 1));
+		}
 	    }
-	  }
-      bm->bytes[i] = byte;
+	}
+	bm->bytes[i] = byte;
     }
 
-  va_end(ap);
-  return(bm);
+    va_end(ap);
+    return (bm);
 }
 
-
 /*----------------------------------------------------------------------*/
 
-void
-freeBitMap(bit_map* bm)
+void freeBitMap(bit_map *bm)
 /* destroy a bit map created by makeBitMap() */
 {
-  s_free(bm->bytes);
-  s_free(bm);
+    s_free(bm->bytes);
+    s_free(bm);
 }
 
 /*----------------------------------------------------------------------*/
@@ -1475,386 +1537,367 @@ freeBitMap(bit_map* bm)
    Could do bounds checking.
  */
 
-boolean
-bitAtPos(unsigned long pos, bit_map* bm)
+boolean bitAtPos(unsigned long pos, bit_map *bm)
 {
-  if (pos > bm->size*bitsPerByte)
-    return false;
-  else
-    return((bm->bytes[(pos / bitsPerByte)] &
-	    (0x80>>(pos % bitsPerByte))) ?
-	   true : false);
+    if (pos > bm->size * bitsPerByte)
+	return false;
+    else
+	return ((bm->bytes[(pos / bitsPerByte)] &
+		 (0x80 >> (pos % bitsPerByte))) ?
+		true : false);
 }
 
 /*----------------------------------------------------------------------*/
 
-char*
-writeBitMap(bit_map* bm, data_tag tag, char* buffer, long* len)
+char *writeBitMap(bit_map *bm, data_tag tag, char *buffer, long *len)
 /* write a bitmap + type and size info */
 {
-  return(writeAny((any*)bm,tag,buffer,len));
+    return (writeAny((any *) bm, tag, buffer, len));
 }
 
 /*----------------------------------------------------------------------*/
 
-char*
-readBitMap(bit_map** bm, char* buffer)
+char *readBitMap(bit_map **bm, char *buffer)
 /* read a bitmap + type and size info */
 {
     char *c;
-    c = readAny((any**)bm,buffer);
-    return(c);
+
+    c = readAny((any **) bm, buffer);
+    return (c);
 }
 
 /*----------------------------------------------------------------------*/
 
-char*
-writeByte(unsigned long byte, char* buf, long* len)
+char *writeByte(unsigned long byte, char *buf, long *len)
 {
-  CHECK_FOR_SPACE_LEFT(1,len);
-  buf[0] = byte & 0xFF; /* we really only want the first byte */
-  return(buf + 1);
+    CHECK_FOR_SPACE_LEFT(1, len);
+    buf[0] = byte & 0xFF;	/* we really only want the first byte */
+    return (buf + 1);
 }
 
 /*----------------------------------------------------------------------*/
 
-char*
-readByte(unsigned char* byte, char* buf)
+char *readByte(unsigned char *byte, char *buf)
 {
-  *byte = buf[0];
-  return(buf + 1);
+    *byte = buf[0];
+    return (buf + 1);
 }
 
 /*----------------------------------------------------------------------*/
 
-char*
-writeBoolean(boolean flag, char* buf, long* len)
+char *writeBoolean(boolean flag, char *buf, long *len)
 {
-  return(writeByte(flag,buf,len));
+    return (writeByte(flag, buf, len));
 }
 
 /*----------------------------------------------------------------------*/
 
-char*
-readBoolean(boolean* flag, char* buffer)
+char *readBoolean(boolean *flag, char *buffer)
 {
-  unsigned char byte;
-  char* buf = readByte(&byte,buffer);
-  *flag = (byte == true) ? true : false;
-  return(buf);
+    unsigned char byte;
+    char *buf = readByte(&byte, buffer);
+
+    *flag = (byte == true) ? true : false;
+    return (buf);
 }
 
 /*----------------------------------------------------------------------*/
 
-char*
-writePDUType(pdu_type pduType, char* buf, long* len)
+char *writePDUType(pdu_type pduType, char *buf, long *len)
 /* PDUType is a single byte */
 {
-  return(writeBinaryInteger((long)pduType,(unsigned long)1,buf,len));
+    return (writeBinaryInteger((long) pduType, (unsigned long) 1, buf, len));
 }
 
 /*----------------------------------------------------------------------*/
 
-char*
-readPDUType(pdu_type* pduType, char* buf)
+char *readPDUType(pdu_type *pduType, char *buf)
 /* PDUType is a single byte */
 {
-  return(readBinaryInteger((long*)pduType,(unsigned long)1,buf));
+    return (readBinaryInteger((long *) pduType, (unsigned long) 1, buf));
 }
 
 /*----------------------------------------------------------------------*/
 
-pdu_type
-peekPDUType(char* buf)
+pdu_type peekPDUType(char *buf)
 /* 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
  */
 {
-  pdu_type pdu;
-  readPDUType(&pdu,buf + HEADER_LEN);
-  return(pdu);
+    pdu_type pdu;
+
+    readPDUType(&pdu, buf + HEADER_LEN);
+    return (pdu);
 }
 
 /*----------------------------------------------------------------------*/
 
-#define BINARY_INTEGER_BYTES	sizeof(long) /* the number of bytes used by
-						a "binary integer" */
-char*
-writeBinaryInteger(long num, unsigned long size, char* buf, long* len)
+#define BINARY_INTEGER_BYTES	sizeof(long)	/* the number of bytes used by
+						   a "binary integer" */
+char *writeBinaryInteger(long num, unsigned long size, char *buf, long *len)
 /* write out first size bytes of num - no type info
   XXX should this take unsigned longs instead ???  */
 {
-  long i;
-  char byte;
+    long i;
+    char byte;
 
-  if (size < 1 || size > BINARY_INTEGER_BYTES)
-    return(NULL);		/* error */
+    if (size < 1 || size > BINARY_INTEGER_BYTES)
+	return (NULL);		/* error */
 
-  CHECK_FOR_SPACE_LEFT(size,len);
+    CHECK_FOR_SPACE_LEFT(size, len);
 
-  for (i = size - 1; i >= 0; i--)
-    { byte = (char)(num & 255);
-      buf[i] = byte;
-      num = num >> bitsPerByte; /* don't and here */
+    for (i = size - 1; i >= 0; i--) {
+	byte = (char) (num & 255);
+	buf[i] = byte;
+	num = num >> bitsPerByte;	/* don't and here */
     }
 
-  return(buf + size);
+    return (buf + size);
 }
 
 /*----------------------------------------------------------------------*/
 
-char*
-readBinaryInteger(long* num, unsigned long size, char* buf)
+char *readBinaryInteger(long *num, unsigned long size, char *buf)
 /* read in first size bytes of num - no type info
   XXX this should take unsigned longs instead !!! */
 {
-  unsigned long i;
-  unsigned char byte;
+    unsigned long i;
+    unsigned char byte;
 
-  if (size < 1 || size > BINARY_INTEGER_BYTES)
-    return(buf);		/* error */
-  *num = 0;
+    if (size < 1 || size > BINARY_INTEGER_BYTES)
+	return (buf);		/* error */
+    *num = 0;
 
-  for (i = 0; i < size; i++)
-    { byte = buf[i];
-      *num = *num << bitsPerByte;
-      *num += byte;
+    for (i = 0; i < size; i++) {
+	byte = buf[i];
+	*num = *num << bitsPerByte;
+	*num += byte;
     }
 
-  return(buf + size);
+    return (buf + size);
 }
 
 /*----------------------------------------------------------------------*/
 
-unsigned long
-writtenCompressedBinIntSize(long num)
+unsigned long writtenCompressedBinIntSize(long num)
 /* return the number of bytes needed to represent the value num.
    currently limited to max of 4 bytes
    Only compresses for positive nums - negatives get whole 4 bytes
  */
 {
-  if (num < 0L)
-    return(4);
-  else if (num < 256L)		/* 2**8 */
-    return(1);
-  else if (num < 65536L)	/* 2**16 */
-    return(2);
-  else if (num < 16777216L)	/* 2**24 */
-    return(3);
-  else
-    return(4);
+    if (num < 0L)
+	return (4);
+    else if (num < 256L)	/* 2**8 */
+	return (1);
+    else if (num < 65536L)	/* 2**16 */
+	return (2);
+    else if (num < 16777216L)	/* 2**24 */
+	return (3);
+    else
+	return (4);
 }
 
 /*----------------------------------------------------------------------*/
 
-char*
-writeNum(long num, data_tag tag, char* buffer, long* len)
+char *writeNum(long num, data_tag tag, char *buffer, long *len)
 /* write a binary integer + size and tag info */
 {
-  char* buf = buffer;
-  long size = writtenCompressedBinIntSize(num);
+    char *buf = buffer;
+    long size = writtenCompressedBinIntSize(num);
 
-  if (num == UNUSED)
-    return(buffer);
+    if (num == UNUSED)
+	return (buffer);
 
-  buf = writeTag(tag,buf,len);
-  buf = writeCompressedInteger(size,buf,len);
-  buf = writeBinaryInteger(num,(unsigned long)size,buf,len);
-  return(buf);
+    buf = writeTag(tag, buf, len);
+    buf = writeCompressedInteger(size, buf, len);
+    buf = writeBinaryInteger(num, (unsigned long) size, buf, len);
+    return (buf);
 }
 
 /*----------------------------------------------------------------------*/
 
-char*
-readNum(long* num, char* buffer)
+char *readNum(long *num, char *buffer)
 /* read a binary integer + size and tag info */
 {
-  char* buf = buffer;
-  data_tag tag;
-  unsigned long size;
-  unsigned long val;
+    char *buf = buffer;
+    data_tag tag;
+    unsigned long size;
+    unsigned long val;
 
-  buf = readTag(&tag,buf);
-  buf = readCompressedInteger(&val,buf);
-  size = (unsigned long)val;
-  buf = readBinaryInteger(num,size,buf);
-  return(buf);
+    buf = readTag(&tag, buf);
+    buf = readCompressedInteger(&val, buf);
+    size = (unsigned long) val;
+    buf = readBinaryInteger(num, size, buf);
+    return (buf);
 }
 
 /*----------------------------------------------------------------------*/
 
-unsigned long
-writtenNumSize(data_tag tag, long num)
+unsigned long writtenNumSize(data_tag tag, long num)
 {
-  long dataSize = writtenCompressedBinIntSize(num);
-  long size;
+    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 */
+    size = writtenTagSize(tag);	/* space for the tag */
+    size += writtenCompressedIntSize(dataSize);		/* space for the size */
+    size += dataSize;		/* space for the data */
 
-  return(size);
+    return (size);
 }
 
 /*----------------------------------------------------------------------*/
 
-typedef void (voidfunc)(void *);
+typedef void (voidfunc) (void *);
 
-void
-doList(void** list, voidfunc *func)
+void doList(void **list, voidfunc * func)
 /* call func on each element of the NULL terminated list of pointers */
 {
-  register long i;
-  register void* ptr = NULL;
-  if (list == NULL)
-    return;
-  for (i = 0,ptr = list[i]; ptr != NULL; ptr = list[++i])
-    (*func)(ptr);
+    register long i;
+    register void *ptr = NULL;
+
+    if (list == NULL)
+	return;
+    for (i = 0, ptr = list[i]; ptr != NULL; ptr = list[++i])
+	(*func) (ptr);
 }
 
 /*----------------------------------------------------------------------*/
 
-char*
-writeProtocolVersion(char* buf, long* len)
+char *writeProtocolVersion(char *buf, long *len)
 /* write a bitmap describing the protocols available */
 {
-  static bit_map* version = NULL;
+    static bit_map *version = NULL;
 
-  if (version == NULL)
-   { version = makeBitMap((unsigned long)1,true); /* version 1! */
-   }
+    if (version == NULL) {
+	version = makeBitMap((unsigned long) 1, true);	/* version 1! */
+    }
 
-  return(writeBitMap(version,DT_ProtocolVersion,buf,len));
+    return (writeBitMap(version, DT_ProtocolVersion, buf, len));
 }
 
 /*----------------------------------------------------------------------*/
 
-char*
-defaultImplementationID(void)
+char *defaultImplementationID(void)
 {
-  static char	ImplementationID[] = "TMC";
-  return(ImplementationID);
+    static char ImplementationID[] = "TMC";
+
+    return (ImplementationID);
 }
 
 /*----------------------------------------------------------------------*/
 
-char*
-defaultImplementationName(void)
+char *defaultImplementationName(void)
 {
-  static char ImplementationName[] = "Thinking Machines Corporation Z39.50";
-  return(ImplementationName);
+    static char ImplementationName[] = "Thinking Machines Corporation Z39.50";
+
+    return (ImplementationName);
 }
 
 /*----------------------------------------------------------------------*/
 
-char*
-defaultImplementationVersion(void)
+char *defaultImplementationVersion(void)
 {
-  static char	ImplementationVersion[] = "2.0A";
-  return(ImplementationVersion);
+    static char ImplementationVersion[] = "2.0A";
+
+    return (ImplementationVersion);
 }
 
 /*----------------------------------------------------------------------*/
 
-
 /*
-**	Routines originally from ZType1.c -- FM
-**
-**----------------------------------------------------------------------*/
+ *	Routines originally from ZType1.c -- FM
+ *
+ *----------------------------------------------------------------------*/
 /* WIDE AREA INFORMATION SERVER SOFTWARE:
-   No guarantees or restrictions.  See the readme file for the full standard
-   disclaimer.
-
-   3.26.90	Harry Morris, morris@think.com
-   4.11.90  HWM - generalized conditional includes (see c-dialect.h)
-*/
+ * No guarantees or restrictions.  See the readme file for the full standard
+ * disclaimer.
+ *
+ * 3.26.90	Harry Morris, morris@think.com
+ * 4.11.90  HWM - generalized conditional includes (see c-dialect.h)
+ */
 /*----------------------------------------------------------------------*/
 
-query_term*
-makeAttributeTerm(
-char* use,
-char* relation,
-char* position,
-char* structure,
-char* truncation,
-char* completeness,
-any* term)
+query_term *makeAttributeTerm(char *use,
+			      char *relation,
+			      char *position,
+			      char *structure,
+			      char *truncation,
+			      char *completeness,
+			      any *term)
 {
-  query_term* qt = (query_term*)s_malloc((size_t)sizeof(query_term));
+    query_term *qt = (query_term *) s_malloc((size_t) sizeof(query_term));
 
-  qt->TermType = TT_Attribute;
+    qt->TermType = TT_Attribute;
 
-  /* copy in the attributes */
-  strncpy(qt->Use,use,ATTRIBUTE_SIZE);
-  strncpy(qt->Relation,relation,ATTRIBUTE_SIZE);
-  strncpy(qt->Position,position,ATTRIBUTE_SIZE);
-  strncpy(qt->Structure,structure,ATTRIBUTE_SIZE);
-  strncpy(qt->Truncation,truncation,ATTRIBUTE_SIZE);
-  strncpy(qt->Completeness,completeness,ATTRIBUTE_SIZE);
+    /* copy in the attributes */
+    strncpy(qt->Use, use, ATTRIBUTE_SIZE);
+    strncpy(qt->Relation, relation, ATTRIBUTE_SIZE);
+    strncpy(qt->Position, position, ATTRIBUTE_SIZE);
+    strncpy(qt->Structure, structure, ATTRIBUTE_SIZE);
+    strncpy(qt->Truncation, truncation, ATTRIBUTE_SIZE);
+    strncpy(qt->Completeness, completeness, ATTRIBUTE_SIZE);
 
-  qt->Term = duplicateAny(term);
+    qt->Term = duplicateAny(term);
 
-  qt->ResultSetID = NULL;
+    qt->ResultSetID = NULL;
 
-  return(qt);
+    return (qt);
 }
 
 /*----------------------------------------------------------------------*/
 
-query_term*
-makeResultSetTerm(any* resultSet)
+query_term *makeResultSetTerm(any *resultSet)
 {
-  query_term* qt = (query_term*)s_malloc((size_t)sizeof(query_term));
+    query_term *qt = (query_term *) s_malloc((size_t) sizeof(query_term));
 
-  qt->TermType = TT_ResultSetID;
+    qt->TermType = TT_ResultSetID;
 
-  qt->ResultSetID = duplicateAny(resultSet);
+    qt->ResultSetID = duplicateAny(resultSet);
 
-  qt->Term = NULL;
+    qt->Term = NULL;
 
-  return(qt);
+    return (qt);
 }
 
 /*----------------------------------------------------------------------*/
 
-query_term*
-makeOperatorTerm(char* operatorCode)
+query_term *makeOperatorTerm(char *operatorCode)
 {
-  query_term* qt = (query_term*)s_malloc((size_t)sizeof(query_term));
+    query_term *qt = (query_term *) s_malloc((size_t) sizeof(query_term));
 
-  qt->TermType = TT_Operator;
+    qt->TermType = TT_Operator;
 
-  strncpy(qt->Operator,operatorCode,OPERATOR_SIZE);
+    strncpy(qt->Operator, operatorCode, OPERATOR_SIZE);
 
-  qt->Term = NULL;
-  qt->ResultSetID = NULL;
+    qt->Term = NULL;
+    qt->ResultSetID = NULL;
 
-  return(qt);
+    return (qt);
 }
 
 /*----------------------------------------------------------------------*/
 
-void
-freeTerm(void* param)
+void freeTerm(void *param)
 {
-  query_term* qt = (query_term*)param;
-  switch (qt->TermType)
-    { case TT_Attribute:
+    query_term *qt = (query_term *) param;
+
+    switch (qt->TermType) {
+    case TT_Attribute:
 	freeAny(qt->Term);
 	break;
-      case TT_ResultSetID:
+    case TT_ResultSetID:
 	freeAny(qt->ResultSetID);
 	break;
-      case TT_Operator:
+    case TT_Operator:
 	/* do nothing */
 	break;
-      default:
+    default:
 	panic("Implementation error: Unknown term type %ld",
 	      qt->TermType);
 	break;
-      }
-  s_free(qt);
+    }
+    s_free(qt);
 }
 
 /*----------------------------------------------------------------------*/
@@ -1862,128 +1905,125 @@ freeTerm(void* param)
 #define ATTRIBUTE_LIST_SIZE	ATTRIBUTE_SIZE * 6
 #define AT_DELIMITER	" "
 
-char*
-writeQueryTerm(query_term* qt, char* buffer, long* len)
-{
-  char* buf = buffer;
-  char attributes[ATTRIBUTE_LIST_SIZE];
-
-  switch (qt->TermType)
-    { case TT_Attribute:
-	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,AT_DELIMITER,sizeof(AT_DELIMITER) + 1,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,AT_DELIMITER,sizeof(AT_DELIMITER) + 1,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);
-	buf = writeAny(qt->Term,DT_Term,buf,len);
+char *writeQueryTerm(query_term *qt, char *buffer, long *len)
+{
+    char *buf = buffer;
+    char attributes[ATTRIBUTE_LIST_SIZE];
+
+    switch (qt->TermType) {
+    case TT_Attribute:
+	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, AT_DELIMITER, sizeof(AT_DELIMITER) + 1, 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, AT_DELIMITER, sizeof(AT_DELIMITER) + 1, 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);
+	buf = writeAny(qt->Term, DT_Term, buf, len);
 	break;
-      case TT_ResultSetID:
-	buf = writeAny(qt->ResultSetID,DT_ResultSetID,buf,len);
+    case TT_ResultSetID:
+	buf = writeAny(qt->ResultSetID, DT_ResultSetID, buf, len);
 	break;
-      case TT_Operator:
-	buf = writeString(qt->Operator,DT_Operator,buf,len);
+    case TT_Operator:
+	buf = writeString(qt->Operator, DT_Operator, buf, len);
 	break;
-      default:
+    default:
 	panic("Implementation error: Unknown term type %ld",
 	      qt->TermType);
 	break;
-      }
+    }
 
-  return(buf);
+    return (buf);
 }
 
 /*----------------------------------------------------------------------*/
 
-char*
-readQueryTerm(query_term** qt, char* buffer)
+char *readQueryTerm(query_term **qt, char *buffer)
 {
-  char* buf = buffer;
-  char  *attributeList = NULL;
-  char* operator = NULL;
-  any*  term;
-  char* use = NULL;
-  char* relation = NULL;
-  char* position = NULL;
-  char* structure = NULL;
-  char* truncation = NULL;
-  char* completeness;
-  any*	resultSetID = NULL;
-  data_tag tag;
-
+    char *buf = buffer;
+    char *attributeList = NULL;
+    char *operator = NULL;
+    any *term;
+    char *use = NULL;
+    char *relation = NULL;
+    char *position = NULL;
+    char *structure = NULL;
+    char *truncation = NULL;
+    char *completeness;
+    any *resultSetID = NULL;
+    data_tag tag;
 
-  tag = peekTag(buffer);
+    tag = peekTag(buffer);
 
-  switch(tag)
-    { case DT_AttributeList:
-	buf = readString(&attributeList,buf);
-	buf = readAny(&term,buf);
-	use = strtok(attributeList,AT_DELIMITER);
-	relation = strtok(NULL,AT_DELIMITER);
-	position = strtok(NULL,AT_DELIMITER);
-	structure = strtok(NULL,AT_DELIMITER);
-	truncation = strtok(NULL,AT_DELIMITER);
-	completeness = strtok(NULL,AT_DELIMITER);
-	*qt = makeAttributeTerm(use,relation,position,structure,
-				truncation,completeness,term);
+    switch (tag) {
+    case DT_AttributeList:
+	buf = readString(&attributeList, buf);
+	buf = readAny(&term, buf);
+	use = strtok(attributeList, AT_DELIMITER);
+	relation = strtok(NULL, AT_DELIMITER);
+	position = strtok(NULL, AT_DELIMITER);
+	structure = strtok(NULL, AT_DELIMITER);
+	truncation = strtok(NULL, AT_DELIMITER);
+	completeness = strtok(NULL, AT_DELIMITER);
+	*qt = makeAttributeTerm(use, relation, position, structure,
+				truncation, completeness, term);
 	s_free(attributeList);
 	freeAny(term);
 	break;
-      case DT_ResultSetID:
-	buf = readAny(&resultSetID,buf);
+    case DT_ResultSetID:
+	buf = readAny(&resultSetID, buf);
 	*qt = makeResultSetTerm(resultSetID);
 	freeAny(resultSetID);
 	break;
-      case DT_Operator:
-	buf = readString(&operator,buf);
+    case DT_Operator:
+	buf = readString(&operator, buf);
 	*qt = makeOperatorTerm(operator);
 	s_free(operator);
 	break;
-      default:
+    default:
 	REPORT_READ_ERROR(buf);
 	break;
-      }
+    }
 
-  return(buf);
+    return (buf);
 }
 
 /*----------------------------------------------------------------------*/
 
-static unsigned long getQueryTermSize (query_term* qt);
+static unsigned long getQueryTermSize(query_term *qt);
 
-static unsigned long
-getQueryTermSize(query_term* qt)
+static unsigned long getQueryTermSize(query_term *qt)
 /* figure out how many bytes it will take to write this query */
 {
-  unsigned long size = 0;
-  static char attributes[] = "11 22 33 44 55 66"; /* we just need this to
-						     calculate its written
-						     size */
+    unsigned long size = 0;
+    static char attributes[] = "11 22 33 44 55 66";	/* we just need this to
+
+							   calculate its written
+							   size */
 
-  switch (qt->TermType)
-    { case TT_Attribute:
-	size = writtenStringSize(DT_AttributeList,attributes);
-	size += writtenAnySize(DT_Term,qt->Term);
+    switch (qt->TermType) {
+    case TT_Attribute:
+	size = writtenStringSize(DT_AttributeList, attributes);
+	size += writtenAnySize(DT_Term, qt->Term);
 	break;
-      case TT_ResultSetID:
-	size = writtenAnySize(DT_ResultSetID,qt->ResultSetID);
+    case TT_ResultSetID:
+	size = writtenAnySize(DT_ResultSetID, qt->ResultSetID);
 	break;
-      case TT_Operator:
-	size = writtenStringSize(DT_Operator,qt->Operator);
+    case TT_Operator:
+	size = writtenStringSize(DT_Operator, qt->Operator);
 	break;
-      default:
+    default:
 	panic("Implementation error: Unknown term type %ld",
 	      qt->TermType);
 	break;
-      }
+    }
 
-  return(size);
+    return (size);
 }
 
 /*----------------------------------------------------------------------*/
@@ -1992,84 +2032,81 @@ getQueryTermSize(query_term* qt)
    transmission, a query is written into an any which is sent as
    the user information field. */
 
-any*
-writeQuery(query_term** terms)
+any *writeQuery(query_term **terms)
 {
-  any* info = NULL;
-  char* writePos = NULL;
-  char* data = NULL;
-  unsigned long size = 0;
-  long remaining = 0;
-  long i;
-  query_term* qt = NULL;
+    any *info = NULL;
+    char *writePos = NULL;
+    char *data = NULL;
+    unsigned long size = 0;
+    long remaining = 0;
+    long i;
+    query_term *qt = NULL;
 
-  if (terms == NULL)
-    return(NULL);
+    if (terms == NULL)
+	return (NULL);
 
-  /* calculate the size of write buffer */
-  for (i = 0,qt = terms[i]; qt != NULL; qt = terms[++i])
-    size += getQueryTermSize(qt);
+    /* calculate the size of write buffer */
+    for (i = 0, qt = terms[i]; qt != NULL; qt = terms[++i])
+	size += getQueryTermSize(qt);
 
-  data = (char*)s_malloc((size_t)size);
+    data = (char *) s_malloc((size_t) size);
 
-  /* write the terms */
-  writePos = data;
-  remaining = size;
-  for (i = 0,qt = terms[i]; qt != NULL; qt = terms[++i])
-    writePos = writeQueryTerm(qt,writePos,&remaining);
+    /* write the terms */
+    writePos = data;
+    remaining = size;
+    for (i = 0, qt = terms[i]; qt != NULL; qt = terms[++i])
+	writePos = writeQueryTerm(qt, writePos, &remaining);
 
-  info = makeAny(size,data);
+    info = makeAny(size, data);
 
-  return(info);
+    return (info);
 }
 
 /*----------------------------------------------------------------------*/
 
-query_term**
-readQuery(any *info)
+query_term **readQuery(any *info)
 {
-  char* readPos = info->bytes;
-  query_term** terms = NULL;
-  query_term* qt = NULL;
-  long numTerms = 0L;
-  char tmp[100];
+    char *readPos = info->bytes;
+    query_term **terms = NULL;
+    query_term *qt = NULL;
+    long numTerms = 0L;
+    char tmp[100];
 
-  sprintf(tmp,"readquery: bytes: %ld",info->size);
-  log_write(tmp);
+    sprintf(tmp, "readquery: bytes: %ld", info->size);
+    log_write(tmp);
 
-  while (readPos < info->bytes + info->size)
-    { readPos = readQueryTerm(&qt,readPos);
+    while (readPos < info->bytes + info->size) {
+	readPos = readQueryTerm(&qt, readPos);
 
-      if (terms == NULL)
-	{ terms = (query_term**)s_malloc((size_t)(sizeof(query_term*)*2));
+	if (terms == NULL) {
+	    terms = (query_term **) s_malloc((size_t) (sizeof(query_term *) * 2));
+	} else {
+	    terms =
+		(query_term **) s_realloc((char *) terms,
+					  (size_t) (sizeof(query_term *) *
+						      (numTerms + 2)));
 	}
-      else
-	{ terms =
-	    (query_term**)s_realloc((char*)terms,
-				    (size_t)(sizeof(query_term*)*(numTerms+2)));
-	  }
-      if (qt == NULL)
-	log_write("qt = null");
-      terms[numTerms++] = qt;
-      terms[numTerms] = NULL;
+	if (qt == NULL)
+	    log_write("qt = null");
+	terms[numTerms++] = qt;
+	terms[numTerms] = NULL;
     }
 
-  return(terms);
+    return (terms);
 }
 
 /*----------------------------------------------------------------------*/
 
-
 /*
-**	Routines originally from panic.c -- FM
-**
-**----------------------------------------------------------------------*/
+ *	Routines originally from panic.c -- FM
+ *
+ *----------------------------------------------------------------------*/
 /* WIDE AREA INFORMATION SERVER SOFTWARE:
-   No guarantees or restrictions.  See the readme file for the full standard
-   disclaimer.
-
-   Morris@think.com
-*/
+ * No guarantees or restrictions.  See the readme file for the full standard
+ * disclaimer.
+ *
+ * Morris@think.com
+ */
 
 /* panic is an error system interface.  On the Mac, it will pop
  * up a little window to explain the problem.
@@ -2078,151 +2115,144 @@ readQuery(any *info)
 
 /*----------------------------------------------------------------------*/
 
-static void exitAction (long error);
+static void exitAction(long error);
 
-static void
-exitAction(long error GCC_UNUSED)
+static void exitAction(long error GCC_UNUSED)
 {
-  long i;
-  for (i = 0; i < 100000; i++)
-    ;
-  exit(0);
+    long i;
+
+    for (i = 0; i < 100000; i++) ;
+    exit(0);
 }
 
 /*----------------------------------------------------------------------*/
 
 #define PANIC_HEADER "Fatal Error:  "
 
-void
-panic(char *format, ...)
+void panic(char *format,...)
 {
-  va_list ap;			/* the variable arguments */
+    va_list ap;			/* the variable arguments */
 
-  fprintf(stderr,PANIC_HEADER);
-  LYva_start(ap, format);	/* init ap */
-  vfprintf(stderr,format,ap);	/* print the contents */
-  va_end(ap);			/* free ap */
-  fflush(stderr);
+    fprintf(stderr, PANIC_HEADER);
+    LYva_start(ap, format);	/* init ap */
+    vfprintf(stderr, format, ap);	/* print the contents */
+    va_end(ap);			/* free ap */
+    fflush(stderr);
 
-  exitAction(0);
+    exitAction(0);
 }
 
 /*----------------------------------------------------------------------*/
 
-
 /*
-**	Routines originally from cutil.c -- FM
-**
-**----------------------------------------------------------------------*/
+ *	Routines originally from cutil.c -- FM
+ *
+ *----------------------------------------------------------------------*/
 /* Wide AREA INFORMATION SERVER SOFTWARE
-   No guarantees or restrictions.  See the readme file for the full standard
-   disclaimer.
-
-   3.26.90	Harry Morris, morris@think.com
-   4.11.90  HWM - generalized conditional includes (see c-dialect.h)
-*/
+ * No guarantees or restrictions.  See the readme file for the full standard
+ * disclaimer.
+ *
+ * 3.26.90	Harry Morris, morris@think.com
+ * 4.11.90  HWM - generalized conditional includes (see c-dialect.h)
+ */
 
 /*----------------------------------------------------------------------*/
 
-void
-fs_checkPtr(void* ptr)
+void fs_checkPtr(void *ptr)
 /* If the ptr is NULL, give an error */
 {
-  if (ptr == NULL)
-    panic("checkPtr found a NULL pointer");
+    if (ptr == NULL)
+	panic("checkPtr found a NULL pointer");
 }
 
 /*----------------------------------------------------------------------*/
 
-void*
-fs_malloc(size_t size)
+void *fs_malloc(size_t size)
 /* does safety checks and optional accounting */
 {
-  register void* ptr = NULL;
+    register void *ptr = NULL;
 
-  ptr = (void*)calloc((size_t)size,(size_t)1);
-  s_checkPtr(ptr);
+    ptr = (void *) calloc((size_t) size, (size_t) 1);
+    s_checkPtr(ptr);
 
-  return(ptr);
+    return (ptr);
 }
 
 /*----------------------------------------------------------------------*/
 
-void*
-fs_realloc(void* ptr, size_t size)
+void *fs_realloc(void *ptr, size_t size)
 /* 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;
+    register void *nptr = NULL;
 
-  if (ptr == NULL)		/* this is really a malloc */
-    return(s_malloc(size));
+    if (ptr == NULL)		/* this is really a malloc */
+	return (s_malloc(size));
 
-  nptr = (void*)realloc(ptr,size);
-  s_checkPtr(ptr);
+    nptr = (void *) realloc(ptr, size);
+    s_checkPtr(ptr);
 
-  return(nptr);
+    return (nptr);
 }
 
 /*----------------------------------------------------------------------*/
 
-void
-fs_free(void* ptr)
+void fs_free(void *ptr)
 /* does safety checks and optional accounting */
 {
-  if (ptr != NULL)		/* some non-ansi compilers/os's cant handle freeing null */
+    if (ptr != NULL)		/* some non-ansi compilers/os's cant handle freeing null */
     {				/* if we knew the size of this block of memory, we could clear it - oh well */
-      free(ptr);
-      ptr = NULL;
+	free(ptr);
+	ptr = NULL;
     }
 }
 
 /*----------------------------------------------------------------------*/
 
-char*
-s_strdup(char* s)
+char *s_strdup(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,
    appropriate action is taken.
  */
 {
-  unsigned long len;
-  char* copy = NULL;
+    unsigned long len;
+    char *copy = NULL;
+
+    if (s == NULL)		/* saftey check to postpone stupid errors */
+	return (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)));
 
-  len = strlen(s);		/* length of string - terminator */
-  copy = (char*)s_malloc((size_t)(sizeof(char)*(len + 1)));
-  strncpy(copy,s,len + 1);
-  return(copy);
+    strncpy(copy, s, len + 1);
+    return (copy);
 }
 
 /*----------------------------------------------------------------------*/
 
-char*
-fs_strncat(char* dst, char* src, size_t maxToAdd, size_t maxTotal)
+char *fs_strncat(char *dst, char *src, size_t maxToAdd, size_t maxTotal)
 
 /* 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
-    { size_t truncateTo = maxTotal - dstSize - 1;
-      char   saveChar = src[truncateTo];
-      char*  result = NULL;
-      src[truncateTo] = '\0';
-      result = strncat(dst,src,maxToAdd);
-      src[truncateTo] = saveChar;
-      return(result);
+    size_t dstSize = strlen(dst);
+    size_t srcSize = strlen(src);
+
+    if (dstSize + srcSize < maxTotal)	/* use regular old strncat */
+	return (strncat(dst, src, maxToAdd));
+    else {
+	size_t truncateTo = maxTotal - dstSize - 1;
+	char saveChar = src[truncateTo];
+	char *result = NULL;
+
+	src[truncateTo] = '\0';
+	result = strncat(dst, src, maxToAdd);
+	src[truncateTo] = saveChar;
+	return (result);
     }
 }
 
@@ -2230,20 +2260,22 @@ fs_strncat(char* dst, char* src, size_t maxToAdd, size_t maxTotal)
 
 char char_downcase(unsigned long long_ch)
 {
-  unsigned char ch = long_ch & 0xFF; /* just want one byte */
-  /* when ansi is the way of the world, this can be tolower */
-  return (((ch >= 'A') && (ch <= 'Z')) ? (ch + 'a' -'A') : ch);
+    unsigned char ch = long_ch & 0xFF;	/* just want one byte */
+
+    /* when ansi is the way of the world, this can be tolower */
+    return (((ch >= 'A') && (ch <= 'Z')) ? (ch + 'a' - 'A') : ch);
 }
 
 char *string_downcase(char *word)
 {
-  long i = 0;
-  while(word[i] != '\0'){
-    word[i] = char_downcase((unsigned long)word[i]);
-    i++;
-  }
-  return(word);
+    long i = 0;
+
+    while (word[i] != '\0') {
+	word[i] = char_downcase((unsigned long) word[i]);
+	i++;
+    }
+    return (word);
 }
 
 /*----------------------------------------------------------------------*/
-
+#endif /* VMS */
diff --git a/WWW/Library/Implementation/HTVMS_WaisUI.h b/WWW/Library/Implementation/HTVMS_WaisUI.h
index 9e8011d3..aaa0495a 100644
--- a/WWW/Library/Implementation/HTVMS_WaisUI.h
+++ b/WWW/Library/Implementation/HTVMS_WaisUI.h
@@ -1,9 +1,9 @@
 /*							HTVMS_WAISUI.h
-**
-**	Adaptation for Lynx by F.Macrides (macrides@sci.wfeb.edu)
-**
-**	31-May-1994 FM	Initial version.
-*/
+ *
+ *	Adaptation for Lynx by F.Macrides (macrides@sci.wfeb.edu)
+ *
+ *	31-May-1994 FM	Initial version.
+ */
 
 #ifndef HTVMSWAIS_H
 #define HTVMSWAIS_H
@@ -12,22 +12,21 @@
 #include <HTUtils.h>
 #endif
 
-void	log_write (char *);
+void log_write(char *);
 
 /*
-**	Routines originally from Panic.h -- FM
-**
-**----------------------------------------------------------------------*/
+ *	Routines originally from Panic.h -- FM
+ *
+ *----------------------------------------------------------------------*/
 
-void	panic (char* format,...);
+void panic(char *format,...);
 
 /*----------------------------------------------------------------------*/
 
-
 /*
-**	Routines originally from CUtil.h -- FM
-**
-**----------------------------------------------------------------------*/
+ *	Routines originally from CUtil.h -- FM
+ *
+ *----------------------------------------------------------------------*/
 
 /* types and constants */
 
@@ -40,8 +39,8 @@ void	panic (char* format,...);
 #endif /* true */
 
 #ifndef false
-#define false	(boolean)0L   /* used to be (!true), but broke
-				 some compilers */
+#define false	(boolean)0L	/* used to be (!true), but broke
+				   some compilers */
 #endif /* false */
 
 #ifndef TRUE
@@ -57,11 +56,11 @@ void	panic (char* format,...);
 
 /* enhanced memory handling functions - don't call them directly, use the
    macros below */
-void	fs_checkPtr (void* ptr);
-void*	fs_malloc (size_t size);
-void*	fs_realloc (void* ptr,size_t size);
-void	fs_free (void* ptr);
-char*	fs_strncat (char* dst,char* src,size_t maxToAdd,size_t maxTotal);
+void fs_checkPtr(void *ptr);
+void *fs_malloc(size_t size);
+void *fs_realloc(void *ptr, size_t size);
+void fs_free(void *ptr);
+char *fs_strncat(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)
@@ -70,22 +69,20 @@ char*	fs_strncat (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 (char* s);
+char *s_strdup(char *s);
 
 #define IS_DELIMITER	1
 #define	NOT_DELIMITER	!IS_DELIMITER
 
-char char_downcase (unsigned long ch);
-char *string_downcase (char* word);
+char char_downcase(unsigned long ch);
+char *string_downcase(char *word);
 
 /*----------------------------------------------------------------------*/
 
-
-
 /*
-**	Routines originally from ZUtil.c -- FM
-**
-**----------------------------------------------------------------------*/
+ *	Routines originally from ZUtil.c -- FM
+ *
+ *----------------------------------------------------------------------*/
 
 /* Data types / constants */
 
@@ -107,12 +104,12 @@ typedef long pdu_type;
 #define	resourceControlAPDU		(pdu_type)30
 #define	resourceControlResponseAPDU	(pdu_type)31
 
-typedef struct any {	/* an any is a non-ascii string of characters */
-	unsigned long	size;
-	char*			bytes;
-	} any;
+typedef struct any {		/* an any is a non-ascii string of characters */
+    unsigned long size;
+    char *bytes;
+} any;
 
-typedef any	bit_map;	/* a bit_map is a group of packed bits */
+typedef any bit_map;		/* a bit_map is a group of packed bits */
 
 typedef unsigned long data_tag;
 
@@ -165,14 +162,14 @@ typedef unsigned long data_tag;
 /* number of bytes required to represent the following sizes in compressed
    integer format
  */
-#define CompressedInt1Byte	128		/* 2 ^ 7 */
-#define CompressedInt2Byte	16384		/* 2 ^ 14 */
+#define CompressedInt1Byte	128	/* 2 ^ 7 */
+#define CompressedInt2Byte	16384	/* 2 ^ 14 */
 #define CompressedInt3Byte	2097152		/* 2 ^ 21 */
 /* others may follow ... */
 
 /* types of query */
-#define QT_0	"0"	/* query whose non-standard format has been agreed upon
-			   client and server */
+#define QT_0	"0"		/* query whose non-standard format has been agreed upon
+				   client and server */
 /* values for InitAPDU option element */
 #define	WILL_USE		TRUE
 #define WILL_NOT_USE		FALSE
@@ -184,7 +181,7 @@ typedef unsigned long data_tag;
 #define REJECT	FALSE
 
 /* values for SearchResponseAPDU search status element */
-#define	SUCCESS	0 /* intuitive huh? */
+#define	SUCCESS	0		/* intuitive huh? */
 #define FAILURE	1
 
 /* values for SearchResponseAPDU result set status element */
@@ -198,16 +195,16 @@ typedef unsigned long data_tag;
 #define PARTIAL_2	2
 #define PARTIAL_3	3
 #define PARTIAL_4	4
-#define PS_NONE		5 /* can't use NONE since it was used by result
-			     set status */
+#define PS_NONE		5	/* can't use NONE since it was used by result
+				   set status */
 
 #define DIAGNOSTIC_CODE_SIZE	(size_t)3
 
-typedef struct diagnosticRecord
- { boolean	SURROGATE;
-   char		DIAG[DIAGNOSTIC_CODE_SIZE];
-   char*	ADDINFO;
- } diagnosticRecord;
+typedef struct diagnosticRecord {
+    boolean SURROGATE;
+    char DIAG[DIAGNOSTIC_CODE_SIZE];
+    char *ADDINFO;
+} diagnosticRecord;
 
 #define D_PermanentSystemError	       "S1"
 #define D_TemporarySystemError         "S2"
@@ -251,7 +248,7 @@ typedef struct diagnosticRecord
 
 /* for internal error handling */
 
-extern char* readErrorPosition;		/* pos where buf stoped making sense */
+extern char *readErrorPosition;	/* pos where buf stoped making sense */
 
 /* the following are macros so that they can return OUT of the function
    which calls them
@@ -259,7 +256,7 @@ extern char* readErrorPosition;		/* pos where buf stoped making sense */
 
 #define RETURN_ON_NULL(var)					\
 	if (var == NULL)					\
-	  return(NULL); /* jump out of caller */
+	  return(NULL);		/* jump out of caller */
 
 #define REPORT_READ_ERROR(pos)					\
 	{ readErrorPosition = (pos);				\
@@ -277,79 +274,78 @@ extern char* readErrorPosition;		/* pos where buf stoped making sense */
 
 /*----------------------------------------------------------------------*/
 
-diagnosticRecord* makeDiag (boolean surrogate,char* code,char* addInfo);
-void freeDiag (diagnosticRecord* diag);
-char* writeDiag (diagnosticRecord* diag,char* buffer,long* len);
-char* readDiag (diagnosticRecord** diag,char* buffer);
+diagnosticRecord *makeDiag(boolean surrogate, char *code, char *addInfo);
+void freeDiag(diagnosticRecord * diag);
+char *writeDiag(diagnosticRecord * diag, char *buffer, long *len);
+char *readDiag(diagnosticRecord ** diag, char *buffer);
 
-char* writeCompressedInteger (unsigned long num,char* buf,long* len);
-char* readCompressedInteger (unsigned long *num,char* buf);
-char* writeCompressedIntWithPadding (unsigned long num,unsigned long size,
-					 char* buffer,long* len);
-unsigned long writtenCompressedIntSize (unsigned long num);
+char *writeCompressedInteger(unsigned long num, char *buf, long *len);
+char *readCompressedInteger(unsigned long *num, char *buf);
+char *writeCompressedIntWithPadding(unsigned long num, unsigned long size,
+				    char *buffer, long *len);
+unsigned long writtenCompressedIntSize(unsigned long num);
 
-char* writeTag (data_tag tag,char* buf,long* len);
-char* readTag (data_tag* tag,char* buf);
-data_tag peekTag (char* buf);
-unsigned long writtenTagSize (data_tag tag);
+char *writeTag(data_tag tag, char *buf, long *len);
+char *readTag(data_tag *tag, char *buf);
+data_tag peekTag(char *buf);
+unsigned long writtenTagSize(data_tag tag);
 
-any* makeAny (unsigned long size,char* data);
-void freeAny (any* a);
-any* duplicateAny (any* a);
-char* writeAny (any* a,data_tag tag,char* buffer,long* len);
-char* readAny (any** anAny,char* buffer);
-unsigned long writtenAnySize (data_tag tag,any* a);
+any *makeAny(unsigned long size, char *data);
+void freeAny(any *a);
+any *duplicateAny(any *a);
+char *writeAny(any *a, data_tag tag, char *buffer, long *len);
+char *readAny(any **anAny, char *buffer);
+unsigned long writtenAnySize(data_tag tag, any *a);
 
-any* stringToAny (char* s);
-char* anyToString (any* a);
-unsigned long writtenStringSize (data_tag tag,char* s);
+any *stringToAny(char *s);
+char *anyToString(any *a);
+unsigned long writtenStringSize(data_tag tag, char *s);
 
-any* longToAny (long Num);
-long anyToLong (any* a);
+any *longToAny(long Num);
+long anyToLong(any *a);
 
-char* writeString (char* s,data_tag tag,char* buffer,long* len);
-char* readString (char** s,char* buffer);
+char *writeString(char *s, data_tag tag, char *buffer, long *len);
+char *readString(char **s, char *buffer);
 
-bit_map* makeBitMap (unsigned long numBits,...);
+bit_map *makeBitMap(unsigned long numBits,...);
 
-void freeBitMap (bit_map* bm);
-boolean bitAtPos (unsigned long pos,bit_map* bm);
-char* writeBitMap (bit_map* bm,data_tag tag,char* buffer,long* len);
-char* readBitMap (bit_map** bm,char* buffer);
+void freeBitMap(bit_map *bm);
+boolean bitAtPos(unsigned long pos, bit_map *bm);
+char *writeBitMap(bit_map *bm, data_tag tag, char *buffer, long *len);
+char *readBitMap(bit_map **bm, char *buffer);
 
-char* writeByte (unsigned long byte,char* buf,long* len);
-char* readByte (unsigned char* byte,char* buf);
+char *writeByte(unsigned long byte, char *buf, long *len);
+char *readByte(unsigned char *byte, char *buf);
 
-char* writeBoolean (boolean flag,char* buf,long* len);
-char* readBoolean (boolean* flag,char* buf);
+char *writeBoolean(boolean flag, char *buf, long *len);
+char *readBoolean(boolean *flag, char *buf);
 
-char* writePDUType (pdu_type pduType,char* buf,long* len);
-char* readPDUType (pdu_type* pduType,char* buf);
-pdu_type peekPDUType (char* buf);
+char *writePDUType(pdu_type pduType, char *buf, long *len);
+char *readPDUType(pdu_type *pduType, char *buf);
+pdu_type peekPDUType(char *buf);
 
-char* writeBinaryInteger (long num,unsigned long size,
-			      char* buf,long* len);
-char* readBinaryInteger (long* num,unsigned long size,char* buf);
-unsigned long writtenCompressedBinIntSize (long num);
+char *writeBinaryInteger(long num, unsigned long size,
+			 char *buf, long *len);
+char *readBinaryInteger(long *num, unsigned long size, char *buf);
+unsigned long writtenCompressedBinIntSize(long num);
 
-char* writeNum (long num,data_tag tag,char* buffer,long* len);
-char* readNum (long* num,char* buffer);
-unsigned long  writtenNumSize (data_tag tag,long num);
+char *writeNum(long num, data_tag tag, char *buffer, long *len);
+char *readNum(long *num, char *buffer);
+unsigned long writtenNumSize(data_tag tag, long num);
 
-void doList (void** list,void (*func)(void *));
+void doList(void **list, void (*func) (void *));
 
-char* writeProtocolVersion (char* buf,long* len);
-char* defaultImplementationID (void);
-char* defaultImplementationName (void);
-char* defaultImplementationVersion (void);
+char *writeProtocolVersion(char *buf, long *len);
+char *defaultImplementationID(void);
+char *defaultImplementationName(void);
+char *defaultImplementationVersion(void);
 
 /*----------------------------------------------------------------------*/
 
-
 /*
-**	Routines originally from ZType1.c -- FM
-**
-**----------------------------------------------------------------------*/
+ *	Routines originally from ZType1.c -- FM
+ *
+ *----------------------------------------------------------------------*/
 
 /* This file implements the type 1 query defined in appendices B & C
    of the SR 1 spec.
@@ -363,7 +359,7 @@ char* defaultImplementationVersion (void);
 #define DT_Term			(data_tag)45
 #define DT_Operator		(data_tag)46
 
-#define QT_BooleanQuery	"1"		/* standard boolean query */
+#define QT_BooleanQuery	"1"	/* standard boolean query */
 
 /* general attribute code - use in place of any attribute */
 #define IGNORE	"ig"
@@ -437,218 +433,223 @@ char* defaultImplementationVersion (void);
 #define OPERATOR_SIZE		2
 
 typedef struct query_term {
-  /* type */
-  long	TermType;
-  /* for term */
-  char	Use[ATTRIBUTE_SIZE];
-  char	Relation[ATTRIBUTE_SIZE];
-  char	Position[ATTRIBUTE_SIZE];
-  char	Structure[ATTRIBUTE_SIZE];
-  char	Truncation[ATTRIBUTE_SIZE];
-  char	Completeness[ATTRIBUTE_SIZE];
-  any*	Term;
-  /* for result set */
-  any*	ResultSetID;
-  /* for operator */
-  char	Operator[OPERATOR_SIZE];
+    /* type */
+    long TermType;
+    /* for term */
+    char Use[ATTRIBUTE_SIZE];
+    char Relation[ATTRIBUTE_SIZE];
+    char Position[ATTRIBUTE_SIZE];
+    char Structure[ATTRIBUTE_SIZE];
+    char Truncation[ATTRIBUTE_SIZE];
+    char Completeness[ATTRIBUTE_SIZE];
+    any *Term;
+    /* for result set */
+    any *ResultSetID;
+    /* for operator */
+    char Operator[OPERATOR_SIZE];
 } query_term;
 
 /*----------------------------------------------------------------------*/
 /* functions */
 
-query_term* makeAttributeTerm (
-        char* use,char* relation,char* position,char* structure,
-	char* truncation,char* completeness,any* term);
-query_term* makeResultSetTerm (any* resultSet);
-query_term* makeOperatorTerm (char* operatorCode);
-void freeTerm (void* qt);
-char* writeQueryTerm (query_term* qt,char* buffer,long* len);
-char* readQueryTerm (query_term** qt,char* buffer);
-any* writeQuery (query_term** terms);
-query_term** readQuery (any* info);
+query_term *makeAttributeTerm(char *use, char *relation, char *position, char *structure,
+			      char *truncation, char *completeness, any *term);
+query_term *makeResultSetTerm(any *resultSet);
+query_term *makeOperatorTerm(char *operatorCode);
+void freeTerm(void *qt);
+char *writeQueryTerm(query_term *qt, char *buffer, long *len);
+char *readQueryTerm(query_term **qt, char *buffer);
+any *writeQuery(query_term **terms);
+query_term **readQuery(any *info);
 
 /*----------------------------------------------------------------------*/
 
-
 /*
-**	Routines originally from UI.c -- FM
-**
-**----------------------------------------------------------------------*/
-
-char *
-generate_retrieval_apdu (char *buff,
-			     long *buff_len,
-			     any *docID,
-			     long chunk_type,
-			     long start_line, long end_line,
-			     char *type,
-			     char *database_name);
-
-
-long
-interpret_message (char *request_message,
+ *	Routines originally from UI.c -- FM
+ *
+ *----------------------------------------------------------------------*/
+
+char *generate_retrieval_apdu(char *buff,
+			      long *buff_len,
+			      any *docID,
+			      long chunk_type,
+			      long start_line, long end_line,
+			      char *type,
+			      char *database_name);
+
+long interpret_message(char *request_message,
 		       long request_length,
 		       char *response_message,
-		       long response_buffer_length, /* length of the buffer (modified)*/
+		       long response_buffer_length,	/* length of the buffer (modified) */
 		       long connection,
 		       boolean verbose);
 
-char *trim_junk (char *headline);
-
-
+char *trim_junk(char *headline);
 
 /*
-**	Routines originally from ZProt.c -- FM
-**
-**----------------------------------------------------------------------*/
+ *	Routines originally from ZProt.c -- FM
+ *
+ *----------------------------------------------------------------------*/
 
 /* APDU types */
 
 typedef struct InitAPDU {
-	pdu_type		PDUType;
-	boolean			willSearch,willPresent,willDelete;
-	boolean			supportAccessControl,supportResourceControl;
-	long			PreferredMessageSize;
-	long			MaximumRecordSize;
-	char*			IDAuthentication;
-	char*			ImplementationID;
-	char*			ImplementationName;
-	char*			ImplementationVersion;
-	any*			ReferenceID;
-	void*			UserInformationField;
-	} InitAPDU;
+    pdu_type PDUType;
+    boolean willSearch, willPresent, willDelete;
+    boolean supportAccessControl, supportResourceControl;
+    long PreferredMessageSize;
+    long MaximumRecordSize;
+    char *IDAuthentication;
+    char *ImplementationID;
+    char *ImplementationName;
+    char *ImplementationVersion;
+    any *ReferenceID;
+    void *UserInformationField;
+} InitAPDU;
 
 typedef struct InitResponseAPDU {
-	pdu_type		PDUType;
-	boolean			Result;
-	boolean			willSearch,willPresent,willDelete;
-	boolean			supportAccessControl,supportResourceControl;
-	long			PreferredMessageSize;
-	long			MaximumRecordSize;
-	char*			IDAuthentication;
-	char*			ImplementationID;
-	char*			ImplementationName;
-	char*			ImplementationVersion;
-	any*			ReferenceID;
-	void*			UserInformationField;
-	} InitResponseAPDU;
+    pdu_type PDUType;
+    boolean Result;
+    boolean willSearch, willPresent, willDelete;
+    boolean supportAccessControl, supportResourceControl;
+    long PreferredMessageSize;
+    long MaximumRecordSize;
+    char *IDAuthentication;
+    char *ImplementationID;
+    char *ImplementationName;
+    char *ImplementationVersion;
+    any *ReferenceID;
+    void *UserInformationField;
+} InitResponseAPDU;
 
 typedef struct SearchAPDU {
-	pdu_type		PDUType;
-	long			SmallSetUpperBound;
-	long			LargeSetLowerBound;
-	long			MediumSetPresentNumber;
-	boolean			ReplaceIndicator;
-	char*			ResultSetName;
-	char**			DatabaseNames;
-	char*			QueryType;
-	char**			ElementSetNames;
-	any*			ReferenceID;
-	void*			Query;
-	} SearchAPDU;
+    pdu_type PDUType;
+    long SmallSetUpperBound;
+    long LargeSetLowerBound;
+    long MediumSetPresentNumber;
+    boolean ReplaceIndicator;
+    char *ResultSetName;
+    char **DatabaseNames;
+    char *QueryType;
+    char **ElementSetNames;
+    any *ReferenceID;
+    void *Query;
+} SearchAPDU;
 
 typedef struct SearchResponseAPDU {
-	pdu_type		PDUType;
-	long			SearchStatus;
-	long			ResultCount;
-	long			NumberOfRecordsReturned;
-	long			NextResultSetPosition;
-	long			ResultSetStatus;
-	long			PresentStatus;
-	any*			ReferenceID;
-	void*			DatabaseDiagnosticRecords;
-	} SearchResponseAPDU;
+    pdu_type PDUType;
+    long SearchStatus;
+    long ResultCount;
+    long NumberOfRecordsReturned;
+    long NextResultSetPosition;
+    long ResultSetStatus;
+    long PresentStatus;
+    any *ReferenceID;
+    void *DatabaseDiagnosticRecords;
+} SearchResponseAPDU;
 
 typedef struct PresentAPDU {
-	pdu_type		PDUType;
-	long			NumberOfRecordsRequested;
-	long			ResultSetStartPosition;
-	char*			ResultSetID;
-	char*			ElementSetNames;
-	any*			ReferenceID;
-	void*			PresentInfo;
-	} PresentAPDU;
+    pdu_type PDUType;
+    long NumberOfRecordsRequested;
+    long ResultSetStartPosition;
+    char *ResultSetID;
+    char *ElementSetNames;
+    any *ReferenceID;
+    void *PresentInfo;
+} PresentAPDU;
 
 typedef struct PresentResponseAPDU {
-	pdu_type		PDUType;
-	boolean			PresentStatus;
-	long			NumberOfRecordsReturned;
-	long			NextResultSetPosition;
-	any*			ReferenceID;
-	void*			DatabaseDiagnosticRecords;
-	} PresentResponseAPDU;
+    pdu_type PDUType;
+    boolean PresentStatus;
+    long NumberOfRecordsReturned;
+    long NextResultSetPosition;
+    any *ReferenceID;
+    void *DatabaseDiagnosticRecords;
+} PresentResponseAPDU;
 
 /*----------------------------------------------------------------------*/
 /* Functions */
 
-InitAPDU* makeInitAPDU (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 (InitAPDU* init);
-char* writeInitAPDU (InitAPDU* init,char* buffer,long* len);
-char* readInitAPDU (InitAPDU** init,char* buffer);
-
-InitResponseAPDU* makeInitResponseAPDU (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 (InitResponseAPDU* init);
-char* writeInitResponseAPDU (InitResponseAPDU* init,char* buffer,long* len);
-char* readInitResponseAPDU (InitResponseAPDU** init,char* buffer);
-InitResponseAPDU* replyToInitAPDU (InitAPDU* init,boolean result,void* userInfo);
-
-SearchAPDU* makeSearchAPDU (long small,long large, long medium,
-				boolean replace,char* name,char** databases,
-				char* type,char** elements,any* refID,void* queryInfo);
-void freeSearchAPDU (SearchAPDU* query);
-char* writeSearchAPDU (SearchAPDU* query,char* buffer,long* len);
-char* readSearchAPDU (SearchAPDU** query,char* buffer);
-
-SearchResponseAPDU* makeSearchResponseAPDU (long result,long count,
-						long recordsReturned,long nextPos,
-						long resultStatus,long presentStatus,
-						any* refID,void* records);
-void freeSearchResponseAPDU (SearchResponseAPDU* queryResponse);
-char* writeSearchResponseAPDU (SearchResponseAPDU* queryResponse,char* buffer,long* len);
-char* readSearchResponseAPDU (SearchResponseAPDU** queryResponse,char* buffer);
-
-PresentAPDU* makePresentAPDU (long recsReq, long startPos,
-				  char* resultID,any* refID,void* info);
-void freePresentAPDU (PresentAPDU* present);
-char* writePresentAPDU (PresentAPDU* present,char* buffer,long* len);
-char* readPresentAPDU (PresentAPDU** present,char* buffer);
-
-PresentResponseAPDU* makePresentResponseAPDU (boolean status,long recsRet,
-						  long nextPos,any* refID,
-						  void* records);
-void freePresentResponseAPDU (PresentResponseAPDU* present);
-char* writePresentResponseAPDU (PresentResponseAPDU* present,char* buffer,long* len);
-char* readPresentResponseAPDU (PresentResponseAPDU** present,char* buffer);
+InitAPDU *makeInitAPDU(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(InitAPDU * init);
+char *writeInitAPDU(InitAPDU * init, char *buffer, long *len);
+char *readInitAPDU(InitAPDU ** init, char *buffer);
+
+InitResponseAPDU *makeInitResponseAPDU(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(InitResponseAPDU *init);
+char *writeInitResponseAPDU(InitResponseAPDU *init, char *buffer, long *len);
+char *readInitResponseAPDU(InitResponseAPDU **init, char *buffer);
+InitResponseAPDU *replyToInitAPDU(InitAPDU * init, boolean result, void *userInfo);
+
+SearchAPDU *makeSearchAPDU(long small, long large, long medium,
+			   boolean replace, char *name, char **databases,
+			   char *type, char **elements, any *refID, void *queryInfo);
+void freeSearchAPDU(SearchAPDU *query);
+char *writeSearchAPDU(SearchAPDU *query, char *buffer, long *len);
+char *readSearchAPDU(SearchAPDU **query, char *buffer);
+
+SearchResponseAPDU *makeSearchResponseAPDU(long result, long count,
+					   long recordsReturned, long nextPos,
+					   long resultStatus, long presentStatus,
+					   any *refID, void *records);
+void freeSearchResponseAPDU(SearchResponseAPDU *queryResponse);
+char *writeSearchResponseAPDU(SearchResponseAPDU *queryResponse, char *buffer, long *len);
+char *readSearchResponseAPDU(SearchResponseAPDU **queryResponse, char *buffer);
+
+PresentAPDU *makePresentAPDU(long recsReq, long startPos,
+			     char *resultID, any *refID, void *info);
+void freePresentAPDU(PresentAPDU * present);
+char *writePresentAPDU(PresentAPDU * present, char *buffer, long *len);
+char *readPresentAPDU(PresentAPDU ** present, char *buffer);
+
+PresentResponseAPDU *makePresentResponseAPDU(boolean status, long recsRet,
+					     long nextPos, any *refID,
+					     void *records);
+void freePresentResponseAPDU(PresentResponseAPDU * present);
+char *writePresentResponseAPDU(PresentResponseAPDU * present, char *buffer, long *len);
+char *readPresentResponseAPDU(PresentResponseAPDU ** present, char *buffer);
 
 /*----------------------------------------------------------------------*/
 /* user extension hooks: */
 
-extern char* writeInitInfo (InitAPDU* init,char* buffer,long* len);
-extern char* readInitInfo (void** info,char* buffer);
-
-extern char* writeInitResponseInfo (InitResponseAPDU* init,char* buffer,long* len);
-extern char* readInitResponseInfo (void** info,char* buffer);
+extern char *writeInitInfo(InitAPDU * init, char *buffer, long *len);
+extern char *readInitInfo(void **info, char *buffer);
 
-extern char* writeSearchInfo (SearchAPDU* query,char* buffer,long* len);
-extern char* readSearchInfo (void** info,char* buffer);
+extern char *writeInitResponseInfo(InitResponseAPDU *init, char *buffer, long *len);
+extern char *readInitResponseInfo(void **info, char *buffer);
 
-extern char* writeSearchResponseInfo (SearchResponseAPDU* query,char* buffer,long* len);
-extern char* readSearchResponseInfo (void** info,char* buffer);
+extern char *writeSearchInfo(SearchAPDU *query, char *buffer, long *len);
+extern char *readSearchInfo(void **info, char *buffer);
 
-extern char* writePresentInfo (PresentAPDU* present,char* buffer,long* len);
-extern char* readPresentInfo (void** info,char* buffer);
+extern char *writeSearchResponseInfo(SearchResponseAPDU *query, char *buffer, long *len);
+extern char *readSearchResponseInfo(void **info, char *buffer);
 
-extern char* writePresentResponseInfo (PresentResponseAPDU* present,char* buffer,long* len);
-extern char* readPresentResponseInfo (void** info,char* buffer);
+extern char *writePresentInfo(PresentAPDU * present, char *buffer, long *len);
+extern char *readPresentInfo(void **info, char *buffer);
 
+extern char *writePresentResponseInfo(PresentResponseAPDU * present, char
+				      *buffer, long *len);
+extern char *readPresentResponseInfo(void **info, char *buffer);
 
 #endif /* HTVMSWAIS_H */
diff --git a/WWW/Library/Implementation/HTWAIS.c b/WWW/Library/Implementation/HTWAIS.c
index 49696b23..fcc64344 100644
--- a/WWW/Library/Implementation/HTWAIS.c
+++ b/WWW/Library/Implementation/HTWAIS.c
@@ -1,46 +1,46 @@
 /*	WorldWideWeb - Wide Area Informaion Server Access	HTWAIS.c
-**	==================================================
-**
-**	This module allows a WWW server or client to read data from a
-**	remote	WAIS
-**  server, and provide that data to a WWW client in hypertext form.
-**  Source files, once retrieved, are stored and used to provide
-**  information about the index when that is acessed.
-**
-**  Authors
-**	BK	Brewster Kahle, Thinking Machines, <Brewster@think.com>
-**	TBL	Tim Berners-Lee, CERN <timbl@info.cern.ch>
-**	FM	Foteos Macrides, WFEB <macrides@sci.wfeb.edu>
-**
-**  History
-**	   Sep 91	TBL adapted shell-ui.c (BK) with HTRetrieve.c from WWW.
-**	   Feb 91	TBL Generated HTML cleaned up a bit (quotes, escaping)
-**			    Refers to lists of sources.
-**	   Mar 93	TBL Lib 2.0 compatible module made.
-**	   May 94	FM  Added DIRECT_WAIS support for VMS.
-**
-**  Bugs
-**	Uses C stream i/o to read and write sockets, which won't work
-**	on VMS TCP systems.
-**
-**	Should cache connections.
-**
-**	ANSI C only as written
-**
-**  Bugs fixed
-**	NT Nathan Torkington (Nathan.Torkington@vuw.ac.nz)
-**
-**  WAIS comments:
-**
-**	1.	Separate directories for different system's .o would help
-**	2.	Document ids are rather long!
-**
-** W WW Address mapping convention:
-**
-**	/servername/database/type/length/document-id
-**
-**	/servername/database?word+word+word
-*/
+ *	==================================================
+ *
+ *	This module allows a WWW server or client to read data from a
+ *	remote	WAIS
+ *  server, and provide that data to a WWW client in hypertext form.
+ *  Source files, once retrieved, are stored and used to provide
+ *  information about the index when that is acessed.
+ *
+ *  Authors
+ *	BK	Brewster Kahle, Thinking Machines, <Brewster@think.com>
+ *	TBL	Tim Berners-Lee, CERN <timbl@info.cern.ch>
+ *	FM	Foteos Macrides, WFEB <macrides@sci.wfeb.edu>
+ *
+ *  History
+ *	   Sep 91	TBL adapted shell-ui.c (BK) with HTRetrieve.c from WWW.
+ *	   Feb 91	TBL Generated HTML cleaned up a bit (quotes, escaping)
+ *			    Refers to lists of sources.
+ *	   Mar 93	TBL Lib 2.0 compatible module made.
+ *	   May 94	FM  Added DIRECT_WAIS support for VMS.
+ *
+ *  Bugs
+ *	Uses C stream i/o to read and write sockets, which won't work
+ *	on VMS TCP systems.
+ *
+ *	Should cache connections.
+ *
+ *	ANSI C only as written
+ *
+ *  Bugs fixed
+ *	NT Nathan Torkington (Nathan.Torkington@vuw.ac.nz)
+ *
+ *  WAIS comments:
+ *
+ *	1.	Separate directories for different system's .o would help
+ *	2.	Document ids are rather long!
+ *
+ * W WW Address mapping convention:
+ *
+ *	/servername/database/type/length/document-id
+ *
+ *	/servername/database?word+word+word
+ */
 /* WIDE AREA INFORMATION SERVER SOFTWARE:
    No guarantees or restrictions.  See the readme file for the full standard
    disclaimer.
@@ -58,8 +58,8 @@
 #include <HTAlert.h>
 
 /*			From WAIS
-**			---------
-*/
+ *			---------
+ */
 #ifdef VMS
 #include <HTVMS_WaisUI.h>
 #include <HTVMS_WaisProt.h>
@@ -68,28 +68,29 @@
 #endif /* VMS */
 
 #define MAX_MESSAGE_LEN 100000
-#define CHARS_PER_PAGE 10000 /* number of chars retrieved in each request */
+#define CHARS_PER_PAGE 10000	/* number of chars retrieved in each request */
 
 #define WAISSEARCH_DATE "Fri Jul 19 1991"
 
 /*			FROM WWW
-**			--------
-*/
+ *			--------
+ */
 #include <LYUtils.h>
 #include <LYLeaks.h>
 
 #define DIRECTORY "/cnidr.org:210/directory-of-servers"
 /* #define DIRECTORY "/quake.think.com:210/directory-of-servers" */
 
-#define BIG 1024	/* identifier size limit  @@@@@ */
+#define BIG 1024		/* identifier size limit  @@@@@ */
 
 #define BUFFER_SIZE 4096	/* Arbitrary size for efficiency */
 
 #define HEX_ESCAPE '%'
 
-static BOOL	as_gate;	/* Client is using us as gateway */
+static BOOL as_gate;		/* Client is using us as gateway */
+
+static char line[2048];		/* For building strings to display */
 
-static char	line[2048];	/* For building strings to display */
 				/* Must be able to take id */
 
 #define PUTC(c) (*target->isa->put_character)(target, c)
@@ -101,23 +102,22 @@ static char	line[2048];	/* For building strings to display */
 #define FREE_TARGET (*target->isa->_free)(target)
 
 struct _HTStructured {
-	const HTStructuredClass *	isa;
-	/* ... */
+    const HTStructuredClass *isa;
+    /* ... */
 };
 
 struct _HTStream {
-	const HTStreamClass *	isa;
-	/* ... */
+    const HTStreamClass *isa;
+    /* ... */
 };
 
 /* ------------------------------------------------------------------------ */
 /* ---------------- Local copy of connect_to_server calls ----------------- */
 /* ------------------------------------------------------------------------ */
 /* Returns 1 on success, 0 on fail, -1 on interrupt. */
-static int fd_mosaic_connect_to_server (
-	char *		host_name,
-	long		port,
-	long *		fd)
+static int fd_mosaic_connect_to_server(char *host_name,
+				       long port,
+				       long *fd)
 {
     char *dummy = NULL;
     int status;
@@ -125,7 +125,7 @@ static int fd_mosaic_connect_to_server (
 
     HTSprintf0(&dummy, "%s//%s:%d/", STR_WAIS_URL, host_name, port);
 
-    status = HTDoConnect (dummy, "WAIS", 210, (int *)fd);
+    status = HTDoConnect(dummy, "WAIS", 210, (int *) fd);
     if (status == HT_INTERRUPTED) {
 	result = -1;
     } else if (status < 0) {
@@ -139,35 +139,32 @@ static int fd_mosaic_connect_to_server (
 
 /* Returns 1 on success, 0 on fail, -1 on interrupt. */
 #ifdef VMS
-static int mosaic_connect_to_server (
-	char *		host_name,
-	long		port,
-	long *		fdp)
+static int mosaic_connect_to_server(char *host_name,
+				    long port,
+				    long *fdp)
 #else
-static int mosaic_connect_to_server (
-	char *		host_name,
-	long		port,
-	FILE **	fp)
-#endif /* VMS */
+static int mosaic_connect_to_server(char *host_name,
+				    long port,
+				    FILE **fp)
+#endif				/* VMS */
 {
 #ifndef VMS
-    FILE* file;
+    FILE *file;
 #endif /* VMS */
     long fd;
     int rv;
 
-    rv = fd_mosaic_connect_to_server (host_name, port, &fd);
+    rv = fd_mosaic_connect_to_server(host_name, port, &fd);
     if (rv == 0) {
-	HTAlert (gettext("Could not connect to WAIS server."));
+	HTAlert(gettext("Could not connect to WAIS server."));
 	return 0;
     } else if (rv == -1) {
-	HTAlert (CONNECTION_INTERRUPTED);
+	HTAlert(CONNECTION_INTERRUPTED);
 	return -1;
     }
-
 #ifndef VMS
-    if ((file = fdopen(fd,"r+")) == NULL) {
-	HTAlert (gettext("Could not open WAIS connection for reading."));
+    if ((file = fdopen(fd, "r+")) == NULL) {
+	HTAlert(gettext("Could not open WAIS connection for reading."));
 	return 0;
     }
 
@@ -183,9 +180,7 @@ static int mosaic_connect_to_server (
 /*								showDiags
 */
 /* modified from Jonny G's version in ui/question.c */
-static void showDiags (
-	HTStream *		target,
-	diagnosticRecord **	d)
+static void showDiags(HTStream *target, diagnosticRecord ** d)
 {
     long i;
 
@@ -201,159 +196,160 @@ static void showDiags (
 }
 
 /*	Matrix of allowed characters in filenames
-**	-----------------------------------------
-*/
+ *	-----------------------------------------
+ */
 
 static BOOL acceptable[256];
 static BOOL acceptable_inited = NO;
 
-static void init_acceptable (void)
+static void init_acceptable(void)
 {
     unsigned int i;
-    char * good =
-      "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789./-_$";
-    for(i=0; i<256; i++) acceptable[i] = NO;
-    for(;*good; good++) acceptable[(unsigned int)*good] = YES;
+    char *good =
+    "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789./-_$";
+
+    for (i = 0; i < 256; i++)
+	acceptable[i] = NO;
+    for (; *good; good++)
+	acceptable[(unsigned int) *good] = YES;
     acceptable_inited = YES;
 }
 
 /*	Transform file identifier into WWW address
-**	------------------------------------------
-**
-**
-** On exit,
-**	returns		nil if error
-**			pointer to malloced string (must be freed) if ok
-*/
-static char * WWW_from_archie (
-	char *		file)
+ *	------------------------------------------
+ *
+ *
+ * On exit,
+ *	returns		nil if error
+ *			pointer to malloced string (must be freed) if ok
+ */
+static char *WWW_from_archie(char *file)
 {
-    char * end;
-    char * result;
-    char * colon;
-    for(end=file; *end > ' '; end++);	/* assumes ASCII encoding*/
-    result = (char *)malloc(10 + (end-file));
-    if (!result) return result;		/* Malloc error */
+    char *end;
+    char *result;
+    char *colon;
+
+    for (end = file; *end > ' '; end++) ;	/* assumes ASCII encoding */
+    result = (char *) malloc(10 + (end - file));
+    if (!result)
+	return result;		/* Malloc error */
     strcpy(result, "file://");
-    strncat(result, file, end-file);
-    colon = strchr(result+7, ':');	/* Expect colon after host */
+    strncat(result, file, end - file);
+    colon = strchr(result + 7, ':');	/* Expect colon after host */
     if (colon) {
-	for(; colon[0]; colon[0]=colon[1], colon++);	/* move down */
+	for (; colon[0]; colon[0] = colon[1], colon++) ;	/* move down */
     }
     return result;
-} /* WWW_from_archie */
+}				/* WWW_from_archie */
 
 /*	Transform document identifier into URL
-**	--------------------------------------
-**
-**  Bugs: A static buffer of finite size is used!
-**	The format of the docid MUST be good!
-**
-**  On exit,
-**	returns		nil if error
-**			pointer to malloced string (must be freed) if ok
-*/
-static char hex [17] = "0123456789ABCDEF";
+ *	--------------------------------------
+ *
+ *  Bugs: A static buffer of finite size is used!
+ *	The format of the docid MUST be good!
+ *
+ *  On exit,
+ *	returns		nil if error
+ *			pointer to malloced string (must be freed) if ok
+ */
+static char hex[17] = "0123456789ABCDEF";
 
-static char * WWW_from_WAIS (
-	any *		docid)
+static char *WWW_from_WAIS(any *docid)
 {
     static char buf[BIG];
-    char * q = buf;
-    char * p = (docid->bytes);
-    char * result = NULL;
+    char *q = buf;
+    char *p = (docid->bytes);
+    char *result = NULL;
     int i, l;
 
     if (TRACE) {
 	char *p;
-	fprintf(tfp, "WAIS id (%d bytes) is ", (int)docid->size);
-	for (p = docid->bytes; p < docid->bytes+docid->size; p++) {
-	    if ((*p >= ' ') && (*p<= '~')) /* Assume ASCII! */
+
+	fprintf(tfp, "WAIS id (%d bytes) is ", (int) docid->size);
+	for (p = docid->bytes; p < docid->bytes + docid->size; p++) {
+	    if ((*p >= ' ') && (*p <= '~'))	/* Assume ASCII! */
 		fprintf(tfp, "%c", *p);
 	    else
-		fprintf(tfp, "<%x>", (unsigned)*p);
+		fprintf(tfp, "<%x>", (unsigned) *p);
 	}
 	fprintf(tfp, "\n");
     }
     for (p = docid->bytes;
-	 (p < docid->bytes+docid->size) && (q < &buf[BIG]);) {
+	 (p < docid->bytes + docid->size) && (q < &buf[BIG]);) {
 	CTRACE((tfp, "    Record type %d, length %d\n", p[0], p[1]));
 	if (*p > 10) {
 	    CTRACE((tfp, "Eh?  DOCID record type of %d!\n", *p));
 	    return 0;
-	}
-	{	/* Bug fix -- allow any byte value 15 Apr 93 */
+	} {			/* Bug fix -- allow any byte value 15 Apr 93 */
 	    unsigned int i = (unsigned) *p++;
 
 	    if (i > 99) {
-		*q++ = (i/100) + '0';
+		*q++ = (i / 100) + '0';
 		i = i % 100;
 	    }
 	    if (i > 9) {
-		*q++ = (i/10) + '0';
+		*q++ = (i / 10) + '0';
 		i = i % 10;
 	    }
 	    *q++ = i + '0';	/* Record type */
 	}
 	*q++ = '=';		/* Separate */
 	l = *p++;		/* Length */
-	for (i = 0; i < l; i++, p++){
+	for (i = 0; i < l; i++, p++) {
 	    if (!acceptable[*p]) {
 		*q++ = HEX_ESCAPE;	/* Means hex coming */
 		*q++ = hex[(*p) >> 4];
 		*q++ = hex[(*p) & 15];
-	    }
-	    else *q++ = *p;
+	    } else
+		*q++ = *p;
 	}
-	*q++= ';';		/* Terminate field */
+	*q++ = ';';		/* Terminate field */
     }
     *q++ = 0;			/* Terminate string */
     CTRACE((tfp, "WWW form of id: %s\n", buf));
     StrAllocCopy(result, buf);
     return result;
-} /* WWW_from_WAIS */
+}				/* WWW_from_WAIS */
 
 /*	Transform URL into WAIS document identifier
-**	-------------------------------------------
-**
-**  On entry,
-**	docname		points to valid name produced originally by
-**			WWW_from_WAIS
-**  On exit,
-**	docid->size	is valid
-**	docid->bytes	is malloced and must later be freed.
-*/
-static any * WAIS_from_WWW (
-	any *		docid,
-	char *		docname)
+ *	-------------------------------------------
+ *
+ *  On entry,
+ *	docname		points to valid name produced originally by
+ *			WWW_from_WAIS
+ *  On exit,
+ *	docid->size	is valid
+ *	docid->bytes	is malloced and must later be freed.
+ */
+static any *WAIS_from_WWW(any *docid, char *docname)
 {
-    char *z;	/* Output pointer */
-    char *sor;	/* Start of record - points to size field. */
-    char *p;	/* Input pointer */
-    char *q;	/* Poisition of "=" */
-    char *s;	/* Position of semicolon */
-    int n;	/* size */
+    char *z;			/* Output pointer */
+    char *sor;			/* Start of record - points to size field. */
+    char *p;			/* Input pointer */
+    char *q;			/* Poisition of "=" */
+    char *s;			/* Position of semicolon */
+    int n;			/* size */
 
     CTRACE((tfp, "WWW id (to become WAIS id): %s\n", docname));
-    for (n = 0, p = docname; *p; p++) { /* Count sizes of strings */
+    for (n = 0, p = docname; *p; p++) {		/* Count sizes of strings */
 	n++;
 	if (*p == ';')
 	    n--;		/* Not converted */
 	else if (*p == HEX_ESCAPE)
-	    n = n-2;		/* Save two bytes */
+	    n = n - 2;		/* Save two bytes */
 	docid->size = n;
     }
 
-    if (!(docid->bytes = (char *) malloc(docid->size))) /* result record */
-	    outofmem(__FILE__, "WAIS_from_WWW");
+    if (!(docid->bytes = (char *) malloc(docid->size)))		/* result record */
+	outofmem(__FILE__, "WAIS_from_WWW");
     z = docid->bytes;
 
-    for (p = docname; *p; ) {	/* Convert of strings */
-				/* Record type */
+    for (p = docname; *p;) {	/* Convert of strings */
+	/* Record type */
 
 	*z = 0;			/* Initialize record type */
 	while (*p >= '0' && *p <= '9') {
-	    *z = *z*10 + (*p++ - '0');	/* Decode decimal record type */
+	    *z = *z * 10 + (*p++ - '0');	/* Decode decimal record type */
 	}
 	z++;
 	if (*p != '=')
@@ -368,96 +364,98 @@ static any * WAIS_from_WWW (
 	if (!s)
 	    return 0;		/* Bad! No ';'; */
 	sor = z;		/* Remember where the size field was */
-	z++;			/* Skip record size for now	*/
-	for (p = q+1; *p != ';';) {
-	   if (*p == HEX_ESCAPE) {
+	z++;			/* Skip record size for now     */
+	for (p = q + 1; *p != ';';) {
+	    if (*p == HEX_ESCAPE) {
 		char c;
 		unsigned int b;
+
 		p++;
 		c = *p++;
-		b =   from_hex(c);
+		b = from_hex(c);
 		c = *p++;
 		if (!c)
 		    break;	/* Odd number of chars! */
-		*z++ = (b<<4) + from_hex(c);
+		*z++ = (b << 4) + from_hex(c);
 	    } else {
 		*z++ = *p++;	/* Record */
 	    }
 	}
-	*sor = (z-sor-1);	/* Fill in size -- not counting size itself */
+	*sor = (z - sor - 1);	/* Fill in size -- not counting size itself */
 	p++;			/* After semicolon: start of next record */
     }
 
     if (TRACE) {
 	char *p;
-	fprintf(tfp, "WAIS id (%d bytes) is ", (int)docid->size);
-	for (p = docid->bytes; p < docid->bytes+docid->size; p++) {
-	    if ((*p >= ' ') && (*p<= '~')) /* Assume ASCII! */
+
+	fprintf(tfp, "WAIS id (%d bytes) is ", (int) docid->size);
+	for (p = docid->bytes; p < docid->bytes + docid->size; p++) {
+	    if ((*p >= ' ') && (*p <= '~'))	/* Assume ASCII! */
 		fprintf(tfp, "%c", *p);
 	    else
-		fprintf(tfp, "<%x>", (unsigned)*p);
+		fprintf(tfp, "<%x>", (unsigned) *p);
 	}
 	fprintf(tfp, "\n");
     }
     return docid;		/* Ok */
 
-} /* WAIS_from_WWW */
+}				/* WAIS_from_WWW */
 
 /*	Send a plain text record to the client		output_text_record()
-**	--------------------------------------
-*/
-static void output_text_record (
-    HTStream *			target,
-    WAISDocumentText *		record,
-    boolean			quote_string_quotes,
-    boolean			binary)
+ *	--------------------------------------
+ */
+static void output_text_record(HTStream *target,
+			       WAISDocumentText *record,
+			       boolean quote_string_quotes,
+			       boolean binary)
 {
-  long count;
-  /* printf(" Text\n");
-     print_any("     DocumentID:  ", record->DocumentID);
-     printf("	  VersionNumber:  %d\n", record->VersionNumber);
+    long count;
+
+    /* printf(" Text\n");
+       print_any("     DocumentID:  ", record->DocumentID);
+       printf("     VersionNumber:  %d\n", record->VersionNumber);
      */
 
-  if (binary) {
-    (*target->isa->put_block)(target,
-			      record->DocumentText->bytes,
-			      record->DocumentText->size);
-    return;
-  }
+    if (binary) {
+	(*target->isa->put_block) (target,
+				   record->DocumentText->bytes,
+				   record->DocumentText->size);
+	return;
+    }
 
-  for (count = 0; count < record->DocumentText->size; count++){
-    long ch = (unsigned char)record->DocumentText->bytes[count];
-    if (ch == 27) {	/* What is this in for?  Tim */
+    for (count = 0; count < record->DocumentText->size; count++) {
+	long ch = (unsigned char) record->DocumentText->bytes[count];
+
+	if (ch == 27) {		/* What is this in for?  Tim */
 	    /* then we have an escape code */
 	    /* if the next letter is '(' or ')', then ignore two letters */
 	    if ('(' == record->DocumentText->bytes[count + 1] ||
 		')' == record->DocumentText->bytes[count + 1])
-	    count += 1;		    /* it is a term marker */
-	    else count += 4;		/* it is a paragraph marker */
-    } else if (ch == '\n' || ch == '\r') {
+		count += 1;	/* it is a term marker */
+	    else
+		count += 4;	/* it is a paragraph marker */
+	} else if (ch == '\n' || ch == '\r') {
 	    PUTC('\n');
-    } else if (HTCJK != NOCJK || ch == '\t' || isprint(ch)){
+	} else if (HTCJK != NOCJK || ch == '\t' || isprint(ch)) {
 	    PUTC(ch);
+	}
     }
-  }
-} /* output text record */
+}				/* output text record */
 
 /*	Format A Search response for the client		display_search_response
-**	---------------------------------------
-*/
+ *	---------------------------------------
+ */
 /* modified from tracy shen's version in wutil.c
  * displays either a text record or a set of headlines.
  */
-static void display_search_response (
-    HTStructured *		target,
-    SearchResponseAPDU *	response,
-    char *			database,
-    char *			keywords)
+static void display_search_response(HTStructured * target, SearchResponseAPDU *response,
+				    char *database,
+				    char *keywords)
 {
-    WAISSearchResponse	*info;
+    WAISSearchResponse *info;
     long i, k;
 
-    BOOL archie =  strstr(database, "archie")!=0;	/* Special handling */
+    BOOL archie = strstr(database, "archie") != 0;	/* Special handling */
 
     CTRACE((tfp, "HTWAIS: Displaying search response\n"));
     PUTS(gettext("Index "));
@@ -465,8 +463,8 @@ static void display_search_response (
     PUTS(database);
     END(HTML_EM);
     sprintf(line, gettext(" contains the following %d item%s relevant to \""),
-	    (int)(response->NumberOfRecordsReturned),
-	    response->NumberOfRecordsReturned ==1 ? "" : "s");
+	    (int) (response->NumberOfRecordsReturned),
+	    response->NumberOfRecordsReturned == 1 ? "" : "s");
     PUTS(line);
     START(HTML_EM);
     PUTS(keywords);
@@ -480,33 +478,34 @@ static void display_search_response (
     START(HTML_OL);
 
     if (response->DatabaseDiagnosticRecords != 0) {
-	info = (WAISSearchResponse *)response->DatabaseDiagnosticRecords;
-	i =0;
+	info = (WAISSearchResponse *) response->DatabaseDiagnosticRecords;
+	i = 0;
 
 	if (info->Diagnostics != NULL)
-	    showDiags((HTStream*)target, info->Diagnostics);
+	    showDiags((HTStream *) target, info->Diagnostics);
 
 	if (info->DocHeaders != 0) {
-	    for (k = 0; info->DocHeaders[k] != 0; k++ ) {
-		WAISDocumentHeader* head = info->DocHeaders[k];
-		char * headline = trim_junk(head->Headline);
-		any * docid = head->DocumentID;
-		char * docname;		/* printable version of docid */
+	    for (k = 0; info->DocHeaders[k] != 0; k++) {
+		WAISDocumentHeader *head = info->DocHeaders[k];
+		char *headline = trim_junk(head->Headline);
+		any *docid = head->DocumentID;
+		char *docname;	/* printable version of docid */
 
 		i++;
 		/*
-		**  Make a printable string out of the document id.
-		*/
+		 * Make a printable string out of the document id.
+		 */
 		CTRACE((tfp, "HTWAIS:  %2ld: Score: %4ld, lines:%4ld '%s'\n",
-			    i,
-			    (long int)(info->DocHeaders[k]->Score),
-			    (long int)(info->DocHeaders[k]->Lines),
-			    headline));
+			i,
+			(long int) (info->DocHeaders[k]->Score),
+			(long int) (info->DocHeaders[k]->Lines),
+			headline));
 
 		START(HTML_LI);
 
 		if (archie) {
-		    char * www_name = WWW_from_archie(headline);
+		    char *www_name = WWW_from_archie(headline);
+
 		    if (www_name) {
 			HTStartAnchor(target, NULL, www_name);
 			PUTS(headline);
@@ -516,21 +515,22 @@ static void display_search_response (
 			PUTS(headline);
 			PUTS(gettext(" (bad file name)"));
 		    }
-		} else { /* Not archie */
-		    docname =  WWW_from_WAIS(docid);
+		} else {	/* Not archie */
+		    docname = WWW_from_WAIS(docid);
 		    if (docname) {
 			if ((head->Types) &&
-			   (!strcmp(head->Types[0], "URL"))) {
+			    (!strcmp(head->Types[0], "URL"))) {
 			    HTStartAnchor(target, NULL, headline);
-			} else{
-			    char * dbname = HTEscape(database, URL_XPALPHAS);
-			    char * w3_address = NULL;
+			} else {
+			    char *dbname = HTEscape(database, URL_XPALPHAS);
+			    char *w3_address = NULL;
+
 			    HTSprintf0(&w3_address,
-					"/%s/%s/%d/%s",
-					dbname,
-					head->Types ? head->Types[0] : "TEXT",
-					(int)(head->DocumentLength),
-					docname);
+				       "/%s/%s/%d/%s",
+				       dbname,
+				       head->Types ? head->Types[0] : "TEXT",
+				       (int) (head->DocumentLength),
+				       docname);
 			    HTStartAnchor(target, NULL, w3_address);
 			    FREE(w3_address);
 			    FREE(dbname);
@@ -546,31 +546,31 @@ static void display_search_response (
 		sprintf(line, "%5ld  %5ld  ",
 			head->Score,
 			head->Lines);
-		PUTS( line);
+		PUTS(line);
 		MAYBE_END(HTML_LI);
-	    } /* next document header */
-	} /* if there were any document headers */
-
+	    }			/* next document header */
+	}
+	/* if there were any document headers */
 	if (info->ShortHeaders != 0) {
 	    k = 0;
 	    while (info->ShortHeaders[k] != 0) {
 		i++;
-		PUTS( gettext("(Short Header record, can't display)"));
+		PUTS(gettext("(Short Header record, can't display)"));
 	    }
 	}
 	if (info->LongHeaders != 0) {
 	    k = 0;
 	    while (info->LongHeaders[k] != 0) {
 		i++;
-		PUTS( gettext("\nLong Header record, can't display\n"));
+		PUTS(gettext("\nLong Header record, can't display\n"));
 	    }
 	}
 	if (info->Text != 0) {
 	    k = 0;
 	    while (info->Text[k] != 0) {
 		i++;
-		PUTS( gettext("\nText record\n"));
-		output_text_record((HTStream*)target,
+		PUTS(gettext("\nText record\n"));
+		output_text_record((HTStream *) target,
 				   info->Text[k++], false, false);
 	    }
 	}
@@ -578,7 +578,7 @@ static void display_search_response (
 	    k = 0;
 	    while (info->Headlines[k] != 0) {
 		i++;
-		PUTS( gettext("\nHeadline record, can't display\n"));
+		PUTS(gettext("\nHeadline record, can't display\n"));
 		/* dsply_headline_record( info->Headlines[k++]); */
 	    }
 	}
@@ -586,26 +586,24 @@ static void display_search_response (
 	    k = 0;
 	    while (info->Codes[k] != 0) {
 		i++;
-		PUTS( gettext("\nCode record, can't display\n"));
+		PUTS(gettext("\nCode record, can't display\n"));
 		/* dsply_code_record( info->Codes[k++]); */
 	    }
 	}
-    }	/* Loop: display user info */
+    }				/* Loop: display user info */
     END(HTML_OL);
     PUTC('\n');
 }
 
 /*		Load by name					HTLoadWAIS
-**		============
-**
-**  This renders any object or search as required.
-*/
-int HTLoadWAIS (
-	const char *		arg,
-	HTParentAnchor *	anAnchor,
-	HTFormat		format_out,
-	HTStream*		sink)
-
+ *		============
+ *
+ *  This renders any object or search as required.
+ */
+int HTLoadWAIS(const char *arg,
+	       HTParentAnchor *anAnchor,
+	       HTFormat format_out,
+	       HTStream *sink)
 #define MAX_KEYWORDS_LENGTH 1000
 #define MAX_SERVER_LENGTH 1000
 #define MAX_DATABASE_LENGTH 1000
@@ -613,26 +611,28 @@ int HTLoadWAIS (
 #define MAXDOCS 200
 
 {
-    char * key;			  /* pointer to keywords in URL */
-    char* request_message = NULL; /* arbitrary message limit */
-    char* response_message = NULL; /* arbitrary message limit */
-    long request_buffer_length; /* how of the request is left */
-    SearchResponseAPDU	*retrieval_response = 0;
+    char *key;			/* pointer to keywords in URL */
+    char *request_message = NULL;	/* arbitrary message limit */
+    char *response_message = NULL;	/* arbitrary message limit */
+    long request_buffer_length;	/* how of the request is left */
+    SearchResponseAPDU *retrieval_response = 0;
     char keywords[MAX_KEYWORDS_LENGTH + 1];
     char *server_name;
-    char *wais_database = NULL;		/* name of current database */
-    char *www_database;			/* Same name escaped */
+    char *wais_database = NULL;	/* name of current database */
+    char *www_database;		/* Same name escaped */
     char *service;
     char *doctype;
     char *doclength;
     long document_length;
     char *docname;
+
 #ifdef VMS
     long connection = 0;
+
 #else
     FILE *connection = NULL;
 #endif /* VMS */
-    char * names;		/* Copy of arg to be hacked up */
+    char *names;		/* Copy of arg to be hacked up */
     BOOL ok = NO;
     int return_status = HT_LOADED;
     int rv;
@@ -640,31 +640,35 @@ int HTLoadWAIS (
     if (!acceptable_inited)
 	init_acceptable();
 
-    /*	Decipher and check syntax of WWW address:
-    **	----------------------------------------
-    **
-    **	First we remove the "wais:" if it was specified.  920110
-    */
+    /* Decipher and check syntax of WWW address:
+     * ----------------------------------------
+     *
+     * First we remove the "wais:" if it was specified.  920110
+     */
     names = HTParse(arg, "", PARSE_HOST | PARSE_PATH | PARSE_PUNCTUATION);
     key = strchr(names, '?');
 
     if (key) {
-	char * p;
-	*key++ = 0;	/* Split off keywords */
-	for (p=key; *p; p++) if (*p == '+') *p = ' ';
+	char *p;
+
+	*key++ = 0;		/* Split off keywords */
+	for (p = key; *p; p++)
+	    if (*p == '+')
+		*p = ' ';
 	HTUnEscape(key);
     }
     if (names[0] == '/') {
-	server_name = names+1;
-	if ((as_gate =(*server_name == '/')) != 0)
+	server_name = names + 1;
+	if ((as_gate = (*server_name == '/')) != 0)
 	    server_name++;	/* Accept one or two */
-	www_database = strchr(server_name,'/');
+	www_database = strchr(server_name, '/');
 	if (www_database) {
-	    *www_database++ = 0;		/* Separate database name */
+	    *www_database++ = 0;	/* Separate database name */
 	    doctype = strchr(www_database, '/');
-	    if (key) ok = YES;	/* Don't need doc details */
-	    else if (doctype) { /* If not search parse doc details */
-		*doctype++ = 0; /* Separate rest of doc address */
+	    if (key)
+		ok = YES;	/* Don't need doc details */
+	    else if (doctype) {	/* If not search parse doc details */
+		*doctype++ = 0;	/* Separate rest of doc address */
 		doclength = strchr(doctype, '/');
 		if (doclength) {
 		    *doclength++ = 0;
@@ -674,15 +678,15 @@ int HTLoadWAIS (
 			if (docname) {
 			    *docname++ = 0;
 			    ok = YES;	/* To avoid a goto! */
-			} /* if docname */
-		    } /* if document_length valid */
-		} /* if doclength */
-	    } else { /* no doctype?  Assume index required */
+			}	/* if docname */
+		    }		/* if document_length valid */
+		}		/* if doclength */
+	    } else {		/* no doctype?  Assume index required */
 		if (!key)
 		    key = "";
 		ok = YES;
-	    } /* if doctype */
-	} /* if database */
+	    }			/* if doctype */
+	}			/* if database */
     }
 
     if (!ok)
@@ -705,6 +709,7 @@ int HTLoadWAIS (
 
     } else if (!(key && !*key)) {
 	int status;
+
 	CTRACE((tfp, "===WAIS=== calling mosaic_connect_to_server\n"));
 	status = mosaic_connect_to_server(server_name,
 					  atoi(service),
@@ -720,37 +725,38 @@ int HTLoadWAIS (
 	}
     }
 
-    StrAllocCopy(wais_database,www_database);
+    StrAllocCopy(wais_database, www_database);
     HTUnEscape(wais_database);
 
     /*
-    **	This below fixed size stuff is terrible.
-    */
+     * This below fixed size stuff is terrible.
+     */
 #ifdef VMS
     if ((request_message = typecallocn(char, MAX_MESSAGE_LEN)) == 0)
-	outofmem(__FILE__, "HTLoadWAIS");
+	  outofmem(__FILE__, "HTLoadWAIS");
     if ((response_message = typecallocn(char, MAX_MESSAGE_LEN)) == 0)
-	outofmem(__FILE__, "HTLoadWAIS");
+	  outofmem(__FILE__, "HTLoadWAIS");
+
 #else
-    request_message = (char*)s_malloc((size_t)MAX_MESSAGE_LEN * sizeof(char));
-    response_message = (char*)s_malloc((size_t)MAX_MESSAGE_LEN * sizeof(char));
+    request_message = (char *) s_malloc((size_t) MAX_MESSAGE_LEN * sizeof(char));
+    response_message = (char *) s_malloc((size_t) MAX_MESSAGE_LEN * sizeof(char));
 #endif /* VMS */
 
     /*
-    **	If keyword search is performed but there are no keywords,
-    **	the user has followed a link to the index itself.  It would be
-    **	appropriate at this point to send him the .SRC file - how?
-    */
-    if (key && !*key) {				/* I N D E X */
+     * If keyword search is performed but there are no keywords, the user has
+     * followed a link to the index itself.  It would be appropriate at this
+     * point to send him the .SRC file - how?
+     */
+    if (key && !*key) {		/* I N D E X */
 #ifdef CACHE_FILE_PREFIX
-	char * filename = NULL;
-	FILE * fp;
+	char *filename = NULL;
+	FILE *fp;
 #endif
-	HTStructured * target = HTML_new(anAnchor, format_out, sink);
+	HTStructured *target = HTML_new(anAnchor, format_out, sink);
 
 	START(HTML_HEAD);
 	PUTC('\n');
-	HTStartIsIndex(target, HTWAIS_SOLICIT_QUERY , NULL);
+	HTStartIsIndex(target, HTWAIS_SOLICIT_QUERY, NULL);
 	PUTC('\n');
 
 	{
@@ -777,23 +783,25 @@ int HTLoadWAIS (
 
 	}
 	/*
-	**  If we have seen a source file for this database, use that.
-	*/
+	 * If we have seen a source file for this database, use that.
+	 */
 #ifdef CACHE_FILE_PREFIX
 	HTSprintf0(&filename, "%sWSRC-%s:%s:%.100s.txt",
-		CACHE_FILE_PREFIX,
-		server_name, service, www_database);
+		   CACHE_FILE_PREFIX,
+		   server_name, service, www_database);
 
 	fp = fopen(filename, "r");	/* Have we found this already? */
 	CTRACE((tfp, "HTWAIS: Description of server %s %s.\n",
-		    filename,
-		    fp ? "exists already" : "does NOT exist!"));
+		filename,
+		fp ? "exists already" : "does NOT exist!"));
 
 	if (fp) {
 	    char c;
-	    START(HTML_PRE);		/* Preformatted description */
+
+	    START(HTML_PRE);	/* Preformatted description */
 	    PUTC('\n');
-	    while((c=getc(fp))!=EOF) PUTC(c);	/* Transfer file */
+	    while ((c = getc(fp)) != EOF)
+		PUTC(c);	/* Transfer file */
 	    END(HTML_PRE);
 	    fclose(fp);
 	}
@@ -803,17 +811,17 @@ int HTLoadWAIS (
 	PUTS(gettext("\nEnter the 's'earch command and then specify search words.\n"));
 
 	FREE_TARGET;
-    } else if (key) {					/* S E A R C H */
+    } else if (key) {		/* S E A R C H */
 	char *p;
-	HTStructured * target;
+	HTStructured *target;
 
 	strncpy(keywords, key, MAX_KEYWORDS_LENGTH);
 	while ((p = strchr(keywords, '+')) != 0)
 	    *p = ' ';
 
 	/*
-	**  Send advance title to get something fast to the other end.
-	*/
+	 * Send advance title to get something fast to the other end.
+	 */
 	target = HTML_new(anAnchor, format_out, sink);
 
 	START(HTML_HEAD);
@@ -842,15 +850,15 @@ int HTLoadWAIS (
 	END(HTML_H1);
 	PUTC('\n');
 
-	request_buffer_length = MAX_MESSAGE_LEN; /* Amount left */
+	request_buffer_length = MAX_MESSAGE_LEN;	/* Amount left */
 	CTRACE((tfp, "HTWAIS: Search for `%s' in `%s'\n",
-		    keywords, wais_database));
-	if(NULL ==
-	generate_search_apdu(request_message + HEADER_LENGTH,
-				&request_buffer_length,
-				keywords, wais_database, NULL, MAXDOCS)) {
+		keywords, wais_database));
+	if (NULL ==
+	    generate_search_apdu(request_message + HEADER_LENGTH,
+				 &request_buffer_length,
+				 keywords, wais_database, NULL, MAXDOCS)) {
 #ifdef VMS
-	    HTAlert (gettext("HTWAIS: Request too large."));
+	    HTAlert(gettext("HTWAIS: Request too large."));
 	    return_status = HT_NOT_LOADED;
 	    FREE_TARGET;
 	    goto CleanUp;
@@ -860,74 +868,75 @@ int HTLoadWAIS (
 	}
 
 	HTProgress(gettext("Searching WAIS database..."));
-	rv = interpret_message (request_message,
-				MAX_MESSAGE_LEN - request_buffer_length,
-				response_message,
-				MAX_MESSAGE_LEN,
-				connection,
-				false	/* true verbose */
-			       );
+	rv = interpret_message(request_message,
+			       MAX_MESSAGE_LEN - request_buffer_length,
+			       response_message,
+			       MAX_MESSAGE_LEN,
+			       connection,
+			       false	/* true verbose */
+	    );
 
 	if (rv == HT_INTERRUPTED) {
-	    HTAlert (gettext("Search interrupted."));
+	    HTAlert(gettext("Search interrupted."));
 	    return_status = HT_INTERRUPTED;
 	    FREE_TARGET;
 	    goto CleanUp;
 	} else if (!rv) {
 #ifdef VMS
-	    HTAlert (HTWAIS_MESSAGE_TOO_BIG);
+	    HTAlert(HTWAIS_MESSAGE_TOO_BIG);
 	    return_status = HT_NOT_LOADED;
 	    FREE_TARGET;
 	    goto CleanUp;
 #else
 	    panic("returned message too large");
 #endif /* VMS */
-	} else {	/* returned message ok */
-	    SearchResponseAPDU	*query_response = 0;
+	} else {		/* returned message ok */
+	    SearchResponseAPDU *query_response = 0;
+
 	    readSearchResponseAPDU(&query_response,
-		response_message + HEADER_LENGTH);
+				   response_message + HEADER_LENGTH);
 	    display_search_response(target,
-		query_response, wais_database, keywords);
+				    query_response, wais_database, keywords);
 	    if (query_response->DatabaseDiagnosticRecords)
-		freeWAISSearchResponse(
-			query_response->DatabaseDiagnosticRecords);
-	    freeSearchResponseAPDU( query_response);
-	}	/* returned message not too large */
+		freeWAISSearchResponse(query_response->DatabaseDiagnosticRecords);
+	    freeSearchResponseAPDU(query_response);
+	}			/* returned message not too large */
 	FREE_TARGET;
     } else {			/* D O C U M E N T    F E T C H */
 	HTFormat format_in;
-	boolean binary;     /* how to transfer stuff coming over */
-	HTStream * target;
+	boolean binary;		/* how to transfer stuff coming over */
+	HTStream *target;
 	long count;
-	any   doc_chunk;
-	any * docid = &doc_chunk;
+	any doc_chunk;
+	any *docid = &doc_chunk;
 
-	CTRACE((tfp, "HTWAIS: Retrieve document id `%s' type `%s' length %ld\n",
-		    docname, doctype, document_length));
+	CTRACE((tfp,
+		"HTWAIS: Retrieve document id `%s' type `%s' length %ld\n",
+		docname, doctype, document_length));
 
 	format_in =
-	  !strcmp(doctype, "WSRC") ? HTAtom_for("application/x-wais-source") :
-	  !strcmp(doctype, "TEXT") ? HTAtom_for("text/plain") :
-	  !strcmp(doctype, "HTML") ? HTAtom_for("text/html") :
-	  !strcmp(doctype, "GIF")  ? HTAtom_for("image/gif") :
-				     HTAtom_for("application/octet-stream");
+	    !strcmp(doctype, "WSRC") ? HTAtom_for("application/x-wais-source") :
+	    !strcmp(doctype, "TEXT") ? HTAtom_for("text/plain") :
+	    !strcmp(doctype, "HTML") ? HTAtom_for("text/html") :
+	    !strcmp(doctype, "GIF") ? HTAtom_for("image/gif") :
+	    HTAtom_for("application/octet-stream");
 	binary =
-	  0 != strcmp(doctype, "WSRC") &&
-	  0 != strcmp(doctype, "TEXT") &&
-	  0 != strcmp(doctype, "HTML") ;
+	    0 != strcmp(doctype, "WSRC") &&
+	    0 != strcmp(doctype, "TEXT") &&
+	    0 != strcmp(doctype, "HTML");
 
 	target = HTStreamStack(format_in, format_out, sink, anAnchor);
 	if (!target)
 	    return HTLoadError(sink, 500,
 			       gettext("Can't convert format of WAIS document"));
 	/*
-	**  Decode hex or litteral format for document ID.
-	*/
+	 * Decode hex or litteral format for document ID.
+	 */
 	WAIS_from_WWW(docid, docname);
 
 	/*
-	**  Loop over slices of the document.
-	*/
+	 * Loop over slices of the document.
+	 */
 	for (count = 0;
 	     count * CHARS_PER_PAGE < document_length;
 	     count++) {
@@ -938,12 +947,12 @@ int HTLoadWAIS (
 #else
 	    char *type = s_strdup(doctype);	/* Gets freed I guess */
 #endif /* VMS */
-	    request_buffer_length = MAX_MESSAGE_LEN; /* Amount left */
+	    request_buffer_length = MAX_MESSAGE_LEN;	/* Amount left */
 	    CTRACE((tfp, "HTWAIS: Slice number %ld\n", count));
 
 	    if (HTCheckForInterrupt()) {
-		HTAlert (TRANSFER_INTERRUPTED);
-		(*target->isa->_abort)(target, NULL);
+		HTAlert(TRANSFER_INTERRUPTED);
+		(*target->isa->_abort) (target, NULL);
 #ifdef VMS
 		FREE(type);
 #endif /* VMS */
@@ -957,13 +966,13 @@ int HTLoadWAIS (
 					docid,
 					CT_byte,
 					count * CHARS_PER_PAGE,
-		    ((count + 1) * CHARS_PER_PAGE <= document_length ?
-					(count + 1) * CHARS_PER_PAGE :
-					document_length),
+					(((count + 1) * CHARS_PER_PAGE <= document_length)
+					 ? (count + 1) * CHARS_PER_PAGE
+					 : document_length),
 					type,
 					wais_database)) {
 #ifdef VMS
-		HTAlert (gettext("HTWAIS: Request too long."));
+		HTAlert(gettext("HTWAIS: Request too long."));
 		return_status = HT_NOT_LOADED;
 		FREE_TARGET;
 		FREE(type);
@@ -975,18 +984,18 @@ int HTLoadWAIS (
 	    }
 
 	    /*
-	    **	Actually do the transaction given by request_message.
-	    */
+	     * Actually do the transaction given by request_message.
+	     */
 	    HTProgress(gettext("Fetching WAIS document..."));
 	    rv = interpret_message(request_message,
 				   MAX_MESSAGE_LEN - request_buffer_length,
 				   response_message,
 				   MAX_MESSAGE_LEN,
 				   connection,
-				   false /* true verbose */
-				  );
+				   false	/* true verbose */
+		);
 	    if (rv == HT_INTERRUPTED) {
-		HTAlert (TRANSFER_INTERRUPTED);
+		HTAlert(TRANSFER_INTERRUPTED);
 		return_status = HT_INTERRUPTED;
 		FREE_TARGET;
 		FREE(type);
@@ -994,7 +1003,7 @@ int HTLoadWAIS (
 		goto CleanUp;
 	    } else if (!rv) {
 #ifdef VMS
-		HTAlert (HTWAIS_MESSAGE_TOO_BIG);
+		HTAlert(HTWAIS_MESSAGE_TOO_BIG);
 		return_status = HT_NOT_LOADED;
 		FREE_TARGET;
 		FREE(type);
@@ -1006,8 +1015,8 @@ int HTLoadWAIS (
 	    }
 
 	    /*
-	    **	Parse the result which came back into memory.
-	    */
+	     * Parse the result which came back into memory.
+	     */
 	    readSearchResponseAPDU(&retrieval_response,
 				   response_message + HEADER_LENGTH);
 
@@ -1015,36 +1024,36 @@ int HTLoadWAIS (
 		((WAISSearchResponse *)
 		 retrieval_response->DatabaseDiagnosticRecords)->Text) {
 		/* display_search_response(target, retrieval_response,
-					wais_database, keywords); */
+		   wais_database, keywords); */
 		PUTS(gettext("No text was returned!\n"));
 		/* panic("No text was returned"); */
 	    } else {
 		output_text_record(target,
 				   ((WAISSearchResponse *)
-		    retrieval_response->DatabaseDiagnosticRecords)->Text[0],
+				    retrieval_response->DatabaseDiagnosticRecords)->Text[0],
 				   false, binary);
-	    } /* If text existed */
+	    }			/* If text existed */
 
 #ifdef VMS
 	    FREE(type);
 #endif /* VMS */
-	}	/* Loop over slices */
+	}			/* Loop over slices */
 
 	FREE_TARGET;
 	FREE(docid->bytes);
 
-	freeWAISSearchResponse( retrieval_response->DatabaseDiagnosticRecords);
-	freeSearchResponseAPDU( retrieval_response);
+	freeWAISSearchResponse(retrieval_response->DatabaseDiagnosticRecords);
+	freeSearchResponseAPDU(retrieval_response);
 
-    } /* If document rather than search */
+    }				/* If document rather than search */
 
-CleanUp:
+  CleanUp:
     /*
-    **	(This postponed until later,  after a timeout:)
-    */
+     * (This postponed until later, after a timeout:)
+     */
 #ifdef VMS
     if (connection)
-	NETCLOSE((int)connection);
+	NETCLOSE((int) connection);
 #else
     if (connection)
 	fclose(connection);
@@ -1065,5 +1074,6 @@ CleanUp:
 #define _HTWAIS_C_1_INIT { "wais", HTLoadWAIS, NULL }
 GLOBALDEF(HTProtocol, HTWAIS, _HTWAIS_C_1_INIT);
 #else
-GLOBALDEF HTProtocol HTWAIS = { "wais", HTLoadWAIS, NULL };
+GLOBALDEF HTProtocol HTWAIS =
+{"wais", HTLoadWAIS, NULL};
 #endif /* GLOBALDEF_IS_MACRO */
diff --git a/WWW/Library/Implementation/HTWAIS.h b/WWW/Library/Implementation/HTWAIS.h
index 7314025f..5f7af9f1 100644
--- a/WWW/Library/Implementation/HTWAIS.h
+++ b/WWW/Library/Implementation/HTWAIS.h
@@ -28,7 +28,8 @@
 #include <HTAccess.h>
 
 #ifdef GLOBALREF_IS_MACRO
-extern GLOBALREF(HTProtocol, HTWAIS);
+extern GLOBALREF (HTProtocol, HTWAIS);
+
 #else
 GLOBALREF HTProtocol HTWAIS;
 #endif /* GLOBALDEF_IS_MACRO */
diff --git a/WWW/Library/Implementation/HTWSRC.c b/WWW/Library/Implementation/HTWSRC.c
index 55d6dea6..31822b8e 100644
--- a/WWW/Library/Implementation/HTWSRC.c
+++ b/WWW/Library/Implementation/HTWSRC.c
@@ -1,12 +1,12 @@
 /*			Parse WAIS Source file			HTWSRC.c
-**			======================
-**
-**	This module parses a stream with WAIS source file
-**	format information on it and creates a structured stream.
-**	That structured stream is then converted into whatever.
-**
-**	3 June 93	Bug fix: Won't crash if no description
-*/
+ *			======================
+ *
+ *	This module parses a stream with WAIS source file
+ *	format information on it and creates a structured stream.
+ *	That structured stream is then converted into whatever.
+ *
+ *	3 June 93	Bug fix: Won't crash if no description
+ */
 
 #include <HTUtils.h>
 
@@ -23,8 +23,8 @@
 #define CACHE_PERIOD (7*86400)	/* Time to keep .src file in seconds */
 
 struct _HTStructured {
-	const HTStructuredClass *	isa;
-	/* ... */
+    const HTStructuredClass *isa;
+    /* ... */
 };
 
 #define PUTC(c) (*me->target->isa->put_character)(me->target, c)
@@ -34,154 +34,161 @@ struct _HTStructured {
 #define MAYBE_END(e) if (HTML_dtd.tags[e].contents != SGML_EMPTY) \
 			(*me->target->isa->end_element)(me->target, e, 0)
 
-
 /*	Here are the parameters which can be specified in a  source file
 */
-static const char* par_name[] = {
-	"version",
-	"ip-address",
+static const char *par_name[] =
+{
+    "version",
+    "ip-address",
 #define PAR_IP_NAME 2
-	"ip-name",
+    "ip-name",
 #define PAR_TCP_PORT 3
-	"tcp-port",
+    "tcp-port",
 #define PAR_DATABASE_NAME 4
-	"database-name",
+    "database-name",
 #define PAR_COST 5
-	"cost",
+    "cost",
 #define PAR_COST_UNIT 6
-	"cost-unit",
+    "cost-unit",
 #define PAR_FREE 7
-	"free",
+    "free",
 #define PAR_MAINTAINER 8
-	"maintainer",
+    "maintainer",
 #define PAR_DESCRIPTION 9
-	"description",
-	"keyword-list",
-	"source",
-	"window-geometry",
-	"configuration",
-	"script",
-	"update-time",
-	"contact-at",
-	"last-contacted",
-	"confidence",
-	"num-docs-to-request",
-	"font",
-	"font-size",
+    "description",
+    "keyword-list",
+    "source",
+    "window-geometry",
+    "configuration",
+    "script",
+    "update-time",
+    "contact-at",
+    "last-contacted",
+    "confidence",
+    "num-docs-to-request",
+    "font",
+    "font-size",
 #define PAR_UNKNOWN 22
-	"unknown",
-	0,				/* Terminate list */
+    "unknown",
+    0,				/* Terminate list */
 #define PAR_COUNT 23
-} ;
-
-
-enum tokenstate { beginning, before_tag, colon, before_value,
-		value, bracketed_value, quoted_value, escape_in_quoted, done };
+};
 
+enum tokenstate {
+    beginning,
+    before_tag,
+    colon,
+    before_value,
+    value,
+    bracketed_value,
+    quoted_value,
+    escape_in_quoted,
+    done
+};
 
 /*		Stream Object
-**		------------
-**
-**	The target is the structured stream down which the
-**	parsed results will go.
-**
-**	all the static stuff below should go in here to make it reentrant
-*/
+ *		------------
+ *
+ *	The target is the structured stream down which the
+ *	parsed results will go.
+ *
+ *	all the static stuff below should go in here to make it reentrant
+ */
 
 struct _HTStream {
-	const HTStreamClass *	isa;
-	HTStructured *		target;
-	char *			par_value[PAR_COUNT];
-	enum tokenstate		state;
-	char			param[BIG+1];
-	int			param_number;
-	int			param_count;
+    const HTStreamClass *isa;
+    HTStructured *target;
+    char *par_value[PAR_COUNT];
+    enum tokenstate state;
+    char param[BIG + 1];
+    int param_number;
+    int param_count;
 };
 
-
-
-
-const char * hex = "0123456789ABCDEF";
+const char *hex = "0123456789ABCDEF";
 
 /*	Decode one hex character
 */
 
-char from_hex (char  c)
+char from_hex(char c)
 {
-    return  (char) (      (c>='0')&&(c<='9') ? c-'0'
-			: (c>='A')&&(c<='F') ? c-'A'+10
-			: (c>='a')&&(c<='f') ? c-'a'+10
-			:		       0);
+    return (char) ((c >= '0') && (c <= '9') ? c - '0'
+		   : (c >= 'A') && (c <= 'F') ? c - 'A' + 10
+		   : (c >= 'a') && (c <= 'f') ? c - 'a' + 10
+		   : 0);
 }
 
-
 /*			State machine
-**			-------------
-**
-** On entry,
-**	me->state	is a valid state (see WSRC_init)
-**	c		is the next character
-** On exit,
-**	returns 1	Done with file
-**		0	Continue. me->state is updated if necessary.
-**		-1	Syntax error error
-*/
-
+ *			-------------
+ *
+ * On entry,
+ *	me->state	is a valid state (see WSRC_init)
+ *	c		is the next character
+ * On exit,
+ *	returns 1	Done with file
+ *		0	Continue. me->state is updated if necessary.
+ *		-1	Syntax error error
+ */
 
 /*		Treat One Character
-**		-------------------
-*/
-static void WSRCParser_put_character (HTStream*  me, char  c)
+ *		-------------------
+ */
+static void WSRCParser_put_character(HTStream *me, char c)
 {
     switch (me->state) {
     case beginning:
-	if (c=='(') me->state = before_tag;
+	if (c == '(')
+	    me->state = before_tag;
 	break;
 
     case before_tag:
-	if (c==')') {
+	if (c == ')') {
 	    me->state = done;
-	    return;			/* Done with input file */
-	} else if (c==':') {
+	    return;		/* Done with input file */
+	} else if (c == ':') {
 	    me->param_count = 0;
 	    me->state = colon;
-	}				/* Ignore other text */
+	}			/* Ignore other text */
 	break;
 
     case colon:
 	if (WHITE(c)) {
 	    me->param[me->param_count++] = 0;	/* Terminate */
-	    for(me->param_number = 0; par_name[me->param_number]; me->param_number++) {
-		if (0==strcmp(par_name[me->param_number], me->param)) {
+	    for (me->param_number = 0;
+		 par_name[me->param_number];
+		 me->param_number++) {
+		if (0 == strcmp(par_name[me->param_number], me->param)) {
 		    break;
 		}
 	    }
 	    if (!par_name[me->param_number]) {	/* Unknown field */
 		CTRACE((tfp, "HTWSRC: Unknown field `%s' in source file\n",
-			    me->param));
+			me->param));
 		me->param_number = PAR_UNKNOWN;
 		me->state = before_value;	/* Could be better ignore */
 		return;
 	    }
 	    me->state = before_value;
 	} else {
-	    if (me->param_count < PARAM_MAX)  me->param[me->param_count++] = c;
+	    if (me->param_count < PARAM_MAX)
+		me->param[me->param_count++] = c;
 	}
 	break;
 
     case before_value:
-	if (c==')') {
+	if (c == ')') {
 	    me->state = done;
-	    return;			/* Done with input file */
+	    return;		/* Done with input file */
 	}
-	if (WHITE(c)) return;		/* Skip white space */
+	if (WHITE(c))
+	    return;		/* Skip white space */
 	me->param_count = 0;
-	if (c=='"') {
+	if (c == '"') {
 	    me->state = quoted_value;
 	    break;
 	}
-	me->state = (c=='"') ? quoted_value :
-		    (c=='(') ? bracketed_value : value;
+	me->state = (c == '"') ? quoted_value :
+	    (c == '(') ? bracketed_value : value;
 	me->param[me->param_count++] = c;	/* Don't miss first character */
 	break;
 
@@ -191,71 +198,76 @@ static void WSRCParser_put_character (HTStream*  me, char  c)
 	    StrAllocCopy(me->par_value[me->param_number], me->param);
 	    me->state = before_tag;
 	} else {
-	    if (me->param_count < PARAM_MAX)  me->param[me->param_count++] = c;
+	    if (me->param_count < PARAM_MAX)
+		me->param[me->param_count++] = c;
 	}
 	break;
 
     case bracketed_value:
-	if (c==')') {
+	if (c == ')') {
 	    me->param[me->param_count] = 0;
 	    StrAllocCopy(me->par_value[me->param_number], me->param);
 	    me->state = before_tag;
 	    break;
 	}
-	if (me->param_count < PARAM_MAX)  me->param[me->param_count++] = c;
+	if (me->param_count < PARAM_MAX)
+	    me->param[me->param_count++] = c;
 	break;
 
     case quoted_value:
-	if (c=='"') {
+	if (c == '"') {
 	    me->param[me->param_count] = 0;
 	    StrAllocCopy(me->par_value[me->param_number], me->param);
 	    me->state = before_tag;
 	    break;
 	}
 
-	if (c=='\\') {		/* Ignore escape but switch state */
+	if (c == '\\') {	/* Ignore escape but switch state */
 	    me->state = escape_in_quoted;
 	    break;
 	}
 	/* Fall through! */
 
     case escape_in_quoted:
-	if (me->param_count < PARAM_MAX)  me->param[me->param_count++] = c;
+	if (me->param_count < PARAM_MAX)
+	    me->param[me->param_count++] = c;
 	me->state = quoted_value;
 	break;
 
-    case done:				/* Ignore anything after EOF */
+    case done:			/* Ignore anything after EOF */
 	return;
 
-    } /* switch me->state */
+    }				/* switch me->state */
 }
 
-
 /*			Open Cache file
-**			===============
-**
-**   Bugs: Maybe for filesystem-challenged platforms (MSDOS for example) we
-**   should make a hash code for the filename.
-*/
+ *			===============
+ *
+ *   Bugs: Maybe for filesystem-challenged platforms (MSDOS for example) we
+ *   should make a hash code for the filename.
+ */
 
 #ifdef CACHE_FILE_PREFIX
-static BOOL write_cache (HTStream *  me)
+static BOOL write_cache(HTStream *me)
 {
-    FILE * fp;
-    char * cache_file_name = NULL;
-    char * www_database;
+    FILE *fp;
+    char *cache_file_name = NULL;
+    char *www_database;
     int result = NO;
 
     if (!me->par_value[PAR_DATABASE_NAME]
 	|| !me->par_value[PAR_IP_NAME]
-	) return NO;
+	)
+	return NO;
 
     www_database = HTEscape(me->par_value[PAR_DATABASE_NAME], URL_XALPHAS);
     HTSprintf0(&cache_file_name, "%sWSRC-%s:%s:%.100s.txt",
-	CACHE_FILE_PREFIX,
-	me->par_value[PAR_IP_NAME],
-	me->par_value[PAR_TCP_PORT] ? me->par_value[PAR_TCP_PORT] : "210",
-	www_database);
+	       CACHE_FILE_PREFIX,
+	       me->par_value[PAR_IP_NAME],
+	       (me->par_value[PAR_TCP_PORT]
+		? me->par_value[PAR_TCP_PORT]
+		: "210"),
+	       www_database);
 
     if ((fp = fopen(cache_file_name, TXT_W)) != 0) {
 	result = YES;
@@ -272,11 +284,11 @@ static BOOL write_cache (HTStream *  me)
 #endif
 
 /*			Output equivalent HTML
-**			----------------------
-**
-*/
+ *			----------------------
+ *
+ */
 
-static void give_parameter (HTStream *  me, int  p)
+static void give_parameter(HTStream *me, int p)
 {
     PUTS(par_name[p]);
     if (me->par_value[p]) {
@@ -288,20 +300,19 @@ static void give_parameter (HTStream *  me, int  p)
     }
 }
 
-
 /*			Generate Outout
-**			===============
-*/
-static void WSRC_gen_html (HTStream *  me, BOOL  source_file)
-
+ *			===============
+ */
+static void WSRC_gen_html(HTStream *me, BOOL source_file)
 {
     if (me->par_value[PAR_DATABASE_NAME]) {
-	char * shortname = 0;
+	char *shortname = 0;
 	int l;
+
 	StrAllocCopy(shortname, me->par_value[PAR_DATABASE_NAME]);
 	l = strlen(shortname);
-	if ( l > 4 && !strcasecomp(shortname + l -4, ".src")) {
-	    shortname[l-4] = 0; /* Chop of .src -- boring! */
+	if (l > 4 && !strcasecomp(shortname + l - 4, ".src")) {
+	    shortname[l - 4] = 0;	/* Chop of .src -- boring! */
 	}
 
 	START(HTML_HEAD);
@@ -331,16 +342,19 @@ static void WSRC_gen_html (HTStream *  me, BOOL  source_file)
 	if (me->par_value[PAR_IP_NAME] &&
 	    me->par_value[PAR_DATABASE_NAME]) {
 
-	    char * WSRC_address = NULL;
-	    char * www_database;
+	    char *WSRC_address = NULL;
+	    char *www_database;
+
 	    www_database = HTEscape(me->par_value[PAR_DATABASE_NAME],
-		URL_XALPHAS);
+				    URL_XALPHAS);
 	    HTSprintf0(&WSRC_address, "%s//%s%s%s/%s",
-		STR_WAIS_URL,
-		me->par_value[PAR_IP_NAME],
-		me->par_value[PAR_TCP_PORT] ? ":" : "",
-		me->par_value[PAR_TCP_PORT] ? me->par_value[PAR_TCP_PORT] :"",
-		www_database);
+		       STR_WAIS_URL,
+		       me->par_value[PAR_IP_NAME],
+		       me->par_value[PAR_TCP_PORT] ? ":" : "",
+		       (me->par_value[PAR_TCP_PORT]
+			? me->par_value[PAR_TCP_PORT]
+			: ""),
+		       www_database);
 
 	    HTStartAnchor(me->target, NULL, WSRC_address);
 	    PUTS(gettext("Direct access"));
@@ -357,8 +371,8 @@ static void WSRC_gen_html (HTStream *  me, BOOL  source_file)
 	}
 	MAYBE_END(HTML_DD);
 
-    } /* end if source_file */
-
+    }
+    /* end if source_file */
     if (me->par_value[PAR_MAINTAINER]) {
 	START(HTML_DT);
 	PUTS(gettext("Maintainer"));
@@ -379,38 +393,35 @@ static void WSRC_gen_html (HTStream *  me, BOOL  source_file)
     END(HTML_DL);
 
     if (me->par_value[PAR_DESCRIPTION]) {
-	START(HTML_PRE);		/* Preformatted description */
+	START(HTML_PRE);	/* Preformatted description */
 	PUTS(me->par_value[PAR_DESCRIPTION]);
 	END(HTML_PRE);
     }
 
-    (*me->target->isa->_free)(me->target);
+    (*me->target->isa->_free) (me->target);
 
     return;
-} /* generate html */
-
+}				/* generate html */
 
-static void WSRCParser_put_string (HTStream *  context, const char*  str)
+static void WSRCParser_put_string(HTStream *context, const char *str)
 {
     const char *p;
-    for(p=str; *p; p++)
+
+    for (p = str; *p; p++)
 	WSRCParser_put_character(context, *p);
 }
 
-
-static void WSRCParser_write (
-		HTStream *	context,
-		const char*	str,
-		int		l)
+static void WSRCParser_write(HTStream *context, const char *str,
+			     int l)
 {
     const char *p;
-    const char *e = str+l;
-    for(p=str; p<e; p++)
+    const char *e = str + l;
+
+    for (p = str; p < e; p++)
 	WSRCParser_put_character(context, *p);
 }
 
-
-static void WSRCParser_free (HTStream *  me)
+static void WSRCParser_free(HTStream *me)
 {
     WSRC_gen_html(me, YES);
 #ifdef CACHE_FILE_PREFIX
@@ -418,51 +429,52 @@ static void WSRCParser_free (HTStream *  me)
 #endif
     {
 	int p;
-	for (p = 0; par_name[p]; p++) { /* Clear out old values */
+
+	for (p = 0; par_name[p]; p++) {		/* Clear out old values */
 	    FREE(me->par_value[p]);
 	}
     }
     FREE(me);
 }
 
-static void WSRCParser_abort (HTStream *  me, HTError  e GCC_UNUSED)
+static void WSRCParser_abort(HTStream *me, HTError e GCC_UNUSED)
 {
     WSRCParser_free(me);
 }
 
-
 /*		Stream subclass		-- method routines
-**		---------------
-*/
+ *		---------------
+ */
 
-HTStreamClass WSRCParserClass = {
-	"WSRCParser",
-	WSRCParser_free,
-	WSRCParser_abort,
-	WSRCParser_put_character,
-	WSRCParser_put_string,
-	WSRCParser_write
+HTStreamClass WSRCParserClass =
+{
+    "WSRCParser",
+    WSRCParser_free,
+    WSRCParser_abort,
+    WSRCParser_put_character,
+    WSRCParser_put_string,
+    WSRCParser_write
 
 };
 
-
 /*		Converter from WAIS Source to whatever
-**		--------------------------------------
-*/
-HTStream* HTWSRCConvert (
-	HTPresentation *	pres,
-	HTParentAnchor *	anchor,
-	HTStream *		sink)
+ *		--------------------------------------
+ */
+HTStream *HTWSRCConvert(HTPresentation *pres, HTParentAnchor *anchor,
+			HTStream *sink)
 {
-    HTStream * me = (HTStream*) malloc(sizeof(*me));
-    if (!me) outofmem(__FILE__, "HTWSRCConvert");
+    HTStream *me = (HTStream *) malloc(sizeof(*me));
+
+    if (!me)
+	outofmem(__FILE__, "HTWSRCConvert");
 
     me->isa = &WSRCParserClass;
     me->target = HTML_new(anchor, pres->rep_out, sink);
 
     {
 	int p;
-	for(p=0; p < PAR_COUNT; p++) {	/* Clear out parameter values */
+
+	for (p = 0; p < PAR_COUNT; p++) {	/* Clear out parameter values */
 	    me->par_value[p] = 0;
 	}
     }
@@ -470,4 +482,3 @@ HTStream* HTWSRCConvert (
 
     return me;
 }
-
diff --git a/WWW/Library/Implementation/HTWSRC.h b/WWW/Library/Implementation/HTWSRC.h
index 4cfe4ee7..c8b27bcc 100644
--- a/WWW/Library/Implementation/HTWSRC.h
+++ b/WWW/Library/Implementation/HTWSRC.h
@@ -1,11 +1,11 @@
 /*                                                             A parser for WAIS source files
                                  WAIS SOURCE FILE PARSER
 
-   This converter returns a stream object into which a WAIS source file can be written.
-   The result is put via a structured stream into whatever format was required for the
-   output stream.
+   This converter returns a stream object into which a WAIS source file can be
+   written.  The result is put via a structured stream into whatever format was
+   required for the output stream.
 
-   See also: HTWAIS protocol interface module
+   See also:  HTWAIS protocol interface module
 
  */
 #ifndef HTWSRC_H
@@ -13,26 +13,25 @@
 
 #include <HTFormat.h>
 
-extern  char from_hex (char c);
+extern char from_hex(char c);
 
-extern  HTStream* HTWSRCConvert (
-        HTPresentation *        pres,
-        HTParentAnchor *        anchor,
-        HTStream *              sink);
+extern HTStream *HTWSRCConvert(HTPresentation *pres,
+			       HTParentAnchor *anchor,
+			       HTStream *sink);
 
 /*
 
 Escaping Strings
 
-   HTDeSlash takes out the invlaid characters in a URL path ELEMENT by converting them
-   into hex-escaped characters.  HTEnSlash does the reverse.
+   HTDeSlash takes out the invlaid characters in a URL path ELEMENT by
+   converting them into hex-escaped characters.  HTEnSlash does the reverse.
 
-   Each returns a pointer to a newly allocated string which must eventually be freed by
-   the caller.
+   Each returns a pointer to a newly allocated string which must eventually be
+   freed by the caller.
 
  */
-extern char * HTDeSlash (const char * str);
+extern char *HTDeSlash(const char *str);
 
-extern char * HTEnSlash (const char * str);
+extern char *HTEnSlash(const char *str);
 
 #endif /* HTWSRC_H */
diff --git a/WWW/Library/Implementation/HText.h b/WWW/Library/Implementation/HText.h
index bd2cc541..8a87cc1c 100644
--- a/WWW/Library/Implementation/HText.h
+++ b/WWW/Library/Implementation/HText.h
@@ -5,9 +5,9 @@
 
 /*
 
-   This is the C interface to the Objective-C (or whatever) Style-oriented HyperText
-   class.  It is used when a style-oriented text object is available or craeted in order to
-   display hypertext.
+   This is the C interface to the Objective-C (or whatever) Style-oriented
+   HyperText class.  It is used when a style-oriented text object is available
+   or craeted in order to display hypertext.
 
  */
 #ifndef HTEXT_H
@@ -18,16 +18,16 @@
 #include <SGML.h>
 
 #ifndef THINK_C
-#ifndef HyperText               /* Objective C version defined HyperText */
-typedef struct _HText HText;    /* Normal Library */
+#ifndef HyperText		/* Objective C version defined HyperText */
+typedef struct _HText HText;	/* Normal Library */
 #endif
 #else
-class CHyperText;               /* Mac Think-C browser hook */
+class CHyperText;		/* Mac Think-C browser hook */
 typedef CHyperText HText;
 #endif
 
-extern HText * HTMainText;              /* Pointer to current main text */
-extern HTParentAnchor * HTMainAnchor;   /* Pointer to current text's anchor */
+extern HText *HTMainText;	/* Pointer to current main text */
+extern HTParentAnchor *HTMainAnchor;	/* Pointer to current text's anchor */
 
 /*
 
@@ -35,40 +35,41 @@ Creation and deletion
 
   HTEXT_NEW: CREATE HYPERTEXT OBJECT
 
-   There are several methods depending on how much you want to specify.  The output stream
-   is used with objects which need to output the hypertext to a stream.  The structure is
-   for objects which need to refer to the structure which is kep by the creating stream.
+   There are several methods depending on how much you want to specify.  The
+   output stream is used with objects which need to output the hypertext to a
+   stream.  The structure is for objects which need to refer to the structure
+   which is kep by the creating stream.
 
  */
- extern HText * HText_new (HTParentAnchor * anchor);
+extern HText *HText_new(HTParentAnchor *anchor);
 
- extern HText * HText_new2 (HTParentAnchor * anchor,
-                                HTStream * output_stream);
+extern HText *HText_new2(HTParentAnchor *anchor,
+			 HTStream *output_stream);
 
- extern HText * HText_new3 (HTParentAnchor * anchor,
-                                HTStream * output_stream,
-                                HTStructured * structure);
+extern HText *HText_new3(HTParentAnchor *anchor,
+			 HTStream *output_stream,
+			 HTStructured * structure);
 
 /*
 
   FREE HYPERTEXT OBJECT
 
  */
-extern void     HText_free (HText * me);
-
+extern void HText_free(HText *me);
 
 /*
 
 Object Building methods
 
-   These are used by a parser to build the text in an object HText_beginAppend must be
-   called, then any combination of other append calls, then HText_endAppend. This allows
-   optimised handling using buffers and caches which are flushed at the end.
+   These are used by a parser to build the text in an object HText_beginAppend
+   must be called, then any combination of other append calls, then
+   HText_endAppend.  This allows optimised handling using buffers and caches
+   which are flushed at the end.
 
  */
-extern void HText_beginAppend (HText * text);
+extern void HText_beginAppend(HText *text);
 
-extern void HText_endAppend (HText * text);
+extern void HText_endAppend(HText *text);
 
 /*
 
@@ -76,14 +77,14 @@ extern void HText_endAppend (HText * text);
 
  */
 
-extern void HText_setStyle (HText * text, HTStyle * style);
+extern void HText_setStyle(HText *text, HTStyle *style);
 
 /*
 
   ADD ONE CHARACTER
 
  */
-extern void HText_appendCharacter (HText * text, int ch);
+extern void HText_appendCharacter(HText *text, int ch);
 
 /*
 
@@ -91,7 +92,7 @@ extern void HText_appendCharacter (HText * text, int ch);
 
  */
 
-extern void HText_appendText (HText * text, const char * str);
+extern void HText_appendText(HText *text, const char *str);
 
 /*
 
@@ -100,13 +101,11 @@ extern void HText_appendText (HText * text, const char * str);
    and similar things
 
  */
-extern void HText_appendParagraph (HText * text);
-
-extern void HText_appendLineBreak (HText * text);
-
-extern void HText_appendHorizontalRule (HText * text);
+extern void HText_appendParagraph(HText *text);
 
+extern void HText_appendLineBreak(HText *text);
 
+extern void HText_appendHorizontalRule(HText *text);
 
 /*
 
@@ -116,44 +115,40 @@ extern void HText_appendHorizontalRule (HText * text);
 
 /*
 
-   The anchor object is created and passed to HText_beginAnchor.  The senstive text is
-   added to the text object, and then HText_endAnchor is called. Anchors may not be
-   nested.
+   The anchor object is created and passed to HText_beginAnchor.  The senstive
+   text is added to the text object, and then HText_endAnchor is called. 
+   Anchors may not be nested.
 
  */
-extern int HText_beginAnchor (
-	HText *		text,
-	BOOL		underline,
-	HTChildAnchor *	anc);
-extern void HText_endAnchor (HText * text, int number);
-extern BOOL HText_isAnchorBlank (HText * text, int number);
+extern int HText_beginAnchor(HText *text, BOOL underline,
+			     HTChildAnchor *anc);
+extern void HText_endAnchor(HText *text, int number);
+extern BOOL HText_isAnchorBlank(HText *text, int number);
 
 /*
 
   APPEND AN INLINE IMAGE
 
-   The image is handled by the creation of an anchor whose destination is the image
-   document to be included. The semantics is the intended inline display of the image.
+   The image is handled by the creation of an anchor whose destination is the
+   image document to be included.  The semantics is the intended inline display
+   of the image.
 
-   An alternative implementation could be, for example, to begin an anchor, append the
-   alternative text or "IMAGE", then end the anchor.  This would simply generate some text
-   linked to the image itself as a separate document.
+   An alternative implementation could be, for example, to begin an anchor,
+   append the alternative text or "IMAGE", then end the anchor.  This would
+   simply generate some text linked to the image itself as a separate document.
 
  */
-extern void HText_appendImage (
-        HText *         text,
-        HTChildAnchor * anc,
-        const char *    alternative_text,
-        int             alignment,
-        BOOL            isMap);
+extern void HText_appendImage(HText *text, HTChildAnchor *anc,
+			      const char *alternative_text,
+			      int alignment,
+			      BOOL isMap);
 
 /*
 
   RETURN THE ANCHOR ASSOCIATED WITH THIS NODE
 
  */
-extern HTParentAnchor * HText_nodeAnchor (HText * me);
-
+extern HTParentAnchor *HText_nodeAnchor(HText *me);
 
 /*
 
@@ -161,63 +156,57 @@ Browsing functions
 
  */
 
-
 /*
 
   BRING TO FRONT AND HIGHLIGHT IT
 
  */
 
-
-extern BOOL HText_select (HText * text);
-extern BOOL HText_selectAnchor (HText * text, HTChildAnchor* anchor);
+extern BOOL HText_select(HText *text);
+extern BOOL HText_selectAnchor(HText *text, HTChildAnchor *anchor);
 
 /*
 
 Editing functions
 
-   These are called from the application.  There are many more functions not included here
-   from the orginal text object.  These functions NEED NOT BE IMPLEMENTED in a browser
-   which cannot edit.
+   These are called from the application.  There are many more functions not
+   included here from the orginal text object.  These functions NEED NOT BE
+   IMPLEMENTED in a browser which cannot edit.
 
  */
 /*      Style handling:
 */
 /*      Apply this style to the selection
 */
-extern void HText_applyStyle (HText * me, HTStyle *style);
+extern void HText_applyStyle(HText *me, HTStyle *style);
 
 /*      Update all text with changed style.
 */
-extern void HText_updateStyle (HText * me, HTStyle *style);
+extern void HText_updateStyle(HText *me, HTStyle *style);
 
 /*      Return style of  selection
 */
-extern HTStyle * HText_selectionStyle (
-        HText * me,
-        HTStyleSheet* sheet);
+extern HTStyle *HText_selectionStyle(HText *me, HTStyleSheet *sheet);
 
 /*      Paste in styled text
 */
-extern void HText_replaceSel (HText * me,
-        const char *aString,
-        HTStyle* aStyle);
+extern void HText_replaceSel(HText *me, const char *aString,
+			     HTStyle *aStyle);
 
 /*      Apply this style to the selection and all similarly formatted text
-**      (style recovery only)
-*/
-extern void HTextApplyToSimilar (HText * me, HTStyle *style);
+ *      (style recovery only)
+ */
+extern void HTextApplyToSimilar(HText *me, HTStyle *style);
 
 /*      Select the first unstyled run.
-**      (style recovery only)
-*/
-extern void HTextSelectUnstyled (HText * me, HTStyleSheet *sheet);
-
+ *      (style recovery only)
+ */
+extern void HTextSelectUnstyled(HText *me, HTStyleSheet *sheet);
 
 /*      Anchor handling:
 */
-extern void             HText_unlinkSelection (HText * me);
-extern HTAnchor *       HText_referenceSelected (HText * me);
-extern HTAnchor *       HText_linkSelTo (HText * me, HTAnchor* anchor);
+extern void HText_unlinkSelection(HText *me);
+extern HTAnchor *HText_referenceSelected(HText *me);
+extern HTAnchor *HText_linkSelTo(HText *me, HTAnchor * anchor);
 
 #endif /* HTEXT_H */
diff --git a/WWW/Library/Implementation/HTioctl.h b/WWW/Library/Implementation/HTioctl.h
index 95e914e6..99f86321 100644
--- a/WWW/Library/Implementation/HTioctl.h
+++ b/WWW/Library/Implementation/HTioctl.h
@@ -1,7 +1,7 @@
 /*
-**  A routine to mimic the ioctl function for UCX.
-**  Bjorn S. Nilsson, 25-Nov-1993. Based on an example in the UCX manual.
-*/
+ *  A routine to mimic the ioctl function for UCX.
+ *  Bjorn S. Nilsson, 25-Nov-1993. Based on an example in the UCX manual.
+ */
 #include <iodef.h>
 #define IOC_OUT (int)0x40000000
 extern int vaxc$get_sdc(), sys$qiow();
diff --git a/WWW/Library/Implementation/LYLeaks.h b/WWW/Library/Implementation/LYLeaks.h
index 19dc526b..81abd551 100644
--- a/WWW/Library/Implementation/LYLeaks.h
+++ b/WWW/Library/Implementation/LYLeaks.h
@@ -6,60 +6,60 @@
 #define __LYLEAKS_H
 
 /*
-**  Copyright (c) 1994, University of Kansas, All Rights Reserved
-**
-**  Include File:	LYLeaks.h
-**  Purpose:		Header to convert requests for allocation to Lynx
-**			custom functions to track memory leaks.
-**  Remarks/Portability/Dependencies/Restrictions:
-**	For the stdlib.h allocation functions to be overriden by the
-**		Lynx memory tracking functions all modules allocating,
-**		freeing, or resizing memory must have LY_FIND_LEAKS
-**		defined before including this file.
-**	This header file should be included in every source file which
-**		does any memory manipulation through use of the
-**		stdlib.h memory functions.
-**	For proper reporting of memory leaks, the function LYLeaks
-**		should be registered for execution by atexit as the
-**		very first executable statement in main.
-**	This code is slow and should not be used except in debugging
-**		circumstances (don't define LY_FIND_LEAKS).
-**	If you are using LY_FIND_LEAKS and don't want the LYLeak*
-**		memory functions to be used in a certain file,
-**		define NO_MEMORY_TRACKING before including this file.
-**	The only safe way to call the LYLeak* functions is to use
-**		the below macros because they depend on the static
-**		string created by __FILE__ to not be dynamic in
-**		nature (don't free it and assume will exist at all
-**		times during execution).
-**	If you are using LY_FIND_LEAKS and LY_FIND_LEAKS_EXTENDED and
-**		want only normal memory tracking (not extended for
-**		HTSprintf/HTSprintf0) to be used in a certain file,
-**		define NO_EXTENDED_MEMORY_TRACKING and don't define
-**		NO_MEMORY_TRACKING before including this file.
-**  Revision History:
-**	05-26-94	created for Lynx 2-3-1, Garrett Arch Blythe
-**	10-30-97	modified to handle StrAllocCopy() and
-**			StrAllocCat(). - KW & FM
-**	1999-10-17	modified to handle HTSprintf0 and HTSprintf(),
-**			and to provide mark_malloced, if
-**			LY_FIND_LEAKS_EXTENDED is defined. - kw
-*/
+ *  Copyright (c) 1994, University of Kansas, All Rights Reserved
+ *
+ *  Include File:	LYLeaks.h
+ *  Purpose:		Header to convert requests for allocation to Lynx
+ *			custom functions to track memory leaks.
+ *  Remarks/Portability/Dependencies/Restrictions:
+ *	For the stdlib.h allocation functions to be overriden by the
+ *		Lynx memory tracking functions all modules allocating,
+ *		freeing, or resizing memory must have LY_FIND_LEAKS
+ *		defined before including this file.
+ *	This header file should be included in every source file which
+ *		does any memory manipulation through use of the
+ *		stdlib.h memory functions.
+ *	For proper reporting of memory leaks, the function LYLeaks
+ *		should be registered for execution by atexit as the
+ *		very first executable statement in main.
+ *	This code is slow and should not be used except in debugging
+ *		circumstances (don't define LY_FIND_LEAKS).
+ *	If you are using LY_FIND_LEAKS and don't want the LYLeak*
+ *		memory functions to be used in a certain file,
+ *		define NO_MEMORY_TRACKING before including this file.
+ *	The only safe way to call the LYLeak* functions is to use
+ *		the below macros because they depend on the static
+ *		string created by __FILE__ to not be dynamic in
+ *		nature (don't free it and assume will exist at all
+ *		times during execution).
+ *	If you are using LY_FIND_LEAKS and LY_FIND_LEAKS_EXTENDED and
+ *		want only normal memory tracking (not extended for
+ *		HTSprintf/HTSprintf0) to be used in a certain file,
+ *		define NO_EXTENDED_MEMORY_TRACKING and don't define
+ *		NO_MEMORY_TRACKING before including this file.
+ *  Revision History:
+ *	05-26-94	created for Lynx 2-3-1, Garrett Arch Blythe
+ *	10-30-97	modified to handle StrAllocCopy() and
+ *			StrAllocCat(). - KW & FM
+ *	1999-10-17	modified to handle HTSprintf0 and HTSprintf(),
+ *			and to provide mark_malloced, if
+ *			LY_FIND_LEAKS_EXTENDED is defined. - kw
+ */
 
 /* Undefine this to get no improved HTSprintf0/HTSprintf tracking: */
 #define LY_FIND_LEAKS_EXTENDED
 
 /*
-**  Required includes
-*/
+ *  Required includes
+ */
 
 #ifndef HTUTILS_H
 #include <HTUtils.h>
 #endif
 
 /*
-**	Constant defines
-*/
+ *	Constant defines
+ */
 #define MAX_CONTENT_LENGTH 50
 #ifdef VMS
 #define LEAKAGE_SINK "sys$login:Lynx.leaks"
@@ -68,65 +68,62 @@
 #endif /* VMS */
 
 /*
-**	Data structures
-*/
-typedef struct SourceLocation_tag	{
-	/*
-	 *	The file name and line number of where an event took place.
-	 */
-	const char *cp_FileName;
-	short ssi_LineNumber;
-}
-SourceLocation;
-
-typedef struct AllocationList_tag	{
-	/*
-	 *	A singly linked list.
-	 */
-	struct AllocationList_tag *ALp_Next;
-
-	/*
-	 *	Count the number of mallocs.
-	 */
-	long st_Sequence;
-
-	/*
-	 *	The memory pointer allocated.
-	 *	If set to NULL, then an invalid request was made.
-	 *	The invalid pointer also.
-	 */
-	void *vp_Alloced;
-	void *vp_BadRequest;
-
-	/*
-	 *	The size in bytes of the allocated memory.
-	 */
-	size_t st_Bytes;
-
-	/*
-	 *	The source location of specific event (calloc, malloc, free).
-	 *	realloc kept separate since will track last realloc on pointer.
-	 */
-	SourceLocation SL_memory;
-	SourceLocation SL_realloc;
+ * Data structures
+ */
+typedef struct SourceLocation_tag {
+    /*
+     * The file name and line number of where an event took place.
+     */
+    const char *cp_FileName;
+    short ssi_LineNumber;
+} SourceLocation;
+
+typedef struct AllocationList_tag {
+    /*
+     * A singly linked list.
+     */
+    struct AllocationList_tag *ALp_Next;
+
+    /*
+     * Count the number of mallocs.
+     */
+    long st_Sequence;
+
+    /*
+     * The memory pointer allocated.  If set to NULL, then an invalid request
+     * was made.  The invalid pointer also.
+     */
+    void *vp_Alloced;
+    void *vp_BadRequest;
+
+    /*
+     * The size in bytes of the allocated memory.
+     */
+    size_t st_Bytes;
+
+    /*
+     * The source location of specific event (calloc, malloc, free).  realloc
+     * kept separate since will track last realloc on pointer.
+     */
+    SourceLocation SL_memory;
+    SourceLocation SL_realloc;
 } AllocationList;
 
 /*
-**  Global variable declarations
-*/
+ *  Global variable declarations
+ */
 
 /*
-**  Macros
-*/
+ *  Macros
+ */
 #if defined(LY_FIND_LEAKS) && !defined(NO_MEMORY_TRACKING)
 /*
-**	Only use these macros if we are to track memory allocations.
-**	The reason for using a macro instead of a define is that we want
-**		to track where the initial allocation took place or where
-**		the last reallocation took place.
-**	Track where the allocation took place by the __FILE__ and __LINE__
-**		defines which are automatic to the compiler.
-*/
+ * Only use these macros if we are to track memory allocations.  The reason for
+ * using a macro instead of a define is that we want to track where the initial
+ * allocation took place or where the last reallocation took place.  Track
+ * where the allocation took place by the __FILE__ and __LINE__ defines which
+ * are automatic to the compiler.
+ */
 #ifdef malloc
 #undef malloc
 #endif /* malloc */
@@ -150,9 +147,9 @@ typedef struct AllocationList_tag	{
 #define free(vp_alloced) LYLeakFree(vp_alloced, __FILE__, __LINE__)
 
 /*
-**  Added the following two defines to track Lynx's frequent use
-**  of those macros. - KW 1997-10-12
-*/
+ * Added the following two defines to track Lynx's frequent use of those
+ * macros.  - KW 1997-10-12
+ */
 #ifdef StrAllocCopy
 #undef StrAllocCopy
 #endif /* StrAllocCopy */
@@ -187,66 +184,56 @@ typedef struct AllocationList_tag	{
 #endif /* LY_FIND_LEAKS && !NO_MEMORY_TRACKING */
 
 #if defined(LY_FIND_LEAKS)
-#define PUBLIC_IF_FIND_LEAKS /* nothing */
+#define PUBLIC_IF_FIND_LEAKS	/* nothing */
 #else
 #define PUBLIC_IF_FIND_LEAKS static
 #endif
 
 /*
-**	Function declarations
-**	See the appropriate source file for usage.
-*/
-#ifndef LYLeakSequence 
-extern long LYLeakSequence (void);
+ * Function declarations.
+ * See the appropriate source file for usage.
+ */
+#ifndef LYLeakSequence
+extern long LYLeakSequence(void);
 #endif
-extern void LYLeaks (void);
+extern void LYLeaks(void);
+
 #ifdef LY_FIND_LEAKS_EXTENDED
-extern AllocationList *LYLeak_mark_malloced (
-	void *		vp_alloced,
-	size_t		st_bytes,
-	const char *	cp_File,
-	const short	ssi_Line);
+extern AllocationList *LYLeak_mark_malloced(void *vp_alloced,
+					    size_t st_bytes,
+					    const char *cp_File,
+					    const short ssi_Line);
 #endif /* LY_FIND_LEAKS_EXTENDED */
-extern void *LYLeakMalloc (
-	size_t		st_bytes,
-	const char *	cp_File,
-	const short	ssi_Line);
-extern void *LYLeakCalloc (
-	size_t		st_number,
-	size_t		st_bytes,
-	const char *	cp_File,
-	const short	ssi_Line);
-extern void *LYLeakRealloc (
-	void *		vp_alloced,
-	size_t		st_newbytes,
-	const char *	cp_File,
-	const short	ssi_Line);
-extern void LYLeakFree (
-	void *		vp_alloced,
-	const char *	cp_File,
-	const short	ssi_Line);
-extern char * LYLeakSACopy (
-	char **		dest,
-	const char *	src,
-	const char *	cp_File,
-	const short	ssi_Line);
-extern char * LYLeakSACat (
-	char **		dest,
-	const char *	src,
-	const char *	cp_File,
-	const short	ssi_Line);
+extern void *LYLeakMalloc(size_t st_bytes, const char *cp_File,
+			  const short ssi_Line);
+extern void *LYLeakCalloc(size_t st_number, size_t st_bytes, const char *cp_File,
+			  const short ssi_Line);
+extern void *LYLeakRealloc(void *vp_alloced,
+			   size_t st_newbytes,
+			   const char *cp_File,
+			   const short ssi_Line);
+extern void LYLeakFree(void *vp_alloced,
+		       const char *cp_File,
+		       const short ssi_Line);
+extern char *LYLeakSACopy(char **dest,
+			  const char *src,
+			  const char *cp_File,
+			  const short ssi_Line);
+extern char *LYLeakSACat(char **dest,
+			 const char *src,
+			 const char *cp_File,
+			 const short ssi_Line);
 
 #ifdef LY_FIND_LEAKS_EXTENDED
-/* Trick to get tracking of var arg functions without relying
-   on var arg preprocessor macros: */
-
-typedef char * HTSprintflike (char **, const char *, ...);
-extern HTSprintflike *Get_htsprintf_fn (
-			   const char *	cp_File,
-			   const short	ssi_Line);
-extern HTSprintflike *Get_htsprintf0_fn (
-			   const char *	cp_File,
-			   const short	ssi_Line);
+/*
+ * Trick to get tracking of var arg functions without relying on var arg
+ * preprocessor macros:
+ */
+typedef char *HTSprintflike(char **, const char *,...);
+extern HTSprintflike *Get_htsprintf_fn(const char *cp_File,
+				       const short ssi_Line);
+extern HTSprintflike *Get_htsprintf0_fn(const char *cp_File,
+					const short ssi_Line);
 #endif /* LY_FIND_LEAKS_EXTENDED */
 
 #endif /* __LYLEAKS_H */
diff --git a/WWW/Library/Implementation/LYexit.h b/WWW/Library/Implementation/LYexit.h
index 6e6bb043..212aa95b 100644
--- a/WWW/Library/Implementation/LYexit.h
+++ b/WWW/Library/Implementation/LYexit.h
@@ -51,8 +51,8 @@
 /*
  *	Function declarations
  */
-extern void exit_immediately (int status) GCC_NORETURN;
-extern void LYexit (int status) GCC_NORETURN;
-extern int LYatexit (void (*function)(void));
+extern void exit_immediately(int status) GCC_NORETURN;
+extern void LYexit(int status) GCC_NORETURN;
+extern int LYatexit(void (*function) (void));
 
 #endif /* __LYEXIT_H */
diff --git a/WWW/Library/Implementation/SGML.c b/WWW/Library/Implementation/SGML.c
index c8172f4d..0a32f58f 100644
--- a/WWW/Library/Implementation/SGML.c
+++ b/WWW/Library/Implementation/SGML.c
@@ -1,13 +1,13 @@
 /*			General SGML Parser code		SGML.c
-**			========================
-**
-**	This module implements an HTStream object.  To parse an
-**	SGML file, create this object which is a parser.  The object
-**	is (currently) created by being passed a DTD structure,
-**	and a target HTStructured object at which to throw the parsed stuff.
-**
-**	 6 Feb 93  Binary searches used. Interface modified.
-*/
+ *			========================
+ *
+ *	This module implements an HTStream object.  To parse an
+ *	SGML file, create this object which is a parser.  The object
+ *	is (currently) created by being passed a DTD structure,
+ *	and a target HTStructured object at which to throw the parsed stuff.
+ *
+ *	 6 Feb 93  Binary searches used. Interface modified.
+ */
 
 #include <HTUtils.h>
 
@@ -28,7 +28,7 @@
 #include <HTChunk.h>
 
 #include <LYCharSets.h>
-#include <LYCharVals.h>	 /* S/390 -- gil -- 0635 */
+#include <LYCharVals.h>		/* S/390 -- gil -- 0635 */
 #include <LYGlobalDefs.h>
 #include <LYStrings.h>
 #include <LYLeaks.h>
@@ -44,12 +44,12 @@
 
 #ifdef USE_PRETTYSRC
 
-char* entity_string; /* this is used for printing entity name.
-    Unconditionally added since redundant assigments don't hurt much*/
+char *entity_string;		/* this is used for printing entity name.
 
-static void fake_put_character (
-		    void* p GCC_UNUSED,
-		    char  c GCC_UNUSED)
+				   Unconditionally added since redundant assigments don't hurt much */
+
+static void fake_put_character(void *p GCC_UNUSED,
+			       char c GCC_UNUSED)
 {
 }
 
@@ -65,7 +65,6 @@ static void fake_put_character (
 			AS_casecomp(a,b) : \
 			(TOASCII(TOUPPER(*a)) - TOASCII(TOUPPER(*b))))
 
-#if ANSI_PREPRO
  /* will use partially inlined version */
 #define orig_HTChunkPutUtf8Char HTChunkPutUtf8Char
 #undef HTChunkPutUtf8Char
@@ -79,25 +78,6 @@ static void fake_put_character (
 	orig_HTChunkPutUtf8Char(ch,x); \
     }
 
-#if 0
-#define orig_HTChunkPutc HTChunkPutc
-#undef HTChunkPutc
-
-#define HTChunkPutc(ch,x) \
-    { \
-    if (ch->size < ch->allocated) \
-	ch->data[ch->size++] = x; \
-    else \
-	orig_HTChunkPutc(ch,x); \
-    }
-
-#undef HTChunkTerminate
-
-#define HTChunkTerminate(ch) \
-    HTChunkPutc(ch, (char)0)
-#endif /* */
-#endif	/* ANSI_PREPRO */
-
 #define PUTS(str) ((*context->actions->put_string)(context->target, str))
 #define PUTC(ch)  ((*context->actions->put_character)(context->target, ch))
 #define PUTUTF8(code) (UCPutUtf8_charstring((HTStream *)context->target, \
@@ -105,34 +85,32 @@ static void fake_put_character (
 
 #define OPT 1
 
-
 /*the following macros are used for pretty source view. */
 #define IS_C(attr) (attr.type == HTMLA_CLASS)
 
-HTCJKlang HTCJK = NOCJK;		/* CJK enum value.		*/
-BOOL HTPassEightBitRaw = FALSE;	/* Pass 161-172,174-255 raw.	*/
+HTCJKlang HTCJK = NOCJK;	/* CJK enum value.              */
+BOOL HTPassEightBitRaw = FALSE;	/* Pass 161-172,174-255 raw.    */
 BOOL HTPassEightBitNum = FALSE;	/* Pass ^ numeric entities raw. */
 BOOL HTPassHighCtrlRaw = FALSE;	/* Pass 127-160,173,&#127; raw. */
-BOOL HTPassHighCtrlNum = FALSE;	/* Pass &#128;-&#159; raw.	*/
+BOOL HTPassHighCtrlNum = FALSE;	/* Pass &#128;-&#159; raw.      */
 
 /*	The State (context) of the parser
-**
-**	This is passed with each call to make the parser reentrant
-**
-*/
+ *
+ *	This is passed with each call to make the parser reentrant
+ *
+ */
 
 #define MAX_ATTRIBUTES 36	/* Max number of attributes per element */
 
-
 /*		Element Stack
-**		-------------
-**	This allows us to return down the stack reselecting styles.
-**	As we return, attribute values will be garbage in general.
-*/
+ *		-------------
+ *	This allows us to return down the stack reselecting styles.
+ *	As we return, attribute values will be garbage in general.
+ */
 typedef struct _HTElement HTElement;
 struct _HTElement {
-	HTElement *	next;	/* Previously nested element or 0 */
-	HTTag*		tag;	/* The tag at this level  */
+    HTElement *next;		/* Previously nested element or 0 */
+    HTTag *tag;			/* The tag at this level  */
 };
 
 typedef enum {
@@ -182,73 +160,74 @@ typedef enum {
 } sgml_state;
 
 /*	Internal Context Data Structure
-**	-------------------------------
-*/
+ *	-------------------------------
+ */
 struct _HTStream {
 
-    const HTStreamClass *	isa;		/* inherited from HTStream */
-
-    const SGML_dtd		*dtd;
-    const HTStructuredClass	*actions;	/* target class	 */
-    HTStructured		*target;	/* target object */
-
-    HTTag			*current_tag;
-    HTTag			*slashedtag;
-    const HTTag			*unknown_tag;
-    BOOL			inSELECT;
-    BOOL			no_lynx_specialcodes;
-    int				current_attribute_number;
-    HTChunk			*string;
-    int				leading_spaces;
-    int				trailing_spaces;
-    HTElement			*element_stack;
-    sgml_state			state;
+    const HTStreamClass *isa;	/* inherited from HTStream */
+
+    const SGML_dtd *dtd;
+    const HTStructuredClass *actions;	/* target class  */
+    HTStructured *target;	/* target object */
+
+    HTTag *current_tag;
+    HTTag *slashedtag;
+    const HTTag *unknown_tag;
+    BOOL inSELECT;
+    BOOL no_lynx_specialcodes;
+    int current_attribute_number;
+    HTChunk *string;
+    int leading_spaces;
+    int trailing_spaces;
+    HTElement *element_stack;
+    sgml_state state;
     unsigned char kanji_buf;
 #ifdef CALLERDATA
-    void *			callerData;
-#endif /* CALLERDATA */
+    void *callerData;
+#endif				/* CALLERDATA */
     BOOL present[MAX_ATTRIBUTES];	/* Flags: attribute is present? */
-    char * value[MAX_ATTRIBUTES];	/* NULL, or strings alloc'd with StrAllocCopy_extra() */
-
-    BOOL			lead_exclamation;
-    BOOL			first_dash;
-    BOOL			end_comment;
-    BOOL			doctype_bracket;
-    BOOL			first_bracket;
-    BOOL			second_bracket;
-    BOOL			isHex;
-
-    HTParentAnchor *		node_anchor;
-    LYUCcharset *		inUCI;		/* pointer to anchor UCInfo */
-    int				inUCLYhndl;	/* charset we are fed	    */
-    LYUCcharset *		outUCI;		/* anchor UCInfo for target */
-    int				outUCLYhndl;	/* charset for target	    */
-    char			utf_count;
-    UCode_t			utf_char;
-    char			utf_buf[8];
-    char *			utf_buf_p;
-    UCTransParams		T;
-    int				current_tag_charset; /* charset to pass attributes */
-
-    char *			recover;
-    int				recover_index;
-    char *			include;
-    char *			active_include;
-    int				include_index;
-    char *			url;
-    char *			csi;
-    int				csi_index;
+    char *value[MAX_ATTRIBUTES];	/* NULL, or strings alloc'd with StrAllocCopy_extra() */
+
+    BOOL lead_exclamation;
+    BOOL first_dash;
+    BOOL end_comment;
+    BOOL doctype_bracket;
+    BOOL first_bracket;
+    BOOL second_bracket;
+    BOOL isHex;
+
+    HTParentAnchor *node_anchor;
+    LYUCcharset *inUCI;		/* pointer to anchor UCInfo */
+    int inUCLYhndl;		/* charset we are fed       */
+    LYUCcharset *outUCI;	/* anchor UCInfo for target */
+    int outUCLYhndl;		/* charset for target       */
+    char utf_count;
+    UCode_t utf_char;
+    char utf_buf[8];
+    char *utf_buf_p;
+    UCTransParams T;
+    int current_tag_charset;	/* charset to pass attributes */
+
+    char *recover;
+    int recover_index;
+    char *include;
+    char *active_include;
+    int include_index;
+    char *url;
+    char *csi;
+    int csi_index;
 #ifdef USE_PRETTYSRC
-    BOOL			cur_attr_is_href;
-    BOOL			cur_attr_is_name;
-    BOOL			seen_nonwhite_in_junk_tag;
+    BOOL cur_attr_is_href;
+    BOOL cur_attr_is_name;
+    BOOL seen_nonwhite_in_junk_tag;
 #endif
 };
 
 #ifndef NO_LYNX_TRACE
-static char *state_name (sgml_state  n)
+static char *state_name(sgml_state n)
 {
     char *result = "?";
+    /* *INDENT-OFF* */
     switch (n) {
     case S_attr:                result = "S_attr";              break;
     case S_attr_gap:            result = "S_attr_gap";          break;
@@ -294,6 +273,8 @@ static char *state_name (sgml_state  n)
     case S_text:                result = "S_text";              break;
     case S_value:               result = "S_value";             break;
     }
+    /* *INDENT-ON* */
+
     return result;
 }
 #endif
@@ -303,15 +284,15 @@ static char *state_name (sgml_state  n)
 static HTElement pool[DEPTH];
 static int depth = 0;
 
-static HTElement* pool_alloc (void)
+static HTElement *pool_alloc(void)
 {
     depth++;
     if (depth > DEPTH)
-	return (HTElement*) malloc(sizeof(HTElement));
+	return (HTElement *) malloc(sizeof(HTElement));
     return (pool + depth - 1);
 }
 
-static void pool_free (HTElement*  e)
+static void pool_free(HTElement * e)
 {
     if (depth > DEPTH)
 	FREE(e);
@@ -321,12 +302,9 @@ static void pool_free (HTElement*  e)
 
 #ifdef USE_PRETTYSRC
 
-static void HTMLSRC_apply_markup (
-	    HTStream *	      context,
-	    HTlexeme	      lexeme,
-	    BOOL	      start)
+static void HTMLSRC_apply_markup(HTStream *context, HTlexeme lexeme, BOOL start)
 {
-    HT_tagspec* ts = *( ( start ? lexeme_start : lexeme_end ) + lexeme);
+    HT_tagspec *ts = *((start ? lexeme_start : lexeme_end) + lexeme);
 
     while (ts) {
 #ifdef USE_COLOR_STYLE
@@ -337,64 +315,54 @@ static void HTMLSRC_apply_markup (
 	    force_classname = TRUE;
 	}
 #endif
-	CTRACE((tfp,ts->start ? "SRCSTART %d\n" : "SRCSTOP %d\n",(int)lexeme));
+	CTRACE((tfp, ts->start ? "SRCSTART %d\n" : "SRCSTOP %d\n", (int) lexeme));
 	if (ts->start)
-	    (*context->actions->start_element)(
-		context->target,
-		ts->element,
-		ts->present,
-		(const char **)ts->value,
-		context->current_tag_charset,
-		(char **)&context->include);
+	    (*context->actions->start_element) (context->target,
+						ts->element,
+						ts->present,
+						(const char **) ts->value,
+						context->current_tag_charset,
+						(char **) &context->include);
 	else
-	    (*context->actions->end_element)(
-		context->target,
-		ts->element,
-		(char **)&context->include);
+	    (*context->actions->end_element) (context->target,
+					      ts->element,
+					      (char **) &context->include);
 	ts = ts->next;
     }
 }
 
-#if ANSI_PREPRO
-#  define PSRCSTART(x)	HTMLSRC_apply_markup(context,HTL_##x,START)
-#  define PSRCSTOP(x)   HTMLSRC_apply_markup(context,HTL_##x,STOP)
-#else
-#  define PSRCSTART(x)	HTMLSRC_apply_markup(context,HTL_/**/x,START)
-#  define PSRCSTOP(x)   HTMLSRC_apply_markup(context,HTL_/**/x,STOP)
-#endif
+#define PSRCSTART(x)	HTMLSRC_apply_markup(context,HTL_##x,START)
+#define PSRCSTOP(x)   HTMLSRC_apply_markup(context,HTL_##x,STOP)
 
 #define attr_is_href context->cur_attr_is_href
 #define attr_is_name context->cur_attr_is_name
 #endif
 
-static void set_chartrans_handling (
-	HTStream *		context,
-	HTParentAnchor *	anchor,
-	int			chndl)
+static void set_chartrans_handling(HTStream *context, HTParentAnchor *anchor,
+				   int chndl)
 {
     if (chndl < 0) {
 	/*
-	**  Nothing was set for the parser in earlier stages,
-	**  so the HTML parser's UCLYhndl should still be its
-	**  default. - FM
-	*/
+	 * Nothing was set for the parser in earlier stages, so the HTML
+	 * parser's UCLYhndl should still be its default.  - FM
+	 */
 	chndl = HTAnchor_getUCLYhndl(anchor, UCT_STAGE_STRUCTURED);
 	if (chndl < 0)
 	    /*
-	    **	That wasn't set either, so seek the HText default. - FM
-	    */
+	     * That wasn't set either, so seek the HText default.  - FM
+	     */
 	    chndl = HTAnchor_getUCLYhndl(anchor, UCT_STAGE_HTEXT);
 	if (chndl < 0)
 	    /*
-	    **	That wasn't set either, so assume the current display
-	    **	character set. - FM
-	    */
+	     * That wasn't set either, so assume the current display character
+	     * set.  - FM
+	     */
 	    chndl = current_char_set;
 	/*
-	**  Try to set the HText and HTML stages' chartrans info
-	**  with the default lock level (will not be changed if
-	**  it was set previously with a higher lock level). - FM
-	*/
+	 * Try to set the HText and HTML stages' chartrans info with the
+	 * default lock level (will not be changed if it was set previously
+	 * with a higher lock level).  - FM
+	 */
 	HTAnchor_setUCInfoStage(anchor, chndl,
 				UCT_STAGE_HTEXT,
 				UCT_SETBY_DEFAULT);
@@ -402,27 +370,25 @@ static void set_chartrans_handling (
 				UCT_STAGE_STRUCTURED,
 				UCT_SETBY_DEFAULT);
 	/*
-	**  Get the chartrans info for output to the HTML parser. - FM
-	*/
+	 * Get the chartrans info for output to the HTML parser.  - FM
+	 */
 	context->outUCI = HTAnchor_getUCInfoStage(anchor,
 						  UCT_STAGE_STRUCTURED);
 	context->outUCLYhndl = HTAnchor_getUCLYhndl(context->node_anchor,
 						    UCT_STAGE_STRUCTURED);
     }
     /*
-    **	Set the in->out transformation parameters. - FM
-    */
+     * Set the in->out transformation parameters.  - FM
+     */
     UCSetTransParams(&context->T,
 		     context->inUCLYhndl, context->inUCI,
 		     context->outUCLYhndl, context->outUCI);
     /*
-    **	This is intended for passing the SGML parser's input
-    **	charset as an argument in each call to the HTML
-    **	parser's start tag function, but it would be better
-    **	to call a Lynx_HTML_parser function to set an element
-    **	in its HTStructured object, itself, if this were
-    **	needed. - FM
-    */
+     * This is intended for passing the SGML parser's input charset as an
+     * argument in each call to the HTML parser's start tag function, but it
+     * would be better to call a Lynx_HTML_parser function to set an element in
+     * its HTStructured object, itself, if this were needed.  - FM
+     */
     if (HTCJK != NOCJK) {
 	context->current_tag_charset = -1;
     } else if (context->T.transp) {
@@ -440,25 +406,24 @@ static void set_chartrans_handling (
     }
 }
 
-static void change_chartrans_handling (
-	HTStream *		context)
+static void change_chartrans_handling(HTStream *context)
 {
     int new_LYhndl = HTAnchor_getUCLYhndl(context->node_anchor,
 					  UCT_STAGE_PARSER);
+
     if (new_LYhndl != context->inUCLYhndl &&
 	new_LYhndl >= 0) {
 	/*
-	 *  Something changed. but ignore if a META wants an unknown charset.
+	 * Something changed.  but ignore if a META wants an unknown charset.
 	 */
-	LYUCcharset * new_UCI = HTAnchor_getUCInfoStage(context->node_anchor,
-							UCT_STAGE_PARSER);
+	LYUCcharset *new_UCI = HTAnchor_getUCInfoStage(context->node_anchor,
+						       UCT_STAGE_PARSER);
+
 	if (new_UCI) {
-	    LYUCcharset * next_UCI = HTAnchor_getUCInfoStage(
-				    context->node_anchor, UCT_STAGE_STRUCTURED
-							    );
-	    int next_LYhndl = HTAnchor_getUCLYhndl(
-				    context->node_anchor, UCT_STAGE_STRUCTURED
-						  );
+	    LYUCcharset *next_UCI = HTAnchor_getUCInfoStage(context->node_anchor,
+							    UCT_STAGE_STRUCTURED);
+	    int next_LYhndl = HTAnchor_getUCLYhndl(context->node_anchor, UCT_STAGE_STRUCTURED);
+
 	    context->inUCI = new_UCI;
 	    context->inUCLYhndl = new_LYhndl;
 	    context->outUCI = next_UCI;
@@ -475,16 +440,14 @@ static int current_is_class = 0;
 #endif
 
 /*	Handle Attribute
-**	----------------
-*/
+ *	----------------
+ */
 /* PUBLIC const char * SGML_default = "";   ?? */
 
-static void handle_attribute_name (
-	HTStream *	context,
-	const char *	s)
+static void handle_attribute_name(HTStream *context, const char *s)
 {
-    HTTag * tag = context->current_tag;
-    attr * attributes = tag->attributes;
+    HTTag *tag = context->current_tag;
+    attr *attributes = tag->attributes;
     int high, low, i, diff;
 
 #ifdef USE_PRETTYSRC
@@ -494,25 +457,25 @@ static void handle_attribute_name (
     }
 #endif
     /*
-    **	Ignore unknown tag. - KW
-    */
+     * Ignore unknown tag.  - KW
+     */
     if (tag == context->unknown_tag) {
 #ifdef USE_PRETTYSRC
 	if (psrc_view)
-	    context->current_attribute_number = 1; /* anything !=INVALID */
+	    context->current_attribute_number = 1;	/* anything !=INVALID */
 #endif
 	return;
     }
 
     /*
-    **	Binary search for attribute name.
-    */
+     * Binary search for attribute name.
+     */
     for (low = 0, high = tag->number_of_attributes;
 	 high > low;
-	 diff < 0 ? (low = i+1) : (high = i)) {
-	i = (low + (high-low)/2);
+	 diff < 0 ? (low = i + 1) : (high = i)) {
+	i = (low + (high - low) / 2);
 	diff = my_casecomp(attributes[i].name, s);
-	if (diff == 0) {		/* success: found it */
+	if (diff == 0) {	/* success: found it */
 	    context->current_attribute_number = i;
 #ifdef USE_PRETTYSRC
 	    if (psrc_view) {
@@ -521,150 +484,141 @@ static void handle_attribute_name (
 	    } else
 #endif
 	    {
-	    context->present[i] = YES;
-	    Clear_extra(context->value[i]);
+		context->present[i] = YES;
+		Clear_extra(context->value[i]);
 #ifdef USE_COLOR_STYLE
 #   ifdef USE_PRETTYSRC
-	    current_is_class = IS_C(attributes[i]);
+		current_is_class = IS_C(attributes[i]);
 #   else
-	    current_is_class = (!strcasecomp("class", s));
+		current_is_class = (!strcasecomp("class", s));
 #   endif
-	    CTRACE((tfp, "SGML: found attribute %s, %d\n", s, current_is_class));
+		CTRACE((tfp, "SGML: found attribute %s, %d\n", s, current_is_class));
 #endif
 	    }
 	    return;
-	} /* if */
-
-    } /* for */
+	}
+	/* if */
+    }				/* for */
 
     CTRACE((tfp, "SGML: Unknown attribute %s for tag %s\n",
-		s, context->current_tag->name));
+	    s, context->current_tag->name));
     context->current_attribute_number = INVALID;	/* Invalid */
 }
 
-
 /*	Handle attribute value
-**	----------------------
-*/
-static void handle_attribute_value (
-	HTStream *	context,
-	const char *	s)
+ *	----------------------
+ */
+static void handle_attribute_value(HTStream *context, const char *s)
 {
     if (context->current_attribute_number != INVALID) {
 	StrAllocCopy_extra(context->value[context->current_attribute_number], s);
 #ifdef USE_COLOR_STYLE
-	if (current_is_class)
-	{
-	    strncpy (class_string, s, TEMPSTRINGSIZE);
+	if (current_is_class) {
+	    strncpy(class_string, s, TEMPSTRINGSIZE);
 	    CTRACE((tfp, "SGML: class is '%s'\n", s));
-	}
-	else
-	{
+	} else {
 	    CTRACE((tfp, "SGML: attribute value is '%s'\n", s));
 	}
 #endif
     } else {
 	CTRACE((tfp, "SGML: Attribute value %s ***ignored\n", s));
     }
-    context->current_attribute_number = INVALID; /* can't have two assignments! */
+    context->current_attribute_number = INVALID;	/* can't have two assignments! */
 }
 
-
 /*
-**  Translate some Unicodes to Lynx special codes and output them.
-**  Special codes - ones those output depend on parsing.
-**
-**  Additional issue, like handling bidirectional text if necessary
-**  may be called from here:  zwnj (8204), zwj (8205), lrm (8206), rlm (8207)
-**  - currently they are ignored in SGML.c and LYCharUtils.c
-**  but also in UCdomap.c because they are non printable...
-**
-*/
-static BOOL put_special_unicodes (
-	HTStream *	context,
-	UCode_t	code)
+ *  Translate some Unicodes to Lynx special codes and output them.
+ *  Special codes - ones those output depend on parsing.
+ *
+ *  Additional issue, like handling bidirectional text if necessary
+ *  may be called from here:  zwnj (8204), zwj (8205), lrm (8206), rlm (8207)
+ *  - currently they are ignored in SGML.c and LYCharUtils.c
+ *  but also in UCdomap.c because they are non printable...
+ *
+ */
+static BOOL put_special_unicodes(HTStream *context, UCode_t code)
 {
     /* (Tgf_nolyspcl) */
     if (context->no_lynx_specialcodes) {
 	/*
-	**  We were asked by a "DTD" flag to not generate lynx specials. - kw
-	*/
+	 * We were asked by a "DTD" flag to not generate lynx specials.  - kw
+	 */
 	return NO;
     }
 
-    if (code == CH_NBSP) {  /* S/390 -- gil -- 0657 */
+    if (code == CH_NBSP) {	/* S/390 -- gil -- 0657 */
 	/*
-	**  Use Lynx special character for nbsp.
-	*/
+	 * Use Lynx special character for nbsp.
+	 */
 #ifdef USE_PRETTYSRC
 	if (!psrc_view)
 #endif
-	PUTC(HT_NON_BREAK_SPACE);
-    } else  if (code == CH_SHY) {
+	    PUTC(HT_NON_BREAK_SPACE);
+    } else if (code == CH_SHY) {
 	/*
-	**  Use Lynx special character for shy.
-	*/
+	 * Use Lynx special character for shy.
+	 */
 #ifdef USE_PRETTYSRC
 	if (!psrc_view)
 #endif
-	PUTC(LY_SOFT_HYPHEN);
+	    PUTC(LY_SOFT_HYPHEN);
     } else if (code == 8194 || code == 8201) {
 	/*
-	**  Use Lynx special character for ensp or thinsp.
-	**
-	**  Originally, Lynx use space '32' as word delimiter and omits this
-	**  space at end of line if word is wrapped to the next line.  There
-	**  are several other spaces in the Unicode repertoire and we should
-	**  teach Lynx to understand them, not only as regular characters but
-	**  in the context of line wrapping.  Unfortunately, if we use
-	**  HT_EN_SPACE we override the chartrans tables for those spaces
-	**  with a single '32' for all (but do line wrapping more fancy).
-	**
-	**  We may treat emsp as one or two ensp (below).
-	*/
+	 * Use Lynx special character for ensp or thinsp.
+	 *
+	 * Originally, Lynx use space '32' as word delimiter and omits this
+	 * space at end of line if word is wrapped to the next line.  There are
+	 * several other spaces in the Unicode repertoire and we should teach
+	 * Lynx to understand them, not only as regular characters but in the
+	 * context of line wrapping.  Unfortunately, if we use HT_EN_SPACE we
+	 * override the chartrans tables for those spaces with a single '32'
+	 * for all (but do line wrapping more fancy).
+	 *
+	 * We may treat emsp as one or two ensp (below).
+	 */
 #ifdef USE_PRETTYSRC
 	if (!psrc_view)
 #endif
-	PUTC(HT_EN_SPACE);
+	    PUTC(HT_EN_SPACE);
     } else if (code == 8195) {
 	/*
-	**  Use Lynx special character for emsp.
-	*/
+	 * Use Lynx special character for emsp.
+	 */
 #ifdef USE_PRETTYSRC
 	if (!psrc_view) {
 #endif
-	/* PUTC(HT_EN_SPACE);  let's stay with a single space :) */
-	PUTC(HT_EN_SPACE);
+	    /* PUTC(HT_EN_SPACE);  let's stay with a single space :) */
+	    PUTC(HT_EN_SPACE);
 #ifdef USE_PRETTYSRC
 	}
 #endif
     } else {
 	/*
-	**  Return NO if nothing done.
-	*/
+	 * Return NO if nothing done.
+	 */
 	return NO;
     }
     /*
-    **	We have handled it.
-    */
+     * We have handled it.
+     */
     return YES;
 }
 
 #ifdef USE_PRETTYSRC
-static void put_pretty_entity (HTStream *  context, int  term)
+static void put_pretty_entity(HTStream *context, int term)
 {
     PSRCSTART(entity);
     PUTC('&');
     PUTS(entity_string);
     if (term)
-	PUTC((char)term);
+	PUTC((char) term);
     PSRCSTOP(entity);
 }
 
-static void put_pretty_number (HTStream *  context)
+static void put_pretty_number(HTStream *context)
 {
     PSRCSTART(entity);
-    PUTS( (context->isHex ? "&#x" : "&#") );
+    PUTS((context->isHex ? "&#x" : "&#"));
     PUTS(entity_string);
     PUTC(';');
     PSRCSTOP(entity);
@@ -672,39 +626,37 @@ static void put_pretty_number (HTStream *  context)
 #endif /* USE_PRETTYSRC */
 
 /*	Handle entity
-**	-------------
-**
-** On entry,
-**	s	contains the entity name zero terminated
-** Bugs:
-**	If the entity name is unknown, the terminator is treated as
-**	a printable non-special character in all cases, even if it is '<'
-** Bug-fix:
-**	Modified SGML_character() so we only come here with terminator
-**	as '\0' and check a FoundEntity flag. -- Foteos Macrides
-**
-** Modified more (for use with Lynx character translation code):
-*/
-static char replace_buf [64];	      /* buffer for replacement strings */
+ *	-------------
+ *
+ * On entry,
+ *	s	contains the entity name zero terminated
+ * Bugs:
+ *	If the entity name is unknown, the terminator is treated as
+ *	a printable non-special character in all cases, even if it is '<'
+ * Bug-fix:
+ *	Modified SGML_character() so we only come here with terminator
+ *	as '\0' and check a FoundEntity flag. -- Foteos Macrides
+ *
+ * Modified more (for use with Lynx character translation code):
+ */
+static char replace_buf[64];	/* buffer for replacement strings */
 static BOOL FoundEntity = FALSE;
 
-static void handle_entity (
-	HTStream *	context,
-	char		term)
+static void handle_entity(HTStream *context, char term)
 {
     UCode_t code;
     long uck = -1;
     const char *s = context->string->data;
 
     /*
-    **	Handle all entities normally. - FM
-    */
+     * Handle all entities normally.  - FM
+     */
     FoundEntity = FALSE;
     if ((code = HTMLGetEntityUCValue(s)) != 0) {
 	/*
-	**  We got a Unicode value for the entity name.
-	**  Check for special Unicodes. - FM
-	*/
+	 * We got a Unicode value for the entity name.  Check for special
+	 * Unicodes.  - FM
+	 */
 	if (put_special_unicodes(context, code)) {
 #ifdef USE_PRETTYSRC
 	    if (psrc_view) {
@@ -715,8 +667,8 @@ static void handle_entity (
 	    return;
 	}
 	/*
-	**  Seek a translation from the chartrans tables.
-	*/
+	 * Seek a translation from the chartrans tables.
+	 */
 	if ((uck = UCTransUniChar(code, context->outUCLYhndl)) >= 32 &&
 /* =============== work in ASCII below here ===============  S/390 -- gil -- 0672 */
 	    uck < 256 &&
@@ -727,15 +679,15 @@ static void handle_entity (
 		put_pretty_entity(context, term);
 	    } else
 #endif
-	    PUTC(FROMASCII((char)uck));
+		PUTC(FROMASCII((char) uck));
 	    FoundEntity = TRUE;
 	    return;
 	} else if ((uck == -4 ||
 		    (context->T.repl_translated_C0 &&
 		     uck > 0 && uck < 32)) &&
-		   /*
-		   **  Not found; look for replacement string.
-		   */
+	    /*
+	     * Not found; look for replacement string.
+	     */
 		   (uck = UCTransUniCharStr(replace_buf, 60, code,
 					    context->outUCLYhndl, 0) >= 0)) {
 #ifdef USE_PRETTYSRC
@@ -743,22 +695,24 @@ static void handle_entity (
 		put_pretty_entity(context, term);
 	    } else
 #endif
-	    PUTS(replace_buf);
+		PUTS(replace_buf);
 	    FoundEntity = TRUE;
 	    return;
 	}
 	/*
-	**  If we're displaying UTF-8, try that now. - FM
-	*/
+	 * If we're displaying UTF-8, try that now.  - FM
+	 */
 #ifndef USE_PRETTYSRC
 	if (context->T.output_utf8 && PUTUTF8(code)) {
 	    FoundEntity = TRUE;
 	    return;
 	}
 #else
-	if (context->T.output_utf8 && (psrc_view ?
-	      (UCPutUtf8_charstring((HTStream *)context->target,
-	      (putc_func_t*)(fake_put_character), code)): PUTUTF8(code) ) ) {
+	if (context->T.output_utf8 && (psrc_view
+				       ? (UCPutUtf8_charstring((HTStream *) context->target,
+							       (putc_func_t *) (fake_put_character),
+							       code))
+				       : PUTUTF8(code))) {
 
 	    if (psrc_view) {
 		put_pretty_entity(context, term);
@@ -769,8 +723,8 @@ static void handle_entity (
 	}
 #endif
 	/*
-	**  If it's safe ASCII, use it. - FM
-	*/
+	 * If it's safe ASCII, use it.  - FM
+	 */
 	if (code >= 32 && code < 127) {
 #ifdef USE_PRETTYSRC
 	    if (psrc_view) {
@@ -778,16 +732,15 @@ static void handle_entity (
 	    } else
 #endif
 
-	    PUTC(FROMASCII((char)code));
+		PUTC(FROMASCII((char) code));
 	    FoundEntity = TRUE;
 	    return;
 	}
 /* =============== work in ASCII above here ===============  S/390 -- gil -- 0682 */
 	/*
-	**  Ignore zwnj (8204) and zwj (8205), if we get to here.
-	**  Note that zwnj may have been handled as <WBR>
-	**  by the calling function. - FM
-	*/
+	 * Ignore zwnj (8204) and zwj (8205), if we get to here.  Note that
+	 * zwnj may have been handled as <WBR> by the calling function.  - FM
+	 */
 	if (!strcmp(s, "zwnj") ||
 	    !strcmp(s, "zwj")) {
 	    CTRACE((tfp, "handle_entity: Ignoring '%s'.\n", s));
@@ -800,8 +753,8 @@ static void handle_entity (
 	    return;
 	}
 	/*
-	**  Ignore lrm (8206), and rln (8207), if we get to here. - FM
-	*/
+	 * Ignore lrm (8206), and rln (8207), if we get to here.  - FM
+	 */
 	if (!strcmp(s, "lrm") ||
 	    !strcmp(s, "rlm")) {
 	    CTRACE((tfp, "handle_entity: Ignoring '%s'.\n", s));
@@ -816,13 +769,13 @@ static void handle_entity (
     }
 
     /*
-    **	If entity string not found, display as text.
-    */
+     * If entity string not found, display as text.
+     */
 #ifdef USE_PRETTYSRC
     if (psrc_view)
 	PSRCSTART(badseq);
 #endif
-    CTRACE((tfp, "SGML: Unknown entity '%s' %ld %ld\n", s, (long)code, uck)); /* S/390 -- gil -- 0695 */
+    CTRACE((tfp, "SGML: Unknown entity '%s' %ld %ld\n", s, (long) code, uck));	/* S/390 -- gil -- 0695 */
     PUTC('&');
     PUTS(s);
     if (term != '\0')
@@ -833,12 +786,10 @@ static void handle_entity (
 #endif
 }
 
-
 /*	Handle comment
-**	--------------
-*/
-static void handle_comment (
-	HTStream *		context)
+ *	--------------
+ */
+static void handle_comment(HTStream *context)
 {
     const char *s = context->string->data;
 
@@ -846,8 +797,8 @@ static void handle_comment (
 
     if (context->csi == NULL &&
 	strncmp(s, "!--#", 4) == 0 &&
-	LYCheckForCSI(context->node_anchor, (char **)&context->url) == TRUE) {
-	LYDoCSI(context->url, s, (char **)&context->csi);
+	LYCheckForCSI(context->node_anchor, (char **) &context->url) == TRUE) {
+	LYDoCSI(context->url, s, (char **) &context->csi);
     } else {
 	LYCommentHacks(context->node_anchor, context->string->data);
     }
@@ -855,12 +806,10 @@ static void handle_comment (
     return;
 }
 
-
 /*	Handle identifier
-**	-----------------
-*/
-static void handle_identifier (
-	HTStream *		context)
+ *	-----------------
+ */
+static void handle_identifier(HTStream *context)
 {
     const char *s = context->string->data;
 
@@ -869,12 +818,10 @@ static void handle_identifier (
     return;
 }
 
-
 /*	Handle doctype
-**	--------------
-*/
-static void handle_doctype (
-	HTStream *		context)
+ *	--------------
+ */
+static void handle_doctype(HTStream *context)
 {
     const char *s = context->string->data;
 
@@ -883,16 +830,13 @@ static void handle_doctype (
     return;
 }
 
-static void SGML_write (
-	HTStream *		me,
-	const char *		s,
-	int			l);
+static void SGML_write(HTStream *me, const char *s,
+		       int l);
 
 /*	Handle marked
-**	-------------
-*/
-static void handle_marked (
-	HTStream *		context)
+ *	-------------
+ */
+static void handle_marked(HTStream *context)
 {
     const char *s = context->string->data;
 
@@ -906,20 +850,18 @@ static void handle_marked (
 	   charset once it is in include - kw */
 
     } else if (!strncmp(context->string->data, "![CDATA[", 8)) {
-	(*context->actions->_write)(context->target,
-		   context->string->data + 8,
-		   context->string->size - 11);
+	(*context->actions->_write) (context->target,
+				     context->string->data + 8,
+				     context->string->size - 11);
 
     }
     return;
 }
 
-
 /*	Handle sgmlent
-**	--------------
-*/
-static void handle_sgmlent (
-	HTStream *		context)
+ *	--------------
+ */
+static void handle_sgmlent(HTStream *context)
 {
     const char *s = context->string->data;
 
@@ -928,12 +870,10 @@ static void handle_sgmlent (
     return;
 }
 
-
 /*	Handle sgmlent
-**	--------------
-*/
-static void handle_sgmlele (
-	HTStream *		context)
+ *	--------------
+ */
+static void handle_sgmlele(HTStream *context)
 {
     const char *s = context->string->data;
 
@@ -942,12 +882,10 @@ static void handle_sgmlele (
     return;
 }
 
-
 /*	Handle sgmlatt
-**	--------------
-*/
-static void handle_sgmlatt (
-	HTStream *		context)
+ *	--------------
+ */
+static void handle_sgmlatt(HTStream *context)
 {
     const char *s = context->string->data;
 
@@ -957,17 +895,16 @@ static void handle_sgmlatt (
 }
 
 /*
- *  Convenience macros - tags (elements) are identified sometimes
- *  by an int or enum value ('TAGNUM'), sometimes
- *  by a pointer to HTTag ('TAGP'). - kw
+ * Convenience macros - tags (elements) are identified sometimes by an int or
+ * enum value ('TAGNUM'), sometimes by a pointer to HTTag ('TAGP').  - kw
  */
 #define TAGNUM_OF_TAGP(t) (t - context->dtd->tags)
 #define TAGP_OF_TAGNUM(e) (context->dtd->tags + e)
 
 /*
- *  The following implement special knowledge about OBJECT.
- *  As long as HTML_OBJECT is the only tag for which an alternative
- *  variant exist, they can be simple macros. - kw
+ * The following implement special knowledge about OBJECT.  As long as
+ * HTML_OBJECT is the only tag for which an alternative variant exist, they can
+ * be simple macros.  - kw
  */
 /* does 'TAGNUM' e have an alternative (variant) parsing mode? */
 #define HAS_ALT_TAGNUM(e) (e == HTML_OBJECT)
@@ -985,36 +922,31 @@ static void handle_sgmlatt (
 #define ALT_TAGP(t) ALT_TAGP_OF_TAGNUM(TAGNUM_OF_TAGP(t))
 #define NORMAL_TAGP(t) NORMAL_TAGP_OF_TAGNUM(TAGNUM_OF_TAGP(t))
 
-
 #ifdef EXTENDED_HTMLDTD
 
-static BOOL element_valid_within (
-    HTTag *	new_tag,
-    HTTag *	stacked_tag,
-    BOOL	direct)
+static BOOL element_valid_within(HTTag * new_tag, HTTag * stacked_tag, BOOL direct)
 {
     TagClass usecontains, usecontained;
+
     if (!stacked_tag || !new_tag)
 	return YES;
     usecontains = (direct ? stacked_tag->contains : stacked_tag->icontains);
     usecontained = (direct ? new_tag->contained : new_tag->icontained);
     if (new_tag == stacked_tag)
 	return (BOOL) ((Tgc_same & usecontains) &&
-		(Tgc_same & usecontained));
+		       (Tgc_same & usecontained));
     else
 	return (BOOL) ((new_tag->tagclass & usecontains) &&
-		(stacked_tag->tagclass & usecontained));
+		       (stacked_tag->tagclass & usecontained));
 }
 
 typedef enum {
-    close_NO	= 0,
+    close_NO = 0,
     close_error = 1,
     close_valid = 2
 } canclose_t;
 
-static canclose_t can_close (
-    HTTag *	new_tag,
-    HTTag *	stacked_tag)
+static canclose_t can_close(HTTag * new_tag, HTTag * stacked_tag)
 {
     if (!stacked_tag)
 	return close_NO;
@@ -1027,11 +959,11 @@ static canclose_t can_close (
 		close_error : close_NO);
 }
 
-static void do_close_stacked (
-    HTStream * context)
+static void do_close_stacked(HTStream *context)
 {
-    HTElement * stacked = context->element_stack;
+    HTElement *stacked = context->element_stack;
     HTMLElement e;
+
     if (!stacked)
 	return;			/* stack was empty */
     if (context->inSELECT && !strcasecomp(stacked->tag->name, "SELECT")) {
@@ -1039,24 +971,22 @@ static void do_close_stacked (
     }
     e = NORMAL_TAGNUM(TAGNUM_OF_TAGP(stacked->tag));
 #ifdef USE_PRETTYSRC
-    if (!psrc_view) /* Don't actually pass call on if viewing psrc - kw */
+    if (!psrc_view)		/* Don't actually pass call on if viewing psrc - kw */
 #endif
-    (*context->actions->end_element)(
-	context->target,
-	e,
-	(char **)&context->include);
+	(*context->actions->end_element) (context->target,
+					  e,
+					  (char **) &context->include);
     context->element_stack = stacked->next;
     pool_free(stacked);
     context->no_lynx_specialcodes = context->element_stack ?
 	(context->element_stack->tag->flags & Tgf_nolyspcl) : NO;
 }
 
-static int is_on_stack (
-	HTStream *	context,
-	HTTag *	old_tag)
+static int is_on_stack(HTStream *context, HTTag * old_tag)
 {
-   HTElement * stacked = context->element_stack;
+    HTElement *stacked = context->element_stack;
     int i = 1;
+
     for (; stacked; stacked = stacked->next, i++) {
 	if (stacked->tag == old_tag ||
 	    stacked->tag == ALT_TAGP(old_tag))
@@ -1067,11 +997,9 @@ static int is_on_stack (
 #endif /* EXTENDED_HTMLDTD */
 
 /*	End element
-**	-----------
-*/
-static void end_element (
-	HTStream *	context,
-	HTTag *	old_tag)
+ *	-----------
+ */
+static void end_element(HTStream *context, HTTag * old_tag)
 {
 #ifdef EXTENDED_HTMLDTD
 
@@ -1091,9 +1019,11 @@ static void end_element (
 	    canclose_check = can_close(old_tag, context->element_stack->tag);
 	    if (canclose_check != close_NO) {
 		CTRACE((tfp, "SGML: End </%s> \t<- %s end </%s>\n",
-			    context->element_stack->tag->name,
-			    canclose_check == close_valid ? "supplied," : "***forced by",
-			    old_tag->name));
+			context->element_stack->tag->name,
+			((canclose_check == close_valid)
+			 ? "supplied,"
+			 : "***forced by"),
+			old_tag->name));
 		do_close_stacked(context);
 		extra_action_taken = YES;
 		stackpos = is_on_stack(context, old_tag);
@@ -1102,17 +1032,18 @@ static void end_element (
 
 	if (stackpos == 0 && old_tag->contents != SGML_EMPTY) {
 	    CTRACE((tfp, "SGML: Still open %s, ***no open %s for </%s>\n",
-			context->element_stack ?
-			context->element_stack->tag->name : "none",
-			old_tag->name,
-			old_tag->name));
+		    context->element_stack ?
+		    context->element_stack->tag->name : "none",
+		    old_tag->name,
+		    old_tag->name));
 	    return;
 	}
 	if (stackpos > 1) {
-	    CTRACE((tfp, "SGML: Nesting <%s>...<%s> \t<- ***invalid end </%s>\n",
-			old_tag->name,
-			context->element_stack->tag->name,
-			old_tag->name));
+	    CTRACE((tfp,
+		    "SGML: Nesting <%s>...<%s> \t<- ***invalid end </%s>\n",
+		    old_tag->name,
+		    context->element_stack->tag->name,
+		    old_tag->name));
 	    return;
 	}
     }
@@ -1121,83 +1052,83 @@ static void end_element (
 #endif /* EXTENDED_HTMLDTD */
 
     /*
-    **	If we are in a SELECT block, ignore anything
-    **	but a SELECT end tag. - FM
-    */
+     * If we are in a SELECT block, ignore anything but a SELECT end tag.  - FM
+     */
     if (context->inSELECT) {
 	if (!strcasecomp(old_tag->name, "SELECT")) {
 	    /*
-	    **	Turn off the inSELECT flag and fall through. - FM
-	    */
+	     * Turn off the inSELECT flag and fall through.  - FM
+	     */
 	    context->inSELECT = FALSE;
 	} else {
 	    /*
-	    **	Ignore the end tag. - FM
-	    */
+	     * Ignore the end tag.  - FM
+	     */
 	    CTRACE((tfp, "SGML: ***Ignoring end tag </%s> in SELECT block.\n",
-			old_tag->name));
+		    old_tag->name));
 	    return;
 	}
     }
     /*
-    **	Handle the end tag. - FM
-    */
+     * Handle the end tag.  - FM
+     */
     CTRACE((tfp, "SGML: End </%s>\n", old_tag->name));
     if (old_tag->contents == SGML_EMPTY) {
 	CTRACE((tfp, "SGML: ***Illegal end tag </%s> found.\n",
-		    old_tag->name));
+		old_tag->name));
 	return;
     }
 #ifdef WIND_DOWN_STACK
-    while (context->element_stack) /* Loop is error path only */
+    while (context->element_stack)	/* Loop is error path only */
 #else
-    if (context->element_stack) /* Substitute and remove one stack element */
+    if (context->element_stack)	/* Substitute and remove one stack element */
 #endif /* WIND_DOWN_STACK */
     {
 	int status = HT_OK;
 	HTMLElement e;
-	HTElement * N = context->element_stack;
-	HTTag * t = (N->tag != old_tag) ? NORMAL_TAGP(N->tag) : N->tag;
-
-	if (old_tag != t) {		/* Mismatch: syntax error */
-	    if (context->element_stack->next) { /* This is not the last level */
-		CTRACE((tfp, "SGML: Found </%s> when expecting </%s>. </%s> ***assumed.\n",
-			     old_tag->name, t->name, t->name));
-	    } else {			/* last level */
-		CTRACE((tfp, "SGML: Found </%s> when expecting </%s>. </%s> ***Ignored.\n",
-			    old_tag->name, t->name, old_tag->name));
-		return;			/* Ignore */
+	HTElement *N = context->element_stack;
+	HTTag *t = (N->tag != old_tag) ? NORMAL_TAGP(N->tag) : N->tag;
+
+	if (old_tag != t) {	/* Mismatch: syntax error */
+	    if (context->element_stack->next) {		/* This is not the last level */
+		CTRACE((tfp,
+			"SGML: Found </%s> when expecting </%s>. </%s> ***assumed.\n",
+			old_tag->name, t->name, t->name));
+	    } else {		/* last level */
+		CTRACE((tfp,
+			"SGML: Found </%s> when expecting </%s>. </%s> ***Ignored.\n",
+			old_tag->name, t->name, old_tag->name));
+		return;		/* Ignore */
 	    }
 	}
 
 	e = NORMAL_TAGNUM(TAGNUM_OF_TAGP(t));
 	CTRACE2(TRACE_SGML, (tfp, "tagnum(%p) = %d\n", t, e));
 #ifdef USE_PRETTYSRC
-	if (!psrc_view) /* Don't actually pass call on if viewing psrc - kw */
+	if (!psrc_view)		/* Don't actually pass call on if viewing psrc - kw */
 #endif
-	    status = (*context->actions->end_element)(context->target,
-						e, (char **)&context->include);
+	    status = (*context->actions->end_element) (context->target,
+						       e, (char **) &context->include);
 	if (status == HT_PARSER_REOPEN_ELT) {
 	    CTRACE((tfp, "SGML: Restart <%s>\n", t->name));
-	    (*context->actions->start_element)(
-		context->target,
-		e,
-		NULL,
-		NULL,
-		context->current_tag_charset,
-		(char **)&context->include);
+	    (*context->actions->start_element) (context->target,
+						e,
+						NULL,
+						NULL,
+						context->current_tag_charset,
+						(char **) &context->include);
 	} else if (status == HT_PARSER_OTHER_CONTENT) {
 	    CTRACE((tfp, "SGML: Continue with other content model for <%s>\n", t->name));
 	    context->element_stack->tag = ALT_TAGP_OF_TAGNUM(e);
 	} else {
-	    context->element_stack = N->next;		/* Remove from stack */
+	    context->element_stack = N->next;	/* Remove from stack */
 	    pool_free(N);
 	}
 	context->no_lynx_specialcodes = context->element_stack ?
 	    (context->element_stack->tag->flags & Tgf_nolyspcl) : NO;
 #ifdef WIND_DOWN_STACK
 	if (old_tag == t)
-	    return;  /* Correct sequence */
+	    return;		/* Correct sequence */
 #else
 	return;
 #endif /* WIND_DOWN_STACK */
@@ -1206,17 +1137,15 @@ static void end_element (
 
     }
     CTRACE((tfp, "SGML: Extra end tag </%s> found and ignored.\n",
-		old_tag->name));
+	    old_tag->name));
 }
 
-
 /*	Start a element
 */
-static void start_element (
-	HTStream *	context)
+static void start_element(HTStream *context)
 {
     int status;
-    HTTag * new_tag = context->current_tag;
+    HTTag *new_tag = context->current_tag;
     HTMLElement e = TAGNUM_OF_TAGP(new_tag);
     BOOL ok = FALSE;
 
@@ -1237,17 +1166,20 @@ static void start_element (
 	    canclose_check = can_close(new_tag, context->element_stack->tag);
 	    if (canclose_check != close_NO) {
 		CTRACE((tfp, "SGML: End </%s> \t<- %s start <%s>\n",
-			    context->element_stack->tag->name,
-			    canclose_check == close_valid ? "supplied," : "***forced by",
-			    new_tag->name));
+			context->element_stack->tag->name,
+			((canclose_check == close_valid)
+			 ? "supplied,"
+			 : "***forced by"),
+			new_tag->name));
 		do_close_stacked(context);
 		extra_action_taken = YES;
-		if (canclose_check  == close_error)
+		if (canclose_check == close_error)
 		    direct_container = NO;
 	    } else {
-		CTRACE((tfp, "SGML: Still open %s \t<- ***invalid start <%s>\n",
-			    context->element_stack->tag->name,
-			    new_tag->name));
+		CTRACE((tfp,
+			"SGML: Still open %s \t<- ***invalid start <%s>\n",
+			context->element_stack->tag->name,
+			new_tag->name));
 	    }
 	}
 	if (context->element_stack && !valid &&
@@ -1255,36 +1187,39 @@ static void start_element (
 	    !(valid = element_valid_within(new_tag, context->element_stack->tag,
 					   direct_container))) {
 	    CTRACE((tfp, "SGML: Still open %s \t<- ***ignoring start <%s>\n",
-			context->element_stack->tag->name,
-			new_tag->name));
+		    context->element_stack->tag->name,
+		    new_tag->name));
 	    return;
 	}
 
-	if (context->element_stack && !extra_action_taken &&
-	    canclose_check == close_NO && !valid && (new_tag->flags & Tgf_mafse)) {
+	if (context->element_stack &&
+	    !extra_action_taken &&
+	    (canclose_check == close_NO) &&
+	    !valid && (new_tag->flags & Tgf_mafse)) {
 	    BOOL has_attributes = NO;
 	    int i = 0;
-	    for (; i< new_tag->number_of_attributes && !has_attributes; i++)
+
+	    for (; i < new_tag->number_of_attributes && !has_attributes; i++)
 		has_attributes = context->present[i];
 	    if (!has_attributes) {
-		CTRACE((tfp, "SGML: Still open %s, ***converting invalid <%s> to </%s>\n",
-			    context->element_stack->tag->name,
-			    new_tag->name,
-			    new_tag->name));
+		CTRACE((tfp,
+			"SGML: Still open %s, ***converting invalid <%s> to </%s>\n",
+			context->element_stack->tag->name,
+			new_tag->name,
+			new_tag->name));
 		end_element(context, new_tag);
 		return;
 	    }
 	}
 
 	if (context->element_stack &&
-	    canclose_check == close_error && !(valid =
-					       element_valid_within(
-						   new_tag,
-						   context->element_stack->tag,
-						   direct_container))) {
+	    (canclose_check == close_error) &&
+	    !(valid = element_valid_within(new_tag,
+					   context->element_stack->tag,
+					   direct_container))) {
 	    CTRACE((tfp, "SGML: Still open %s \t<- ***invalid start <%s>\n",
-			context->element_stack->tag->name,
-			new_tag->name));
+		    context->element_stack->tag->name,
+		    new_tag->name));
 	}
     }
     /* Fall through to the non-extended code - kw */
@@ -1292,75 +1227,80 @@ static void start_element (
 #endif /* EXTENDED_HTMLDTD */
 
     /*
-    **	If we are not in a SELECT block, check if this is
-    **	a SELECT start tag.  Otherwise (i.e., we are in a
-    **	SELECT block) accept only OPTION as valid, terminate
-    **	the SELECT block if it is any other form-related
-    **	element, and otherwise ignore it. - FM
-    */
+     * If we are not in a SELECT block, check if this is a SELECT start tag. 
+     * Otherwise (i.e., we are in a SELECT block) accept only OPTION as valid,
+     * terminate the SELECT block if it is any other form-related element, and
+     * otherwise ignore it.  - FM
+     */
     if (!context->inSELECT) {
 	/*
-	**  We are not in a SELECT block, so check if this starts one. - FM
-	**  (frequent case!)
-	*/
+	 * We are not in a SELECT block, so check if this starts one.  - FM
+	 * (frequent case!)
+	 */
 	/* my_casecomp() - optimized by the first character */
 	if (!my_casecomp(new_tag->name, "SELECT")) {
 	    /*
-	    **	Set the inSELECT flag and fall through. - FM
-	    */
+	     * Set the inSELECT flag and fall through.  - FM
+	     */
 	    context->inSELECT = TRUE;
 	}
     } else {
 	/*
-	**  We are in a SELECT block. - FM
-	*/
+	 * We are in a SELECT block.  - FM
+	 */
 	if (strcasecomp(new_tag->name, "OPTION")) {
 	    /*
-	    **	Ugh, it is not an OPTION. - FM
-	    */
+	     * Ugh, it is not an OPTION.  - FM
+	     */
 	    switch (e) {
-		case HTML_INPUT:  case HTML_TEXTAREA: case HTML_SELECT:
-		case HTML_BUTTON: case HTML_FIELDSET: case HTML_LABEL:
-		case HTML_LEGEND: case HTML_FORM:
-		    ok = TRUE;
-		    break;
-		default:
-		    break;
+	    case HTML_INPUT:
+	    case HTML_TEXTAREA:
+	    case HTML_SELECT:
+	    case HTML_BUTTON:
+	    case HTML_FIELDSET:
+	    case HTML_LABEL:
+	    case HTML_LEGEND:
+	    case HTML_FORM:
+		ok = TRUE;
+		break;
+	    default:
+		break;
 	    }
-	    if (ok)
-	    {
+	    if (ok) {
 		/*
-		**  It is another form-related start tag, so terminate
-		**  the current SELECT block and fall through. - FM
-		*/
-		CTRACE((tfp, "SGML: ***Faking SELECT end tag before <%s> start tag.\n",
-			    new_tag->name));
+		 * It is another form-related start tag, so terminate the
+		 * current SELECT block and fall through.  - FM
+		 */
+		CTRACE((tfp,
+			"SGML: ***Faking SELECT end tag before <%s> start tag.\n",
+			new_tag->name));
 		end_element(context, SGMLFindTag(context->dtd, "SELECT"));
 	    } else {
 		/*
-		**  Ignore the start tag. - FM
-		*/
-		CTRACE((tfp, "SGML: ***Ignoring start tag <%s> in SELECT block.\n",
-			    new_tag->name));
+		 * Ignore the start tag.  - FM
+		 */
+		CTRACE((tfp,
+			"SGML: ***Ignoring start tag <%s> in SELECT block.\n",
+			new_tag->name));
 		return;
 	    }
 	}
     }
     /*
-    **	Handle the start tag. - FM
-    */
+     * Handle the start tag.  - FM
+     */
     CTRACE((tfp, "SGML: Start <%s>\n", new_tag->name));
-    status = (*context->actions->start_element)(
-	context->target,
-	TAGNUM_OF_TAGP(new_tag),
-	context->present,
-	(const char**) context->value,	/* coerce type for think c */
-	context->current_tag_charset,
-	(char **)&context->include);
+    status = (*context->actions->start_element) (context->target,
+						 TAGNUM_OF_TAGP(new_tag),
+						 context->present,
+						 (const char **) context->value,	/* coerce type for think c */
+						 context->current_tag_charset,
+						 (char **) &context->include);
     if (status == HT_PARSER_OTHER_CONTENT)
 	new_tag = ALT_TAGP(new_tag);	/* this is only returned for OBJECT */
-    if (new_tag->contents != SGML_EMPTY) {		/* i.e., tag not empty */
-	HTElement * N = pool_alloc();
+    if (new_tag->contents != SGML_EMPTY) {	/* i.e., tag not empty */
+	HTElement *N = pool_alloc();
+
 	if (N == NULL)
 	    outofmem(__FILE__, "start_element");
 	N->next = context->element_stack;
@@ -1368,76 +1308,73 @@ static void start_element (
 	context->element_stack = N;
 	context->no_lynx_specialcodes = (new_tag->flags & Tgf_nolyspcl);
 
-    } else if (e == HTML_META ) {
+    } else if (e == HTML_META) {
 	/*
-	**  Check for result of META tag. - KW & FM
-	*/
+	 * Check for result of META tag.  - KW & FM
+	 */
 	change_chartrans_handling(context);
     }
 }
 
-
 /*		Find Tag in DTD tag list
-**		------------------------
-**
-** On entry,
-**	dtd	points to dtd structure including valid tag list
-**	string	points to name of tag in question
-**
-** On exit,
-**	returns:
-**		NULL		tag not found
-**		else		address of tag structure in dtd
-*/
-HTTag * SGMLFindTag (
-	const SGML_dtd*	dtd,
-	const char *		s)
+ *		------------------------
+ *
+ * On entry,
+ *	dtd	points to dtd structure including valid tag list
+ *	string	points to name of tag in question
+ *
+ * On exit,
+ *	returns:
+ *		NULL		tag not found
+ *		else		address of tag structure in dtd
+ */
+HTTag *SGMLFindTag(const SGML_dtd * dtd,
+		   const char *s)
 {
     int high, low, i, diff;
-    static HTTag* last[64] = {NULL};  /*optimize using the previous results*/
-    HTTag** res = last + (UCH(*s) % 64);     /*pointer arithmetic*/
+    static HTTag *last[64] =
+    {NULL};			/*optimize using the previous results */
+    HTTag **res = last + (UCH(*s) % 64);	/*pointer arithmetic */
 
     if (*res && !strcasecomp((*res)->name, s))
 	return *res;
 
-    for (low = 0, high=dtd->number_of_tags;
-	  high > low;
-	  diff < 0 ? (low = i+1) : (high = i)) {	/* Binary search */
-	i = (low + (high-low)/2);
+    for (low = 0, high = dtd->number_of_tags;
+	 high > low;
+	 diff < 0 ? (low = i + 1) : (high = i)) {	/* Binary search */
+	i = (low + (high - low) / 2);
 	/* my_casecomp() - optimized by the first character, NOT_ASCII ok */
 	diff = my_casecomp(dtd->tags[i].name, s);	/* Case insensitive */
-	if (diff == 0) {		/* success: found it */
+	if (diff == 0) {	/* success: found it */
 	    *res = &dtd->tags[i];
 	    return *res;
 	}
     }
     if (IsNmStart(*s)) {
 	/*
-	**  Unrecognized, but may be valid. - KW
-	*/
+	 * Unrecognized, but may be valid.  - KW
+	 */
 	return &HTTag_unrecognized;
     }
     return NULL;
 }
 
 /*________________________________________________________________________
-**			Public Methods
-*/
-
+ *			Public Methods
+ */
 
 /*	Could check that we are back to bottom of stack! @@  */
 /*	Do check! - FM					     */
 /*							     */
-static void SGML_free (
-	HTStream *	context)
+static void SGML_free(HTStream *context)
 {
     int i;
-    HTElement * cur;
-    HTTag * t;
+    HTElement *cur;
+    HTTag *t;
 
     /*
-    **	Free the buffers. - FM
-    */
+     * Free the buffers.  - FM
+     */
     FREE(context->recover);
     FREE(context->url);
     FREE(context->csi);
@@ -1445,30 +1382,30 @@ static void SGML_free (
     FREE(context->active_include);
 
     /*
-    **	Wind down stack if any elements are open. - FM
-    */
+     * Wind down stack if any elements are open.  - FM
+     */
     while (context->element_stack) {
 	cur = context->element_stack;
 	t = cur->tag;
 	context->element_stack = cur->next;	/* Remove from stack */
 	pool_free(cur);
 #ifdef USE_PRETTYSRC
-	if (!psrc_view) /* Don't actually call on target if viewing psrc - kw */
+	if (!psrc_view)		/* Don't actually call on target if viewing psrc - kw */
 #endif
-	    (*context->actions->end_element)(context->target,
-		    NORMAL_TAGNUM(TAGNUM_OF_TAGP(t)),
-		    (char **)&context->include);
+	    (*context->actions->end_element) (context->target,
+					      NORMAL_TAGNUM(TAGNUM_OF_TAGP(t)),
+					      (char **) &context->include);
 	FREE(context->include);
     }
 
     /*
-    **	Finish off the target. - FM
-    */
-    (*context->actions->_free)(context->target);
+     * Finish off the target.  - FM
+     */
+    (*context->actions->_free) (context->target);
 
     /*
-    **	Free the strings and context structure. - FM
-    */
+     * Free the strings and context structure.  - FM
+     */
     HTChunkFree(context->string);
     for (i = 0; i < MAX_ATTRIBUTES; i++)
 	FREE_extra(context->value[i]);
@@ -1479,21 +1416,19 @@ static void SGML_free (
 #endif
 }
 
-static void SGML_abort (
-	HTStream *	context,
-	HTError	e)
+static void SGML_abort(HTStream *context, HTError e)
 {
     int i;
-    HTElement * cur;
+    HTElement *cur;
 
     /*
-    **	Abort the target. - FM
-    */
-    (*context->actions->_abort)(context->target, e);
+     * Abort the target.  - FM
+     */
+    (*context->actions->_abort) (context->target, e);
 
     /*
-    **	Free the buffers. - FM
-    */
+     * Free the buffers.  - FM
+     */
     FREE(context->recover);
     FREE(context->include);
     FREE(context->active_include);
@@ -1501,8 +1436,8 @@ static void SGML_abort (
     FREE(context->csi);
 
     /*
-    **	Free stack memory if any elements were left open. - KW
-    */
+     * Free stack memory if any elements were left open.  - KW
+     */
     while (context->element_stack) {
 	cur = context->element_stack;
 	context->element_stack = cur->next;	/* Remove from stack */
@@ -1510,8 +1445,8 @@ static void SGML_abort (
     }
 
     /*
-    **	Free the strings and context structure. - FM
-    */
+     * Free the strings and context structure.  - FM
+     */
     HTChunkFree(context->string);
     for (i = 0; i < MAX_ATTRIBUTES; i++)
 	FREE_extra(context->value[i]);
@@ -1522,68 +1457,62 @@ static void SGML_abort (
 #endif
 }
 
-
 /*	Read and write user callback handle
-**	-----------------------------------
-**
-**   The callbacks from the SGML parser have an SGML context parameter.
-**   These calls allow the caller to associate his own context with a
-**   particular SGML context.
-*/
+ *	-----------------------------------
+ *
+ *   The callbacks from the SGML parser have an SGML context parameter.
+ *   These calls allow the caller to associate his own context with a
+ *   particular SGML context.
+ */
 
 #ifdef CALLERDATA
-void* SGML_callerData (
-	HTStream *	context)
+void *SGML_callerData(HTStream *context)
 {
     return context->callerData;
 }
 
-void SGML_setCallerData (
-	HTStream *	context,
-	void*		data)
+void SGML_setCallerData(HTStream *context, void *data)
 {
     context->callerData = data;
 }
 #endif /* CALLERDATA */
 
-static void SGML_character (
-	HTStream *	context,
-	char		c_in)
+static void SGML_character(HTStream *context, char c_in)
 {
-    const SGML_dtd *dtd =	context->dtd;
-    HTChunk	*string =	context->string;
-    const char * EntityName;
-    HTTag * testtag = NULL;
-    BOOLEAN chk;	/* Helps (?) walk through all the else ifs... */
-    UCode_t clong, uck = 0; /* Enough bits for UCS4 ... */
+    const SGML_dtd *dtd = context->dtd;
+    HTChunk *string = context->string;
+    const char *EntityName;
+    HTTag *testtag = NULL;
+    BOOLEAN chk;		/* Helps (?) walk through all the else ifs... */
+    UCode_t clong, uck = 0;	/* Enough bits for UCS4 ... */
     int testlast;
+
 #ifdef CJK_EX
     unsigned char c;
+
 #else
     char c;
 #endif
     char saved_char_in = '\0';
 
     /*
-    **	Now some fun with the preprocessor.
-    **	Use copies for c and unsign_c == clong, so that
-    **	we can revert back to the unchanged c_in. - KW
-    */
+     * Now some fun with the preprocessor.  Use copies for c and unsign_c ==
+     * clong, so that we can revert back to the unchanged c_in.  - KW
+     */
 #define unsign_c clong
 
     c = c_in;
-    clong = UCH(c);	/* a.k.a. unsign_c */
+    clong = UCH(c);		/* a.k.a. unsign_c */
 
     if (context->T.decode_utf8) {
 	/*
-	**  Combine UTF-8 into Unicode.
-	**  Incomplete characters silently ignored.
-	**  From Linux kernel's console.c. - KW
-	*/
-	if (TOASCII(UCH(c)) > 127) { /* S/390 -- gil -- 0710 */
+	 * Combine UTF-8 into Unicode.  Incomplete characters silently ignored. 
+	 * From Linux kernel's console.c.  - KW
+	 */
+	if (TOASCII(UCH(c)) > 127) {	/* S/390 -- gil -- 0710 */
 	    /*
-	    **	We have an octet from a multibyte character. - FM
-	    */
+	     * We have an octet from a multibyte character.  - FM
+	     */
 	    if (context->utf_count > 0 && (TOASCII(c) & 0xc0) == 0x80) {
 		context->utf_char = (context->utf_char << 6) | (TOASCII(c) & 0x3f);
 		context->utf_count--;
@@ -1591,26 +1520,25 @@ static void SGML_character (
 		(context->utf_buf_p)++;
 		if (context->utf_count == 0) {
 		    /*
-		    **	We have all of the bytes, so terminate
-		    **	the buffer and set 'clong' to the UCode_t
-		    **	value. - FM
-		    */
+		     * We have all of the bytes, so terminate the buffer and
+		     * set 'clong' to the UCode_t value.  - FM
+		     */
 		    *(context->utf_buf_p) = '\0';
 		    clong = context->utf_char;
 		    if (clong < 256) {
-			c = ((char)(clong & 0xff));
+			c = ((char) (clong & 0xff));
 		    }
 		    goto top1;
 		} else {
 		    /*
-		    **	Wait for more. - KW
-		    */
+		     * Wait for more.  - KW
+		     */
 		    return;
 		}
 	    } else {
 		/*
-		**  Start handling a new multibyte character. - FM
-		*/
+		 * Start handling a new multibyte character.  - FM
+		 */
 		context->utf_buf_p = context->utf_buf;
 		*(context->utf_buf_p) = c;
 		(context->utf_buf_p)++;
@@ -1631,70 +1559,68 @@ static void SGML_character (
 		    context->utf_char = (c & 0x01);
 		} else {
 		    /*
-		    **	Garbage. - KW
-		    */
+		     * Garbage.  - KW
+		     */
 		    context->utf_count = 0;
 		    context->utf_buf_p = context->utf_buf;
 		    *(context->utf_buf_p) = '\0';
 		}
 		/*
-		**  Wait for more. - KW
-		*/
+		 * Wait for more.  - KW
+		 */
 		return;
 	    }
 	} else {
 	    /*
-	    **	Got an ASCII char. - KW
-	    */
+	     * Got an ASCII char.  - KW
+	     */
 	    context->utf_count = 0;
 	    context->utf_buf_p = context->utf_buf;
 	    *(context->utf_buf_p) = '\0';
-		    /*	goto top;  */
+	    /*  goto top;  */
 	}
-    } /* end of context->T.decode_utf8	S/390 -- gil -- 0726 */
-
+    }
+    /* end of context->T.decode_utf8      S/390 -- gil -- 0726 */
 #ifdef NOTDEFINED
     /*
-    **	If we have a koi8-r input and do not have
-    **	koi8-r as the output, save the raw input
-    **	in saved_char_in before we potentially
-    **	convert it to Unicode. - FM
-    */
+     * If we have a koi8-r input and do not have koi8-r as the output, save the
+     * raw input in saved_char_in before we potentially convert it to Unicode. 
+     * - FM
+     */
     if (context->T.strip_raw_char_in)
 	saved_char_in = c;
 #endif /* NOTDEFINED */
 
     /*
-    **	If we want the raw input converted
-    **	to Unicode, try that now. - FM
-    */
+     * If we want the raw input converted to Unicode, try that now.  - FM
+     */
     if (context->T.trans_to_uni &&
-	((TOASCII(unsign_c) >= LYlowest_eightbit[context->inUCLYhndl]) ||  /* S/390 -- gil -- 0744 */
+	((TOASCII(unsign_c) >= LYlowest_eightbit[context->inUCLYhndl]) ||	/* S/390 -- gil -- 0744 */
 	 (unsign_c < ' ' && unsign_c != 0 &&
 	  context->T.trans_C0_to_uni))) {
 	/*
-	**  Convert the octet to Unicode. - FM
-	*/
+	 * Convert the octet to Unicode.  - FM
+	 */
 	clong = UCTransToUni(c, context->inUCLYhndl);
 	if (clong > 0) {
 	    saved_char_in = c;
 	    if (clong < 256) {
-		c = FROMASCII((char)clong);
+		c = FROMASCII((char) clong);
 	    }
 	}
 	goto top1;
-    } else if (unsign_c < ' ' && unsign_c != 0 &&  /* S/390 -- gil -- 0768 */
+    } else if (unsign_c < ' ' && unsign_c != 0 &&	/* S/390 -- gil -- 0768 */
 	       context->T.trans_C0_to_uni) {
 	/*
-	**  This else if may be too ugly to keep. - KW
-	*/
+	 * This else if may be too ugly to keep.  - KW
+	 */
 	if (context->T.trans_from_uni &&
 	    (((clong = UCTransToUni(c, context->inUCLYhndl)) >= ' ') ||
 	     (context->T.transp &&
 	      (clong = UCTransToUni(c, context->inUCLYhndl)) > 0))) {
 	    saved_char_in = c;
 	    if (clong < 256) {
-		c = FROMASCII((char)clong);
+		c = FROMASCII((char) clong);
 	    }
 	    goto top1;
 	} else {
@@ -1723,80 +1649,78 @@ static void SGML_character (
 		StrAllocCat(context->recover, replace_buf + 1);
 	    }
 	    goto top0a;
-	} /*  Next line end of ugly stuff for C0. - KW */
-    } else {  /* end of context->T.trans_to_uni	 S/390 -- gil -- 0791 */
+	}			/*  Next line end of ugly stuff for C0. - KW */
+    } else {			/* end of context->T.trans_to_uni  S/390 -- gil -- 0791 */
 	goto top0a;
     }
 
     /*
-    **	At this point we have either unsign_c a.k.a. clong in
-    **	Unicode (and c in latin1 if clong is in the latin1 range),
-    **	or unsign_c and c will have to be passed raw. - KW
-    */
+     * At this point we have either unsign_c a.k.a.  clong in Unicode (and c in
+     * latin1 if clong is in the latin1 range), or unsign_c and c will have to
+     * be passed raw.  - KW
+     */
 /*
-**  We jump up to here from below if we have
-**  stuff in the recover, insert, or csi buffers
-**  to process.	 We zero saved_char_in, in effect
-**  as a flag that the octet in not that of the
-**  actual call to this function.  This may be OK
-**  for now, for the stuff this function adds to
-**  its recover buffer, but it might not be for
-**  stuff other functions added to the insert or
-**  csi buffer, so bear that in mind. - FM
-**  Stuff from the recover buffer is now handled
-**  as UTF-8 if we can expect that's what it is,
-**  and in that case we don't come back up here. - kw
-*/
-top:
+ *  We jump up to here from below if we have
+ *  stuff in the recover, insert, or csi buffers
+ *  to process.	 We zero saved_char_in, in effect
+ *  as a flag that the octet in not that of the
+ *  actual call to this function.  This may be OK
+ *  for now, for the stuff this function adds to
+ *  its recover buffer, but it might not be for
+ *  stuff other functions added to the insert or
+ *  csi buffer, so bear that in mind. - FM
+ *  Stuff from the recover buffer is now handled
+ *  as UTF-8 if we can expect that's what it is,
+ *  and in that case we don't come back up here. - kw
+ */
+  top:
     saved_char_in = '\0';
 /*
-**  We jump to here from above when we don't have
-**  UTF-8 input, haven't converted to Unicode, and
-**  want clong set to the input octet (unsigned)
-**  without zeroing its saved_char_in copy (which
-**  is signed). - FM
-*/
-top0a:
+ *  We jump to here from above when we don't have
+ *  UTF-8 input, haven't converted to Unicode, and
+ *  want clong set to the input octet (unsigned)
+ *  without zeroing its saved_char_in copy (which
+ *  is signed). - FM
+ */
+  top0a:
     *(context->utf_buf) = '\0';
     clong = UCH(c);
 /*
-**  We jump to here from above if we have converted
-**  the input, or a multibyte sequence across calls,
-**  to a Unicode value and loaded it into clong (to
-**  which unsign_c has been defined), and from below
-**  when we are recycling a character (e.g., because
-**  it terminated an entity but is not the standard
-**  semi-colon).  The character will already have
-**  been put through the Unicode conversions. - FM
-*/
-top1:
+ *  We jump to here from above if we have converted
+ *  the input, or a multibyte sequence across calls,
+ *  to a Unicode value and loaded it into clong (to
+ *  which unsign_c has been defined), and from below
+ *  when we are recycling a character (e.g., because
+ *  it terminated an entity but is not the standard
+ *  semi-colon).  The character will already have
+ *  been put through the Unicode conversions. - FM
+ */
+  top1:
     /*
-    **	Ignore low ISO 646 7-bit control characters
-    **	if HTCJK is not set. - FM
-    */
+     * Ignore low ISO 646 7-bit control characters if HTCJK is not set.  - FM
+     */
     /*
-    ** Works for both ASCII and EBCDIC. -- gil
-    */	/* S/390 -- gil -- 0811 */
+     * Works for both ASCII and EBCDIC. -- gil
+ *//* S/390 -- gil -- 0811 */
     if (TOASCII(unsign_c) < 32 &&
 	c != '\t' && c != '\n' && c != '\r' &&
 	HTCJK == NOCJK)
 	goto after_switch;
 
     /*
-    **	Ignore 127 if we don't have HTPassHighCtrlRaw
-    **	or HTCJK set. - FM
-    */
+     * Ignore 127 if we don't have HTPassHighCtrlRaw or HTCJK set.  - FM
+     */
 #define PASSHICTRL (context->T.transp || \
 		    unsign_c >= LYlowest_eightbit[context->inUCLYhndl])
-    if (TOASCII(c) == 127 &&  /* S/390 -- gil -- 0830 */
+    if (TOASCII(c) == 127 &&	/* S/390 -- gil -- 0830 */
 	!(PASSHICTRL || HTCJK != NOCJK))
 	goto after_switch;
 
     /*
-    **	Ignore 8-bit control characters 128 - 159 if
-    **	neither HTPassHighCtrlRaw nor HTCJK is set. - FM
-    */
-    if (TOASCII(unsign_c) > 127 && TOASCII(unsign_c) < 160 &&  /* S/390 -- gil -- 0847 */
+     * Ignore 8-bit control characters 128 - 159 if neither HTPassHighCtrlRaw
+     * nor HTCJK is set.  - FM
+     */
+    if (TOASCII(unsign_c) > 127 && TOASCII(unsign_c) < 160 &&	/* S/390 -- gil -- 0847 */
 	!(PASSHICTRL || HTCJK != NOCJK))
 	goto after_switch;
 
@@ -1804,42 +1728,40 @@ top1:
      * JIS X0201 Kana is single byte. To prevent to fail SGML parsing
      * we have to care them here. -- TH
      */
-    if ((HTCJK==JAPANESE) && (context->state==S_in_kanji) &&
+    if ((HTCJK == JAPANESE) && (context->state == S_in_kanji) &&
 	!IS_JAPANESE_2BYTE(context->kanji_buf, UCH(c))) {
 #ifdef CONV_JISX0201KANA_JISX0208KANA
 	if (IS_SJIS_X0201KANA(context->kanji_buf)) {
 	    unsigned char sjis_hi, sjis_lo;
+
 	    JISx0201TO0208_SJIS(context->kanji_buf, &sjis_hi, &sjis_lo);
 	    PUTC(sjis_hi);
 	    PUTC(sjis_lo);
-	}
-	else
+	} else
 #endif
 	    PUTC(context->kanji_buf);
 	context->state = S_text;
     }
 
     /*
-    **	Handle character based on context->state.
-    */
+     * Handle character based on context->state.
+     */
     CTRACE2(TRACE_SGML, (tfp, "SGML before %s|%.*s|%c|\n",
-	    state_name(context->state),
-	    string->size,
-	    NonNull(string->data),
-	    UCH(c)));
-    switch(context->state) {
+			 state_name(context->state),
+			 string->size,
+			 NonNull(string->data),
+			 UCH(c)));
+    switch (context->state) {
 
     case S_in_kanji:
 	/*
-	**  Note that if we don't have a CJK input, then this
-	**  is not the second byte of a CJK di-byte, and we're
-	**  trashing the input.	 That's why 8-bit characters
-	**  followed by, for example, '<' can cause the tag to
-	**  be treated as text, not markup.  We could try to deal
-	**  with it by holding each first byte and then checking
-	**  byte pairs, but that doesn't seem worth the overhead
-	**  (see below). - FM
-	*/
+	 * Note that if we don't have a CJK input, then this is not the second
+	 * byte of a CJK di-byte, and we're trashing the input.  That's why
+	 * 8-bit characters followed by, for example, '<' can cause the tag to
+	 * be treated as text, not markup.  We could try to deal with it by
+	 * holding each first byte and then checking byte pairs, but that
+	 * doesn't seem worth the overhead (see below).  - FM
+	 */
 	context->state = S_text;
 	PUTC(context->kanji_buf);
 	PUTC(c);
@@ -1847,36 +1769,34 @@ top1:
 
     case S_tagname_slash:
 	/*
-	 *  We had something link "<name/" so far, set state to S_text
-	 *  but keep context->slashedtag as as a flag; except if we get
-	 *  '>' directly after the "<name/", and really have a tag for
-	 *  that name in context->slashedtag, in which case keep state as
-	 *  is and let code below deal with it. - kw
+	 * We had something link "<name/" so far, set state to S_text but keep
+	 * context->slashedtag as as a flag; except if we get '>' directly
+	 * after the "<name/", and really have a tag for that name in
+	 * context->slashedtag, in which case keep state as is and let code
+	 * below deal with it.  - kw
 	 */
 	if (!(c == '>' && context->slashedtag && TOASCII(unsign_c) < 127)) {
 	    context->state = S_text;
-	} /* fall through in any case! */
-
+	}
+	/* fall through in any case! */
     case S_text:
-	if (HTCJK != NOCJK && (TOASCII(c) & 0200) != 0) {  /* S/390 -- gil -- 0864 */
+	if (HTCJK != NOCJK && (TOASCII(c) & 0200) != 0) {	/* S/390 -- gil -- 0864 */
 	    /*
-	    **	Setting up for Kanji multibyte handling (based on
-	    **	Takuya ASADA's (asada@three-a.co.jp) CJK Lynx).
-	    **	Note that if the input is not in fact CJK, the
-	    **	next byte also will be mishandled, as explained
-	    **	above.	Toggle raw mode off in such cases, or
-	    **	select the "7 bit approximations" display
-	    **	character set, which is largely equivalent
-	    **	to having raw mode off with CJK. - FM
-	    */
+	     * Setting up for Kanji multibyte handling (based on Takuya ASADA's
+	     * (asada@three-a.co.jp) CJK Lynx).  Note that if the input is not
+	     * in fact CJK, the next byte also will be mishandled, as explained
+	     * above.  Toggle raw mode off in such cases, or select the "7 bit
+	     * approximations" display character set, which is largely
+	     * equivalent to having raw mode off with CJK.  - FM
+	     */
 	    context->state = S_in_kanji;
 	    context->kanji_buf = c;
 	    break;
-	} else if (HTCJK != NOCJK && TOASCII(c) == '\033') {  /* S/390 -- gil -- 0881 */
+	} else if (HTCJK != NOCJK && TOASCII(c) == '\033') {	/* S/390 -- gil -- 0881 */
 	    /*
-	    **	Setting up for CJK escape sequence handling (based on
-	    **	Takuya ASADA's (asada@three-a.co.jp) CJK Lynx). - FM
-	    */
+	     * Setting up for CJK escape sequence handling (based on Takuya
+	     * ASADA's (asada@three-a.co.jp) CJK Lynx).  - FM
+	     */
 	    context->state = S_esc;
 	    PUTC(c);
 	    break;
@@ -1884,17 +1804,17 @@ top1:
 
 	if (c == '&' || c == '<') {
 #ifdef USE_PRETTYSRC
-	    if (psrc_view) { /*there is nothing useful in the element_stack*/
+	    if (psrc_view) {	/*there is nothing useful in the element_stack */
 		testtag = context->current_tag;
 	    } else
 #endif
 	    {
 		testtag = context->element_stack ?
-		     context->element_stack->tag : NULL;
+		    context->element_stack->tag : NULL;
 	    }
 	}
 
-	if (c == '&' && TOASCII(unsign_c) < 127	 &&  /* S/390 -- gil -- 0898 */
+	if (c == '&' && TOASCII(unsign_c) < 127 &&	/* S/390 -- gil -- 0898 */
 	    (!testtag ||
 	     (testtag->contents == SGML_MIXED ||
 	      testtag->contents == SGML_ELEMENT ||
@@ -1904,19 +1824,19 @@ top1:
 #endif
 	      testtag->contents == SGML_RCDATA))) {
 	    /*
-	    **	Setting up for possible entity, without the leading '&'. - FM
-	    */
+	     * Setting up for possible entity, without the leading '&'.  - FM
+	     */
 	    string->size = 0;
 	    context->state = S_ero;
-	} else if (c == '<' && TOASCII(unsign_c) < 127) {  /* S/390 -- gil -- 0915 */
+	} else if (c == '<' && TOASCII(unsign_c) < 127) {	/* S/390 -- gil -- 0915 */
 	    /*
-	    **	Setting up for possible tag. - FM
-	    */
+	     * Setting up for possible tag.  - FM
+	     */
 	    string->size = 0;
 	    if (testtag && testtag->contents == SGML_PCDATA) {
 		context->state = S_pcdata;
 	    } else if (testtag && (testtag->contents == SGML_LITTERAL
-				|| testtag->contents == SGML_CDATA)) {
+				   || testtag->contents == SGML_CDATA)) {
 		context->state = S_litteral;
 	    } else if (testtag && (testtag->contents == SGML_SCRIPT)) {
 		context->state = S_script;
@@ -1929,11 +1849,11 @@ top1:
 		    (c == '>' && context->state == S_tagname_slash)) &&
 		   TOASCII(unsign_c) < 127) {
 	    /*
-	    **	We got either the second slash of a pending "<NAME/blah blah/"
-	    **  shortref construct, or the '>' of a mere "<NAME/>".  In both
-	    **  cases generate a "</NAME>" end tag in the recover buffer for
-	    **  reparsing unless NAME is really an empty element. - kw
-	    */
+	     * We got either the second slash of a pending "<NAME/blah blah/"
+	     * shortref construct, or the '>' of a mere "<NAME/>".  In both
+	     * cases generate a "</NAME>" end tag in the recover buffer for
+	     * reparsing unless NAME is really an empty element.  - kw
+	     */
 #ifdef USE_PRETTYSRC
 	    if (psrc_view) {
 		PSRCSTART(abracket);
@@ -1941,8 +1861,8 @@ top1:
 		PSRCSTOP(abracket);
 	    } else
 #endif
-	    if (context->slashedtag != context->unknown_tag &&
-		!ReallyEmptyTag(context->slashedtag)) {
+		if (context->slashedtag != context->unknown_tag &&
+		    !ReallyEmptyTag(context->slashedtag)) {
 		if (context->recover == NULL) {
 		    StrAllocCopy(context->recover, "</");
 		    context->recover_index = 0;
@@ -1957,12 +1877,12 @@ top1:
 	} else if (context->element_stack &&
 		   (context->element_stack->tag->flags & Tgf_frecyc)) {
 	    /*
-	     *  The element stack says we are within the contents of an
-	     *  element that the next stage (HTML.c) may want to feed
-	     *  us back again (via the *include string).  So try to output
-	     *  text in UTF-8 if possible, using the same logic as for
-	     *  attribute values (which should be in line with what
-	     *  context->current_tag_charset indicates). - kw
+	     * The element stack says we are within the contents of an element
+	     * that the next stage (HTML.c) may want to feed us back again (via
+	     * the *include string).  So try to output text in UTF-8 if
+	     * possible, using the same logic as for attribute values (which
+	     * should be in line with what context->current_tag_charset
+	     * indicates).  - kw
 	     */
 	    if (context->T.decode_utf8 &&
 		*context->utf_buf) {
@@ -1975,9 +1895,9 @@ top1:
 		if (LYIsASCII(clong)) {
 		    PUTC(c);
 		} else if (clong == 0xfffd && saved_char_in &&
-		    HTPassEightBitRaw &&
-		    UCH(saved_char_in) >=
-		    LYlowest_eightbit[context->outUCLYhndl]) {
+			   HTPassEightBitRaw &&
+			   UCH(saved_char_in) >=
+			   LYlowest_eightbit[context->outUCLYhndl]) {
 		    PUTUTF8((0xf000 | UCH(saved_char_in)));
 		} else {
 		    PUTUTF8(clong);
@@ -1989,74 +1909,75 @@ top1:
 	    }
 
 #define PASS8859SPECL context->T.pass_160_173_raw
-	/*
-	**  Convert 160 (nbsp) to Lynx special character if
-	**  neither HTPassHighCtrlRaw nor HTCJK is set. - FM
-	*/
-	} else if (unsign_c == CH_NBSP &&  /* S/390 -- gil -- 0932 */
+	    /*
+	     * Convert 160 (nbsp) to Lynx special character if neither
+	     * HTPassHighCtrlRaw nor HTCJK is set.  - FM
+	     */
+	} else if (unsign_c == CH_NBSP &&	/* S/390 -- gil -- 0932 */
 		   !context->no_lynx_specialcodes &&
 		   !(PASS8859SPECL || HTCJK != NOCJK)) {
 	    PUTC(HT_NON_BREAK_SPACE);
-	/*
-	**  Convert 173 (shy) to Lynx special character if
-	**  neither HTPassHighCtrlRaw nor HTCJK is set. - FM
-	*/
-	} else if (unsign_c == CH_SHY &&  /* S/390 -- gil -- 0949 */
+	    /*
+	     * Convert 173 (shy) to Lynx special character if neither
+	     * HTPassHighCtrlRaw nor HTCJK is set.  - FM
+	     */
+	} else if (unsign_c == CH_SHY &&	/* S/390 -- gil -- 0949 */
 		   !context->no_lynx_specialcodes &&
 		   !(PASS8859SPECL || HTCJK != NOCJK)) {
 	    PUTC(LY_SOFT_HYPHEN);
-	/*
-	**  Handle the case in which we think we have a character
-	**  which doesn't need further processing (e.g., a koi8-r
-	**  input for a koi8-r output). - FM
-	*/
+	    /*
+	     * Handle the case in which we think we have a character which
+	     * doesn't need further processing (e.g., a koi8-r input for a
+	     * koi8-r output).  - FM
+	     */
 	} else if (context->T.use_raw_char_in && saved_char_in) {
 	    /*
-	    **	Only if the original character is still in saved_char_in,
-	    **	otherwise we may be iterating from a goto top. - KW
-	    */
+	     * Only if the original character is still in saved_char_in,
+	     * otherwise we may be iterating from a goto top.  - KW
+	     */
 	    PUTC(saved_char_in);
 	    saved_char_in = '\0';
 /******************************************************************
- *   I. LATIN-1 OR UCS2	 TO  DISPLAY CHARSET
+ * I.  LATIN-1 OR UCS2 TO DISPLAY CHARSET
  ******************************************************************/
-	} else if ((chk = (BOOL) (context->T.trans_from_uni && TOASCII(unsign_c) >= 160)) &&  /* S/390 -- gil -- 0968 */
+	} else if ((chk = (BOOL) (context->T.trans_from_uni &&
+				  TOASCII(unsign_c) >= 160)) &&		/* S/390 -- gil -- 0968 */
 		   (uck = UCTransUniChar(unsign_c,
 					 context->outUCLYhndl)) >= ' ' &&
 		   uck < 256) {
 	    CTRACE((tfp, "UCTransUniChar returned 0x%.2lX:'%c'.\n",
-			uck, FROMASCII((char)uck)));
+		    uck, FROMASCII((char) uck)));
 	    /*
-	    **	We got one octet from the conversions, so use it. - FM
-	    */
-	    PUTC(FROMASCII((char)uck));
+	     * We got one octet from the conversions, so use it.  - FM
+	     */
+	    PUTC(FROMASCII((char) uck));
 	} else if ((chk &&
-		   (uck == -4 ||
-		    (context->T.repl_translated_C0 &&
-		     uck > 0 && uck < 32))) &&
-		   /*
-		   **  Not found; look for replacement string. - KW
-		   */
+		    (uck == -4 ||
+		     (context->T.repl_translated_C0 &&
+		      uck > 0 && uck < 32))) &&
+	    /*
+	     * Not found; look for replacement string.  - KW
+	     */
 		   (uck = UCTransUniCharStr(replace_buf, 60, clong,
 					    context->outUCLYhndl,
 					    0) >= 0)) {
 	    /*
-	    **	Got a replacement string.
-	    **	No further tests for validity - assume that whoever
-	    **	defined replacement strings knew what she was doing. - KW
-	    */
+	     * Got a replacement string.  No further tests for validity -
+	     * assume that whoever defined replacement strings knew what she
+	     * was doing.  - KW
+	     */
 	    PUTS(replace_buf);
-	/*
-	**  If we're displaying UTF-8, try that now. - FM
-	*/
+	    /*
+	     * If we're displaying UTF-8, try that now.  - FM
+	     */
 	} else if (context->T.output_utf8 && PUTUTF8(clong)) {
-	    ; /* do nothing more */
-	/*
-	**  If it's any other (> 160) 8-bit character, and
-	**  we have not set HTPassEightBitRaw nor HTCJK, nor
-	**  have the "ISO Latin 1" character set selected,
-	**  back translate for our character set. - FM
-	*/
+	    ;			/* do nothing more */
+	    /*
+	     * If it's any other (> 160) 8-bit character, and we have not set
+	     * HTPassEightBitRaw nor HTCJK, nor have the "ISO Latin 1"
+	     * character set selected, back translate for our character set.  -
+	     * FM
+	     */
 #define IncludesLatin1Enc \
 		(context->outUCLYhndl == LATIN1 || \
 		 (context->outUCI && \
@@ -2073,18 +1994,19 @@ top1:
 #endif
 
 	    string->size = 0;
-	    EntityName = HTMLGetEntityName((int)(unsign_c - 160));
+	    EntityName = HTMLGetEntityName((int) (unsign_c - 160));
 	    HTChunkPuts(string, EntityName);
 	    HTChunkTerminate(string);
 #ifdef USE_PRETTYSRC
-	    /* we need to disable it temporary*/
+	    /* we need to disable it temporary */
 	    if (psrc_view) {
-		psrc_view_backup =1; psrc_view =0;
+		psrc_view_backup = 1;
+		psrc_view = 0;
 	    }
 #endif
 	    handle_entity(context, '\0');
 #ifdef USE_PRETTYSRC
-	    /* we need to disable it temporary*/
+	    /* we need to disable it temporary */
 	    if (psrc_view_backup)
 		psrc_view = TRUE;
 #endif
@@ -2092,72 +2014,71 @@ top1:
 	    string->size = 0;
 	    if (!FoundEntity)
 		PUTC(';');
-	/*
-	**  If we get to here and have an ASCII char,
-	**  pass the character. - KW
-	*/
-	} else if (TOASCII(unsign_c) < 127 && unsign_c > 0) {  /* S/390 -- gil -- 0987 */
+	    /*
+	     * If we get to here and have an ASCII char, pass the character.  -
+	     * KW
+	     */
+	} else if (TOASCII(unsign_c) < 127 && unsign_c > 0) {	/* S/390 -- gil -- 0987 */
 	    PUTC(c);
-	/*
-	**  If we get to here, and should have translated,
-	**  translation has failed so far. - KW
-	**
-	**  We should have sent UTF-8 output to the parser
-	**  already, but what the heck, try again. - FM
-	*/
+	    /*
+	     * If we get to here, and should have translated, translation has
+	     * failed so far.  - KW
+	     *
+	     * We should have sent UTF-8 output to the parser already, but what
+	     * the heck, try again.  - FM
+	     */
 	} else if (context->T.output_utf8 && *context->utf_buf) {
 	    PUTS(context->utf_buf);
 	    context->utf_buf_p = context->utf_buf;
 	    *(context->utf_buf_p) = '\0';
 #ifdef NOTDEFINED
-	/*
-	**  Check for a strippable koi8-r 8-bit character. - FM
-	*/
+	    /*
+	     * Check for a strippable koi8-r 8-bit character.  - FM
+	     */
 	} else if (context->T.strip_raw_char_in && saved_char_in &&
 		   (UCH(saved_char_in) >= 0xc0) &&
 		   (UCH(saved_char_in) < 255)) {
 	    /*
-	    **	KOI8 special: strip high bit, gives (somewhat) readable
-	    **	ASCII or KOI7 - it was constructed that way! - KW
-	    */
-	    PUTC(((char)(saved_char_in & 0x7f)));
+	     * KOI8 special:  strip high bit, gives (somewhat) readable ASCII
+	     * or KOI7 - it was constructed that way!  - KW
+	     */
+	    PUTC(((char) (saved_char_in & 0x7f)));
 	    saved_char_in = '\0';
 #endif /* NOTDEFINED */
-	/*
-	**  If we don't actually want the character,
-	**  make it safe and output that now. - FM
-	*/
-	} else if (TOASCII(UCH(c)) <	 /* S/390 -- gil -- 0997 */
-			LYlowest_eightbit[context->outUCLYhndl] ||
+	    /*
+	     * If we don't actually want the character, make it safe and output
+	     * that now.  - FM
+	     */
+	} else if (TOASCII(UCH(c)) <	/* S/390 -- gil -- 0997 */
+		   LYlowest_eightbit[context->outUCLYhndl] ||
 		   (context->T.trans_from_uni && !HTPassEightBitRaw)) {
-	/*
-	**  If we get to here, pass the character. - FM
-	*/
+	    /*
+	     * If we get to here, pass the character.  - FM
+	     */
 	} else {
 	    PUTC(c);
 	}
 	break;
 
-    /*
-    **	Found '<' in SGML_PCDATA content; treat this mode nearly like
-    **  S_litteral, but recognize '<!' and '<?' to filter out comments
-    **  and processing instructions. - kw
-    */
+	/*
+	 * Found '<' in SGML_PCDATA content; treat this mode nearly like
+	 * S_litteral, but recognize '<!' and '<?' to filter out comments and
+	 * processing instructions.  - kw
+	 */
     case S_pcdata:
-	if (!string->size && TOASCII(unsign_c) < 127) { /* first after '<' */
-	    if (c == '!') { /* <! */
+	if (!string->size && TOASCII(unsign_c) < 127) {		/* first after '<' */
+	    if (c == '!') {	/* <! */
 		/*
-		**	Terminate and set up for possible comment,
-		**	identifier, declaration, or marked section
-		**  as under S_tag. - kw
-		*/
+		 * Terminate and set up for possible comment, identifier,
+		 * declaration, or marked section as under S_tag.  - kw
+		 */
 		context->state = S_exclamation;
 		context->lead_exclamation = TRUE;
 		context->doctype_bracket = FALSE;
 		context->first_bracket = FALSE;
 		HTChunkPutc(string, c);
 		break;
-	    } else if (c == '?') { /* <? - ignore as a PI until '>' - kw */
+	    } else if (c == '?') {	/* <? - ignore as a PI until '>' - kw */
 		CTRACE((tfp,
 			"SGML: Found PI in PCDATA, junking it until '>'\n"));
 #ifdef USE_PRETTYSRC
@@ -2165,7 +2086,7 @@ top1:
 		    PSRCSTART(abracket);
 		    PUTS("<?");
 		    PSRCSTOP(abracket);
-		    context->seen_nonwhite_in_junk_tag = TRUE; /* show all */
+		    context->seen_nonwhite_in_junk_tag = TRUE;	/* show all */
 		}
 #endif
 		context->state = S_junk_pi;
@@ -2174,19 +2095,18 @@ top1:
 	}
 	goto case_S_litteral;
 
-    /*
-    **  Found '<' in SGML_SCRIPT content; treat this mode nearly like
-    **  S_litteral, but recognize '<!' to allow the content to be treated
-    **  as a comment by lynx.
-    */
+	/*
+	 * Found '<' in SGML_SCRIPT content; treat this mode nearly like
+	 * S_litteral, but recognize '<!' to allow the content to be treated as
+	 * a comment by lynx.
+	 */
     case S_script:
-	if (!string->size && TOASCII(unsign_c) < 127) { /* first after '<' */
-	    if (c == '!') { /* <! */
+	if (!string->size && TOASCII(unsign_c) < 127) {		/* first after '<' */
+	    if (c == '!') {	/* <! */
 		/*
-		**	Terminate and set up for possible comment,
-		**	identifier, declaration, or marked section
-		**  as under S_tag. - kw
-		*/
+		 * Terminate and set up for possible comment, identifier,
+		 * declaration, or marked section as under S_tag.  - kw
+		 */
 		context->state = S_exclamation;
 		context->lead_exclamation = TRUE;
 		context->doctype_bracket = FALSE;
@@ -2197,15 +2117,15 @@ top1:
 	}
 	goto case_S_litteral;
 
-    /*
-    **	In litteral mode, waits only for specific end tag (for
-    **	compatibility with old servers, and for Lynx). - FM
-    */
-    case_S_litteral:
-    case S_litteral: /*PSRC:this case not understood completely by HV, not done*/
+	/*
+	 * In litteral mode, waits only for specific end tag (for compatibility
+	 * with old servers, and for Lynx).  - FM
+	 */
+      case_S_litteral:
+    case S_litteral:		/*PSRC:this case not understood completely by HV, not done */
 	HTChunkPutc(string, c);
 #ifdef USE_PRETTYSRC
-	if (psrc_view) { /*there is nothing useful in the element_stack*/
+	if (psrc_view) {	/*there is nothing useful in the element_stack */
 	    testtag = context->current_tag;
 	} else
 #endif
@@ -2220,20 +2140,20 @@ top1:
 
 	/*
 	 * Normally when we get the closing ">",
-	 *	testtag contains something like "TITLE"
-	 *	string contains something like "/title>"
+	 *      testtag contains something like "TITLE"
+	 *      string contains something like "/title>"
 	 * so we decrement by 2 to compare the final character of each.
 	 */
 	testlast = string->size - 2 - context->trailing_spaces - context->leading_spaces;
 
 	if (TOUPPER(c) != ((testlast < 0)
-			    ? '/'
-			    : testtag->name[testlast])) {
+			   ? '/'
+			   : testtag->name[testlast])) {
 	    int i;
 
 	    /*
-	    **	If complete match, end litteral.
-	    */
+	     * If complete match, end litteral.
+	     */
 	    if ((c == '>') &&
 		testlast >= 0 && !testtag->name[testlast]) {
 #ifdef USE_PRETTYSRC
@@ -2242,7 +2162,7 @@ top1:
 		    PUTS("</");
 		    PSRCSTOP(abracket);
 		    PSRCSTART(tag);
-		    strcpy(string->data,context->current_tag->name);
+		    strcpy(string->data, context->current_tag->name);
 		    if (tagname_transform != 1) {
 			if (tagname_transform == 0)
 			    LYLowerCase(string->data);
@@ -2292,67 +2212,67 @@ top1:
 	    if (((testtag->contents != SGML_LITTERAL &&
 		  (testtag->flags & Tgf_strict)) ||
 		 (context->state == S_pcdata &&
-		  (testtag->flags & (Tgf_strict|Tgf_endO)))) &&
+		  (testtag->flags & (Tgf_strict | Tgf_endO)))) &&
 		(testlast > -1 &&
 		 (c == '>' || testlast > 0 || IsNmStart(c)))) {
 		context->state = S_end;
 		string->size--;
-		for (i = 0; i < string->size; i++)  /* remove '/' */
-		    string->data[i] = string->data[i+1];
+		for (i = 0; i < string->size; i++)	/* remove '/' */
+		    string->data[i] = string->data[i + 1];
 		if ((string->size == 1) ? IsNmStart(c) : IsNmChar(c))
 		    break;
 		string->size--;
 		goto top1;
 	    }
 	    if (context->state == S_pcdata &&
-		(testtag->flags & (Tgf_strict|Tgf_endO)) &&
+		(testtag->flags & (Tgf_strict | Tgf_endO)) &&
 		(testlast < 0 && IsNmStart(c))) {
 		context->state = S_tag;
 		break;
 	    }
 	    /*
-	    **	If Mismatch: recover string literally.
-	    */
+	     * If Mismatch:  recover string literally.
+	     */
 	    PUTC('<');
-	    for (i = 0; i < string->size-1; i++)  /* recover, except last c */
-	       PUTC(string->data[i]);
+	    for (i = 0; i < string->size - 1; i++)	/* recover, except last c */
+		PUTC(string->data[i]);
 	    string->size = 0;
 	    context->state = S_text;
 	    goto top1;		/* to recover last c */
 	}
 	break;
 
-    /*
-    **	Character reference (numeric entity) or named entity.
-    */
+	/*
+	 * Character reference (numeric entity) or named entity.
+	 */
     case S_ero:
 	if (c == '#') {
 	    /*
-	    **	Setting up for possible numeric entity.
-	    */
-	    context->state = S_cro;  /* &# is Char Ref Open */
+	     * Setting up for possible numeric entity.
+	     */
+	    context->state = S_cro;	/* &# is Char Ref Open */
 	    break;
 	}
-	context->state = S_entity;   /* Fall through! */
+	context->state = S_entity;	/* Fall through! */
 
-    /*
-    **	Handle possible named entity.
-    */
+	/*
+	 * Handle possible named entity.
+	 */
     case S_entity:
 	if (TOASCII(unsign_c) < 127 && (string->size ?	/* S/390 -- gil -- 1029 */
-		  isalnum(UCH(c)) : isalpha(UCH(c)))) {
+					isalnum(UCH(c)) : isalpha(UCH(c)))) {
 	    /* Should probably use IsNmStart/IsNmChar above (is that right?),
 	       but the world is not ready for that - there's &nbsp: (note
 	       colon!) and stuff around. */
 	    /*
-	    **	Accept valid ASCII character. - FM
-	    */
+	     * Accept valid ASCII character.  - FM
+	     */
 	    HTChunkPutc(string, c);
 	} else if (string->size == 0) {
 	    /*
-	    **	It was an ampersand that's just text, so output
-	    **	the ampersand and recycle this character. - FM
-	    */
+	     * It was an ampersand that's just text, so output the ampersand
+	     * and recycle this character.  - FM
+	     */
 #ifdef USE_PRETTYSRC
 	    if (psrc_view)
 		PSRCSTART(badseq);
@@ -2366,8 +2286,8 @@ top1:
 	    goto top1;
 	} else {
 	    /*
-	    **	Terminate entity name and try to handle it. - FM
-	    */
+	     * Terminate entity name and try to handle it.  - FM
+	     */
 	    HTChunkTerminate(string);
 #ifdef USE_PRETTYSRC
 	    entity_string = string->data;
@@ -2376,14 +2296,15 @@ top1:
 	    /* CTRACE((tfp, "%s: %d: %s\n", __FILE__, __LINE__, string->data)); */
 	    if (!strcmp(string->data, "zwnj") &&
 		(!context->element_stack ||
-		 (context->element_stack->tag  &&
+		 (context->element_stack->tag &&
 		  context->element_stack->tag->contents == SGML_MIXED))) {
 		/*
-		**  Handle zwnj (8204) as <WBR>. - FM
-		*/
+		 * Handle zwnj (8204) as <WBR>.  - FM
+		 */
 		char temp[8];
 
-		CTRACE((tfp, "SGML_character: Handling 'zwnj' entity as 'WBR' element.\n"));
+		CTRACE((tfp,
+			"SGML_character: Handling 'zwnj' entity as 'WBR' element.\n"));
 
 		if (c != ';') {
 		    sprintf(temp, "<WBR>%c", c);
@@ -2405,11 +2326,10 @@ top1:
 	    string->size = 0;
 	    context->state = S_text;
 	    /*
-	    **	Don't eat the terminator if we didn't find the
-	    **	entity name and therefore sent the raw string
-	    **	via handle_entity(), or if the terminator is
-	    **	not the "standard" semi-colon for HTML. - FM
-	    */
+	     * Don't eat the terminator if we didn't find the entity name and
+	     * therefore sent the raw string via handle_entity(), or if the
+	     * terminator is not the "standard" semi-colon for HTML.  - FM
+	     */
 #ifdef USE_PRETTYSRC
 	    if (psrc_view && FoundEntity && c == ';') {
 		PSRCSTART(entity);
@@ -2422,25 +2342,25 @@ top1:
 	}
 	break;
 
-    /*
-    **	Check for a numeric entity.
-    */
+	/*
+	 * Check for a numeric entity.
+	 */
     case S_cro:
-	if (TOASCII(unsign_c) < 127 && TOLOWER(UCH(c)) == 'x') {  /* S/390 -- gil -- 1060 */
+	if (TOASCII(unsign_c) < 127 && TOLOWER(UCH(c)) == 'x') {	/* S/390 -- gil -- 1060 */
 	    context->isHex = TRUE;
 	    context->state = S_incro;
 	} else if (TOASCII(unsign_c) < 127 && isdigit(UCH(c))) {
 	    /*
-	    **	Accept only valid ASCII digits. - FM
-	    */
+	     * Accept only valid ASCII digits.  - FM
+	     */
 	    HTChunkPutc(string, c);	/* accumulate a character NUMBER */
 	    context->isHex = FALSE;
 	    context->state = S_incro;
 	} else if (string->size == 0) {
 	    /*
-	    **	No 'x' or digit following the "&#" so recover
-	    **	them and recycle the character. - FM
-	    */
+	     * No 'x' or digit following the "&#" so recover them and recycle
+	     * the character.  - FM
+	     */
 #ifdef USE_PRETTYSRC
 	    if (psrc_view)
 		PSRCSTART(badseq);
@@ -2456,24 +2376,24 @@ top1:
 	}
 	break;
 
-    /*
-    **	Handle a numeric entity.
-    */
+	/*
+	 * Handle a numeric entity.
+	 */
     case S_incro:
-	/* S/390 -- gil -- 1075 */ /* CTRACE((tfp, "%s: %d: numeric %d %d\n",
-			    __FILE__, __LINE__, unsign_c, c)); */
+/* S/390 -- gil -- 1075 *//* CTRACE((tfp, "%s: %d: numeric %d %d\n",
+   __FILE__, __LINE__, unsign_c, c)); */
 	if ((TOASCII(unsign_c) < 127) &&
 	    (context->isHex ? isxdigit(UCH(c)) :
-			      isdigit(UCH(c)))) {
+	     isdigit(UCH(c)))) {
 	    /*
-	    **	Accept only valid hex or ASCII digits. - FM
-	    */
+	     * Accept only valid hex or ASCII digits.  - FM
+	     */
 	    HTChunkPutc(string, c);	/* accumulate a character NUMBER */
 	} else if (string->size == 0) {
 	    /*
-	    **	No hex digit following the "&#x" so recover
-	    **	them and recycle the character. - FM
-	    */
+	     * No hex digit following the "&#x" so recover them and recycle the
+	     * character.  - FM
+	     */
 #ifdef USE_PRETTYSRC
 	    if (psrc_view)
 		PSRCSTART(badseq);
@@ -2488,179 +2408,178 @@ top1:
 	    goto top1;
 	} else {
 	    /*
-	    **	Terminate the numeric entity and try to handle it. - FM
-	    */
+	     * Terminate the numeric entity and try to handle it.  - FM
+	     */
 	    UCode_t code;
 	    int i;
+
 	    HTChunkTerminate(string);
 #ifdef USE_PRETTYSRC
 	    entity_string = string->data;
 #endif
 	    if ((context->isHex ? sscanf(string->data, "%lx", &code) :
-				  sscanf(string->data, "%ld", &code)) == 1) {
+		 sscanf(string->data, "%ld", &code)) == 1) {
 /* =============== work in ASCII below here ===============  S/390 -- gil -- 1092 */
 		if ((code == 1) ||
 		    (code > 127 && code < 156)) {
 		    /*
-		    **	Assume these are Microsoft code points,
-		    **	inflicted on us by FrontPage. - FM
-		    **
-		    **	MS FrontPage uses syntax like &#153; in 128-159 range
-		    **	and doesn't follow Unicode standards for this area.
-		    **	Windows-1252 codepoints are assumed here.
-		    */
+		     * Assume these are Microsoft code points, inflicted on us
+		     * by FrontPage.  - FM
+		     *
+		     * MS FrontPage uses syntax like &#153; in 128-159 range
+		     * and doesn't follow Unicode standards for this area. 
+		     * Windows-1252 codepoints are assumed here.
+		     */
 		    switch (code) {
-			case 1:
-			    /*
-			    **	WHITE SMILING FACE
-			    */
-			    code = 0x263a;
-			    break;
-			case 128:
-			    /*
-			    **	EURO currency sign
-			    */
-			    code = 0x20ac;
-			    break;
-			case 130:
-			    /*
-			    **	SINGLE LOW-9 QUOTATION MARK (sbquo)
-			    */
-			    code = 0x201a;
-			    break;
-			case 132:
-			    /*
-			    **	DOUBLE LOW-9 QUOTATION MARK (bdquo)
-			    */
-			    code = 0x201e;
-			    break;
-			case 133:
-			    /*
-			    **	HORIZONTAL ELLIPSIS (hellip)
-			    */
-			    code = 0x2026;
-			    break;
-			case 134:
-			    /*
-			    **	DAGGER (dagger)
-			    */
-			    code = 0x2020;
-			    break;
-			case 135:
-			    /*
-			    **	DOUBLE DAGGER (Dagger)
-			    */
-			    code = 0x2021;
-			    break;
-			case 137:
-			    /*
-			    **	PER MILLE SIGN (permil)
-			    */
-			    code = 0x2030;
-			    break;
-			case 139:
-			    /*
-			    **	SINGLE LEFT-POINTING ANGLE QUOTATION MARK
-			    **	(lsaquo)
-			    */
-			    code = 0x2039;
-			    break;
-			case 145:
-			    /*
-			    **	LEFT SINGLE QUOTATION MARK (lsquo)
-			    */
-			    code = 0x2018;
-			    break;
-			case 146:
-			    /*
-			    **	RIGHT SINGLE QUOTATION MARK (rsquo)
-			    */
-			    code = 0x2019;
-			    break;
-			case 147:
-			    /*
-			    **	LEFT DOUBLE QUOTATION MARK (ldquo)
-			    */
-			    code = 0x201c;
-			    break;
-			case 148:
-			    /*
-			    **	RIGHT DOUBLE QUOTATION MARK (rdquo)
-			    */
-			    code = 0x201d;
-			    break;
-			case 149:
-			    /*
-			    **	BULLET (bull)
-			    */
-			    code = 0x2022;
-			    break;
-			case 150:
-			    /*
-			    **	EN DASH (ndash)
-			    */
-			    code = 0x2013;
-			    break;
-			case 151:
-			    /*
-			    **	EM DASH (mdash)
-			    */
-			    code = 0x2014;
-			    break;
-			case 152:
-			    /*
-			    **	SMALL TILDE (tilde)
-			    */
-			    code = 0x02dc;
-			    break;
-			case 153:
-			    /*
-			    **	TRADE MARK SIGN (trade)
-			    */
-			    code = 0x2122;
-			    break;
-			case 155:
-			    /*
-			    **	SINGLE RIGHT-POINTING ANGLE QUOTATION MARK
-			    **	(rsaquo)
-			    */
-			    code = 0x203a;
-			    break;
-			default:
-			    /*
-			    **	Do not attempt a conversion
-			    **	to valid Unicode values.
-			    */
-			    break;
+		    case 1:
+			/*
+			 * WHITE SMILING FACE
+			 */
+			code = 0x263a;
+			break;
+		    case 128:
+			/*
+			 * EURO currency sign
+			 */
+			code = 0x20ac;
+			break;
+		    case 130:
+			/*
+			 * SINGLE LOW-9 QUOTATION MARK (sbquo)
+			 */
+			code = 0x201a;
+			break;
+		    case 132:
+			/*
+			 * DOUBLE LOW-9 QUOTATION MARK (bdquo)
+			 */
+			code = 0x201e;
+			break;
+		    case 133:
+			/*
+			 * HORIZONTAL ELLIPSIS (hellip)
+			 */
+			code = 0x2026;
+			break;
+		    case 134:
+			/*
+			 * DAGGER (dagger)
+			 */
+			code = 0x2020;
+			break;
+		    case 135:
+			/*
+			 * DOUBLE DAGGER (Dagger)
+			 */
+			code = 0x2021;
+			break;
+		    case 137:
+			/*
+			 * PER MILLE SIGN (permil)
+			 */
+			code = 0x2030;
+			break;
+		    case 139:
+			/*
+			 * SINGLE LEFT-POINTING ANGLE QUOTATION MARK (lsaquo)
+			 */
+			code = 0x2039;
+			break;
+		    case 145:
+			/*
+			 * LEFT SINGLE QUOTATION MARK (lsquo)
+			 */
+			code = 0x2018;
+			break;
+		    case 146:
+			/*
+			 * RIGHT SINGLE QUOTATION MARK (rsquo)
+			 */
+			code = 0x2019;
+			break;
+		    case 147:
+			/*
+			 * LEFT DOUBLE QUOTATION MARK (ldquo)
+			 */
+			code = 0x201c;
+			break;
+		    case 148:
+			/*
+			 * RIGHT DOUBLE QUOTATION MARK (rdquo)
+			 */
+			code = 0x201d;
+			break;
+		    case 149:
+			/*
+			 * BULLET (bull)
+			 */
+			code = 0x2022;
+			break;
+		    case 150:
+			/*
+			 * EN DASH (ndash)
+			 */
+			code = 0x2013;
+			break;
+		    case 151:
+			/*
+			 * EM DASH (mdash)
+			 */
+			code = 0x2014;
+			break;
+		    case 152:
+			/*
+			 * SMALL TILDE (tilde)
+			 */
+			code = 0x02dc;
+			break;
+		    case 153:
+			/*
+			 * TRADE MARK SIGN (trade)
+			 */
+			code = 0x2122;
+			break;
+		    case 155:
+			/*
+			 * SINGLE RIGHT-POINTING ANGLE QUOTATION MARK (rsaquo)
+			 */
+			code = 0x203a;
+			break;
+		    default:
+			/*
+			 * Do not attempt a conversion to valid Unicode values.
+			 */
+			break;
 		    }
 		}
 		/*
-		**  Check for special values. - FM
-		*/
+		 * Check for special values.  - FM
+		 */
 		if ((code == 8204) &&
 		    (!context->element_stack ||
-		     (context->element_stack->tag  &&
+		     (context->element_stack->tag &&
 		      context->element_stack->tag->contents == SGML_MIXED))) {
 		    /*
-		    **	Handle zwnj (8204) as <WBR>. - FM
-		    */
+		     * Handle zwnj (8204) as <WBR>.  - FM
+		     */
 		    char temp[8];
 
-		    CTRACE((tfp, "SGML_character: Handling '8204' (zwnj) reference as 'WBR' element.\n"));
+		    CTRACE((tfp,
+			    "SGML_character: Handling '8204' (zwnj) reference as 'WBR' element.\n"));
 
 		    /*
-		    **	Include the terminator if it is not
-		    **	the standard semi-colon. - FM
-		    */
+		     * Include the terminator if it is not the standard
+		     * semi-colon.  - FM
+		     */
 		    if (c != ';') {
 			sprintf(temp, "<WBR>%c", c);
 		    } else {
 			sprintf(temp, "<WBR>");
 		    }
 		    /*
-		    **	Add the replacement string to the
-		    **	recover buffer for processing. - FM
-		    */
+		     * Add the replacement string to the recover buffer for
+		     * processing.  - FM
+		     */
 		    if (context->recover == NULL) {
 			StrAllocCopy(context->recover, temp);
 			context->recover_index = 0;
@@ -2673,13 +2592,13 @@ top1:
 		    break;
 		} else if (put_special_unicodes(context, code)) {
 		    /*
-		    **	We handled the value as a special character,
-		    **	so recycle the terminator or break. - FM
-		    */
+		     * We handled the value as a special character, so recycle
+		     * the terminator or break.  - FM
+		     */
 #ifdef USE_PRETTYSRC
 		    if (psrc_view) {
 			PSRCSTART(entity);
-			PUTS( (context->isHex ? "&#x" : "&#") );
+			PUTS((context->isHex ? "&#x" : "&#"));
 			PUTS(entity_string);
 			if (c == ';')
 			    PUTC(';');
@@ -2694,8 +2613,8 @@ top1:
 		    break;
 		}
 		/*
-		**  Seek a translation from the chartrans tables.
-		*/
+		 * Seek a translation from the chartrans tables.
+		 */
 		if ((uck = UCTransUniChar(code,
 					  context->outUCLYhndl)) >= 32 &&
 		    uck < 256 &&
@@ -2704,7 +2623,7 @@ top1:
 #ifdef USE_PRETTYSRC
 		    if (!psrc_view) {
 #endif
-		    PUTC(FROMASCII((char)uck));
+			PUTC(FROMASCII((char) uck));
 #ifdef USE_PRETTYSRC
 		    } else {
 			put_pretty_number(context);
@@ -2713,9 +2632,9 @@ top1:
 		} else if ((uck == -4 ||
 			    (context->T.repl_translated_C0 &&
 			     uck > 0 && uck < 32)) &&
-			   /*
-			   **  Not found; look for replacement string.
-			   */
+		    /*
+		     * Not found; look for replacement string.
+		     */
 			   (uck = UCTransUniCharStr(replace_buf, 60, code,
 						    context->outUCLYhndl,
 						    0) >= 0)) {
@@ -2724,16 +2643,16 @@ top1:
 			put_pretty_number(context);
 		    } else
 #endif
-		    PUTS(replace_buf);
-		/*
-		**  If we're displaying UTF-8, try that now. - FM
-		*/
+			PUTS(replace_buf);
+		    /*
+		     * If we're displaying UTF-8, try that now.  - FM
+		     */
 		} else if (context->T.output_utf8 && PUTUTF8(code)) {
-		    ;  /* do nothing more */
-		/*
-		**  Ignore 8205 (zwj),
-		**  8206 (lrm), and 8207 (rln), if we get to here. - FM
-		*/
+		    ;		/* do nothing more */
+		    /*
+		     * Ignore 8205 (zwj), 8206 (lrm), and 8207 (rln), if we get
+		     * to here.  - FM
+		     */
 		} else if (code == 8205 ||
 			   code == 8206 ||
 			   code == 8207) {
@@ -2750,7 +2669,7 @@ top1:
 #ifdef USE_PRETTYSRC
 		    if (psrc_view) {
 			PSRCSTART(badseq);
-			PUTS( (context->isHex ? "&#x" : "&#") );
+			PUTS((context->isHex ? "&#x" : "&#"));
 			PUTS(entity_string);
 			if (c == ';')
 			    PUTC(';');
@@ -2763,71 +2682,69 @@ top1:
 		    if (c != ';')
 			goto top1;
 		    break;
-		/*
-		**  Show the numeric entity if we get to here
-		**  and the value:
-		**   (1) Is greater than 255 (but use ASCII characters
-		**	 for spaces or dashes).
-		**   (2) Is less than 32, and not valid or we don't
-		**	 have HTCJK set.
-		**   (3) Is 127 and we don't have HTPassHighCtrlRaw or
-		**	 HTCJK set.
-		**   (4) Is 128 - 159 and we don't have HTPassHighCtrlNum
-		**	 set.
-		**  - FM
-		*/
+		    /*
+		     * Show the numeric entity if we get to here and the value:
+		     * (1) Is greater than 255 (but use ASCII characters for
+		     * spaces or dashes).
+		     * (2) Is less than 32, and not valid or we don't have
+		     * HTCJK set.
+		     * (3) Is 127 and we don't have HTPassHighCtrlRaw or HTCJK
+		     * set.
+		     * (4) Is 128 - 159 and we don't have HTPassHighCtrlNum
+		     * set.
+		     * - FM
+		     */
 		} else if ((code > 255) ||
-			   (code < ' ' &&  /* S/390 -- gil -- 1140 */
+			   (code < ' ' &&	/* S/390 -- gil -- 1140 */
 			    code != '\t' && code != '\n' && code != '\r' &&
 			    HTCJK == NOCJK) ||
 			   (TOASCII(code) == 127 &&
 			    !(HTPassHighCtrlRaw || HTCJK != NOCJK)) ||
 			   (TOASCII(code) > 127 && code < 160 &&
 			    !HTPassHighCtrlNum)) {
-			/*
-			**  Unhandled or illegal value.	 Recover the
-			**  "&#" or "&#x" and digit(s), and recycle
-			**  the terminator. - FM
-			*/
+		    /*
+		     * Unhandled or illegal value.  Recover the "&#" or "&#x"
+		     * and digit(s), and recycle the terminator.  - FM
+		     */
 #ifdef USE_PRETTYSRC
-			if (psrc_view) {
-			    PSRCSTART(badseq);
-			}
+		    if (psrc_view) {
+			PSRCSTART(badseq);
+		    }
 #endif
-			if (context->isHex) {
-			    PUTS("&#x");
-			    context->isHex = FALSE;
-			} else {
-			    PUTS("&#");
-			}
-			string->size--;
-			for (i = 0; i < string->size; i++)	/* recover */
-			    PUTC(string->data[i]);
+		    if (context->isHex) {
+			PUTS("&#x");
+			context->isHex = FALSE;
+		    } else {
+			PUTS("&#");
+		    }
+		    string->size--;
+		    for (i = 0; i < string->size; i++)	/* recover */
+			PUTC(string->data[i]);
 #ifdef USE_PRETTYSRC
-			if (psrc_view) {
-			    PSRCSTOP(badseq);
-			}
+		    if (psrc_view) {
+			PSRCSTOP(badseq);
+		    }
 #endif
-			string->size = 0;
-			context->isHex = FALSE;
-			context->state = S_text;
-			goto top1;
-		} else if (TOASCII(code) < 161 ||  /* S/390 -- gil -- 1162 */
+		    string->size = 0;
+		    context->isHex = FALSE;
+		    context->state = S_text;
+		    goto top1;
+		} else if (TOASCII(code) < 161 ||	/* S/390 -- gil -- 1162 */
 			   HTPassEightBitNum ||
 			   IncludesLatin1Enc) {
 		    /*
-		    **	No conversion needed. - FM
-		    */
+		     * No conversion needed.  - FM
+		     */
 #ifdef USE_PRETTYSRC
 		    if (psrc_view) {
 			put_pretty_number(context);
 		    } else
 #endif
-		    PUTC(FROMASCII((char)code));
+			PUTC(FROMASCII((char) code));
 		} else {
 		    /*
-		    **	Handle as named entity. - FM
-		    */
+		     * Handle as named entity.  - FM
+		     */
 		    code -= 160;
 		    EntityName = HTMLGetEntityName(code);
 		    if (EntityName && EntityName[0] != '\0') {
@@ -2836,17 +2753,17 @@ top1:
 			HTChunkTerminate(string);
 			handle_entity(context, '\0');
 			/*
-			**  Add a semi-colon if something went wrong
-			**  and handle_entity() sent the string. - FM
-			*/
+			 * Add a semi-colon if something went wrong and
+			 * handle_entity() sent the string.  - FM
+			 */
 			if (!FoundEntity) {
 			    PUTC(';');
 			}
 		    } else {
 			/*
-			**  Our conversion failed, so recover the "&#"
-			**  and digit(s), and recycle the terminator. - FM
-			*/
+			 * Our conversion failed, so recover the "&#" and
+			 * digit(s), and recycle the terminator.  - FM
+			 */
 #ifdef USE_PRETTYSRC
 			if (psrc_view)
 			    PSRCSTART(badseq);
@@ -2871,25 +2788,24 @@ top1:
 		    }
 		}
 		/*
-		**  If we get to here, we succeeded.  Hoorah!!! - FM
-		*/
+		 * If we get to here, we succeeded.  Hoorah!!!  - FM
+		 */
 		string->size = 0;
 		context->isHex = FALSE;
 		context->state = S_text;
 		/*
-		**  Don't eat the terminator if it's not
-		**  the "standard" semi-colon for HTML. - FM
-		*/
+		 * Don't eat the terminator if it's not the "standard"
+		 * semi-colon for HTML.  - FM
+		 */
 		if (c != ';') {
 		    goto top1;
 		}
 	    } else {
 		/*
-		**  Not an entity, and don't know why not, so add
-		**  the terminator to the string, output the "&#"
-		**  or "&#x", and process the string via the recover
-		**  element. - FM
-		*/
+		 * Not an entity, and don't know why not, so add the terminator
+		 * to the string, output the "&#" or "&#x", and process the
+		 * string via the recover element.  - FM
+		 */
 		string->size--;
 		HTChunkPutc(string, c);
 		HTChunkTerminate(string);
@@ -2921,21 +2837,21 @@ top1:
 	}
 	break;
 
-    /*
-    **	Tag
-    */
-    case S_tag:					/* new tag */
+	/*
+	 * Tag
+	 */
+    case S_tag:		/* new tag */
 	if (TOASCII(unsign_c) < 127 && (string->size ?	/* S/390 -- gil -- 1179 */
-		  IsNmChar(c) : IsNmStart(c))) {
+					IsNmChar(c) : IsNmStart(c))) {
 	    /*
-	    **	Add valid ASCII character. - FM
-	    */
+	     * Add valid ASCII character.  - FM
+	     */
 	    HTChunkPutc(string, c);
-	} else if (c == '!' && !string->size) { /* <! */
+	} else if (c == '!' && !string->size) {		/* <! */
 	    /*
-	    **	Terminate and set up for possible comment,
-	    **	identifier, declaration, or marked section. - FM
-	    */
+	     * Terminate and set up for possible comment, identifier,
+	     * declaration, or marked section.  - FM
+	     */
 	    context->state = S_exclamation;
 	    context->lead_exclamation = TRUE;
 	    context->doctype_bracket = FALSE;
@@ -2943,16 +2859,16 @@ top1:
 	    HTChunkPutc(string, c);
 	    break;
 	} else if (!string->size &&
-		   (TOASCII(unsign_c) <= 160 &&	 /* S/390 -- gil -- 1196 */
+		   (TOASCII(unsign_c) <= 160 &&		/* S/390 -- gil -- 1196 */
 		    (c != '/' && c != '?' && c != '_' && c != ':'))) {
 	    /*
-	    **	'<' must be followed by an ASCII letter to be a valid
-	    **	start tag.  Here it isn't, nor do we have a '/' for an
-	    **	end tag, nor one of some other characters with a
-	    **	special meaning for SGML or which are likely to be legal
-	    **	Name Start characters in XML or some other extension.
-	    **	So recover the '<' and following character as data. - FM & KW
-	    */
+	     * '<' must be followed by an ASCII letter to be a valid start tag. 
+	     * Here it isn't, nor do we have a '/' for an end tag, nor one of
+	     * some other characters with a special meaning for SGML or which
+	     * are likely to be legal Name Start characters in XML or some
+	     * other extension.  So recover the '<' and following character as
+	     * data.  - FM & KW
+	     */
 	    context->state = S_text;
 #ifdef USE_PRETTYSRC
 	    if (psrc_view)
@@ -2964,19 +2880,20 @@ top1:
 		PSRCSTOP(badseq);
 #endif
 	    goto top1;
-	} else {				/* End of tag name */
+	} else {		/* End of tag name */
 	    /*
-	    **	Try to handle tag. - FM
-	    */
-	    HTTag * t;
+	     * Try to handle tag.  - FM
+	     */
+	    HTTag *t;
+
 	    if (c == '/') {
 		if (string->size == 0) {
 		    context->state = S_end;
 		    break;
 		}
-		CTRACE((tfp,"SGML: `<%.*s/' found!\n", string->size, string->data));
+		CTRACE((tfp, "SGML: `<%.*s/' found!\n", string->size, string->data));
 	    }
-	    HTChunkTerminate(string) ;
+	    HTChunkTerminate(string);
 
 	    t = SGMLFindTag(dtd, string->data);
 	    if (t == context->unknown_tag &&
@@ -2984,32 +2901,32 @@ top1:
 		  string->size == 4 && 0 == strcasecomp(string->data, "URL")) ||
 		 (string->size > 4 && 0 == strncasecomp(string->data, "URL:", 4)))) {
 		/*
-		**  Treat <URL: as text rather than a junk tag,
-		**  so we display it and the URL (Lynxism 8-). - FM
-		*/
+		 * Treat <URL:  as text rather than a junk tag, so we display
+		 * it and the URL (Lynxism 8-).  - FM
+		 */
 #ifdef USE_PRETTYSRC
 		if (psrc_view)
 		    PSRCSTART(badseq);
 #endif
 		PUTC('<');
-		PUTS(string->data); /* recover */
+		PUTS(string->data);	/* recover */
 		PUTC(c);
 #ifdef USE_PRETTYSRC
 		if (psrc_view)
 		    PSRCSTOP(badseq);
 #endif
 		CTRACE((tfp, "SGML: Treating <%s%c as text\n",
-			    string->data, c));
+			string->data, c));
 		string->size = 0;
 		context->state = S_text;
 		break;
 	    }
 	    if (c == '/' && t) {
 		/*
-		 *  Element name was ended by '/'.  Remember the tag that
-		 *  ended thusly, we'll interpret this as either an indication
-		 *  of an empty element (if '>' follows directly) or do
-		 *  some SGMLshortref-ish treatment. - kw
+		 * Element name was ended by '/'.  Remember the tag that ended
+		 * thusly, we'll interpret this as either an indication of an
+		 * empty element (if '>' follows directly) or do some
+		 * SGMLshortref-ish treatment.  - kw
 		 */
 		context->slashedtag = t;
 	    }
@@ -3021,14 +2938,14 @@ top1:
 			PSRCSTART(abracket);
 			PUTS("<?");
 			PSRCSTOP(abracket);
-			context->seen_nonwhite_in_junk_tag = TRUE; /*show all*/
+			context->seen_nonwhite_in_junk_tag = TRUE;	/*show all */
 		    }
 #endif
 		    context->state = S_junk_pi;
 		    break;
 		}
 		CTRACE((tfp, "SGML: *** Invalid element %s\n",
-			    string->data));
+			string->data));
 
 #ifdef USE_PRETTYSRC
 		if (psrc_view) {
@@ -3043,7 +2960,7 @@ top1:
 			    LYUpperCase(string->data);
 		    }
 		    PUTS(string->data);
-		    if (c == '>' ) {
+		    if (c == '>') {
 			PSRCSTOP(badtag);
 			PSRCSTART(abracket);
 			PUTC('>');
@@ -3057,11 +2974,11 @@ top1:
 		break;
 	    } else if (t == context->unknown_tag) {
 		CTRACE((tfp, "SGML: *** Unknown element %s\n",
-			    string->data));
+			string->data));
 		/*
-		**  Fall through and treat like valid
-		**  tag for attribute parsing. - KW
-		*/
+		 * Fall through and treat like valid tag for attribute parsing. 
+		 * - KW
+		 */
 
 	    }
 	    context->current_tag = t;
@@ -3087,14 +3004,14 @@ top1:
 		else
 		    PSRCSTOP(badtag);
 	    }
-	    if (!psrc_view) /*don't waste time */
+	    if (!psrc_view)	/*don't waste time */
 #endif
 	    {
-	    /*
-	    **	Clear out attributes.
-	    */
-		memset( (void*)context->present, 0 , sizeof(BOOL)*
-				context->current_tag->number_of_attributes);
+		/*
+		 * Clear out attributes.
+		 */
+		memset((void *) context->present, 0, sizeof(BOOL) *
+		       context->current_tag->number_of_attributes);
 	    }
 
 	    string->size = 0;
@@ -3131,8 +3048,8 @@ top1:
     case S_exclamation:
 	if (context->lead_exclamation && c == '-') {
 	    /*
-	    **	Set up for possible comment. - FM
-	    */
+	     * Set up for possible comment.  - FM
+	     */
 	    context->lead_exclamation = FALSE;
 	    context->first_dash = TRUE;
 	    HTChunkPutc(string, c);
@@ -3140,8 +3057,8 @@ top1:
 	}
 	if (context->lead_exclamation && c == '[') {
 	    /*
-	    **	Set up for possible marked section. - FM
-	    */
+	     * Set up for possible marked section.  - FM
+	     */
 	    context->lead_exclamation = FALSE;
 	    context->first_bracket = TRUE;
 	    context->second_bracket = FALSE;
@@ -3151,8 +3068,8 @@ top1:
 	}
 	if (context->first_dash && c == '-') {
 	    /*
-	    **	Set up to handle comment. - FM
-	    */
+	     * Set up to handle comment.  - FM
+	     */
 	    context->lead_exclamation = FALSE;
 	    context->first_dash = FALSE;
 	    context->end_comment = FALSE;
@@ -3164,8 +3081,8 @@ top1:
 	context->first_dash = FALSE;
 	if (c == '>') {
 	    /*
-	    **	Try to handle identifier. - FM
-	    */
+	     * Try to handle identifier.  - FM
+	     */
 	    HTChunkTerminate(string);
 #ifdef USE_PRETTYSRC
 	    if (psrc_view) {
@@ -3176,7 +3093,7 @@ top1:
 		PSRCSTOP(sgmlspecial);
 	    } else
 #endif
-	    handle_identifier(context);
+		handle_identifier(context);
 	    string->size = 0;
 	    context->state = S_text;
 	    break;
@@ -3185,8 +3102,8 @@ top1:
 	    if (string->size == 8 &&
 		!strncasecomp(string->data, "!DOCTYPE", 8)) {
 		/*
-		**  Set up for DOCTYPE declaration. - FM
-		*/
+		 * Set up for DOCTYPE declaration.  - FM
+		 */
 		HTChunkPutc(string, c);
 		context->doctype_bracket = FALSE;
 		context->state = S_doctype;
@@ -3195,8 +3112,8 @@ top1:
 	    if (string->size == 7 &&
 		!strncasecomp(string->data, "!ENTITY", 7)) {
 		/*
-		**  Set up for ENTITY declaration. - FM
-		*/
+		 * Set up for ENTITY declaration.  - FM
+		 */
 		HTChunkPutc(string, c);
 		context->first_dash = FALSE;
 		context->end_comment = TRUE;
@@ -3206,8 +3123,8 @@ top1:
 	    if (string->size == 8 &&
 		!strncasecomp(string->data, "!ELEMENT", 8)) {
 		/*
-		**  Set up for ELEMENT declaration. - FM
-		*/
+		 * Set up for ELEMENT declaration.  - FM
+		 */
 		HTChunkPutc(string, c);
 		context->first_dash = FALSE;
 		context->end_comment = TRUE;
@@ -3217,8 +3134,8 @@ top1:
 	    if (string->size == 8 &&
 		!strncasecomp(string->data, "!ATTLIST", 8)) {
 		/*
-		**  Set up for ATTLIST declaration. - FM
-		*/
+		 * Set up for ATTLIST declaration.  - FM
+		 */
 		HTChunkPutc(string, c);
 		context->first_dash = FALSE;
 		context->end_comment = TRUE;
@@ -3232,8 +3149,8 @@ top1:
     case S_comment:		/* Expecting comment. - FM */
 	if (historical_comments) {
 	    /*
-	    **	Any '>' terminates. - FM
-	    */
+	     * Any '>' terminates.  - FM
+	     */
 	    if (c == '>') {
 		HTChunkTerminate(string);
 #ifdef USE_PRETTYSRC
@@ -3245,7 +3162,7 @@ top1:
 		    PSRCSTOP(comm);
 		} else
 #endif
-		handle_comment(context);
+		    handle_comment(context);
 		string->size = 0;
 		context->end_comment = FALSE;
 		context->first_dash = FALSE;
@@ -3266,16 +3183,16 @@ top1:
 		context->end_comment = TRUE;
 	    else if (!minimal_comments)
 		/*
-		**  Validly treat '--' pairs as successive comments
-		**  (for minimal, any "--WHITE>" terminates). - FM
-		*/
+		 * Validly treat '--' pairs as successive comments (for
+		 * minimal, any "--WHITE>" terminates).  - FM
+		 */
 		context->end_comment = FALSE;
 	    break;
 	}
 	if (context->end_comment && c == '>') {
 	    /*
-	    **	Terminate and handle the comment. - FM
-	    */
+	     * Terminate and handle the comment.  - FM
+	     */
 	    HTChunkTerminate(string);
 #ifdef USE_PRETTYSRC
 	    if (psrc_view) {
@@ -3297,9 +3214,9 @@ top1:
 	if (context->end_comment && !isspace(UCH(c)))
 	    context->end_comment = FALSE;
 
-    S_comment_put_c:
+      S_comment_put_c:
 	if (context->T.decode_utf8 &&
-		   *context->utf_buf) {
+	    *context->utf_buf) {
 	    HTChunkPuts(string, context->utf_buf);
 	    context->utf_buf_p = context->utf_buf;
 	    *(context->utf_buf_p) = '\0';
@@ -3345,7 +3262,7 @@ top1:
 		PSRCSTOP(sgmlspecial);
 	    } else
 #endif
-	    handle_doctype(context);
+		handle_doctype(context);
 	    string->size = 0;
 	    context->state = S_text;
 	    break;
@@ -3377,7 +3294,7 @@ top1:
 		PSRCSTOP(sgmlspecial);
 	    } else
 #endif
-	    handle_marked(context);
+		handle_marked(context);
 	    string->size = 0;
 	    context->state = S_text;
 	    break;
@@ -3411,7 +3328,7 @@ top1:
 		PSRCSTOP(sgmlspecial);
 	    } else
 #endif
-	    handle_sgmlent(context);
+		handle_sgmlent(context);
 	    string->size = 0;
 	    context->end_comment = FALSE;
 	    context->first_dash = FALSE;
@@ -3448,7 +3365,7 @@ top1:
 		PSRCSTOP(sgmlspecial);
 	    } else
 #endif
-	    handle_sgmlele(context);
+		handle_sgmlele(context);
 	    string->size = 0;
 	    context->end_comment = FALSE;
 	    context->first_dash = FALSE;
@@ -3485,7 +3402,7 @@ top1:
 		PSRCSTOP(sgmlspecial);
 	    } else
 #endif
-	    handle_sgmlatt(context);
+		handle_sgmlatt(context);
 	    string->size = 0;
 	    context->end_comment = FALSE;
 	    context->first_dash = FALSE;
@@ -3503,8 +3420,8 @@ top1:
 #ifdef USE_PRETTYSRC
 	    if (!psrc_view)
 #endif
-	    if (context->current_tag->name)
-		start_element(context);
+		if (context->current_tag->name)
+		    start_element(context);
 #ifdef USE_PRETTYSRC
 	    if (psrc_view) {
 		PSRCSTART(abracket);
@@ -3516,10 +3433,10 @@ top1:
 	    break;
 	}
 	HTChunkPutc(string, c);
-	context->state = S_attr; /* Get attribute */
+	context->state = S_attr;	/* Get attribute */
 	break;
 
-				/* accumulating value */
+	/* accumulating value */
     case S_attr:
 	if (WHITE(c) || (c == '>') || (c == '=')) {	/* End of word */
 	    HTChunkTerminate(string);
@@ -3527,13 +3444,13 @@ top1:
 #ifdef USE_PRETTYSRC
 	    if (!psrc_view) {
 #endif
-	    string->size = 0;
-	    if (c == '>') {				/* End of tag */
-		if (context->current_tag->name)
-		    start_element(context);
-		context->state = S_text;
-		break;
-	    }
+		string->size = 0;
+		if (c == '>') {	/* End of tag */
+		    if (context->current_tag->name)
+			start_element(context);
+		    context->state = S_text;
+		    break;
+		}
 #ifdef USE_PRETTYSRC
 	    } else {
 		PUTC(' ');
@@ -3548,7 +3465,8 @@ top1:
 			LYUpperCase(string->data);
 		}
 		PUTS(string->data);
-		if (c == '=' ) PUTC('=');
+		if (c == '=')
+		    PUTC('=');
 		if (c == '=' || c == '>') {
 		    if (context->current_attribute_number == INVALID)
 			PSRCSTOP(badattr);
@@ -3565,7 +3483,7 @@ top1:
 		string->size = 0;
 	    }
 #endif
-	    context->state = (c == '=' ?  S_equals: S_attr_gap);
+	    context->state = (c == '=' ? S_equals : S_attr_gap);
 	} else {
 	    HTChunkPutc(string, c);
 	}
@@ -3606,7 +3524,7 @@ top1:
 	    break;
 	}
 	HTChunkPutc(string, c);
-	context->state = S_attr; /* Get next attribute */
+	context->state = S_attr;	/* Get next attribute */
 	break;
 
     case S_equals:		/* After attr = */
@@ -3651,49 +3569,50 @@ top1:
 	    PSRCSTART(attrval);
 #endif
 	context->state = S_value;
-	/*  no break!  fall through to S_value and process current `c`	 */
+	/*  no break!  fall through to S_value and process current `c`   */
 
     case S_value:
-	if (WHITE(c) || (c == '>')) {		/* End of word */
-	    HTChunkTerminate(string) ;
+	if (WHITE(c) || (c == '>')) {	/* End of word */
+	    HTChunkTerminate(string);
 #ifdef USE_PRETTYSRC
 	    if (psrc_view) {
-		/*PSRCSTART(attrval);*/
+		/*PSRCSTART(attrval); */
 		if (attr_is_name) {
 		    HTStartAnchor(context->target, string->data, NULL);
-		    (*context->actions->end_element)(
-			context->target,
-			HTML_A,
-			(char **)&context->include);
+		    (*context->actions->end_element) (context->target,
+						      HTML_A,
+						      (char **) &context->include);
 		} else if (attr_is_href) {
 		    PSRCSTART(href);
-		    HTStartAnchor(context->target,NULL,string->data);
+		    HTStartAnchor(context->target, NULL, string->data);
 		}
 		PUTS_TR(string->data);
 		if (attr_is_href) {
-		    (*context->actions->end_element)(
-			context->target,
-			HTML_A,
-			(char **)&context->include);
+		    (*context->actions->end_element) (context->target,
+						      HTML_A,
+						      (char **) &context->include);
 		    PSRCSTOP(href);
 		}
 		PSRCSTOP(attrval);
 	    } else
 #endif
-#ifdef CJK_EX	/* Quick hack. - JH7AYN */
-	    {   char jis_buf[512];
+#ifdef CJK_EX			/* Quick hack. - JH7AYN */
+	    {
+		char jis_buf[512];
+
 		if (string->data[0] == '$') {
-		  if (string->data[1] == 'B' || string->data[1] == '@') {
-		    jis_buf[0] = '\033';
-		    strcpy(jis_buf + 1, string->data);
-		    TO_EUC((const unsigned char *)jis_buf, (unsigned char *)string->data);
-		  }
+		    if (string->data[1] == 'B' || string->data[1] == '@') {
+			jis_buf[0] = '\033';
+			strcpy(jis_buf + 1, string->data);
+			TO_EUC((const unsigned char *) jis_buf,
+			       (unsigned char *) string->data);
+		    }
 		}
 	    }
 #endif
 	    handle_attribute_value(context, string->data);
 	    string->size = 0;
-	    if (c == '>') {		/* End of tag */
+	    if (c == '>') {	/* End of tag */
 #ifdef USE_PRETTYSRC
 		if (psrc_view) {
 		    PSRCSTART(abracket);
@@ -3705,8 +3624,8 @@ top1:
 		    start_element(context);
 		context->state = S_text;
 		break;
-	    }
-	    else context->state = S_tag_gap;
+	    } else
+		context->state = S_tag_gap;
 	} else if (context->T.decode_utf8 &&
 		   *context->utf_buf) {
 	    HTChunkPuts(string, context->utf_buf);
@@ -3733,40 +3652,38 @@ top1:
 
     case S_squoted:		/* Quoted attribute value */
 	if (c == '\'') {	/* End of attribute value */
-	    HTChunkTerminate(string) ;
+	    HTChunkTerminate(string);
 #ifdef USE_PRETTYSRC
 	    if (psrc_view) {
-		/*PSRCSTART(attrval);*/
+		/*PSRCSTART(attrval); */
 		if (attr_is_name) {
-		    HTStartAnchor(context->target,string->data, NULL);
-		    (*context->actions->end_element)(
-			context->target,
-			HTML_A,
-			(char **)&context->include);
+		    HTStartAnchor(context->target, string->data, NULL);
+		    (*context->actions->end_element) (context->target,
+						      HTML_A,
+						      (char **) &context->include);
 		} else if (attr_is_href) {
 		    PSRCSTART(href);
-		    HTStartAnchor(context->target,NULL,string->data);
+		    HTStartAnchor(context->target, NULL, string->data);
 		}
 		PUTS_TR(string->data);
 		if (attr_is_href) {
-		    (*context->actions->end_element)(
-			context->target,
-			HTML_A,
-			(char **)&context->include);
+		    (*context->actions->end_element) (context->target,
+						      HTML_A,
+						      (char **) &context->include);
 		    PSRCSTOP(href);
 		}
 		PUTC('\'');
 		PSRCSTOP(attrval);
 	    } else
 #endif
-	    handle_attribute_value(context, string->data);
+		handle_attribute_value(context, string->data);
 	    string->size = 0;
 	    context->state = S_tag_gap;
-	} else if (TOASCII(c) == '\033') {  /* S/390 -- gil -- 1213 */
+	} else if (TOASCII(c) == '\033') {	/* S/390 -- gil -- 1213 */
 	    /*
-	    **	Setting up for possible single quotes in CJK escape
-	    **	sequences. - Takuya ASADA (asada@three-a.co.jp)
-	    */
+	     * Setting up for possible single quotes in CJK escape sequences. 
+	     * - Takuya ASADA (asada@three-a.co.jp)
+	     */
 	    context->state = S_esc_sq;
 	    HTChunkPutc(string, c);
 	} else if (context->T.decode_utf8 &&
@@ -3797,26 +3714,24 @@ top1:
 	if (c == '"' ||		/* Valid end of attribute value */
 	    (soft_dquotes &&	/*  If emulating old Netscape bug, treat '>' */
 	     c == '>')) {	/*  as a co-terminator of dquoted and tag    */
-	    HTChunkTerminate(string) ;
+	    HTChunkTerminate(string);
 #ifdef USE_PRETTYSRC
 	    if (psrc_view) {
-		/*PSRCSTART(attrval);*/
+		/*PSRCSTART(attrval); */
 		if (attr_is_name) {
-		    HTStartAnchor(context->target,string->data, NULL);
-		    (*context->actions->end_element)(
-			context->target,
-			HTML_A,
-			(char **)&context->include);
+		    HTStartAnchor(context->target, string->data, NULL);
+		    (*context->actions->end_element) (context->target,
+						      HTML_A,
+						      (char **) &context->include);
 		} else if (attr_is_href) {
 		    PSRCSTART(href);
-		    HTStartAnchor(context->target,NULL,string->data);
+		    HTStartAnchor(context->target, NULL, string->data);
 		}
 		PUTS_TR(string->data);
 		if (attr_is_href) {
-		    (*context->actions->end_element)(
-			context->target,
-			HTML_A,
-			(char **)&context->include);
+		    (*context->actions->end_element) (context->target,
+						      HTML_A,
+						      (char **) &context->include);
 		    PSRCSTOP(href);
 		}
 		PUTC(c);
@@ -3824,16 +3739,16 @@ top1:
 	    } else
 #endif
 
-	    handle_attribute_value(context, string->data);
+		handle_attribute_value(context, string->data);
 	    string->size = 0;
 	    context->state = S_tag_gap;
 	    if (c == '>')	/* We emulated the Netscape bug, so we go  */
 		goto top1;	/* back and treat it as the tag terminator */
-	} else if (TOASCII(c) == '\033') {  /* S/390 -- gil -- 1230 */
+	} else if (TOASCII(c) == '\033') {	/* S/390 -- gil -- 1230 */
 	    /*
-	    **	Setting up for possible double quotes in CJK escape
-	    **	sequences. - Takuya ASADA (asada@three-a.co.jp)
-	    */
+	     * Setting up for possible double quotes in CJK escape sequences. 
+	     * - Takuya ASADA (asada@three-a.co.jp)
+	     */
 	    context->state = S_esc_dq;
 	    HTChunkPutc(string, c);
 	} else if (context->T.decode_utf8 &&
@@ -3860,12 +3775,13 @@ top1:
 	}
 	break;
 
-    case S_end:					/* </ */
+    case S_end:		/* </ */
 	if (TOASCII(unsign_c) < 127 && (string->size ?	/* S/390 -- gil -- 1247 */
-		  IsNmChar(c) : IsNmStart(c))) {
+					IsNmChar(c) : IsNmStart(c))) {
 	    HTChunkPutc(string, c);
-	} else {				/* End of end tag name */
-	    HTTag * t = 0;
+	} else {		/* End of end tag name */
+	    HTTag *t = 0;
+
 #ifdef USE_PRETTYSRC
 	    BOOL psrc_tagname_processed = FALSE;
 #endif
@@ -3900,15 +3816,16 @@ top1:
 			PUTC('>');
 			PSRCSTOP(abracket);
 		    }
-		    psrc_tagname_processed=TRUE;
+		    psrc_tagname_processed = TRUE;
 		}
 	    } else if (psrc_view) {
 #endif
 	    } else {
 		BOOL tag_OK = (BOOL) (c == '>' || WHITE(c));
+
 #if OPT
 		HTMLElement e = TAGNUM_OF_TAGP(t);
-		int branch = 2; /* it can be 0,1,2*/
+		int branch = 2;	/* it can be 0,1,2 */
 #endif
 		context->current_tag = t;
 		if (HAS_ALT_TAGNUM(TAGNUM_OF_TAGP(t)) &&
@@ -3918,19 +3835,36 @@ top1:
 #if OPT
 		if (tag_OK
 #ifdef EXTENDED_HTMLDTD
-		 && Old_DTD
+		    && Old_DTD
 #endif
-		 ) {
-		   switch (e) {
-		     case HTML_DD: case HTML_DT: case HTML_LI: case HTML_LH :
-		     case HTML_TD: case HTML_TH: case HTML_TR: case HTML_THEAD:
-		     case HTML_TFOOT : case HTML_TBODY : case HTML_COLGROUP:
+		    ) {
+		    switch (e) {
+		    case HTML_DD:
+		    case HTML_DT:
+		    case HTML_LI:
+		    case HTML_LH:
+		    case HTML_TD:
+		    case HTML_TH:
+		    case HTML_TR:
+		    case HTML_THEAD:
+		    case HTML_TFOOT:
+		    case HTML_TBODY:
+		    case HTML_COLGROUP:
 			branch = 0;
 			break;
 
-		     case HTML_A:  case HTML_B: case HTML_BLINK: case HTML_CITE:
-		     case HTML_EM: case HTML_FONT: case HTML_FORM: case HTML_I:
-		     case HTML_P:  case HTML_STRONG: case HTML_TT: case HTML_U:
+		    case HTML_A:
+		    case HTML_B:
+		    case HTML_BLINK:
+		    case HTML_CITE:
+		    case HTML_EM:
+		    case HTML_FONT:
+		    case HTML_FORM:
+		    case HTML_I:
+		    case HTML_P:
+		    case HTML_STRONG:
+		    case HTML_TT:
+		    case HTML_U:
 			branch = 1;
 			break;
 		    default:
@@ -3941,36 +3875,36 @@ top1:
 
 #ifdef EXTENDED_HTMLDTD
 		/*
-		**  Just handle ALL end tags normally :-) - kw
-		*/
+		 * Just handle ALL end tags normally :-) - kw
+		 */
 		if (!Old_DTD) {
-		    end_element( context, context->current_tag);
+		    end_element(context, context->current_tag);
 		} else
 #endif /* EXTENDED_HTMLDTD */
 
-		if (tag_OK &&
+		    if (tag_OK &&
 #if OPT
-		    (branch == 0)
+			(branch == 0)
 #else
-		    (!strcasecomp(string->data, "DD") ||
-		     !strcasecomp(string->data, "DT") ||
-		     !strcasecomp(string->data, "LI") ||
-		     !strcasecomp(string->data, "LH") ||
-		     !strcasecomp(string->data, "TD") ||
-		     !strcasecomp(string->data, "TH") ||
-		     !strcasecomp(string->data, "TR") ||
-		     !strcasecomp(string->data, "THEAD") ||
-		     !strcasecomp(string->data, "TFOOT") ||
-		     !strcasecomp(string->data, "TBODY") ||
-		     !strcasecomp(string->data, "COLGROUP"))
+			(!strcasecomp(string->data, "DD") ||
+			 !strcasecomp(string->data, "DT") ||
+			 !strcasecomp(string->data, "LI") ||
+			 !strcasecomp(string->data, "LH") ||
+			 !strcasecomp(string->data, "TD") ||
+			 !strcasecomp(string->data, "TH") ||
+			 !strcasecomp(string->data, "TR") ||
+			 !strcasecomp(string->data, "THEAD") ||
+			 !strcasecomp(string->data, "TFOOT") ||
+			 !strcasecomp(string->data, "TBODY") ||
+			 !strcasecomp(string->data, "COLGROUP"))
 #endif
-		 ) {
+		    ) {
 		    /*
-		    **	Don't treat these end tags as invalid,
-		    **	nor act on them. - FM
-		    */
+		     * Don't treat these end tags as invalid, nor act on them. 
+		     * - FM
+		     */
 		    CTRACE((tfp, "SGML: `</%s%c' found!  Ignoring it.\n",
-				string->data, c));
+			    string->data, c));
 		    string->size = 0;
 		    context->current_attribute_number = INVALID;
 		    if (c != '>') {
@@ -3997,52 +3931,56 @@ top1:
 			    !strcasecomp(string->data, "TT") ||
 			    !strcasecomp(string->data, "U"))
 #endif
-		) {
+		    ) {
 		    /*
-		    **	Handle end tags for container elements declared
-		    **	as SGML_EMPTY to prevent "expected tag substitution"
-		    **	but still processed via HTML_end_element() in HTML.c
-		    **	with checks there to avoid throwing the HTML.c stack
-		    **	out of whack (Ugh, what a hack! 8-). - FM
-		    */
+		     * Handle end tags for container elements declared as
+		     * SGML_EMPTY to prevent "expected tag substitution" but
+		     * still processed via HTML_end_element() in HTML.c with
+		     * checks there to avoid throwing the HTML.c stack out of
+		     * whack (Ugh, what a hack!  8-).  - FM
+		     */
 		    if (context->inSELECT) {
 			/*
-			**  We are in a SELECT block. - FM
-			*/
+			 * We are in a SELECT block.  - FM
+			 */
 			if (strcasecomp(string->data, "FORM")) {
 			    /*
-			    **	It is not at FORM end tag, so ignore it. - FM
-			    */
-			    CTRACE((tfp, "SGML: ***Ignoring end tag </%s> in SELECT block.\n",
-					string->data));
+			     * It is not at FORM end tag, so ignore it.  - FM
+			     */
+			    CTRACE((tfp,
+				    "SGML: ***Ignoring end tag </%s> in SELECT block.\n",
+				    string->data));
 			} else {
 			    /*
-			    **	End the SELECT block and then
-			    **	handle the FORM end tag. - FM
-			    */
-			    CTRACE((tfp, "SGML: ***Faking SELECT end tag before </%s> end tag.\n",
-					string->data));
+			     * End the SELECT block and then handle the FORM
+			     * end tag.  - FM
+			     */
+			    CTRACE((tfp,
+				    "SGML: ***Faking SELECT end tag before </%s> end tag.\n",
+				    string->data));
 			    end_element(context,
 					SGMLFindTag(context->dtd, "SELECT"));
 			    CTRACE((tfp, "SGML: End </%s>\n", string->data));
 
 #ifdef USE_PRETTYSRC
-			    if (!psrc_view) /* Don't actually call if viewing psrc - kw */
+			    if (!psrc_view)	/* Don't actually call if viewing psrc - kw */
 #endif
-			    (*context->actions->end_element)
-				(context->target,
-				 TAGNUM_OF_TAGP(context->current_tag),
-				 (char **)&context->include);
+				(*context->actions->end_element)
+				    (context->target,
+				     TAGNUM_OF_TAGP(context->current_tag),
+				     (char **) &context->include);
 			}
 		    } else if (!strcasecomp(string->data, "P")) {
 			/*
-			**  Treat a P end tag like a P start tag (Ugh,
-			**  what a hack! 8-). - FM
-			*/
-			CTRACE((tfp, "SGML: `</%s%c' found!  Treating as '<%s%c'.\n",
-				    string->data, c, string->data, c));
+			 * Treat a P end tag like a P start tag (Ugh, what a
+			 * hack!  8-).  - FM
+			 */
+			CTRACE((tfp,
+				"SGML: `</%s%c' found!  Treating as '<%s%c'.\n",
+				string->data, c, string->data, c));
 			{
 			    int i;
+
 			    for (i = 0;
 				 i < context->current_tag->number_of_attributes;
 				 i++) {
@@ -4055,12 +3993,12 @@ top1:
 			CTRACE((tfp, "SGML: End </%s>\n", string->data));
 
 #ifdef USE_PRETTYSRC
-			if (!psrc_view) /* Don't actually call if viewing psrc - kw */
+			if (!psrc_view)		/* Don't actually call if viewing psrc - kw */
 #endif
-			(*context->actions->end_element)
-			    (context->target,
-			     TAGNUM_OF_TAGP(context->current_tag),
-			     (char **)&context->include);
+			    (*context->actions->end_element)
+				(context->target,
+				 TAGNUM_OF_TAGP(context->current_tag),
+				 (char **) &context->include);
 		    }
 		    string->size = 0;
 		    context->current_attribute_number = INVALID;
@@ -4073,9 +4011,9 @@ top1:
 		    break;
 		} else {
 		    /*
-		    **	Handle all other end tags normally. - FM
-		    */
-		    end_element( context, context->current_tag);
+		     * Handle all other end tags normally.  - FM
+		     */
+		    end_element(context, context->current_tag);
 		}
 	    }
 
@@ -4093,7 +4031,7 @@ top1:
 		}
 		PUTS(string->data);
 		PSRCSTOP(tag);
-		if ( c != '>' ) {
+		if (c != '>') {
 		    PSRCSTART(badtag);
 		    PUTC(c);
 		} else {
@@ -4108,7 +4046,7 @@ top1:
 	    context->current_attribute_number = INVALID;
 	    if (c != '>') {
 		if (!WHITE(c))
-		    CTRACE((tfp,"SGML: `</%s%c' found!\n", string->data, c));
+		    CTRACE((tfp, "SGML: `</%s%c' found!\n", string->data, c));
 		context->state = S_junk_tag;
 	    } else {
 		context->current_tag = NULL;
@@ -4117,7 +4055,6 @@ top1:
 	}
 	break;
 
-
     case S_esc:		/* Expecting '$'or '(' following CJK ESC. */
 	if (c == '$') {
 	    context->state = S_dollar;
@@ -4129,7 +4066,7 @@ top1:
 	PUTC(c);
 	break;
 
-    case S_dollar:	/* Expecting '@', 'B', 'A' or '(' after CJK "ESC$". */
+    case S_dollar:		/* Expecting '@', 'B', 'A' or '(' after CJK "ESC$". */
 	if (c == '@' || c == 'B' || c == 'A') {
 	    context->state = S_nonascii_text;
 	} else if (c == '(') {
@@ -4138,7 +4075,7 @@ top1:
 	PUTC(c);
 	break;
 
-    case S_dollar_paren: /* Expecting 'C' after CJK "ESC$(". */
+    case S_dollar_paren:	/* Expecting 'C' after CJK "ESC$(". */
 	if (c == 'C') {
 	    context->state = S_nonascii_text;
 	} else {
@@ -4147,7 +4084,7 @@ top1:
 	PUTC(c);
 	break;
 
-    case S_paren:	/* Expecting 'B', 'J', 'T' or 'I' after CJK "ESC(". */
+    case S_paren:		/* Expecting 'B', 'J', 'T' or 'I' after CJK "ESC(". */
 	if (c == 'B' || c == 'J' || c == 'T') {
 	    context->state = S_text;
 	} else if (c == 'I') {
@@ -4158,8 +4095,8 @@ top1:
 	PUTC(c);
 	break;
 
-    case S_nonascii_text: /* Expecting CJK ESC after non-ASCII text. */
-	if (TOASCII(c) == '\033') {  /* S/390 -- gil -- 1264 */
+    case S_nonascii_text:	/* Expecting CJK ESC after non-ASCII text. */
+	if (TOASCII(c) == '\033') {	/* S/390 -- gil -- 1264 */
 	    context->state = S_esc;
 	}
 	PUTC(c);
@@ -4167,7 +4104,7 @@ top1:
 	    context->state = S_text;
 	break;
 
-    case S_esc_sq:	/* Expecting '$'or '(' following CJK ESC. */
+    case S_esc_sq:		/* Expecting '$'or '(' following CJK ESC. */
 	if (c == '$') {
 	    context->state = S_dollar_sq;
 	} else if (c == '(') {
@@ -4178,7 +4115,7 @@ top1:
 	HTChunkPutc(string, c);
 	break;
 
-    case S_dollar_sq:	/* Expecting '@', 'B', 'A' or '(' after CJK "ESC$". */
+    case S_dollar_sq:		/* Expecting '@', 'B', 'A' or '(' after CJK "ESC$". */
 	if (c == '@' || c == 'B' || c == 'A') {
 	    context->state = S_nonascii_text_sq;
 	} else if (c == '(') {
@@ -4187,7 +4124,7 @@ top1:
 	HTChunkPutc(string, c);
 	break;
 
-    case S_dollar_paren_sq: /* Expecting 'C' after CJK "ESC$(". */
+    case S_dollar_paren_sq:	/* Expecting 'C' after CJK "ESC$(". */
 	if (c == 'C') {
 	    context->state = S_nonascii_text_sq;
 	} else {
@@ -4196,7 +4133,7 @@ top1:
 	HTChunkPutc(string, c);
 	break;
 
-    case S_paren_sq:	/* Expecting 'B', 'J', 'T' or 'I' after CJK "ESC(". */
+    case S_paren_sq:		/* Expecting 'B', 'J', 'T' or 'I' after CJK "ESC(". */
 	if (c == 'B' || c == 'J' || c == 'T') {
 	    context->state = S_squoted;
 	} else if (c == 'I') {
@@ -4207,8 +4144,8 @@ top1:
 	HTChunkPutc(string, c);
 	break;
 
-    case S_nonascii_text_sq: /* Expecting CJK ESC after non-ASCII text. */
-	if (TOASCII(c) == '\033') {  /* S/390 -- gil -- 1281 */
+    case S_nonascii_text_sq:	/* Expecting CJK ESC after non-ASCII text. */
+	if (TOASCII(c) == '\033') {	/* S/390 -- gil -- 1281 */
 	    context->state = S_esc_sq;
 	}
 	HTChunkPutc(string, c);
@@ -4225,7 +4162,7 @@ top1:
 	HTChunkPutc(string, c);
 	break;
 
-    case S_dollar_dq:	/* Expecting '@', 'B', 'A' or '(' after CJK "ESC$". */
+    case S_dollar_dq:		/* Expecting '@', 'B', 'A' or '(' after CJK "ESC$". */
 	if (c == '@' || c == 'B' || c == 'A') {
 	    context->state = S_nonascii_text_dq;
 	} else if (c == '(') {
@@ -4234,7 +4171,7 @@ top1:
 	HTChunkPutc(string, c);
 	break;
 
-    case S_dollar_paren_dq: /* Expecting 'C' after CJK "ESC$(". */
+    case S_dollar_paren_dq:	/* Expecting 'C' after CJK "ESC$(". */
 	if (c == 'C') {
 	    context->state = S_nonascii_text_dq;
 	} else {
@@ -4243,7 +4180,7 @@ top1:
 	HTChunkPutc(string, c);
 	break;
 
-    case S_paren_dq:	/* Expecting 'B', 'J', 'T' or 'I' after CJK "ESC(". */
+    case S_paren_dq:		/* Expecting 'B', 'J', 'T' or 'I' after CJK "ESC(". */
 	if (c == 'B' || c == 'J' || c == 'T') {
 	    context->state = S_dquoted;
 	} else if (c == 'I') {
@@ -4254,8 +4191,8 @@ top1:
 	HTChunkPutc(string, c);
 	break;
 
-    case S_nonascii_text_dq: /* Expecting CJK ESC after non-ASCII text. */
-	if (TOASCII(c) == '\033') {  /* S/390 -- gil -- 1298 */
+    case S_nonascii_text_dq:	/* Expecting CJK ESC after non-ASCII text. */
+	if (TOASCII(c) == '\033') {	/* S/390 -- gil -- 1298 */
 	    context->state = S_esc_dq;
 	}
 	HTChunkPutc(string, c);
@@ -4280,7 +4217,7 @@ top1:
 	}
 #ifdef USE_PRETTYSRC
 	else if (psrc_view) {
-	    /*pack spaces until first non-space is seen*/
+	    /*pack spaces until first non-space is seen */
 	    if (!context->seen_nonwhite_in_junk_tag) {
 		if (!WHITE(c)) {
 		    context->seen_nonwhite_in_junk_tag = TRUE;
@@ -4291,19 +4228,19 @@ top1:
 	}
 #endif
 
-    } /* switch on context->state */
+    }				/* switch on context->state */
     CTRACE2(TRACE_SGML, (tfp, "SGML after  %s|%.*s|%c|\n",
-	    state_name(context->state),
-	    string->size,
-	    NonNull(string->data),
-	    UCH(c)));
+			 state_name(context->state),
+			 string->size,
+			 NonNull(string->data),
+			 UCH(c)));
 
-after_switch:
+  after_switch:
     /*
-    **	Check whether an external function has added
-    **	anything to the include buffer.  If so, move the
-    **	new stuff to the beginning of active_include. - kw
-    */
+     * Check whether an external function has added anything to the include
+     * buffer.  If so, move the new stuff to the beginning of active_include. 
+     * - kw
+     */
     if (context->include != NULL) {
 	if (context->include[0] == '\0') {
 	    FREE(context->include);
@@ -4320,8 +4257,8 @@ after_switch:
     }
 
     /*
-    **	Check whether we've added anything to the recover buffer. - FM
-    */
+     * Check whether we've added anything to the recover buffer.  - FM
+     */
     if (context->recover != NULL) {
 	if (context->recover[context->recover_index] == '\0') {
 	    FREE(context->recover);
@@ -4334,10 +4271,9 @@ after_switch:
     }
 
     /*
-    **	Check whether an external function had added
-    **	anything to the include buffer; it should now be
-    **  in active_include. - FM / kw
-    */
+     * Check whether an external function had added anything to the include
+     * buffer; it should now be in active_include.  - FM / kw
+     */
     if (context->active_include != NULL) {
 	if (context->active_include[context->include_index] == '\0') {
 	    FREE(context->active_include);
@@ -4346,25 +4282,25 @@ after_switch:
 	    if (context->current_tag_charset == UTF8_handle ||
 		context->T.trans_from_uni) {
 		/*
-		 *  If it looks like we would have fed UTF-8 to the
-		 *  next processing stage, assume that whatever we were
-		 *  fed back is in UTF-8 form, too.  This won't be always
-		 *  true for all uses of the include buffer, but it's a
-		 *  start. - kw
+		 * If it looks like we would have fed UTF-8 to the next
+		 * processing stage, assume that whatever we were fed back is
+		 * in UTF-8 form, too.  This won't be always true for all uses
+		 * of the include buffer, but it's a start.  - kw
 		 */
 		char *puni = context->active_include + context->include_index;
+
 		c = *puni;
 		clong = UCGetUniFromUtf8String(&puni);
 		if (clong < 256 && clong >= 0) {
-			c = ((char)(clong & 0xff));
+		    c = ((char) (clong & 0xff));
 		}
 		saved_char_in = '\0';
 		context->include_index = puni - context->active_include + 1;
 		goto top1;
 	    } else {
 		/*
-		 *  Otherwise assume no UTF-8 - do charset-naive processing
-		 *  and hope for the best. - kw
+		 * Otherwise assume no UTF-8 - do charset-naive processing and
+		 * hope for the best.  - kw
 		 */
 		c = context->active_include[context->include_index];
 		context->include_index++;
@@ -4374,9 +4310,9 @@ after_switch:
     }
 
     /*
-    **	Check whether an external function has added
-    **	anything to the csi buffer. - FM
-    */
+     * Check whether an external function has added anything to the csi buffer. 
+     * - FM
+     */
     if (context->csi != NULL) {
 	if (context->csi[context->csi_index] == '\0') {
 	    FREE(context->csi);
@@ -4387,26 +4323,22 @@ after_switch:
 	    goto top;
 	}
     }
-}  /* SGML_character */
-
+}				/* SGML_character */
 
-static void SGML_string (
-	HTStream *	context,
-	const char*	str)
+static void SGML_string(HTStream *context, const char *str)
 {
     const char *p;
+
     for (p = str; *p; p++)
 	SGML_character(context, *p);
 }
 
-
-static void SGML_write (
-	HTStream *	context,
-	const char*	str,
-	int		l)
+static void SGML_write(HTStream *context, const char *str,
+		       int l)
 {
     const char *p;
-    const char *e = str+l;
+    const char *e = str + l;
+
     for (p = str; p < e; p++)
 	SGML_character(context, *p);
 }
@@ -4415,34 +4347,34 @@ static void SGML_write (
 */
 
 /*	Structured Object Class
-**	-----------------------
-*/
+ *	-----------------------
+ */
 const HTStreamClass SGMLParser =
 {
-	"SGMLParser",
-	SGML_free,
-	SGML_abort,
-	SGML_character,
-	SGML_string,
-	SGML_write,
+    "SGMLParser",
+    SGML_free,
+    SGML_abort,
+    SGML_character,
+    SGML_string,
+    SGML_write,
 };
 
 /*	Create SGML Engine
-**	------------------
-**
-** On entry,
-**	dtd		represents the DTD, along with
-**	actions		is the sink for the data as a set of routines.
-**
-*/
+ *	------------------
+ *
+ * On entry,
+ *	dtd		represents the DTD, along with
+ *	actions		is the sink for the data as a set of routines.
+ *
+ */
 
-HTStream* SGML_new  (
-	const SGML_dtd *	dtd,
-	HTParentAnchor *	anchor,
-	HTStructured *		target)
+HTStream *SGML_new(const SGML_dtd * dtd,
+		   HTParentAnchor *anchor,
+		   HTStructured * target)
 {
     int i;
-    HTStream* context = (HTStream *) malloc(sizeof(*context));
+    HTStream *context = (HTStream *) malloc(sizeof(*context));
+
     if (!context)
 	outofmem(__FILE__, "SGML_begin");
 
@@ -4452,17 +4384,17 @@ HTStream* SGML_new  (
     context->trailing_spaces = 0;
     context->dtd = dtd;
     context->target = target;
-    context->actions = (const HTStructuredClass*)(((HTStream*)target)->isa);
-					/* Ugh: no OO */
+    context->actions = (const HTStructuredClass *) (((HTStream *) target)->isa);
+    /* Ugh: no OO */
     context->unknown_tag = &HTTag_unrecognized;
     context->current_tag = context->slashedtag = NULL;
     context->state = S_text;
     context->kanji_buf = '\0';
-    context->element_stack = 0;			/* empty */
+    context->element_stack = 0;	/* empty */
     context->inSELECT = FALSE;
-    context->no_lynx_specialcodes = NO;	/* special codes normally generated */
+    context->no_lynx_specialcodes = NO;		/* special codes normally generated */
 #ifdef CALLERDATA
-    context->callerData = (void*) callerData;
+    context->callerData = (void *) callerData;
 #endif /* CALLERDATA */
     for (i = 0; i < MAX_ATTRIBUTES; i++)
 	context->value[i] = 0;
@@ -4475,7 +4407,7 @@ HTStream* SGML_new  (
     context->second_bracket = FALSE;
     context->isHex = FALSE;
 
-    context->node_anchor = anchor; /* Could be NULL? */
+    context->node_anchor = anchor;	/* Could be NULL? */
     context->utf_count = 0;
     context->utf_char = 0;
     context->utf_buf[0] = context->utf_buf[6] = '\0';
@@ -4491,15 +4423,15 @@ HTStream* SGML_new  (
 	context->inUCLYhndl = HTAnchor_getUCLYhndl(anchor,
 						   UCT_STAGE_PARSER);
     }
-#ifdef CAN_SWITCH_DISPLAY_CHARSET /* Allow a switch to a more suitable display charset */
+#ifdef CAN_SWITCH_DISPLAY_CHARSET	/* Allow a switch to a more suitable display charset */
     else if (anchor->UCStages
 	     && anchor->UCStages->s[UCT_STAGE_PARSER].LYhndl >= 0
-	     && anchor->UCStages->s[UCT_STAGE_PARSER].LYhndl != current_char_set ) {
+	     && anchor->UCStages->s[UCT_STAGE_PARSER].LYhndl != current_char_set) {
 	int o = anchor->UCStages->s[UCT_STAGE_PARSER].LYhndl;
 
-	anchor->UCStages->s[UCT_STAGE_PARSER].LYhndl = -1; /* Force reset */
+	anchor->UCStages->s[UCT_STAGE_PARSER].LYhndl = -1;	/* Force reset */
 	HTAnchor_resetUCInfoStage(anchor, o, UCT_STAGE_PARSER,
-				  /* Preserve change this: */
+	/* Preserve change this: */
 				  anchor->UCStages->s[UCT_STAGE_PARSER].lock);
     }
 #endif
@@ -4534,11 +4466,11 @@ HTStream* SGML_new  (
 }
 
 /*		Asian character conversion functions
-**		====================================
-**
-**	Added 24-Mar-96 by FM, based on:
-**
-////////////////////////////////////////////////////////////////////////
+ *		====================================
+ *
+ *	Added 24-Mar-96 by FM, based on:
+ *
+ ////////////////////////////////////////////////////////////////////////
 Copyright (c) 1993 Electrotechnical Laboratory (ETL)
 
 Permission to use, copy, modify, and distribute this material
@@ -4563,76 +4495,76 @@ History:
 
 int TREAT_SJIS = 1;
 
-void JISx0201TO0208_EUC (
-	register unsigned char		IHI,
-	register unsigned char		ILO,
-	register unsigned char *	OHI,
-	register unsigned char *	OLO)
+void JISx0201TO0208_EUC(register unsigned char IHI,
+			register unsigned char ILO,
+			register unsigned char *OHI,
+			register unsigned char *OLO)
 {
-    static char *table[] = {
-	"\241\243",	/* A1,A3 */
-	"\241\326",	/* A1,D6 */
-	"\241\327",	/* A1,D7 */
-	"\241\242",	/* A1,A2 */
-	"\241\246",	/* A1,A6 */
-	"\245\362",	/* A5,F2 */
-	"\245\241",	/* A5,A1 */
-	"\245\243",	/* A5,A3 */
-	"\245\245",	/* A5,A5 */
-	"\245\247",	/* A5,A7 */
-	"\245\251",	/* A5,A9 */
-	"\245\343",	/* A5,E3 */
-	"\245\345",	/* A5,E5 */
-	"\245\347",	/* A5,E7 */
-	"\245\303",	/* A5,C3 */
-	"\241\274",	/* A1,BC */
-	"\245\242",	/* A5,A2 */
-	"\245\244",	/* A5,A4 */
-	"\245\246",	/* A5,A6 */
-	"\245\250",	/* A5,A8 */
-	"\245\252",	/* A5,AA */
-	"\245\253",	/* A5,AB */
-	"\245\255",	/* A5,AD */
-	"\245\257",	/* A5,AF */
-	"\245\261",	/* A5,B1 */
-	"\245\263",	/* A5,B3 */
-	"\245\265",	/* A5,B5 */
-	"\245\267",	/* A5,B7 */
-	"\245\271",	/* A5,B9 */
-	"\245\273",	/* A5,BB */
-	"\245\275",	/* A5,BD */
-	"\245\277",	/* A5,BF */
-	"\245\301",	/* A5,C1 */
-	"\245\304",	/* A5,C4 */
-	"\245\306",	/* A5,C6 */
-	"\245\310",	/* A5,C8 */
-	"\245\312",	/* A5,CA */
-	"\245\313",	/* A5,CB */
-	"\245\314",	/* A5,CC */
-	"\245\315",	/* A5,CD */
-	"\245\316",	/* A5,CE */
-	"\245\317",	/* A5,CF */
-	"\245\322",	/* A5,D2 */
-	"\245\325",	/* A5,D5 */
-	"\245\330",	/* A5,D8 */
-	"\245\333",	/* A5,DB */
-	"\245\336",	/* A5,DE */
-	"\245\337",	/* A5,DF */
-	"\245\340",	/* A5,E0 */
-	"\245\341",	/* A5,E1 */
-	"\245\342",	/* A5,E2 */
-	"\245\344",	/* A5,E4 */
-	"\245\346",	/* A5,E6 */
-	"\245\350",	/* A5,E8 */
-	"\245\351",	/* A5,E9 */
-	"\245\352",	/* A5,EA */
-	"\245\353",	/* A5,EB */
-	"\245\354",	/* A5,EC */
-	"\245\355",	/* A5,ED */
-	"\245\357",	/* A5,EF */
-	"\245\363",	/* A5,F3 */
-	"\241\253",	/* A1,AB */
-	"\241\254"	/* A1,AC */
+    static char *table[] =
+    {
+	"\241\243",		/* A1,A3 */
+	"\241\326",		/* A1,D6 */
+	"\241\327",		/* A1,D7 */
+	"\241\242",		/* A1,A2 */
+	"\241\246",		/* A1,A6 */
+	"\245\362",		/* A5,F2 */
+	"\245\241",		/* A5,A1 */
+	"\245\243",		/* A5,A3 */
+	"\245\245",		/* A5,A5 */
+	"\245\247",		/* A5,A7 */
+	"\245\251",		/* A5,A9 */
+	"\245\343",		/* A5,E3 */
+	"\245\345",		/* A5,E5 */
+	"\245\347",		/* A5,E7 */
+	"\245\303",		/* A5,C3 */
+	"\241\274",		/* A1,BC */
+	"\245\242",		/* A5,A2 */
+	"\245\244",		/* A5,A4 */
+	"\245\246",		/* A5,A6 */
+	"\245\250",		/* A5,A8 */
+	"\245\252",		/* A5,AA */
+	"\245\253",		/* A5,AB */
+	"\245\255",		/* A5,AD */
+	"\245\257",		/* A5,AF */
+	"\245\261",		/* A5,B1 */
+	"\245\263",		/* A5,B3 */
+	"\245\265",		/* A5,B5 */
+	"\245\267",		/* A5,B7 */
+	"\245\271",		/* A5,B9 */
+	"\245\273",		/* A5,BB */
+	"\245\275",		/* A5,BD */
+	"\245\277",		/* A5,BF */
+	"\245\301",		/* A5,C1 */
+	"\245\304",		/* A5,C4 */
+	"\245\306",		/* A5,C6 */
+	"\245\310",		/* A5,C8 */
+	"\245\312",		/* A5,CA */
+	"\245\313",		/* A5,CB */
+	"\245\314",		/* A5,CC */
+	"\245\315",		/* A5,CD */
+	"\245\316",		/* A5,CE */
+	"\245\317",		/* A5,CF */
+	"\245\322",		/* A5,D2 */
+	"\245\325",		/* A5,D5 */
+	"\245\330",		/* A5,D8 */
+	"\245\333",		/* A5,DB */
+	"\245\336",		/* A5,DE */
+	"\245\337",		/* A5,DF */
+	"\245\340",		/* A5,E0 */
+	"\245\341",		/* A5,E1 */
+	"\245\342",		/* A5,E2 */
+	"\245\344",		/* A5,E4 */
+	"\245\346",		/* A5,E6 */
+	"\245\350",		/* A5,E8 */
+	"\245\351",		/* A5,E9 */
+	"\245\352",		/* A5,EA */
+	"\245\353",		/* A5,EB */
+	"\245\354",		/* A5,EC */
+	"\245\355",		/* A5,ED */
+	"\245\357",		/* A5,EF */
+	"\245\363",		/* A5,F3 */
+	"\241\253",		/* A1,AB */
+	"\241\254"		/* A1,AC */
     };
 
     if ((IHI == 0x8E) && (ILO >= 0xA1) && (ILO <= 0xDF)) {
@@ -4644,7 +4576,7 @@ void JISx0201TO0208_EUC (
     }
 }
 
-static int IS_SJIS_STR (const unsigned char *  str)
+static int IS_SJIS_STR(const unsigned char *str)
 {
     const unsigned char *s;
     unsigned char ch;
@@ -4659,10 +4591,9 @@ static int IS_SJIS_STR (const unsigned char *  str)
     return 0;
 }
 
-unsigned char * SJIS_TO_JIS1 (
-	register unsigned char		HI,
-	register unsigned char		LO,
-	register unsigned char *	JCODE)
+unsigned char *SJIS_TO_JIS1(register unsigned char HI,
+			    register unsigned char LO,
+			    register unsigned char *JCODE)
 {
     HI -= UCH((HI <= 0x9F) ? 0x71 : 0xB1);
     HI = UCH((HI << 1) + 1);
@@ -4679,10 +4610,9 @@ unsigned char * SJIS_TO_JIS1 (
     return JCODE;
 }
 
-unsigned char * JIS_TO_SJIS1 (
-	register unsigned char		HI,
-	register unsigned char		LO,
-	register unsigned char *	SJCODE)
+unsigned char *JIS_TO_SJIS1(register unsigned char HI,
+			    register unsigned char LO,
+			    register unsigned char *SJCODE)
 {
     if (HI & 1)
 	LO += UCH(0x1F);
@@ -4699,10 +4629,9 @@ unsigned char * JIS_TO_SJIS1 (
     return SJCODE;
 }
 
-unsigned char * EUC_TO_SJIS1 (
-	unsigned char			HI,
-	unsigned char			LO,
-	register unsigned char *	SJCODE)
+unsigned char *EUC_TO_SJIS1(unsigned char HI,
+			    unsigned char LO,
+			    register unsigned char *SJCODE)
 {
     if (HI == 0x8E)
 	JISx0201TO0208_EUC(HI, LO, &HI, &LO);
@@ -4710,10 +4639,9 @@ unsigned char * EUC_TO_SJIS1 (
     return SJCODE;
 }
 
-void JISx0201TO0208_SJIS (
-	register unsigned char		I,
-	register unsigned char *	OHI,
-	register unsigned char *	OLO)
+void JISx0201TO0208_SJIS(register unsigned char I,
+			 register unsigned char *OHI,
+			 register unsigned char *OLO)
 {
     unsigned char SJCODE[2];
 
@@ -4723,10 +4651,9 @@ void JISx0201TO0208_SJIS (
     *OLO = SJCODE[1];
 }
 
-unsigned char * SJIS_TO_EUC1 (
-	unsigned char		HI,
-	unsigned char		LO,
-	unsigned char *	data)
+unsigned char *SJIS_TO_EUC1(unsigned char HI,
+			    unsigned char LO,
+			    unsigned char *data)
 {
     SJIS_TO_JIS1(HI, LO, data);
     data[0] |= 0x80;
@@ -4734,9 +4661,8 @@ unsigned char * SJIS_TO_EUC1 (
     return data;
 }
 
-unsigned char * SJIS_TO_EUC (
-	unsigned char *	src,
-	unsigned char *	dst)
+unsigned char *SJIS_TO_EUC(unsigned char *src,
+			   unsigned char *dst)
 {
     register unsigned char hi, lo, *sp, *dp;
     register int in_sjis = 0;
@@ -4757,9 +4683,8 @@ unsigned char * SJIS_TO_EUC (
     return dst;
 }
 
-unsigned char * EUC_TO_SJIS (
-	unsigned char *	src,
-	unsigned char *	dst)
+unsigned char *EUC_TO_SJIS(unsigned char *src,
+			   unsigned char *dst)
 {
     register unsigned char *sp, *dp;
 
@@ -4782,11 +4707,10 @@ unsigned char * EUC_TO_SJIS (
 
 #define Strcpy(a,b)	(strcpy((char*)a,(const char*)b),&a[strlen((const char*)a)])
 
-unsigned char *EUC_TO_JIS (
-	unsigned char *	src,
-	unsigned char *	dst,
-	const char *		toK,
-	const char *		toA)
+unsigned char *EUC_TO_JIS(unsigned char *src,
+			  unsigned char *dst,
+			  const char *toK,
+			  const char *toA)
 {
     register unsigned char kana_mode = 0;
     register unsigned char cch;
@@ -4833,9 +4757,8 @@ unsigned char *EUC_TO_JIS (
 
 int repair_JIS = 0;
 
-static const unsigned char *repairJIStoEUC (
-	const unsigned char *	src,
-	unsigned char **	dstp)
+static const unsigned char *repairJIStoEUC(const unsigned char *src,
+					   unsigned char **dstp)
 {
     const unsigned char *s;
     unsigned char *d, ch1, ch2;
@@ -4858,9 +4781,8 @@ static const unsigned char *repairJIStoEUC (
     return 0;
 }
 
-unsigned char *TO_EUC (
-	const unsigned char *	jis,
-	unsigned char *	euc)
+unsigned char *TO_EUC(const unsigned char *jis,
+		      unsigned char *euc)
 {
     register const unsigned char *s;
     register unsigned char c, jis_stat;
@@ -4890,6 +4812,7 @@ unsigned char *TO_EUC (
 	if (c == to2B && jis_stat == 0 && repair_JIS) {
 	    if (*s == 'B' || *s == '@') {
 		const unsigned char *ts;
+
 		if ((ts = repairJIStoEUC(s + 1, &d)) != NULL) {
 		    s = ts;
 		    continue;
@@ -4948,7 +4871,7 @@ unsigned char *TO_EUC (
 
 #define non94(ch) ((ch) <= 0x20 || (ch) == 0x7F)
 
-static int is_EUC_JP (unsigned char *  euc)
+static int is_EUC_JP(unsigned char *euc)
 {
     unsigned char *cp;
     int ch1, ch2;
@@ -4970,41 +4893,39 @@ static int is_EUC_JP (unsigned char *  euc)
     return 1;
 }
 
-void TO_SJIS (
-	const unsigned char *	any,
-	unsigned char *	sjis)
+void TO_SJIS(const unsigned char *arg,
+	     unsigned char *sjis)
 {
     unsigned char *euc;
 
-    euc = malloc(strlen((const char *) any) + 1);
+    euc = malloc(strlen((const char *) arg) + 1);
 #ifdef CJK_EX
     if (!euc)
 	outofmem(__FILE__, "TO_SJIS");
 #endif
-    TO_EUC(any, euc);
+    TO_EUC(arg, euc);
     if (is_EUC_JP(euc))
 	EUC_TO_SJIS(euc, sjis);
     else
-	strcpy((char *) sjis, (const char *) any);
+	strcpy((char *) sjis, (const char *) arg);
     free(euc);
 }
 
-void TO_JIS (
-	const unsigned char *	any,
-	unsigned char *	jis)
+void TO_JIS(const unsigned char *arg,
+	    unsigned char *jis)
 {
     unsigned char *euc;
 
-    if (any[0] == 0) {
+    if (arg[0] == 0) {
 	jis[0] = 0;
 	return;
     }
-    euc = malloc(strlen((const char *) any) + 1);
+    euc = malloc(strlen((const char *) arg) + 1);
 #ifdef CJK_EX
     if (!euc)
 	outofmem(__FILE__, "TO_JIS");
 #endif
-    TO_EUC(any, euc);
+    TO_EUC(arg, euc);
     is_EUC_JP(euc);
     EUC_TO_JIS(euc, jis, TO_KANJI, TO_ASCII);
 
diff --git a/WWW/Library/Implementation/SGML.h b/WWW/Library/Implementation/SGML.h
index 1ecf18f5..7d22883f 100644
--- a/WWW/Library/Implementation/SGML.h
+++ b/WWW/Library/Implementation/SGML.h
@@ -27,146 +27,144 @@ SGML content types
 
  */
 typedef enum {
-    SGML_EMPTY,	   /* No content. */
-    SGML_LITTERAL, /* Literal character data.  Recognize exact close tag only.
-		      Old www server compatibility only!  Not SGML */
-    SGML_CDATA,	   /* Character data.  Recognize </ only.
-		      (But we treat it just as SGML_LITTERAL.) */
-    SGML_SCRIPT,   /* Like CDATA, but allow it to be a comment */
-    SGML_RCDATA,   /* Replaceable character data. Should recognize </ and &ref;
-		      (but we treat it like SGML_MIXED for old times' sake). */
-    SGML_MIXED,	   /* Elements and parsed character data.
-		      Recognize all markup. */
-    SGML_ELEMENT,  /* Any data found should be regarded as an error.
-		      (But we treat it just like SGML_MIXED.) */
-    SGML_PCDATA	   /* Should contain no elements but &ref; is parsed.
-		      (We treat it like SGML_CDATA wrt. contained tags
-		      i.e. pass them on literally, i.e. like we should
-		      treat SGML_RCDATA) (added by KW). */
+    SGML_EMPTY,			/* No content. */
+    SGML_LITTERAL,		/* Literal character data.  Recognize exact close tag only.
+				   Old www server compatibility only!  Not SGML */
+    SGML_CDATA,			/* Character data.  Recognize </ only.
+				   (But we treat it just as SGML_LITTERAL.) */
+    SGML_SCRIPT,		/* Like CDATA, but allow it to be a comment */
+    SGML_RCDATA,		/* Replaceable character data. Should recognize </ and &ref;
+				   (but we treat it like SGML_MIXED for old times' sake). */
+    SGML_MIXED,			/* Elements and parsed character data.
+				   Recognize all markup. */
+    SGML_ELEMENT,		/* Any data found should be regarded as an error.
+				   (But we treat it just like SGML_MIXED.) */
+    SGML_PCDATA			/* Should contain no elements but &ref; is parsed.
+				   (We treat it like SGML_CDATA wrt. contained tags
+				   i.e. pass them on literally, i.e. like we should
+				   treat SGML_RCDATA) (added by KW). */
 } SGMLContent;
 
-
 typedef struct {
-    char *	name;		/* The (constant) name of the attribute */
+    char *name;			/* The (constant) name of the attribute */
 #ifdef USE_PRETTYSRC
-    char	type;		/* code of the type of the attribute. Code
+    char type;			/* code of the type of the attribute. Code
 				   values are in HTMLDTD.h */
 #endif
 } attr;
 
 typedef int TagClass;
+
     /* textflow */
-#define Tgc_FONTlike	0x00001 /* S,STRIKE,I,B,TT,U,BIG,SMALL,STYLE,BLINK;BR,TAB */
-#define Tgc_EMlike	0x00002 /* EM,STRONG,DFN,CODE,SAMP,KBD,VAR,CITE,Q,INS,DEL,SPAN,.. */
-#define Tgc_MATHlike	0x00004 /* SUB,SUP,MATH,COMMENT */
-#define Tgc_Alike	0x00008 /* A */
-#define Tgc_formula	0x00010 /* not used until math is supported better... */
+#define Tgc_FONTlike	0x00001	/* S,STRIKE,I,B,TT,U,BIG,SMALL,STYLE,BLINK;BR,TAB */
+#define Tgc_EMlike	0x00002	/* EM,STRONG,DFN,CODE,SAMP,KBD,VAR,CITE,Q,INS,DEL,SPAN,.. */
+#define Tgc_MATHlike	0x00004	/* SUB,SUP,MATH,COMMENT */
+#define Tgc_Alike	0x00008	/* A */
+#define Tgc_formula	0x00010	/* not used until math is supported better... */
     /* used for special structures: forms, tables,... */
-#define Tgc_TRlike	0x00020 /* TR and similar */
-#define Tgc_SELECTlike	0x00040 /* SELECT,INPUT,TEXTAREA(,...) */
+#define Tgc_TRlike	0x00020	/* TR and similar */
+#define Tgc_SELECTlike	0x00040	/* SELECT,INPUT,TEXTAREA(,...) */
     /* structure */
-#define Tgc_FORMlike	0x00080 /* FORM itself */
-#define Tgc_Plike	0x00100 /* P,H1..H6,... structures containing text or
-				    insertion but not other structures */
-#define Tgc_DIVlike	0x00200 /* ADDRESS,FIG,BDO,NOTE,FN,DIV,CENTER;FIG
-				    structures which can contain other structures */
-#define Tgc_LIlike	0x00400 /* LH,LI,DT,DD;TH,TD structure-like, only valid
-				    within certain other structures */
-#define Tgc_ULlike	0x00800 /* UL,OL,DL,DIR,MENU;TABLE;XMP,LISTING
-				    special in some way, cannot contain (parsed)
-				    text directly */
+#define Tgc_FORMlike	0x00080	/* FORM itself */
+#define Tgc_Plike	0x00100	/* P,H1..H6,... structures containing text or
+				   insertion but not other structures */
+#define Tgc_DIVlike	0x00200	/* ADDRESS,FIG,BDO,NOTE,FN,DIV,CENTER;FIG
+				   structures which can contain other structures */
+#define Tgc_LIlike	0x00400	/* LH,LI,DT,DD;TH,TD structure-like, only valid
+				   within certain other structures */
+#define Tgc_ULlike	0x00800	/* UL,OL,DL,DIR,MENU;TABLE;XMP,LISTING
+				   special in some way, cannot contain (parsed)
+				   text directly */
     /* insertions */
-#define Tgc_BRlike	0x01000 /* BR,IMG,TAB allowed in any text */
-#define Tgc_APPLETlike	0x02000 /* APPLET,OBJECT,EMBED,SCRIPT;BUTTON */
-#define Tgc_HRlike	0x04000 /* HR,MARQUEE can contain all kinds of things
-				    and/or are not allowed (?) in running text */
-#define Tgc_MAPlike	0x08000 /* MAP,AREA some specials that never contain
-				    (directly or indirectly) other things than
-				    special insertions */
-#define Tgc_outer	0x10000 /* HTML,FRAMESET,FRAME,PLAINTEXT; */
-#define Tgc_BODYlike	0x20000 /* BODY,BODYTEXT,NOFRAMES,TEXTFLOW; */
-#define Tgc_HEADstuff	0x40000 /* HEAD,BASE,STYLE,TITLE; */
+#define Tgc_BRlike	0x01000	/* BR,IMG,TAB allowed in any text */
+#define Tgc_APPLETlike	0x02000	/* APPLET,OBJECT,EMBED,SCRIPT;BUTTON */
+#define Tgc_HRlike	0x04000	/* HR,MARQUEE can contain all kinds of things
+				   and/or are not allowed (?) in running text */
+#define Tgc_MAPlike	0x08000	/* MAP,AREA some specials that never contain
+				   (directly or indirectly) other things than
+				   special insertions */
+#define Tgc_outer	0x10000	/* HTML,FRAMESET,FRAME,PLAINTEXT; */
+#define Tgc_BODYlike	0x20000	/* BODY,BODYTEXT,NOFRAMES,TEXTFLOW; */
+#define Tgc_HEADstuff	0x40000	/* HEAD,BASE,STYLE,TITLE; */
     /* special relations */
 #define Tgc_same	0x80000
 
 /* Some more properties of tags (or rather, elements) and rules how
    to deal with them. - kw */
 typedef int TagFlags;
-#define Tgf_endO	0x00001 /* end tag can be Omitted */
-#define Tgf_startO	0x00002 /* start tag can be Omitted */
-#define Tgf_mafse	0x00004 /* Make Attribute-Free Start-tag End instead
-				      (if found invalid) */
-#define Tgf_strict	0x00008 /* Ignore contained invalid elements,
+
+#define Tgf_endO	0x00001	/* end tag can be Omitted */
+#define Tgf_startO	0x00002	/* start tag can be Omitted */
+#define Tgf_mafse	0x00004	/* Make Attribute-Free Start-tag End instead
+				   (if found invalid) */
+#define Tgf_strict	0x00008	/* Ignore contained invalid elements,
 				   don't pass them on; or other variant
 				   handling for some content types */
-#define Tgf_nreie	0x00010 /* Not Really Empty If Empty,
-				      used by color style code */
-#define Tgf_frecyc	0x00020 /* Pass element content on in a form that
+#define Tgf_nreie	0x00010	/* Not Really Empty If Empty,
+				   used by color style code */
+#define Tgf_frecyc	0x00020	/* Pass element content on in a form that
 				   allows recycling, i.e. don't translate to
 				   output (display) character set yet (treat
 				   content similar to attribute values) */
-#define Tgf_nolyspcl	0x00040 /* Don't generate lynx special characters
+#define Tgf_nolyspcl	0x00040	/* Don't generate lynx special characters
 				   for soft hyphen and various spaces (nbsp,
 				   ensp,..) */
 
 /*		A tag structure describes an SGML element.
-**		-----------------------------------------
-**
-**
-**	name		is the string which comes after the tag opener "<".
-**
-**	attributes	points to a zero-terminated array
-**			of attribute names.
-**
-**	litteral	determines how the SGML engine parses the characters
-**			within the element.  If set, tag openers are ignored
-**			except for that which opens a matching closing tag.
-**
-*/
+ *		-----------------------------------------
+ *
+ *
+ *	name		is the string which comes after the tag opener "<".
+ *
+ *	attributes	points to a zero-terminated array
+ *			of attribute names.
+ *
+ *	litteral	determines how the SGML engine parses the characters
+ *			within the element.  If set, tag openers are ignored
+ *			except for that which opens a matching closing tag.
+ *
+ */
 typedef struct _tag HTTag;
-struct _tag{
-    char *	name;			/* The name of the tag */
+struct _tag {
+    char *name;			/* The name of the tag */
 #ifdef USE_COLOR_STYLE
-    int		name_len;		/* The length of the name */
+    int name_len;		/* The length of the name */
 #endif
 #ifdef EXP_JUSTIFY_ELTS
-    BOOL	can_justify;		/* justification allowed?*/
+    BOOL can_justify;		/* justification allowed? */
 #endif
-    attr *	attributes;		/* The list of acceptable attributes */
-    int		number_of_attributes;	/* Number of possible attributes */
-    SGMLContent contents;		/* End only on end tag @@ */
-    TagClass	tagclass,
-	contains,	/* which classes of elements this one can contain directly */
-	icontains,	/* which classes of elements this one can contain indirectly */
-	contained,	/* in which classes can this tag be contained ? */
-	icontained,	/* in which classes can this tag be indirectly contained ? */
-	canclose;	/* which classes of elements can this one close
-			   if something looks wrong ? */
-    TagFlags	flags;
+    attr *attributes;		/* The list of acceptable attributes */
+    int number_of_attributes;	/* Number of possible attributes */
+    SGMLContent contents;	/* End only on end tag @@ */
+    TagClass tagclass;
+    TagClass contains;		/* which classes of elements this one can contain directly */
+    TagClass icontains;		/* which classes of elements this one can contain indirectly */
+    TagClass contained;		/* in which classes can this tag be contained ? */
+    TagClass icontained;	/* in which classes can this tag be indirectly contained ? */
+    TagClass canclose;		/* which classes of elements can this one close
+				   if something looks wrong ? */
+    TagFlags flags;
 };
 
-
 /*		DTD Information
-**		---------------
-**
-**  Not the whole DTD, but all this parser uses of it.
-*/
+ *		---------------
+ *
+ *  Not the whole DTD, but all this parser uses of it.
+ */
 typedef struct {
-    HTTag *		tags;		/* Must be in strcmp order by name */
-    int			number_of_tags;
-    const char **	entity_names;	/* Must be in strcmp order by name */
-    size_t		number_of_entities;
-				/*  "entity_names" table probably unused,
-				**  see comments in HTMLDTD.c near the top
-				*/
+    HTTag *tags;		/* Must be in strcmp order by name */
+    int number_of_tags;
+    const char **entity_names;	/* Must be in strcmp order by name */
+    size_t number_of_entities;
+    /*  "entity_names" table probably unused,
+     *  see comments in HTMLDTD.c near the top
+     */
 } SGML_dtd;
 
-
 /*	SGML context passed to parsers
 */
 typedef struct _HTSGMLContext *HTSGMLContext;	/* Hidden */
 
-
 /*__________________________________________________________________________
 */
 
@@ -191,46 +189,31 @@ Structured Object definition
  */
 typedef struct _HTStructured HTStructured;
 
-typedef struct _HTStructuredClass{
+typedef struct _HTStructuredClass {
 
-	char*  name;				/* Just for diagnostics */
+    char *name;			/* Just for diagnostics */
 
-	void (*_free) (
-		HTStructured*	me);
+    void (*_free) (HTStructured * me);
 
-	void (*_abort) (
-		HTStructured*	me,
-		HTError		e);
+    void (*_abort) (HTStructured * me, HTError e);
 
-	void (*put_character) (
-		HTStructured*	me,
-		char		ch);
+    void (*put_character) (HTStructured * me, char ch);
 
-	void (*put_string) (
-		HTStructured*	me,
-		const char *	str);
+    void (*put_string) (HTStructured * me, const char *str);
 
-	void (*_write) (
-		HTStructured*	me,
-		const char *	str,
-		int		len);
+    void (*_write) (HTStructured * me, const char *str,
+		    int len);
 
-	int (*start_element) (
-		HTStructured*	me,
-		int		element_number,
-		const BOOL*	attribute_present,
-		const char**	attribute_value,
-		int		charset,
-		char **		include);
+    int (*start_element) (HTStructured * me, int element_number,
+			  const BOOL *attribute_present,
+			  const char **attribute_value,
+			  int charset,
+			  char **include);
 
-	int (*end_element) (
-		HTStructured*	me,
-		int		element_number,
-		char **		include);
+    int (*end_element) (HTStructured * me, int element_number,
+			char **include);
 
-	int (*put_entity) (
-		HTStructured*	me,
-		int		entity_number);
+    int (*put_entity) (HTStructured * me, int entity_number);
 
 } HTStructuredClass;
 
@@ -239,9 +222,9 @@ typedef struct _HTStructuredClass{
   into additional HTStructuredClass members.  For now they don't do
   anything target-specific. - kw
   */
-extern BOOLEAN LYCheckForCSI (HTParentAnchor *anchor, char **url);
-extern void LYDoCSI (char *url, const char *comment, char **csi);
-extern BOOLEAN LYCommentHacks (HTParentAnchor *anchor, const char *comment);
+extern BOOLEAN LYCheckForCSI(HTParentAnchor *anchor, char **url);
+extern void LYDoCSI(char *url, const char *comment, char **csi);
+extern BOOLEAN LYCommentHacks(HTParentAnchor *anchor, const char *comment);
 
 /*
 
@@ -250,10 +233,8 @@ Find a Tag by Name
    Returns a pointer to the tag within the DTD.
 
  */
-extern HTTag * SGMLFindTag (
-	const SGML_dtd *	dtd,
-	const char *		string);
-
+extern HTTag *SGMLFindTag(const SGML_dtd * dtd,
+			  const char *string);
 
 /*
 
@@ -261,18 +242,17 @@ Create an SGML parser
 
  */
 /*
-** On entry,
-**	dtd		must point to a DTD structure as defined above
-**	callbacks	must point to user routines.
-**	callData	is returned in callbacks transparently.
-** On exit,
-**		The default tag starter has been processed.
-*/
-extern HTStream * SGML_new (
-	const SGML_dtd *	dtd,
-	HTParentAnchor *	anchor,
-	HTStructured *		target);
+ * On entry,
+ *	dtd		must point to a DTD structure as defined above
+ *	callbacks	must point to user routines.
+ *	callData	is returned in callbacks transparently.
+ * On exit,
+ *		The default tag starter has been processed.
+ */
+extern HTStream *SGML_new(const SGML_dtd * dtd,
+			  HTParentAnchor *anchor,
+			  HTStructured * target);
 
 extern const HTStreamClass SGMLParser;
 
-#endif	/* SGML_H */
+#endif /* SGML_H */
diff --git a/WWW/Library/Implementation/UCAux.h b/WWW/Library/Implementation/UCAux.h
index 44598b0e..06db09b6 100644
--- a/WWW/Library/Implementation/UCAux.h
+++ b/WWW/Library/Implementation/UCAux.h
@@ -5,15 +5,13 @@
 #include <HTUtils.h>
 #endif
 
-extern BOOL UCCanUniTranslateFrom (int from);
-extern BOOL UCCanTranslateUniTo (int to);
-extern BOOL UCCanTranslateFromTo (int from, int to);
-extern BOOL UCNeedNotTranslate (
-	int		from,
-	int		to);
+extern BOOL UCCanUniTranslateFrom(int from);
+extern BOOL UCCanTranslateUniTo(int to);
+extern BOOL UCCanTranslateFromTo(int from, int to);
+extern BOOL UCNeedNotTranslate(int from,
+			       int to);
 
-struct _UCTransParams
-{
+struct _UCTransParams {
     BOOL transp;
     BOOL do_cjk;
     BOOL decode_utf8;
@@ -33,44 +31,37 @@ typedef struct _UCTransParams UCTransParams;
 #include <UCDefs.h>
 #endif /* UCDEFS_H */
 
-extern void UCSetTransParams (
-	UCTransParams *		pT,
-	int			cs_in,
-	const LYUCcharset *	p_in,
-	int			cs_out,
-	const LYUCcharset *	p_out);
+extern void UCSetTransParams(UCTransParams * pT, int cs_in,
+			     const LYUCcharset *p_in,
+			     int cs_out,
+			     const LYUCcharset *p_out);
 
-extern void UCTransParams_clear (
-	UCTransParams *		pT);
+extern void UCTransParams_clear(UCTransParams * pT);
 
-extern void UCSetBoxChars (
-    int		cset,
-    int *	pvert_out,
-    int *	phori_out,
-    int		vert_in,
-    int		hori_in);
+extern void UCSetBoxChars(int cset,
+			  int *pvert_out,
+			  int *phori_out,
+			  int vert_in,
+			  int hori_in);
 
 #ifndef HTSTREAM_H
 #include <HTStream.h>
 #endif /* HTSTREAM_H */
 
-typedef void putc_func_t (
-	HTStream *	me,
-	char		ch);
+typedef void putc_func_t(HTStream *me,
+			 char ch);
 
 #ifndef UCMAP_H
 #include <UCMap.h>
 #endif /* UCMAP_H */
 
-extern BOOL UCPutUtf8_charstring (
-	HTStream *	target,
-	putc_func_t *	actions,
-	UCode_t		code);
+extern BOOL UCPutUtf8_charstring(HTStream *target,
+				 putc_func_t * actions,
+				 UCode_t code);
 
-extern BOOL UCConvertUniToUtf8 (
-	UCode_t		code,
-	char *		buffer);
+extern BOOL UCConvertUniToUtf8(UCode_t code,
+			       char *buffer);
 
-extern UCode_t UCGetUniFromUtf8String (char ** ppuni);
+extern UCode_t UCGetUniFromUtf8String(char **ppuni);
 
 #endif /* UCAUX_H */
diff --git a/WWW/Library/Implementation/UCDefs.h b/WWW/Library/Implementation/UCDefs.h
index 48b45533..8677824c 100644
--- a/WWW/Library/Implementation/UCDefs.h
+++ b/WWW/Library/Implementation/UCDefs.h
@@ -8,35 +8,34 @@
 #endif
 
 typedef struct _LYUCcharset {
-    int UChndl;		/* -1 for "old" charsets, >= 0 for chartrans tables */
+    int UChndl;			/* -1 for "old" charsets, >= 0 for chartrans tables */
 
-    const char * MIMEname;
+    const char *MIMEname;
     int enc;
-    int codepage;	/* if positive, an IBM OS/2 specific number;
-			   if negative, flag for no table translation */
+    int codepage;		/* if positive, an IBM OS/2 specific number;
+				   if negative, flag for no table translation */
 
     /* parameters below are not used by chartrans mechanism, */
-    /* they describe some relationships against built-in Latin1 charset...*/
-    int repertoire;	/* unused */
-    int codepoints;	/* subset/superset of Latin1 ? */
-    int cpranges;	/* unused, obsolete by LYlowest_eightbit;
-			  "which ranges have valid displayable chars
-			   (including nbsp and shy)" */
-    int like8859;	/* currently used for nbsp and shy only
-			   (but UCT_R_8859SPECL assumed for any UCT_R_8BIT...);
-			  "for which ranges is it like 8859-1" */
+    /* they describe some relationships against built-in Latin1 charset... */
+    int repertoire;		/* unused */
+    int codepoints;		/* subset/superset of Latin1 ? */
+    int cpranges;		/* unused, obsolete by LYlowest_eightbit;
+				   "which ranges have valid displayable chars
+				   (including nbsp and shy)" */
+    int like8859;		/* currently used for nbsp and shy only
+				   (but UCT_R_8859SPECL assumed for any UCT_R_8BIT...);
+				   "for which ranges is it like 8859-1" */
 } LYUCcharset;
 
 #define UCT_ENC_7BIT 0
 #define UCT_ENC_8BIT 1
-#define UCT_ENC_8859 2         /* no displayable chars in 0x80-0x9F */
-#define UCT_ENC_8BIT_C0 3      /* 8-bit + some chars in C0 control area */
+#define UCT_ENC_8859 2		/* no displayable chars in 0x80-0x9F */
+#define UCT_ENC_8BIT_C0 3	/* 8-bit + some chars in C0 control area */
 #define UCT_ENC_MAYBE2022 4
 #define UCT_ENC_CJK 5
 #define UCT_ENC_16BIT 6
 #define UCT_ENC_UTF8 7
 
-
 #define UCT_REP_SUBSETOF_LAT1 0x01
 #define UCT_REP_SUPERSETOF_LAT1 0x02
 #define UCT_REP_IS_LAT1 UCT_REP_SUBSETOF_LAT1 | UCT_REP_SUPERSETOF_LAT1
@@ -48,7 +47,7 @@ typedef struct _LYUCcharset {
 /*
  *  More general description how the code points relate to 8859-1 and UCS:
  */
-#define UCT_CP_SUBSETOF_LAT1 0x01 /* implies UCT_CP_SUBSETOF_UCS2 */
+#define UCT_CP_SUBSETOF_LAT1 0x01	/* implies UCT_CP_SUBSETOF_UCS2 */
 #define UCT_CP_SUPERSETOF_LAT1 0x02
 #define UCT_CP_SUBSETOF_UCS2 0x04
 
@@ -61,19 +60,19 @@ typedef struct _LYUCcharset {
 #define UCT_R_7BITINV 0x10	/* invariant???, displayable 7bit chars */
 #define UCT_R_7BITNAT 0x20	/* displayable 7bit, national??? */
 #define UCT_R_HIGHCTRL 0x40	/* chars in 0x80-0x9F range */
-#define UCT_R_8859SPECL 0x80	/* special chars in 8859-x sets: nbsp and shy*/
+#define UCT_R_8859SPECL 0x80	/* special chars in 8859-x sets: nbsp and shy */
 #define UCT_R_HIGH8BIT 0x100	/* rest of 0xA0-0xFF range */
 
-#define UCT_R_ASCII UCT_R_7BITINV | UCT_R_7BITNAT /* displayable US-ASCII */
+#define UCT_R_ASCII UCT_R_7BITINV | UCT_R_7BITNAT	/* displayable US-ASCII */
 #define UCT_R_LAT1 UCT_R_ASCII | UCT_R_8859SPECL | UCT_R_HIGH8BIT
-#define UCT_R_8BIT UCT_R_LAT1 | UCT_R_HIGHCTRL /* full 8bit range */
+#define UCT_R_8BIT UCT_R_LAT1 | UCT_R_HIGHCTRL	/* full 8bit range */
 
 /*
  *  For the following some comments are in HTAnchor.c.
  */
 #define UCT_STAGE_MIME 0
 #define UCT_STAGE_PARSER 1	/* What the parser (SGML.c) gets to see */
-#define UCT_STAGE_STRUCTURED 2	/* What the structured stream (HTML) gets fed*/
+#define UCT_STAGE_STRUCTURED 2	/* What the structured stream (HTML) gets fed */
 #define UCT_STAGE_HTEXT 3	/* What gets fed to the HText_* functions */
 #define UCT_STAGEMAX 4
 
@@ -84,16 +83,14 @@ typedef struct _LYUCcharset {
 #define UCT_SETBY_PARSER 4	/* set by SGML parser or similar */
 #define UCT_SETBY_MIME 5	/* set explicitly by MIME charset parameter */
 
-typedef struct _UCStageInfo
-{
-    int	lock;			/* by what it has been set */
+typedef struct _UCStageInfo {
+    int lock;			/* by what it has been set */
     int LYhndl;
-    LYUCcharset	C;
+    LYUCcharset C;
 } UCStageInfo;
 
-typedef struct _UCAnchorInfo
-{
-    struct _UCStageInfo	s[UCT_STAGEMAX];
+typedef struct _UCAnchorInfo {
+    struct _UCStageInfo s[UCT_STAGEMAX];
 } UCAnchorInfo;
 
 #endif /* UCDEFS_H */
diff --git a/WWW/Library/Implementation/UCMap.h b/WWW/Library/Implementation/UCMap.h
index 66c24f0f..b45e99cc 100644
--- a/WWW/Library/Implementation/UCMap.h
+++ b/WWW/Library/Implementation/UCMap.h
@@ -7,42 +7,33 @@
 
 typedef long UCode_t;
 
-extern int UCTransUniChar (
-	UCode_t		unicode,
-	int		charset_out);
-extern int UCTransUniCharStr (
-	char *		outbuf,
-	int		buflen,
-	UCode_t		unicode,
-	int		charset_out,
-	int		chk_single_flag);
-extern int UCTransChar (
-	char		ch_in,
-	int		charset_in,
-	int		charset_out);
-extern int UCReverseTransChar (
-	char		ch_out,
-	int		charset_in,
-	int		charset_out);
-extern int UCTransCharStr (
-	char *		outbuf,
-	int		buflen,
-	char		ch_in,
-	int		charset_in,
-	int		charset_out,
-	int		chk_single_flag);
-extern UCode_t UCTransToUni (
-	char		ch_in,
-	int		charset_in);
-extern int UCGetRawUniMode_byLYhndl (
-	int		i);
-extern int UCGetLYhndl_byMIME (
-	const char *	p); /* returns -1 if name not recognized */
-extern int safeUCGetLYhndl_byMIME (
-	const char *	p); /* returns LATIN1 if name not recognized */
+extern int UCTransUniChar(UCode_t unicode,
+			  int charset_out);
+extern int UCTransUniCharStr(char *outbuf,
+			     int buflen,
+			     UCode_t unicode,
+			     int charset_out,
+			     int chk_single_flag);
+extern int UCTransChar(char ch_in,
+		       int charset_in,
+		       int charset_out);
+extern int UCReverseTransChar(char ch_out,
+			      int charset_in,
+			      int charset_out);
+extern int UCTransCharStr(char *outbuf,
+			  int buflen,
+			  char ch_in,
+			  int charset_in,
+			  int charset_out,
+			  int chk_single_flag);
+extern UCode_t UCTransToUni(char ch_in,
+			    int charset_in);
+extern int UCGetRawUniMode_byLYhndl(int i);
+extern int UCGetLYhndl_byMIME(const char *p);	/* returns -1 if name not recognized */
+extern int safeUCGetLYhndl_byMIME(const char *p);	/* returns LATIN1 if name not recognized */
 
 #ifdef EXP_LOCALE_CHARSET
-extern void LYFindLocaleCharset (void);
+extern void LYFindLocaleCharset(void);
 #endif
 
 extern int UCLYhndl_for_unspec;
@@ -51,12 +42,12 @@ extern int UCLYhndl_HTFile_for_unspec;
 extern int UCLYhndl_HTFile_for_unrec;
 
 /* easy to type: */
-extern int LATIN1;     /* UCGetLYhndl_byMIME("iso-8859-1") */
-extern int US_ASCII;   /* UCGetLYhndl_byMIME("us-ascii")   */
-extern int UTF8_handle;	/* UCGetLYhndl_byMIME("utf-8")      */
+extern int LATIN1;		/* UCGetLYhndl_byMIME("iso-8859-1") */
+extern int US_ASCII;		/* UCGetLYhndl_byMIME("us-ascii")   */
+extern int UTF8_handle;		/* UCGetLYhndl_byMIME("utf-8")      */
 
-#undef TRANSPARENT	/* defined on Solaris in <sys/stream.h> */
-extern int TRANSPARENT; /* UCGetLYhndl_byMIME("x-transparent")  */
+#undef TRANSPARENT		/* defined on Solaris in <sys/stream.h> */
+extern int TRANSPARENT;		/* UCGetLYhndl_byMIME("x-transparent")  */
 
 /*
 In general, Lynx translates letters from document charset to display charset.
@@ -76,7 +67,6 @@ UCLYhndl_for_unrec  -  in case a charset parameter is not recognized;
 UCLYhndl_HTFile_for_unrec  - the same but only for local files,
                              currently not used.
 
-
 current_char_set  -	this corresponds to "display charset",
 			declared in LYCharSets.c and really important.
 
@@ -87,7 +77,6 @@ from user's error in configuration file lynx.cfg or command line switches,
 those unrecognized MIME names are assumed as LATIN1 (via safeUCGetLYhndl...).
 */
 
-
 #define UCTRANS_NOTFOUND (-4)
 
 #endif /* UCMAP_H */
diff --git a/WWW/Library/Implementation/www_tcp.h b/WWW/Library/Implementation/www_tcp.h
index 56f00cf7..31b5acde 100644
--- a/WWW/Library/Implementation/www_tcp.h
+++ b/WWW/Library/Implementation/www_tcp.h
@@ -38,22 +38,22 @@ Default values
 
  */
 /* Default values of those: */
-#define NETCLOSE close      /* Routine to close a TCP-IP socket         */
-#define NETREAD  HTDoRead       /* Routine to read from a TCP-IP socket     */
-#define NETWRITE write      /* Routine to write to a TCP-IP socket      */
-#define SOCKET_READ read    /* normal socket read routine */
-#define IOCTL ioctl	    /* normal ioctl routine for sockets */
-#define SOCKET_ERRNO errno	    /* normal socket errno */
+#define NETCLOSE close		/* Routine to close a TCP-IP socket         */
+#define NETREAD  HTDoRead	/* Routine to read from a TCP-IP socket     */
+#define NETWRITE write		/* Routine to write to a TCP-IP socket      */
+#define SOCKET_READ read	/* normal socket read routine */
+#define IOCTL ioctl		/* normal ioctl routine for sockets */
+#define SOCKET_ERRNO errno	/* normal socket errno */
 
 /* Unless stated otherwise, */
-#define SELECT                  /* Can handle >1 channel.               */
-#define GOT_SYSTEM              /* Can call shell with string           */
+#define SELECT			/* Can handle >1 channel.               */
+#define GOT_SYSTEM		/* Can call shell with string           */
 
 #ifdef UNIX
 #define GOT_PIPE
 #endif /* UNIX */
 
-#define INVSOC (-1)             /* Unix invalid socket */
+#define INVSOC (-1)		/* Unix invalid socket */
 		/* NB: newer libwww has something different for Windows */
 
 #ifndef VMS
@@ -126,7 +126,7 @@ Default values
 #endif
 
 #ifdef HAVE_STRING_H
-#include <string.h>             /* For bzero etc */
+#include <string.h>		/* For bzero etc */
 #endif /* HAVE_STRING_H */
 
 /*
@@ -135,29 +135,30 @@ Default values
 
  */
 #ifndef TOASCII
-#ifdef EBCDIC  /* S/390 -- gil -- 1327 */
+#ifdef EBCDIC			/* S/390 -- gil -- 1327 */
 
-extern       char un_IBM1047[];
+extern char un_IBM1047[];
 extern unsigned char IBM1047[];
+
 /* For debugging
 #include <assert.h>
 #define   TOASCII(c) (assert((c)>=0 && (c)<256), un_IBM1047[c])
-*/ /* for production */
+*//* for production */
 #define   TOASCII(c) (un_IBM1047[c])
 
 #define FROMASCII(c) (IBM1047[c])
 
-#else  /* EBCDIC */
+#else /* EBCDIC */
 
 #if '0' != 48
- error Host character set is not ASCII.
+error Host character set is not ASCII.
 #endif
 
 #define TOASCII(c) (c)
 #define FROMASCII(c) (c)
 
-#endif /* EBCDIC */
-#endif /* !TOASCII */
+#endif				/* EBCDIC */
+#endif				/* !TOASCII */
 
 /* convert a char to an unsigned, needed if we have signed characters for ctype.h */
 #define UCH(ch) ((unsigned char)(ch))
@@ -174,15 +175,16 @@ IBM-PC running Windows NT
 #define _WINDOWS_NSL
 #endif
 
-#include <fcntl.h>                      /* For HTFile.c */
-#include <sys\types.h>                  /* For HTFile.c */
-#include <sys\stat.h>                   /* For HTFile.c */
+#include <fcntl.h>		/* For HTFile.c */
+#include <sys\types.h>		/* For HTFile.c */
+#include <sys\stat.h>		/* For HTFile.c */
 #undef NETREAD
 #undef NETWRITE
 #undef NETCLOSE
 #undef IOCTL
 extern int ws_netread(int fd, char *buf, int len);
-#define NETREAD(s,b,l)  ws_netread((s),(b),(l))	/* 1997/11/06 (Thu) */
+
+#define NETREAD(s,b,l)  ws_netread((s),(b),(l))		/* 1997/11/06 (Thu) */
 #define NETWRITE(s,b,l) send((s),(b),(l),0)
 #define NETCLOSE(s)     closesocket(s)
 #define IOCTL				ioctlsocket
@@ -217,7 +219,7 @@ extern int ws_netread(int fd, char *buf, int len);
 #else /* USE_WINSOCK_H */
 
 #include <winsock.h>
-typedef struct sockaddr_in SockA;  /* See netinet/in.h */
+typedef struct sockaddr_in SockA;	/* See netinet/in.h */
 
 #if defined(_MSC_VER) || defined(__MINGW32__)
 #undef EINTR
@@ -233,16 +235,14 @@ typedef struct sockaddr_in SockA;  /* See netinet/in.h */
 #define ECONNRESET           (WSABASEERR+54)
 #define ETIMEDOUT             WSAETIMEDOUT	/* 1997/11/10 (Mon) */
 
-#undef  SOCKET_ERRNO	/* 1997/10/19 (Sun) 18:01:46 */
+#undef  SOCKET_ERRNO		/* 1997/10/19 (Sun) 18:01:46 */
 #define SOCKET_ERRNO          WSAGetLastError()
 
-#endif	/* USE_WINSOCK_H */
+#endif /* USE_WINSOCK_H */
 
 #define INCLUDES_DONE
 #define TCP_INCLUDES_DONE
-#endif  /* WINDOWS */
-
-
+#endif /* WINDOWS */
 
 /*
 
@@ -281,8 +281,8 @@ VAX/VMS
 #define NETWRITE(s,b,l) ((s)>10 ? netwrite((s),(b),(l)) : write((s),(b),(l)))
 #define NETCLOSE(s)     ((s)>10 ? netclose(s) : close(s))
 #undef IOCTL
-#define IOCTL(a,b,c) -1 /* disables ioctl function	      */
-#define NO_IOCTL	/* flag to check if ioctl is disabled */
+#define IOCTL(a,b,c) -1		/* disables ioctl function            */
+#define NO_IOCTL		/* flag to check if ioctl is disabled */
 #endif /* WIN_TCP */
 
 #ifdef CMU_TCP
@@ -303,11 +303,11 @@ VAX/VMS
 #undef IOCTL
 #undef SOCKET_ERRNO
 /*
-**  Delete these socket_foo() prototypes as MultiNet adds them
-**  to it's socket library headers.  Compiler warnings due to
-**  the absence of arguments in the generic prototypes here will
-**  include the names of those which can be deleted. - FM
-*/
+ *  Delete these socket_foo() prototypes as MultiNet adds them
+ *  to it's socket library headers.  Compiler warnings due to
+ *  the absence of arguments in the generic prototypes here will
+ *  include the names of those which can be deleted. - FM
+ */
 extern int socket_read();
 extern int socket_write();
 extern int socket_close();
@@ -347,15 +347,15 @@ extern int socket_ioctl();
 
 #define INCLUDES_DONE
 
-#ifdef MULTINET  /* Include from standard Multinet directories */
+#ifdef MULTINET			/* Include from standard Multinet directories */
 /*
-**  Delete any of these multinet_foo() and associated prototypes
-**  as MultiNet adds them to its socket library headers.  You'll
-**  get compiler warnings about them, due the absence of arguments
-**  in the generic prototyping here, and the warnings will include
-**  the names of the functions whose prototype entries can be
-**  deleted here. - FM
-*/
+ *  Delete any of these multinet_foo() and associated prototypes
+ *  as MultiNet adds them to its socket library headers.  You'll
+ *  get compiler warnings about them, due the absence of arguments
+ *  in the generic prototyping here, and the warnings will include
+ *  the names of the functions whose prototype entries can be
+ *  deleted here. - FM
+ */
 extern int multinet_accept();
 extern int multinet_bind();
 extern int multinet_connect();
@@ -392,7 +392,7 @@ extern char *vms_errno_string();
 #endif /* __TYPE */
 #ifdef __TIME_LOADED
 #undef  __TIME
-#define __TIME 1  /* to avoid double definitions in in.h */
+#define __TIME 1		/* to avoid double definitions in in.h */
 #endif /* __TIME_LOADED */
 #include "multinet_root:[multinet.include.sys]time.h"
 #define MULTINET_NO_PROTOTYPES	/* DECC is compatible-but-different */
@@ -404,9 +404,9 @@ extern char *vms_errno_string();
 #include "multinet_root:[multinet.include.sys]ioctl.h"
 #define TCP_INCLUDES_DONE
 /*
-**  Uncomment this if you get compiler messages
-**  about struct timeval having no linkage. - FM
-*/
+ *  Uncomment this if you get compiler messages
+ *  about struct timeval having no linkage. - FM
+ */
 /*#define NO_TIMEVAL*/
 #ifdef NO_TIMEVAL
 struct timeval {
@@ -416,12 +416,11 @@ struct timeval {
 #endif /* NO_TIMEVAL */
 #endif /* MULTINET */
 
-
 #ifdef DECNET
 #include <types.h>
 #include <errno.h>
 #include <time.h>
-#include <types.h>  /* for socket.h */
+#include <types.h>		/* for socket.h */
 #include <socket.h>
 #include <dn>
 #include <dnetdb>
@@ -429,7 +428,6 @@ struct timeval {
 #define TCP_INCLUDES_DONE
 #endif /* DECNET */
 
-
 #ifdef UCX
 #include <types.h>
 #include <errno.h>
@@ -447,7 +445,6 @@ struct timeval {
 #define TCP_INCLUDES_DONE
 #endif /* UCX */
 
-
 #ifdef CMU_TCP
 #include <types.h>
 #include <errno.h>
@@ -460,7 +457,6 @@ struct timeval {
 #define TCP_INCLUDES_DONE
 #endif /* CMU_TCP */
 
-
 #ifdef SOCKETSHR_TCP
 #include <types.h>
 #include <errno.h>
@@ -494,16 +490,16 @@ struct timeval {
 #include <time.h>
 #ifdef VMS_SOCKET_HEADERS
 /*
-**  Not all versions of VMS have the full set of headers
-**  for socket library functions, because the TCP/IP
-**  packages were layered products.  If we want these
-**  specifically, instead of those for the above packages,
-**  the module should be compiled with VMS_SOCKET_HEADERS
-**  defined instead of layered product definitions, above.
-**  If the module is not using socket library functions,
-**  none of the definitions need be used, and we include
-**  only the above three headers. - FM
-*/
+ *  Not all versions of VMS have the full set of headers
+ *  for socket library functions, because the TCP/IP
+ *  packages were layered products.  If we want these
+ *  specifically, instead of those for the above packages,
+ *  the module should be compiled with VMS_SOCKET_HEADERS
+ *  defined instead of layered product definitions, above.
+ *  If the module is not using socket library functions,
+ *  none of the definitions need be used, and we include
+ *  only the above three headers. - FM
+ */
 #include <socket.h>
 #include <in.h>
 #include <inet.h>
@@ -524,11 +520,11 @@ struct timeval {
 #define GLOBALDEF globaldef
 #define GLOBALREF globalref
 #else
-#ifdef __GNUC__		/* this added by Sterling Bjorndahl */
+#ifdef __GNUC__			/* this added by Sterling Bjorndahl */
 #define GLOBALREF_IS_MACRO 1
 #define GLOBALDEF_IS_MACRO 1
-#include <gnu_hacks.h>	/* defines GLOBALREF and GLOBALDEF for GNUC on VMS */
-#endif  /* __GNUC__ */
+#include <gnu_hacks.h>		/* defines GLOBALREF and GLOBALDEF for GNUC on VMS */
+#endif /* __GNUC__ */
 #endif /* VAXC && !DECC */
 
 #include <perror.h>
@@ -611,8 +607,8 @@ Regular BSD unix versions
 #ifdef HAVE_STRING_H
 #include <string.h>
 #endif /* HAVE_STRING_H */
-#include <errno.h>          /* independent */
-#ifdef __MVS__  /* S/390 -- gil -- 1361 */
+#include <errno.h>		/* independent */
+#ifdef __MVS__			/* S/390 -- gil -- 1361 */
 #include <time.h>
 #endif /* __MVS__ */
 #ifdef SCO
@@ -622,12 +618,12 @@ Regular BSD unix versions
 #if defined(AIX) || defined(SVR4)
 #include <time.h>
 #endif /* AIX || SVR4 */
-#include <sys/time.h>       /* independent */
+#include <sys/time.h>		/* independent */
 #include <sys/stat.h>
-#ifndef __MVS__  /* S/390 -- gil -- 1373 */
+#ifndef __MVS__			/* S/390 -- gil -- 1373 */
 #include <sys/param.h>
 #endif /* __MVS__ */
-#include <sys/file.h>       /* For open() etc */
+#include <sys/file.h>		/* For open() etc */
 
 #if defined(NeXT) || defined(sony_news)
 #ifndef mode_t
@@ -637,7 +633,7 @@ typedef unsigned short mode_t;
 #endif /* NeXT || sony_news */
 
 #define INCLUDES_DONE
-#endif  /* Normal includes */
+#endif /* Normal includes */
 
 /* FIXME: this should be autoconf'd */
 /* Interactive UNIX for i386 and i486 -- Thanks to jeffrey@itm.itm.org */
@@ -655,7 +651,7 @@ typedef unsigned short mode_t;
 #include <sys/pty.h>
 #endif /* !MERGE */
 #ifndef USE_DIRENT
-#define USE_DIRENT     /* sys V style directory open */
+#define USE_DIRENT		/* sys V style directory open */
 #endif /* USE_DIRENT */
 #include <sys/dirent.h>
 #endif /* ISC */
@@ -666,10 +662,10 @@ typedef unsigned short mode_t;
 
 # ifdef HAVE_LIMITS_H
 #  include <limits.h>
-# endif /* HAVE_LIMITS_H */
+# endif				/* HAVE_LIMITS_H */
 # if !defined(MAXINT) && defined(INT_MAX)
 #  define MAXINT INT_MAX
-# endif /* !MAXINT && INT_MAX */
+# endif				/* !MAXINT && INT_MAX */
 
 #else
 
@@ -700,15 +696,15 @@ Defaults
  */
 #ifndef TCP_INCLUDES_DONE
 #ifndef NO_IOCTL
-#include <sys/ioctl.h> /* EJB */
+#include <sys/ioctl.h>		/* EJB */
 #endif /* !NO_IOCTL */
 #include <sys/socket.h>
 #include <netinet/in.h>
 #ifdef HAVE_ARPA_INET_H
-#include <arpa/inet.h>      /* Must be after netinet/in.h */
+#include <arpa/inet.h>		/* Must be after netinet/in.h */
 #endif
 #include <netdb.h>
-#endif  /* TCP includes */
+#endif /* TCP includes */
 
 typedef unsigned short PortNumber;
 
@@ -788,7 +784,7 @@ ROUGH ESTIMATE OF MAX PATH LENGTH
 #ifdef PATH_MAX
 #define HT_MAX_PATH PATH_MAX
 #else
-#define HT_MAX_PATH 1024                        /* Any better ideas? */
+#define HT_MAX_PATH 1024	/* Any better ideas? */
 #endif
 #endif
 #endif /* HT_MAX_PATH */
@@ -804,12 +800,13 @@ ROUGH ESTIMATE OF MAX PATH LENGTH
 #ifdef SELECT
 #ifndef FD_SET
 typedef unsigned int fd_set;
+
 #define FD_SET(fd,pmask) (*(pmask)) |=  (1<<(fd))
 #define FD_CLR(fd,pmask) (*(pmask)) &= ~(1<<(fd))
 #define FD_ZERO(pmask)   (*(pmask))=0
 #define FD_ISSET(fd,pmask) (*(pmask) & (1<<(fd)))
-#endif  /* !FD_SET */
-#endif  /* SELECT */
+#endif /* !FD_SET */
+#endif /* SELECT */
 
 /*
  * Macro for setting errno - only define this if you really can do it.
@@ -817,7 +814,7 @@ typedef unsigned int fd_set;
 #if defined(CAN_SET_ERRNO) || (!defined(errno) && (!defined(VMS) || defined(UCX)))
 #define set_errno(value) errno = value
 #else
-#define set_errno(value) /* we do not know how */
+#define set_errno(value)	/* we do not know how */
 #endif
 
 /* IPv6 support */
@@ -827,9 +824,10 @@ typedef unsigned int fd_set;
 
 #if !defined(__MINGW32__)
 #ifdef INET6
-typedef struct sockaddr_storage SockA;  /* See netinet/in.h */
+typedef struct sockaddr_storage SockA;	/* See netinet/in.h */
+
 #else
-typedef struct sockaddr_in SockA;  /* See netinet/in.h */
+typedef struct sockaddr_in SockA;	/* See netinet/in.h */
 #endif /* INET6 */
 #endif
 
@@ -848,7 +846,7 @@ typedef struct sockaddr_in SockA;  /* See netinet/in.h */
 #endif /* INET6 */
 
 #ifndef MAXHOSTNAMELEN
-#define MAXHOSTNAMELEN 64		/* Arbitrary limit */
+#define MAXHOSTNAMELEN 64	/* Arbitrary limit */
 #endif /* MAXHOSTNAMELEN */
 
 #endif /* TCP_H */