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 ignore_case:1;
36 unsigned word_regexp:1;
47 enum grep_expr_node node;
50 struct grep_pat *atom;
51 struct grep_expr *unary;
53 struct grep_expr *left;
54 struct grep_expr *right;
60 struct grep_pat *pattern_list;
61 struct grep_pat **pattern_tail;
62 struct grep_pat *header_list;
63 struct grep_pat **header_tail;
64 struct grep_expr *pattern_expression;
73 int unmatch_name_only;
78 #define GREP_BINARY_DEFAULT 0
79 #define GREP_BINARY_NOMATCH 1
80 #define GREP_BINARY_TEXT 2
85 int null_following_name;
89 char color_context[COLOR_MAXLEN];
90 char color_filename[COLOR_MAXLEN];
91 char color_function[COLOR_MAXLEN];
92 char color_lineno[COLOR_MAXLEN];
93 char color_match[COLOR_MAXLEN];
94 char color_selected[COLOR_MAXLEN];
95 char color_sep[COLOR_MAXLEN];
98 unsigned post_context;
103 void (*output)(struct grep_opt *opt, const void *data, size_t size);
107 extern void append_grep_pattern(struct grep_opt *opt, const char *pat, const char *origin, int no, enum grep_pat_token t);
108 extern void append_header_grep_pattern(struct grep_opt *, enum grep_header_field, const char *);
109 extern void compile_grep_patterns(struct grep_opt *opt);
110 extern void free_grep_patterns(struct grep_opt *opt);
111 extern int grep_buffer(struct grep_opt *opt, const char *name, char *buf, unsigned long size);
113 extern struct grep_opt *grep_opt_dup(const struct grep_opt *opt);
114 extern int grep_threads_ok(const struct grep_opt *opt);