Use err(3). Add prototype.
This commit is contained in:
parent
3042ea1f52
commit
d6c7156e61
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=28070
@ -38,8 +38,8 @@
|
|||||||
.Nm soelim
|
.Nm soelim
|
||||||
.Nd eliminate \&.so's from nroff input
|
.Nd eliminate \&.so's from nroff input
|
||||||
.Sh SYNOPSIS
|
.Sh SYNOPSIS
|
||||||
.Nm soelim
|
.Nm
|
||||||
.Op Ar file ...
|
.Op Ar
|
||||||
.Sh DESCRIPTION
|
.Sh DESCRIPTION
|
||||||
.Nm Soelim
|
.Nm Soelim
|
||||||
reads the specified files or the standard input and performs the textual
|
reads the specified files or the standard input and performs the textual
|
||||||
@ -69,7 +69,7 @@ i.e.
|
|||||||
.Dl \'so /usr/lib/tmac.s
|
.Dl \'so /usr/lib/tmac.s
|
||||||
.Pp
|
.Pp
|
||||||
A sample usage of
|
A sample usage of
|
||||||
.Nm soelim
|
.Nm
|
||||||
would be
|
would be
|
||||||
.Pp
|
.Pp
|
||||||
.Bd -literal -offset indent -compact
|
.Bd -literal -offset indent -compact
|
||||||
|
@ -32,15 +32,20 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
static char copyright[] =
|
static const char copyright[] =
|
||||||
"@(#) Copyright (c) 1980, 1993\n\
|
"@(#) Copyright (c) 1980, 1993\n\
|
||||||
The Regents of the University of California. All rights reserved.\n";
|
The Regents of the University of California. All rights reserved.\n";
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
|
#if 0
|
||||||
static char sccsid[] = "@(#)soelim.c 8.1 (Berkeley) 6/6/93";
|
static char sccsid[] = "@(#)soelim.c 8.1 (Berkeley) 6/6/93";
|
||||||
|
#endif
|
||||||
|
static const char rcsid[] =
|
||||||
|
"$Id$";
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
|
#include <err.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
/*
|
/*
|
||||||
* soelim - a filter to process n/troff input eliminating .so's
|
* 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 "-"
|
#define STDIN_NAME "-"
|
||||||
|
|
||||||
|
int process __P((char *));
|
||||||
|
|
||||||
|
int
|
||||||
main(argc, argv)
|
main(argc, argv)
|
||||||
int argc;
|
int argc;
|
||||||
char *argv[];
|
char *argv[];
|
||||||
@ -79,7 +87,8 @@ main(argc, argv)
|
|||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
int process(file)
|
int
|
||||||
|
process(file)
|
||||||
char *file;
|
char *file;
|
||||||
{
|
{
|
||||||
register char *cp;
|
register char *cp;
|
||||||
@ -93,7 +102,7 @@ int process(file)
|
|||||||
} else {
|
} else {
|
||||||
soee = fopen(file, "r");
|
soee = fopen(file, "r");
|
||||||
if (soee == NULL) {
|
if (soee == NULL) {
|
||||||
perror(file);
|
warn(file);
|
||||||
return(-1);
|
return(-1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user