Use err(3). Add prototype.

This commit is contained in:
Philippe Charnier 1997-08-11 07:29:17 +00:00
parent 3042ea1f52
commit d6c7156e61
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=28070
2 changed files with 15 additions and 6 deletions

View File

@ -38,8 +38,8 @@
.Nm soelim
.Nd eliminate \&.so's from nroff input
.Sh SYNOPSIS
.Nm soelim
.Op Ar file ...
.Nm
.Op Ar
.Sh DESCRIPTION
.Nm Soelim
reads the specified files or the standard input and performs the textual
@ -69,7 +69,7 @@ i.e.
.Dl \'so /usr/lib/tmac.s
.Pp
A sample usage of
.Nm soelim
.Nm
would be
.Pp
.Bd -literal -offset indent -compact

View File

@ -32,15 +32,20 @@
*/
#ifndef lint
static char copyright[] =
static const char 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[] = "@(#)soelim.c 8.1 (Berkeley) 6/6/93";
#endif
static const char rcsid[] =
"$Id$";
#endif /* not lint */
#include <err.h>
#include <stdio.h>
/*
* soelim - a filter to process n/troff input eliminating .so's
@ -60,6 +65,9 @@ static char sccsid[] = "@(#)soelim.c 8.1 (Berkeley) 6/6/93";
*/
#define STDIN_NAME "-"
int process __P((char *));
int
main(argc, argv)
int argc;
char *argv[];
@ -79,7 +87,8 @@ main(argc, argv)
exit(0);
}
int process(file)
int
process(file)
char *file;
{
register char *cp;
@ -93,7 +102,7 @@ int process(file)
} else {
soee = fopen(file, "r");
if (soee == NULL) {
perror(file);
warn(file);
return(-1);
}
}