From ac65f7b04443851cc6f03683bad9b70a770e375c Mon Sep 17 00:00:00 2001 From: Unknown User d91-jda Date: Fri, 9 Feb 1996 23:52:00 +0000 Subject: [PATCH] Protoized some more. git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@241 ec53bebd-3082-4978-b11e-865c3cabbd6b --- appl/telnet/telnetd/authenc.c | 19 ++++------- appl/telnet/telnetd/slc.c | 2 +- appl/telnet/telnetd/state.c | 34 +++++++------------ appl/telnet/telnetd/sys_term.c | 62 +++++++++++++--------------------- appl/telnet/telnetd/utility.c | 50 +++++++++++---------------- 5 files changed, 63 insertions(+), 104 deletions(-) diff --git a/appl/telnet/telnetd/authenc.c b/appl/telnet/telnetd/authenc.c index b044458d2..bc2d05a66 100644 --- a/appl/telnet/telnetd/authenc.c +++ b/appl/telnet/telnetd/authenc.c @@ -40,9 +40,7 @@ RCSID("$Id$"); #include int -net_write(str, len) - unsigned char *str; - int len; +net_write(unsigned char *str, int len) { if (nfrontp + len < netobuf + BUFSIZ) { memmove((void *)nfrontp, (void *)str, len); @@ -53,7 +51,7 @@ net_write(str, len) } void -net_encrypt() +net_encrypt(void) { #if defined(ENCRYPTION) char *s = (nclearto > nbackp) ? nclearto : nbackp; @@ -65,26 +63,21 @@ net_encrypt() } int -telnet_spin() +telnet_spin(void) { ttloop(); return(0); } char * -telnet_getenv(val) - char *val; +telnet_getenv(char *val) { - extern char *getenv(); + extern char *getenv(const char *); return(getenv(val)); } char * -telnet_gets(prompt, result, length, echo) - char *prompt; - char *result; - int length; - int echo; +telnet_gets(char *prompt, char *result, int length, int echo) { return((char *)0); } diff --git a/appl/telnet/telnetd/slc.c b/appl/telnet/telnetd/slc.c index 3c3f2d221..ffbdcb42b 100644 --- a/appl/telnet/telnetd/slc.c +++ b/appl/telnet/telnetd/slc.c @@ -102,7 +102,7 @@ default_slc() * Initialize the slc mapping table. */ void -get_slc_defaults() +get_slc_defaults(void) { register int i; diff --git a/appl/telnet/telnetd/state.c b/appl/telnet/telnetd/state.c index 768fb5a0a..636bf0f04 100644 --- a/appl/telnet/telnetd/state.c +++ b/appl/telnet/telnetd/state.c @@ -82,7 +82,7 @@ unsigned char *subsave; #define TS_DONT 8 /* dont -''- */ void -telrcv() +telrcv(void) { register int c; static int state = TS_DATA; @@ -434,8 +434,7 @@ gotiac: switch (c) { * */ void -send_do(option, init) - int option, init; +send_do(int option, int init) { if (init) { if ((do_dont_resp[option] == 0 && his_state_is_will(option)) || @@ -459,7 +458,7 @@ send_do(option, init) } #ifdef AUTHENTICATION -extern void auth_request(); +extern void auth_request(void); #endif #ifdef LINEMODE extern void doclientstat(); @@ -469,8 +468,7 @@ extern void encrypt_send_support(); #endif void -willoption(option) - int option; +willoption(int option) { int changeok = 0; void (*func)() = 0; @@ -663,8 +661,7 @@ willoption(option) } /* end of willoption */ void -send_dont(option, init) - int option, init; +send_dont(int option, int init) { if (init) { if ((do_dont_resp[option] == 0 && his_state_is_wont(option)) || @@ -680,8 +677,7 @@ send_dont(option, init) } void -wontoption(option) - int option; +wontoption(int option) { /* * Process client input. @@ -812,8 +808,7 @@ wontoption(option) } /* end of wontoption */ void -send_will(option, init) - int option, init; +send_will(int option, int init) { if (init) { if ((will_wont_resp[option] == 0 && my_state_is_will(option))|| @@ -840,8 +835,7 @@ int turn_on_sga = 0; #endif void -dooption(option) - int option; +dooption(int option) { int changeok = 0; @@ -971,8 +965,7 @@ dooption(option) } /* end of dooption */ void -send_wont(option, init) - int option, init; +send_wont(int option, int init) { if (init) { if ((will_wont_resp[option] == 0 && my_state_is_wont(option)) || @@ -988,8 +981,7 @@ send_wont(option, init) } void -dontoption(option) - int option; +dontoption(int option) { /* * Process client input. @@ -1094,7 +1086,7 @@ int env_ovalue = -1; * Terminal speed */ void -suboption() +suboption(void) { register int subchar; @@ -1515,7 +1507,7 @@ suboption() } /* end of suboption */ void -doclientstat() +doclientstat(void) { clientstat(TELOPT_LINEMODE, WILL, 0); } @@ -1523,7 +1515,7 @@ doclientstat() #define ADD(c) *ncp++ = c #define ADD_DATA(c) { *ncp++ = c; if (c == SE || c == IAC) *ncp++ = c; } void -send_status() +send_status(void) { unsigned char statusbuf[256]; register unsigned char *ncp; diff --git a/appl/telnet/telnetd/sys_term.c b/appl/telnet/telnetd/sys_term.c index d599276ed..2105cb705 100644 --- a/appl/telnet/telnetd/sys_term.c +++ b/appl/telnet/telnetd/sys_term.c @@ -179,7 +179,7 @@ char *new_login = LOGIN_PATH; */ void -init_termbuf() +init_termbuf(void) { # ifdef STREAMSPTY (void) tcgetattr(ttyfd, &termbuf); @@ -203,7 +203,7 @@ copy_termbuf(cp, len) #endif /* defined(LINEMODE) && defined(TIOCPKT_IOCTL) */ void -set_termbuf() +set_termbuf(void) { /* * Only make the necessary changes. @@ -233,10 +233,7 @@ set_termbuf() int -spcset(func, valp, valpp) - int func; - cc_t *valp; - cc_t **valpp; +spcset(int func, cc_t *valp, cc_t **valpp) { #define setval(a, b) *valp = termbuf.c_cc[a]; \ @@ -562,26 +559,25 @@ tty_setlinemode(on) #endif /* LINEMODE */ int -tty_isecho() +tty_isecho(void) { return (termbuf.c_lflag & ECHO); } int -tty_flowmode() +tty_flowmode(void) { return((termbuf.c_iflag & IXON) ? 1 : 0); } int -tty_restartany() +tty_restartany(void) { return((termbuf.c_iflag & IXANY) ? 1 : 0); } void -tty_setecho(on) - int on; +tty_setecho(int on) { if (on) termbuf.c_lflag |= ECHO; @@ -590,7 +586,7 @@ tty_setecho(on) } int -tty_israw() +tty_israw(void) { return(!(termbuf.c_lflag & ICANON)); } @@ -607,8 +603,7 @@ tty_setraw(on) #endif void -tty_binaryin(on) - int on; +tty_binaryin(int on) { if (on) { termbuf.c_iflag &= ~ISTRIP; @@ -618,8 +613,7 @@ tty_binaryin(on) } void -tty_binaryout(on) - int on; +tty_binaryout(int on) { if (on) { termbuf.c_cflag &= ~(CSIZE|PARENB); @@ -633,13 +627,13 @@ tty_binaryout(on) } int -tty_isbinaryin() +tty_isbinaryin(void) { return(!(termbuf.c_iflag & ISTRIP)); } int -tty_isbinaryout() +tty_isbinaryout(void) { return(!(termbuf.c_oflag&OPOST)); } @@ -679,7 +673,7 @@ tty_setsig(on) #endif /* LINEMODE */ int -tty_issofttab() +tty_issofttab(void) { # ifdef OXTABS return (termbuf.c_oflag & OXTABS); @@ -690,8 +684,7 @@ tty_issofttab() } void -tty_setsofttab(on) - int on; +tty_setsofttab(int on) { if (on) { # ifdef OXTABS @@ -713,7 +706,7 @@ tty_setsofttab(on) } int -tty_islitecho() +tty_islitecho(void) { # ifdef ECHOCTL return (!(termbuf.c_lflag & ECHOCTL)); @@ -727,8 +720,7 @@ tty_islitecho() } void -tty_setlitecho(on) - int on; +tty_setlitecho(int on) { # ifdef ECHOCTL if (on) @@ -745,7 +737,7 @@ tty_setlitecho(on) } int -tty_iscrnl() +tty_iscrnl(void) { return (termbuf.c_iflag & ICRNL); } @@ -801,8 +793,7 @@ struct termspeeds { #endif /* DECODE_BUAD */ void -tty_tspeed(val) - int val; +tty_tspeed(int val) { #ifdef DECODE_BAUD register struct termspeeds *tp; @@ -818,8 +809,7 @@ tty_tspeed(val) } void -tty_rspeed(val) - int val; +tty_rspeed(int val) { #ifdef DECODE_BAUD register struct termspeeds *tp; @@ -1233,10 +1223,7 @@ char *gen_id = "fe"; /* ARGSUSED */ void -startslave(host, autologin, autoname) - char *host; - int autologin; - char *autoname; +startslave(char *host, int autologin, char *autoname) { register int i; char name[256]; @@ -1375,9 +1362,9 @@ char *envinit[3]; extern char **environ; void -init_env() +init_env(void) { - extern char *getenv(); + extern char *getenv(const char *); char **envp; envp = envinit; @@ -1434,7 +1421,7 @@ void start_login(char *host, int autologin, char *name) { register char *cp; struct arg_val argv; - extern char *getenv(); + extern char *getenv(const char *); #ifdef HAVE_UTMPX_H char id_buf[3]; int ptynum; @@ -1691,8 +1678,7 @@ int addarg(struct arg_val *argv, char *val) */ /* ARGSUSED */ void -cleanup(sig) - int sig; +cleanup(int sig) { #ifndef PARENT_DOES_UTMP # if (BSD > 43) || defined(convex) diff --git a/appl/telnet/telnetd/utility.c b/appl/telnet/telnetd/utility.c index 3d4f54853..6e6e3d8ae 100644 --- a/appl/telnet/telnetd/utility.c +++ b/appl/telnet/telnetd/utility.c @@ -56,9 +56,9 @@ RCSID("$Id$"); */ void -ttloop() +ttloop(void) { - void netflush(); + void netflush(void); DIAG(TD_REPORT, {sprintf(nfrontp, "td: ttloop\r\n"); nfrontp += strlen(nfrontp);}); @@ -87,8 +87,8 @@ ttloop() * Check a descriptor to see if out of band data exists on it. */ int -stilloob(s) - int s; /* socket number */ +stilloob(int s) + /* socket number */ { static struct timeval timeout = { 0 }; fd_set excepts; @@ -111,7 +111,7 @@ stilloob(s) } void -ptyflush() +ptyflush(void) { int n; @@ -143,8 +143,7 @@ ptyflush() * character. */ char * -nextitem(current) - char *current; +nextitem(char *current) { if ((*current&0xff) != IAC) { return current+1; @@ -190,7 +189,7 @@ nextitem(current) * us in any case. */ void -netclear() +netclear(void) { register char *thisitem, *next; char *good; @@ -243,7 +242,7 @@ netclear() * handling requests for urgent data. */ void -netflush() +netflush(void) { int n; extern int not42; @@ -321,9 +320,7 @@ netflush() * len - How many bytes to write */ void -writenet(ptr, len) - register unsigned char *ptr; - register int len; +writenet(register unsigned char *ptr, register int len) { /* flush buffer if no room for new data) */ if ((&netobuf[BUFSIZ] - nfrontp) < len) { @@ -363,11 +360,9 @@ void fatal(int f, char *msg) } void -fatalperror(f, msg) - int f; - char *msg; +fatalperror(int f, char *msg) { - char buf[BUFSIZ], *strerror(); + char buf[BUFSIZ], *strerror(int); (void) sprintf(buf, "%s: %s", msg, strerror(errno)); fatal(f, buf); @@ -415,8 +410,7 @@ void edithost(char *pat, char *host) static char *putlocation; void -putstr(s) - register char *s; +putstr(register char *s) { while (*s) @@ -424,8 +418,7 @@ putstr(s) } void -putchr(cc) - int cc; +putchr(int cc) { *putlocation++ = cc; } @@ -521,9 +514,7 @@ void putf(char *cp, char *where) * Print telnet options and commands in plain text, if possible. */ void -printoption(fmt, option) - register char *fmt; - register int option; +printoption(register char *fmt, register int option) { if (TELOPT_OK(option)) sprintf(nfrontp, "%s %s\r\n", fmt, TELOPT(option)); @@ -536,10 +527,10 @@ printoption(fmt, option) } void -printsub(direction, pointer, length) - char direction; /* '<' or '>' */ - unsigned char *pointer; /* where suboption data sits */ - int length; /* length of suboption data */ +printsub(char direction, unsigned char *pointer, int length) + /* '<' or '>' */ + /* where suboption data sits */ + /* length of suboption data */ { register int i; char buf[512]; @@ -1173,10 +1164,7 @@ printsub(direction, pointer, length) * Dump a data buffer in hex and ascii to the output data stream. */ void -printdata(tag, ptr, cnt) - register char *tag; - register char *ptr; - register int cnt; +printdata(register char *tag, register char *ptr, register int cnt) { register int i; char xbuf[30];