use always static for usage and keep usage definition above main
This commit is contained in:
12
grep.c
12
grep.c
@@ -12,7 +12,6 @@ enum { Match = 0, NoMatch = 1, Error = 2 };
|
||||
|
||||
static void addpattern(const char *);
|
||||
static bool grep(FILE *, const char *);
|
||||
static void usage(void);
|
||||
|
||||
static bool eflag = false;
|
||||
static bool vflag = false;
|
||||
@@ -25,6 +24,12 @@ static struct plist {
|
||||
struct plist *next;
|
||||
} *phead;
|
||||
|
||||
static void
|
||||
usage(void)
|
||||
{
|
||||
enprintf(Error, "usage: %s [-Ecilnqv] [-e pattern] pattern [files...]\n", argv0);
|
||||
}
|
||||
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
@@ -158,8 +163,3 @@ end:
|
||||
return match;
|
||||
}
|
||||
|
||||
void
|
||||
usage(void)
|
||||
{
|
||||
enprintf(Error, "usage: %s [-Ecilnqv] [-e pattern] pattern [files...]\n", argv0);
|
||||
}
|
||||
|
Reference in New Issue
Block a user