Skip to content

Commit

Permalink
Fix for measurement
Browse files Browse the repository at this point in the history
  • Loading branch information
NWilson committed Dec 19, 2024
1 parent c63bfd5 commit 5ac1aea
Show file tree
Hide file tree
Showing 5 changed files with 184 additions and 127 deletions.
15 changes: 12 additions & 3 deletions doc/html/pcre2api.html
Original file line number Diff line number Diff line change
Expand Up @@ -4048,9 +4048,18 @@ <h1>pcre2api man page</h1>
The <b>pcre2_set_substitution_callout()</b> function can be used to specify a
callout function for <b>pcre2_substitute()</b>. This information is passed in
a match context. The callout function is called after each substitution has
been processed, but it can cause the replacement not to happen. The callout
function is not called for simulated substitutions that happen as a result of
the PCRE2_SUBSTITUTE_OVERFLOW_LENGTH option.
been processed, but it can cause the replacement not to happen.
</P>
<P>
The callout function is not called for simulated substitutions that happen as a
result of the PCRE2_SUBSTITUTE_OVERFLOW_LENGTH option. In this mode, when
substitution processing exceeds the buffer space provided by the caller,
processing continues by counting code units. The simulation is unable to
populate the callout block, and so the simulation is pessimistic about the
required buffer size. Whichever is larger of accepted or rejected substitution
is reported as the required size. Therefore, the returned buffer length may be
an overestimate (without a substitution callout, it is normally an exact
measurement).
</P>
<P>
The first argument of the callout function is a pointer to a substitute callout
Expand Down
Loading

0 comments on commit 5ac1aea

Please sign in to comment.