8 typedef int pcre_extra;
28 enum grep_header_field {
29 GREP_HEADER_AUTHOR = 0,
32 #define GREP_HEADER_FIELD_MAX (GREP_HEADER_COMMITTER + 1)
35 struct grep_pat *next;
38 enum grep_pat_token token;
41 enum grep_header_field field;
44 pcre_extra *pcre_extra_info;
47 unsigned ignore_case:1;
48 unsigned word_regexp:1;
60 enum grep_expr_node node;
63 struct grep_pat *atom;
64 struct grep_expr *unary;
66 struct grep_expr *left;
67 struct grep_expr *right;
73 struct grep_pat *pattern_list;
74 struct grep_pat **pattern_tail;
75 struct grep_pat *header_list;
76 struct grep_pat **header_tail;
77 struct grep_expr *pattern_expression;
86 int unmatch_name_only;
91 #define GREP_BINARY_DEFAULT 0
92 #define GREP_BINARY_NOMATCH 1
93 #define GREP_BINARY_TEXT 2
99 int null_following_name;
104 char color_context[COLOR_MAXLEN];
105 char color_filename[COLOR_MAXLEN];
106 char color_function[COLOR_MAXLEN];
107 char color_lineno[COLOR_MAXLEN];
108 char color_match[COLOR_MAXLEN];
109 char color_selected[COLOR_MAXLEN];
110 char color_sep[COLOR_MAXLEN];
112 unsigned pre_context;
113 unsigned post_context;
120 void (*output)(struct grep_opt *opt, const void *data, size_t size);
124 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);
125 extern void append_grep_pattern(struct grep_opt *opt, const char *pat, const char *origin, int no, enum grep_pat_token t);
126 extern void append_header_grep_pattern(struct grep_opt *, enum grep_header_field, const char *);
127 extern void compile_grep_patterns(struct grep_opt *opt);
128 extern void free_grep_patterns(struct grep_opt *opt);
129 extern int grep_buffer(struct grep_opt *opt, const char *name, char *buf, unsigned long size);
131 extern struct grep_opt *grep_opt_dup(const struct grep_opt *opt);
132 extern int grep_threads_ok(const struct grep_opt *opt);