-# $OpenBSD: Makefile,v 1.3 1996/07/26 20:35:31 dm Exp $
-# $NetBSD: Makefile,v 1.4 1994/12/08 09:30:36 jtc Exp $
+# $OpenBSD: Makefile,v 1.4 1997/04/02 01:47:00 millert Exp $
+# $NetBSD: Makefile,v 1.5 1996/12/29 10:36:37 cgd Exp $
+# @(#)Makefile 8.1 (Berkeley) 6/6/93
#
# Files are:
# /etc/remote remote host description file
# CONNECT enable ~C command (connect pgm to remote)
PROG= tip
-CFLAGS+=-I${.CURDIR} \
+CFLAGS+=-I${.CURDIR} -ansi -pedantic \
-DDEFBR=1200 -DDEFFS=BUFSIZ -DACULOG -DPRISTINE -DCONNECT \
-DV831 -DVENTEL -DHAYES -DCOURIER -DT3000
.PATH: ${.CURDIR}/aculib
BINOWN= uucp
BINGRP= dialer
-BINMODE=4554
+BINMODE=4510
SRCS= acu.c acutab.c cmds.c cmdtab.c cu.c hunt.c log.c partab.c \
remote.c tip.c tipout.c uucplock.c value.c vars.c \
biz22.c courier.c df.c dn11.c hayes.c t3000.c v3451.c v831.c ventel.c
-/* $OpenBSD: acu.c,v 1.2 1996/06/26 05:40:40 deraadt Exp $ */
-/* $NetBSD: acu.c,v 1.3 1994/12/08 09:30:39 jtc Exp $ */
+/* $OpenBSD: acu.c,v 1.3 1997/04/02 01:47:01 millert Exp $ */
+/* $NetBSD: acu.c,v 1.4 1996/12/29 10:34:03 cgd Exp $ */
/*
* Copyright (c) 1983, 1993
#if 0
static char sccsid[] = "@(#)acu.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: acu.c,v 1.2 1996/06/26 05:40:40 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: acu.c,v 1.3 1997/04/02 01:47:01 millert Exp $";
#endif /* not lint */
#include "tip.h"
printf("\ncall aborted\n");
logent(value(HOST), "", "", "call aborted");
if (acu != NOACU) {
- boolean(value(VERBOSE)) = FALSE;
+ setboolean(value(VERBOSE), FALSE);
if (conflag)
disconnect(NOSTR);
else
-/* $OpenBSD: biz22.c,v 1.3 1996/06/26 05:40:51 deraadt Exp $ */
-/* $NetBSD: biz22.c,v 1.4 1995/10/29 00:49:47 pk Exp $ */
+/* $OpenBSD: biz22.c,v 1.4 1997/04/02 01:47:05 millert Exp $ */
+/* $NetBSD: biz22.c,v 1.6 1997/02/11 09:24:11 mrg Exp $ */
/*
* Copyright (c) 1983, 1993
#if 0
static char sccsid[] = "@(#)biz22.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: biz22.c,v 1.3 1996/06/26 05:40:51 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: biz22.c,v 1.4 1997/04/02 01:47:05 millert Exp $";
#endif /* not lint */
#include "tip.h"
static int timeout = 0;
static jmp_buf timeoutbuf;
+static int cmd(), detect();
+
/*
* Dial up on a BIZCOMP Model 1022 with either
* tone dialing (mod = "V")
{
register int connected = 0;
char cbuf[40];
- static int cmd(), detect();
if (boolean(value(VERBOSE)))
printf("\nstarting call...");
printf("can't initialize bizcomp...");
return (0);
}
- strcpy(cbuf, "\02.\r");
+ (void)strcpy(cbuf, "\02.\r");
cbuf[1] = *mod;
if (cmd(cbuf)) {
printf("can't set dialing mode...");
return (0);
}
- strcpy(cbuf, "\02D");
- strcat(cbuf, num);
- strcat(cbuf, "\r");
+ (void)snprintf(cbuf, sizeof(cbuf), "\02D%s\r", num);
write(FD, cbuf, strlen(cbuf));
if (!detect("7\r")) {
printf("can't get dial tone...");
if (timeout) {
char line[80];
- sprintf(line, "%d second dial timeout",
+ (void)sprintf(line, "%d second dial timeout",
number(value(DIALTIMEOUT)));
logent(value(HOST), num, "biz1022", line);
}
-/* $OpenBSD: biz31.c,v 1.3 1996/06/26 05:40:51 deraadt Exp $ */
-/* $NetBSD: biz31.c,v 1.4 1995/10/29 00:49:48 pk Exp $ */
+/* $OpenBSD: biz31.c,v 1.4 1997/04/02 01:47:06 millert Exp $ */
+/* $NetBSD: biz31.c,v 1.5 1997/02/11 09:24:14 mrg Exp $ */
/*
* Copyright (c) 1983, 1993
#if 0
static char sccsid[] = "@(#)biz31.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: biz31.c,v 1.3 1996/06/26 05:40:51 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: biz31.c,v 1.4 1997/04/02 01:47:06 millert Exp $";
#endif /* not lint */
#include "tip.h"
if (timeout) {
char line[80];
- sprintf(line, "%d second dial timeout",
+ (void)sprintf(line, "%d second dial timeout",
number(value(DIALTIMEOUT)));
logent(value(HOST), num, "biz", line);
}
-/* $OpenBSD: courier.c,v 1.4 1997/01/17 07:13:34 millert Exp $ */
-/* $NetBSD: courier.c,v 1.5 1995/10/29 00:49:50 pk Exp $ */
+/* $OpenBSD: courier.c,v 1.5 1997/04/02 01:47:06 millert Exp $ */
+/* $NetBSD: courier.c,v 1.7 1997/02/11 09:24:16 mrg Exp $ */
/*
* Copyright (c) 1986, 1993
#if 0
static char sccsid[] = "@(#)courier.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: courier.c,v 1.4 1997/01/17 07:13:34 millert Exp $";
+static char rcsid[] = "$OpenBSD: courier.c,v 1.5 1997/04/02 01:47:06 millert Exp $";
#endif /* not lint */
/*
static int timeout = 0;
static int connected = 0;
static jmp_buf timeoutbuf, intbuf;
-static int coursync();
+static int coursync(), cour_connect(), cour_swallow();
+static void cour_napx();
cour_dialer(num, acu)
register char *num;
char line[80];
#endif
struct termios cntrl;
- static int cour_connect(), cour_swallow();
if (boolean(value(VERBOSE)))
printf("Using \"%s\"\n", acu);
connected = cour_connect();
#ifdef ACULOG
if (timeout) {
- sprintf(line, "%d second dial timeout",
+ (void)sprintf(line, "%d second dial timeout",
number(value(DIALTIMEOUT)));
logent(value(HOST), num, "cour", line);
}
cour_nap()
{
-
- static void cour_napx();
int omask;
struct itimerval itv, oitv;
register struct itimerval *itp = &itv;
-/* $OpenBSD: hayes.c,v 1.5 1997/01/17 07:13:36 millert Exp $ */
-/* $NetBSD: hayes.c,v 1.5 1996/11/01 23:56:33 cgd Exp $ */
+/* $OpenBSD: hayes.c,v 1.6 1997/04/02 01:47:06 millert Exp $ */
+/* $NetBSD: hayes.c,v 1.6 1997/02/11 09:24:17 mrg Exp $ */
/*
* Copyright (c) 1983, 1993
#if 0
static char sccsid[] = "@(#)hayes.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: hayes.c,v 1.5 1997/01/17 07:13:36 millert Exp $";
+static char rcsid[] = "$OpenBSD: hayes.c,v 1.6 1997/04/02 01:47:06 millert Exp $";
#endif /* not lint */
/*
tcflush(FD, TCIOFLUSH);
#ifdef ACULOG
if (timeout) {
- sprintf(line, "%d second dial timeout",
+ (void)sprintf(line, "%d second dial timeout",
number(value(DIALTIMEOUT)));
logent(value(HOST), num, "hayes", line);
}
-/* $OpenBSD: t3000.c,v 1.4 1997/01/17 07:13:37 millert Exp $ */
-/* $NetBSD: t3000.c,v 1.3 1995/10/29 00:49:57 pk Exp $ */
+/* $OpenBSD: t3000.c,v 1.5 1997/04/02 01:47:07 millert Exp $ */
+/* $NetBSD: t3000.c,v 1.5 1997/02/11 09:24:18 mrg Exp $ */
/*
* Copyright (c) 1992, 1993
#if 0
static char sccsid[] = "@(#)t3000.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: t3000.c,v 1.4 1997/01/17 07:13:37 millert Exp $";
+static char rcsid[] = "$OpenBSD: t3000.c,v 1.5 1997/04/02 01:47:07 millert Exp $";
#endif /* not lint */
/*
static int timeout = 0;
static int connected = 0;
static jmp_buf timeoutbuf, intbuf;
-static int t3000_sync();
+static int t3000_sync(), t3000_connect(), t3000_swallow();
+static void t3000_napx();
t3000_dialer(num, acu)
register char *num;
#ifdef ACULOG
char line[80];
#endif
- static int t3000_connect(), t3000_swallow();
if (boolean(value(VERBOSE)))
printf("Using \"%s\"\n", acu);
connected = t3000_connect();
#ifdef ACULOG
if (timeout) {
- sprintf(line, "%d second dial timeout",
+ (void)sprintf(line, "%d second dial timeout",
number(value(DIALTIMEOUT)));
logent(value(HOST), num, "t3000", line);
}
t3000_nap()
{
-
- static void t3000_napx();
int omask;
struct itimerval itv, oitv;
register struct itimerval *itp = &itv;
-/* $OpenBSD: v3451.c,v 1.3 1996/06/26 05:40:55 deraadt Exp $ */
-/* $NetBSD: v3451.c,v 1.4 1995/10/29 00:49:59 pk Exp $ */
+/* $OpenBSD: v3451.c,v 1.4 1997/04/02 01:47:07 millert Exp $ */
+/* $NetBSD: v3451.c,v 1.6 1997/02/11 09:24:20 mrg Exp $ */
/*
* Copyright (c) 1983, 1993
#if 0
static char sccsid[] = "@(#)v3451.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: v3451.c,v 1.3 1996/06/26 05:40:55 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: v3451.c,v 1.4 1997/04/02 01:47:07 millert Exp $";
#endif /* not lint */
/*
static jmp_buf Sjbuf;
+static int expect(), notin(), prefix();
+static void vawrite(), alarmtr();
+
v3451_dialer(num, acu)
register char *num;
char *acu;
#ifdef ACULOG
char line[80];
#endif
- static int expect();
- static void vawrite();
/*
* Get in synch
#endif
return (0);
}
- strcpy(phone, num);
- strcat(phone, "\r");
+ (void)snprintf(phone, sizeof phone, "%s\r", num);
vawrite(phone, 1 + slow);
if (!expect(phone)) {
printf("Vadic will not accept phone number\n");
char buf[300];
register char *rp = buf;
int timeout = 30, online = 0;
- static int notin();
- static void alarmtr();
if (strcmp(cp, "\"\"") == 0)
return (1);
notin(sh, lg)
char *sh, *lg;
{
- static int prefix();
for (; *lg; lg++)
if (prefix(sh, lg))
-/* $OpenBSD: v831.c,v 1.3 1996/06/26 05:40:56 deraadt Exp $ */
-/* $NetBSD: v831.c,v 1.4 1995/10/29 00:50:02 pk Exp $ */
+/* $OpenBSD: v831.c,v 1.4 1997/04/02 01:47:08 millert Exp $ */
+/* $NetBSD: v831.c,v 1.5 1996/12/29 10:42:01 cgd Exp $ */
/*
* Copyright (c) 1983, 1993
#if 0
static char sccsid[] = "@(#)v831.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: v831.c,v 1.3 1996/06/26 05:40:56 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: v831.c,v 1.4 1997/04/02 01:47:08 millert Exp $";
#endif /* not lint */
/*
int v831_abort();
static void alarmtr();
+static int dialit();
+static char *sanitize();
extern int errno;
static jmp_buf jmpbuf;
{
int status, pid, connected = 1;
register int timelim;
- static int dialit();
if (boolean(value(VERBOSE)))
printf("\nstarting call...");
struct termios cntrl;
char c;
int i, two = 2;
- static char *sanitize();
phonenum = sanitize(phonenum);
#ifdef DEBUG
-/* $OpenBSD: ventel.c,v 1.4 1997/01/17 07:13:38 millert Exp $ */
-/* $NetBSD: ventel.c,v 1.4 1995/10/29 00:50:04 pk Exp $ */
+/* $OpenBSD: ventel.c,v 1.5 1997/04/02 01:47:08 millert Exp $ */
+/* $NetBSD: ventel.c,v 1.6 1997/02/11 09:24:21 mrg Exp $ */
/*
* Copyright (c) 1983, 1993
#if 0
static char sccsid[] = "@(#)ventel.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: ventel.c,v 1.4 1997/01/17 07:13:38 millert Exp $";
+static char rcsid[] = "$OpenBSD: ventel.c,v 1.5 1997/04/02 01:47:08 millert Exp $";
#endif /* not lint */
/*
static int timeout = 0;
static jmp_buf timeoutbuf;
+static int gobble(), vensync();
+static void echo();
+
/*
* some sleep calls have been replaced by this macro
* because some ventel modems require two <cr>s in less than
register char *cp;
register int connected = 0;
char *msg, line[80];
- static int gobble(), vensync();
- static void echo();
struct termios cntrl;
/*
tcflush(FD, TCIOFLUSH);
#ifdef ACULOG
if (timeout) {
- sprintf(line, "%d second dial timeout",
+ (void)sprintf(line, "%d second dial timeout",
number(value(DIALTIMEOUT)));
logent(value(HOST), num, "ventel", line);
}
-/* $OpenBSD: cmds.c,v 1.4 1996/10/15 23:47:20 millert Exp $ */
-/* $NetBSD: cmds.c,v 1.6 1995/10/29 00:49:38 pk Exp $ */
+/* $OpenBSD: cmds.c,v 1.5 1997/04/02 01:47:01 millert Exp $ */
+/* $NetBSD: cmds.c,v 1.7 1997/02/11 09:24:03 mrg Exp $ */
/*
* Copyright (c) 1983, 1993
#if 0
static char sccsid[] = "@(#)cmds.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: cmds.c,v 1.4 1996/10/15 23:47:20 millert Exp $";
+static char rcsid[] = "$OpenBSD: cmds.c,v 1.5 1997/04/02 01:47:01 millert Exp $";
#endif /* not lint */
#include "tip.h"
printf("\r\n%s: cannot create\r\n", argv[1]);
return;
}
- snprintf(line, sizeof(line), "cat %s;echo \01", argv[0]);
+ (void)snprintf(line, sizeof(line), "cat %s;echo \01", argv[0]);
transfer(line, fd, "\01");
}
return;
}
if (boolean(value(ECHOCHECK)))
- snprintf(line, sizeof(line), "cat>%s\r", argv[1]);
+ (void)snprintf(line, sizeof(line), "cat>%s\r", argv[1]);
else
- snprintf(line, sizeof(line), "stty -echo;cat>%s;stty echo\r", argv[1]);
+ (void)snprintf(line, sizeof(line),
+ "stty -echo;cat>%s;stty echo\r", argv[1]);
transmit(fd, "\04", line);
}
/* signal(SIGINT, sigint) */
return(name);
}
- snprintf(cmdbuf, sizeof(cmdbuf), "echo %s", name);
+ (void)snprintf(cmdbuf, sizeof(cmdbuf), "echo %s", name);
if ((pid = vfork()) == 0) {
Shell = value(SHELL);
if (Shell == NOSTR)
-/* $OpenBSD: cu.c,v 1.2 1996/06/26 05:40:43 deraadt Exp $ */
-/* $NetBSD: cu.c,v 1.3 1994/12/08 09:30:48 jtc Exp $ */
+/* $OpenBSD: cu.c,v 1.3 1997/04/02 01:47:02 millert Exp $ */
+/* $NetBSD: cu.c,v 1.5 1997/02/11 09:24:05 mrg Exp $ */
/*
* Copyright (c) 1983, 1993
#if 0
static char sccsid[] = "@(#)cu.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: cu.c,v 1.2 1996/06/26 05:40:43 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: cu.c,v 1.3 1997/04/02 01:47:02 millert Exp $";
#endif /* not lint */
#include "tip.h"
* The "cu" host name is used to define the
* attributes of the generic dialer.
*/
- (void)sprintf(sbuf, "cu%d", BR);
+ (void)snprintf(sbuf, sizeof(sbuf), "cu%d", BR);
if ((i = hunt(sbuf)) == 0) {
printf("all ports busy\n");
exit(3);
user_uid();
vinit();
setparity("none");
- boolean(value(VERBOSE)) = 0;
+ setboolean(value(VERBOSE), 0);
if (HW)
ttysetup(speed(BR));
if (connect()) {
-/* $OpenBSD: partab.c,v 1.2 1996/06/26 05:40:44 deraadt Exp $ */
-/* $NetBSD: partab.c,v 1.3 1994/12/08 09:30:55 jtc Exp $ */
+/* $OpenBSD: partab.c,v 1.3 1997/04/02 01:47:02 millert Exp $ */
+/* $NetBSD: partab.c,v 1.4 1996/12/29 10:38:21 cgd Exp $ */
/*
* Copyright (c) 1983, 1993
#if 0
static char sccsid[] = "@(#)partab.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: partab.c,v 1.2 1996/06/26 05:40:44 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: partab.c,v 1.3 1997/04/02 01:47:02 millert Exp $";
#endif /* not lint */
/*
* Even parity table for 0-0177
*/
-char evenpartab[] = {
+const unsigned char evenpartab[] = {
0000,0201,0202,0003,0204,0005,0006,0207,
0210,0011,0012,0213,0014,0215,0216,0017,
0220,0021,0022,0223,0024,0225,0226,0027,
-/* $OpenBSD: remote.c,v 1.3 1996/10/15 23:47:21 millert Exp $ */
-/* $NetBSD: remote.c,v 1.3 1994/12/08 09:31:03 jtc Exp $ */
+/* $OpenBSD: remote.c,v 1.4 1997/04/02 01:47:02 millert Exp $ */
+/* $NetBSD: remote.c,v 1.4 1996/12/29 10:34:08 cgd Exp $ */
/*
* Copyright (c) 1992, 1993
#if 0
static char sccsid[] = "@(#)remote.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: remote.c,v 1.3 1996/10/15 23:47:21 millert Exp $";
+static char rcsid[] = "$OpenBSD: remote.c,v 1.4 1997/04/02 01:47:02 millert Exp $";
#endif /* not lint */
#include <stdio.h>
* see if uppercase mode should be turned on initially
*/
if (cgetflag("ra"))
- boolean(value(RAISE)) = 1;
+ setboolean(value(RAISE), 1);
if (cgetflag("ec"))
- boolean(value(ECHOCHECK)) = 1;
+ setboolean(value(ECHOCHECK), 1);
if (cgetflag("be"))
- boolean(value(BEAUTIFY)) = 1;
+ setboolean(value(BEAUTIFY), 1);
if (cgetflag("nb"))
- boolean(value(BEAUTIFY)) = 0;
+ setboolean(value(BEAUTIFY), 0);
if (cgetflag("sc"))
- boolean(value(SCRIPT)) = 1;
+ setboolean(value(SCRIPT), 1);
if (cgetflag("tb"))
- boolean(value(TABEXPAND)) = 1;
+ setboolean(value(TABEXPAND), 1);
if (cgetflag("vb"))
- boolean(value(VERBOSE)) = 1;
+ setboolean(value(VERBOSE), 1);
if (cgetflag("nv"))
- boolean(value(VERBOSE)) = 0;
+ setboolean(value(VERBOSE), 0);
if (cgetflag("ta"))
- boolean(value(TAND)) = 1;
+ setboolean(value(TAND), 1);
if (cgetflag("nt"))
- boolean(value(TAND)) = 0;
+ setboolean(value(TAND), 0);
if (cgetflag("rw"))
- boolean(value(RAWFTP)) = 1;
+ setboolean(value(RAWFTP), 1);
if (cgetflag("hd"))
- boolean(value(HALFDUPLEX)) = 1;
+ setboolean(value(HALFDUPLEX), 1);
if (RE == NOSTR)
RE = (char *)"tip.record";
if (EX == NOSTR)
-/* $OpenBSD: tip.c,v 1.3 1996/06/26 05:40:47 deraadt Exp $ */
-/* $NetBSD: tip.c,v 1.8 1995/10/29 00:49:42 pk Exp $ */
+/* $OpenBSD: tip.c,v 1.4 1997/04/02 01:47:03 millert Exp $ */
+/* $NetBSD: tip.c,v 1.11 1997/02/11 09:24:06 mrg Exp $ */
/*
* Copyright (c) 1983, 1993
#if 0
static char sccsid[] = "@(#)tip.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: tip.c,v 1.3 1996/06/26 05:40:47 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: tip.c,v 1.4 1997/04/02 01:47:03 millert Exp $";
#endif /* not lint */
/*
for (p = system; *p; p++)
*p = '\0';
PN = PNbuf;
- (void)sprintf(sbuf, "tip%d", BR);
+ (void)snprintf(sbuf, sizeof(sbuf), "tip%d", BR);
system = sbuf;
notnumber:
if (!(gch = escape()))
continue;
} else if (!cumode && gch == character(value(RAISECHAR))) {
- boolean(value(RAISE)) = !boolean(value(RAISE));
+ setboolean(value(RAISE), !boolean(value(RAISE)));
continue;
} else if (gch == '\r') {
bol = 1;
{
register int i, flip, clr, set;
char *parity;
- extern char evenpartab[];
+ extern const unsigned char evenpartab[];
if (value(PARITY) == NOSTR)
value(PARITY) = defparity;
-/* $OpenBSD: tip.h,v 1.4 1996/10/15 23:47:22 millert Exp $ */
-/* $NetBSD: tip.h,v 1.4 1995/10/29 00:49:43 pk Exp $ */
+/* $OpenBSD: tip.h,v 1.5 1997/04/02 01:47:03 millert Exp $ */
+/* $NetBSD: tip.h,v 1.5 1996/12/29 10:34:11 cgd Exp $ */
/*
* Copyright (c) 1989, 1993
* initialize it in vars.c, so we cast it as needed to keep lint
* happy.
*/
-typedef
- union {
- int zz_number;
- short zz_boolean[2];
- char zz_character[4];
- int *zz_address;
- }
- zzhack;
#define value(v) vtable[v].v_value
-#define number(v) ((((zzhack *)(&(v))))->zz_number)
-
-#if BYTE_ORDER == LITTLE_ENDIAN
-#define boolean(v) ((((zzhack *)(&(v))))->zz_boolean[0])
-#define character(v) ((((zzhack *)(&(v))))->zz_character[0])
-#endif
-
-#if BYTE_ORDER == BIG_ENDIAN
-#define boolean(v) ((((zzhack *)(&(v))))->zz_boolean[1])
-#define character(v) ((((zzhack *)(&(v))))->zz_character[3])
-#endif
+#define number(v) ((long)(v))
+#define boolean(v) ((short)(long)(v))
+#define character(v) ((char)(long)(v))
+#define address(v) ((long *)(v))
-#define address(v) ((((zzhack *)(&(v))))->zz_address)
+#define setnumber(v,n) do { (v) = (char *)(long)(n); } while (0)
+#define setboolean(v,n) do { (v) = (char *)(long)(n); } while (0)
+#define setcharacter(v,n) do { (v) = (char *)(long)(n); } while (0)
+#define setaddress(v,n) do { (v) = (char *)(n); } while (0)
/*
* Escape command table definitions --
-/* $OpenBSD: tipout.c,v 1.3 1996/06/26 05:40:48 deraadt Exp $ */
-/* $NetBSD: tipout.c,v 1.4 1995/10/29 00:49:45 pk Exp $ */
+/* $OpenBSD: tipout.c,v 1.4 1997/04/02 01:47:04 millert Exp $ */
+/* $NetBSD: tipout.c,v 1.5 1996/12/29 10:34:12 cgd Exp $ */
/*
* Copyright (c) 1983, 1993
#if 0
static char sccsid[] = "@(#)tipout.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: tipout.c,v 1.3 1996/06/26 05:40:48 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: tipout.c,v 1.4 1997/04/02 01:47:04 millert Exp $";
#endif /* not lint */
#include "tip.h"
if (boolean(value(SCRIPT)) && fscript != NULL)
fclose(fscript);
if (pline == line) {
- boolean(value(SCRIPT)) = FALSE;
+ setboolean(value(SCRIPT), FALSE);
reply = 'y';
} else {
if ((fscript = fopen(line, "a")) == NULL)
reply = 'n';
else {
reply = 'y';
- boolean(value(SCRIPT)) = TRUE;
+ setboolean(value(SCRIPT), TRUE);
}
}
write(repdes[1], &reply, 1);
intSYS()
{
- boolean(value(BEAUTIFY)) = !boolean(value(BEAUTIFY));
+ setboolean(value(BEAUTIFY), !boolean(value(BEAUTIFY)));
longjmp(sigbuf, 1);
}
-/* $OpenBSD: uucplock.c,v 1.2 1996/06/26 05:40:49 deraadt Exp $ */
-/* $NetBSD: uucplock.c,v 1.6 1995/09/26 06:02:14 jtc Exp $ */
+/* $OpenBSD: uucplock.c,v 1.3 1997/04/02 01:47:04 millert Exp $ */
+/* $NetBSD: uucplock.c,v 1.7 1997/02/11 09:24:08 mrg Exp $ */
/*
* Copyright (c) 1988, 1993
#if 0
static char sccsid[] = "@(#)uucplock.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: uucplock.c,v 1.2 1996/06/26 05:40:49 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: uucplock.c,v 1.3 1997/04/02 01:47:04 millert Exp $";
#endif /* not lint */
#include <stdio.h>
/* fall out and finish the locking process */
}
pid = getpid();
- sprintf(text_pid, "%10d\n", pid);
+ (void)sprintf(text_pid, "%10d\n", pid);
len = strlen(text_pid);
if (write(fd, text_pid, len) != len) {
(void)close(fd);
-/* $OpenBSD: value.c,v 1.3 1996/10/15 23:47:22 millert Exp $ */
-/* $NetBSD: value.c,v 1.3 1994/12/08 09:31:17 jtc Exp $ */
+/* $OpenBSD: value.c,v 1.4 1997/04/02 01:47:04 millert Exp $ */
+/* $NetBSD: value.c,v 1.6 1997/02/11 09:24:09 mrg Exp $ */
/*
* Copyright (c) 1983, 1993
#if 0
static char sccsid[] = "@(#)value.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: value.c,v 1.3 1996/10/15 23:47:22 millert Exp $";
+static char rcsid[] = "$OpenBSD: value.c,v 1.4 1997/04/02 01:47:04 millert Exp $";
#endif /* not lint */
#include "tip.h"
if (cp = getenv(p->v_name))
p->v_value = cp;
if (p->v_type&IREMOTE)
- number(p->v_value) = *address(p->v_value);
+ setnumber(p->v_value, *address(p->v_value));
}
/*
* Read the .tiprc file in the HOME directory
* for sets
*/
if (strlen(value(HOME)) + sizeof("/.tiprc") > sizeof(file)) {
- fprintf(stderr, "Home directory path too long: %s\n",
+ (void)fprintf(stderr, "Home directory path too long: %s\n",
value(HOME));
} else {
strcpy(file, value(HOME));
return;
if (!(p->v_type&(ENVIRON|INIT)))
free(p->v_value);
- if ((p->v_value = malloc(size(v)+1)) == NOSTR) {
+ if ((p->v_value = strdup(v)) == NOSTR) {
printf("out of core\r\n");
return;
}
p->v_type &= ~(ENVIRON|INIT);
- strcpy(p->v_value, v);
break;
case NUMBER:
if (number(p->v_value) == number(v))
return;
- number(p->v_value) = number(v);
+ setnumber(p->v_value, number(v));
break;
case BOOL:
if (boolean(p->v_value) == (*v != '!'))
return;
- boolean(p->v_value) = (*v != '!');
+ setboolean(p->v_value, (*v != '!'));
break;
case CHAR:
if (character(p->v_value) == *v)
return;
- character(p->v_value) = *v;
+ setcharacter(p->v_value, *v);
}
p->v_access |= CHANGED;
}
static void vprint();
+static void vtoken();
vlex(s)
register char *s;
{
register value_t *p;
- static void vtoken();
if (equal(s, "all")) {
for (p = vtable; p->v_name; p++)