Skip to content

Commit

Permalink
doc: include summary of directives in pcre2_set_optimize.3
Browse files Browse the repository at this point in the history
Make the documentation of the new API more useful at a first glance
by providing the list of values that can be used while keeping all
details in pcre2api.3, and just like it is done in other similar pages.

While at it reorder the entries for the directives in pcre2api.3 so it
is more natural and to match the one used here.
  • Loading branch information
carenas committed Sep 21, 2024
1 parent cd4c0e3 commit 3163f0c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
16 changes: 13 additions & 3 deletions doc/pcre2_set_optimize.3
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,19 @@ The result is zero for success, PCRE2_ERROR_NULL if \fIccontext\fP is NULL,
or PCRE2_ERROR_BADOPTION if \fIdirective\fP is unknown. The latter could be
useful to detect if a certain optimization is available.
.P
There is a complete description of the PCRE2 native API, including all
permitted values for the \fIdirective\fP parameter of \fBpcre2_set_optimize()\fP,
in the
The list of possible values for the \fIdirective\fP parameter are:
.sp
PCRE2_OPTIMIZATION_FULL Enable all optimizations (default)
PCRE2_OPTIMIZATION_NONE Disable all optimizations
PCRE2_AUTO_POSSESS Enable auto-possessification
PCRE2_AUTO_POSSESS_OFF Disable auto-possessification
PCRE2_DOTSTAR_ANCHOR Enable implicit dotstar anchoring
PCRE2_DOTSTAR_ANCHOR_OFF Disable implicit dotstar anchoring
PCRE2_START_OPTIMIZE Enable start-up optimizations at match time
PCRE2_START_OPTIMIZE_OFF Disable start-up optimizations at match time
.sp
There is a complete description of the PCRE2 native API, including detailed
descriptions \fIdirective\fP parameter values in the
.\" HREF
\fBpcre2api\fP
.\"
Expand Down
8 changes: 4 additions & 4 deletions doc/pcre2api.3
Original file line number Diff line number Diff line change
Expand Up @@ -900,14 +900,14 @@ known that some optimizations cannot benefit a certain regex, it might be
desirable to disable them, in order to speed up compilation.
.P
The permitted values of \fIdirective\fP are as follows:
.sp
PCRE2_OPTIMIZATION_NONE
.sp
Disable all optional performance optimizations.
.sp
PCRE2_OPTIMIZATION_FULL
.sp
Enable all optional performance optimizations. This is the default value.
.sp
PCRE2_OPTIMIZATION_NONE
.sp
Disable all optional performance optimizations.
.sp
PCRE2_AUTO_POSSESS
PCRE2_AUTO_POSSESS_OFF
Expand Down

0 comments on commit 3163f0c

Please sign in to comment.