about summary refs log tree commit diff stats
path: root/WWW/Library/Implementation/HTTelnet.c
diff options
context:
space:
mode:
Diffstat (limited to 'WWW/Library/Implementation/HTTelnet.c')
-rw-r--r--WWW/Library/Implementation/HTTelnet.c62
1 files changed, 17 insertions, 45 deletions
diff --git a/WWW/Library/Implementation/HTTelnet.c b/WWW/Library/Implementation/HTTelnet.c
index 3a03eb33..5de48da1 100644
--- a/WWW/Library/Implementation/HTTelnet.c
+++ b/WWW/Library/Implementation/HTTelnet.c
@@ -14,7 +14,7 @@
 */
 
 #include <HTUtils.h>
-#include <tcp.h>
+#include <LYUtils.h>
 
 /* Implements:
 */
@@ -24,8 +24,6 @@
 #include <HTAnchor.h>
 #include <HTTP.h>
 #include <HTFile.h>
-/*#include <errno.h> included by tcp.h -- FM */
-/*#include <stdio.h> included by HTUtils.h -- FM */
 
 #include <HText.h>
 
@@ -34,10 +32,9 @@
 
 #include <userdefs.h>  /* for TELNET_COMMAND and RLOGIN_COMMAND */
 
+#include <LYStrings.h>
 #include <LYLeaks.h>
 
-#define FREE(x) if (x) {free(x); x = NULL;}
-
 #define HT_NO_DATA -9999
 
 
@@ -55,10 +52,6 @@ PRIVATE int remote_session ARGS2(char *, acc_method, char *, host)
 	enum _login_protocol { telnet, rlogin, tn3270 } login_protocol =
 		strcmp(acc_method, "rlogin") == 0 ? rlogin :
 		strcmp(acc_method, "tn3270") == 0 ? tn3270 : telnet;
-#ifdef VMS
-	extern int DCLsystem PARAMS((char *command));
-#define system(a) DCLsystem(a) /* use LYCurses.c routines for spawns */
-#endif /* VMS */
 
 	/*
 	 *	Modified to allow for odd chars in a username only if exists.
@@ -91,8 +84,7 @@ PRIVATE int remote_session ARGS2(char *, acc_method, char *, host)
 	    *port++ = '\0';	/* Split */
 
     if (!hostname || *hostname == '\0') {
-	if (TRACE)
-	    fprintf(stderr, "HTTelnet: No host specified!\n");
+	CTRACE(tfp, "HTTelnet: No host specified!\n");
 	return HT_NO_DATA;
     }
 
@@ -149,8 +141,7 @@ PRIVATE int remote_session ARGS2(char *, acc_method, char *, host)
 		hostname,
 		port ? port : "");
 
-	if (TRACE)
-	    fprintf(stderr, "HTTelnet: Command is: %s\n\n", command);
+	CTRACE(tfp, "HTTelnet: Command is: %s\n\n", command);
 	system(command);
 	return HT_NO_DATA;		/* Ok - it was done but no data */
 #define TELNET_DONE
@@ -176,8 +167,7 @@ PRIVATE int remote_session ARGS2(char *, acc_method, char *, host)
 		port ? port : "");
 	}
 
-	if (TRACE)
-	    fprintf(stderr, "HTTelnet: Normal: Command is: %s\n\n", command);
+	CTRACE(tfp, "HTTelnet: Normal: Command is: %s\n\n", command);
 #ifdef __DJGPP__
        __djgpp_set_ctrl_c(0);
        _go32_want_ctrl_break(1);
@@ -216,8 +206,7 @@ PRIVATE int remote_session ARGS2(char *, acc_method, char *, host)
 		hostname);
 	}
 
-	if (TRACE)
-	    fprintf(stderr, "HTTelnet: Command is: %s\n\n", command);
+	CTRACE(tfp, "HTTelnet: Command is: %s\n\n", command);
 	system(command);
 	return HT_NO_DATA;		/* Ok - it was done but no data */
 #define TELNET_DONE
@@ -272,8 +261,7 @@ PRIVATE int remote_session ARGS2(char *, acc_method, char *, host)
 		}
 	    }
 
-	    if (TRACE)
-		fprintf(stderr, "HTTelnet: Command is: %s\n\n", command);
+	    CTRACE(tfp, "HTTelnet: Command is: %s\n\n", command);
 	    system(command);
 	    return HT_NO_DATA;		/* Ok - it was done but no data */
 	}
@@ -300,8 +288,7 @@ PRIVATE int remote_session ARGS2(char *, acc_method, char *, host)
 		port ? port : "");
 	}
 
-	if (TRACE)
-	    fprintf(stderr, "HTTelnet: Command is: %s\n\n", command);
+	CTRACE(tfp, "HTTelnet: Command is: %s\n\n", command);
 	system(command);
 	return HT_NO_DATA;		/* Ok - it was done but no data */
 #define TELNET_DONE
@@ -313,12 +300,10 @@ PRIVATE int remote_session ARGS2(char *, acc_method, char *, host)
 		port ? "/PORT=" : "",
 		port ? port : "",
 		hostname);
-	    if (TRACE)
-		fprintf(stderr, "HTTelnet: Command is: %s\n\n", command);
+	    CTRACE(tfp, "HTTelnet: Command is: %s\n\n", command);
 	    system(command);
 	}
 	else {
-	    extern int LYgetch NOPARAMS;
 	    extern BOOLEAN HadVMSInterrupt;
 
 	    printf(
@@ -358,8 +343,7 @@ PRIVATE int remote_session ARGS2(char *, acc_method, char *, host)
 		hostname);
 	}
 
-	if (TRACE)
-	    fprintf(stderr, "HTTelnet: Command is: %s\n\n", command);
+	CTRACE(tfp, "HTTelnet: Command is: %s\n\n", command);
 	system(command);
 	return HT_NO_DATA;		/* Ok - it was done but no data */
     }
@@ -400,8 +384,7 @@ PRIVATE int remote_session ARGS2(char *, acc_method, char *, host)
 	    }
 	}
 
-	if (TRACE)
-	    fprintf(stderr, "HTTelnet: Command is: %s\n\n", command);
+	CTRACE(tfp, "HTTelnet: Command is: %s\n\n", command);
 	system(command);
 	return HT_NO_DATA;		/* Ok - it was done but no data */
     }
@@ -424,8 +407,7 @@ PRIVATE int remote_session ARGS2(char *, acc_method, char *, host)
 		port ? port : "");
 	}
 
-	if (TRACE)
-	    fprintf(stderr, "HTTelnet: Command is: %s\n\n", command);
+	CTRACE(tfp, "HTTelnet: Command is: %s\n\n", command);
 	system(command);
 	return HT_NO_DATA;		/* Ok - it was done but no data */
     }
@@ -435,12 +417,10 @@ PRIVATE int remote_session ARGS2(char *, acc_method, char *, host)
 		port ? "/PORT=" : "",
 		port ? port : "",
 		hostname);
-	    if (TRACE)
-		fprintf(stderr, "HTTelnet: Command is: %s\n\n", command);
+	    CTRACE(tfp, "HTTelnet: Command is: %s\n\n", command);
 	    system(command);
 	}
 	else {
-	    extern int LYgetch NOPARAMS;
 	    extern BOOLEAN HadVMSInterrupt;
 
 	    printf(
@@ -458,12 +438,10 @@ PRIVATE int remote_session ARGS2(char *, acc_method, char *, host)
 		port ? "/PORT=" : "",
 		port ? port : "",
 		hostname);
-	    if (TRACE)
-		fprintf(stderr, "HTTelnet: Command is: %s\n\n", command);
+	    CTRACE(tfp, "HTTelnet: Command is: %s\n\n", command);
 	    system(command);
 	}
 	else {
-	    extern int LYgetch NOPARAMS;
 	    extern BOOLEAN HadVMSInterrupt;
 
 	    printf(
@@ -486,8 +464,7 @@ PRIVATE int remote_session ARGS2(char *, acc_method, char *, host)
 	if (login_protocol == telnet) { 		/* telnet only */
 	    sprintf(command, "TELNET  %s",	/* @@ Bug: port ignored */
 		hostname);
-	    if (TRACE)
-		fprintf(stderr, "HTTelnet: Command is: %s\n\n", command);
+	    CTRACE(tfp, "HTTelnet: Command is: %s\n\n", command);
 	    system(command);
 	    return HT_NO_DATA;		/* Ok - it was done but no data */
 	}
@@ -505,8 +482,6 @@ PRIVATE int remote_session ARGS2(char *, acc_method, char *, host)
 	    printf("\nlogging in with username %s", user);
 	printf(".\n");
 	{
-	    extern int LYgetch NOPARAMS;
-
 	    printf("\nPress <return> to return to Lynx.");
 	    fflush(stdout);
 	    LYgetch();
@@ -549,9 +524,7 @@ ARGS4
     int status;
 
     if (sink) {
-	if (TRACE)
-	    fprintf(stderr,
-	   "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, "file:", PARSE_ACCESS);
@@ -559,8 +532,7 @@ ARGS4
     host = HTParse(addr, "", PARSE_HOST);
     if (!host || *host == '\0') {
 	status = HT_NO_DATA;
-	if (TRACE)
-	    fprintf(stderr, "HTTelnet: No host specified!\n");
+	CTRACE(tfp, "HTTelnet: No host specified!\n");
     } else {
 	status = remote_session(acc_method, host);
     }