use always static for usage and keep usage definition above main

This commit is contained in:
dwts
2014-04-22 16:44:16 +03:00
committed by sin
parent 575b38391c
commit 459161481a
6 changed files with 32 additions and 34 deletions

12
grep.c
View File

@@ -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);
}