2004-05-30 01:45:25 +02:00
|
|
|
|
--- work/ztelnet/telnet/commands.c.orig Wed Sep 20 02:03:45 1995
|
|
|
|
|
+++ work/ztelnet/telnet/commands.c Sun May 30 01:37:06 2004
|
|
|
|
|
@@ -40,7 +40,7 @@
|
|
|
|
|
#include <netdb.h>
|
|
|
|
|
#include <ctype.h>
|
|
|
|
|
#include <pwd.h>
|
|
|
|
|
-#include <varargs.h>
|
|
|
|
|
+#include <stdarg.h>
|
|
|
|
|
#include <errno.h>
|
|
|
|
|
|
|
|
|
|
#include <arpa/telnet.h>
|
|
|
|
|
@@ -79,8 +79,6 @@
|
|
|
|
|
extern char **genget();
|
|
|
|
|
extern int Ambiguous();
|
|
|
|
|
|
|
|
|
|
-static call();
|
|
|
|
|
-
|
|
|
|
|
typedef struct {
|
|
|
|
|
char *name; /* command name */
|
|
|
|
|
char *help; /* help string (NULL for no help) */
|
|
|
|
|
@@ -93,6 +91,10 @@
|
2000-06-20 16:27:33 +02:00
|
|
|
|
static int margc;
|
|
|
|
|
static char *margv[20];
|
|
|
|
|
|
|
|
|
|
+ void send_wont();
|
|
|
|
|
+ void send_dont();
|
|
|
|
|
+ void send_will();
|
|
|
|
|
+ void send_do();
|
|
|
|
|
static void
|
|
|
|
|
makeargv()
|
|
|
|
|
{
|
2004-05-30 01:45:25 +02:00
|
|
|
|
@@ -230,10 +232,8 @@
|
2000-06-20 16:27:33 +02:00
|
|
|
|
int nbyte; /* Number of bytes to send this command */
|
|
|
|
|
int what; /* Character to be sent (<0 ==> special) */
|
|
|
|
|
};
|
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
-/* PMS
|
|
|
|
|
-extern int
|
|
|
|
|
-*/
|
|
|
|
|
static int
|
|
|
|
|
send_esc P((void)),
|
|
|
|
|
send_help P((void)),
|
2004-05-30 01:45:25 +02:00
|
|
|
|
@@ -370,7 +370,6 @@
|
2000-06-20 16:27:33 +02:00
|
|
|
|
send_docmd(name)
|
|
|
|
|
char *name;
|
|
|
|
|
{
|
|
|
|
|
- void send_do();
|
|
|
|
|
return(send_tncmd(send_do, "do", name));
|
|
|
|
|
}
|
|
|
|
|
|
2004-05-30 01:45:25 +02:00
|
|
|
|
@@ -378,21 +377,18 @@
|
2000-06-20 16:27:33 +02:00
|
|
|
|
send_dontcmd(name)
|
|
|
|
|
char *name;
|
|
|
|
|
{
|
|
|
|
|
- void send_dont();
|
|
|
|
|
return(send_tncmd(send_dont, "dont", name));
|
|
|
|
|
}
|
|
|
|
|
static int
|
|
|
|
|
send_willcmd(name)
|
|
|
|
|
char *name;
|
|
|
|
|
{
|
|
|
|
|
- void send_will();
|
|
|
|
|
return(send_tncmd(send_will, "will", name));
|
|
|
|
|
}
|
|
|
|
|
static int
|
|
|
|
|
send_wontcmd(name)
|
|
|
|
|
char *name;
|
|
|
|
|
{
|
|
|
|
|
- void send_wont();
|
|
|
|
|
return(send_tncmd(send_wont, "wont", name));
|
|
|
|
|
}
|
|
|
|
|
|
2004-05-30 01:45:25 +02:00
|
|
|
|
@@ -590,11 +586,8 @@
|
2000-06-20 16:27:33 +02:00
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
-/* PMS
|
|
|
|
|
-extern int togglehelp P((void));
|
|
|
|
|
-*/
|
|
|
|
|
-static int togglehelp P((void));
|
|
|
|
|
|
|
|
|
|
+static int togglehelp P((void));
|
|
|
|
|
#if defined(AUTHENTICATE)
|
|
|
|
|
extern int auth_togdebug P((int));
|
1998-03-18 19:53:00 +01:00
|
|
|
|
#endif
|
2004-05-30 01:45:25 +02:00
|
|
|
|
@@ -828,12 +821,8 @@
|
2000-06-20 16:27:33 +02:00
|
|
|
|
*/
|
|
|
|
|
|
1998-03-18 19:53:00 +01:00
|
|
|
|
#ifdef USE_TERMIO
|
2000-06-20 16:27:33 +02:00
|
|
|
|
-#ifdef BYPMS
|
|
|
|
|
-struct termios new_tc = { 0 };
|
|
|
|
|
-#else
|
|
|
|
|
struct termio new_tc = { 0 };
|
1998-03-18 19:53:00 +01:00
|
|
|
|
#endif
|
2000-06-20 16:27:33 +02:00
|
|
|
|
-#endif
|
1998-03-18 19:53:00 +01:00
|
|
|
|
|
2000-06-20 16:27:33 +02:00
|
|
|
|
struct setlist {
|
|
|
|
|
char *name; /* name */
|
2004-05-30 01:45:25 +02:00
|
|
|
|
@@ -1559,9 +1548,6 @@
|
2000-06-20 16:27:33 +02:00
|
|
|
|
int arg;
|
|
|
|
|
};
|
1998-03-18 19:53:00 +01:00
|
|
|
|
|
2000-06-20 16:27:33 +02:00
|
|
|
|
-/* PMS
|
|
|
|
|
-extern void slc_help();
|
|
|
|
|
-*/
|
|
|
|
|
static void slc_help();
|
|
|
|
|
|
|
|
|
|
struct slclist SlcList[] = {
|
2004-05-30 01:45:25 +02:00
|
|
|
|
@@ -1640,15 +1626,13 @@
|
2000-06-20 16:27:33 +02:00
|
|
|
|
|
|
|
|
|
extern struct env_lst *
|
|
|
|
|
env_define P((unsigned char *, unsigned char *));
|
|
|
|
|
-extern void
|
|
|
|
|
+static void
|
|
|
|
|
env_undefine P((unsigned char *)),
|
|
|
|
|
env_export P((unsigned char *)),
|
|
|
|
|
env_unexport P((unsigned char *)),
|
|
|
|
|
env_send P((unsigned char *)),
|
|
|
|
|
- env_list P((void));
|
|
|
|
|
-
|
|
|
|
|
-/* PMS: extern is replaced by static */
|
|
|
|
|
-static void env_help P((void));
|
|
|
|
|
+ env_list P((void)),
|
|
|
|
|
+ env_help P((void));
|
|
|
|
|
|
|
|
|
|
struct envlist EnvList[] = {
|
|
|
|
|
{ "define", "Define an environment variable",
|
2004-05-30 01:45:25 +02:00
|
|
|
|
@@ -2232,7 +2216,7 @@
|
2000-06-20 16:27:33 +02:00
|
|
|
|
register struct hostent *host = 0;
|
|
|
|
|
struct sockaddr_in sin;
|
|
|
|
|
struct servent *sp = 0;
|
|
|
|
|
- unsigned long temp, inet_addr();
|
|
|
|
|
+ unsigned long temp;/*, inet_addr();*/
|
|
|
|
|
extern char *inet_ntoa();
|
|
|
|
|
#if defined(IP_OPTIONS) && defined(IPPROTO_IP)
|
|
|
|
|
char *srp = 0, *strrchr();
|
2004-05-30 01:45:25 +02:00
|
|
|
|
@@ -2489,11 +2473,7 @@
|
2000-06-20 16:27:33 +02:00
|
|
|
|
envhelp[] = "change environment variables ('environ ?' for more)",
|
|
|
|
|
modestring[] = "try to enter line or character mode ('mode ?' for more)";
|
|
|
|
|
|
|
|
|
|
-/* PMS
|
|
|
|
|
-extern int help();
|
|
|
|
|
-*/
|
|
|
|
|
-
|
|
|
|
|
-static int help();
|
|
|
|
|
+static int help();
|
1998-03-18 19:53:00 +01:00
|
|
|
|
|
2000-06-20 16:27:33 +02:00
|
|
|
|
static Command cmdtab[] = {
|
|
|
|
|
{ "close", closehelp, bye, 1 },
|
2004-05-30 01:45:25 +02:00
|
|
|
|
@@ -2548,18 +2528,14 @@
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/*VARARGS1*/
|
|
|
|
|
- static
|
|
|
|
|
-call(va_alist)
|
|
|
|
|
- va_dcl
|
|
|
|
|
+typedef int (*intrtn_t)();
|
|
|
|
|
+static call(intrtn_t routine, ...)
|
|
|
|
|
{
|
|
|
|
|
va_list ap;
|
|
|
|
|
- typedef int (*intrtn_t)();
|
|
|
|
|
- intrtn_t routine;
|
|
|
|
|
char *args[100];
|
|
|
|
|
int argno = 0;
|
|
|
|
|
|
|
|
|
|
- va_start(ap);
|
|
|
|
|
- routine = (va_arg(ap, intrtn_t));
|
|
|
|
|
+ va_start(ap, routine);
|
|
|
|
|
while ((args[argno++] = va_arg(ap, char *)) != 0) {
|
|
|
|
|
;
|
|
|
|
|
}
|