21 enum grep_header_field {
22 GREP_HEADER_AUTHOR = 0,
25 #define GREP_HEADER_FIELD_MAX (GREP_HEADER_COMMITTER + 1)
28 struct grep_pat *next;
31 enum grep_pat_token token;
34 enum grep_header_field field;
37 unsigned ignore_case:1;
38 unsigned word_regexp:1;
50 enum grep_expr_node node;
53 struct grep_pat *atom;
54 struct grep_expr *unary;
56 struct grep_expr *left;
57 struct grep_expr *right;
63 struct grep_pat *pattern_list;
64 struct grep_pat **pattern_tail;
65 struct grep_pat *header_list;
66 struct grep_pat **header_tail;
67 struct grep_expr *pattern_expression;
76 int unmatch_name_only;
81 #define GREP_BINARY_DEFAULT 0
82 #define GREP_BINARY_NOMATCH 1
83 #define GREP_BINARY_TEXT 2
88 int null_following_name;
92 char color_context[COLOR_MAXLEN];
93 char color_filename[COLOR_MAXLEN];
94 char color_function[COLOR_MAXLEN];
95 char color_lineno[COLOR_MAXLEN];
96 char color_match[COLOR_MAXLEN];
97 char color_selected[COLOR_MAXLEN];
98 char color_sep[COLOR_MAXLEN];
100 unsigned pre_context;
101 unsigned post_context;
106 void (*output)(struct grep_opt *opt, const void *data, size_t size);
110 extern void append_grep_pat(struct grep_opt *opt, const char *pat, size_t patlen, const char *origin, int no, enum grep_pat_token t);
111 extern void append_grep_pattern(struct grep_opt *opt, const char *pat, const char *origin, int no, enum grep_pat_token t);
112 extern void append_header_grep_pattern(struct grep_opt *, enum grep_header_field, const char *);
113 extern void compile_grep_patterns(struct grep_opt *opt);
114 extern void free_grep_patterns(struct grep_opt *opt);
115 extern int grep_buffer(struct grep_opt *opt, const char *name, char *buf, unsigned long size);
117 extern struct grep_opt *grep_opt_dup(const struct grep_opt *opt);
118 extern int grep_threads_ok(const struct grep_opt *opt);