Documentation update for NULL arguments.

This commit is contained in:
Philip.Hazel 2018-06-28 16:26:03 +00:00
parent 7e921fda05
commit 5a45a0712a
33 changed files with 826 additions and 756 deletions

View File

@ -25,7 +25,8 @@ SYNOPSIS
DESCRIPTION DESCRIPTION
</b><br> </b><br>
<P> <P>
This function frees the memory used for a compiled pattern, including any If <i>code</i> is NULL, this function does nothing. Otherwise, <i>code</i> must
point to a compiled pattern. This function frees its memory, including any
memory used by the JIT compiler. If the compiled pattern was created by a call memory used by the JIT compiler. If the compiled pattern was created by a call
to <b>pcre2_code_copy_with_tables()</b>, the memory for the character tables is to <b>pcre2_code_copy_with_tables()</b>, the memory for the character tables is
also freed. also freed.

View File

@ -27,7 +27,8 @@ DESCRIPTION
<P> <P>
This function frees the memory occupied by a compile context, using the memory This function frees the memory occupied by a compile context, using the memory
freeing function from the general context with which it was created, or freeing function from the general context with which it was created, or
<b>free()</b> if that was not set. <b>free()</b> if that was not set. If the argument is NULL, the function returns
immediately without doing anything.
</P> </P>
<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

@ -28,7 +28,8 @@ DESCRIPTION
This function is part of an experimental set of pattern conversion functions. This function is part of an experimental set of pattern conversion functions.
It frees the memory occupied by a convert context, using the memory It frees the memory occupied by a convert context, using the memory
freeing function from the general context with which it was created, or freeing function from the general context with which it was created, or
<b>free()</b> if that was not set. <b>free()</b> if that was not set. If the argument is NULL, the function returns
immediately without doing anything.
</P> </P>
<P> <P>
The pattern conversion functions are described in the The pattern conversion functions are described in the

View File

@ -28,7 +28,8 @@ DESCRIPTION
This function is part of an experimental set of pattern conversion functions. This function is part of an experimental set of pattern conversion functions.
It frees the memory occupied by a converted pattern that was obtained by It frees the memory occupied by a converted pattern that was obtained by
calling <b>pcre2_pattern_convert()</b> with arguments that caused it to place calling <b>pcre2_pattern_convert()</b> with arguments that caused it to place
the converted pattern into newly obtained heap memory. the converted pattern into newly obtained heap memory. If the argument is NULL,
the function returns immediately without doing anything.
</P> </P>
<P> <P>
The pattern conversion functions are described in the The pattern conversion functions are described in the

View File

@ -26,7 +26,8 @@ DESCRIPTION
</b><br> </b><br>
<P> <P>
This function frees the memory occupied by a general context, using the memory This function frees the memory occupied by a general context, using the memory
freeing function within the context, if set. freeing function within the context, if set. If the argument is NULL, the
function returns immediately without doing anything.
</P> </P>
<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

@ -38,6 +38,10 @@ passed to a matching function. The arguments of this function are:
</PRE> </PRE>
</P> </P>
<P> <P>
If <i>mcontext</i> is NULL, the function returns immediately, without doing
anything.
</P>
<P>
If <i>callback</i> is NULL and <i>callback_data</i> is NULL, an internal 32KiB If <i>callback</i> is NULL and <i>callback_data</i> is NULL, an internal 32KiB
block on the machine stack is used. block on the machine stack is used.
</P> </P>

View File

@ -26,8 +26,9 @@ DESCRIPTION
</b><br> </b><br>
<P> <P>
This function is used to free a JIT stack that was created by This function is used to free a JIT stack that was created by
<b>pcre2_jit_stack_create()</b> when it is no longer needed. For more details, <b>pcre2_jit_stack_create()</b> when it is no longer needed. If the argument is
see the NULL, the function returns immediately without doing anything. For more
details, see the
<a href="pcre2jit.html"><b>pcre2jit</b></a> <a href="pcre2jit.html"><b>pcre2jit</b></a>
page. page.
</P> </P>

View File

@ -27,7 +27,8 @@ DESCRIPTION
<P> <P>
This function frees the memory occupied by a match context, using the memory This function frees the memory occupied by a match context, using the memory
freeing function from the general context with which it was created, or freeing function from the general context with which it was created, or
<b>free()</b> if that was not set. <b>free()</b> if that was not set. If the argument is NULL, the function returns
immediately without doing anything.
</P> </P>
<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

@ -25,9 +25,10 @@ SYNOPSIS
DESCRIPTION DESCRIPTION
</b><br> </b><br>
<P> <P>
This function frees the memory occupied by a match data block, using the memory If <i>match_data</i> is NULL, this function does nothing. Otherwise,
freeing function from the general context or compiled pattern with which it was <i>match_data</i> must point to a match data block, which this function frees,
created, or <b>free()</b> if that was not set. using the memory freeing function from the general context or compiled pattern
with which it was created, or <b>free()</b> if that was not set.
</P> </P>
<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

@ -27,7 +27,8 @@ DESCRIPTION
<P> <P>
This function frees the memory that was obtained by This function frees the memory that was obtained by
<b>pcre2_serialize_encode()</b> to hold a serialized byte stream. The argument <b>pcre2_serialize_encode()</b> to hold a serialized byte stream. The argument
must point to such a byte stream. must point to such a byte stream or be NULL, in which case the function returns
without doing anything.
</P> </P>
<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

@ -28,7 +28,7 @@ DESCRIPTION
This is a convenience function for freeing the memory obtained by a previous This is a convenience function for freeing the memory obtained by a previous
call to <b>pcre2_substring_get_byname()</b> or call to <b>pcre2_substring_get_byname()</b> or
<b>pcre2_substring_get_bynumber()</b>. Its only argument is a pointer to the <b>pcre2_substring_get_bynumber()</b>. Its only argument is a pointer to the
string. string. If the argument is NULL, the function does nothing.
</P> </P>
<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

@ -27,7 +27,8 @@ DESCRIPTION
<P> <P>
This is a convenience function for freeing the store obtained by a previous This is a convenience function for freeing the store obtained by a previous
call to <b>pcre2substring_list_get()</b>. Its only argument is a pointer to call to <b>pcre2substring_list_get()</b>. Its only argument is a pointer to
the list of string pointers. the list of string pointers. If the argument is NULL, the function returns
immediately, without doing anything.
</P> </P>
<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

@ -518,7 +518,9 @@ been matched by <b>pcre2_match()</b>. They are:
<b>pcre2_substring_number_from_name()</b> <b>pcre2_substring_number_from_name()</b>
</pre> </pre>
<b>pcre2_substring_free()</b> and <b>pcre2_substring_list_free()</b> are also <b>pcre2_substring_free()</b> and <b>pcre2_substring_list_free()</b> are also
provided, to free memory used for extracted strings. provided, to free memory used for extracted strings. If either of these
functions is called with a NULL argument, the function returns immediately
without doing anything.
</P> </P>
<P> <P>
The function <b>pcre2_substitute()</b> can be called to match a pattern and The function <b>pcre2_substitute()</b> can be called to match a pattern and
@ -727,6 +729,10 @@ The memory used for a general context should be freed by calling:
<br> <br>
<br> <br>
<b>void pcre2_general_context_free(pcre2_general_context *<i>gcontext</i>);</b> <b>void pcre2_general_context_free(pcre2_general_context *<i>gcontext</i>);</b>
<br>
<br>
If this function is passed a NULL argument, it function returns immediately
without doing anything.
<a name="compilecontext"></a></P> <a name="compilecontext"></a></P>
<br><b> <br><b>
The compile context The compile context
@ -1249,6 +1255,8 @@ If the compile context argument <i>ccontext</i> is NULL, memory for the compiled
pattern is obtained by calling <b>malloc()</b>. Otherwise, it is obtained from pattern is obtained by calling <b>malloc()</b>. Otherwise, it is obtained from
the same memory function that was used for the compile context. The caller must the same memory function that was used for the compile context. The caller must
free the memory by calling <b>pcre2_code_free()</b> when it is no longer needed. free the memory by calling <b>pcre2_code_free()</b> when it is no longer needed.
If <b>pcre2_code_free()</b> is called with a NULL argument, it returns
immediately, without doing anything.
</P> </P>
<P> <P>
The function <b>pcre2_code_copy()</b> makes a copy of the compiled code in new The function <b>pcre2_code_copy()</b> makes a copy of the compiled code in new
@ -1257,7 +1265,8 @@ if the code has been processed by the JIT compiler (see
<a href="#jitcompiling">below),</a> <a href="#jitcompiling">below),</a>
the JIT information cannot be copied (because it is position-dependent). the JIT information cannot be copied (because it is position-dependent).
The new copy can initially be used only for non-JIT matching, though it can be The new copy can initially be used only for non-JIT matching, though it can be
passed to <b>pcre2_jit_compile()</b> if required. passed to <b>pcre2_jit_compile()</b> if required. If <b>pcre2_code_copy()</b> is
called with a NULL argument, it returns NULL.
</P> </P>
<P> <P>
The <b>pcre2_code_copy()</b> function provides a way for individual threads in a The <b>pcre2_code_copy()</b> function provides a way for individual threads in a
@ -1272,7 +1281,9 @@ there are occasions when a copy of a compiled pattern and the relevant tables
are needed. The <b>pcre2_code_copy_with_tables()</b> provides this facility. are needed. The <b>pcre2_code_copy_with_tables()</b> provides this facility.
Copies of both the code and the tables are made, with the new code pointing to Copies of both the code and the tables are made, with the new code pointing to
the new tables. The memory for the new tables is automatically freed when the new tables. The memory for the new tables is automatically freed when
<b>pcre2_code_free()</b> is called for the new copy of the compiled code. <b>pcre2_code_free()</b> is called for the new copy of the compiled code. If
<b>pcre2_code_copy_withy_tables()</b> is called with a NULL argument, it returns
NULL.
</P> </P>
<P> <P>
NOTE: When one of the matching functions is called, pointers to the compiled NOTE: When one of the matching functions is called, pointers to the compiled
@ -2363,7 +2374,8 @@ match data block (for that match) have taken place.
</P> </P>
<P> <P>
When a match data block itself is no longer needed, it should be freed by When a match data block itself is no longer needed, it should be freed by
calling <b>pcre2_match_data_free()</b>. calling <b>pcre2_match_data_free()</b>. If this function is called with a NULL
argument, it returns immediately, without doing anything.
</P> </P>
<br><a name="SEC27" href="#TOC1">MATCHING A PATTERN: THE TRADITIONAL FUNCTION</a><br> <br><a name="SEC27" href="#TOC1">MATCHING A PATTERN: THE TRADITIONAL FUNCTION</a><br>
<P> <P>
@ -3619,7 +3631,7 @@ Cambridge, England.
</P> </P>
<br><a name="SEC42" href="#TOC1">REVISION</a><br> <br><a name="SEC42" href="#TOC1">REVISION</a><br>
<P> <P>
Last updated: 22 June 2018 Last updated: 28 June 2018
<br> <br>
Copyright &copy; 1997-2018 University of Cambridge. Copyright &copy; 1997-2018 University of Cambridge.
<br> <br>

View File

@ -105,7 +105,8 @@ If <b>buffer</b> points to a NULL pointer, an output buffer is obtained using
the allocator in the context or <b>malloc()</b> if no context is supplied. A the allocator in the context or <b>malloc()</b> if no context is supplied. A
pointer to this buffer is placed in the variable to which <b>buffer</b> points. pointer to this buffer is placed in the variable to which <b>buffer</b> points.
When no longer needed the output buffer must be freed by calling When no longer needed the output buffer must be freed by calling
<b>pcre2_converted_pattern_free()</b>. <b>pcre2_converted_pattern_free()</b>. If this function is called with a NULL
argument, it returns immediately without doing anything.
</P> </P>
<P> <P>
If <b>buffer</b> points to a non-NULL pointer, <b>blength</b> must be set to the If <b>buffer</b> points to a non-NULL pointer, <b>blength</b> must be set to the
@ -181,9 +182,9 @@ Cambridge, England.
</P> </P>
<br><a name="SEC7" href="#TOC1">REVISION</a><br> <br><a name="SEC7" href="#TOC1">REVISION</a><br>
<P> <P>
Last updated: 12 July 2017 Last updated: 28 June 2018
<br> <br>
Copyright &copy; 1997-2017 University of Cambridge. Copyright &copy; 1997-2018 University of Cambridge.
<br> <br>
<p> <p>
Return to the <a href="index.html">PCRE2 index page</a>. Return to the <a href="index.html">PCRE2 index page</a>.

View File

@ -193,9 +193,10 @@ are a starting size, a maximum size, and a general context (for memory
allocation functions, or NULL for standard memory allocation). It returns a allocation functions, or NULL for standard memory allocation). It returns a
pointer to an opaque structure of type <b>pcre2_jit_stack</b>, or NULL if there pointer to an opaque structure of type <b>pcre2_jit_stack</b>, or NULL if there
is an error. The <b>pcre2_jit_stack_free()</b> function is used to free a stack is an error. The <b>pcre2_jit_stack_free()</b> function is used to free a stack
that is no longer needed. (For the technically minded: the address space is that is no longer needed. If its argument is NULL, this function returns
allocated by mmap or VirtualAlloc.) A maximum stack size of 512KiB to 1MiB immediately, without doing anything. (For the technically minded: the address
should be more than enough for any pattern. space is allocated by mmap or VirtualAlloc.) A maximum stack size of 512KiB to
1MiB should be more than enough for any pattern.
</P> </P>
<P> <P>
The <b>pcre2_jit_stack_assign()</b> function specifies which stack JIT code The <b>pcre2_jit_stack_assign()</b> function specifies which stack JIT code
@ -207,7 +208,8 @@ should use. Its arguments are as follows:
</pre> </pre>
The first argument is a pointer to a match context. When this is subsequently The first argument is a pointer to a match context. When this is subsequently
passed to a matching function, its information determines which JIT stack is passed to a matching function, its information determines which JIT stack is
used. There are three cases for the values of the other two options: used. If this argument is NULL, the function returns immediately, without doing
anything. There are three cases for the values of the other two options:
<pre> <pre>
(1) If <i>callback</i> is NULL and <i>data</i> is NULL, an internal 32KiB block (1) If <i>callback</i> is NULL and <i>data</i> is NULL, an internal 32KiB block
on the machine stack is used. This is the default when a match on the machine stack is used. This is the default when a match
@ -432,9 +434,9 @@ Cambridge, England.
</P> </P>
<br><a name="SEC13" href="#TOC1">REVISION</a><br> <br><a name="SEC13" href="#TOC1">REVISION</a><br>
<P> <P>
Last updated: 31 March 2017 Last updated: 28 June 2018
<br> <br>
Copyright &copy; 1997-2017 University of Cambridge. Copyright &copy; 1997-2018 University of Cambridge.
<br> <br>
<p> <p>
Return to the <a href="index.html">PCRE2 index page</a>. Return to the <a href="index.html">PCRE2 index page</a>.

View File

@ -129,7 +129,9 @@ non-binary data, be sure that the file is opened for binary output.
Serializing a set of patterns leaves the original data untouched, so they can Serializing a set of patterns leaves the original data untouched, so they can
still be used for matching. Their memory must eventually be freed in the usual still be used for matching. Their memory must eventually be freed in the usual
way by calling <b>pcre2_code_free()</b>. When you have finished with the byte way by calling <b>pcre2_code_free()</b>. When you have finished with the byte
stream, it too must be freed by calling <b>pcre2_serialize_free()</b>. stream, it too must be freed by calling <b>pcre2_serialize_free()</b>. If this
function is called with a NULL argument, it returns immediately without doing
anything.
</P> </P>
<br><a name="SEC4" href="#TOC1">RE-USING PRECOMPILED PATTERNS</a><br> <br><a name="SEC4" href="#TOC1">RE-USING PRECOMPILED PATTERNS</a><br>
<P> <P>

View File

@ -578,7 +578,9 @@ PCRE2 API OVERVIEW
pcre2_substring_number_from_name() pcre2_substring_number_from_name()
pcre2_substring_free() and pcre2_substring_list_free() are also pro- pcre2_substring_free() and pcre2_substring_list_free() are also pro-
vided, to free memory used for extracted strings. vided, to free memory used for extracted strings. If either of these
functions is called with a NULL argument, the function returns immedi-
ately without doing anything.
The function pcre2_substitute() can be called to match a pattern and The function pcre2_substitute() can be called to match a pattern and
return a copy of the subject string with substitutions for parts that return a copy of the subject string with substitutions for parts that
@ -772,6 +774,8 @@ PCRE2 CONTEXTS
void pcre2_general_context_free(pcre2_general_context *gcontext); void pcre2_general_context_free(pcre2_general_context *gcontext);
If this function is passed a NULL argument, it function returns immedi-
ately without doing anything.
The compile context The compile context
@ -1249,14 +1253,16 @@ COMPILING A PATTERN
piled pattern is obtained by calling malloc(). Otherwise, it is piled pattern is obtained by calling malloc(). Otherwise, it is
obtained from the same memory function that was used for the compile obtained from the same memory function that was used for the compile
context. The caller must free the memory by calling pcre2_code_free() context. The caller must free the memory by calling pcre2_code_free()
when it is no longer needed. when it is no longer needed. If pcre2_code_free() is called with a
NULL argument, it returns immediately, without doing anything.
The function pcre2_code_copy() makes a copy of the compiled code in new The function pcre2_code_copy() makes a copy of the compiled code in new
memory, using the same memory allocator as was used for the original. memory, using the same memory allocator as was used for the original.
However, if the code has been processed by the JIT compiler (see However, if the code has been processed by the JIT compiler (see
below), the JIT information cannot be copied (because it is position- below), the JIT information cannot be copied (because it is position-
dependent). The new copy can initially be used only for non-JIT match- dependent). The new copy can initially be used only for non-JIT match-
ing, though it can be passed to pcre2_jit_compile() if required. ing, though it can be passed to pcre2_jit_compile() if required. If
pcre2_code_copy() is called with a NULL argument, it returns NULL.
The pcre2_code_copy() function provides a way for individual threads in The pcre2_code_copy() function provides a way for individual threads in
a multithreaded application to acquire a private copy of shared com- a multithreaded application to acquire a private copy of shared com-
@ -1270,7 +1276,8 @@ COMPILING A PATTERN
Copies of both the code and the tables are made, with the new code Copies of both the code and the tables are made, with the new code
pointing to the new tables. The memory for the new tables is automati- pointing to the new tables. The memory for the new tables is automati-
cally freed when pcre2_code_free() is called for the new copy of the cally freed when pcre2_code_free() is called for the new copy of the
compiled code. compiled code. If pcre2_code_copy_withy_tables() is called with a NULL
argument, it returns NULL.
NOTE: When one of the matching functions is called, pointers to the NOTE: When one of the matching functions is called, pointers to the
compiled pattern and the subject string are set in the match data block compiled pattern and the subject string are set in the match data block
@ -2332,7 +2339,8 @@ THE MATCH DATA BLOCK
taken place. taken place.
When a match data block itself is no longer needed, it should be freed When a match data block itself is no longer needed, it should be freed
by calling pcre2_match_data_free(). by calling pcre2_match_data_free(). If this function is called with a
NULL argument, it returns immediately, without doing anything.
MATCHING A PATTERN: THE TRADITIONAL FUNCTION MATCHING A PATTERN: THE TRADITIONAL FUNCTION
@ -3501,7 +3509,7 @@ AUTHOR
REVISION REVISION
Last updated: 22 June 2018 Last updated: 28 June 2018
Copyright (c) 1997-2018 University of Cambridge. Copyright (c) 1997-2018 University of Cambridge.
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
@ -4848,10 +4856,11 @@ CONTROLLING THE JIT STACK
memory allocation functions, or NULL for standard memory allocation). memory allocation functions, or NULL for standard memory allocation).
It returns a pointer to an opaque structure of type pcre2_jit_stack, or It returns a pointer to an opaque structure of type pcre2_jit_stack, or
NULL if there is an error. The pcre2_jit_stack_free() function is used NULL if there is an error. The pcre2_jit_stack_free() function is used
to free a stack that is no longer needed. (For the technically minded: to free a stack that is no longer needed. If its argument is NULL, this
the address space is allocated by mmap or VirtualAlloc.) A maximum function returns immediately, without doing anything. (For the techni-
stack size of 512KiB to 1MiB should be more than enough for any pat- cally minded: the address space is allocated by mmap or VirtualAlloc.)
tern. A maximum stack size of 512KiB to 1MiB should be more than enough for
any pattern.
The pcre2_jit_stack_assign() function specifies which stack JIT code The pcre2_jit_stack_assign() function specifies which stack JIT code
should use. Its arguments are as follows: should use. Its arguments are as follows:
@ -4862,8 +4871,9 @@ CONTROLLING THE JIT STACK
The first argument is a pointer to a match context. When this is subse- The first argument is a pointer to a match context. When this is subse-
quently passed to a matching function, its information determines which quently passed to a matching function, its information determines which
JIT stack is used. There are three cases for the values of the other JIT stack is used. If this argument is NULL, the function returns imme-
two options: diately, without doing anything. There are three cases for the values
of the other two options:
(1) If callback is NULL and data is NULL, an internal 32KiB block (1) If callback is NULL and data is NULL, an internal 32KiB block
on the machine stack is used. This is the default when a match on the machine stack is used. This is the default when a match
@ -5075,8 +5085,8 @@ AUTHOR
REVISION REVISION
Last updated: 31 March 2017 Last updated: 28 June 2018
Copyright (c) 1997-2017 University of Cambridge. Copyright (c) 1997-2018 University of Cambridge.
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
@ -9659,7 +9669,8 @@ SAVING COMPILED PATTERNS
they can still be used for matching. Their memory must eventually be they can still be used for matching. Their memory must eventually be
freed in the usual way by calling pcre2_code_free(). When you have fin- freed in the usual way by calling pcre2_code_free(). When you have fin-
ished with the byte stream, it too must be freed by calling pcre2_seri- ished with the byte stream, it too must be freed by calling pcre2_seri-
alize_free(). alize_free(). If this function is called with a NULL argument, it
returns immediately without doing anything.
RE-USING PRECOMPILED PATTERNS RE-USING PRECOMPILED PATTERNS

View File

@ -1,4 +1,4 @@
.TH PCRE2_CODE_FREE 3 "23 March 2017" "PCRE2 10.30" .TH PCRE2_CODE_FREE 3 "28 June 2018" "PCRE2 10.32"
.SH NAME .SH NAME
PCRE2 - Perl-compatible regular expressions (revised API) PCRE2 - Perl-compatible regular expressions (revised API)
.SH SYNOPSIS .SH SYNOPSIS
@ -13,7 +13,8 @@ PCRE2 - Perl-compatible regular expressions (revised API)
.SH DESCRIPTION .SH DESCRIPTION
.rs .rs
.sp .sp
This function frees the memory used for a compiled pattern, including any If \fIcode\fP is NULL, this function does nothing. Otherwise, \fIcode\fP must
point to a compiled pattern. This function frees its memory, including any
memory used by the JIT compiler. If the compiled pattern was created by a call memory used by the JIT compiler. If the compiled pattern was created by a call
to \fBpcre2_code_copy_with_tables()\fP, the memory for the character tables is to \fBpcre2_code_copy_with_tables()\fP, the memory for the character tables is
also freed. also freed.

View File

@ -1,4 +1,4 @@
.TH PCRE2_COMPILE_CONTEXT_FREE 3 "22 October 2014" "PCRE2 10.00" .TH PCRE2_COMPILE_CONTEXT_FREE 3 "29 June 2018" "PCRE2 10.32"
.SH NAME .SH NAME
PCRE2 - Perl-compatible regular expressions (revised API) PCRE2 - Perl-compatible regular expressions (revised API)
.SH SYNOPSIS .SH SYNOPSIS
@ -15,7 +15,8 @@ PCRE2 - Perl-compatible regular expressions (revised API)
.sp .sp
This function frees the memory occupied by a compile context, using the memory This function frees the memory occupied by a compile context, using the memory
freeing function from the general context with which it was created, or freeing function from the general context with which it was created, or
\fBfree()\fP if that was not set. \fBfree()\fP if that was not set. If the argument is NULL, the function returns
immediately without doing anything.
.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
.\" HREF .\" HREF

View File

@ -1,4 +1,4 @@
.TH PCRE2_CONVERT_CONTEXT_FREE 3 "10 July 2017" "PCRE2 10.30" .TH PCRE2_CONVERT_CONTEXT_FREE 3 "28 June 2018" "PCRE2 10.32"
.SH NAME .SH NAME
PCRE2 - Perl-compatible regular expressions (revised API) PCRE2 - Perl-compatible regular expressions (revised API)
.SH SYNOPSIS .SH SYNOPSIS
@ -16,7 +16,8 @@ PCRE2 - Perl-compatible regular expressions (revised API)
This function is part of an experimental set of pattern conversion functions. This function is part of an experimental set of pattern conversion functions.
It frees the memory occupied by a convert context, using the memory It frees the memory occupied by a convert context, using the memory
freeing function from the general context with which it was created, or freeing function from the general context with which it was created, or
\fBfree()\fP if that was not set. \fBfree()\fP if that was not set. If the argument is NULL, the function returns
immediately without doing anything.
.P .P
The pattern conversion functions are described in the The pattern conversion functions are described in the
.\" HREF .\" HREF

View File

@ -1,4 +1,4 @@
.TH PCRE2_CONVERTED_PATTERN_FREE 3 "11 July 2017" "PCRE2 10.30" .TH PCRE2_CONVERTED_PATTERN_FREE 3 "28 June 2018" "PCRE2 10.32"
.SH NAME .SH NAME
PCRE2 - Perl-compatible regular expressions (revised API) PCRE2 - Perl-compatible regular expressions (revised API)
.SH SYNOPSIS .SH SYNOPSIS
@ -16,7 +16,8 @@ PCRE2 - Perl-compatible regular expressions (revised API)
This function is part of an experimental set of pattern conversion functions. This function is part of an experimental set of pattern conversion functions.
It frees the memory occupied by a converted pattern that was obtained by It frees the memory occupied by a converted pattern that was obtained by
calling \fBpcre2_pattern_convert()\fP with arguments that caused it to place calling \fBpcre2_pattern_convert()\fP with arguments that caused it to place
the converted pattern into newly obtained heap memory. the converted pattern into newly obtained heap memory. If the argument is NULL,
the function returns immediately without doing anything.
.P .P
The pattern conversion functions are described in the The pattern conversion functions are described in the
.\" HREF .\" HREF

View File

@ -1,4 +1,4 @@
.TH PCRE2_GENERAL_CONTEXT_FREE 3 "22 October 2014" "PCRE2 10.00" .TH PCRE2_GENERAL_CONTEXT_FREE 3 "28 June 2018" "PCRE2 10.32"
.SH NAME .SH NAME
PCRE2 - Perl-compatible regular expressions (revised API) PCRE2 - Perl-compatible regular expressions (revised API)
.SH SYNOPSIS .SH SYNOPSIS
@ -14,7 +14,8 @@ PCRE2 - Perl-compatible regular expressions (revised API)
.rs .rs
.sp .sp
This function frees the memory occupied by a general context, using the memory This function frees the memory occupied by a general context, using the memory
freeing function within the context, if set. freeing function within the context, if set. If the argument is NULL, the
function returns immediately without doing anything.
.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
.\" HREF .\" HREF

View File

@ -1,4 +1,4 @@
.TH PCRE2_JIT_STACK_ASSIGN 3 "08 November 2014" "PCRE2 10.0" .TH PCRE2_JIT_STACK_ASSIGN 3 "28 June 2018" "PCRE2 10.32"
.SH NAME .SH NAME
PCRE2 - Perl-compatible regular expressions (revised API) PCRE2 - Perl-compatible regular expressions (revised API)
.SH SYNOPSIS .SH SYNOPSIS
@ -24,6 +24,9 @@ passed to a matching function. The arguments of this function are:
callback a callback function callback a callback function
callback_data a JIT stack or a value to be passed to the callback callback_data a JIT stack or a value to be passed to the callback
.P .P
If \fImcontext\fP is NULL, the function returns immediately, without doing
anything.
.P
If \fIcallback\fP is NULL and \fIcallback_data\fP is NULL, an internal 32KiB If \fIcallback\fP is NULL and \fIcallback_data\fP is NULL, an internal 32KiB
block on the machine stack is used. block on the machine stack is used.
.P .P

View File

@ -1,4 +1,4 @@
.TH PCRE2_JIT_STACK_FREE 3 "21 October 2014" "PCRE2 10.00" .TH PCRE2_JIT_STACK_FREE 3 "28 June 2018" "PCRE2 10.32"
.SH NAME .SH NAME
PCRE2 - Perl-compatible regular expressions (revised API) PCRE2 - Perl-compatible regular expressions (revised API)
.SH SYNOPSIS .SH SYNOPSIS
@ -13,8 +13,9 @@ PCRE2 - Perl-compatible regular expressions (revised API)
.rs .rs
.sp .sp
This function is used to free a JIT stack that was created by This function is used to free a JIT stack that was created by
\fBpcre2_jit_stack_create()\fP when it is no longer needed. For more details, \fBpcre2_jit_stack_create()\fP when it is no longer needed. If the argument is
see the NULL, the function returns immediately without doing anything. For more
details, see the
.\" HREF .\" HREF
\fBpcre2jit\fP \fBpcre2jit\fP
.\" .\"

View File

@ -1,4 +1,4 @@
.TH PCRE2_MATCH_CONTEXT_FREE 3 "22 October 2014" "PCRE2 10.00" .TH PCRE2_MATCH_CONTEXT_FREE 3 "28 June 2018" "PCRE2 10.32"
.SH NAME .SH NAME
PCRE2 - Perl-compatible regular expressions (revised API) PCRE2 - Perl-compatible regular expressions (revised API)
.SH SYNOPSIS .SH SYNOPSIS
@ -15,7 +15,8 @@ PCRE2 - Perl-compatible regular expressions (revised API)
.sp .sp
This function frees the memory occupied by a match context, using the memory This function frees the memory occupied by a match context, using the memory
freeing function from the general context with which it was created, or freeing function from the general context with which it was created, or
\fBfree()\fP if that was not set. \fBfree()\fP if that was not set. If the argument is NULL, the function returns
immediately without doing anything.
.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
.\" HREF .\" HREF

View File

@ -1,4 +1,4 @@
.TH PCRE2_MATCH_DATA_FREE 3 "25 March 2017" "PCRE2 10.30" .TH PCRE2_MATCH_DATA_FREE 3 "28 June 2018" "PCRE2 10.32"
.SH NAME .SH NAME
PCRE2 - Perl-compatible regular expressions (revised API) PCRE2 - Perl-compatible regular expressions (revised API)
.SH SYNOPSIS .SH SYNOPSIS
@ -13,9 +13,10 @@ PCRE2 - Perl-compatible regular expressions (revised API)
.SH DESCRIPTION .SH DESCRIPTION
.rs .rs
.sp .sp
This function frees the memory occupied by a match data block, using the memory If \fImatch_data\fP is NULL, this function does nothing. Otherwise,
freeing function from the general context or compiled pattern with which it was \fImatch_data\fP must point to a match data block, which this function frees,
created, or \fBfree()\fP if that was not set. using the memory freeing function from the general context or compiled pattern
with which it was created, or \fBfree()\fP if that was not set.
.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
.\" HREF .\" HREF

View File

@ -15,7 +15,8 @@ PCRE2 - Perl-compatible regular expressions (revised API)
.sp .sp
This function frees the memory that was obtained by This function frees the memory that was obtained by
\fBpcre2_serialize_encode()\fP to hold a serialized byte stream. The argument \fBpcre2_serialize_encode()\fP to hold a serialized byte stream. The argument
must point to such a byte stream. must point to such a byte stream or be NULL, in which case the function returns
without doing anything.
.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
.\" HREF .\" HREF

View File

@ -1,4 +1,4 @@
.TH PCRE2_SUBSTRING_FREE 3 "21 October 2014" "PCRE2 10.00" .TH PCRE2_SUBSTRING_FREE 3 "28 June 2018" "PCRE2 10.32"
.SH NAME .SH NAME
PCRE2 - Perl-compatible regular expressions (revised API) PCRE2 - Perl-compatible regular expressions (revised API)
.SH SYNOPSIS .SH SYNOPSIS
@ -15,7 +15,7 @@ PCRE2 - Perl-compatible regular expressions (revised API)
This is a convenience function for freeing the memory obtained by a previous This is a convenience function for freeing the memory obtained by a previous
call to \fBpcre2_substring_get_byname()\fP or call to \fBpcre2_substring_get_byname()\fP or
\fBpcre2_substring_get_bynumber()\fP. Its only argument is a pointer to the \fBpcre2_substring_get_bynumber()\fP. Its only argument is a pointer to the
string. string. If the argument is NULL, the function does nothing.
.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
.\" HREF .\" HREF

View File

@ -1,4 +1,4 @@
.TH PCRE2_SUBSTRING_LIST_FREE 3 "21 October 2014" "PCRE2 10.00" .TH PCRE2_SUBSTRING_LIST_FREE 3 "28 June 2018" "PCRE2 10.32"
.SH NAME .SH NAME
PCRE2 - Perl-compatible regular expressions (revised API) PCRE2 - Perl-compatible regular expressions (revised API)
.SH SYNOPSIS .SH SYNOPSIS
@ -14,7 +14,8 @@ PCRE2 - Perl-compatible regular expressions (revised API)
.sp .sp
This is a convenience function for freeing the store obtained by a previous This is a convenience function for freeing the store obtained by a previous
call to \fBpcre2substring_list_get()\fP. Its only argument is a pointer to call to \fBpcre2substring_list_get()\fP. Its only argument is a pointer to
the list of string pointers. the list of string pointers. If the argument is NULL, the function returns
immediately, without doing anything.
.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
.\" HREF .\" HREF

View File

@ -1,4 +1,4 @@
.TH PCRE2API 3 "22 June 2018" "PCRE2 10.32" .TH PCRE2API 3 "28 June 2018" "PCRE2 10.32"
.SH NAME .SH NAME
PCRE2 - Perl-compatible regular expressions (revised API) PCRE2 - Perl-compatible regular expressions (revised API)
.sp .sp
@ -453,7 +453,9 @@ been matched by \fBpcre2_match()\fP. They are:
\fBpcre2_substring_number_from_name()\fP \fBpcre2_substring_number_from_name()\fP
.sp .sp
\fBpcre2_substring_free()\fP and \fBpcre2_substring_list_free()\fP are also \fBpcre2_substring_free()\fP and \fBpcre2_substring_list_free()\fP are also
provided, to free memory used for extracted strings. provided, to free memory used for extracted strings. If either of these
functions is called with a NULL argument, the function returns immediately
without doing anything.
.P .P
The function \fBpcre2_substitute()\fP can be called to match a pattern and The function \fBpcre2_substitute()\fP can be called to match a pattern and
return a copy of the subject string with substitutions for parts that were return a copy of the subject string with substitutions for parts that were
@ -666,6 +668,8 @@ The memory used for a general context should be freed by calling:
.B void pcre2_general_context_free(pcre2_general_context *\fIgcontext\fP); .B void pcre2_general_context_free(pcre2_general_context *\fIgcontext\fP);
.fi .fi
.sp .sp
If this function is passed a NULL argument, it function returns immediately
without doing anything.
. .
. .
.\" HTML <a name="compilecontext"></a> .\" HTML <a name="compilecontext"></a>
@ -1178,6 +1182,8 @@ If the compile context argument \fIccontext\fP is NULL, memory for the compiled
pattern is obtained by calling \fBmalloc()\fP. Otherwise, it is obtained from pattern is obtained by calling \fBmalloc()\fP. Otherwise, it is obtained from
the same memory function that was used for the compile context. The caller must the same memory function that was used for the compile context. The caller must
free the memory by calling \fBpcre2_code_free()\fP when it is no longer needed. free the memory by calling \fBpcre2_code_free()\fP when it is no longer needed.
If \fBpcre2_code_free()\fP is called with a NULL argument, it returns
immediately, without doing anything.
.P .P
The function \fBpcre2_code_copy()\fP makes a copy of the compiled code in new The function \fBpcre2_code_copy()\fP makes a copy of the compiled code in new
memory, using the same memory allocator as was used for the original. However, memory, using the same memory allocator as was used for the original. However,
@ -1188,7 +1194,8 @@ below),
.\" .\"
the JIT information cannot be copied (because it is position-dependent). the JIT information cannot be copied (because it is position-dependent).
The new copy can initially be used only for non-JIT matching, though it can be The new copy can initially be used only for non-JIT matching, though it can be
passed to \fBpcre2_jit_compile()\fP if required. passed to \fBpcre2_jit_compile()\fP if required. If \fBpcre2_code_copy()\fP is
called with a NULL argument, it returns NULL.
.P .P
The \fBpcre2_code_copy()\fP function provides a way for individual threads in a The \fBpcre2_code_copy()\fP function provides a way for individual threads in a
multithreaded application to acquire a private copy of shared compiled code. multithreaded application to acquire a private copy of shared compiled code.
@ -1205,7 +1212,9 @@ there are occasions when a copy of a compiled pattern and the relevant tables
are needed. The \fBpcre2_code_copy_with_tables()\fP provides this facility. are needed. The \fBpcre2_code_copy_with_tables()\fP provides this facility.
Copies of both the code and the tables are made, with the new code pointing to Copies of both the code and the tables are made, with the new code pointing to
the new tables. The memory for the new tables is automatically freed when the new tables. The memory for the new tables is automatically freed when
\fBpcre2_code_free()\fP is called for the new copy of the compiled code. \fBpcre2_code_free()\fP is called for the new copy of the compiled code. If
\fBpcre2_code_copy_withy_tables()\fP is called with a NULL argument, it returns
NULL.
.P .P
NOTE: When one of the matching functions is called, pointers to the compiled NOTE: When one of the matching functions is called, pointers to the compiled
pattern and the subject string are set in the match data block so that they can pattern and the subject string are set in the match data block so that they can
@ -2333,7 +2342,8 @@ free a compiled pattern or a subject string until after all operations on the
match data block (for that match) have taken place. match data block (for that match) have taken place.
.P .P
When a match data block itself is no longer needed, it should be freed by When a match data block itself is no longer needed, it should be freed by
calling \fBpcre2_match_data_free()\fP. calling \fBpcre2_match_data_free()\fP. If this function is called with a NULL
argument, it returns immediately, without doing anything.
. .
. .
.SH "MATCHING A PATTERN: THE TRADITIONAL FUNCTION" .SH "MATCHING A PATTERN: THE TRADITIONAL FUNCTION"
@ -3627,6 +3637,6 @@ Cambridge, England.
.rs .rs
.sp .sp
.nf .nf
Last updated: 22 June 2018 Last updated: 28 June 2018
Copyright (c) 1997-2018 University of Cambridge. Copyright (c) 1997-2018 University of Cambridge.
.fi .fi

View File

@ -1,4 +1,4 @@
.TH PCRE2CONVERT 3 "12 July 2017" "PCRE2 10.30" .TH PCRE2CONVERT 3 "28 June 2018" "PCRE2 10.32"
.SH NAME .SH NAME
PCRE2 - Perl-compatible regular expressions (revised API) PCRE2 - Perl-compatible regular expressions (revised API)
.SH "EXPERIMENTAL PATTERN CONVERSION FUNCTIONS" .SH "EXPERIMENTAL PATTERN CONVERSION FUNCTIONS"
@ -83,7 +83,8 @@ If \fBbuffer\fP points to a NULL pointer, an output buffer is obtained using
the allocator in the context or \fBmalloc()\fP if no context is supplied. A the allocator in the context or \fBmalloc()\fP if no context is supplied. A
pointer to this buffer is placed in the variable to which \fBbuffer\fP points. pointer to this buffer is placed in the variable to which \fBbuffer\fP points.
When no longer needed the output buffer must be freed by calling When no longer needed the output buffer must be freed by calling
\fBpcre2_converted_pattern_free()\fP. \fBpcre2_converted_pattern_free()\fP. If this function is called with a NULL
argument, it returns immediately without doing anything.
.P .P
If \fBbuffer\fP points to a non-NULL pointer, \fBblength\fP must be set to the If \fBbuffer\fP points to a non-NULL pointer, \fBblength\fP must be set to the
actual length of the buffer provided (in code units). actual length of the buffer provided (in code units).
@ -158,6 +159,6 @@ Cambridge, England.
.rs .rs
.sp .sp
.nf .nf
Last updated: 12 July 2017 Last updated: 28 June 2018
Copyright (c) 1997-2017 University of Cambridge. Copyright (c) 1997-2018 University of Cambridge.
.fi .fi

View File

@ -1,4 +1,4 @@
.TH PCRE2JIT 3 "31 March 2017" "PCRE2 10.30" .TH PCRE2JIT 3 "28 June 2018" "PCRE2 10.32"
.SH NAME .SH NAME
PCRE2 - Perl-compatible regular expressions (revised API) PCRE2 - Perl-compatible regular expressions (revised API)
.SH "PCRE2 JUST-IN-TIME COMPILER SUPPORT" .SH "PCRE2 JUST-IN-TIME COMPILER SUPPORT"
@ -177,9 +177,10 @@ are a starting size, a maximum size, and a general context (for memory
allocation functions, or NULL for standard memory allocation). It returns a allocation functions, or NULL for standard memory allocation). It returns a
pointer to an opaque structure of type \fBpcre2_jit_stack\fP, or NULL if there pointer to an opaque structure of type \fBpcre2_jit_stack\fP, or NULL if there
is an error. The \fBpcre2_jit_stack_free()\fP function is used to free a stack is an error. The \fBpcre2_jit_stack_free()\fP function is used to free a stack
that is no longer needed. (For the technically minded: the address space is that is no longer needed. If its argument is NULL, this function returns
allocated by mmap or VirtualAlloc.) A maximum stack size of 512KiB to 1MiB immediately, without doing anything. (For the technically minded: the address
should be more than enough for any pattern. space is allocated by mmap or VirtualAlloc.) A maximum stack size of 512KiB to
1MiB should be more than enough for any pattern.
.P .P
The \fBpcre2_jit_stack_assign()\fP function specifies which stack JIT code The \fBpcre2_jit_stack_assign()\fP function specifies which stack JIT code
should use. Its arguments are as follows: should use. Its arguments are as follows:
@ -190,7 +191,8 @@ should use. Its arguments are as follows:
.sp .sp
The first argument is a pointer to a match context. When this is subsequently The first argument is a pointer to a match context. When this is subsequently
passed to a matching function, its information determines which JIT stack is passed to a matching function, its information determines which JIT stack is
used. There are three cases for the values of the other two options: used. If this argument is NULL, the function returns immediately, without doing
anything. There are three cases for the values of the other two options:
.sp .sp
(1) If \fIcallback\fP is NULL and \fIdata\fP is NULL, an internal 32KiB block (1) If \fIcallback\fP is NULL and \fIdata\fP is NULL, an internal 32KiB block
on the machine stack is used. This is the default when a match on the machine stack is used. This is the default when a match
@ -410,6 +412,6 @@ Cambridge, England.
.rs .rs
.sp .sp
.nf .nf
Last updated: 31 March 2017 Last updated: 28 June 2018
Copyright (c) 1997-2017 University of Cambridge. Copyright (c) 1997-2018 University of Cambridge.
.fi .fi

View File

@ -114,7 +114,9 @@ non-binary data, be sure that the file is opened for binary output.
Serializing a set of patterns leaves the original data untouched, so they can Serializing a set of patterns leaves the original data untouched, so they can
still be used for matching. Their memory must eventually be freed in the usual still be used for matching. Their memory must eventually be freed in the usual
way by calling \fBpcre2_code_free()\fP. When you have finished with the byte way by calling \fBpcre2_code_free()\fP. When you have finished with the byte
stream, it too must be freed by calling \fBpcre2_serialize_free()\fP. stream, it too must be freed by calling \fBpcre2_serialize_free()\fP. If this
function is called with a NULL argument, it returns immediately without doing
anything.
. .
. .
.SH "RE-USING PRECOMPILED PATTERNS" .SH "RE-USING PRECOMPILED PATTERNS"