21 enum grep_header_field {
22 GREP_HEADER_AUTHOR = 0,
23 GREP_HEADER_COMMITTER,
27 struct grep_pat *next;
30 enum grep_pat_token token;
32 enum grep_header_field field;
35 unsigned word_regexp:1;
46 enum grep_expr_node node;
49 struct grep_pat *atom;
50 struct grep_expr *unary;
52 struct grep_expr *left;
53 struct grep_expr *right;
59 struct grep_pat *pattern_list;
60 struct grep_pat **pattern_tail;
61 struct grep_expr *pattern_expression;
68 int unmatch_name_only;
73 #define GREP_BINARY_DEFAULT 0
74 #define GREP_BINARY_NOMATCH 1
75 #define GREP_BINARY_TEXT 2
80 int null_following_name;
82 char color_match[COLOR_MAXLEN];
83 const char *color_external;
86 unsigned post_context;
89 extern void append_grep_pattern(struct grep_opt *opt, const char *pat, const char *origin, int no, enum grep_pat_token t);
90 extern void append_header_grep_pattern(struct grep_opt *, enum grep_header_field, const char *);
91 extern void compile_grep_patterns(struct grep_opt *opt);
92 extern void free_grep_patterns(struct grep_opt *opt);
93 extern int grep_buffer(struct grep_opt *opt, const char *name, char *buf, unsigned long size);