Merge the (in)complete ANSIfication work from src/crypto/telnet.

This commit is contained in:
Mark Murray 2001-11-30 22:37:28 +00:00
parent 3138440a79
commit 33cc94ddaf
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=87156
7 changed files with 208 additions and 224 deletions

View File

@ -57,14 +57,6 @@
#ifndef __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_connect(int);
void printd(const unsigned char *, int);

View File

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

View File

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

View File

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

View File

@ -274,12 +274,12 @@ struct sendlist {
static int
send_esc P((void)),
send_help P((void)),
send_docmd P((char *)),
send_dontcmd P((char *)),
send_willcmd P((char *)),
send_wontcmd P((char *));
send_esc(void),
send_help(void),
send_docmd(char *),
send_dontcmd(char *),
send_willcmd(char *),
send_wontcmd(char *);
static struct sendlist Sendlist[] = {
{ "ao", "Send Telnet Abort output", 1, 0, NULL, 2, AO },
@ -1457,18 +1457,18 @@ struct envlist {
};
extern struct env_lst *
env_define P((const unsigned char *, unsigned char *));
env_define(const unsigned char *, unsigned char *);
extern void
env_undefine P((unsigned char *)),
env_export P((const unsigned char *)),
env_unexport P((const unsigned char *)),
env_send P((unsigned char *)),
env_undefine(unsigned char *),
env_export(const unsigned char *),
env_unexport(const unsigned char *),
env_send(unsigned char *),
#if defined(OLD_ENVIRON) && defined(ENV_HACK)
env_varval P((unsigned char *)),
env_varval(unsigned char *),
#endif
env_list P((void));
env_list(void);
static void
env_help P((void));
env_help(void);
struct envlist EnvList[] = {
{ "define", "Define an environment variable",

View File

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

View File

@ -69,30 +69,30 @@ typedef struct {
/* Initialization routine */
extern int
ring_init P((Ring *ring, unsigned char *buffer, int count));
ring_init(Ring *ring, unsigned char *buffer, int count);
/* Data movement routines */
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
extern void
ring_consume_data P((Ring *ring, unsigned char *buffer, int count));
ring_consume_data(Ring *ring, unsigned char *buffer, int count);
#endif
/* Buffer state transition routines */
extern void
ring_supplied P((Ring *ring, int count)),
ring_consumed P((Ring *ring, int count));
ring_supplied(Ring *ring, int count),
ring_consumed(Ring *ring, int count);
/* Buffer state query routines */
extern int
ring_at_mark P((Ring *)),
ring_empty_count P((Ring *ring)),
ring_empty_consecutive P((Ring *ring)),
ring_full_count P((Ring *ring)),
ring_full_consecutive P((Ring *ring));
ring_at_mark(Ring *),
ring_empty_count(Ring *ring),
ring_empty_consecutive(Ring *ring),
ring_full_count(Ring *ring),
ring_full_consecutive(Ring *ring);
extern void
ring_clear_mark P((Ring *)),
ring_mark P((Ring *));
ring_clear_mark(Ring *),
ring_mark(Ring *);