]> git.ipfire.org Git - thirdparty/git.git/blobdiff - grep.h
grep: add support for PCRE v2
[thirdparty/git.git] / grep.h
diff --git a/grep.h b/grep.h
index 3bff0870b25cedce6d01d2924eb2af61bd6b58aa..6f3d4e19548016b5eee5a9d02399b67e57536cdf 100644 (file)
--- a/grep.h
+++ b/grep.h
@@ -21,6 +21,16 @@ typedef int pcre;
 typedef int pcre_extra;
 typedef int pcre_jit_stack;
 #endif
+#ifdef USE_LIBPCRE2
+#define PCRE2_CODE_UNIT_WIDTH 8
+#include <pcre2.h>
+#else
+typedef int pcre2_code;
+typedef int pcre2_match_data;
+typedef int pcre2_compile_context;
+typedef int pcre2_match_context;
+typedef int pcre2_jit_stack;
+#endif
 #include "kwset.h"
 #include "thread-utils.h"
 #include "userdiff.h"
@@ -65,6 +75,12 @@ struct grep_pat {
        pcre_jit_stack *pcre1_jit_stack;
        const unsigned char *pcre1_tables;
        int pcre1_jit_on;
+       pcre2_code *pcre2_pattern;
+       pcre2_match_data *pcre2_match_data;
+       pcre2_compile_context *pcre2_compile_context;
+       pcre2_match_context *pcre2_match_context;
+       pcre2_jit_stack *pcre2_jit_stack;
+       uint32_t pcre2_jit_on;
        kwset_t kws;
        unsigned fixed:1;
        unsigned ignore_case:1;
@@ -128,6 +144,7 @@ struct grep_opt {
        int extended;
        int use_reflog_filter;
        int pcre1;
+       int pcre2;
        int relative;
        int pathname;
        int null_following_name;