Fix documentation typos and upgrade documentation checking script.

This commit is contained in:
Philip.Hazel 2020-04-24 16:05:36 +00:00
parent ce558bbff1
commit d4e4533240
16 changed files with 80 additions and 69 deletions

View File

@ -16,6 +16,7 @@ while (scalar(@ARGV) > 0)
while (<IN>) while (<IN>)
{ {
$count = 0;
$line++; $line++;
if (/^\s*$/) if (/^\s*$/)
{ {
@ -50,13 +51,23 @@ while (scalar(@ARGV) > 0)
$yield = 1; $yield = 1;
} }
} }
else elsif (/\\[^ef]|\\f[^IBP]/)
{ {
if (/\\[^ef]|\\f[^IBP]/) printf "Bad backslash in line $line of $file\n";
{ $yield = 1;
printf "Bad backslash in line $line of $file\n"; }
$yield = 1; while (/\\f[BI]/g)
} {
$count++;
}
while (/\\fP/g)
{
$count--;
}
if ($count != 0)
{
printf "Mismatching formatting in line $line of $file\n";
$yield = 1;
} }
} }

View File

@ -29,7 +29,7 @@ This function frees unused JIT executable memory. The argument is a general
context, for custom memory management, or NULL for standard memory management. context, for custom memory management, or NULL for standard memory management.
JIT memory allocation retains some memory in order to improve future JIT JIT memory allocation retains some memory in order to improve future JIT
compilation speed. In low memory conditions, compilation speed. In low memory conditions,
\fBpcre2_jit_free_unused_memory()\fB can be used to cause this memory to be <b>pcre2_jit_free_unused_memory()</b> can be used to cause this memory to be
freed. freed.
</P> </P>
<P> <P>

View File

@ -252,7 +252,7 @@ document for an overview of all the PCRE2 documentation.
<b>int pcre2_substitute(const pcre2_code *<i>code</i>, PCRE2_SPTR <i>subject</i>,</b> <b>int pcre2_substitute(const pcre2_code *<i>code</i>, PCRE2_SPTR <i>subject</i>,</b>
<b> PCRE2_SIZE <i>length</i>, PCRE2_SIZE <i>startoffset</i>,</b> <b> PCRE2_SIZE <i>length</i>, PCRE2_SIZE <i>startoffset</i>,</b>
<b> uint32_t <i>options</i>, pcre2_match_data *<i>match_data</i>,</b> <b> uint32_t <i>options</i>, pcre2_match_data *<i>match_data</i>,</b>
<b> pcre2_match_context *<i>mcontext</i>, PCRE2_SPTR \fIreplacementzfP,</b> <b> pcre2_match_context *<i>mcontext</i>, PCRE2_SPTR <i>replacementz</i>,</b>
<b> PCRE2_SIZE <i>rlength</i>, PCRE2_UCHAR *<i>outputbuffer</i>,</b> <b> PCRE2_SIZE <i>rlength</i>, PCRE2_UCHAR *<i>outputbuffer</i>,</b>
<b> PCRE2_SIZE *<i>outlengthptr</i>);</b> <b> PCRE2_SIZE *<i>outlengthptr</i>);</b>
</P> </P>
@ -3485,7 +3485,7 @@ set in the match context, searching stops when that limit is reached.
<P> <P>
You can restrict the effect of a global substitution to a portion of the You can restrict the effect of a global substitution to a portion of the
subject string by setting either or both of <i>startoffset</i> and an offset subject string by setting either or both of <i>startoffset</i> and an offset
limit. Here is a \fPpcre2test\fP example: limit. Here is a <b>pcre2test</b> example:
<pre> <pre>
/B/g,replace=!,use_offset_limit /B/g,replace=!,use_offset_limit
ABC ABC ABC ABC\=offset=3,offset_limit=12 ABC ABC ABC ABC\=offset=3,offset_limit=12

View File

@ -436,7 +436,7 @@ default parameter values by adding, for example,
--with-pcre2grep-bufsize=51200 --with-pcre2grep-bufsize=51200
--with-pcre2grep-max-bufsize=2097152 --with-pcre2grep-max-bufsize=2097152
</pre> </pre>
to the <b>configure</b> command. The caller of \fPpcre2grep\fP can override to the <b>configure</b> command. The caller of <b>pcre2grep</b> can override
these values by using --buffer-size and --max-buffer-size on the command line. these values by using --buffer-size and --max-buffer-size on the command line.
</P> </P>
<br><a name="SEC17" href="#TOC1">PCRE2TEST OPTION FOR LIBREADLINE SUPPORT</a><br> <br><a name="SEC17" href="#TOC1">PCRE2TEST OPTION FOR LIBREADLINE SUPPORT</a><br>

View File

@ -562,7 +562,7 @@ when the PCRE2 library is compiled; if they are not specified, the defaults
are very large and so effectively unlimited. are very large and so effectively unlimited.
</P> </P>
<P> <P>
\fB--max-buffer-size=<i>number</i> <b>--max-buffer-size</b>=<i>number</i>
This limits the expansion of the processing buffer, whose initial size can be This limits the expansion of the processing buffer, whose initial size can be
set by <b>--buffer-size</b>. The maximum buffer size is silently forced to be no set by <b>--buffer-size</b>. The maximum buffer size is silently forced to be no
smaller than the starting buffer size. smaller than the starting buffer size.
@ -597,7 +597,7 @@ well as possibly handling a two-character newline sequence.
There is a limit to the number of lines that can be matched, imposed by the way There is a limit to the number of lines that can be matched, imposed by the way
that <b>pcre2grep</b> buffers the input file as it scans it. With a sufficiently that <b>pcre2grep</b> buffers the input file as it scans it. With a sufficiently
large processing buffer, this should not be a problem, but the <b>-M</b> option large processing buffer, this should not be a problem, but the <b>-M</b> option
does not work when input is read line by line (see \fP--line-buffered\fP.) does not work when input is read line by line (see <b>--line-buffered</b>.)
</P> </P>
<P> <P>
<b>-N</b> <i>newline-type</i>, <b>--newline</b>=<i>newline-type</i> <b>-N</b> <i>newline-type</i>, <b>--newline</b>=<i>newline-type</i>

View File

@ -90,7 +90,7 @@ or a negative error code.
There is a limit to the size of pattern that JIT supports, imposed by the size There is a limit to the size of pattern that JIT supports, imposed by the size
of machine stack that it uses. The exact rules are not documented because they of machine stack that it uses. The exact rules are not documented because they
may change at any time, in particular, when new optimizations are introduced. may change at any time, in particular, when new optimizations are introduced.
If a pattern is too big, a call to \fBpcre2_jit_compile()\fB returns If a pattern is too big, a call to <b>pcre2_jit_compile()</b> returns
PCRE2_ERROR_NOMEMORY. PCRE2_ERROR_NOMEMORY.
</P> </P>
<P> <P>
@ -339,12 +339,12 @@ stack through the JIT callback function.
You can free a JIT stack at any time, as long as it will not be used by You can free a JIT stack at any time, as long as it will not be used by
<b>pcre2_match()</b> again. When you assign the stack to a match context, only a <b>pcre2_match()</b> again. When you assign the stack to a match context, only a
pointer is set. There is no reference counting or any other magic. You can free pointer is set. There is no reference counting or any other magic. You can free
compiled patterns, contexts, and stacks in any order, anytime. Just \fIdo compiled patterns, contexts, and stacks in any order, anytime.
not\fP call <b>pcre2_match()</b> with a match context pointing to an already Just <i>do not</i> call <b>pcre2_match()</b> with a match context pointing to an
freed stack, as that will cause SEGFAULT. (Also, do not free a stack currently already freed stack, as that will cause SEGFAULT. (Also, do not free a stack
used by <b>pcre2_match()</b> in another thread). You can also replace the stack currently used by <b>pcre2_match()</b> in another thread). You can also replace
in a context at any time when it is not in use. You should free the previous the stack in a context at any time when it is not in use. You should free the
stack before assigning a replacement. previous stack before assigning a replacement.
</P> </P>
<P> <P>
(5) Should I allocate/free a stack every time before/after calling (5) Should I allocate/free a stack every time before/after calling

View File

@ -295,7 +295,7 @@ these characters with '&#60;' if the <b>allusedtext</b> modifier is set:
Partial match: 123ab Partial match: 123ab
&#60;&#60;&#60; &#60;&#60;&#60;
</pre> </pre>
However, the \fPallusedtext\fP modifier is not available for JIT matching, However, the <b>allusedtext</b> modifier is not available for JIT matching,
because JIT matching does not record the first (or last) consulted characters. because JIT matching does not record the first (or last) consulted characters.
For this reason, this information is not available via the API. It is therefore For this reason, this information is not available via the API. It is therefore
not possible in general to obtain the exact number of characters that must be not possible in general to obtain the exact number of characters that must be

View File

@ -261,7 +261,7 @@ standard output, then exit with zero exit code. All other options are ignored.
If both -C and -LM are present, whichever is first is recognized. If both -C and -LM are present, whichever is first is recognized.
</P> </P>
<P> <P>
\fB-pattern\fB <i>modifier-list</i> <b>-pattern</b> <i>modifier-list</i>
Behave as if each pattern line contains the given modifiers. Behave as if each pattern line contains the given modifiers.
</P> </P>
<P> <P>

View File

@ -351,7 +351,7 @@ PCRE2 NATIVE API STRING SUBSTITUTION FUNCTION
int pcre2_substitute(const pcre2_code *code, PCRE2_SPTR subject, int pcre2_substitute(const pcre2_code *code, PCRE2_SPTR subject,
PCRE2_SIZE length, PCRE2_SIZE startoffset, PCRE2_SIZE length, PCRE2_SIZE startoffset,
uint32_t options, pcre2_match_data *match_data, uint32_t options, pcre2_match_data *match_data,
pcre2_match_context *mcontext, PCRE2_SPTR replacementzfP, pcre2_match_context *mcontext, PCRE2_SPTR replacementz,
PCRE2_SIZE rlength, PCRE2_UCHAR *outputbuffer, PCRE2_SIZE rlength, PCRE2_UCHAR *outputbuffer,
PCRE2_SIZE *outlengthptr); PCRE2_SIZE *outlengthptr);
@ -5334,7 +5334,7 @@ JIT STACK FAQ
pcre2_match() again. When you assign the stack to a match context, only pcre2_match() again. When you assign the stack to a match context, only
a pointer is set. There is no reference counting or any other magic. a pointer is set. There is no reference counting or any other magic.
You can free compiled patterns, contexts, and stacks in any order, any- You can free compiled patterns, contexts, and stacks in any order, any-
time. Just do not call pcre2_match() with a match context pointing to time. Just do not call pcre2_match() with a match context pointing to
an already freed stack, as that will cause SEGFAULT. (Also, do not free an already freed stack, as that will cause SEGFAULT. (Also, do not free
a stack currently used by pcre2_match() in another thread). You can a stack currently used by pcre2_match() in another thread). You can
also replace the stack in a context at any time when it is not in use. also replace the stack in a context at any time when it is not in use.

View File

@ -17,7 +17,7 @@ This function frees unused JIT executable memory. The argument is a general
context, for custom memory management, or NULL for standard memory management. context, for custom memory management, or NULL for standard memory management.
JIT memory allocation retains some memory in order to improve future JIT JIT memory allocation retains some memory in order to improve future JIT
compilation speed. In low memory conditions, compilation speed. In low memory conditions,
\fBpcre2_jit_free_unused_memory()\fB can be used to cause this memory to be \fBpcre2_jit_free_unused_memory()\fP can be used to cause this memory to be
freed. freed.
.P .P
There is a complete description of the PCRE2 native API in the There is a complete description of the PCRE2 native API in the

View File

@ -187,7 +187,7 @@ document for an overview of all the PCRE2 documentation.
.B int pcre2_substitute(const pcre2_code *\fIcode\fP, PCRE2_SPTR \fIsubject\fP, .B int pcre2_substitute(const pcre2_code *\fIcode\fP, PCRE2_SPTR \fIsubject\fP,
.B " PCRE2_SIZE \fIlength\fP, PCRE2_SIZE \fIstartoffset\fP," .B " PCRE2_SIZE \fIlength\fP, PCRE2_SIZE \fIstartoffset\fP,"
.B " uint32_t \fIoptions\fP, pcre2_match_data *\fImatch_data\fP," .B " uint32_t \fIoptions\fP, pcre2_match_data *\fImatch_data\fP,"
.B " pcre2_match_context *\fImcontext\fP, PCRE2_SPTR \fIreplacementzfP," .B " pcre2_match_context *\fImcontext\fP, PCRE2_SPTR \fIreplacementz\fP,"
.B " PCRE2_SIZE \fIrlength\fP, PCRE2_UCHAR *\fIoutputbuffer\fP," .B " PCRE2_SIZE \fIrlength\fP, PCRE2_UCHAR *\fIoutputbuffer\fP,"
.B " PCRE2_SIZE *\fIoutlengthptr\fP);" .B " PCRE2_SIZE *\fIoutlengthptr\fP);"
.fi .fi
@ -3495,7 +3495,7 @@ set in the match context, searching stops when that limit is reached.
.P .P
You can restrict the effect of a global substitution to a portion of the You can restrict the effect of a global substitution to a portion of the
subject string by setting either or both of \fIstartoffset\fP and an offset subject string by setting either or both of \fIstartoffset\fP and an offset
limit. Here is a \fPpcre2test\fP example: limit. Here is a \fBpcre2test\fP example:
.sp .sp
/B/g,replace=!,use_offset_limit /B/g,replace=!,use_offset_limit
ABC ABC ABC ABC\e=offset=3,offset_limit=12 ABC ABC ABC ABC\e=offset=3,offset_limit=12

View File

@ -439,7 +439,7 @@ default parameter values by adding, for example,
--with-pcre2grep-bufsize=51200 --with-pcre2grep-bufsize=51200
--with-pcre2grep-max-bufsize=2097152 --with-pcre2grep-max-bufsize=2097152
.sp .sp
to the \fBconfigure\fP command. The caller of \fPpcre2grep\fP can override to the \fBconfigure\fP command. The caller of \fBpcre2grep\fP can override
these values by using --buffer-size and --max-buffer-size on the command line. these values by using --buffer-size and --max-buffer-size on the command line.
. .
. .

View File

@ -488,7 +488,7 @@ There are no short forms for these options. The default limits can be set
when the PCRE2 library is compiled; if they are not specified, the defaults when the PCRE2 library is compiled; if they are not specified, the defaults
are very large and so effectively unlimited. are very large and so effectively unlimited.
.TP .TP
\fB--max-buffer-size=\fInumber\fP \fB--max-buffer-size\fP=\fInumber\fP
This limits the expansion of the processing buffer, whose initial size can be This limits the expansion of the processing buffer, whose initial size can be
set by \fB--buffer-size\fP. The maximum buffer size is silently forced to be no set by \fB--buffer-size\fP. The maximum buffer size is silently forced to be no
smaller than the starting buffer size. smaller than the starting buffer size.
@ -520,7 +520,7 @@ well as possibly handling a two-character newline sequence.
There is a limit to the number of lines that can be matched, imposed by the way There is a limit to the number of lines that can be matched, imposed by the way
that \fBpcre2grep\fP buffers the input file as it scans it. With a sufficiently that \fBpcre2grep\fP buffers the input file as it scans it. With a sufficiently
large processing buffer, this should not be a problem, but the \fB-M\fP option large processing buffer, this should not be a problem, but the \fB-M\fP option
does not work when input is read line by line (see \fP--line-buffered\fP.) does not work when input is read line by line (see \fB--line-buffered\fP.)
.TP .TP
\fB-N\fP \fInewline-type\fP, \fB--newline\fP=\fInewline-type\fP \fB-N\fP \fInewline-type\fP, \fB--newline\fP=\fInewline-type\fP
Six different conventions for indicating the ends of lines in scanned files are Six different conventions for indicating the ends of lines in scanned files are

View File

@ -64,7 +64,7 @@ or a negative error code.
There is a limit to the size of pattern that JIT supports, imposed by the size There is a limit to the size of pattern that JIT supports, imposed by the size
of machine stack that it uses. The exact rules are not documented because they of machine stack that it uses. The exact rules are not documented because they
may change at any time, in particular, when new optimizations are introduced. may change at any time, in particular, when new optimizations are introduced.
If a pattern is too big, a call to \fBpcre2_jit_compile()\fB returns If a pattern is too big, a call to \fBpcre2_jit_compile()\fP returns
PCRE2_ERROR_NOMEMORY. PCRE2_ERROR_NOMEMORY.
.P .P
PCRE2_JIT_COMPLETE requests the JIT compiler to generate code for complete PCRE2_JIT_COMPLETE requests the JIT compiler to generate code for complete
@ -315,12 +315,12 @@ stack through the JIT callback function.
You can free a JIT stack at any time, as long as it will not be used by You can free a JIT stack at any time, as long as it will not be used by
\fBpcre2_match()\fP again. When you assign the stack to a match context, only a \fBpcre2_match()\fP again. When you assign the stack to a match context, only a
pointer is set. There is no reference counting or any other magic. You can free pointer is set. There is no reference counting or any other magic. You can free
compiled patterns, contexts, and stacks in any order, anytime. Just \fIdo compiled patterns, contexts, and stacks in any order, anytime.
not\fP call \fBpcre2_match()\fP with a match context pointing to an already Just \fIdo not\fP call \fBpcre2_match()\fP with a match context pointing to an
freed stack, as that will cause SEGFAULT. (Also, do not free a stack currently already freed stack, as that will cause SEGFAULT. (Also, do not free a stack
used by \fBpcre2_match()\fP in another thread). You can also replace the stack currently used by \fBpcre2_match()\fP in another thread). You can also replace
in a context at any time when it is not in use. You should free the previous the stack in a context at any time when it is not in use. You should free the
stack before assigning a replacement. previous stack before assigning a replacement.
.P .P
(5) Should I allocate/free a stack every time before/after calling (5) Should I allocate/free a stack every time before/after calling
\fBpcre2_match()\fP? \fBpcre2_match()\fP?

View File

@ -261,7 +261,7 @@ these characters with '<' if the \fBallusedtext\fP modifier is set:
Partial match: 123ab Partial match: 123ab
<<< <<<
.sp .sp
However, the \fPallusedtext\fP modifier is not available for JIT matching, However, the \fBallusedtext\fP modifier is not available for JIT matching,
because JIT matching does not record the first (or last) consulted characters. because JIT matching does not record the first (or last) consulted characters.
For this reason, this information is not available via the API. It is therefore For this reason, this information is not available via the API. It is therefore
not possible in general to obtain the exact number of characters that must be not possible in general to obtain the exact number of characters that must be

View File

@ -218,7 +218,7 @@ List modifiers: write a list of available pattern and subject modifiers to the
standard output, then exit with zero exit code. All other options are ignored. standard output, then exit with zero exit code. All other options are ignored.
If both -C and -LM are present, whichever is first is recognized. If both -C and -LM are present, whichever is first is recognized.
.TP 10 .TP 10
\fB-pattern\fB \fImodifier-list\fP \fB-pattern\fP \fImodifier-list\fP
Behave as if each pattern line contains the given modifiers. Behave as if each pattern line contains the given modifiers.
.TP 10 .TP 10
\fB-q\fP \fB-q\fP