summaryrefslogtreecommitdiff
path: root/usr.bin/tip/aculib
diff options
context:
space:
mode:
authorMoritz Jodeit <moritz@cvs.openbsd.org>2006-03-17 14:43:07 +0000
committerMoritz Jodeit <moritz@cvs.openbsd.org>2006-03-17 14:43:07 +0000
commitb678932bdb4b0fd73d046c7eb934809c2e3e605d (patch)
tree5466b01c4a9586066e4adb231293812efc59be2a /usr.bin/tip/aculib
parent6d052bb0ddd1b432e9e85fc458c8d131d179f76e (diff)
big prototype cleanup:
o make more functions static o add all the prototypes to tip.h o consistently declare functions in the cmd table testing and ok dhill@
Diffstat (limited to 'usr.bin/tip/aculib')
-rw-r--r--usr.bin/tip/aculib/biz22.c17
-rw-r--r--usr.bin/tip/aculib/courier.c16
-rw-r--r--usr.bin/tip/aculib/df.c21
-rw-r--r--usr.bin/tip/aculib/hayes.c14
-rw-r--r--usr.bin/tip/aculib/t3000.c16
-rw-r--r--usr.bin/tip/aculib/ventel.c16
6 files changed, 48 insertions, 52 deletions
diff --git a/usr.bin/tip/aculib/biz22.c b/usr.bin/tip/aculib/biz22.c
index 75a0d13f46b..702faf0e7b4 100644
--- a/usr.bin/tip/aculib/biz22.c
+++ b/usr.bin/tip/aculib/biz22.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: biz22.c,v 1.11 2003/06/03 02:56:18 millert Exp $ */
+/* $OpenBSD: biz22.c,v 1.12 2006/03/17 14:43:06 moritz Exp $ */
/* $NetBSD: biz22.c,v 1.6 1997/02/11 09:24:11 mrg Exp $ */
/*
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)biz22.c 8.1 (Berkeley) 6/6/93";
#endif
-static const char rcsid[] = "$OpenBSD: biz22.c,v 1.11 2003/06/03 02:56:18 millert Exp $";
+static const char rcsid[] = "$OpenBSD: biz22.c,v 1.12 2006/03/17 14:43:06 moritz Exp $";
#endif /* not lint */
#include "tip.h"
@@ -42,7 +42,7 @@ static const char rcsid[] = "$OpenBSD: biz22.c,v 1.11 2003/06/03 02:56:18 miller
#define DISCONNECT_CMD "\20\04" /* disconnection string */
static void sigALRM();
-static int timeout = 0;
+static int dialtimeout = 0;
static jmp_buf timeoutbuf;
static int cmd(), detect();
@@ -91,7 +91,7 @@ biz_dialer(num, mod)
*/
connected = detect("1\r");
#ifdef ACULOG
- if (timeout) {
+ if (dialtimeout) {
char line[80];
(void)snprintf(line, sizeof line, "%ld second dial timeout",
@@ -99,7 +99,7 @@ biz_dialer(num, mod)
logent(value(HOST), num, "biz1022", line);
}
#endif
- if (timeout)
+ if (dialtimeout)
biz22_disconnect(); /* insurance */
return (connected);
}
@@ -138,8 +138,7 @@ biz22_abort()
static void
sigALRM()
{
-
- timeout = 1;
+ dialtimeout = 1;
longjmp(timeoutbuf, 1);
}
@@ -173,7 +172,7 @@ detect(s)
char c;
f = signal(SIGALRM, sigALRM);
- timeout = 0;
+ dialtimeout = 0;
while (*s) {
if (setjmp(timeoutbuf)) {
biz22_abort();
@@ -187,5 +186,5 @@ detect(s)
return (0);
}
signal(SIGALRM, f);
- return (timeout == 0);
+ return (dialtimeout == 0);
}
diff --git a/usr.bin/tip/aculib/courier.c b/usr.bin/tip/aculib/courier.c
index 91350089355..0661f1e84f8 100644
--- a/usr.bin/tip/aculib/courier.c
+++ b/usr.bin/tip/aculib/courier.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: courier.c,v 1.13 2003/06/03 02:56:18 millert Exp $ */
+/* $OpenBSD: courier.c,v 1.14 2006/03/17 14:43:06 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.13 2003/06/03 02:56:18 millert Exp $";
+static const char rcsid[] = "$OpenBSD: courier.c,v 1.14 2006/03/17 14:43:06 moritz Exp $";
#endif /* not lint */
/*
@@ -49,7 +49,7 @@ static const char rcsid[] = "$OpenBSD: courier.c,v 1.13 2003/06/03 02:56:18 mill
static void cour_write(int fd, char *cp, int n);
static void sigALRM();
-static int timeout = 0;
+static int dialtimeout = 0;
static int connected = 0;
static jmp_buf timeoutbuf;
static int coursync(), cour_connect(), cour_swallow();
@@ -104,13 +104,13 @@ badsynch:
cour_write(FD, "\r", 1);
connected = cour_connect();
#ifdef ACULOG
- if (timeout) {
+ if (dialtimeout) {
(void)snprintf(line, sizeof line, "%ld second dial timeout",
number(value(DIALTIMEOUT)));
logent(value(HOST), num, "cour", line);
}
#endif
- if (timeout)
+ if (dialtimeout)
cour_disconnect();
return (connected);
}
@@ -137,7 +137,7 @@ static void
sigALRM()
{
printf("\07timeout waiting for reply\n");
- timeout = 1;
+ dialtimeout = 1;
longjmp(timeoutbuf, 1);
}
@@ -149,7 +149,7 @@ cour_swallow(match)
char c;
f = signal(SIGALRM, sigALRM);
- timeout = 0;
+ dialtimeout = 0;
do {
if (*match =='\0') {
signal(SIGALRM, f);
@@ -203,7 +203,7 @@ cour_connect()
again:
nc = 0; nl = sizeof(dialer_buf)-1;
bzero(dialer_buf, sizeof(dialer_buf));
- timeout = 0;
+ dialtimeout = 0;
for (nc = 0, nl = sizeof(dialer_buf)-1 ; nl > 0 ; nc++, nl--) {
if (setjmp(timeoutbuf))
break;
diff --git a/usr.bin/tip/aculib/df.c b/usr.bin/tip/aculib/df.c
index 85ceed0f613..78f3d2d32d7 100644
--- a/usr.bin/tip/aculib/df.c
+++ b/usr.bin/tip/aculib/df.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: df.c,v 1.7 2003/06/03 02:56:18 millert Exp $ */
+/* $OpenBSD: df.c,v 1.8 2006/03/17 14:43:06 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.7 2003/06/03 02:56:18 millert Exp $";
+static const char rcsid[] = "$OpenBSD: df.c,v 1.8 2006/03/17 14:43:06 moritz Exp $";
#endif /* not lint */
/*
@@ -44,9 +44,9 @@ static const char rcsid[] = "$OpenBSD: df.c,v 1.7 2003/06/03 02:56:18 millert Ex
#include "tip.h"
static jmp_buf Sjbuf;
-static void timeout();
-static int df_dialer(char *num, char *acu, int df03);
-static void df_disconnect();
+static void alrm_timeout(int);
+static int df_dialer(char *, char *, int);
+static void df_disconnect(void);
int
df02_dialer(num, acu)
@@ -100,7 +100,7 @@ df_dialer(num, acu, df03)
ioctl(f, TIOCMBIS, &st); /* set ST for 1200 baud */
}
#endif
- signal(SIGALRM, timeout);
+ signal(SIGALRM, alrm_timeout);
alarm(5 * strlen(num) + 10);
tcflush(f, TCIOFLUSH);
write(f, "\001", 1);
@@ -119,25 +119,22 @@ df_dialer(num, acu, df03)
}
void
-df_disconnect()
+df_disconnect(void)
{
write(FD, "\001", 1);
sleep(1);
tcflush(FD, TCIOFLUSH);
}
-
void
df_abort()
{
-
df_disconnect();
}
-
+/*ARGSUSED*/
static void
-timeout()
+alrm_timeout(int signo)
{
-
longjmp(Sjbuf, 1);
}
diff --git a/usr.bin/tip/aculib/hayes.c b/usr.bin/tip/aculib/hayes.c
index b8b06b56671..65f5f9eb81b 100644
--- a/usr.bin/tip/aculib/hayes.c
+++ b/usr.bin/tip/aculib/hayes.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hayes.c,v 1.11 2003/06/03 02:56:18 millert Exp $ */
+/* $OpenBSD: hayes.c,v 1.12 2006/03/17 14:43:06 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.11 2003/06/03 02:56:18 millert Exp $";
+static const char rcsid[] = "$OpenBSD: hayes.c,v 1.12 2006/03/17 14:43:06 moritz Exp $";
#endif /* not lint */
/*
@@ -68,7 +68,7 @@ static const char rcsid[] = "$OpenBSD: hayes.c,v 1.11 2003/06/03 02:56:18 miller
#define min(a,b) ((a < b) ? a : b)
static void sigALRM();
-static int timeout = 0;
+static int dialtimeout = 0;
static jmp_buf timeoutbuf;
static char gobble();
static void error_rep(char c);
@@ -131,13 +131,13 @@ hay_dialer(num, acu)
}
tcflush(FD, TCIOFLUSH);
#ifdef ACULOG
- if (timeout) {
+ if (dialtimeout) {
(void)snprintf(line, sizeof line, "%ld second dial timeout",
number(value(DIALTIMEOUT)));
logent(value(HOST), num, "hayes", line);
}
#endif
- if (timeout)
+ if (dialtimeout)
hay_disconnect(); /* insurance */
return (connected);
}
@@ -169,7 +169,7 @@ sigALRM()
{
printf("\07timeout waiting for reply\n\r");
- timeout = 1;
+ dialtimeout = 1;
longjmp(timeoutbuf, 1);
}
@@ -182,7 +182,7 @@ gobble(match)
int i, status = 0;
f = signal(SIGALRM, sigALRM);
- timeout = 0;
+ dialtimeout = 0;
#ifdef DEBUG
printf("\ngobble: waiting for %s\n", match);
#endif
diff --git a/usr.bin/tip/aculib/t3000.c b/usr.bin/tip/aculib/t3000.c
index 625c4c4a04c..f4331807902 100644
--- a/usr.bin/tip/aculib/t3000.c
+++ b/usr.bin/tip/aculib/t3000.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: t3000.c,v 1.12 2003/06/03 02:56:18 millert Exp $ */
+/* $OpenBSD: t3000.c,v 1.13 2006/03/17 14:43:06 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.12 2003/06/03 02:56:18 millert Exp $";
+static const char rcsid[] = "$OpenBSD: t3000.c,v 1.13 2006/03/17 14:43:06 moritz Exp $";
#endif /* not lint */
/*
@@ -49,7 +49,7 @@ static const char rcsid[] = "$OpenBSD: t3000.c,v 1.12 2003/06/03 02:56:18 miller
#define MAXRETRY 5
static void sigALRM();
-static int timeout = 0;
+static int dialtimeout = 0;
static int connected = 0;
static jmp_buf timeoutbuf;
static int t3000_sync(), t3000_connect(), t3000_swallow();
@@ -104,13 +104,13 @@ badsynch:
t3000_write(FD, "\r", 1);
connected = t3000_connect();
#ifdef ACULOG
- if (timeout) {
+ if (dialtimeout) {
(void)snprintf(line, sizeof line, "%ld second dial timeout",
number(value(DIALTIMEOUT)));
logent(value(HOST), num, "t3000", line);
}
#endif
- if (timeout)
+ if (dialtimeout)
t3000_disconnect();
return (connected);
}
@@ -137,7 +137,7 @@ static void
sigALRM()
{
printf("\07timeout waiting for reply\n");
- timeout = 1;
+ dialtimeout = 1;
longjmp(timeoutbuf, 1);
}
@@ -149,7 +149,7 @@ t3000_swallow(match)
char c;
f = signal(SIGALRM, sigALRM);
- timeout = 0;
+ dialtimeout = 0;
do {
if (*match =='\0') {
signal(SIGALRM, f);
@@ -217,7 +217,7 @@ t3000_connect()
again:
nc = 0; nl = sizeof(dialer_buf)-1;
bzero(dialer_buf, sizeof(dialer_buf));
- timeout = 0;
+ dialtimeout = 0;
for (nc = 0, nl = sizeof(dialer_buf)-1 ; nl > 0 ; nc++, nl--) {
if (setjmp(timeoutbuf))
break;
diff --git a/usr.bin/tip/aculib/ventel.c b/usr.bin/tip/aculib/ventel.c
index 523269392b2..94a9571e6c3 100644
--- a/usr.bin/tip/aculib/ventel.c
+++ b/usr.bin/tip/aculib/ventel.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ventel.c,v 1.10 2003/06/03 02:56:18 millert Exp $ */
+/* $OpenBSD: ventel.c,v 1.11 2006/03/17 14:43:06 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.10 2003/06/03 02:56:18 millert Exp $";
+static const char rcsid[] = "$OpenBSD: ventel.c,v 1.11 2006/03/17 14:43:06 moritz Exp $";
#endif /* not lint */
/*
@@ -48,7 +48,7 @@ static const char rcsid[] = "$OpenBSD: ventel.c,v 1.10 2003/06/03 02:56:18 mille
#define MAXRETRY 5
static void sigALRM();
-static int timeout = 0;
+static int dialtimeout = 0;
static jmp_buf timeoutbuf;
static int gobble(), vensync();
@@ -103,15 +103,15 @@ ven_dialer(num, acu)
connected = gobble('!', line);
tcflush(FD, TCIOFLUSH);
#ifdef ACULOG
- if (timeout) {
+ if (dialtimeout) {
(void)snprintf(line, sizeof line, "%ld second dial timeout",
number(value(DIALTIMEOUT)));
logent(value(HOST), num, "ventel", line);
}
#endif
- if (timeout)
+ if (dialtimeout)
ven_disconnect(); /* insurance */
- if (connected || timeout || !boolean(value(VERBOSE)))
+ if (connected || dialtimeout || !boolean(value(VERBOSE)))
return (connected);
/* call failed, parse response for user */
cp = strchr(line, '\r');
@@ -177,7 +177,7 @@ static void
sigALRM()
{
printf("\07timeout waiting for reply\n");
- timeout = 1;
+ dialtimeout = 1;
longjmp(timeoutbuf, 1);
}
@@ -191,7 +191,7 @@ gobble(match, response)
char c;
f = signal(SIGALRM, sigALRM);
- timeout = 0;
+ dialtimeout = 0;
do {
if (setjmp(timeoutbuf)) {
signal(SIGALRM, f);