diff options
author | imp <imp@FreeBSD.org> | 2002-02-06 16:38:40 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 2002-02-06 16:38:40 +0000 |
commit | 03e95a007574b9643fd72401983d6f3f4a08142e (patch) | |
tree | 9b3dc3692bc5178d1fd59b6862bf2910822b7a26 /libexec/getty/chat.c | |
parent | da2d85715fed780b6085d04c50d9c1aea4d57ba1 (diff) | |
download | FreeBSD-src-03e95a007574b9643fd72401983d6f3f4a08142e.zip FreeBSD-src-03e95a007574b9643fd72401983d6f3f4a08142e.tar.gz |
o __P removal
o remove register
o use strict prototypes
Diffstat (limited to 'libexec/getty/chat.c')
-rw-r--r-- | libexec/getty/chat.c | 51 |
1 files changed, 19 insertions, 32 deletions
diff --git a/libexec/getty/chat.c b/libexec/getty/chat.c index 1fdef26..4e14176 100644 --- a/libexec/getty/chat.c +++ b/libexec/getty/chat.c @@ -68,15 +68,15 @@ static int chat_alarm = CHAT_DEFAULT_TIMEOUT; /* Default */ static volatile int alarmed = 0; -static void chat_alrm __P((int)); -static int chat_unalarm __P((void)); -static int getdigit __P((unsigned char **, int, int)); -static char **read_chat __P((char **)); -static char *cleanchr __P((char **, unsigned char)); -static char *cleanstr __P((const unsigned char *, int)); -static const char *result __P((int)); -static int chat_expect __P((const char *)); -static int chat_send __P((char const *)); +static void chat_alrm(int); +static int chat_unalarm(void); +static int getdigit(unsigned char **, int, int); +static char **read_chat(char **); +static char *cleanchr(char **, unsigned char); +static char *cleanstr(const unsigned char *, int); +static const char *result(int); +static int chat_expect(const char *); +static int chat_send(char const *); /* @@ -87,8 +87,7 @@ static int chat_send __P((char const *)); */ static void -chat_alrm(signo) - int signo; +chat_alrm(int signo) { int on = 1; @@ -104,7 +103,7 @@ chat_alrm(signo) */ static int -chat_unalarm() +chat_unalarm(void) { int off = 0; return ioctl(STDIN_FILENO, FIONBIO, &off); @@ -116,9 +115,7 @@ chat_unalarm() */ static int -getdigit(ptr, base, max) - unsigned char **ptr; - int base, max; +getdigit(unsigned char **ptr, int base, int max) { int i, val = 0; char * q; @@ -145,8 +142,7 @@ getdigit(ptr, base, max) */ static char ** -read_chat(chatstr) - char **chatstr; +read_chat(char **chatstr) { char *str = *chatstr; char **res = NULL; @@ -252,9 +248,7 @@ read_chat(chatstr) */ static char * -cleanchr(buf, ch) - char **buf; - unsigned char ch; +cleanchr(char **buf, unsigned char ch) { int l; static char tmpbuf[5]; @@ -288,9 +282,7 @@ cleanchr(buf, ch) */ static char * -cleanstr(s, l) - const unsigned char *s; - int l; +cleanstr(const unsigned char *s, int l) { static unsigned char * tmp = NULL; static int tmplen = 0; @@ -319,8 +311,7 @@ cleanstr(s, l) */ static const char * -result(r) - int r; +result(int r) { static const char * results[] = { "OK", "MEMERROR", "IOERROR", "TIMEOUT" @@ -335,8 +326,7 @@ result(r) */ static int -chat_expect(str) - const char *str; +chat_expect(const char *str) { int len, r = 0; @@ -405,8 +395,7 @@ chat_expect(str) */ static int -chat_send(str) - char const *str; +chat_send(char const *str) { int r = 0; @@ -459,9 +448,7 @@ chat_send(str) */ int -getty_chat(scrstr, timeout, debug) - char *scrstr; - int timeout, debug; +getty_chat(char *scrstr, int timeout, int debug) { int r = -1; |