]> git.ipfire.org Git - thirdparty/git.git/blobdiff - grep.h
grep: refactor next_match() and match_one_pattern() for external use
[thirdparty/git.git] / grep.h
diff --git a/grep.h b/grep.h
index 3cb8a83ae8ca584bc1b3f7a5d0e9dd6b92381777..808ad76f0c53f9296ad2397d19a4925b217bc5a9 100644 (file)
--- a/grep.h
+++ b/grep.h
@@ -191,6 +191,15 @@ void compile_grep_patterns(struct grep_opt *opt);
 void free_grep_patterns(struct grep_opt *opt);
 int grep_buffer(struct grep_opt *opt, const char *buf, unsigned long size);
 
+/* The field parameter is only used to filter header patterns
+ * (where appropriate). If filtering isn't desirable
+ * GREP_HEADER_FIELD_MAX should be supplied.
+ */
+int grep_next_match(struct grep_opt *opt,
+                   const char *bol, const char *eol,
+                   enum grep_context ctx, regmatch_t *pmatch,
+                   enum grep_header_field field, int eflags);
+
 struct grep_source {
        char *name;