Elliott Hughes | 2dbd7d2 | 2020-06-03 14:32:37 -0700 | [diff] [blame] | 1 | .TH PCRE2_JIT_COMPILE 3 "29 July 2019" "PCRE2 10.34" |
Janis Danisevskis | 112c9cc | 2016-03-31 13:35:25 +0100 | [diff] [blame] | 2 | .SH NAME |
| 3 | PCRE2 - Perl-compatible regular expressions (revised API) |
| 4 | .SH SYNOPSIS |
| 5 | .rs |
| 6 | .sp |
| 7 | .B #include <pcre2.h> |
| 8 | .PP |
| 9 | .nf |
| 10 | .B int pcre2_jit_compile(pcre2_code *\fIcode\fP, uint32_t \fIoptions\fP); |
| 11 | .fi |
| 12 | . |
| 13 | .SH DESCRIPTION |
| 14 | .rs |
| 15 | .sp |
| 16 | This function requests JIT compilation, which, if the just-in-time compiler is |
| 17 | available, further processes a compiled pattern into machine code that executes |
| 18 | much faster than the \fBpcre2_match()\fP interpretive matching function. Full |
| 19 | details are given in the |
| 20 | .\" HREF |
| 21 | \fBpcre2jit\fP |
| 22 | .\" |
| 23 | documentation. |
| 24 | .P |
| 25 | The first argument is a pointer that was returned by a successful call to |
| 26 | \fBpcre2_compile()\fP, and the second must contain one or more of the following |
| 27 | bits: |
| 28 | .sp |
| 29 | PCRE2_JIT_COMPLETE compile code for full matching |
| 30 | PCRE2_JIT_PARTIAL_SOFT compile code for soft partial matching |
| 31 | PCRE2_JIT_PARTIAL_HARD compile code for hard partial matching |
Janis Danisevskis | 112c9cc | 2016-03-31 13:35:25 +0100 | [diff] [blame] | 32 | .sp |
Elliott Hughes | 2dbd7d2 | 2020-06-03 14:32:37 -0700 | [diff] [blame] | 33 | There is also an obsolete option called PCRE2_JIT_INVALID_UTF, which has been |
| 34 | superseded by the \fBpcre2_compile()\fP option PCRE2_MATCH_INVALID_UTF. The old |
| 35 | option is deprecated and may be removed in the future. |
| 36 | .P |
Janis Danisevskis | 112c9cc | 2016-03-31 13:35:25 +0100 | [diff] [blame] | 37 | The yield of the function is 0 for success, or a negative error code otherwise. |
| 38 | In particular, PCRE2_ERROR_JIT_BADOPTION is returned if JIT is not supported or |
Elliott Hughes | 2dbd7d2 | 2020-06-03 14:32:37 -0700 | [diff] [blame] | 39 | if an unknown bit is set in \fIoptions\fP. The function can also return |
| 40 | PCRE2_ERROR_NOMEMORY if JIT is unable to allocate executable memory for the |
| 41 | compiler, even if it was because of a system security restriction. |
Janis Danisevskis | 112c9cc | 2016-03-31 13:35:25 +0100 | [diff] [blame] | 42 | .P |
| 43 | There is a complete description of the PCRE2 native API in the |
| 44 | .\" HREF |
| 45 | \fBpcre2api\fP |
| 46 | .\" |
| 47 | page and a description of the POSIX API in the |
| 48 | .\" HREF |
| 49 | \fBpcre2posix\fP |
| 50 | .\" |
| 51 | page. |