20 enum grep_header_field {
21 GREP_HEADER_AUTHOR = 0,
22 GREP_HEADER_COMMITTER,
26 struct grep_pat *next;
29 enum grep_pat_token token;
31 enum grep_header_field field;
44 enum grep_expr_node node;
47 struct grep_pat *atom;
48 struct grep_expr *unary;
50 struct grep_expr *left;
51 struct grep_expr *right;
57 struct grep_pat *pattern_list;
58 struct grep_pat **pattern_tail;
59 struct grep_expr *pattern_expression;
64 unsigned status_only:1;
66 unsigned unmatch_name_only:1;
68 unsigned word_regexp:1;
71 #define GREP_BINARY_DEFAULT 0
72 #define GREP_BINARY_NOMATCH 1
73 #define GREP_BINARY_TEXT 2
78 unsigned null_following_name:1;
81 unsigned post_context;
84 extern void append_grep_pattern(struct grep_opt *opt, const char *pat, const char *origin, int no, enum grep_pat_token t);
85 extern void append_header_grep_pattern(struct grep_opt *, enum grep_header_field, const char *);
86 extern void compile_grep_patterns(struct grep_opt *opt);
87 extern void free_grep_patterns(struct grep_opt *opt);
88 extern int grep_buffer(struct grep_opt *opt, const char *name, char *buf, unsigned long size);