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
;
43 enum grep_expr_node node
;
46 struct grep_pat
*atom
;
47 struct grep_expr
*unary
;
49 struct grep_expr
*left
;
50 struct grep_expr
*right
;
56 struct grep_pat
*pattern_list
;
57 struct grep_pat
**pattern_tail
;
58 struct grep_expr
*pattern_expression
;
63 unsigned status_only
:1;
65 unsigned unmatch_name_only
:1;
67 unsigned word_regexp
:1;
70 #define GREP_BINARY_DEFAULT 0
71 #define GREP_BINARY_NOMATCH 1
72 #define GREP_BINARY_TEXT 2
77 unsigned null_following_name
:1;
80 unsigned post_context
;
83 extern void append_grep_pattern(struct grep_opt
*opt
, const char *pat
, const char *origin
, int no
, enum grep_pat_token t
);
84 extern void append_header_grep_pattern(struct grep_opt
*, enum grep_header_field
, const char *);
85 extern void compile_grep_patterns(struct grep_opt
*opt
);
86 extern void free_grep_patterns(struct grep_opt
*opt
);
87 extern int grep_buffer(struct grep_opt
*opt
, const char *name
, char *buf
, unsigned long size
);