(1) uint32_t for substring number args; (2) correct PRIV(memctl_malloc)

definition for Windows; (3) remove unwanted PCRE2_EXP_DATA_DEFN; (4) 
documentation updates.
This commit is contained in:
Philip.Hazel 2014-12-01 16:14:53 +00:00
parent bb3b7927f3
commit a119d6f974
16 changed files with 93 additions and 98 deletions

View File

@ -10,7 +10,7 @@ dnl be defined as -RC2, for example. For real releases, it should be empty.
m4_define(pcre2_major, [10]) m4_define(pcre2_major, [10])
m4_define(pcre2_minor, [00]) m4_define(pcre2_minor, [00])
m4_define(pcre2_prerelease, [-RC1]) m4_define(pcre2_prerelease, [-RC2])
m4_define(pcre2_date, [2014-11-28]) m4_define(pcre2_date, [2014-11-28])
# NOTE: The CMakeLists.txt file searches for the above variables in the first # NOTE: The CMakeLists.txt file searches for the above variables in the first

View File

@ -27,19 +27,19 @@ DESCRIPTION
<P> <P>
This function returns information about a compiled pattern. Its arguments are: This function returns information about a compiled pattern. Its arguments are:
<pre> <pre>
<i>code</i> Compiled regular expression <i>code</i> Pointer to a compiled regular expression
<i>what</i> What information is required <i>what</i> What information is required
<i>where</i> Where to put the information <i>where</i> Where to put the information
</pre> </pre>
If <i>where</i> is NULL, the function returns the amount of memory needed for The recognized values for the <i>what</i> argument, and the information they
the requested information, in bytes. The following information is available: request are as follows:
<pre> <pre>
PCRE2_INFO_ALLOPTIONS Final options after compiling PCRE2_INFO_ALLOPTIONS Final options after compiling
PCRE2_INFO_ARGOPTIONS Options passed to <b>pcre2_compile()</b> PCRE2_INFO_ARGOPTIONS Options passed to <b>pcre2_compile()</b>
PCRE2_INFO_BACKREFMAX Number of highest back reference PCRE2_INFO_BACKREFMAX Number of highest back reference
PCRE2_INFO_BSR What \R matches PCRE2_INFO_BSR What \R matches:
0 all Unicode line endings PCRE2_BSR_UNICODE: Unicode line endings
1 CR, LF, or CRLF only PCRE2_BSR_ANYCRLF: CR, LF, or CRLF only
PCRE2_INFO_CAPTURECOUNT Number of capturing subpatterns PCRE2_INFO_CAPTURECOUNT Number of capturing subpatterns
PCRE2_INFO_FIRSTBITMAP Bitmap of first code units, or NULL PCRE2_INFO_FIRSTBITMAP Bitmap of first code units, or NULL
PCRE2_INFO_FIRSTCODEUNIT First code unit when type is 1 PCRE2_INFO_FIRSTCODEUNIT First code unit when type is 1
@ -58,7 +58,7 @@ the requested information, in bytes. The following information is available:
PCRE2_INFO_MATCHEMPTY 1 if the pattern can match an PCRE2_INFO_MATCHEMPTY 1 if the pattern can match an
empty string, 0 otherwise empty string, 0 otherwise
PCRE2_INFO_MATCHLIMIT Match limit if set, PCRE2_INFO_MATCHLIMIT Match limit if set,
otherwise PCRE2_RROR_UNSET otherwise PCRE2_ERROR_UNSET
PCRE2_INFO_MAXLOOKBEHIND Length (in characters) of the longest PCRE2_INFO_MAXLOOKBEHIND Length (in characters) of the longest
lookbehind assertion lookbehind assertion
PCRE2_INFO_MINLENGTH Lower bound length of matching strings PCRE2_INFO_MINLENGTH Lower bound length of matching strings
@ -66,17 +66,20 @@ the requested information, in bytes. The following information is available:
PCRE2_INFO_NAMECOUNT Number of named subpatterns PCRE2_INFO_NAMECOUNT Number of named subpatterns
PCRE2_INFO_NAMETABLE Pointer to name table PCRE2_INFO_NAMETABLE Pointer to name table
PCRE2_CONFIG_NEWLINE Code for the newline sequence: PCRE2_CONFIG_NEWLINE Code for the newline sequence:
1 for CR PCRE2_NEWLINE_CR
2 for LF PCRE2_NEWLINE_LF
3 for CRLF PCRE2_NEWLINE_CRLF
4 for ANY PCRE2_NEWLINE_ANY
5 for ANYCRLF PCRE2_NEWLINE_ANYCRLF
PCRE2_INFO_RECURSIONLIMIT Recursion limit if set, PCRE2_INFO_RECURSIONLIMIT Recursion limit if set,
otherwise PCRE2_ERROR_UNSET otherwise PCRE2_ERROR_UNSET
PCRE2_INFO_SIZE Size of compiled pattern PCRE2_INFO_SIZE Size of compiled pattern
</pre> </pre>
The <i>where</i> argument must point to an unsigned 32-bit integer (uint32_t If <i>where</i> is NULL, the function returns the amount of memory needed for
variable), except for the following <i>what</i> values: the requested information, in bytes. Otherwise, the <i>where</i> argument must
point to an unsigned 32-bit integer (uint32_t variable), except for the
following <i>what</i> values, when it must point to a variable of the type
shown:
<pre> <pre>
PCRE2_INFO_FIRSTBITMAP const uint8_t * PCRE2_INFO_FIRSTBITMAP const uint8_t *
PCRE2_INFO_JITSIZE size_t PCRE2_INFO_JITSIZE size_t

View File

@ -20,7 +20,7 @@ SYNOPSIS
</P> </P>
<P> <P>
<b>int pcre2_substring_copy_bynumber(pcre2_match_data *<i>match_data</i>,</b> <b>int pcre2_substring_copy_bynumber(pcre2_match_data *<i>match_data</i>,</b>
<b> unsigned int <i>number</i>, PCRE2_UCHAR *<i>buffer</i>,</b> <b> uint32_t <i>number</i>, PCRE2_UCHAR *<i>buffer</i>,</b>
<b> PCRE2_SIZE *<i>bufflen</i>);</b> <b> PCRE2_SIZE *<i>bufflen</i>);</b>
</P> </P>
<br><b> <br><b>

View File

@ -20,14 +20,14 @@ SYNOPSIS
</P> </P>
<P> <P>
<b>int pcre2_substring_get_bynumber(pcre2_match_data *<i>match_data</i>,</b> <b>int pcre2_substring_get_bynumber(pcre2_match_data *<i>match_data</i>,</b>
<b> unsigned int <i>number</i>, PCRE2_UCHAR **<i>bufferptr</i>, PCRE2_SIZE *<i>bufflen</i>);</b> <b> uint32_t <i>number</i>, PCRE2_UCHAR **<i>bufferptr</i>, PCRE2_SIZE *<i>bufflen</i>);</b>
</P> </P>
<br><b> <br><b>
DESCRIPTION DESCRIPTION
</b><br> </b><br>
<P> <P>
This is a convenience function for extracting a captured substring by number into This is a convenience function for extracting a captured substring by number
newly acquired memory. The arguments are: into newly acquired memory. The arguments are:
<pre> <pre>
<i>match_data</i> The match data for the match <i>match_data</i> The match data for the match
<i>number</i> Number of the required substring <i>number</i> Number of the required substring

View File

@ -20,7 +20,7 @@ SYNOPSIS
</P> </P>
<P> <P>
<b>int pcre2_substring_length_bynumber(pcre2_match_data *<i>match_data</i>,</b> <b>int pcre2_substring_length_bynumber(pcre2_match_data *<i>match_data</i>,</b>
<b> unsigned int <i>number</i>, PCRE2_SIZE *<i>length</i>);</b> <b> uint32_t <i>number</i>, PCRE2_SIZE *<i>length</i>);</b>
</P> </P>
<br><b> <br><b>
DESCRIPTION DESCRIPTION

View File

@ -189,7 +189,7 @@ document for an overview of all the PCRE2 documentation.
<br> <br>
<br> <br>
<b>int pcre2_substring_copy_bynumber(pcre2_match_data *<i>match_data</i>,</b> <b>int pcre2_substring_copy_bynumber(pcre2_match_data *<i>match_data</i>,</b>
<b> unsigned int <i>number</i>, PCRE2_UCHAR *<i>buffer</i>,</b> <b> uint32_t <i>number</i>, PCRE2_UCHAR *<i>buffer</i>,</b>
<b> PCRE2_SIZE *<i>bufflen</i>);</b> <b> PCRE2_SIZE *<i>bufflen</i>);</b>
<br> <br>
<br> <br>
@ -201,7 +201,7 @@ document for an overview of all the PCRE2 documentation.
<br> <br>
<br> <br>
<b>int pcre2_substring_get_bynumber(pcre2_match_data *<i>match_data</i>,</b> <b>int pcre2_substring_get_bynumber(pcre2_match_data *<i>match_data</i>,</b>
<b> unsigned int <i>number</i>, PCRE2_UCHAR **<i>bufferptr</i>,</b> <b> uint32_t <i>number</i>, PCRE2_UCHAR **<i>bufferptr</i>,</b>
<b> PCRE2_SIZE *<i>bufflen</i>);</b> <b> PCRE2_SIZE *<i>bufflen</i>);</b>
<br> <br>
<br> <br>
@ -210,7 +210,7 @@ document for an overview of all the PCRE2 documentation.
<br> <br>
<br> <br>
<b>int pcre2_substring_length_bynumber(pcre2_match_data *<i>match_data</i>,</b> <b>int pcre2_substring_length_bynumber(pcre2_match_data *<i>match_data</i>,</b>
<b> unsigned int <i>number</i>, PCRE2_SIZE *<i>length</i>);</b> <b> uint32_t <i>number</i>, PCRE2_SIZE *<i>length</i>);</b>
<br> <br>
<br> <br>
<b>int pcre2_substring_nametable_scan(const pcre2_code *<i>code</i>,</b> <b>int pcre2_substring_nametable_scan(const pcre2_code *<i>code</i>,</b>
@ -2214,16 +2214,16 @@ The internal recursion limit was reached.
<br><a name="SEC28" href="#TOC1">EXTRACTING CAPTURED SUBSTRINGS BY NUMBER</a><br> <br><a name="SEC28" href="#TOC1">EXTRACTING CAPTURED SUBSTRINGS BY NUMBER</a><br>
<P> <P>
<b>int pcre2_substring_length_bynumber(pcre2_match_data *<i>match_data</i>,</b> <b>int pcre2_substring_length_bynumber(pcre2_match_data *<i>match_data</i>,</b>
<b> unsigned int <i>number</i>, PCRE2_SIZE *<i>length</i>);</b> <b> uint32_t <i>number</i>, PCRE2_SIZE *<i>length</i>);</b>
<br> <br>
<br> <br>
<b>int pcre2_substring_copy_bynumber(pcre2_match_data *<i>match_data</i>,</b> <b>int pcre2_substring_copy_bynumber(pcre2_match_data *<i>match_data</i>,</b>
<b> unsigned int <i>number</i>, PCRE2_UCHAR *<i>buffer</i>,</b> <b> uint32_t <i>number</i>, PCRE2_UCHAR *<i>buffer</i>,</b>
<b> PCRE2_SIZE *<i>bufflen</i>);</b> <b> PCRE2_SIZE *<i>bufflen</i>);</b>
<br> <br>
<br> <br>
<b>int pcre2_substring_get_bynumber(pcre2_match_data *<i>match_data</i>,</b> <b>int pcre2_substring_get_bynumber(pcre2_match_data *<i>match_data</i>,</b>
<b> unsigned int <i>number</i>, PCRE2_UCHAR **<i>bufferptr</i>,</b> <b> uint32_t <i>number</i>, PCRE2_UCHAR **<i>bufferptr</i>,</b>
<b> PCRE2_SIZE *<i>bufflen</i>);</b> <b> PCRE2_SIZE *<i>bufflen</i>);</b>
<br> <br>
<br> <br>
@ -2685,7 +2685,7 @@ Cambridge, England.
</P> </P>
<br><a name="SEC37" href="#TOC1">REVISION</a><br> <br><a name="SEC37" href="#TOC1">REVISION</a><br>
<P> <P>
Last updated: 27 November 2014 Last updated: 01 December 2014
<br> <br>
Copyright &copy; 1997-2014 University of Cambridge. Copyright &copy; 1997-2014 University of Cambridge.
<br> <br>

View File

@ -283,7 +283,7 @@ PCRE2 NATIVE API STRING EXTRACTION FUNCTIONS
PCRE2_SPTR name, PCRE2_UCHAR *buffer, PCRE2_SIZE *bufflen); PCRE2_SPTR name, PCRE2_UCHAR *buffer, PCRE2_SIZE *bufflen);
int pcre2_substring_copy_bynumber(pcre2_match_data *match_data, int pcre2_substring_copy_bynumber(pcre2_match_data *match_data,
unsigned int number, PCRE2_UCHAR *buffer, uint32_t number, PCRE2_UCHAR *buffer,
PCRE2_SIZE *bufflen); PCRE2_SIZE *bufflen);
void pcre2_substring_free(PCRE2_UCHAR *buffer); void pcre2_substring_free(PCRE2_UCHAR *buffer);
@ -292,14 +292,14 @@ PCRE2 NATIVE API STRING EXTRACTION FUNCTIONS
PCRE2_SPTR name, PCRE2_UCHAR **bufferptr, PCRE2_SIZE *bufflen); PCRE2_SPTR name, PCRE2_UCHAR **bufferptr, PCRE2_SIZE *bufflen);
int pcre2_substring_get_bynumber(pcre2_match_data *match_data, int pcre2_substring_get_bynumber(pcre2_match_data *match_data,
unsigned int number, PCRE2_UCHAR **bufferptr, uint32_t number, PCRE2_UCHAR **bufferptr,
PCRE2_SIZE *bufflen); PCRE2_SIZE *bufflen);
int pcre2_substring_length_byname(pcre2_match_data *match_data, int pcre2_substring_length_byname(pcre2_match_data *match_data,
PCRE2_SPTR name, PCRE2_SIZE *length); PCRE2_SPTR name, PCRE2_SIZE *length);
int pcre2_substring_length_bynumber(pcre2_match_data *match_data, int pcre2_substring_length_bynumber(pcre2_match_data *match_data,
unsigned int number, PCRE2_SIZE *length); uint32_t number, PCRE2_SIZE *length);
int pcre2_substring_nametable_scan(const pcre2_code *code, int pcre2_substring_nametable_scan(const pcre2_code *code,
PCRE2_SPTR name, PCRE2_SPTR *first, PCRE2_SPTR *last); PCRE2_SPTR name, PCRE2_SPTR *first, PCRE2_SPTR *last);
@ -2189,14 +2189,14 @@ ERROR RETURNS FROM pcre2_match()
EXTRACTING CAPTURED SUBSTRINGS BY NUMBER EXTRACTING CAPTURED SUBSTRINGS BY NUMBER
int pcre2_substring_length_bynumber(pcre2_match_data *match_data, int pcre2_substring_length_bynumber(pcre2_match_data *match_data,
unsigned int number, PCRE2_SIZE *length); uint32_t number, PCRE2_SIZE *length);
int pcre2_substring_copy_bynumber(pcre2_match_data *match_data, int pcre2_substring_copy_bynumber(pcre2_match_data *match_data,
unsigned int number, PCRE2_UCHAR *buffer, uint32_t number, PCRE2_UCHAR *buffer,
PCRE2_SIZE *bufflen); PCRE2_SIZE *bufflen);
int pcre2_substring_get_bynumber(pcre2_match_data *match_data, int pcre2_substring_get_bynumber(pcre2_match_data *match_data,
unsigned int number, PCRE2_UCHAR **bufferptr, uint32_t number, PCRE2_UCHAR **bufferptr,
PCRE2_SIZE *bufflen); PCRE2_SIZE *bufflen);
void pcre2_substring_free(PCRE2_UCHAR *buffer); void pcre2_substring_free(PCRE2_UCHAR *buffer);
@ -2624,7 +2624,7 @@ AUTHOR
REVISION REVISION
Last updated: 27 November 2014 Last updated: 01 December 2014
Copyright (c) 1997-2014 University of Cambridge. Copyright (c) 1997-2014 University of Cambridge.
------------------------------------------------------------------------------ ------------------------------------------------------------------------------

View File

@ -1,4 +1,4 @@
.TH PCRE2_PATTERN_INFO 3 "21 October 2014" "PCRE2 10.00" .TH PCRE2_PATTERN_INFO 3 "01 December 2014" "PCRE2 10.00"
.SH NAME .SH NAME
PCRE2 - Perl-compatible regular expressions (revised API) PCRE2 - Perl-compatible regular expressions (revised API)
.SH SYNOPSIS .SH SYNOPSIS
@ -15,19 +15,19 @@ PCRE2 - Perl-compatible regular expressions (revised API)
.sp .sp
This function returns information about a compiled pattern. Its arguments are: This function returns information about a compiled pattern. Its arguments are:
.sp .sp
\fIcode\fP Compiled regular expression \fIcode\fP Pointer to a compiled regular expression
\fIwhat\fP What information is required \fIwhat\fP What information is required
\fIwhere\fP Where to put the information \fIwhere\fP Where to put the information
.sp .sp
If \fIwhere\fP is NULL, the function returns the amount of memory needed for The recognized values for the \fIwhat\fP argument, and the information they
the requested information, in bytes. The following information is available: request are as follows:
.sp .sp
PCRE2_INFO_ALLOPTIONS Final options after compiling PCRE2_INFO_ALLOPTIONS Final options after compiling
PCRE2_INFO_ARGOPTIONS Options passed to \fBpcre2_compile()\fP PCRE2_INFO_ARGOPTIONS Options passed to \fBpcre2_compile()\fP
PCRE2_INFO_BACKREFMAX Number of highest back reference PCRE2_INFO_BACKREFMAX Number of highest back reference
PCRE2_INFO_BSR What \eR matches PCRE2_INFO_BSR What \eR matches:
0 all Unicode line endings PCRE2_BSR_UNICODE: Unicode line endings
1 CR, LF, or CRLF only PCRE2_BSR_ANYCRLF: CR, LF, or CRLF only
PCRE2_INFO_CAPTURECOUNT Number of capturing subpatterns PCRE2_INFO_CAPTURECOUNT Number of capturing subpatterns
PCRE2_INFO_FIRSTBITMAP Bitmap of first code units, or NULL PCRE2_INFO_FIRSTBITMAP Bitmap of first code units, or NULL
PCRE2_INFO_FIRSTCODEUNIT First code unit when type is 1 PCRE2_INFO_FIRSTCODEUNIT First code unit when type is 1
@ -46,7 +46,7 @@ the requested information, in bytes. The following information is available:
PCRE2_INFO_MATCHEMPTY 1 if the pattern can match an PCRE2_INFO_MATCHEMPTY 1 if the pattern can match an
empty string, 0 otherwise empty string, 0 otherwise
PCRE2_INFO_MATCHLIMIT Match limit if set, PCRE2_INFO_MATCHLIMIT Match limit if set,
otherwise PCRE2_RROR_UNSET otherwise PCRE2_ERROR_UNSET
PCRE2_INFO_MAXLOOKBEHIND Length (in characters) of the longest PCRE2_INFO_MAXLOOKBEHIND Length (in characters) of the longest
lookbehind assertion lookbehind assertion
PCRE2_INFO_MINLENGTH Lower bound length of matching strings PCRE2_INFO_MINLENGTH Lower bound length of matching strings
@ -54,17 +54,20 @@ the requested information, in bytes. The following information is available:
PCRE2_INFO_NAMECOUNT Number of named subpatterns PCRE2_INFO_NAMECOUNT Number of named subpatterns
PCRE2_INFO_NAMETABLE Pointer to name table PCRE2_INFO_NAMETABLE Pointer to name table
PCRE2_CONFIG_NEWLINE Code for the newline sequence: PCRE2_CONFIG_NEWLINE Code for the newline sequence:
1 for CR PCRE2_NEWLINE_CR
2 for LF PCRE2_NEWLINE_LF
3 for CRLF PCRE2_NEWLINE_CRLF
4 for ANY PCRE2_NEWLINE_ANY
5 for ANYCRLF PCRE2_NEWLINE_ANYCRLF
PCRE2_INFO_RECURSIONLIMIT Recursion limit if set, PCRE2_INFO_RECURSIONLIMIT Recursion limit if set,
otherwise PCRE2_ERROR_UNSET otherwise PCRE2_ERROR_UNSET
PCRE2_INFO_SIZE Size of compiled pattern PCRE2_INFO_SIZE Size of compiled pattern
.sp .sp
The \fIwhere\fP argument must point to an unsigned 32-bit integer (uint32_t If \fIwhere\fP is NULL, the function returns the amount of memory needed for
variable), except for the following \fIwhat\fP values: the requested information, in bytes. Otherwise, the \fIwhere\fP argument must
point to an unsigned 32-bit integer (uint32_t variable), except for the
following \fIwhat\fP values, when it must point to a variable of the type
shown:
.sp .sp
PCRE2_INFO_FIRSTBITMAP const uint8_t * PCRE2_INFO_FIRSTBITMAP const uint8_t *
PCRE2_INFO_JITSIZE size_t PCRE2_INFO_JITSIZE size_t

View File

@ -1,4 +1,4 @@
.TH PCRE2_SUBSTRING_COPY_BYNUMBER 3 "21 October 2014" "PCRE2 10.00" .TH PCRE2_SUBSTRING_COPY_BYNUMBER 3 "01 December 2014" "PCRE2 10.00"
.SH NAME .SH NAME
PCRE2 - Perl-compatible regular expressions (revised API) PCRE2 - Perl-compatible regular expressions (revised API)
.SH SYNOPSIS .SH SYNOPSIS
@ -8,7 +8,7 @@ PCRE2 - Perl-compatible regular expressions (revised API)
.PP .PP
.nf .nf
.B int pcre2_substring_copy_bynumber(pcre2_match_data *\fImatch_data\fP, .B int pcre2_substring_copy_bynumber(pcre2_match_data *\fImatch_data\fP,
.B " unsigned int \fInumber\fP, PCRE2_UCHAR *\fIbuffer\fP," .B " uint32_t \fInumber\fP, PCRE2_UCHAR *\fIbuffer\fP,"
.B " PCRE2_SIZE *\fIbufflen\fP);" .B " PCRE2_SIZE *\fIbufflen\fP);"
.fi .fi
. .

View File

@ -1,4 +1,4 @@
.TH PCRE2_SUBSTRING_GET_BYNUMBER 3 "21 October 2014" "PCRE2 10.00" .TH PCRE2_SUBSTRING_GET_BYNUMBER 3 "01 December 2014" "PCRE2 10.00"
.SH NAME .SH NAME
PCRE2 - Perl-compatible regular expressions (revised API) PCRE2 - Perl-compatible regular expressions (revised API)
.SH SYNOPSIS .SH SYNOPSIS
@ -8,14 +8,14 @@ PCRE2 - Perl-compatible regular expressions (revised API)
.PP .PP
.nf .nf
.B int pcre2_substring_get_bynumber(pcre2_match_data *\fImatch_data\fP, .B int pcre2_substring_get_bynumber(pcre2_match_data *\fImatch_data\fP,
.B " unsigned int \fInumber\fP, PCRE2_UCHAR **\fIbufferptr\fP, PCRE2_SIZE *\fIbufflen\fP);" .B " uint32_t \fInumber\fP, PCRE2_UCHAR **\fIbufferptr\fP, PCRE2_SIZE *\fIbufflen\fP);"
.fi .fi
. .
.SH DESCRIPTION .SH DESCRIPTION
.rs .rs
.sp .sp
This is a convenience function for extracting a captured substring by number into This is a convenience function for extracting a captured substring by number
newly acquired memory. The arguments are: into newly acquired memory. The arguments are:
.sp .sp
\fImatch_data\fP The match data for the match \fImatch_data\fP The match data for the match
\fInumber\fP Number of the required substring \fInumber\fP Number of the required substring

View File

@ -1,4 +1,4 @@
.TH PCRE2_SUBSTRING_LENGTH_BYNUMBER 3 "21 October 2014" "PCRE2 10.00" .TH PCRE2_SUBSTRING_LENGTH_BYNUMBER 3 "01 December 2014" "PCRE2 10.00"
.SH NAME .SH NAME
PCRE2 - Perl-compatible regular expressions (revised API) PCRE2 - Perl-compatible regular expressions (revised API)
.SH SYNOPSIS .SH SYNOPSIS
@ -8,7 +8,7 @@ PCRE2 - Perl-compatible regular expressions (revised API)
.PP .PP
.nf .nf
.B int pcre2_substring_length_bynumber(pcre2_match_data *\fImatch_data\fP, .B int pcre2_substring_length_bynumber(pcre2_match_data *\fImatch_data\fP,
.B " unsigned int \fInumber\fP, PCRE2_SIZE *\fIlength\fP);" .B " uint32_t \fInumber\fP, PCRE2_SIZE *\fIlength\fP);"
.fi .fi
. .
.SH DESCRIPTION .SH DESCRIPTION

View File

@ -1,4 +1,4 @@
.TH PCRE2API 3 "27 November 2014" "PCRE2 10.00" .TH PCRE2API 3 "01 December 2014" "PCRE2 10.00"
.SH NAME .SH NAME
PCRE2 - Perl-compatible regular expressions (revised API) PCRE2 - Perl-compatible regular expressions (revised API)
.sp .sp
@ -138,7 +138,7 @@ document for an overview of all the PCRE2 documentation.
.B " PCRE2_SPTR \fIname\fP, PCRE2_UCHAR *\fIbuffer\fP, PCRE2_SIZE *\fIbufflen\fP);" .B " PCRE2_SPTR \fIname\fP, PCRE2_UCHAR *\fIbuffer\fP, PCRE2_SIZE *\fIbufflen\fP);"
.sp .sp
.B int pcre2_substring_copy_bynumber(pcre2_match_data *\fImatch_data\fP, .B int pcre2_substring_copy_bynumber(pcre2_match_data *\fImatch_data\fP,
.B " unsigned int \fInumber\fP, PCRE2_UCHAR *\fIbuffer\fP," .B " uint32_t \fInumber\fP, PCRE2_UCHAR *\fIbuffer\fP,"
.B " PCRE2_SIZE *\fIbufflen\fP);" .B " PCRE2_SIZE *\fIbufflen\fP);"
.sp .sp
.B void pcre2_substring_free(PCRE2_UCHAR *\fIbuffer\fP); .B void pcre2_substring_free(PCRE2_UCHAR *\fIbuffer\fP);
@ -147,14 +147,14 @@ document for an overview of all the PCRE2 documentation.
.B " PCRE2_SPTR \fIname\fP, PCRE2_UCHAR **\fIbufferptr\fP, PCRE2_SIZE *\fIbufflen\fP);" .B " PCRE2_SPTR \fIname\fP, PCRE2_UCHAR **\fIbufferptr\fP, PCRE2_SIZE *\fIbufflen\fP);"
.sp .sp
.B int pcre2_substring_get_bynumber(pcre2_match_data *\fImatch_data\fP, .B int pcre2_substring_get_bynumber(pcre2_match_data *\fImatch_data\fP,
.B " unsigned int \fInumber\fP, PCRE2_UCHAR **\fIbufferptr\fP," .B " uint32_t \fInumber\fP, PCRE2_UCHAR **\fIbufferptr\fP,"
.B " PCRE2_SIZE *\fIbufflen\fP);" .B " PCRE2_SIZE *\fIbufflen\fP);"
.sp .sp
.B int pcre2_substring_length_byname(pcre2_match_data *\fImatch_data\fP, .B int pcre2_substring_length_byname(pcre2_match_data *\fImatch_data\fP,
.B " PCRE2_SPTR \fIname\fP, PCRE2_SIZE *\fIlength\fP);" .B " PCRE2_SPTR \fIname\fP, PCRE2_SIZE *\fIlength\fP);"
.sp .sp
.B int pcre2_substring_length_bynumber(pcre2_match_data *\fImatch_data\fP, .B int pcre2_substring_length_bynumber(pcre2_match_data *\fImatch_data\fP,
.B " unsigned int \fInumber\fP, PCRE2_SIZE *\fIlength\fP);" .B " uint32_t \fInumber\fP, PCRE2_SIZE *\fIlength\fP);"
.sp .sp
.B int pcre2_substring_nametable_scan(const pcre2_code *\fIcode\fP, .B int pcre2_substring_nametable_scan(const pcre2_code *\fIcode\fP,
.B " PCRE2_SPTR \fIname\fP, PCRE2_SPTR *\fIfirst\fP, PCRE2_SPTR *\fIlast\fP);" .B " PCRE2_SPTR \fIname\fP, PCRE2_SPTR *\fIfirst\fP, PCRE2_SPTR *\fIlast\fP);"
@ -2248,14 +2248,14 @@ The internal recursion limit was reached.
.sp .sp
.nf .nf
.B int pcre2_substring_length_bynumber(pcre2_match_data *\fImatch_data\fP, .B int pcre2_substring_length_bynumber(pcre2_match_data *\fImatch_data\fP,
.B " unsigned int \fInumber\fP, PCRE2_SIZE *\fIlength\fP);" .B " uint32_t \fInumber\fP, PCRE2_SIZE *\fIlength\fP);"
.sp .sp
.B int pcre2_substring_copy_bynumber(pcre2_match_data *\fImatch_data\fP, .B int pcre2_substring_copy_bynumber(pcre2_match_data *\fImatch_data\fP,
.B " unsigned int \fInumber\fP, PCRE2_UCHAR *\fIbuffer\fP," .B " uint32_t \fInumber\fP, PCRE2_UCHAR *\fIbuffer\fP,"
.B " PCRE2_SIZE *\fIbufflen\fP);" .B " PCRE2_SIZE *\fIbufflen\fP);"
.sp .sp
.B int pcre2_substring_get_bynumber(pcre2_match_data *\fImatch_data\fP, .B int pcre2_substring_get_bynumber(pcre2_match_data *\fImatch_data\fP,
.B " unsigned int \fInumber\fP, PCRE2_UCHAR **\fIbufferptr\fP," .B " uint32_t \fInumber\fP, PCRE2_UCHAR **\fIbufferptr\fP,"
.B " PCRE2_SIZE *\fIbufflen\fP);" .B " PCRE2_SIZE *\fIbufflen\fP);"
.sp .sp
.B void pcre2_substring_free(PCRE2_UCHAR *\fIbuffer\fP); .B void pcre2_substring_free(PCRE2_UCHAR *\fIbuffer\fP);
@ -2735,6 +2735,6 @@ Cambridge, England.
.rs .rs
.sp .sp
.nf .nf
Last updated: 27 November 2014 Last updated: 01 December 2014
Copyright (c) 1997-2014 University of Cambridge. Copyright (c) 1997-2014 University of Cambridge.
.fi .fi

View File

@ -434,16 +434,16 @@ PCRE2_EXP_DECL PCRE2_SIZE pcre2_get_startchar(pcre2_match_data *);
PCRE2_EXP_DECL int pcre2_substring_copy_byname(pcre2_match_data *, \ PCRE2_EXP_DECL int pcre2_substring_copy_byname(pcre2_match_data *, \
PCRE2_SPTR, PCRE2_UCHAR *, PCRE2_SIZE *); \ PCRE2_SPTR, PCRE2_UCHAR *, PCRE2_SIZE *); \
PCRE2_EXP_DECL int pcre2_substring_copy_bynumber(pcre2_match_data *, \ PCRE2_EXP_DECL int pcre2_substring_copy_bynumber(pcre2_match_data *, \
unsigned int, PCRE2_UCHAR *, PCRE2_SIZE *); \ uint32_t, PCRE2_UCHAR *, PCRE2_SIZE *); \
PCRE2_EXP_DECL void pcre2_substring_free(PCRE2_UCHAR *); \ PCRE2_EXP_DECL void pcre2_substring_free(PCRE2_UCHAR *); \
PCRE2_EXP_DECL int pcre2_substring_get_byname(pcre2_match_data *, \ PCRE2_EXP_DECL int pcre2_substring_get_byname(pcre2_match_data *, \
PCRE2_SPTR, PCRE2_UCHAR **, PCRE2_SIZE *); \ PCRE2_SPTR, PCRE2_UCHAR **, PCRE2_SIZE *); \
PCRE2_EXP_DECL int pcre2_substring_get_bynumber(pcre2_match_data *, \ PCRE2_EXP_DECL int pcre2_substring_get_bynumber(pcre2_match_data *, \
unsigned int, PCRE2_UCHAR **, PCRE2_SIZE *); \ uint32_t, PCRE2_UCHAR **, PCRE2_SIZE *); \
PCRE2_EXP_DECL int pcre2_substring_length_byname(pcre2_match_data *, \ PCRE2_EXP_DECL int pcre2_substring_length_byname(pcre2_match_data *, \
PCRE2_SPTR, PCRE2_SIZE *); \ PCRE2_SPTR, PCRE2_SIZE *); \
PCRE2_EXP_DECL int pcre2_substring_length_bynumber(pcre2_match_data *, \ PCRE2_EXP_DECL int pcre2_substring_length_bynumber(pcre2_match_data *, \
unsigned int, PCRE2_SIZE *); \ uint32_t, PCRE2_SIZE *); \
PCRE2_EXP_DECL int pcre2_substring_nametable_scan(const pcre2_code *, \ PCRE2_EXP_DECL int pcre2_substring_nametable_scan(const pcre2_code *, \
PCRE2_SPTR, PCRE2_SPTR *, PCRE2_SPTR *); \ PCRE2_SPTR, PCRE2_SPTR *, PCRE2_SPTR *); \
PCRE2_EXP_DECL int pcre2_substring_number_from_name(\ PCRE2_EXP_DECL int pcre2_substring_number_from_name(\

View File

@ -82,7 +82,7 @@ Arguments:
Returns: pointer to memory or NULL on failure Returns: pointer to memory or NULL on failure
*/ */
PCRE2_EXP_DEFN void * extern void *
PRIV(memctl_malloc)(size_t size, pcre2_memctl *memctl) PRIV(memctl_malloc)(size_t size, pcre2_memctl *memctl)
{ {
pcre2_memctl *newmemctl; pcre2_memctl *newmemctl;

View File

@ -75,38 +75,30 @@ using some MS magic. I found some useful information on this web page:
http://msdn2.microsoft.com/en-us/library/y4h7bcy6(VS.80).aspx. According to the http://msdn2.microsoft.com/en-us/library/y4h7bcy6(VS.80).aspx. According to the
information there, using __declspec(dllexport) without "extern" we have a information there, using __declspec(dllexport) without "extern" we have a
definition; with "extern" we have a declaration. The settings here override the definition; with "extern" we have a declaration. The settings here override the
setting in pcre.h (which is included below); it defines only PCRE2_EXP_DECL, setting in pcre2.h (which is included below); it defines only PCRE2_EXP_DECL,
which is all that is needed for applications (they just import the symbols). We which is all that is needed for applications (they just import the symbols). We
use: use:
PCRE2_EXP_DECL for declarations PCRE2_EXP_DECL for declarations
PCRE2_EXP_DEFN for definitions of exported functions PCRE2_EXP_DEFN for definitions
PCRE2_EXP_DATA_DEFN for definitions of exported variables
The reason for the two DEFN macros is that in non-Windows environments, one The reason for wrapping this in #ifndef PCRE2_EXP_DECL is so that pcre2test,
does not want to have "extern" before variable definitions because it leads to
compiler warnings. So we distinguish between functions and variables. In
Windows, the two should always be the same.
The reason for wrapping this in #ifndef PCRE2_EXP_DECL is so that pcretest,
which is an application, but needs to import this file in order to "peek" at which is an application, but needs to import this file in order to "peek" at
internals, can #include pcre.h first to get an application's-eye view. internals, can #include pcre2.h first to get an application's-eye view.
In principle, people compiling for non-Windows, non-Unix-like (i.e. uncommon, In principle, people compiling for non-Windows, non-Unix-like (i.e. uncommon,
special-purpose environments) might want to stick other stuff in front of special-purpose environments) might want to stick other stuff in front of
exported symbols. That's why, in the non-Windows case, we set PCRE2_EXP_DEFN and exported symbols. That's why, in the non-Windows case, we set PCRE2_EXP_DEFN
PCRE2_EXP_DATA_DEFN only if they are not already set. */ only if it is not already set. */
#ifndef PCRE2_EXP_DECL #ifndef PCRE2_EXP_DECL
# ifdef _WIN32 # ifdef _WIN32
# ifndef PCRE2_STATIC # ifndef PCRE2_STATIC
# define PCRE2_EXP_DECL extern __declspec(dllexport) # define PCRE2_EXP_DECL extern __declspec(dllexport)
# define PCRE2_EXP_DEFN __declspec(dllexport) # define PCRE2_EXP_DEFN __declspec(dllexport)
# define PCRE2_EXP_DATA_DEFN __declspec(dllexport)
# else # else
# define PCRE2_EXP_DECL extern # define PCRE2_EXP_DECL extern
# define PCRE2_EXP_DEFN # define PCRE2_EXP_DEFN
# define PCRE2_EXP_DATA_DEFN
# endif # endif
# else # else
# ifdef __cplusplus # ifdef __cplusplus
@ -117,9 +109,6 @@ PCRE2_EXP_DATA_DEFN only if they are not already set. */
# ifndef PCRE2_EXP_DEFN # ifndef PCRE2_EXP_DEFN
# define PCRE2_EXP_DEFN PCRE2_EXP_DECL # define PCRE2_EXP_DEFN PCRE2_EXP_DECL
# endif # endif
# ifndef PCRE2_EXP_DATA_DEFN
# define PCRE2_EXP_DATA_DEFN
# endif
# endif # endif
#endif #endif
@ -129,7 +118,7 @@ property values. This must follow the setting of PCRE2_EXP_DECL above. */
#include "pcre2.h" #include "pcre2.h"
#include "pcre2_ucp.h" #include "pcre2_ucp.h"
/* When PCRE is compiled as a C++ library, the subject pointer can be replaced /* When PCRE2 is compiled as a C++ library, the subject pointer can be replaced
with a custom type. This makes it possible, for example, to allow pcre2_match() with a custom type. This makes it possible, for example, to allow pcre2_match()
to process subject strings that are discontinuous by using a smart pointer to process subject strings that are discontinuous by using a smart pointer
class. It must always be possible to inspect all of the subject string in class. It must always be possible to inspect all of the subject string in

View File

@ -79,7 +79,7 @@ int entrysize = pcre2_substring_nametable_scan(match_data->code, stringname,
if (entrysize < 0) return entrysize; if (entrysize < 0) return entrysize;
for (entry = first; entry <= last; entry += entrysize) for (entry = first; entry <= last; entry += entrysize)
{ {
uint16_t n = GET2(entry, 0); uint32_t n = GET2(entry, 0);
if (n < match_data->oveccount && match_data->ovector[n*2] != PCRE2_UNSET) if (n < match_data->oveccount && match_data->ovector[n*2] != PCRE2_UNSET)
return pcre2_substring_copy_bynumber(match_data, n, buffer, sizeptr); return pcre2_substring_copy_bynumber(match_data, n, buffer, sizeptr);
} }
@ -109,7 +109,7 @@ Returns: if successful: 0
PCRE2_EXP_DEFN int PCRE2_CALL_CONVENTION PCRE2_EXP_DEFN int PCRE2_CALL_CONVENTION
pcre2_substring_copy_bynumber(pcre2_match_data *match_data, pcre2_substring_copy_bynumber(pcre2_match_data *match_data,
unsigned int stringnumber, PCRE2_UCHAR *buffer, PCRE2_SIZE *sizeptr) uint32_t stringnumber, PCRE2_UCHAR *buffer, PCRE2_SIZE *sizeptr)
{ {
PCRE2_SIZE left, right; PCRE2_SIZE left, right;
PCRE2_SIZE p = 0; PCRE2_SIZE p = 0;
@ -160,7 +160,7 @@ int entrysize = pcre2_substring_nametable_scan(match_data->code, stringname,
if (entrysize < 0) return entrysize; if (entrysize < 0) return entrysize;
for (entry = first; entry <= last; entry += entrysize) for (entry = first; entry <= last; entry += entrysize)
{ {
uint16_t n = GET2(entry, 0); uint32_t n = GET2(entry, 0);
if (n < match_data->oveccount && match_data->ovector[n*2] != PCRE2_UNSET) if (n < match_data->oveccount && match_data->ovector[n*2] != PCRE2_UNSET)
return pcre2_substring_get_bynumber(match_data, n, stringptr, sizeptr); return pcre2_substring_get_bynumber(match_data, n, stringptr, sizeptr);
} }
@ -190,7 +190,7 @@ Returns: if successful: zero
PCRE2_EXP_DEFN int PCRE2_CALL_CONVENTION PCRE2_EXP_DEFN int PCRE2_CALL_CONVENTION
pcre2_substring_get_bynumber(pcre2_match_data *match_data, pcre2_substring_get_bynumber(pcre2_match_data *match_data,
unsigned int stringnumber, PCRE2_UCHAR **stringptr, PCRE2_SIZE *sizeptr) uint32_t stringnumber, PCRE2_UCHAR **stringptr, PCRE2_SIZE *sizeptr)
{ {
PCRE2_SIZE left, right; PCRE2_SIZE left, right;
PCRE2_SIZE p = 0; PCRE2_SIZE p = 0;
@ -263,7 +263,7 @@ int entrysize = pcre2_substring_nametable_scan(match_data->code, stringname,
if (entrysize <= 0) return entrysize; if (entrysize <= 0) return entrysize;
for (entry = first; entry <= last; entry += entrysize) for (entry = first; entry <= last; entry += entrysize)
{ {
uint16_t n = GET2(entry, 0); uint32_t n = GET2(entry, 0);
if (n < match_data->oveccount && match_data->ovector[n*2] != PCRE2_UNSET) if (n < match_data->oveccount && match_data->ovector[n*2] != PCRE2_UNSET)
return pcre2_substring_length_bynumber(match_data, n, sizeptr); return pcre2_substring_length_bynumber(match_data, n, sizeptr);
} }
@ -288,7 +288,7 @@ Returns: 0 if successful, else a negative error number
PCRE2_EXP_DEFN int PCRE2_CALL_CONVENTION PCRE2_EXP_DEFN int PCRE2_CALL_CONVENTION
pcre2_substring_length_bynumber(pcre2_match_data *match_data, pcre2_substring_length_bynumber(pcre2_match_data *match_data,
unsigned int stringnumber, PCRE2_SIZE *sizeptr) uint32_t stringnumber, PCRE2_SIZE *sizeptr)
{ {
if (stringnumber >= match_data->oveccount || if (stringnumber >= match_data->oveccount ||
stringnumber > match_data->code->top_bracket || stringnumber > match_data->code->top_bracket ||