Protoized some more.

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@241 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Unknown User d91-jda
1996-02-09 23:52:00 +00:00
parent 40e821a122
commit ac65f7b044
5 changed files with 63 additions and 104 deletions

View File

@@ -40,9 +40,7 @@ RCSID("$Id$");
#include <libtelnet/misc.h> #include <libtelnet/misc.h>
int int
net_write(str, len) net_write(unsigned char *str, int len)
unsigned char *str;
int len;
{ {
if (nfrontp + len < netobuf + BUFSIZ) { if (nfrontp + len < netobuf + BUFSIZ) {
memmove((void *)nfrontp, (void *)str, len); memmove((void *)nfrontp, (void *)str, len);
@@ -53,7 +51,7 @@ net_write(str, len)
} }
void void
net_encrypt() net_encrypt(void)
{ {
#if defined(ENCRYPTION) #if defined(ENCRYPTION)
char *s = (nclearto > nbackp) ? nclearto : nbackp; char *s = (nclearto > nbackp) ? nclearto : nbackp;
@@ -65,26 +63,21 @@ net_encrypt()
} }
int int
telnet_spin() telnet_spin(void)
{ {
ttloop(); ttloop();
return(0); return(0);
} }
char * char *
telnet_getenv(val) telnet_getenv(char *val)
char *val;
{ {
extern char *getenv(); extern char *getenv(const char *);
return(getenv(val)); return(getenv(val));
} }
char * char *
telnet_gets(prompt, result, length, echo) telnet_gets(char *prompt, char *result, int length, int echo)
char *prompt;
char *result;
int length;
int echo;
{ {
return((char *)0); return((char *)0);
} }

View File

@@ -102,7 +102,7 @@ default_slc()
* Initialize the slc mapping table. * Initialize the slc mapping table.
*/ */
void void
get_slc_defaults() get_slc_defaults(void)
{ {
register int i; register int i;

View File

@@ -82,7 +82,7 @@ unsigned char *subsave;
#define TS_DONT 8 /* dont -''- */ #define TS_DONT 8 /* dont -''- */
void void
telrcv() telrcv(void)
{ {
register int c; register int c;
static int state = TS_DATA; static int state = TS_DATA;
@@ -434,8 +434,7 @@ gotiac: switch (c) {
* *
*/ */
void void
send_do(option, init) send_do(int option, int init)
int option, init;
{ {
if (init) { if (init) {
if ((do_dont_resp[option] == 0 && his_state_is_will(option)) || if ((do_dont_resp[option] == 0 && his_state_is_will(option)) ||
@@ -459,7 +458,7 @@ send_do(option, init)
} }
#ifdef AUTHENTICATION #ifdef AUTHENTICATION
extern void auth_request(); extern void auth_request(void);
#endif #endif
#ifdef LINEMODE #ifdef LINEMODE
extern void doclientstat(); extern void doclientstat();
@@ -469,8 +468,7 @@ extern void encrypt_send_support();
#endif #endif
void void
willoption(option) willoption(int option)
int option;
{ {
int changeok = 0; int changeok = 0;
void (*func)() = 0; void (*func)() = 0;
@@ -663,8 +661,7 @@ willoption(option)
} /* end of willoption */ } /* end of willoption */
void void
send_dont(option, init) send_dont(int option, int init)
int option, init;
{ {
if (init) { if (init) {
if ((do_dont_resp[option] == 0 && his_state_is_wont(option)) || if ((do_dont_resp[option] == 0 && his_state_is_wont(option)) ||
@@ -680,8 +677,7 @@ send_dont(option, init)
} }
void void
wontoption(option) wontoption(int option)
int option;
{ {
/* /*
* Process client input. * Process client input.
@@ -812,8 +808,7 @@ wontoption(option)
} /* end of wontoption */ } /* end of wontoption */
void void
send_will(option, init) send_will(int option, int init)
int option, init;
{ {
if (init) { if (init) {
if ((will_wont_resp[option] == 0 && my_state_is_will(option))|| if ((will_wont_resp[option] == 0 && my_state_is_will(option))||
@@ -840,8 +835,7 @@ int turn_on_sga = 0;
#endif #endif
void void
dooption(option) dooption(int option)
int option;
{ {
int changeok = 0; int changeok = 0;
@@ -971,8 +965,7 @@ dooption(option)
} /* end of dooption */ } /* end of dooption */
void void
send_wont(option, init) send_wont(int option, int init)
int option, init;
{ {
if (init) { if (init) {
if ((will_wont_resp[option] == 0 && my_state_is_wont(option)) || if ((will_wont_resp[option] == 0 && my_state_is_wont(option)) ||
@@ -988,8 +981,7 @@ send_wont(option, init)
} }
void void
dontoption(option) dontoption(int option)
int option;
{ {
/* /*
* Process client input. * Process client input.
@@ -1094,7 +1086,7 @@ int env_ovalue = -1;
* Terminal speed * Terminal speed
*/ */
void void
suboption() suboption(void)
{ {
register int subchar; register int subchar;
@@ -1515,7 +1507,7 @@ suboption()
} /* end of suboption */ } /* end of suboption */
void void
doclientstat() doclientstat(void)
{ {
clientstat(TELOPT_LINEMODE, WILL, 0); clientstat(TELOPT_LINEMODE, WILL, 0);
} }
@@ -1523,7 +1515,7 @@ doclientstat()
#define ADD(c) *ncp++ = c #define ADD(c) *ncp++ = c
#define ADD_DATA(c) { *ncp++ = c; if (c == SE || c == IAC) *ncp++ = c; } #define ADD_DATA(c) { *ncp++ = c; if (c == SE || c == IAC) *ncp++ = c; }
void void
send_status() send_status(void)
{ {
unsigned char statusbuf[256]; unsigned char statusbuf[256];
register unsigned char *ncp; register unsigned char *ncp;

View File

@@ -179,7 +179,7 @@ char *new_login = LOGIN_PATH;
*/ */
void void
init_termbuf() init_termbuf(void)
{ {
# ifdef STREAMSPTY # ifdef STREAMSPTY
(void) tcgetattr(ttyfd, &termbuf); (void) tcgetattr(ttyfd, &termbuf);
@@ -203,7 +203,7 @@ copy_termbuf(cp, len)
#endif /* defined(LINEMODE) && defined(TIOCPKT_IOCTL) */ #endif /* defined(LINEMODE) && defined(TIOCPKT_IOCTL) */
void void
set_termbuf() set_termbuf(void)
{ {
/* /*
* Only make the necessary changes. * Only make the necessary changes.
@@ -233,10 +233,7 @@ set_termbuf()
int int
spcset(func, valp, valpp) spcset(int func, cc_t *valp, cc_t **valpp)
int func;
cc_t *valp;
cc_t **valpp;
{ {
#define setval(a, b) *valp = termbuf.c_cc[a]; \ #define setval(a, b) *valp = termbuf.c_cc[a]; \
@@ -562,26 +559,25 @@ tty_setlinemode(on)
#endif /* LINEMODE */ #endif /* LINEMODE */
int int
tty_isecho() tty_isecho(void)
{ {
return (termbuf.c_lflag & ECHO); return (termbuf.c_lflag & ECHO);
} }
int int
tty_flowmode() tty_flowmode(void)
{ {
return((termbuf.c_iflag & IXON) ? 1 : 0); return((termbuf.c_iflag & IXON) ? 1 : 0);
} }
int int
tty_restartany() tty_restartany(void)
{ {
return((termbuf.c_iflag & IXANY) ? 1 : 0); return((termbuf.c_iflag & IXANY) ? 1 : 0);
} }
void void
tty_setecho(on) tty_setecho(int on)
int on;
{ {
if (on) if (on)
termbuf.c_lflag |= ECHO; termbuf.c_lflag |= ECHO;
@@ -590,7 +586,7 @@ tty_setecho(on)
} }
int int
tty_israw() tty_israw(void)
{ {
return(!(termbuf.c_lflag & ICANON)); return(!(termbuf.c_lflag & ICANON));
} }
@@ -607,8 +603,7 @@ tty_setraw(on)
#endif #endif
void void
tty_binaryin(on) tty_binaryin(int on)
int on;
{ {
if (on) { if (on) {
termbuf.c_iflag &= ~ISTRIP; termbuf.c_iflag &= ~ISTRIP;
@@ -618,8 +613,7 @@ tty_binaryin(on)
} }
void void
tty_binaryout(on) tty_binaryout(int on)
int on;
{ {
if (on) { if (on) {
termbuf.c_cflag &= ~(CSIZE|PARENB); termbuf.c_cflag &= ~(CSIZE|PARENB);
@@ -633,13 +627,13 @@ tty_binaryout(on)
} }
int int
tty_isbinaryin() tty_isbinaryin(void)
{ {
return(!(termbuf.c_iflag & ISTRIP)); return(!(termbuf.c_iflag & ISTRIP));
} }
int int
tty_isbinaryout() tty_isbinaryout(void)
{ {
return(!(termbuf.c_oflag&OPOST)); return(!(termbuf.c_oflag&OPOST));
} }
@@ -679,7 +673,7 @@ tty_setsig(on)
#endif /* LINEMODE */ #endif /* LINEMODE */
int int
tty_issofttab() tty_issofttab(void)
{ {
# ifdef OXTABS # ifdef OXTABS
return (termbuf.c_oflag & OXTABS); return (termbuf.c_oflag & OXTABS);
@@ -690,8 +684,7 @@ tty_issofttab()
} }
void void
tty_setsofttab(on) tty_setsofttab(int on)
int on;
{ {
if (on) { if (on) {
# ifdef OXTABS # ifdef OXTABS
@@ -713,7 +706,7 @@ tty_setsofttab(on)
} }
int int
tty_islitecho() tty_islitecho(void)
{ {
# ifdef ECHOCTL # ifdef ECHOCTL
return (!(termbuf.c_lflag & ECHOCTL)); return (!(termbuf.c_lflag & ECHOCTL));
@@ -727,8 +720,7 @@ tty_islitecho()
} }
void void
tty_setlitecho(on) tty_setlitecho(int on)
int on;
{ {
# ifdef ECHOCTL # ifdef ECHOCTL
if (on) if (on)
@@ -745,7 +737,7 @@ tty_setlitecho(on)
} }
int int
tty_iscrnl() tty_iscrnl(void)
{ {
return (termbuf.c_iflag & ICRNL); return (termbuf.c_iflag & ICRNL);
} }
@@ -801,8 +793,7 @@ struct termspeeds {
#endif /* DECODE_BUAD */ #endif /* DECODE_BUAD */
void void
tty_tspeed(val) tty_tspeed(int val)
int val;
{ {
#ifdef DECODE_BAUD #ifdef DECODE_BAUD
register struct termspeeds *tp; register struct termspeeds *tp;
@@ -818,8 +809,7 @@ tty_tspeed(val)
} }
void void
tty_rspeed(val) tty_rspeed(int val)
int val;
{ {
#ifdef DECODE_BAUD #ifdef DECODE_BAUD
register struct termspeeds *tp; register struct termspeeds *tp;
@@ -1233,10 +1223,7 @@ char *gen_id = "fe";
/* ARGSUSED */ /* ARGSUSED */
void void
startslave(host, autologin, autoname) startslave(char *host, int autologin, char *autoname)
char *host;
int autologin;
char *autoname;
{ {
register int i; register int i;
char name[256]; char name[256];
@@ -1375,9 +1362,9 @@ char *envinit[3];
extern char **environ; extern char **environ;
void void
init_env() init_env(void)
{ {
extern char *getenv(); extern char *getenv(const char *);
char **envp; char **envp;
envp = envinit; envp = envinit;
@@ -1434,7 +1421,7 @@ void start_login(char *host, int autologin, char *name)
{ {
register char *cp; register char *cp;
struct arg_val argv; struct arg_val argv;
extern char *getenv(); extern char *getenv(const char *);
#ifdef HAVE_UTMPX_H #ifdef HAVE_UTMPX_H
char id_buf[3]; char id_buf[3];
int ptynum; int ptynum;
@@ -1691,8 +1678,7 @@ int addarg(struct arg_val *argv, char *val)
*/ */
/* ARGSUSED */ /* ARGSUSED */
void void
cleanup(sig) cleanup(int sig)
int sig;
{ {
#ifndef PARENT_DOES_UTMP #ifndef PARENT_DOES_UTMP
# if (BSD > 43) || defined(convex) # if (BSD > 43) || defined(convex)

View File

@@ -56,9 +56,9 @@ RCSID("$Id$");
*/ */
void void
ttloop() ttloop(void)
{ {
void netflush(); void netflush(void);
DIAG(TD_REPORT, {sprintf(nfrontp, "td: ttloop\r\n"); DIAG(TD_REPORT, {sprintf(nfrontp, "td: ttloop\r\n");
nfrontp += strlen(nfrontp);}); nfrontp += strlen(nfrontp);});
@@ -87,8 +87,8 @@ ttloop()
* Check a descriptor to see if out of band data exists on it. * Check a descriptor to see if out of band data exists on it.
*/ */
int int
stilloob(s) stilloob(int s)
int s; /* socket number */ /* socket number */
{ {
static struct timeval timeout = { 0 }; static struct timeval timeout = { 0 };
fd_set excepts; fd_set excepts;
@@ -111,7 +111,7 @@ stilloob(s)
} }
void void
ptyflush() ptyflush(void)
{ {
int n; int n;
@@ -143,8 +143,7 @@ ptyflush()
* character. * character.
*/ */
char * char *
nextitem(current) nextitem(char *current)
char *current;
{ {
if ((*current&0xff) != IAC) { if ((*current&0xff) != IAC) {
return current+1; return current+1;
@@ -190,7 +189,7 @@ nextitem(current)
* us in any case. * us in any case.
*/ */
void void
netclear() netclear(void)
{ {
register char *thisitem, *next; register char *thisitem, *next;
char *good; char *good;
@@ -243,7 +242,7 @@ netclear()
* handling requests for urgent data. * handling requests for urgent data.
*/ */
void void
netflush() netflush(void)
{ {
int n; int n;
extern int not42; extern int not42;
@@ -321,9 +320,7 @@ netflush()
* len - How many bytes to write * len - How many bytes to write
*/ */
void void
writenet(ptr, len) writenet(register unsigned char *ptr, register int len)
register unsigned char *ptr;
register int len;
{ {
/* flush buffer if no room for new data) */ /* flush buffer if no room for new data) */
if ((&netobuf[BUFSIZ] - nfrontp) < len) { if ((&netobuf[BUFSIZ] - nfrontp) < len) {
@@ -363,11 +360,9 @@ void fatal(int f, char *msg)
} }
void void
fatalperror(f, msg) fatalperror(int f, char *msg)
int f;
char *msg;
{ {
char buf[BUFSIZ], *strerror(); char buf[BUFSIZ], *strerror(int);
(void) sprintf(buf, "%s: %s", msg, strerror(errno)); (void) sprintf(buf, "%s: %s", msg, strerror(errno));
fatal(f, buf); fatal(f, buf);
@@ -415,8 +410,7 @@ void edithost(char *pat, char *host)
static char *putlocation; static char *putlocation;
void void
putstr(s) putstr(register char *s)
register char *s;
{ {
while (*s) while (*s)
@@ -424,8 +418,7 @@ putstr(s)
} }
void void
putchr(cc) putchr(int cc)
int cc;
{ {
*putlocation++ = cc; *putlocation++ = cc;
} }
@@ -521,9 +514,7 @@ void putf(char *cp, char *where)
* Print telnet options and commands in plain text, if possible. * Print telnet options and commands in plain text, if possible.
*/ */
void void
printoption(fmt, option) printoption(register char *fmt, register int option)
register char *fmt;
register int option;
{ {
if (TELOPT_OK(option)) if (TELOPT_OK(option))
sprintf(nfrontp, "%s %s\r\n", fmt, TELOPT(option)); sprintf(nfrontp, "%s %s\r\n", fmt, TELOPT(option));
@@ -536,10 +527,10 @@ printoption(fmt, option)
} }
void void
printsub(direction, pointer, length) printsub(char direction, unsigned char *pointer, int length)
char direction; /* '<' or '>' */ /* '<' or '>' */
unsigned char *pointer; /* where suboption data sits */ /* where suboption data sits */
int length; /* length of suboption data */ /* length of suboption data */
{ {
register int i; register int i;
char buf[512]; char buf[512];
@@ -1173,10 +1164,7 @@ printsub(direction, pointer, length)
* Dump a data buffer in hex and ascii to the output data stream. * Dump a data buffer in hex and ascii to the output data stream.
*/ */
void void
printdata(tag, ptr, cnt) printdata(register char *tag, register char *ptr, register int cnt)
register char *tag;
register char *ptr;
register int cnt;
{ {
register int i; register int i;
char xbuf[30]; char xbuf[30];