WARNSify, fix .Nm usage, deprecate register, use <err.h>

This commit is contained in:
lukem 1997-10-19 05:02:57 +00:00
parent 1663c913e5
commit 7c81c8f378
27 changed files with 367 additions and 401 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: aux.c,v 1.5 1997/05/13 06:15:52 mikel Exp $ */
/* $NetBSD: aux.c,v 1.6 1997/10/19 05:02:57 lukem Exp $ */
/*
* Copyright (c) 1980, 1993
@ -33,11 +33,12 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)aux.c 8.1 (Berkeley) 6/6/93";
#else
static char rcsid[] = "$NetBSD: aux.c,v 1.5 1997/05/13 06:15:52 mikel Exp $";
__RCSID("$NetBSD: aux.c,v 1.6 1997/10/19 05:02:57 lukem Exp $");
#endif
#endif /* not lint */
@ -62,7 +63,7 @@ savestr(str)
int size = strlen(str) + 1;
if ((new = salloc(size)) != NOSTR)
bcopy(str, new, size);
memmove(new, str, size);
return new;
}
@ -79,46 +80,14 @@ save2str(str, old)
if ((new = salloc(newsize + oldsize)) != NOSTR) {
if (oldsize) {
bcopy(old, new, oldsize);
memmove(new, old, oldsize);
new[oldsize - 1] = ' ';
}
bcopy(str, new + oldsize, newsize);
memmove(new + oldsize, str, newsize);
}
return new;
}
/*
* Announce a fatal error and die.
*/
#if __STDC__
#include <stdarg.h>
#else
#include <varargs.h>
#endif
void
#if __STDC__
panic(const char *fmt, ...)
#else
panic(fmt, va_alist)
char *fmt;
va_dcl
#endif
{
va_list ap;
#if __STDC__
va_start(ap, fmt);
#else
va_start(ap);
#endif
(void)fprintf(stderr, "panic: ");
vfprintf(stderr, fmt, ap);
va_end(ap);
(void)fprintf(stderr, "\n");
fflush(stderr);
abort();
}
/*
* Touch the named message by setting its MTOUCH flag.
* Touched messages have the effect of not being sent
@ -126,7 +95,7 @@ panic(fmt, va_alist)
*/
void
touch(mp)
register struct message *mp;
struct message *mp;
{
mp->m_flag |= MTOUCH;
@ -156,7 +125,7 @@ int
argcount(argv)
char **argv;
{
register char **ap;
char **ap;
for (ap = argv; *ap++ != NOSTR;)
;
@ -172,10 +141,10 @@ hfield(field, mp)
char field[];
struct message *mp;
{
register FILE *ibuf;
FILE *ibuf;
char linebuf[LINESIZE];
register int lc;
register char *hfield;
int lc;
char *hfield;
char *colon, *oldhfield = NOSTR;
ibuf = setinput(mp);
@ -200,14 +169,14 @@ hfield(field, mp)
*/
int
gethfield(f, linebuf, rem, colon)
register FILE *f;
FILE *f;
char linebuf[];
register int rem;
int rem;
char **colon;
{
char line2[LINESIZE];
register char *cp, *cp2;
register int c;
char *cp, *cp2;
int c;
for (;;) {
if (--rem < 0)
@ -243,7 +212,7 @@ gethfield(f, linebuf, rem, colon)
if (cp + c >= linebuf + LINESIZE - 2)
break;
*cp++ = ' ';
bcopy(cp2, cp, c);
memmove(cp, cp2, c);
cp += c;
}
*cp = 0;
@ -262,7 +231,7 @@ ishfield(linebuf, colon, field)
char linebuf[], field[];
char *colon;
{
register char *cp = colon;
char *cp = colon;
*cp = 0;
if (strcasecmp(linebuf, field) != 0) {
@ -280,7 +249,7 @@ ishfield(linebuf, colon, field)
*/
void
istrcpy(dest, src)
register char *dest, *src;
char *dest, *src;
{
do {
@ -390,7 +359,7 @@ int
blankline(linebuf)
char linebuf[];
{
register char *cp;
char *cp;
for (cp = linebuf; *cp; cp++)
if (*cp != ' ' && *cp != '\t')
@ -405,10 +374,10 @@ blankline(linebuf)
*/
char *
nameof(mp, reptype)
register struct message *mp;
struct message *mp;
int reptype;
{
register char *cp, *cp2;
char *cp, *cp2;
cp = skin(name1(mp, reptype));
if (reptype != 0 || charcount(cp, '!') < 2)
@ -428,9 +397,9 @@ nameof(mp, reptype)
*/
char *
skip_comment(cp)
register char *cp;
char *cp;
{
register nesting = 1;
int nesting = 1;
for (; nesting > 0 && *cp; cp++) {
switch (*cp) {
@ -457,8 +426,8 @@ char *
skin(name)
char *name;
{
register int c;
register char *cp, *cp2;
int c;
char *cp, *cp2;
char *bufend;
int gotlt, lastsp;
char nbuf[BUFSIZ];
@ -563,13 +532,13 @@ skin(name)
*/
char *
name1(mp, reptype)
register struct message *mp;
struct message *mp;
int reptype;
{
char namebuf[LINESIZE];
char linebuf[LINESIZE];
register char *cp, *cp2;
register FILE *ibuf;
char *cp, *cp2;
FILE *ibuf;
int first = 1;
if ((cp = hfield("from", mp)) != NOSTR)
@ -632,8 +601,8 @@ charcount(str, c)
char *str;
int c;
{
register char *cp;
register int i;
char *cp;
int i;
for (i = 0, cp = str; *cp; cp++)
if (*cp == c)
@ -646,7 +615,7 @@ charcount(str, c)
*/
int
anyof(s1, s2)
register char *s1, *s2;
char *s1, *s2;
{
while (*s1)
@ -660,7 +629,7 @@ anyof(s1, s2)
*/
int
raise(c)
register int c;
int c;
{
if (islower(c))
@ -673,7 +642,7 @@ raise(c)
*/
char *
copy(s1, s2)
register char *s1, *s2;
char *s1, *s2;
{
while ((*s2++ = *s1++) != '\0')
@ -706,10 +675,10 @@ isign(field, ignore)
int
member(realfield, table)
register char *realfield;
char *realfield;
struct ignoretab *table;
{
register struct ignore *igp;
struct ignore *igp;
for (igp = table->i_head[hash(realfield)]; igp != 0; igp = igp->i_link)
if (*igp->i_field == *realfield &&

View File

@ -1,4 +1,4 @@
/* $NetBSD: cmd1.c,v 1.9 1997/07/09 05:29:48 mikel Exp $ */
/* $NetBSD: cmd1.c,v 1.10 1997/10/19 05:03:00 lukem Exp $ */
/*-
* Copyright (c) 1980, 1993
@ -33,11 +33,12 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)cmd1.c 8.2 (Berkeley) 4/20/95";
#else
static char rcsid[] = "$NetBSD: cmd1.c,v 1.9 1997/07/09 05:29:48 mikel Exp $";
__RCSID("$NetBSD: cmd1.c,v 1.10 1997/10/19 05:03:00 lukem Exp $");
#endif
#endif /* not lint */
@ -62,8 +63,8 @@ headers(v)
void *v;
{
int *msgvec = v;
register int n, mesg, flag;
register struct message *mp;
int n, mesg, flag;
struct message *mp;
int size;
size = screensize();
@ -104,7 +105,7 @@ scroll(v)
void *v;
{
char *arg = v;
register int s, size;
int s, size;
int cur[1];
cur[0] = 0;
@ -159,7 +160,7 @@ from(v)
void *v;
{
int *msgvec = v;
register int *ip;
int *ip;
for (ip = msgvec; *ip != 0; ip++)
printhead(*ip);
@ -235,8 +236,8 @@ pcmdlist(v)
void *v;
{
extern const struct cmd cmdtab[];
register const struct cmd *cp;
register int cc;
const struct cmd *cp;
int cc;
printf("Commands are:\n");
for (cc = 0, cp = cmdtab; cp->c_name != NULL; cp++) {
@ -309,7 +310,7 @@ type1(msgvec, doign, page)
int *msgvec;
int doign, page;
{
register *ip;
int *ip;
struct message *mp;
char *cp;
int nlines;
@ -383,8 +384,8 @@ top(v)
void *v;
{
int *msgvec = v;
register int *ip;
register struct message *mp;
int *ip;
struct message *mp;
int c, topl, lines, lineb;
char *valtop, linebuf[LINESIZE];
FILE *ibuf;
@ -426,7 +427,7 @@ stouch(v)
void *v;
{
int *msgvec = v;
register int *ip;
int *ip;
for (ip = msgvec; *ip != 0; ip++) {
dot = &message[*ip-1];
@ -444,7 +445,7 @@ mboxit(v)
void *v;
{
int *msgvec = v;
register int *ip;
int *ip;
for (ip = msgvec; *ip != 0; ip++) {
dot = &message[*ip-1];

View File

@ -1,4 +1,4 @@
/* $NetBSD: cmd2.c,v 1.7 1997/05/17 19:55:10 pk Exp $ */
/* $NetBSD: cmd2.c,v 1.8 1997/10/19 05:03:03 lukem Exp $ */
/*
* Copyright (c) 1980, 1993
@ -33,16 +33,16 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)cmd2.c 8.1 (Berkeley) 6/6/93";
#else
static char rcsid[] = "$NetBSD: cmd2.c,v 1.7 1997/05/17 19:55:10 pk Exp $";
__RCSID("$NetBSD: cmd2.c,v 1.8 1997/10/19 05:03:03 lukem Exp $");
#endif
#endif /* not lint */
#include "rcv.h"
#include <sys/wait.h>
#include "extern.h"
/*
@ -62,8 +62,8 @@ next(v)
void *v;
{
int *msgvec = v;
register struct message *mp;
register int *ip, *ip2;
struct message *mp;
int *ip, *ip2;
int list[2], mdot;
if (*msgvec != 0) {
@ -169,8 +169,8 @@ save1(str, mark, cmd, ignore)
char *cmd;
struct ignoretab *ignore;
{
register int *ip;
register struct message *mp;
int *ip;
struct message *mp;
char *file, *disp;
int f, *msgvec;
FILE *obuf;
@ -246,7 +246,7 @@ snarf(linebuf, flag)
char linebuf[];
int *flag;
{
register char *cp;
char *cp;
*flag = 1;
cp = strlen(linebuf) + linebuf - 1;
@ -322,8 +322,8 @@ int
delm(msgvec)
int *msgvec;
{
register struct message *mp;
register *ip;
struct message *mp;
int *ip;
int last;
last = 0;
@ -362,8 +362,8 @@ undeletecmd(v)
void *v;
{
int *msgvec = v;
register struct message *mp;
register *ip;
struct message *mp;
int *ip;
for (ip = msgvec; *ip && ip-msgvec < msgCount; ip++) {
mp = &message[*ip - 1];
@ -410,7 +410,7 @@ clobber(v)
void *v;
{
char **argv = v;
register int times;
int times;
if (argv[0] == 0)
times = 1;
@ -428,7 +428,7 @@ clob1(n)
int n;
{
char buf[512];
register char *cp;
char *cp;
if (n <= 0)
return;
@ -488,8 +488,8 @@ ignore1(list, tab, which)
char *which;
{
char field[LINESIZE];
register int h;
register struct ignore *igp;
int h;
struct ignore *igp;
char **ap;
if (*list == NOSTR)
@ -518,7 +518,7 @@ igshow(tab, which)
struct ignoretab *tab;
char *which;
{
register int h;
int h;
struct ignore *igp;
char **ap, **ring;

View File

@ -1,4 +1,4 @@
/* $NetBSD: cmd3.c,v 1.8 1997/07/09 05:29:49 mikel Exp $ */
/* $NetBSD: cmd3.c,v 1.9 1997/10/19 05:03:05 lukem Exp $ */
/*
* Copyright (c) 1980, 1993
@ -33,11 +33,12 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)cmd3.c 8.2 (Berkeley) 4/20/95";
#else
static char rcsid[] = "$NetBSD: cmd3.c,v 1.8 1997/07/09 05:29:49 mikel Exp $";
__RCSID("$NetBSD: cmd3.c,v 1.9 1997/10/19 05:03:05 lukem Exp $");
#endif
#endif /* not lint */
@ -106,8 +107,8 @@ bangexp(str)
char *str;
{
char bangbuf[BUFSIZ];
register char *cp, *cp2;
register int n;
char *cp, *cp2;
int n;
int changed = 0;
cp = str;
@ -157,8 +158,8 @@ int
help(v)
void *v;
{
register c;
register FILE *f;
int c;
FILE *f;
if ((f = Fopen(_PATH_HELP, "r")) == NULL) {
perror(_PATH_HELP);
@ -273,7 +274,7 @@ _respond(msgvec)
*/
char *
reedit(subj)
register char *subj;
char *subj;
{
char *newsubj;
@ -298,8 +299,8 @@ preserve(v)
void *v;
{
int *msgvec = v;
register struct message *mp;
register int *ip, mesg;
struct message *mp;
int *ip, mesg;
if (edit) {
printf("Cannot \"preserve\" in edit mode\n");
@ -322,8 +323,8 @@ int
unread(v)
void *v;
{
int *msgvec = v;
register int *ip;
int *msgvec = v;
int *ip;
for (ip = msgvec; *ip != 0; ip++) {
dot = &message[*ip-1];
@ -341,8 +342,8 @@ messize(v)
void *v;
{
int *msgvec = v;
register struct message *mp;
register int *ip, mesg;
struct message *mp;
int *ip, mesg;
for (ip = msgvec; *ip != 0; ip++) {
mesg = *ip;
@ -375,8 +376,8 @@ set(v)
void *v;
{
char **arglist = v;
register struct var *vp;
register char *cp, *cp2;
struct var *vp;
char *cp, *cp2;
char varbuf[BUFSIZ], **ap, **p;
int errs, h, s;
@ -423,7 +424,7 @@ unset(v)
void *v;
{
char **arglist = v;
register struct var *vp, *vp2;
struct var *vp, *vp2;
int errs, h;
char **ap;
@ -462,9 +463,9 @@ group(v)
void *v;
{
char **argv = v;
register struct grouphead *gh;
register struct group *gp;
register int h;
struct grouphead *gh;
struct group *gp;
int h;
int s;
char **ap, *gname, **p;
@ -519,7 +520,7 @@ void
sort(list)
char **list;
{
register char **ap;
char **ap;
for (ap = list; *ap != NOSTR; ap++)
;
@ -579,8 +580,8 @@ echo(v)
void *v;
{
char **argv = v;
register char **ap;
register char *cp;
char **ap;
char *cp;
for (ap = argv; *ap != NOSTR; ap++) {
cp = *ap;
@ -616,8 +617,8 @@ _Respond(msgvec)
{
struct header head;
struct message *mp;
register int *ap;
register char *cp;
int *ap;
char *cp;
head.h_to = NIL;
for (ap = msgvec; *ap != 0; ap++) {
@ -650,7 +651,7 @@ ifcmd(v)
void *v;
{
char **argv = v;
register char *cp;
char *cp;
if (cond != CANY) {
printf("Illegal nested \"if\"\n");
@ -728,8 +729,8 @@ alternates(v)
void *v;
{
char **namelist = v;
register int c;
register char **ap, **ap2, *cp;
int c;
char **ap, **ap2, *cp;
c = argcount(namelist) + 1;
if (c == 1) {

View File

@ -1,4 +1,4 @@
/* $NetBSD: cmdtab.c,v 1.7 1996/12/28 07:10:59 tls Exp $ */
/* $NetBSD: cmdtab.c,v 1.8 1997/10/19 05:03:08 lukem Exp $ */
/*
* Copyright (c) 1980, 1993
@ -33,11 +33,12 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)cmdtab.c 8.2 (Berkeley) 4/20/95";
#else
static char rcsid[] = "$NetBSD: cmdtab.c,v 1.7 1996/12/28 07:10:59 tls Exp $";
__RCSID("$NetBSD: cmdtab.c,v 1.8 1997/10/19 05:03:08 lukem Exp $");
#endif
#endif /* not lint */

View File

@ -1,4 +1,4 @@
/* $NetBSD: collect.c,v 1.10 1997/09/25 19:56:15 christos Exp $ */
/* $NetBSD: collect.c,v 1.11 1997/10/19 05:03:10 lukem Exp $ */
/*
* Copyright (c) 1980, 1993
@ -33,11 +33,12 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)collect.c 8.2 (Berkeley) 4/19/94";
#else
static char rcsid[] = "$NetBSD: collect.c,v 1.10 1997/09/25 19:56:15 christos Exp $";
__RCSID("$NetBSD: collect.c,v 1.11 1997/10/19 05:03:10 lukem Exp $");
#endif
#endif /* not lint */
@ -81,7 +82,7 @@ collect(hp, printheaders)
{
FILE *fbuf;
int lc, cc, escape, eofcount;
register int c, t;
int c, t;
char linebuf[LINESIZE], *cp;
extern char *tempMail;
char getsub;
@ -421,8 +422,8 @@ exwrite(name, fp, f)
FILE *fp;
int f;
{
register FILE *of;
register int c;
FILE *of;
int c;
long cc;
int lc;
struct stat junk;
@ -541,7 +542,7 @@ forward(ms, fp, f)
FILE *fp;
int f;
{
register int *msgvec;
int *msgvec;
extern char *tempMail;
struct ignoretab *ig;
char *tabst;
@ -647,10 +648,10 @@ collhup(s)
void
savedeadletter(fp)
register FILE *fp;
FILE *fp;
{
register FILE *dbuf;
register int c;
FILE *dbuf;
int c;
char *cp;
if (fsize(fp) == 0)

View File

@ -1,4 +1,4 @@
/* $NetBSD: def.h,v 1.9 1996/12/28 07:11:00 tls Exp $ */
/* $NetBSD: def.h,v 1.10 1997/10/19 05:03:12 lukem Exp $ */
/*
* Copyright (c) 1980, 1993
* The Regents of the University of California. All rights reserved.
@ -32,7 +32,7 @@
* SUCH DAMAGE.
*
* @(#)def.h 8.4 (Berkeley) 4/20/95
* $NetBSD: def.h,v 1.9 1996/12/28 07:11:00 tls Exp $
* $NetBSD: def.h,v 1.10 1997/10/19 05:03:12 lukem Exp $
*/
/*
@ -41,17 +41,26 @@
* Author: Kurt Shoens (UCB) March 25, 1978
*/
#include <sys/param.h>
#include <sys/types.h>
#include <sys/file.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
#include <sys/param.h>
#include <sys/time.h>
#include <sys/wait.h>
#include <ctype.h>
#include <err.h>
#include <errno.h>
#include <fcntl.h>
#include <paths.h>
#include <pwd.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <termios.h>
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>
#include <string.h>
#include "pathnames.h"
#define APPEND /* New mail goes to end of mailbox */

View File

@ -1,4 +1,4 @@
/* $NetBSD: dotlock.c,v 1.1 1996/06/08 19:48:19 christos Exp $ */
/* $NetBSD: dotlock.c,v 1.2 1997/10/19 05:03:16 lukem Exp $ */
/*
* Copyright (c) 1996 Christos Zoulas. All rights reserved.
@ -29,23 +29,12 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#ifndef lint
static char rcsid[] = "$NetBSD: dotlock.c,v 1.1 1996/06/08 19:48:19 christos Exp $";
__RCSID("$NetBSD: dotlock.c,v 1.2 1997/10/19 05:03:16 lukem Exp $");
#endif
#include <sys/types.h>
#include <sys/param.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <stdio.h>
#include <string.h>
#include <fcntl.h>
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
#include <signal.h>
#include "rcv.h"
#include "extern.h"
#ifndef O_SYNC

View File

@ -1,4 +1,4 @@
/* $NetBSD: edit.c,v 1.5 1996/06/08 19:48:20 christos Exp $ */
/* $NetBSD: edit.c,v 1.6 1997/10/19 05:03:18 lukem Exp $ */
/*
* Copyright (c) 1980, 1993
@ -33,16 +33,16 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)edit.c 8.1 (Berkeley) 6/6/93";
#else
static char rcsid[] = "$NetBSD: edit.c,v 1.5 1996/06/08 19:48:20 christos Exp $";
__RCSID("$NetBSD: edit.c,v 1.6 1997/10/19 05:03:18 lukem Exp $");
#endif
#endif /* not lint */
#include "rcv.h"
#include <fcntl.h>
#include "extern.h"
/*
@ -85,10 +85,10 @@ edit1(msgvec, type)
int *msgvec;
int type;
{
register int c;
int c;
int i;
FILE *fp;
register struct message *mp;
struct message *mp;
off_t size;
/*
@ -147,12 +147,12 @@ edit1(msgvec, type)
*/
FILE *
run_editor(fp, size, type, readonly)
register FILE *fp;
FILE *fp;
off_t size;
int type, readonly;
{
register FILE *nf = NULL;
register int t;
FILE *nf = NULL;
int t;
time_t modtime;
char *edit;
struct stat statb;

View File

@ -1,4 +1,4 @@
/* $NetBSD: extern.h,v 1.7 1997/07/09 05:22:00 mikel Exp $ */
/* $NetBSD: extern.h,v 1.8 1997/10/19 05:03:20 lukem Exp $ */
/*-
* Copyright (c) 1992, 1993
@ -33,7 +33,7 @@
* SUCH DAMAGE.
*
* @(#)extern.h 8.2 (Berkeley) 4/20/95
* $NetBSD: extern.h,v 1.7 1997/07/09 05:22:00 mikel Exp $
* $NetBSD: extern.h,v 1.8 1997/10/19 05:03:20 lukem Exp $
*/
struct name;
@ -189,8 +189,6 @@ int more __P((void *));
int newfileinfo __P((int));
int next __P((void *));
int null __P((void *));
void panic __P((const char *, ...))
__attribute__((__format__(__printf__,1,2),__noreturn__));
struct headline;
void parse __P((char [], struct headline *, char []));
int pcmdlist __P((void *));

View File

@ -1,4 +1,4 @@
/* $NetBSD: fio.c,v 1.9 1997/10/18 15:48:48 matt Exp $ */
/* $NetBSD: fio.c,v 1.10 1997/10/19 05:03:22 lukem Exp $ */
/*
* Copyright (c) 1980, 1993
@ -33,21 +33,16 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)fio.c 8.2 (Berkeley) 4/20/95";
#else
static char rcsid[] = "$NetBSD: fio.c,v 1.9 1997/10/18 15:48:48 matt Exp $";
__RCSID("$NetBSD: fio.c,v 1.10 1997/10/19 05:03:22 lukem Exp $");
#endif
#endif /* not lint */
#include "rcv.h"
#include <sys/file.h>
#include <sys/wait.h>
#include <unistd.h>
#include <paths.h>
#include <errno.h>
#include "extern.h"
/*
@ -61,12 +56,12 @@ static char rcsid[] = "$NetBSD: fio.c,v 1.9 1997/10/18 15:48:48 matt Exp $";
*/
void
setptr(ibuf, offset)
register FILE *ibuf;
FILE *ibuf;
off_t offset;
{
extern char *tmpdir;
register int c, count;
register char *cp, *cp2;
int c, count;
char *cp, *cp2;
struct message this;
FILE *mestmp;
int maybe, inhead;
@ -180,7 +175,7 @@ putline(obuf, linebuf, outlf)
char *linebuf;
int outlf;
{
register int c;
int c;
c = strlen(linebuf);
(void) fwrite(linebuf, sizeof *linebuf, c, obuf);
@ -204,7 +199,7 @@ readline(ibuf, linebuf, linesize)
char *linebuf;
int linesize;
{
register int n;
int n;
clearerr(ibuf);
if (fgets(linebuf, linesize, ibuf) == NULL)
@ -221,14 +216,12 @@ readline(ibuf, linebuf, linesize)
*/
FILE *
setinput(mp)
register struct message *mp;
struct message *mp;
{
fflush(otf);
if (fseek(itf, (long)positionof(mp->m_block, mp->m_offset), 0) < 0) {
perror("fseek");
panic("temporary file seek");
}
if (fseek(itf, (long)positionof(mp->m_block, mp->m_offset), 0) < 0)
err(1, "fseek");
return (itf);
}
@ -241,25 +234,26 @@ makemessage(f, omsgCount)
FILE *f;
int omsgCount;
{
register size = (msgCount + 1) * sizeof (struct message);
int size = (msgCount + 1) * sizeof (struct message);
if (omsgCount) {
message = (struct message *)realloc(message, (unsigned) size);
if (message == 0)
panic("Insufficient memory for %d messages\n",
errx(1, "Insufficient memory for %d messages\n",
msgCount);
} else {
if (message != 0)
free((char *) message);
if ((message = (struct message *) malloc((unsigned) size)) == 0)
panic("Insufficient memory for %d messages", msgCount);
errx(1, "Insufficient memory for %d messages",
msgCount);
dot = message;
}
size -= (omsgCount + 1) * sizeof (struct message);
fflush(f);
(void) lseek(fileno(f), (off_t)sizeof *message, 0);
if (read(fileno(f), (char *) &message[omsgCount], size) != size)
panic("Message temporary file corrupted");
errx(1, "Message temporary file corrupted");
message[msgCount].m_size = 0;
message[msgCount].m_lines = 0;
Fclose(f);
@ -352,12 +346,12 @@ fsize(iob)
*/
char *
expand(name)
register char *name;
char *name;
{
char xname[PATHSIZE];
char cmdbuf[PATHSIZE]; /* also used for file names */
register int pid, l;
register char *cp, *shell;
int pid, l;
char *cp, *shell;
int pivec[2];
struct stat sbuf;
extern union wait wait_status;
@ -465,7 +459,7 @@ getfold(name)
char *
getdeadletter()
{
register char *cp;
char *cp;
if ((cp = value("DEAD")) == NOSTR || (cp = expand(cp)) == NOSTR)
cp = expand("~/dead.letter");

View File

@ -1,4 +1,4 @@
/* $NetBSD: getname.c,v 1.4 1996/06/08 19:48:23 christos Exp $ */
/* $NetBSD: getname.c,v 1.5 1997/10/19 05:03:24 lukem Exp $ */
/*
* Copyright (c) 1980, 1993
@ -33,16 +33,16 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)getname.c 8.1 (Berkeley) 6/6/93";
#else
static char rcsid[] = "$NetBSD: getname.c,v 1.4 1996/06/08 19:48:23 christos Exp $";
__RCSID("$NetBSD: getname.c,v 1.5 1997/10/19 05:03:24 lukem Exp $");
#endif
#endif /* not lint */
#include "rcv.h"
#include <pwd.h>
#include "extern.h"
/* Getname / getuserid for those with hashed passwd data base). */

View File

@ -1,4 +1,4 @@
/* $NetBSD: head.c,v 1.6 1996/12/28 07:11:03 tls Exp $ */
/* $NetBSD: head.c,v 1.7 1997/10/19 05:03:26 lukem Exp $ */
/*
* Copyright (c) 1980, 1993
@ -33,11 +33,12 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)head.c 8.2 (Berkeley) 4/20/95";
#else
static char rcsid[] = "$NetBSD: head.c,v 1.6 1996/12/28 07:11:03 tls Exp $";
__RCSID("$NetBSD: head.c,v 1.7 1997/10/19 05:03:26 lukem Exp $");
#endif
#endif /* not lint */
@ -59,7 +60,7 @@ int
ishead(linebuf)
char linebuf[];
{
register char *cp;
char *cp;
struct headline hl;
char parbuf[BUFSIZ];
@ -104,9 +105,9 @@ fail(linebuf, reason)
void
parse(line, hl, pbuf)
char line[], pbuf[];
register struct headline *hl;
struct headline *hl;
{
register char *cp;
char *cp;
char *sp;
char word[LINESIZE];
@ -138,10 +139,10 @@ parse(line, hl, pbuf)
*/
char *
copyin(src, space)
register char *src;
char *src;
char **space;
{
register char *cp;
char *cp;
char *top;
top = cp = *space;
@ -189,7 +190,7 @@ isdate(date)
*/
int
cmatch(cp, tp)
register char *cp, *tp;
char *cp, *tp;
{
while (*cp && *tp)
@ -236,9 +237,9 @@ cmatch(cp, tp)
*/
char *
nextword(wp, wbuf)
register char *wp, *wbuf;
char *wp, *wbuf;
{
register c;
int c;
if (wp == NOSTR) {
*wbuf = 0;

View File

@ -1,4 +1,4 @@
/* $NetBSD: lex.c,v 1.10 1997/05/17 19:55:13 pk Exp $ */
/* $NetBSD: lex.c,v 1.11 1997/10/19 05:03:29 lukem Exp $ */
/*
* Copyright (c) 1980, 1993
@ -33,17 +33,16 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)lex.c 8.2 (Berkeley) 4/20/95";
#else
static char rcsid[] = "$NetBSD: lex.c,v 1.10 1997/05/17 19:55:13 pk Exp $";
__RCSID("$NetBSD: lex.c,v 1.11 1997/10/19 05:03:29 lukem Exp $");
#endif
#endif /* not lint */
#include "rcv.h"
#include <errno.h>
#include <fcntl.h>
#include "extern.h"
/*
@ -208,7 +207,7 @@ void
commands()
{
int eofloop = 0;
register int n;
int n;
char linebuf[LINESIZE];
#if __GNUC__
/* Avoid longjmp clobbering */
@ -294,8 +293,8 @@ execute(linebuf, contxt)
char word[LINESIZE];
char *arglist[MAXARGC];
const struct cmd *com = NULL;
register char *cp, *cp2;
register int c;
char *cp, *cp2;
int c;
int muvec[2];
int e = 1;
@ -451,7 +450,7 @@ execute(linebuf, contxt)
break;
default:
panic("Unknown argtype");
errx(1, "Unknown argtype");
}
out:
@ -505,7 +504,7 @@ lex(word)
char word[];
{
extern const struct cmd cmdtab[];
register const struct cmd *cp;
const struct cmd *cp;
for (cp = &cmdtab[0]; cp->c_name != NOSTR; cp++)
if (isprefix(word, cp->c_name))
@ -521,7 +520,7 @@ int
isprefix(as1, as2)
char *as1, *as2;
{
register char *s1, *s2;
char *s1, *s2;
s1 = as1;
s2 = as2;
@ -627,8 +626,8 @@ int
newfileinfo(omsgCount)
int omsgCount;
{
register struct message *mp;
register int u, n, mdot, d, s, l;
struct message *mp;
int u, n, mdot, d, s, l;
char fname[PATHSIZE], zname[PATHSIZE], *ename;
for (mp = &message[omsgCount]; mp < &message[msgCount]; mp++)
@ -705,7 +704,7 @@ void
load(name)
char *name;
{
register FILE *in, *oldin;
FILE *in, *oldin;
if ((in = Fopen(name, "r")) == NULL)
return;

View File

@ -1,4 +1,4 @@
/* $NetBSD: list.c,v 1.7 1997/07/09 05:23:36 mikel Exp $ */
/* $NetBSD: list.c,v 1.8 1997/10/19 05:03:32 lukem Exp $ */
/*
* Copyright (c) 1980, 1993
@ -33,18 +33,20 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)list.c 8.4 (Berkeley) 5/1/95";
#else
static char rcsid[] = "$NetBSD: list.c,v 1.7 1997/07/09 05:23:36 mikel Exp $";
__RCSID("$NetBSD: list.c,v 1.8 1997/10/19 05:03:32 lukem Exp $");
#endif
#endif /* not lint */
#include "rcv.h"
#include <ctype.h>
#include "extern.h"
int matchto __P((char *, int));
/*
* Mail -- a mail program
*
@ -62,8 +64,8 @@ getmsglist(buf, vector, flags)
char *buf;
int *vector, flags;
{
register int *ip;
register struct message *mp;
int *ip;
struct message *mp;
if (msgCount == 0) {
*vector = 0;
@ -121,9 +123,9 @@ markall(buf, f)
char buf[];
int f;
{
register char **np;
register int i;
register struct message *mp;
char **np;
int i;
struct message *mp;
char *namelist[NMLSIZE], *bufp;
int tok, beg, mc, star, other, valdot, colmod, colresult;
@ -317,7 +319,7 @@ number:
if (colmod != 0) {
for (i = 1; i <= msgCount; i++) {
register struct coltab *colp;
struct coltab *colp;
mp = &message[i - 1];
for (colp = &coltab[0]; colp->co_char; colp++)
@ -331,7 +333,7 @@ number:
if (mp->m_flag & MMARK)
break;
if (mp >= &message[msgCount]) {
register struct coltab *colp;
struct coltab *colp;
printf("No messages satisfy");
for (colp = &coltab[0]; colp->co_char; colp++)
@ -352,7 +354,7 @@ int
evalcol(col)
int col;
{
register struct coltab *colp;
struct coltab *colp;
if (col == 0)
return(lastcolmod);
@ -371,7 +373,7 @@ int
check(mesg, f)
int mesg, f;
{
register struct message *mp;
struct message *mp;
if (mesg < 1 || mesg > msgCount) {
printf("%d: Invalid message number\n", mesg);
@ -395,7 +397,7 @@ getrawlist(line, argv, argc)
char **argv;
int argc;
{
register char c, *cp, *cp2, quotec;
char c, *cp, *cp2, quotec;
int argn;
char linebuf[BUFSIZ];
@ -508,9 +510,9 @@ int
scan(sp)
char **sp;
{
register char *cp, *cp2;
register int c;
register struct lex *lp;
char *cp, *cp2;
int c;
struct lex *lp;
int quotec;
if (regretp >= 0) {
@ -611,7 +613,7 @@ regret(token)
int token;
{
if (++regretp >= REGDEP)
panic("Too many regrets");
errx(1, "Too many regrets");
regretstack[regretp] = token;
lexstring[STRINGLEN-1] = '\0';
string_stack[regretp] = savestr(lexstring);
@ -635,7 +637,7 @@ int
first(f, m)
int f, m;
{
register struct message *mp;
struct message *mp;
if (msgCount == 0)
return 0;
@ -659,7 +661,7 @@ matchsender(str, mesg)
char *str;
int mesg;
{
register char *cp, *cp2, *backup;
char *cp, *cp2, *backup;
if (!*str) /* null string matches nothing instead of everything */
return 0;
@ -686,9 +688,10 @@ static char *to_fields[] = { "to", "cc", "bcc", 0 };
int
matchto(str, mesg)
char *str;
int mesg;
{
register struct message *mp;
register char *cp, *cp2, *backup, **to;
struct message *mp;
char *cp, *cp2, *backup, **to;
str++;
@ -731,8 +734,8 @@ matchsubj(str, mesg)
char *str;
int mesg;
{
register struct message *mp;
register char *cp, *cp2, *backup;
struct message *mp;
char *cp, *cp2, *backup;
str++;
if (*str == '\0')
@ -781,11 +784,11 @@ void
mark(mesg)
int mesg;
{
register int i;
int i;
i = mesg;
if (i < 1 || i > msgCount)
panic("Bad message number to mark");
errx(1, "Bad message number to mark");
message[i-1].m_flag |= MMARK;
}
@ -796,11 +799,11 @@ void
unmark(mesg)
int mesg;
{
register int i;
int i;
i = mesg;
if (i < 1 || i > msgCount)
panic("Bad message number to unmark");
errx(1, "Bad message number to unmark");
message[i-1].m_flag &= ~MMARK;
}
@ -811,8 +814,8 @@ int
metamess(meta, f)
int meta, f;
{
register int c, m;
register struct message *mp;
int c, m;
struct message *mp;
c = meta;
switch (c) {

View File

@ -1,4 +1,4 @@
.\" $NetBSD: mail.1,v 1.9 1997/03/08 14:19:41 mouse Exp $
.\" $NetBSD: mail.1,v 1.10 1997/10/19 05:03:34 lukem Exp $
.\"
.\" Copyright (c) 1980, 1990, 1993
.\" The Regents of the University of California. All rights reserved.
@ -32,7 +32,7 @@
.\" SUCH DAMAGE.
.\"
.\" from: @(#)mail.1 8.8 (Berkeley) 4/28/95
.\" $NetBSD: mail.1,v 1.9 1997/03/08 14:19:41 mouse Exp $
.\" $NetBSD: mail.1,v 1.10 1997/10/19 05:03:34 lukem Exp $
.\"
.Dd April 28, 1995
.Dt MAIL 1
@ -41,21 +41,21 @@
.Nm mail
.Nd send and receive mail
.Sh SYNOPSIS
.Nm mail
.Nm
.Op Fl iInv
.Op Fl s Ar subject
.Op Fl c Ar cc-addr
.Op Fl b Ar bcc-addr
.Ar to-addr...
.Nm mail
.Nm ""
.Op Fl iInNv
.Fl f
.Op Ar name
.Nm mail
.Nm ""
.Op Fl iInNv
.Op Fl u Ar user
.Sh INTRODUCTION
.Nm Mail
.Nm
is an intelligent mail processing system, which has
a command syntax reminiscent of
.Xr \&ed 1
@ -70,7 +70,7 @@ delivery are displayed on the user's terminal.
Ignore tty interrupt signals.
This is
particularly useful when using
.Nm mail
.Nm
on noisy phone lines.
.It Fl I
Forces mail to run in interactive mode even when
@ -106,7 +106,7 @@ Read in the contents of your
(or the specified file)
for processing; when you
.Ar quit ,
.Nm mail
.Nm
writes undeleted messages back to this file.
.It Fl u
Is equivalent to:
@ -115,7 +115,7 @@ Is equivalent to:
.El
.Ss Sending mail
To send a message to one or more people,
.Nm mail
.Nm
can be invoked with arguments which are the names of people to
whom the mail will be sent.
You are then expected to type in
@ -126,12 +126,12 @@ at the beginning of a line.
The section below
.Ar Replying to or originating mail ,
describes some features of
.Nm mail
.Nm
available to help you compose your letter.
.Pp
.Ss Reading mail
In normal usage
.Nm mail
.Nm
is given no arguments and checks your mail out of the
post office, then
prints out a one line header of each message found.
@ -158,13 +158,13 @@ the message or
.Ql Ic r )
to it.
Deletion causes the
.Nm mail
.Nm
program to forget about the message.
This is not irreversible; the message can be
.Ic undeleted
.Ql Ic u )
by giving its number, or the
.Nm mail
.Nm
session can be aborted by giving the
.Ic exit
.Ql Ic x )
@ -203,7 +203,7 @@ person who it was from.
Text you then type in, up to an end-of-file,
defines the contents of the message.
While you are composing a message,
.Nm mail
.Nm
treats lines beginning with the character
.Ql Ic \&~
specially.
@ -222,7 +222,7 @@ are given in the summary below.)
.Pp
.Ss Ending a mail processing session.
You can end a
.Nm mail
.Nm
session with the
.Ic quit
.Ql Ic q )
@ -251,7 +251,7 @@ in your home directory.
The current list of such aliases can be displayed with the
.Ic alias
command in
.Nm mail .
.Nm "" .
System wide distribution lists can be created by editing
.Pa /etc/aliases ,
see
@ -275,7 +275,7 @@ See
.Xr mailaddr 7
for a description of network addresses.
.Pp
.Nm Mail
.Nm
has a number of options which can be set in the
.Pa .mailrc
file to alter its behavior; thus
@ -297,7 +297,7 @@ command's requirements is used.
If there are no messages forward of
the current message, the search proceeds backwards, and if there are no
good messages at all,
.Nm mail
.Nm
types
.Dq Li No applicable messages
and
@ -353,12 +353,12 @@ The
.Ic alternates
command is useful if you have accounts on several machines.
It can be used to inform
.Nm mail
.Nm
that the listed addresses are really you.
When you
.Ic reply
to messages,
.Nm mail
.Nm
will not send a copy of the message to any of the addresses
listed on the
.Ic alternates
@ -391,7 +391,7 @@ nor will they be available for most other commands.
.Ic dt )
Deletes the current message and prints the next message.
If there is no next message,
.Nm mail
.Nm
says
.Dq Li "at EOF" .
.It Ic edit
@ -677,12 +677,12 @@ program text over the message system.
A synonym for
.Ic exit .
.It Ic z
.Nm Mail
.Nm
presents message headers in windowfuls as described under the
.Ic headers
command.
You can move
.Nm mail Ns 's
.Nm "" Ns 's
attention forward to the next window with the
.Ic \&z
command.
@ -814,7 +814,7 @@ This should always be set (perhaps in
.Pa /etc/mail.rc ) .
.It Ar ask, asksub
Causes
.Nm mail
.Nm
to prompt you for the subject of each message you send.
If
you respond with simply a newline, no subject field will be sent.
@ -848,14 +848,14 @@ Setting the binary option
is the same as specifying
.Fl d
on the command line and causes
.Nm mail
.Nm
to output all sorts of information useful for debugging
.Nm mail .
.Nm "" .
.It Ar dot
The binary option
.Ar dot
causes
.Nm mail
.Nm
to interpret a period alone on a line as the terminator
of a message you are sending.
.It Ar hold
@ -870,11 +870,11 @@ An option related to
is
.Ar ignoreeof
which makes
.Nm mail
.Nm
refuse to accept a control-d as the end of a message.
.Ar Ignoreeof
also applies to
.Nm mail
.Nm
command mode.
.It Ar metoo
Usually, when a group is expanded that contains the sender, the sender
@ -891,7 +891,7 @@ flag on the command line.
Normally, when you abort a message with two
.Tn RUBOUT
(erase or delete)
.Nm mail
.Nm
copies the partial letter to the file
.Dq Pa dead.letter
in your home directory.
@ -986,7 +986,7 @@ use in the place of ~ to denote escapes.
The name of the directory to use for storing folders of
messages.
If this name begins with a `/',
.Nm mail
.Nm
considers it to be an absolute pathname; otherwise, the
folder directory is found relative to your home directory.
.It Ev MBOX
@ -1013,7 +1013,7 @@ with the
command; normally, the first five lines are printed.
.El
.Sh ENVIRONMENT
.Nm Mail
.Nm
utilizes the
.Ev HOME
and
@ -1050,7 +1050,7 @@ and
.Re
.Sh HISTORY
A
.Nm mail
.Nm
command
appeared in
.At v6 .
@ -1063,7 +1063,7 @@ Most are
not useful to the general user.
.Pp
Usually,
.Nm mail
.Nm
is just a link to
.Nm Mail ,
which can be confusing.

View File

@ -1,4 +1,4 @@
/* $NetBSD: main.c,v 1.7 1997/05/13 06:15:57 mikel Exp $ */
/* $NetBSD: main.c,v 1.8 1997/10/19 05:03:38 lukem Exp $ */
/*
* Copyright (c) 1980, 1993
@ -33,25 +33,25 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#ifndef lint
static char copyright[] =
"@(#) Copyright (c) 1980, 1993\n\
The Regents of the University of California. All rights reserved.\n";
__COPYRIGHT("@(#) Copyright (c) 1980, 1993\n\
The Regents of the University of California. All rights reserved.\n");
#endif /* not lint */
#ifndef lint
#if 0
static char sccsid[] = "@(#)main.c 8.2 (Berkeley) 4/20/95";
#else
static char rcsid[] = "$NetBSD: main.c,v 1.7 1997/05/13 06:15:57 mikel Exp $";
__RCSID("$NetBSD: main.c,v 1.8 1997/10/19 05:03:38 lukem Exp $");
#endif
#endif /* not lint */
#include "rcv.h"
#include <fcntl.h>
#include <sys/ioctl.h>
#include "extern.h"
int main __P((int, char **));
/*
* Mail -- a mail program
*
@ -65,7 +65,7 @@ main(argc, argv)
int argc;
char *argv[];
{
register int i;
int i;
struct name *to, *cc, *bcc, *smopts;
char *subject;
char *ef;

View File

@ -1,4 +1,4 @@
/* $NetBSD: names.c,v 1.5 1996/06/08 19:48:32 christos Exp $ */
/* $NetBSD: names.c,v 1.6 1997/10/19 05:03:41 lukem Exp $ */
/*
* Copyright (c) 1980, 1993
@ -33,11 +33,12 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)names.c 8.1 (Berkeley) 6/6/93";
#else
static char rcsid[] = "$NetBSD: names.c,v 1.5 1996/06/08 19:48:32 christos Exp $";
__RCSID("$NetBSD: names.c,v 1.6 1997/10/19 05:03:41 lukem Exp $");
#endif
#endif /* not lint */
@ -48,7 +49,6 @@ static char rcsid[] = "$NetBSD: names.c,v 1.5 1996/06/08 19:48:32 christos Exp $
*/
#include "rcv.h"
#include <fcntl.h>
#include "extern.h"
/*
@ -61,7 +61,7 @@ nalloc(str, ntype)
char str[];
int ntype;
{
register struct name *np;
struct name *np;
np = (struct name *) salloc(sizeof *np);
np->n_flink = NIL;
@ -78,7 +78,7 @@ struct name *
tailof(name)
struct name *name;
{
register struct name *np;
struct name *np;
np = name;
if (np == NIL)
@ -98,8 +98,8 @@ extract(line, ntype)
char line[];
int ntype;
{
register char *cp;
register struct name *top, *np, *t;
char *cp;
struct name *top, *np, *t;
char nbuf[BUFSIZ];
if (line == NOSTR || *line == '\0')
@ -124,13 +124,13 @@ extract(line, ntype)
*/
char *
detract(np, ntype)
register struct name *np;
struct name *np;
int ntype;
{
register int s;
register char *cp, *top;
register struct name *p;
register int comma;
int s;
char *cp, *top;
struct name *p;
int comma;
comma = ntype & GCOMMA;
if (np == NIL)
@ -173,14 +173,14 @@ char *
yankword(ap, wbuf)
char *ap, wbuf[];
{
register char *cp, *cp2;
char *cp, *cp2;
cp = ap;
for (;;) {
if (*cp == '\0')
return NOSTR;
if (*cp == '(') {
register int nesting = 0;
int nesting = 0;
while (*cp != '\0') {
switch (*cp++) {
@ -223,8 +223,8 @@ outof(names, fo, hp)
FILE *fo;
struct header *hp;
{
register int c;
register struct name *np, *top;
int c;
struct name *np, *top;
time_t now;
char *date, *fname;
FILE *fout, *fin;
@ -360,7 +360,7 @@ int
isfileaddr(name)
char *name;
{
register char *cp;
char *cp;
if (*name == '+')
return 1;
@ -384,9 +384,9 @@ struct name *
usermap(names)
struct name *names;
{
register struct name *new, *np, *cp;
struct name *new, *np, *cp;
struct grouphead *gh;
register int metoo;
int metoo;
new = NIL;
np = names;
@ -466,7 +466,7 @@ struct name *
cat(n1, n2)
struct name *n1, *n2;
{
register struct name *tail;
struct name *tail;
if (n1 == NIL)
return(n2);
@ -486,13 +486,13 @@ char **
unpack(np)
struct name *np;
{
register char **ap, **top;
register struct name *n;
char **ap, **top;
struct name *n;
int t, extra, metoo, verbose;
n = np;
if ((t = count(n)) == 0)
panic("No names to unpack");
errx(1, "No names to unpack");
/*
* Compute the number of extra arguments we will need.
* We need at least two extra -- one for "mail" and one for
@ -531,7 +531,7 @@ struct name *
elide(names)
struct name *names;
{
register struct name *np, *t, *new;
struct name *np, *t, *new;
struct name *x;
if (names == NIL)
@ -643,9 +643,9 @@ put(list, node)
*/
int
count(np)
register struct name *np;
struct name *np;
{
register int c;
int c;
for (c = 0; np != NIL; np = np->n_flink)
if ((np->n_type & GDEL) == 0)
@ -658,10 +658,10 @@ count(np)
*/
struct name *
delname(np, name)
register struct name *np;
struct name *np;
char name[];
{
register struct name *p;
struct name *p;
for (p = np; p != NIL; p = p->n_flink)
if (strcasecmp(p->n_name, name) == 0) {
@ -692,7 +692,7 @@ void
prettyprint(name)
struct name *name;
{
register struct name *np;
struct name *np;
np = name;
while (np != NIL) {

View File

@ -1,4 +1,4 @@
/* $NetBSD: popen.c,v 1.6 1997/05/13 06:48:42 mikel Exp $ */
/* $NetBSD: popen.c,v 1.7 1997/10/19 05:03:45 lukem Exp $ */
/*
* Copyright (c) 1980, 1993
@ -33,17 +33,16 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)popen.c 8.1 (Berkeley) 6/6/93";
#else
static char rcsid[] = "$NetBSD: popen.c,v 1.6 1997/05/13 06:48:42 mikel Exp $";
__RCSID("$NetBSD: popen.c,v 1.7 1997/10/19 05:03:45 lukem Exp $");
#endif
#endif /* not lint */
#include "rcv.h"
#include <sys/wait.h>
#include <fcntl.h>
#include "extern.h"
#define READ 0
@ -178,7 +177,7 @@ register_file(fp, pipe, pid)
struct fp *fpp;
if ((fpp = (struct fp *) malloc(sizeof *fpp)) == NULL)
panic("Out of memory");
errx(1, "Out of memory");
fpp->fp = fp;
fpp->pipe = pipe;
fpp->pid = pid;
@ -198,7 +197,7 @@ unregister_file(fp)
free((char *) p);
return;
}
panic("Invalid file pointer");
errx(1, "Invalid file pointer");
}
static int
@ -210,7 +209,7 @@ file_pid(fp)
for (p = fp_head; p; p = p->link)
if (p->fp == fp)
return (p->pid);
panic("Invalid file pointer");
errx(1, "Invalid file pointer");
/*NOTREACHED*/
}
@ -311,7 +310,7 @@ static struct child *
findchild(pid)
int pid;
{
register struct child **cpp;
struct child **cpp;
for (cpp = &child; *cpp != NULL && (*cpp)->pid != pid;
cpp = &(*cpp)->link)
@ -327,9 +326,9 @@ findchild(pid)
static void
delchild(cp)
register struct child *cp;
struct child *cp;
{
register struct child **cpp;
struct child **cpp;
for (cpp = &child; *cpp != cp; cpp = &(*cpp)->link)
;
@ -343,7 +342,7 @@ sigchild(signo)
{
int pid;
union wait status;
register struct child *cp;
struct child *cp;
while ((pid =
wait3((int *)&status, WNOHANG, (struct rusage *)0)) > 0) {
@ -367,7 +366,7 @@ wait_child(pid)
int pid;
{
sigset_t nset, oset;
register struct child *cp = findchild(pid);
struct child *cp = findchild(pid);
sigemptyset(&nset);
sigaddset(&nset, SIGCHLD);
sigprocmask(SIG_BLOCK, &nset, &oset);
@ -388,7 +387,7 @@ free_child(pid)
int pid;
{
sigset_t nset, oset;
register struct child *cp = findchild(pid);
struct child *cp = findchild(pid);
sigemptyset(&nset);
sigaddset(&nset, SIGCHLD);
sigprocmask(SIG_BLOCK, &nset, &oset);

View File

@ -1,4 +1,4 @@
/* $NetBSD: quit.c,v 1.6 1996/12/28 07:11:07 tls Exp $ */
/* $NetBSD: quit.c,v 1.7 1997/10/19 05:03:49 lukem Exp $ */
/*
* Copyright (c) 1980, 1993
@ -33,16 +33,16 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)quit.c 8.2 (Berkeley) 4/28/95";
#else
static char rcsid[] = "$NetBSD: quit.c,v 1.6 1996/12/28 07:11:07 tls Exp $";
__RCSID("$NetBSD: quit.c,v 1.7 1997/10/19 05:03:49 lukem Exp $");
#endif
#endif /* not lint */
#include "rcv.h"
#include <fcntl.h>
#include "extern.h"
/*
@ -77,8 +77,8 @@ quit()
{
int mcount, p, modify, autohold, anystat, holdbit, nohold;
FILE *ibuf = NULL, *obuf, *fbuf, *rbuf, *readstat = NULL, *abuf;
register struct message *mp;
register int c;
struct message *mp;
int c;
extern char *tempQuit, *tempResid;
struct stat minfo;
char *mbox;
@ -357,10 +357,10 @@ newmail:
*/
int
writeback(res)
register FILE *res;
FILE *res;
{
register struct message *mp;
register int p, c;
struct message *mp;
int p, c;
FILE *obuf;
p = 0;
@ -413,8 +413,8 @@ void
edstop()
{
extern char *tmpdir;
register int gotcha, c;
register struct message *mp;
int gotcha, c;
struct message *mp;
FILE *obuf, *ibuf, *readstat = NULL;
struct stat statb;
char *tempname;

View File

@ -1,4 +1,4 @@
/* $NetBSD: send.c,v 1.6 1996/06/08 19:48:39 christos Exp $ */
/* $NetBSD: send.c,v 1.7 1997/10/19 05:03:52 lukem Exp $ */
/*
* Copyright (c) 1980, 1993
@ -33,11 +33,12 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)send.c 8.1 (Berkeley) 6/6/93";
#else
static char rcsid[] = "$NetBSD: send.c,v 1.6 1996/06/08 19:48:39 christos Exp $";
__RCSID("$NetBSD: send.c,v 1.7 1997/10/19 05:03:52 lukem Exp $");
#endif
#endif /* not lint */
@ -59,17 +60,17 @@ static char rcsid[] = "$NetBSD: send.c,v 1.6 1996/06/08 19:48:39 christos Exp $"
*/
int
send(mp, obuf, doign, prefix)
register struct message *mp;
struct message *mp;
FILE *obuf;
struct ignoretab *doign;
char *prefix;
{
long count;
register FILE *ibuf;
FILE *ibuf;
char line[LINESIZE];
int ishead, infld, ignoring = 0, dostat, firstline;
register char *cp, *cp2;
register int c = 0;
char *cp, *cp2;
int c = 0;
int length;
int prefixlen = 0;
@ -235,12 +236,12 @@ send(mp, obuf, doign, prefix)
*/
void
statusput(mp, obuf, prefix)
register struct message *mp;
struct message *mp;
FILE *obuf;
char *prefix;
{
char statout[3];
register char *cp = statout;
char *cp = statout;
if (mp->m_flag & MREAD)
*cp++ = 'R';
@ -413,7 +414,7 @@ fixhead(hp, tolist)
struct header *hp;
struct name *tolist;
{
register struct name *np;
struct name *np;
hp->h_to = NIL;
hp->h_cc = NIL;
@ -440,8 +441,8 @@ infix(hp, fi)
FILE *fi;
{
extern char *tempMail;
register FILE *nfo, *nfi;
register int c;
FILE *nfo, *nfi;
int c;
if ((nfo = Fopen(tempMail, "w")) == NULL) {
perror(tempMail);
@ -488,7 +489,7 @@ puthead(hp, fo, w)
FILE *fo;
int w;
{
register int gotcha;
int gotcha;
gotcha = 0;
if (hp->h_to != NIL && w & GTO)
@ -510,11 +511,11 @@ puthead(hp, fo, w)
void
fmt(str, np, fo, comma)
char *str;
register struct name *np;
struct name *np;
FILE *fo;
int comma;
{
register col, len;
int col, len;
comma = comma ? 1 : 0;
col = strlen(str);
@ -546,11 +547,11 @@ fmt(str, np, fo, comma)
int
savemail(name, fi)
char name[];
register FILE *fi;
FILE *fi;
{
register FILE *fo;
FILE *fo;
char buf[BUFSIZ];
register i;
int i;
time_t now;
if ((fo = Fopen(name, "a")) == NULL) {

View File

@ -1,4 +1,4 @@
/* $NetBSD: strings.c,v 1.5 1996/06/08 19:48:40 christos Exp $ */
/* $NetBSD: strings.c,v 1.6 1997/10/19 05:03:54 lukem Exp $ */
/*
* Copyright (c) 1980, 1993
@ -33,11 +33,12 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)strings.c 8.1 (Berkeley) 6/6/93";
#else
static char rcsid[] = "$NetBSD: strings.c,v 1.5 1996/06/08 19:48:40 christos Exp $";
__RCSID("$NetBSD: strings.c,v 1.6 1997/10/19 05:03:54 lukem Exp $");
#endif
#endif /* not lint */
@ -64,9 +65,9 @@ char *
salloc(size)
int size;
{
register char *t;
register int s;
register struct strings *sp;
char *t;
int s;
struct strings *sp;
int index;
s = size;
@ -81,14 +82,12 @@ salloc(size)
index++;
}
if (sp >= &stringdope[NSPACE])
panic("String too large");
errx(1, "String too large");
if (sp->s_topFree == NOSTR) {
index = sp - &stringdope[0];
sp->s_topFree = malloc(STRINGSIZE << index);
if (sp->s_topFree == NOSTR) {
fprintf(stderr, "No room for space %d\n", index);
panic("Internal error");
}
if (sp->s_topFree == NOSTR)
errx(1, "No room for space %d", index);
sp->s_nextFree = sp->s_topFree;
sp->s_nleft = STRINGSIZE << index;
}
@ -106,8 +105,8 @@ salloc(size)
void
sreset()
{
register struct strings *sp;
register int index;
struct strings *sp;
int index;
if (noreset)
return;
@ -128,7 +127,7 @@ sreset()
void
spreserve()
{
register struct strings *sp;
struct strings *sp;
for (sp = &stringdope[0]; sp < &stringdope[NSPACE]; sp++)
sp->s_topFree = NOSTR;

View File

@ -1,4 +1,4 @@
/* $NetBSD: temp.c,v 1.5 1996/06/08 19:48:42 christos Exp $ */
/* $NetBSD: temp.c,v 1.6 1997/10/19 05:03:57 lukem Exp $ */
/*
* Copyright (c) 1980, 1993
@ -33,16 +33,16 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)temp.c 8.1 (Berkeley) 6/6/93";
#else
static char rcsid[] = "$NetBSD: temp.c,v 1.5 1996/06/08 19:48:42 christos Exp $";
__RCSID("$NetBSD: temp.c,v 1.6 1997/10/19 05:03:57 lukem Exp $");
#endif
#endif /* not lint */
#include "rcv.h"
#include <errno.h>
#include "extern.h"
/*
@ -61,7 +61,7 @@ char *tmpdir;
void
tinit()
{
register char *cp;
char *cp;
if ((tmpdir = getenv("TMPDIR")) == NULL) {
tmpdir = _PATH_TMP;

View File

@ -1,4 +1,4 @@
/* $NetBSD: tty.c,v 1.7 1997/07/09 05:25:46 mikel Exp $ */
/* $NetBSD: tty.c,v 1.8 1997/10/19 05:03:59 lukem Exp $ */
/*
* Copyright (c) 1980, 1993
@ -33,11 +33,12 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)tty.c 8.2 (Berkeley) 6/6/93";
#else
static char rcsid[] = "$NetBSD: tty.c,v 1.7 1997/07/09 05:25:46 mikel Exp $";
__RCSID("$NetBSD: tty.c,v 1.8 1997/10/19 05:03:59 lukem Exp $");
#endif
#endif /* not lint */
@ -49,7 +50,6 @@ static char rcsid[] = "$NetBSD: tty.c,v 1.7 1997/07/09 05:25:46 mikel Exp $";
#include "rcv.h"
#include "extern.h"
#include <sys/ioctl.h>
static cc_t c_erase; /* Current erase char */
static cc_t c_kill; /* Current kill char */

View File

@ -1,4 +1,4 @@
/* $NetBSD: v7.local.c,v 1.8 1997/05/13 06:15:58 mikel Exp $ */
/* $NetBSD: v7.local.c,v 1.9 1997/10/19 05:04:02 lukem Exp $ */
/*
* Copyright (c) 1980, 1993
@ -33,11 +33,12 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)v7.local.c 8.1 (Berkeley) 6/6/93";
#else
static char rcsid[] = "$NetBSD: v7.local.c,v 1.8 1997/05/13 06:15:58 mikel Exp $";
__RCSID("$NetBSD: v7.local.c,v 1.9 1997/10/19 05:04:02 lukem Exp $");
#endif
#endif /* not lint */
@ -50,8 +51,6 @@ static char rcsid[] = "$NetBSD: v7.local.c,v 1.8 1997/05/13 06:15:58 mikel Exp $
*/
#include "rcv.h"
#include <stdlib.h>
#include <fcntl.h>
#include "extern.h"
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: vars.c,v 1.4 1996/06/08 19:48:45 christos Exp $ */
/* $NetBSD: vars.c,v 1.5 1997/10/19 05:04:04 lukem Exp $ */
/*
* Copyright (c) 1980, 1993
@ -33,11 +33,12 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)vars.c 8.1 (Berkeley) 6/6/93";
#else
static char rcsid[] = "$NetBSD: vars.c,v 1.4 1996/06/08 19:48:45 christos Exp $";
__RCSID("$NetBSD: vars.c,v 1.5 1997/10/19 05:04:04 lukem Exp $");
#endif
#endif /* not lint */
@ -57,8 +58,8 @@ void
assign(name, value)
char name[], value[];
{
register struct var *vp;
register int h;
struct var *vp;
int h;
h = hash(name);
vp = lookup(name);
@ -102,8 +103,8 @@ vcopy(str)
return "";
len = strlen(str) + 1;
if ((new = malloc(len)) == NULL)
panic("Out of memory");
bcopy(str, new, (int) len);
errx(1, "Out of memory");
memmove(new, str, (int) len);
return new;
}
@ -116,7 +117,7 @@ char *
value(name)
char name[];
{
register struct var *vp;
struct var *vp;
if ((vp = lookup(name)) == NOVAR)
return(getenv(name));
@ -130,9 +131,9 @@ value(name)
struct var *
lookup(name)
register char name[];
char name[];
{
register struct var *vp;
struct var *vp;
for (vp = variables[hash(name)]; vp != NOVAR; vp = vp->v_link)
if (*vp->v_name == *name && equal(vp->v_name, name))
@ -146,9 +147,9 @@ lookup(name)
struct grouphead *
findgroup(name)
register char name[];
char name[];
{
register struct grouphead *gh;
struct grouphead *gh;
for (gh = groups[hash(name)]; gh != NOGRP; gh = gh->g_link)
if (*gh->g_name == *name && equal(gh->g_name, name))
@ -163,8 +164,8 @@ void
printgroup(name)
char name[];
{
register struct grouphead *gh;
register struct group *gp;
struct grouphead *gh;
struct group *gp;
if ((gh = findgroup(name)) == NOGRP) {
printf("\"%s\": not a group\n", name);
@ -182,9 +183,9 @@ printgroup(name)
*/
int
hash(name)
register char *name;
char *name;
{
register h = 0;
int h = 0;
while (*name) {
h <<= 2;

View File

@ -1,4 +1,4 @@
/* $NetBSD: version.c,v 1.4 1996/06/08 19:48:46 christos Exp $ */
/* $NetBSD: version.c,v 1.5 1997/10/19 05:04:07 lukem Exp $ */
/*
* Copyright (c) 1980, 1993
@ -33,11 +33,12 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)version.c 8.1 (Berkeley) 6/6/93";
#else
static char rcsid[] = "$NetBSD: version.c,v 1.4 1996/06/08 19:48:46 christos Exp $";
__RCSID("$NetBSD: version.c,v 1.5 1997/10/19 05:04:07 lukem Exp $");
#endif
#endif /* not lint */