diff --git a/libexec/getty/extern.h b/libexec/getty/extern.h index 787bd30fa15f..fd80c0296244 100644 --- a/libexec/getty/extern.h +++ b/libexec/getty/extern.h @@ -1,4 +1,4 @@ -/* $NetBSD: extern.h,v 1.4 1996/07/31 20:40:26 thorpej Exp $ */ +/* $NetBSD: extern.h,v 1.5 2001/11/10 17:35:54 thorpej Exp $ */ /* * Copyright (c) 1993 @@ -37,20 +37,20 @@ struct delayval; -int adelay __P((int, struct delayval *)); -char *autobaud __P((void)); -int delaybits __P((void)); -void edithost __P((char *)); -void gendefaults __P((void)); -int getent __P((char *, char *)); -int getflag __P((char *)); -long getnum __P((char *)); -char *getstr __P((char *, char **)); -void gettable __P((char *, char *)); -void makeenv __P((char *[])); -char *portselector __P((void)); -void set_ttydefaults __P((int)); -void setchars __P((void)); -void setdefaults __P((void)); -void setflags __P((int)); -int speed __P((int)); +int adelay(int, struct delayval *); +char *autobaud(void); +int delaybits(void); +void edithost(char *); +void gendefaults(void); +int getent(char *, char *); +int getflag(char *); +long getnum(char *); +char *getstr(char *, char **); +void gettable(char *, char *); +void makeenv(char *[]); +char *portselector(void); +void set_ttydefaults(int); +void setchars(void); +void setdefaults(void); +void setflags(int); +int speed(int); diff --git a/libexec/getty/main.c b/libexec/getty/main.c index 70d9422637b6..b21890543295 100644 --- a/libexec/getty/main.c +++ b/libexec/getty/main.c @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.40 2001/11/10 17:20:52 thorpej Exp $ */ +/* $NetBSD: main.c,v 1.41 2001/11/10 17:35:54 thorpej Exp $ */ /*- * Copyright (c) 1980, 1993 @@ -44,7 +44,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 1993\n\ #if 0 static char sccsid[] = "from: @(#)main.c 8.1 (Berkeley) 6/20/93"; #else -__RCSID("$NetBSD: main.c,v 1.40 2001/11/10 17:20:52 thorpej Exp $"); +__RCSID("$NetBSD: main.c,v 1.41 2001/11/10 17:35:54 thorpej Exp $"); #endif #endif /* not lint */ @@ -140,16 +140,12 @@ const char partab[] = { #define KILL tmode.c_cc[VKILL] #define EOT tmode.c_cc[VEOF] -static void dingdong __P((int)); -static void interrupt __P((int)); -static void clearscreen __P((void)); -void timeoverrun __P((int)); +static void clearscreen(void); jmp_buf timeout; static void -dingdong(signo) - int signo; +dingdong(int signo) { alarm(0); @@ -160,8 +156,7 @@ dingdong(signo) jmp_buf intrupt; static void -interrupt(signo) - int signo; +interrupt(int signo) { signal(SIGINT, interrupt); @@ -171,28 +166,25 @@ interrupt(signo) /* * Action to take when getty is running too long. */ -void -timeoverrun(signo) - int signo; +static void +timeoverrun(int signo) { syslog(LOG_ERR, "getty exiting due to excessive running time"); exit(1); } -int main __P((int, char **)); -static int getname __P((void)); -static void oflush __P((void)); -static void prompt __P((void)); -static void putchr __P((int)); -static void putf __P((const char *)); -static void putpad __P((const char *)); -static void xputs __P((const char *)); +int main(int, char *[]); +static int getname(void); +static void oflush(void); +static void prompt(void); +static void putchr(int); +static void putf(const char *); +static void putpad(const char *); +static void xputs(const char *); int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char *argv[]) { const char *progname; char *tname; @@ -442,7 +434,7 @@ main(argc, argv) } static int -getname() +getname(void) { int c; char *np; @@ -557,8 +549,7 @@ getname() } static void -putpad(s) - const char *s; +putpad(const char *s) { int pad = 0; speed_t ospeed = cfgetospeed(&tmode); @@ -595,8 +586,7 @@ putpad(s) } static void -xputs(s) - const char *s; +xputs(const char *s) { while (*s) putchr(*s++); @@ -606,8 +596,7 @@ char outbuf[OBUFSIZ]; int obufcnt = 0; static void -putchr(cc) - int cc; +putchr(int cc) { char c; @@ -626,7 +615,7 @@ putchr(cc) } static void -oflush() +oflush(void) { if (obufcnt) write(STDOUT_FILENO, outbuf, obufcnt); @@ -634,7 +623,7 @@ oflush() } static void -prompt() +prompt(void) { putf(LM); @@ -643,8 +632,7 @@ prompt() } static void -putf(cp) - const char *cp; +putf(const char *cp) { time_t t; char *slash, db[100]; @@ -702,7 +690,7 @@ putf(cp) } static void -clearscreen() +clearscreen(void) { struct ttyent *typ; struct tinfo *tinfo; diff --git a/libexec/getty/subr.c b/libexec/getty/subr.c index 49824b3f520c..2135f48eec6e 100644 --- a/libexec/getty/subr.c +++ b/libexec/getty/subr.c @@ -1,4 +1,4 @@ -/* $NetBSD: subr.c,v 1.24 2000/09/19 16:17:48 mjl Exp $ */ +/* $NetBSD: subr.c,v 1.25 2001/11/10 17:35:54 thorpej Exp $ */ /* * Copyright (c) 1983, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "from: @(#)subr.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: subr.c,v 1.24 2000/09/19 16:17:48 mjl Exp $"); +__RCSID("$NetBSD: subr.c,v 1.25 2001/11/10 17:35:54 thorpej Exp $"); #endif #endif /* not lint */ @@ -60,14 +60,13 @@ __RCSID("$NetBSD: subr.c,v 1.24 2000/09/19 16:17:48 mjl Exp $"); extern struct termios tmode, omode; -static void compatflags __P((long)); +static void compatflags(long); /* * Get a table entry. */ void -gettable(name, buf) - char *name, *buf; +gettable(char *name, char *buf) { struct gettystrs *sp; struct gettynums *np; @@ -112,7 +111,7 @@ gettable(name, buf) } void -gendefaults() +gendefaults(void) { struct gettystrs *sp; struct gettynums *np; @@ -132,7 +131,7 @@ gendefaults() } void -setdefaults() +setdefaults(void) { struct gettystrs *sp; struct gettynums *np; @@ -165,7 +164,7 @@ charvars[] = { }; void -setchars() +setchars(void) { int i; char *p; @@ -185,8 +184,7 @@ setchars() #define ISSET(t, f) ((t) & (f)) void -setflags(n) - int n; +setflags(int n) { tcflag_t iflag, oflag, cflag, lflag; @@ -367,8 +365,7 @@ out: * Old TTY => termios, snatched from */ void -compatflags(flags) - long flags; +compatflags(long flags) { tcflag_t iflag, oflag, cflag, lflag; @@ -535,7 +532,7 @@ struct delayval tbdelay[] = { }; int -delaybits() +delaybits(void) { int f; @@ -548,9 +545,7 @@ delaybits() } int -adelay(ms, dp) - ms; - struct delayval *dp; +adelay(int ms, struct delayval *dp) { if (ms == 0) return (0); @@ -563,8 +558,7 @@ adelay(ms, dp) char editedhost[MAXHOSTNAMELEN]; void -edithost(pat) - char *pat; +edithost(char *pat) { char *host = HN; char *res = editedhost; @@ -603,8 +597,7 @@ edithost(pat) } void -makeenv(env) - char *env[]; +makeenv(char *env[]) { static char termbuf[128] = "TERM="; char *p, *q; @@ -652,7 +645,7 @@ struct portselect { }; char * -portselector() +portselector(void) { char c, baud[20], *type = "default"; struct portselect *ps; @@ -687,7 +680,7 @@ portselector() #include char * -autobaud() +autobaud(void) { int rfds; struct timeval timeout;