Skip to content

Commit 91606be

Browse files
authored
Further updates to pcre2_config docs, and remove pcre2test's VERSION_SIZE (#836)
1 parent 10f78a6 commit 91606be

File tree

5 files changed

+1298
-1271
lines changed

5 files changed

+1298
-1271
lines changed

doc/html/pcre2api.html

Lines changed: 29 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1374,15 +1374,18 @@ <h2><a name="SEC19" href="#TOC1">CHECKING BUILD-TIME OPTIONS</a></h2>
13741374
<pre>
13751375
PCRE2_CONFIG_JITTARGET
13761376
</pre>
1377-
The <i>where</i> argument should point to a buffer that is suitably aligned and
1378-
wide enough to hold the full string. The exact length required is returned when
1379-
calling <b>pcre2_config()</b> with <b>where</b> set to NULL first. The buffer is
1380-
filled with a string that contains the name of the architecture for which the JIT
1381-
compiler is configured at build time, for example, a 64-bit ARM CPU that supports
1382-
the Armv8.1 extension writes "ARM-64 (LSE) 64bit (little endian + unaligned)".
1383-
If JIT support is not available, PCRE2_ERROR_BADOPTION is returned, otherwise
1384-
the number of code units used is returned. This is the length of the string,
1385-
plus one code unit for the NUL character.
1377+
The <i>where</i> argument should point to a code-unit-aligned buffer. All
1378+
previous versions of PCRE2 have required no more than 128 code units of buffer
1379+
capacity. However, this requirement is not guaranteed to be maintained, so
1380+
applications should call <b>pcre2_config()</b> with <b>where</b> set to NULL to
1381+
receive the required buffer size, then assert or allocate a suitably-size buffer
1382+
for a second call to <b>pcre2_config()</b>. The buffer is filled with a string
1383+
that contains the name of the architecture for which the JIT compiler is
1384+
configured at build time, for example, a 64-bit ARM CPU that supports the
1385+
Armv8.1 extension writes "ARM-64 (LSE) 64bit (little endian + unaligned)". If
1386+
JIT support is not available, PCRE2_ERROR_BADOPTION is returned; otherwise the
1387+
number of code units used is returned. This is the length of the string plus one
1388+
unit for the terminating zero.
13861389
<pre>
13871390
PCRE2_CONFIG_LINKSIZE
13881391
</pre>
@@ -1451,13 +1454,15 @@ <h2><a name="SEC19" href="#TOC1">CHECKING BUILD-TIME OPTIONS</a></h2>
14511454
<pre>
14521455
PCRE2_CONFIG_UNICODE_VERSION
14531456
</pre>
1454-
The <i>where</i> argument should point to a buffer that is at least 24 code
1455-
units long. (The exact length required can be found by calling
1456-
<b>pcre2_config()</b> with <b>where</b> set to NULL.) If PCRE2 has been compiled
1457-
without Unicode support, the buffer is filled with the text "Unicode not
1458-
supported". Otherwise, the Unicode version string (for example, "8.0.0") is
1459-
inserted. The number of code units used is returned. This is the length of the
1460-
string plus one unit for the terminating zero.
1457+
The <i>where</i> argument should point to a code-unit-aligned buffer. All
1458+
previous versions of PCRE2 have required no more than 24 code units of buffer
1459+
capacity. However, applications should call <b>pcre2_config()</b> with
1460+
<b>where</b> set to NULL to receive the required buffer size, then assert or
1461+
allocate a suitably-size buffer for a second call to <b>pcre2_config()</b>. If
1462+
PCRE2 has been compiled without Unicode support, the buffer is filled with the
1463+
text "Unicode not supported". Otherwise, the Unicode version string (for
1464+
example, "8.0.0") is written. The number of code units used is returned. This is
1465+
the length of the string plus one unit for the terminating zero.
14611466
<pre>
14621467
PCRE2_CONFIG_UNICODE
14631468
</pre>
@@ -1466,12 +1471,14 @@ <h2><a name="SEC19" href="#TOC1">CHECKING BUILD-TIME OPTIONS</a></h2>
14661471
<pre>
14671472
PCRE2_CONFIG_VERSION
14681473
</pre>
1469-
The <i>where</i> argument should point to a buffer that is at least 24 code
1470-
units long. (The exact length required can be found by calling
1471-
<b>pcre2_config()</b> with <b>where</b> set to NULL.) The buffer is filled with
1472-
the PCRE2 version string, zero-terminated. The number of code units used is
1473-
returned. This is the length of the string plus one unit for the terminating
1474-
zero.
1474+
The <i>where</i> argument should point to a code-unit-aligned buffer. All
1475+
previous versions of PCRE2 have required no more than 24 code units of buffer
1476+
capacity. However, applications should call <b>pcre2_config()</b> with
1477+
<b>where</b> set to NULL to receive the required buffer size, then assert or
1478+
allocate a suitably-size buffer for a second call to <b>pcre2_config()</b>. The
1479+
buffer is filled with the PCRE2 version string, zero-terminated. The number of
1480+
code units used is returned. This is the length of the string plus one unit for
1481+
the terminating zero.
14751482
<a name="compiling"></a></p>
14761483
<h2><a name="SEC20" href="#TOC1">COMPILING A PATTERN</a></h2>
14771484
<p>

0 commit comments

Comments
 (0)