diff options
author | gabor <gabor@FreeBSD.org> | 2010-07-29 00:11:14 +0000 |
---|---|---|
committer | gabor <gabor@FreeBSD.org> | 2010-07-29 00:11:14 +0000 |
commit | d3f9c5a1b7e9d966652b4c688f2558356eb149d3 (patch) | |
tree | 1e1d5961f5ee38199f4b4fbd83cfffc86339e1c5 /usr.bin/grep/grep.h | |
parent | 1e88e37ddc5c0145f7fc505a213d255161668879 (diff) | |
download | FreeBSD-src-d3f9c5a1b7e9d966652b4c688f2558356eb149d3.zip FreeBSD-src-d3f9c5a1b7e9d966652b4c688f2558356eb149d3.tar.gz |
- Use the traditional behaviour for filename and directory name inclusion
and exclusion patterns [1]
- Some improvements on the exiting code, like replacing memcpy with
strlcpy/strcpy
Approved by: delphij (mentor)
Pointed out by: bf [1], des [1]
Diffstat (limited to 'usr.bin/grep/grep.h')
-rw-r--r-- | usr.bin/grep/grep.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/usr.bin/grep/grep.h b/usr.bin/grep/grep.h index 4a2d43f..bb5e5f9 100644 --- a/usr.bin/grep/grep.h +++ b/usr.bin/grep/grep.h @@ -71,8 +71,6 @@ extern const char *errstr[]; #define LINK_EXPLICIT 1 #define LINK_SKIP 2 -#define FILE_PAT 0 -#define DIR_PAT 1 #define EXCL_PAT 0 #define INCL_PAT 1 @@ -98,7 +96,6 @@ struct str { struct epat { char *pat; int mode; - int type; }; typedef struct { @@ -118,7 +115,7 @@ extern int cflags, eflags; extern bool Eflag, Fflag, Gflag, Hflag, Lflag, bflag, cflag, hflag, iflag, lflag, mflag, nflag, oflag, qflag, sflag, vflag, wflag, xflag; -extern bool exclflag, nullflag; +extern bool dexclude, dinclude, fexclude, finclude, nullflag; extern unsigned long long Aflag, Bflag, mcount; extern char *label; extern const char *color; @@ -126,9 +123,9 @@ extern int binbehave, devbehave, dirbehave, filebehave, grepbehave, linkbehave; extern bool first, matchall, notfound, prev; extern int tail; -extern unsigned int epatterns, patterns; +extern unsigned int dpatterns, fpatterns, patterns; extern char **pattern; -extern struct epat *epattern; +extern struct epat *dpattern, *fpattern; extern regex_t *er_pattern, *r_pattern; extern fastgrep_t *fg_pattern; @@ -137,11 +134,14 @@ extern fastgrep_t *fg_pattern; extern char re_error[RE_ERROR_BUF + 1]; /* Seems big enough */ /* util.c */ +bool dir_matching(const char *dname); +bool file_matching(const char *fname); int procfile(const char *fn); int grep_tree(char **argv); void *grep_malloc(size_t size); void *grep_calloc(size_t nmemb, size_t size); void *grep_realloc(void *ptr, size_t size); +char *grep_strdup(const char *str); void printline(struct str *line, int sep, regmatch_t *matches, int m); /* queue.c */ |