summaryrefslogtreecommitdiff
path: root/usr.bin/tip
diff options
context:
space:
mode:
authorMoritz Jodeit <moritz@cvs.openbsd.org>2006-03-17 19:17:14 +0000
committerMoritz Jodeit <moritz@cvs.openbsd.org>2006-03-17 19:17:14 +0000
commit0239d7682efc2b478227fcbaa8aeb93cc10fb3a6 (patch)
tree9b65fe651d41e60981c115ea03360a61bce52631 /usr.bin/tip
parent205c70fa20b21fe73ce397c558a8d49cf8549116 (diff)
ansification and correct prototypes. ok deraadt@
Diffstat (limited to 'usr.bin/tip')
-rw-r--r--usr.bin/tip/aculib/biz22.c36
-rw-r--r--usr.bin/tip/aculib/biz31.c49
-rw-r--r--usr.bin/tip/aculib/courier.c48
-rw-r--r--usr.bin/tip/aculib/df.c26
-rw-r--r--usr.bin/tip/aculib/dn11.c22
-rw-r--r--usr.bin/tip/aculib/hayes.c51
-rw-r--r--usr.bin/tip/aculib/t3000.c49
-rw-r--r--usr.bin/tip/aculib/v3451.c39
-rw-r--r--usr.bin/tip/aculib/v831.c31
-rw-r--r--usr.bin/tip/aculib/ventel.c35
-rw-r--r--usr.bin/tip/acutab.c17
-rw-r--r--usr.bin/tip/tip.h41
12 files changed, 214 insertions, 230 deletions
diff --git a/usr.bin/tip/aculib/biz22.c b/usr.bin/tip/aculib/biz22.c
index 702faf0e7b4..920b42a5c41 100644
--- a/usr.bin/tip/aculib/biz22.c
+++ b/usr.bin/tip/aculib/biz22.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: biz22.c,v 1.12 2006/03/17 14:43:06 moritz Exp $ */
+/* $OpenBSD: biz22.c,v 1.13 2006/03/17 19:17:13 moritz Exp $ */
/* $NetBSD: biz22.c,v 1.6 1997/02/11 09:24:11 mrg Exp $ */
/*
@@ -34,19 +34,20 @@
#if 0
static char sccsid[] = "@(#)biz22.c 8.1 (Berkeley) 6/6/93";
#endif
-static const char rcsid[] = "$OpenBSD: biz22.c,v 1.12 2006/03/17 14:43:06 moritz Exp $";
+static const char rcsid[] = "$OpenBSD: biz22.c,v 1.13 2006/03/17 19:17:13 moritz Exp $";
#endif /* not lint */
#include "tip.h"
#define DISCONNECT_CMD "\20\04" /* disconnection string */
-static void sigALRM();
static int dialtimeout = 0;
static jmp_buf timeoutbuf;
-static int cmd(), detect();
-void biz22_disconnect();
+static int biz_dialer(char *, char *);
+static void sigALRM(int);
+static int cmd(char *);
+static int detect(char *);
/*
* Dial up on a BIZCOMP Model 1022 with either
@@ -54,8 +55,7 @@ void biz22_disconnect();
* pulse dialing (mod = "W")
*/
static int
-biz_dialer(num, mod)
- char *num, *mod;
+biz_dialer(char *num, char *mod)
{
int connected = 0;
char cbuf[40];
@@ -105,23 +105,19 @@ biz_dialer(num, mod)
}
int
-biz22w_dialer(num, acu)
- char *num, *acu;
+biz22w_dialer(char *num, char *acu)
{
-
return (biz_dialer(num, "W"));
}
int
-biz22f_dialer(num, acu)
- char *num, *acu;
+biz22f_dialer(char *num, char *acu)
{
-
return (biz_dialer(num, "V"));
}
void
-biz22_disconnect()
+biz22_disconnect(void)
{
write(FD, DISCONNECT_CMD, sizeof(DISCONNECT_CMD)-1);
sleep(2);
@@ -129,22 +125,21 @@ biz22_disconnect()
}
void
-biz22_abort()
+biz22_abort(void)
{
-
write(FD, "\02", 1);
}
+/*ARGSUSED*/
static void
-sigALRM()
+sigALRM(int signo)
{
dialtimeout = 1;
longjmp(timeoutbuf, 1);
}
static int
-cmd(s)
- char *s;
+cmd(char *s)
{
sig_t f;
char c;
@@ -165,8 +160,7 @@ cmd(s)
}
static int
-detect(s)
- char *s;
+detect(char *s)
{
sig_t f;
char c;
diff --git a/usr.bin/tip/aculib/biz31.c b/usr.bin/tip/aculib/biz31.c
index c5b5e6aa330..41518112db4 100644
--- a/usr.bin/tip/aculib/biz31.c
+++ b/usr.bin/tip/aculib/biz31.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: biz31.c,v 1.9 2003/06/03 02:56:18 millert Exp $ */
+/* $OpenBSD: biz31.c,v 1.10 2006/03/17 19:17:13 moritz Exp $ */
/* $NetBSD: biz31.c,v 1.5 1997/02/11 09:24:14 mrg Exp $ */
/*
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)biz31.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: biz31.c,v 1.9 2003/06/03 02:56:18 millert Exp $";
+static char rcsid[] = "$OpenBSD: biz31.c,v 1.10 2006/03/17 19:17:13 moritz Exp $";
#endif /* not lint */
#include "tip.h"
@@ -42,7 +42,14 @@ static char rcsid[] = "$OpenBSD: biz31.c,v 1.9 2003/06/03 02:56:18 millert Exp $
#define MAXRETRY 3 /* sync up retry count */
#define DISCONNECT_CMD "\21\25\11\24" /* disconnection string */
-static void sigALRM();
+static int biz_dialer(char *, char *);
+static int bizsync(int);
+static int echo(char *);
+static void sigALRM(int);
+static int detect(char *);
+static int flush(char *);
+static int bizsync(int);
+
static int timeout = 0;
static jmp_buf timeoutbuf;
@@ -52,8 +59,7 @@ static jmp_buf timeoutbuf;
* pulse dialing (mod = "w")
*/
static int
-biz_dialer(num, mod)
- char *num, *mod;
+biz_dialer(char *num, char *mod)
{
int connected = 0;
@@ -101,37 +107,34 @@ biz_dialer(num, mod)
return (connected);
}
-biz31w_dialer(num, acu)
- char *num, *acu;
+int
+biz31w_dialer(char *num, char *acu)
{
-
return (biz_dialer(num, "w"));
}
-biz31f_dialer(num, acu)
- char *num, *acu;
+int
+biz31f_dialer(char *num, char *acu)
{
-
return (biz_dialer(num, "f"));
}
-biz31_disconnect()
+void
+biz31_disconnect(void)
{
-
write(FD, DISCONNECT_CMD, sizeof(DISCONNECT_CMD)-1);
sleep(2);
tcflush(FD, TCIOFLUSH);
}
-biz31_abort()
+void
+biz31_abort(void)
{
-
write(FD, "\33", 1);
}
static int
-echo(s)
- char *s;
+echo(char *s)
{
char c;
@@ -153,17 +156,16 @@ echo(s)
}
}
+/*ARGSUSED*/
static void
-sigALRM()
+sigALRM(int signo)
{
-
timeout = 1;
longjmp(timeoutbuf, 1);
}
static int
-detect(s)
- char *s;
+detect(char *s)
{
sig_t f;
char c;
@@ -187,8 +189,7 @@ detect(s)
}
static int
-flush(s)
- char *s;
+flush(char *s)
{
sig_t f;
char c;
@@ -211,7 +212,7 @@ flush(s)
* call there are gory ways to simulate this.
*/
static int
-bizsync(fd)
+bizsync(int fd)
{
#ifdef FIOCAPACITY
struct capacity b;
diff --git a/usr.bin/tip/aculib/courier.c b/usr.bin/tip/aculib/courier.c
index 0661f1e84f8..cd642b6df0a 100644
--- a/usr.bin/tip/aculib/courier.c
+++ b/usr.bin/tip/aculib/courier.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: courier.c,v 1.14 2006/03/17 14:43:06 moritz Exp $ */
+/* $OpenBSD: courier.c,v 1.15 2006/03/17 19:17:13 moritz Exp $ */
/* $NetBSD: courier.c,v 1.7 1997/02/11 09:24:16 mrg Exp $ */
/*
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)courier.c 8.1 (Berkeley) 6/6/93";
#endif
-static const char rcsid[] = "$OpenBSD: courier.c,v 1.14 2006/03/17 14:43:06 moritz Exp $";
+static const char rcsid[] = "$OpenBSD: courier.c,v 1.15 2006/03/17 19:17:13 moritz Exp $";
#endif /* not lint */
/*
@@ -47,20 +47,22 @@ static const char rcsid[] = "$OpenBSD: courier.c,v 1.14 2006/03/17 14:43:06 mori
#define MAXRETRY 5
-static void cour_write(int fd, char *cp, int n);
-static void sigALRM();
static int dialtimeout = 0;
static int connected = 0;
static jmp_buf timeoutbuf;
-static int coursync(), cour_connect(), cour_swallow();
-void cour_nap();
-void cour_disconnect(void);
+static void sigALRM(int);
+static int cour_swallow(char *);
+static int cour_connect(void);
+static int coursync(void);
+static void cour_write(int, char *, int);
+static void cour_nap(void);
+#ifdef DEBUG
+static void cour_verbose_read(void);
+#endif
int
-cour_dialer(num, acu)
- char *num;
- char *acu;
+cour_dialer(char *num, char *acu)
{
char *cp;
#ifdef ACULOG
@@ -116,7 +118,7 @@ badsynch:
}
void
-cour_disconnect()
+cour_disconnect(void)
{
/* first hang up the modem*/
ioctl(FD, TIOCCDTR, 0);
@@ -127,14 +129,15 @@ cour_disconnect()
}
void
-cour_abort()
+cour_abort(void)
{
cour_write(FD, "\r", 1); /* send anything to abort the call */
cour_disconnect();
}
+/*ARGSUSED*/
static void
-sigALRM()
+sigALRM(int signo)
{
printf("\07timeout waiting for reply\n");
dialtimeout = 1;
@@ -142,8 +145,7 @@ sigALRM()
}
static int
-cour_swallow(match)
- char *match;
+cour_swallow(char *match)
{
sig_t f;
char c;
@@ -189,7 +191,7 @@ struct baud_msg {
};
static int
-cour_connect()
+cour_connect(void)
{
char c;
int nc, nl, n;
@@ -262,7 +264,7 @@ again:
* the courier in sync.
*/
static int
-coursync()
+coursync(void)
{
int already = 0;
int len;
@@ -304,10 +306,7 @@ coursync()
}
static void
-cour_write(fd, cp, n)
-int fd;
-char *cp;
-int n;
+cour_write(int fd, char *cp, int n)
{
#ifdef notdef
if (boolean(value(VERBOSE)))
@@ -323,7 +322,8 @@ int n;
}
#ifdef DEBUG
-cour_verbose_read()
+static void
+cour_verbose_read(void)
{
int n = 0;
char buf[BUFSIZ];
@@ -339,8 +339,8 @@ cour_verbose_read()
#endif
/* Give the courier 50 milliseconds between characters */
-void
-cour_nap()
+static void
+cour_nap(void)
{
struct timespec ts;
diff --git a/usr.bin/tip/aculib/df.c b/usr.bin/tip/aculib/df.c
index 78f3d2d32d7..f858d46fc05 100644
--- a/usr.bin/tip/aculib/df.c
+++ b/usr.bin/tip/aculib/df.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: df.c,v 1.8 2006/03/17 14:43:06 moritz Exp $ */
+/* $OpenBSD: df.c,v 1.9 2006/03/17 19:17:13 moritz Exp $ */
/* $NetBSD: df.c,v 1.4 1995/10/29 00:49:51 pk Exp $ */
/*
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)df.c 8.1 (Berkeley) 6/6/93";
#endif
-static const char rcsid[] = "$OpenBSD: df.c,v 1.8 2006/03/17 14:43:06 moritz Exp $";
+static const char rcsid[] = "$OpenBSD: df.c,v 1.9 2006/03/17 19:17:13 moritz Exp $";
#endif /* not lint */
/*
@@ -44,30 +44,24 @@ static const char rcsid[] = "$OpenBSD: df.c,v 1.8 2006/03/17 14:43:06 moritz Exp
#include "tip.h"
static jmp_buf Sjbuf;
-static void alrm_timeout(int);
-static int df_dialer(char *, char *, int);
-static void df_disconnect(void);
+
+static int df_dialer(char *, char *, int);
+static void alrm_timeout(int);
int
-df02_dialer(num, acu)
- char *num, *acu;
+df02_dialer(char *num, char *acu)
{
-
return (df_dialer(num, acu, 0));
}
int
-df03_dialer(num, acu)
- char *num, *acu;
+df03_dialer(char *num, char *acu)
{
-
return (df_dialer(num, acu, 1));
}
-int
-df_dialer(num, acu, df03)
- char *num, *acu;
- int df03;
+static int
+df_dialer(char *num, char *acu, int df03)
{
int f = FD;
struct termios cntrl;
@@ -127,7 +121,7 @@ df_disconnect(void)
}
void
-df_abort()
+df_abort(void)
{
df_disconnect();
}
diff --git a/usr.bin/tip/aculib/dn11.c b/usr.bin/tip/aculib/dn11.c
index 3d5d18cd299..01805ca7691 100644
--- a/usr.bin/tip/aculib/dn11.c
+++ b/usr.bin/tip/aculib/dn11.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dn11.c,v 1.8 2003/06/03 02:56:18 millert Exp $ */
+/* $OpenBSD: dn11.c,v 1.9 2006/03/17 19:17:13 moritz Exp $ */
/* $NetBSD: dn11.c,v 1.4 1995/10/29 00:49:53 pk Exp $ */
/*
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)dn11.c 8.1 (Berkeley) 6/6/93";
#endif
-static const char rcsid[] = "$OpenBSD: dn11.c,v 1.8 2003/06/03 02:56:18 millert Exp $";
+static const char rcsid[] = "$OpenBSD: dn11.c,v 1.9 2006/03/17 19:17:13 moritz Exp $";
#endif /* not lint */
/*
@@ -42,14 +42,13 @@ static const char rcsid[] = "$OpenBSD: dn11.c,v 1.8 2003/06/03 02:56:18 millert
*/
#include "tip.h"
-void dn_abort();
-void alarmtr();
static jmp_buf jmpbuf;
static pid_t child = -1, dn;
+static void alarmtr(int);
+
int
-dn_dialer(num, acu)
- char *num, *acu;
+dn_dialer(char *num, char *acu)
{
int lt, nw;
int timelim;
@@ -112,8 +111,9 @@ dn_dialer(num, acu)
return (1);
}
-void
-alarmtr()
+/*ARGSUSED*/
+static void
+alarmtr(int signo)
{
alarm(0);
longjmp(jmpbuf, 1);
@@ -124,9 +124,8 @@ alarmtr()
* hanging up...
*/
void
-dn_disconnect()
+dn_disconnect(void)
{
-
sleep(2);
if (FD > 0)
ioctl(FD, TIOCCDTR, 0);
@@ -134,9 +133,8 @@ dn_disconnect()
}
void
-dn_abort()
+dn_abort(void)
{
-
sleep(2);
if (child > 0)
kill(child, SIGKILL);
diff --git a/usr.bin/tip/aculib/hayes.c b/usr.bin/tip/aculib/hayes.c
index 65f5f9eb81b..e7139435b6b 100644
--- a/usr.bin/tip/aculib/hayes.c
+++ b/usr.bin/tip/aculib/hayes.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hayes.c,v 1.12 2006/03/17 14:43:06 moritz Exp $ */
+/* $OpenBSD: hayes.c,v 1.13 2006/03/17 19:17:13 moritz Exp $ */
/* $NetBSD: hayes.c,v 1.6 1997/02/11 09:24:17 mrg Exp $ */
/*
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)hayes.c 8.1 (Berkeley) 6/6/93";
#endif
-static const char rcsid[] = "$OpenBSD: hayes.c,v 1.12 2006/03/17 14:43:06 moritz Exp $";
+static const char rcsid[] = "$OpenBSD: hayes.c,v 1.13 2006/03/17 19:17:13 moritz Exp $";
#endif /* not lint */
/*
@@ -67,14 +67,8 @@ static const char rcsid[] = "$OpenBSD: hayes.c,v 1.12 2006/03/17 14:43:06 moritz
#define min(a,b) ((a < b) ? a : b)
-static void sigALRM();
static int dialtimeout = 0;
static jmp_buf timeoutbuf;
-static char gobble();
-static void error_rep(char c);
-int hay_sync(void);
-void hay_disconnect(void);
-void goodbye(void);
#define DUMBUFLEN 40
static char dumbuf[DUMBUFLEN];
@@ -85,10 +79,14 @@ static char dumbuf[DUMBUFLEN];
#define FAILED 4
static int state = IDLE;
+static void sigALRM(int);
+static char gobble(char *);
+static void error_rep(char);
+static void goodbye(void);
+static int hay_sync(void);
+
int
-hay_dialer(num, acu)
- char *num;
- char *acu;
+hay_dialer(char *num, char *acu)
{
char *cp;
int connected = 0;
@@ -142,9 +140,8 @@ hay_dialer(num, acu)
return (connected);
}
-
void
-hay_disconnect()
+hay_disconnect(void)
{
/* first hang up the modem*/
#ifdef DEBUG
@@ -157,25 +154,23 @@ hay_disconnect()
}
void
-hay_abort()
+hay_abort(void)
{
-
write(FD, "\r", 1); /* send anything to abort the call */
hay_disconnect();
}
+/*ARGSUSED*/
static void
-sigALRM()
+sigALRM(int signo)
{
-
printf("\07timeout waiting for reply\n\r");
dialtimeout = 1;
longjmp(timeoutbuf, 1);
}
static char
-gobble(match)
- char *match;
+gobble(char *match)
{
char c;
sig_t f;
@@ -222,23 +217,23 @@ error_rep(char c)
case '1':
printf("CONNECT");
break;
-
+
case '2':
printf("RING");
break;
-
+
case '3':
printf("NO CARRIER");
break;
-
+
case '4':
printf("ERROR in input");
break;
-
+
case '5':
printf("CONNECT 1200");
break;
-
+
default:
printf("Unknown Modem error: %c (0x%x)", c, c);
}
@@ -249,8 +244,8 @@ error_rep(char c)
/*
* set modem back to normal verbose status codes.
*/
-void
-goodbye()
+static void
+goodbye(void)
{
int len;
char c;
@@ -294,8 +289,8 @@ goodbye()
#define MAXRETRY 5
-int
-hay_sync()
+static int
+hay_sync(void)
{
int len, retry = 0;
diff --git a/usr.bin/tip/aculib/t3000.c b/usr.bin/tip/aculib/t3000.c
index f4331807902..1bb81c5d375 100644
--- a/usr.bin/tip/aculib/t3000.c
+++ b/usr.bin/tip/aculib/t3000.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: t3000.c,v 1.13 2006/03/17 14:43:06 moritz Exp $ */
+/* $OpenBSD: t3000.c,v 1.14 2006/03/17 19:17:13 moritz Exp $ */
/* $NetBSD: t3000.c,v 1.5 1997/02/11 09:24:18 mrg Exp $ */
/*
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)t3000.c 8.1 (Berkeley) 6/6/93";
#endif
-static const char rcsid[] = "$OpenBSD: t3000.c,v 1.13 2006/03/17 14:43:06 moritz Exp $";
+static const char rcsid[] = "$OpenBSD: t3000.c,v 1.14 2006/03/17 19:17:13 moritz Exp $";
#endif /* not lint */
/*
@@ -48,19 +48,22 @@ static const char rcsid[] = "$OpenBSD: t3000.c,v 1.13 2006/03/17 14:43:06 moritz
#define MAXRETRY 5
-static void sigALRM();
static int dialtimeout = 0;
static int connected = 0;
static jmp_buf timeoutbuf;
-static int t3000_sync(), t3000_connect(), t3000_swallow();
-static void t3000_write(int fd, char *cp, int n);
-static void t3000_nap();
-void t3000_disconnect();
+
+static void sigALRM(int);
+static int t3000_swallow(char *);
+static int t3000_connect(void);
+static int t3000_sync(void);
+static void t3000_write(int, char *, int);
+static void t3000_nap(void);
+#ifdef DEBUG
+static void t3000_verbose_read(void);
+#endif
int
-t3000_dialer(num, acu)
- char *num;
- char *acu;
+t3000_dialer(char *num, char *acu)
{
char *cp;
struct termios cntrl;
@@ -116,7 +119,7 @@ badsynch:
}
void
-t3000_disconnect()
+t3000_disconnect(void)
{
/* first hang up the modem*/
ioctl(FD, TIOCCDTR, 0);
@@ -127,14 +130,15 @@ t3000_disconnect()
}
void
-t3000_abort()
+t3000_abort(void)
{
t3000_write(FD, "\r", 1); /* send anything to abort the call */
t3000_disconnect();
}
+/*ARGSUSED*/
static void
-sigALRM()
+sigALRM(int signo)
{
printf("\07timeout waiting for reply\n");
dialtimeout = 1;
@@ -142,8 +146,7 @@ sigALRM()
}
static int
-t3000_swallow(match)
- char *match;
+t3000_swallow(char *match)
{
sig_t f;
char c;
@@ -203,7 +206,7 @@ struct tbaud_msg {
};
static int
-t3000_connect()
+t3000_connect(void)
{
char c;
int nc, nl, n;
@@ -276,7 +279,7 @@ again:
* the t3000 in sync.
*/
static int
-t3000_sync()
+t3000_sync(void)
{
int already = 0;
int len;
@@ -321,10 +324,7 @@ if (len == 0) len = 1;
}
static void
-t3000_write(fd, cp, n)
-int fd;
-char *cp;
-int n;
+t3000_write(int fd, char *cp, int n)
{
#ifdef notdef
if (boolean(value(VERBOSE)))
@@ -340,7 +340,8 @@ int n;
}
#ifdef DEBUG
-t3000_verbose_read()
+static void
+t3000_verbose_read(void)
{
int n = 0;
char buf[BUFSIZ];
@@ -356,8 +357,8 @@ t3000_verbose_read()
#endif
/* Give the t3000 50 milliseconds between characters */
-void
-t3000_nap()
+static void
+t3000_nap(void)
{
struct timespec ts;
diff --git a/usr.bin/tip/aculib/v3451.c b/usr.bin/tip/aculib/v3451.c
index 1f9f55f3c38..96624409f27 100644
--- a/usr.bin/tip/aculib/v3451.c
+++ b/usr.bin/tip/aculib/v3451.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: v3451.c,v 1.8 2003/06/03 02:56:18 millert Exp $ */
+/* $OpenBSD: v3451.c,v 1.9 2006/03/17 19:17:13 moritz Exp $ */
/* $NetBSD: v3451.c,v 1.6 1997/02/11 09:24:20 mrg Exp $ */
/*
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)v3451.c 8.1 (Berkeley) 6/6/93";
#endif
-static const char rcsid[] = "$OpenBSD: v3451.c,v 1.8 2003/06/03 02:56:18 millert Exp $";
+static const char rcsid[] = "$OpenBSD: v3451.c,v 1.9 2006/03/17 19:17:13 moritz Exp $";
#endif /* not lint */
/*
@@ -44,13 +44,14 @@ static const char rcsid[] = "$OpenBSD: v3451.c,v 1.8 2003/06/03 02:56:18 millert
static jmp_buf Sjbuf;
-static int expect(), notin(), prefix();
-static void vawrite(), alarmtr();
+static void vawrite(char *, int);
+static int expect(char *);
+static void alarmtr(int);
+static int notin(char *, char *);
+static int prefix(char *, char *);
int
-v3451_dialer(num, acu)
- char *num;
- char *acu;
+v3451_dialer(char *num, char *acu)
{
sig_t func;
int ok;
@@ -124,32 +125,26 @@ v3451_dialer(num, acu)
}
void
-v3451_disconnect()
+v3451_disconnect(void)
{
-
close(FD);
}
void
-v3451_abort()
+v3451_abort(void)
{
-
close(FD);
}
static void
-vawrite(cp, delay)
- char *cp;
- int delay;
+vawrite(char *cp, int delay)
{
-
for (; *cp; sleep(delay), cp++)
write(FD, cp, 1);
}
static int
-expect(cp)
- char *cp;
+expect(char *cp)
{
char buf[300];
char *rp = buf;
@@ -186,17 +181,16 @@ expect(cp)
return (1);
}
+/*ARGSUSED*/
static void
-alarmtr()
+alarmtr(int signo)
{
longjmp(Sjbuf, 1);
}
static int
-notin(sh, lg)
- char *sh, *lg;
+notin(char *sh, char *lg)
{
-
for (; *lg; lg++)
if (prefix(sh, lg))
return (0);
@@ -204,8 +198,7 @@ notin(sh, lg)
}
static int
-prefix(s1, s2)
- char *s1, *s2;
+prefix(char *s1, char *s2)
{
char c;
diff --git a/usr.bin/tip/aculib/v831.c b/usr.bin/tip/aculib/v831.c
index b14d9611815..383a540f1f6 100644
--- a/usr.bin/tip/aculib/v831.c
+++ b/usr.bin/tip/aculib/v831.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: v831.c,v 1.10 2005/02/17 12:45:42 aaron Exp $ */
+/* $OpenBSD: v831.c,v 1.11 2006/03/17 19:17:13 moritz Exp $ */
/* $NetBSD: v831.c,v 1.5 1996/12/29 10:42:01 cgd Exp $ */
/*
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)v831.c 8.1 (Berkeley) 6/6/93";
#endif
-static const char rcsid[] = "$OpenBSD: v831.c,v 1.10 2005/02/17 12:45:42 aaron Exp $";
+static const char rcsid[] = "$OpenBSD: v831.c,v 1.11 2006/03/17 19:17:13 moritz Exp $";
#endif /* not lint */
/*
@@ -43,17 +43,15 @@ static const char rcsid[] = "$OpenBSD: v831.c,v 1.10 2005/02/17 12:45:42 aaron E
#include "tip.h"
#include <termios.h>
-void v831_abort();
-static void alarmtr();
-static int dialit();
-static char *sanitize();
-
static jmp_buf jmpbuf;
static pid_t child = -1;
+static void alarmtr(int);
+static int dialit(char *, char *);
+static char * sanitize(char *);
+
int
-v831_dialer(num, acu)
- char *num, *acu;
+v831_dialer(char *num, char *acu)
{
int status;
int timelim;
@@ -116,8 +114,9 @@ v831_dialer(num, acu)
return (1);
}
+/*ARGSUSED*/
static void
-alarmtr()
+alarmtr(int signo)
{
alarm(0);
longjmp(jmpbuf, 1);
@@ -128,7 +127,7 @@ alarmtr()
* hanging up...
*/
void
-v831_disconnect()
+v831_disconnect(void)
{
struct termios cntrl;
@@ -148,9 +147,8 @@ v831_disconnect()
}
void
-v831_abort()
+v831_abort(void)
{
-
#ifdef DEBUG
printf("[abort: AC=%d]\n", AC);
#endif
@@ -185,9 +183,7 @@ struct vaconfig {
#define ETX 03
static int
-dialit(phonenum, acu)
- char *phonenum;
- char *acu;
+dialit(char *phonenum, char *acu)
{
struct vaconfig *vp;
struct termios cntrl;
@@ -247,8 +243,7 @@ dialit(phonenum, acu)
}
static char *
-sanitize(s)
- char *s;
+sanitize(char *s)
{
static char buf[128];
char *cp;
diff --git a/usr.bin/tip/aculib/ventel.c b/usr.bin/tip/aculib/ventel.c
index 94a9571e6c3..04ca30e6199 100644
--- a/usr.bin/tip/aculib/ventel.c
+++ b/usr.bin/tip/aculib/ventel.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ventel.c,v 1.11 2006/03/17 14:43:06 moritz Exp $ */
+/* $OpenBSD: ventel.c,v 1.12 2006/03/17 19:17:13 moritz Exp $ */
/* $NetBSD: ventel.c,v 1.6 1997/02/11 09:24:21 mrg Exp $ */
/*
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)ventel.c 8.1 (Berkeley) 6/6/93";
#endif
-static const char rcsid[] = "$OpenBSD: ventel.c,v 1.11 2006/03/17 14:43:06 moritz Exp $";
+static const char rcsid[] = "$OpenBSD: ventel.c,v 1.12 2006/03/17 19:17:13 moritz Exp $";
#endif /* not lint */
/*
@@ -47,13 +47,13 @@ static const char rcsid[] = "$OpenBSD: ventel.c,v 1.11 2006/03/17 14:43:06 morit
#define MAXRETRY 5
-static void sigALRM();
static int dialtimeout = 0;
static jmp_buf timeoutbuf;
-static int gobble(), vensync();
-static void echo();
-void ven_disconnect();
+static void echo(char *);
+static void sigALRM(int);
+static int gobble(char, char *);
+static int vensync(int);
/*
* some sleep calls have been replaced by this macro
@@ -66,9 +66,7 @@ void ven_disconnect();
#define busyloop(n) do { DELAY(n); } while (0)
int
-ven_dialer(num, acu)
- char *num;
- char *acu;
+ven_dialer(char *num, char *acu)
{
char *cp;
int connected = 0;
@@ -135,23 +133,20 @@ ven_dialer(num, acu)
}
void
-ven_disconnect()
+ven_disconnect(void)
{
-
close(FD);
}
void
-ven_abort()
+ven_abort(void)
{
-
write(FD, "\03", 1);
close(FD);
}
static void
-echo(s)
- char *s;
+echo(char *s)
{
char c;
@@ -173,8 +168,9 @@ echo(s)
}
}
+/*ARGSUSED*/
static void
-sigALRM()
+sigALRM(int signo)
{
printf("\07timeout waiting for reply\n");
dialtimeout = 1;
@@ -182,9 +178,7 @@ sigALRM()
}
static int
-gobble(match, response)
- char match;
- char response[];
+gobble(char match, char response[])
{
char *cp = response;
sig_t f;
@@ -219,7 +213,7 @@ gobble(match, response)
* there are gory ways to simulate this.
*/
static int
-vensync(fd)
+vensync(int fd)
{
int already = 0, nread;
char buf[60];
@@ -260,4 +254,3 @@ vensync(fd)
}
return (0);
}
-
diff --git a/usr.bin/tip/acutab.c b/usr.bin/tip/acutab.c
index 1d8a4ec23e0..85101f317e2 100644
--- a/usr.bin/tip/acutab.c
+++ b/usr.bin/tip/acutab.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: acutab.c,v 1.4 2003/06/03 02:56:18 millert Exp $ */
+/* $OpenBSD: acutab.c,v 1.5 2006/03/17 19:17:13 moritz Exp $ */
/* $NetBSD: acutab.c,v 1.3 1994/12/08 09:30:41 jtc Exp $ */
/*
@@ -34,24 +34,11 @@
#if 0
static char sccsid[] = "@(#)acutab.c 8.1 (Berkeley) 6/6/93";
#endif
-static const char rcsid[] = "$OpenBSD: acutab.c,v 1.4 2003/06/03 02:56:18 millert Exp $";
+static const char rcsid[] = "$OpenBSD: acutab.c,v 1.5 2006/03/17 19:17:13 moritz Exp $";
#endif /* not lint */
#include "tip.h"
-extern int df02_dialer(), df03_dialer(), df_disconnect(), df_abort(),
- biz31f_dialer(), biz31_disconnect(), biz31_abort(),
- biz31w_dialer(),
- biz22f_dialer(), biz22_disconnect(), biz22_abort(),
- biz22w_dialer(),
- ven_dialer(), ven_disconnect(), ven_abort(),
- hay_dialer(), hay_disconnect(), hay_abort(),
- cour_dialer(), cour_disconnect(), cour_abort(),
- t3000_dialer(), t3000_disconnect(), t3000_abort(),
- v3451_dialer(), v3451_disconnect(), v3451_abort(),
- v831_dialer(), v831_disconnect(), v831_abort(),
- dn_dialer(), dn_disconnect(), dn_abort();
-
acu_t acutable[] = {
#if BIZ1031
{ "biz31f", biz31f_dialer, biz31_disconnect, biz31_abort },
diff --git a/usr.bin/tip/tip.h b/usr.bin/tip/tip.h
index 8407e340848..3a7bdb1ea25 100644
--- a/usr.bin/tip/tip.h
+++ b/usr.bin/tip/tip.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: tip.h,v 1.22 2006/03/17 19:12:20 deraadt Exp $ */
+/* $OpenBSD: tip.h,v 1.23 2006/03/17 19:17:13 moritz Exp $ */
/* $NetBSD: tip.h,v 1.7 1997/04/20 00:02:46 mellon Exp $ */
/*
@@ -130,9 +130,9 @@ typedef
typedef
struct {
char *acu_name;
- int (*acu_dialer)();
- int (*acu_disconnect)();
- int (*acu_abort)();
+ int (*acu_dialer)(char *, char *);
+ void (*acu_disconnect)(void);
+ void (*acu_abort)(void);
}
acu_t;
@@ -275,24 +275,49 @@ char *expand(char *);
char *getremote(char *);
char *interp(char *);
int any(int, char *);
+int biz22w_dialer(char *, char *);
+int biz22f_dialer(char *, char *);
+int biz31w_dialer(char *, char *);
+int biz31f_dialer(char *, char *);
+int cour_dialer(char *, char *);
+int df02_dialer(char *, char *);
+int df03_dialer(char *, char *);
+int dn_dialer(char *, char *);
+int hay_dialer(char *, char *);
int prompt(char *, char *, size_t);
int size(char *);
+int t3000_dialer(char *, char *);
int ttysetup(int);
int uu_lock(char *);
int uu_unlock(char *);
+int v3451_dialer(char *, char *);
+int v831_dialer(char *, char *);
+int ven_dialer(char *, char *);
int vstring(char *, char *);
long hunt(char *);
+void biz22_disconnect(void);
+void biz22_abort(void);
+void biz31_disconnect(void);
+void biz31_abort(void);
void chdirectory(int);
void cleanup(int);
void consh(int);
+void cour_abort(void);
+void cour_disconnect(void);
void cu_put(int);
void cu_take(int);
void cumain(int, char **);
void daemon_uid(void);
+void df_abort(void);
+void df_disconnect(void);
void disconnect(char *);
+void dn_abort(void);
+void dn_disconnect(void);
void finish(int);
void genbrk(int);
void getfl(int);
+void hay_abort(void);
+void hay_disconnect(void);
void help(int);
void listvariables(int);
void logent(char *, char *, char *, char *);
@@ -307,11 +332,19 @@ void setscript(void);
void shell(int);
void shell_uid(void);
void suspend(int);
+void t3000_disconnect(void);
+void t3000_abort(void);
void timeout(int);
void tipabort(char *);
void tipout(void);
void user_uid(void);
void unraw(void);
+void v3451_abort(void);
+void v3451_disconnect(void);
+void v831_disconnect(void);
+void v831_abort(void);
void variable(int);
+void ven_disconnect(void);
+void ven_abort(void);
void vinit(void);
void vlex(char *);