xref: /aosp_15_r20/external/pcre/doc/html/pcre2_jit_compile.html (revision 22dc650d8ae982c6770746019a6f94af92b0f024)
1*22dc650dSSadaf Ebrahimi<html>
2*22dc650dSSadaf Ebrahimi<head>
3*22dc650dSSadaf Ebrahimi<title>pcre2_jit_compile specification</title>
4*22dc650dSSadaf Ebrahimi</head>
5*22dc650dSSadaf Ebrahimi<body bgcolor="#FFFFFF" text="#00005A" link="#0066FF" alink="#3399FF" vlink="#2222BB">
6*22dc650dSSadaf Ebrahimi<h1>pcre2_jit_compile man page</h1>
7*22dc650dSSadaf Ebrahimi<p>
8*22dc650dSSadaf EbrahimiReturn to the <a href="index.html">PCRE2 index page</a>.
9*22dc650dSSadaf Ebrahimi</p>
10*22dc650dSSadaf Ebrahimi<p>
11*22dc650dSSadaf EbrahimiThis page is part of the PCRE2 HTML documentation. It was generated
12*22dc650dSSadaf Ebrahimiautomatically from the original man page. If there is any nonsense in it,
13*22dc650dSSadaf Ebrahimiplease consult the man page, in case the conversion went wrong.
14*22dc650dSSadaf Ebrahimi<br>
15*22dc650dSSadaf Ebrahimi<br><b>
16*22dc650dSSadaf EbrahimiSYNOPSIS
17*22dc650dSSadaf Ebrahimi</b><br>
18*22dc650dSSadaf Ebrahimi<P>
19*22dc650dSSadaf Ebrahimi<b>#include &#60;pcre2.h&#62;</b>
20*22dc650dSSadaf Ebrahimi</P>
21*22dc650dSSadaf Ebrahimi<P>
22*22dc650dSSadaf Ebrahimi<b>int pcre2_jit_compile(pcre2_code *<i>code</i>, uint32_t <i>options</i>);</b>
23*22dc650dSSadaf Ebrahimi</P>
24*22dc650dSSadaf Ebrahimi<br><b>
25*22dc650dSSadaf EbrahimiDESCRIPTION
26*22dc650dSSadaf Ebrahimi</b><br>
27*22dc650dSSadaf Ebrahimi<P>
28*22dc650dSSadaf EbrahimiThis function requests JIT compilation, which, if the just-in-time compiler is
29*22dc650dSSadaf Ebrahimiavailable, further processes a compiled pattern into machine code that executes
30*22dc650dSSadaf Ebrahimimuch faster than the <b>pcre2_match()</b> interpretive matching function. Full
31*22dc650dSSadaf Ebrahimidetails are given in the
32*22dc650dSSadaf Ebrahimi<a href="pcre2jit.html"><b>pcre2jit</b></a>
33*22dc650dSSadaf Ebrahimidocumentation.
34*22dc650dSSadaf Ebrahimi</P>
35*22dc650dSSadaf Ebrahimi<P>
36*22dc650dSSadaf EbrahimiThe first argument is a pointer that was returned by a successful call to
37*22dc650dSSadaf Ebrahimi<b>pcre2_compile()</b>, and the second must contain one or more of the following
38*22dc650dSSadaf Ebrahimibits:
39*22dc650dSSadaf Ebrahimi<pre>
40*22dc650dSSadaf Ebrahimi  PCRE2_JIT_COMPLETE      compile code for full matching
41*22dc650dSSadaf Ebrahimi  PCRE2_JIT_PARTIAL_SOFT  compile code for soft partial matching
42*22dc650dSSadaf Ebrahimi  PCRE2_JIT_PARTIAL_HARD  compile code for hard partial matching
43*22dc650dSSadaf Ebrahimi</pre>
44*22dc650dSSadaf EbrahimiThere is also an obsolete option called PCRE2_JIT_INVALID_UTF, which has been
45*22dc650dSSadaf Ebrahimisuperseded by the <b>pcre2_compile()</b> option PCRE2_MATCH_INVALID_UTF. The old
46*22dc650dSSadaf Ebrahimioption is deprecated and may be removed in the future.
47*22dc650dSSadaf Ebrahimi</P>
48*22dc650dSSadaf Ebrahimi<P>
49*22dc650dSSadaf EbrahimiThe yield of the function is 0 for success, or a negative error code otherwise.
50*22dc650dSSadaf EbrahimiIn particular, PCRE2_ERROR_JIT_BADOPTION is returned if JIT is not supported or
51*22dc650dSSadaf Ebrahimiif an unknown bit is set in <i>options</i>. The function can also return
52*22dc650dSSadaf EbrahimiPCRE2_ERROR_NOMEMORY if JIT is unable to allocate executable memory for the
53*22dc650dSSadaf Ebrahimicompiler, even if it was because of a system security restriction.
54*22dc650dSSadaf Ebrahimi</P>
55*22dc650dSSadaf Ebrahimi<P>
56*22dc650dSSadaf EbrahimiThere is a complete description of the PCRE2 native API in the
57*22dc650dSSadaf Ebrahimi<a href="pcre2api.html"><b>pcre2api</b></a>
58*22dc650dSSadaf Ebrahimipage and a description of the POSIX API in the
59*22dc650dSSadaf Ebrahimi<a href="pcre2posix.html"><b>pcre2posix</b></a>
60*22dc650dSSadaf Ebrahimipage.
61*22dc650dSSadaf Ebrahimi<p>
62*22dc650dSSadaf EbrahimiReturn to the <a href="index.html">PCRE2 index page</a>.
63*22dc650dSSadaf Ebrahimi</p>
64