summaryrefslogtreecommitdiffstats
path: root/usr.bin/tail
diff options
context:
space:
mode:
authorpaul <paul@FreeBSD.org>2004-11-03 15:23:11 +0000
committerpaul <paul@FreeBSD.org>2004-11-03 15:23:11 +0000
commit5386ac46ea6d22cd22ae9cbfcc860957ee5b570b (patch)
tree5f07f41ffc5b3603a08c3640429a79ee82fdc228 /usr.bin/tail
parentd96345ff4775adb9812a384c8bc6a8a16076d862 (diff)
downloadFreeBSD-src-5386ac46ea6d22cd22ae9cbfcc860957ee5b570b.zip
FreeBSD-src-5386ac46ea6d22cd22ae9cbfcc860957ee5b570b.tar.gz
Convert to ANSI style function definitions.
Diffstat (limited to 'usr.bin/tail')
-rw-r--r--usr.bin/tail/forward.c6
-rw-r--r--usr.bin/tail/misc.c8
-rw-r--r--usr.bin/tail/read.c8
-rw-r--r--usr.bin/tail/reverse.c15
-rw-r--r--usr.bin/tail/tail.c6
5 files changed, 12 insertions, 31 deletions
diff --git a/usr.bin/tail/forward.c b/usr.bin/tail/forward.c
index 883ea9a..6f9256f 100644
--- a/usr.bin/tail/forward.c
+++ b/usr.bin/tail/forward.c
@@ -89,11 +89,7 @@ static void rlines(FILE *, off_t, struct stat *);
* NOREG cyclically read lines into a wrap-around array of buffers
*/
void
-forward(fp, style, off, sbp)
- FILE *fp;
- enum STYLE style;
- off_t off;
- struct stat *sbp;
+forward(FILE *fp, enum STYLE style, off_t off, struct stat *sbp)
{
int ch, n, kq = -1;
int action = USE_SLEEP;
diff --git a/usr.bin/tail/misc.c b/usr.bin/tail/misc.c
index 6d0ecdb..c2f1883 100644
--- a/usr.bin/tail/misc.c
+++ b/usr.bin/tail/misc.c
@@ -73,9 +73,7 @@ oerr()
* absolute file offset `startoff'. May move map window.
*/
int
-mapprint(mip, startoff, len)
- struct mapinfo *mip;
- off_t startoff, len;
+mapprint(struct mapinfo *mip, off_t startoff, off_t len)
{
int n;
@@ -101,9 +99,7 @@ mapprint(mip, startoff, len)
* aligned.
*/
int
-maparound(mip, offset)
- struct mapinfo *mip;
- off_t offset;
+maparound(struct mapinfo *mip, off_t offset)
{
if (mip->start != NULL && munmap(mip->start, mip->maplen) != 0)
diff --git a/usr.bin/tail/read.c b/usr.bin/tail/read.c
index f904ef0..ff66f78 100644
--- a/usr.bin/tail/read.c
+++ b/usr.bin/tail/read.c
@@ -66,9 +66,7 @@ static const char sccsid[] = "@(#)read.c 8.1 (Berkeley) 6/6/93";
* the end.
*/
int
-bytes(fp, off)
- FILE *fp;
- off_t off;
+bytes(FILE *fp, off_t off)
{
int ch, len, tlen;
char *ep, *p, *t;
@@ -135,9 +133,7 @@ bytes(fp, off)
* the end.
*/
int
-lines(fp, off)
- FILE *fp;
- off_t off;
+lines(FILE *fp, off_t off)
{
struct {
int blen;
diff --git a/usr.bin/tail/reverse.c b/usr.bin/tail/reverse.c
index d8c45e9..64a8313 100644
--- a/usr.bin/tail/reverse.c
+++ b/usr.bin/tail/reverse.c
@@ -79,11 +79,7 @@ static void r_reg(FILE *, enum STYLE, off_t, struct stat *);
* NOREG cyclically read input into a linked list of buffers
*/
void
-reverse(fp, style, off, sbp)
- FILE *fp;
- enum STYLE style;
- off_t off;
- struct stat *sbp;
+reverse(FILE *fp, enum STYLE style, off_t off, struct stat *sbp)
{
if (style != REVERSE && off == 0)
return;
@@ -112,11 +108,7 @@ reverse(fp, style, off, sbp)
* r_reg -- display a regular file in reverse order by line.
*/
static void
-r_reg(fp, style, off, sbp)
- FILE *fp;
- enum STYLE style;
- off_t off;
- struct stat *sbp;
+r_reg(FILE *fp, enum STYLE style, off_t off, struct stat *sbp)
{
struct mapinfo map;
off_t curoff, size, lineend;
@@ -196,8 +188,7 @@ typedef struct bf {
* user warned).
*/
static void
-r_buf(fp)
- FILE *fp;
+r_buf(FILE *fp)
{
BF *mark, *tl, *tr;
int ch, len, llen;
diff --git a/usr.bin/tail/tail.c b/usr.bin/tail/tail.c
index 2a3ee13..8fa0ed6 100644
--- a/usr.bin/tail/tail.c
+++ b/usr.bin/tail/tail.c
@@ -63,6 +63,8 @@ static const char sccsid[] = "@(#)tail.c 8.1 (Berkeley) 6/6/93";
int Fflag, fflag, rflag, rval;
const char *fname;
+int no_files;
+
static void obsolete(char **);
static void usage(void);
@@ -138,8 +140,7 @@ main(int argc, char *argv[])
argc -= optind;
argv += optind;
- if (fflag && argc > 1)
- errx(1, "-f option only appropriate for a single file");
+ no_files = argc;
/*
* If displaying in reverse, don't permit follow option, and convert
@@ -168,6 +169,7 @@ main(int argc, char *argv[])
}
}
+ printf("No files: %d\n", no_files);
if (*argv)
for (first = 1; (fname = *argv++);) {
if ((fp = fopen(fname, "r")) == NULL ||
OpenPOWER on IntegriCloud