Damn. The previous mega-commit was incomplete WRT ANSIfication. This

fixes that.


git-svn-id: http://svn0.us-east.freebsd.org/base/head/contrib/telnet@87155 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
This commit is contained in:
markm 2001-11-30 22:28:07 +00:00
parent a033672a04
commit a88d48b9df
13 changed files with 249 additions and 280 deletions

View File

@ -54,14 +54,6 @@
* or implied warranty. * or implied warranty.
*/ */
#if !defined(P)
#ifdef __STDC__
#define P(x) x
#else
#define P(x) ()
#endif
#endif
#ifdef AUTHENTICATION #ifdef AUTHENTICATION
Authenticator *findauthenticator(int, int); Authenticator *findauthenticator(int, int);

View File

@ -53,13 +53,6 @@
* this software for any purpose. It is provided "as is" without express * this software for any purpose. It is provided "as is" without express
* or implied warranty. * or implied warranty.
*/ */
#if !defined(P)
#ifdef __STDC__
#define P(x) x
#else
#define P(x) ()
#endif
#endif
#ifdef ENCRYPTION #ifdef ENCRYPTION
void encrypt_init(const char *, int); void encrypt_init(const char *, int);

View File

@ -116,14 +116,14 @@ struct keyidlist {
#define FB64_IV_BAD 3 #define FB64_IV_BAD 3
void fb64_stream_iv P((Block, struct stinfo *)); void fb64_stream_iv(Block, struct stinfo *);
void fb64_init P((struct fb *)); void fb64_init(struct fb *);
static int fb64_start P((struct fb *, int, int)); static int fb64_start(struct fb *, int, int);
int fb64_is P((unsigned char *, int, struct fb *)); int fb64_is(unsigned char *, int, struct fb *);
int fb64_reply P((unsigned char *, int, struct fb *)); int fb64_reply(unsigned char *, int, struct fb *);
static void fb64_session P((Session_Key *, int, struct fb *)); static void fb64_session(Session_Key *, int, struct fb *);
void fb64_stream_key P((Block, struct stinfo *)); void fb64_stream_key(Block, struct stinfo *);
int fb64_keyid P((int, unsigned char *, int *, struct fb *)); int fb64_keyid(int, unsigned char *, int *, struct fb *);
void void
cfb64_init(int server __unused) cfb64_init(int server __unused)

View File

@ -76,8 +76,8 @@ static const char sccsid[] = "@(#)encrypt.c 8.2 (Berkeley) 5/30/95";
* These functions pointers point to the current routines * These functions pointers point to the current routines
* for encrypting and decrypting data. * for encrypting and decrypting data.
*/ */
void (*encrypt_output) P((unsigned char *, int)); void (*encrypt_output)(unsigned char *, int);
int (*decrypt_input) P((int)); int (*decrypt_input)(int);
int EncryptType(char *type, char *mode); int EncryptType(char *type, char *mode);
int EncryptStart(char *mode); int EncryptStart(char *mode);

View File

@ -72,8 +72,8 @@ static const char sccsid[] = "@(#)kerberos.c 8.3 (Berkeley) 5/30/95";
#include "auth.h" #include "auth.h"
#include "misc.h" #include "misc.h"
int kerberos4_cksum P((unsigned char *, int)); int kerberos4_cksum(unsigned char *, int);
int kuserok P((AUTH_DAT *, char *)); int kuserok(AUTH_DAT *, char *);
extern int auth_debug_mode; extern int auth_debug_mode;

View File

@ -87,8 +87,8 @@ static char sccsid[] = "@(#)krb4encpwd.c 8.3 (Berkeley) 5/30/95";
#include "auth.h" #include "auth.h"
#include "misc.h" #include "misc.h"
int krb_mk_encpwd_req P((KTEXT, char *, char *, char *, char *, char *, char *)); int krb_mk_encpwd_req(KTEXT, char *, char *, char *, char *, char *, char *);
int krb_rd_encpwd_req P((KTEXT, char *, char *, u_long, AUTH_DAT *, char *, char *, char *, char *)); int krb_rd_encpwd_req(KTEXT, char *, char *, u_long, AUTH_DAT *, char *, char *, char *, char *);
extern auth_debug_mode; extern auth_debug_mode;

View File

@ -57,14 +57,6 @@
#ifndef __MISC_PROTO__ #ifndef __MISC_PROTO__
#define __MISC_PROTO__ #define __MISC_PROTO__
#if !defined(P)
#ifdef __STDC__
#define P(x) x
#else
#define P(x) ()
#endif
#endif
void auth_encrypt_init(char *, char *, const char *, int); void auth_encrypt_init(char *, char *, const char *, int);
void auth_encrypt_connect(int); void auth_encrypt_connect(int);
void printd(const unsigned char *, int); void printd(const unsigned char *, int);

View File

@ -86,13 +86,13 @@ static const char sccsid[] = "@(#)commands.c 8.4 (Berkeley) 5/30/95";
typedef int (*intrtn_t)(int, char **); typedef int (*intrtn_t)(int, char **);
#ifdef AUTHENTICATION #ifdef AUTHENTICATION
extern int auth_togdebug P((int)); extern int auth_togdebug(int);
#endif #endif
#ifdef ENCRYPTION #ifdef ENCRYPTION
extern int EncryptAutoEnc P((int)); extern int EncryptAutoEnc(int);
extern int EncryptAutoDec P((int)); extern int EncryptAutoDec(int);
extern int EncryptDebug P((int)); extern int EncryptDebug(int);
extern int EncryptVerbose P((int)); extern int EncryptVerbose(int);
#endif /* ENCRYPTION */ #endif /* ENCRYPTION */
#if defined(IPPROTO_IP) && defined(IP_TOS) #if defined(IPPROTO_IP) && defined(IP_TOS)
int tos = -1; int tos = -1;
@ -289,12 +289,12 @@ struct sendlist {
static int static int
send_esc P((void)), send_esc(void),
send_help P((void)), send_help(void),
send_docmd P((char *)), send_docmd(char *),
send_dontcmd P((char *)), send_dontcmd(char *),
send_willcmd P((char *)), send_willcmd(char *),
send_wontcmd P((char *)); send_wontcmd(char *);
static struct sendlist Sendlist[] = { static struct sendlist Sendlist[] = {
{ "ao", "Send Telnet Abort output", 1, 0, NULL, 2, AO }, { "ao", "Send Telnet Abort output", 1, 0, NULL, 2, AO },
@ -1514,18 +1514,18 @@ struct envlist {
}; };
extern struct env_lst * extern struct env_lst *
env_define P((const unsigned char *, unsigned char *)); env_define(const unsigned char *, unsigned char *);
extern void extern void
env_undefine P((unsigned char *)), env_undefine(unsigned char *),
env_export P((const unsigned char *)), env_export(const unsigned char *),
env_unexport P((const unsigned char *)), env_unexport(const unsigned char *),
env_send P((unsigned char *)), env_send(unsigned char *),
#if defined(OLD_ENVIRON) && defined(ENV_HACK) #if defined(OLD_ENVIRON) && defined(ENV_HACK)
env_varval P((unsigned char *)), env_varval(unsigned char *),
#endif #endif
env_list P((void)); env_list(void);
static void static void
env_help P((void)); env_help(void);
struct envlist EnvList[] = { struct envlist EnvList[] = {
{ "define", "Define an environment variable", { "define", "Define an environment variable",
@ -1847,11 +1847,11 @@ struct authlist {
}; };
extern int extern int
auth_enable P((char *)), auth_enable(char *),
auth_disable P((char *)), auth_disable(char *),
auth_status P((void)); auth_status(void);
static int static int
auth_help P((void)); auth_help(void);
struct authlist AuthList[] = { struct authlist AuthList[] = {
{ "status", "Display current status of authentication information", { "status", "Display current status of authentication information",
@ -1930,18 +1930,18 @@ struct encryptlist {
}; };
extern int extern int
EncryptEnable P((char *, char *)), EncryptEnable(char *, char *),
EncryptDisable P((char *, char *)), EncryptDisable(char *, char *),
EncryptType P((char *, char *)), EncryptType(char *, char *),
EncryptStart P((char *)), EncryptStart(char *),
EncryptStartInput P((void)), EncryptStartInput(void),
EncryptStartOutput P((void)), EncryptStartOutput(void),
EncryptStop P((char *)), EncryptStop(char *),
EncryptStopInput P((void)), EncryptStopInput(void),
EncryptStopOutput P((void)), EncryptStopOutput(void),
EncryptStatus P((void)); EncryptStatus(void);
static int static int
EncryptHelp P((void)); EncryptHelp(void);
struct encryptlist EncryptList[] = { struct encryptlist EncryptList[] = {
{ "enable", "Enable encryption. ('encrypt enable ?' for more)", { "enable", "Enable encryption. ('encrypt enable ?' for more)",

View File

@ -148,8 +148,8 @@ extern char
options[], /* All the little options */ options[], /* All the little options */
*hostname; /* Who are we connected to? */ *hostname; /* Who are we connected to? */
#ifdef ENCRYPTION #ifdef ENCRYPTION
extern void (*encrypt_output) P((unsigned char *, int)); extern void (*encrypt_output)(unsigned char *, int);
extern int (*decrypt_input) P((int)); extern int (*decrypt_input)(int);
#endif /* ENCRYPTION */ #endif /* ENCRYPTION */
/* /*
@ -222,7 +222,7 @@ extern int (*decrypt_input) P((int));
#ifdef SIGINFO #ifdef SIGINFO
extern SIG_FUNC_RET extern SIG_FUNC_RET
ayt_status P((void)); ayt_status(void);
#endif #endif
extern FILE extern FILE
@ -230,113 +230,113 @@ extern FILE
extern unsigned char extern unsigned char
NetTraceFile[]; /* Name of file where debugging output goes */ NetTraceFile[]; /* Name of file where debugging output goes */
extern void extern void
SetNetTrace P((char *)); /* Function to change where debugging goes */ SetNetTrace(char *); /* Function to change where debugging goes */
extern jmp_buf extern jmp_buf
peerdied, peerdied,
toplevel; /* For error conditions. */ toplevel; /* For error conditions. */
extern void extern void
command P((int, const char *, int)), command(int, const char *, int),
Dump P((char, unsigned char *, int)), Dump(char, unsigned char *, int),
env_init P((void)), env_init(void),
Exit P((int)), Exit(int),
ExitString P((const char *, int)), ExitString(const char *, int),
init_network P((void)), init_network(void),
init_sys P((void)), init_sys(void),
init_telnet P((void)), init_telnet(void),
init_terminal P((void)), init_terminal(void),
intp P((void)), intp(void),
optionstatus P((void)), optionstatus(void),
printoption P((const char *, int, int)), printoption(const char *, int, int),
printsub P((char, unsigned char *, int)), printsub(char, unsigned char *, int),
quit P((void)), quit(void),
sendabort P((void)), sendabort(void),
sendbrk P((void)), sendbrk(void),
sendeof P((void)), sendeof(void),
sendsusp P((void)), sendsusp(void),
sendnaws P((void)), sendnaws(void),
sendayt P((void)), sendayt(void),
setconnmode P((int)), setconnmode(int),
setcommandmode P((void)), setcommandmode(void),
set_escape_char P((char *s)), set_escape_char(char *s),
setneturg P((void)), setneturg(void),
sys_telnet_init P((void)), sys_telnet_init(void),
telnet P((char *)), telnet(char *),
tel_enter_binary P((int)), tel_enter_binary(int),
tel_leave_binary P((int)), tel_leave_binary(int),
TerminalFlushOutput P((void)), TerminalFlushOutput(void),
TerminalNewMode P((int)), TerminalNewMode(int),
TerminalRestoreState P((void)), TerminalRestoreState(void),
TerminalSaveState P((void)), TerminalSaveState(void),
TerminalDefaultChars P((void)), TerminalDefaultChars(void),
TerminalSpeeds P((long *, long *)), TerminalSpeeds(long *, long *),
tninit P((void)), tninit(void),
upcase P((char *)), upcase(char *),
willoption P((int)), willoption(int),
wontoption P((int)); wontoption(int);
extern void extern void
send_do P((int, int)), send_do(int, int),
send_dont P((int, int)), send_dont(int, int),
send_will P((int, int)), send_will(int, int),
send_wont P((int, int)); send_wont(int, int);
extern void extern void
lm_will P((unsigned char *, int)), lm_will(unsigned char *, int),
lm_wont P((unsigned char *, int)), lm_wont(unsigned char *, int),
lm_do P((unsigned char *, int)), lm_do(unsigned char *, int),
lm_dont P((unsigned char *, int)), lm_dont(unsigned char *, int),
lm_mode P((unsigned char *, int, int)); lm_mode(unsigned char *, int, int);
extern void extern void
slc_init P((void)), slc_init(void),
slcstate P((void)), slcstate(void),
slc_mode_export P((void)), slc_mode_export(void),
slc_mode_import P((int)), slc_mode_import(int),
slc_import P((int)), slc_import(int),
slc_export P((void)), slc_export(void),
slc P((unsigned char *, int)), slc(unsigned char *, int),
slc_check P((void)), slc_check(void),
slc_start_reply P((void)), slc_start_reply(void),
slc_add_reply P((unsigned char, unsigned char, cc_t)), slc_add_reply(unsigned char, unsigned char, cc_t),
slc_end_reply P((void)); slc_end_reply(void);
extern int extern int
getconnmode P((void)), getconnmode(void),
opt_welldefined P((const char *)), opt_welldefined(const char *),
NetClose P((int)), NetClose(int),
netflush P((void)), netflush(void),
process_rings P((int, int, int, int, int, int)), process_rings(int, int, int, int, int, int),
rlogin_susp P((void)), rlogin_susp(void),
SetSockOpt P((int, int, int, int)), SetSockOpt(int, int, int, int),
slc_update P((void)), slc_update(void),
stilloob P((void)), stilloob(void),
telrcv P((void)), telrcv(void),
TerminalRead P((char *, int)), TerminalRead(char *, int),
TerminalWrite P((char *, int)), TerminalWrite(char *, int),
TerminalAutoFlush P((void)), TerminalAutoFlush(void),
TerminalWindowSize P((long *, long *)), TerminalWindowSize(long *, long *),
TerminalSpecialChars P((int)), TerminalSpecialChars(int),
tn P((int, char **)), tn(int, char **),
ttyflush P((int)); ttyflush(int);
extern void extern void
env_opt P((unsigned char *, int)), env_opt(unsigned char *, int),
env_opt_start P((void)), env_opt_start(void),
env_opt_start_info P((void)), env_opt_start_info(void),
env_opt_add P((unsigned char *)), env_opt_add(unsigned char *),
env_opt_end P((int)); env_opt_end(int);
extern unsigned char extern unsigned char
*env_default P((int, int)), *env_default(int, int),
*env_getvalue P((const unsigned char *)); *env_getvalue(const unsigned char *);
extern int extern int
get_status P((char *)), get_status(char *),
dosynch P((char *)); dosynch(char *);
extern cc_t extern cc_t
*tcval P((int)); *tcval(int);
#ifndef USE_TERMIO #ifndef USE_TERMIO
@ -486,6 +486,6 @@ extern Ring
ttyiring; ttyiring;
extern void extern void
xmitAO P((void)), xmitAO(void),
xmitEC P((void)), xmitEC(void),
xmitEL P((void)); xmitEL(void);

View File

@ -73,35 +73,35 @@ typedef struct {
/* Initialization routine */ /* Initialization routine */
extern int extern int
ring_init P((Ring *ring, unsigned char *buffer, int count)); ring_init(Ring *ring, unsigned char *buffer, int count);
/* Data movement routines */ /* Data movement routines */
extern void extern void
ring_supply_data P((Ring *ring, unsigned char *buffer, int count)); ring_supply_data(Ring *ring, unsigned char *buffer, int count);
#ifdef notdef #ifdef notdef
extern void extern void
ring_consume_data P((Ring *ring, unsigned char *buffer, int count)); ring_consume_data(Ring *ring, unsigned char *buffer, int count);
#endif #endif
/* Buffer state transition routines */ /* Buffer state transition routines */
extern void extern void
ring_supplied P((Ring *ring, int count)), ring_supplied(Ring *ring, int count),
ring_consumed P((Ring *ring, int count)); ring_consumed(Ring *ring, int count);
/* Buffer state query routines */ /* Buffer state query routines */
extern int extern int
ring_at_mark P((Ring *)), ring_at_mark(Ring *),
ring_empty_count P((Ring *ring)), ring_empty_count(Ring *ring),
ring_empty_consecutive P((Ring *ring)), ring_empty_consecutive(Ring *ring),
ring_full_count P((Ring *ring)), ring_full_count(Ring *ring),
ring_full_consecutive P((Ring *ring)); ring_full_consecutive(Ring *ring);
#ifdef ENCRYPTION #ifdef ENCRYPTION
extern void extern void
ring_encrypt P((Ring *ring, void (*func)(unsigned char *, int))), ring_encrypt(Ring *ring, void (*func)(unsigned char *, int)),
ring_clearto P((Ring *ring)); ring_clearto(Ring *ring);
#endif /* ENCRYPTION */ #endif /* ENCRYPTION */
extern void extern void
ring_clear_mark P((Ring *)), ring_clear_mark(Ring *),
ring_mark P((Ring *)); ring_mark(Ring *);

View File

@ -80,115 +80,107 @@ extern int pty, net;
extern char line[16]; extern char line[16];
extern int SYNCHing; /* we are in TELNET SYNCH mode */ extern int SYNCHing; /* we are in TELNET SYNCH mode */
#ifndef P
# ifdef __STDC__
# define P(x) x
# else
# define P(x) ()
# endif
#endif
extern void extern void
_termstat P((void)), _termstat(void),
add_slc P((char, char, cc_t)), add_slc(char, char, cc_t),
check_slc P((void)), check_slc(void),
change_slc P((char, char, cc_t)), change_slc(char, char, cc_t),
cleanup P((int)), cleanup(int),
clientstat P((int, int, int)), clientstat(int, int, int),
copy_termbuf P((char *, size_t)), copy_termbuf(char *, size_t),
deferslc P((void)), deferslc(void),
defer_terminit P((void)), defer_terminit(void),
do_opt_slc P((unsigned char *, int)), do_opt_slc(unsigned char *, int),
doeof P((void)), doeof(void),
dooption P((int)), dooption(int),
dontoption P((int)), dontoption(int),
edithost P((char *, char *)), edithost(char *, char *),
fatal P((int, const char *)), fatal(int, const char *),
fatalperror P((int, const char *)), fatalperror(int, const char *),
get_slc_defaults P((void)), get_slc_defaults(void),
init_env P((void)), init_env(void),
init_termbuf P((void)), init_termbuf(void),
interrupt P((void)), interrupt(void),
localstat P((void)), localstat(void),
flowstat P((void)), flowstat(void),
netclear P((void)), netclear(void),
netflush P((void)), netflush(void),
#ifdef DIAGNOSTICS #ifdef DIAGNOSTICS
printoption P((const char *, int)), printoption(const char *, int),
printdata P((const char *, char *, int)), printdata(const char *, char *, int),
printsub P((char, unsigned char *, int)), printsub(char, unsigned char *, int),
#endif #endif
process_slc P((unsigned char, unsigned char, cc_t)), process_slc(unsigned char, unsigned char, cc_t),
ptyflush P((void)), ptyflush(void),
putchr P((int)), putchr(int),
putf P((char *, char *)), putf(char *, char *),
recv_ayt P((void)), recv_ayt(void),
send_do P((int, int)), send_do(int, int),
send_dont P((int, int)), send_dont(int, int),
send_slc P((void)), send_slc(void),
send_status P((void)), send_status(void),
send_will P((int, int)), send_will(int, int),
send_wont P((int, int)), send_wont(int, int),
sendbrk P((void)), sendbrk(void),
sendsusp P((void)), sendsusp(void),
set_termbuf P((void)), set_termbuf(void),
start_login P((char *, int, char *)), start_login(char *, int, char *),
start_slc P((int)), start_slc(int),
#ifdef AUTHENTICATION #ifdef AUTHENTICATION
start_slave P((char *)), start_slave(char *),
#else #else
start_slave P((char *, int, char *)), start_slave(char *, int, char *),
#endif #endif
suboption P((void)), suboption(void),
telrcv P((void)), telrcv(void),
ttloop P((void)), ttloop(void),
tty_binaryin P((int)), tty_binaryin(int),
tty_binaryout P((int)); tty_binaryout(int);
extern int extern int
end_slc P((unsigned char **)), end_slc(unsigned char **),
getnpty P((void)), getnpty(void),
#ifndef convex #ifndef convex
getpty P((int *)), getpty(int *),
#endif #endif
login_tty P((int)), login_tty(int),
spcset P((int, cc_t *, cc_t **)), spcset(int, cc_t *, cc_t **),
stilloob P((int)), stilloob(int),
terminit P((void)), terminit(void),
termstat P((void)), termstat(void),
tty_flowmode P((void)), tty_flowmode(void),
tty_restartany P((void)), tty_restartany(void),
tty_isbinaryin P((void)), tty_isbinaryin(void),
tty_isbinaryout P((void)), tty_isbinaryout(void),
tty_iscrnl P((void)), tty_iscrnl(void),
tty_isecho P((void)), tty_isecho(void),
tty_isediting P((void)), tty_isediting(void),
tty_islitecho P((void)), tty_islitecho(void),
tty_isnewmap P((void)), tty_isnewmap(void),
tty_israw P((void)), tty_israw(void),
tty_issofttab P((void)), tty_issofttab(void),
tty_istrapsig P((void)), tty_istrapsig(void),
tty_linemode P((void)); tty_linemode(void);
extern void extern void
tty_rspeed P((int)), tty_rspeed(int),
tty_setecho P((int)), tty_setecho(int),
tty_setedit P((int)), tty_setedit(int),
tty_setlinemode P((int)), tty_setlinemode(int),
tty_setlitecho P((int)), tty_setlitecho(int),
tty_setsig P((int)), tty_setsig(int),
tty_setsofttab P((int)), tty_setsofttab(int),
tty_tspeed P((int)), tty_tspeed(int),
willoption P((int)), willoption(int),
wontoption P((int)); wontoption(int);
int output_data __P((const char *, ...)) __printflike(1, 2); int output_data(const char *, ...) __printflike(1, 2);
void output_datalen __P((const char *, int)); void output_datalen(const char *, int);
void startslave __P((char *, int, char *)); void startslave(char *, int, char *);
#ifdef ENCRYPTION #ifdef ENCRYPTION
extern void (*encrypt_output) P((unsigned char *, int)); extern void (*encrypt_output)(unsigned char *, int);
extern int (*decrypt_input) P((int)); extern int (*decrypt_input)(int);
extern char *nclearto; extern char *nclearto;
#endif /* ENCRYPTION */ #endif /* ENCRYPTION */

View File

@ -140,9 +140,9 @@ struct termios termbuf, termbuf2; /* pty control structure */
#include <sys/types.h> #include <sys/types.h>
#include <libutil.h> #include <libutil.h>
int cleanopen __P((char *)); int cleanopen(char *);
void scrub_env __P((void)); void scrub_env(void);
static char **addarg __P((char **, const char *)); static char **addarg(char **, const char *);
/* /*
* init_termbuf() * init_termbuf()

View File

@ -82,11 +82,11 @@ int debug = 0;
int keepalive = 1; int keepalive = 1;
const char *altlogin; const char *altlogin;
void doit __P((struct sockaddr *)); void doit(struct sockaddr *);
int terminaltypeok __P((char *)); int terminaltypeok(char *);
void startslave __P((char *, int, char *)); void startslave(char *, int, char *);
extern void usage P((void)); extern void usage(void);
static void _gettermname __P((void)); static void _gettermname(void);
/* /*
* The string to pass to getopt(). We do it this way so * The string to pass to getopt(). We do it this way so
@ -123,7 +123,7 @@ int family = AF_INET;
char *hostname; char *hostname;
char host_name[MAXHOSTNAMELEN]; char host_name[MAXHOSTNAMELEN];
extern void telnet P((int, int, char *)); extern void telnet(int, int, char *);
int level; int level;
char user_name[256]; char user_name[256];