From 4bba8e595ecc312b5dd9c73c8da1a636f896fce9 Mon Sep 17 00:00:00 2001 From: Paul Richards Date: Wed, 3 Nov 2004 15:23:11 +0000 Subject: [PATCH] Convert to ANSI style function definitions. --- usr.bin/tail/forward.c | 6 +----- usr.bin/tail/misc.c | 8 ++------ usr.bin/tail/read.c | 8 ++------ usr.bin/tail/reverse.c | 15 +++------------ usr.bin/tail/tail.c | 6 ++++-- 5 files changed, 12 insertions(+), 31 deletions(-) diff --git a/usr.bin/tail/forward.c b/usr.bin/tail/forward.c index 883ea9a3a145..6f9256f10d3f 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 6d0ecdb7501e..c2f18836775f 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 f904ef0bc74d..ff66f78cf37e 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 d8c45e99fd24..64a8313f112b 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 2a3ee1365e74..8fa0ed6edda1 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 ||