Add PCRE2_CONFIG_COMPILED_WIDTHS and PCRE2_CONFIG_NEVER_BACKSLASH_C.
This commit is contained in:
parent
03fa7ead8a
commit
4ac74a013b
|
@ -13,6 +13,9 @@ that is called by both pcre2_match() and pcre2_dfa_match().
|
||||||
|
|
||||||
3. Add idempotent guard to pcre2_internal.h.
|
3. Add idempotent guard to pcre2_internal.h.
|
||||||
|
|
||||||
|
4. Add new pcre2_config() options: PCRE2_CONFIG_NEVER_BACKSLASH_C and
|
||||||
|
PCRE2_CONFIG_COMPILED_WIDTHS.
|
||||||
|
|
||||||
|
|
||||||
Version 10.30 14-August-2017
|
Version 10.30 14-August-2017
|
||||||
----------------------------
|
----------------------------
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
.TH PCRE2_CONFIG 3 "26 May 2017" "PCRE2 10.30"
|
.TH PCRE2_CONFIG 3 "16 September 2017" "PCRE2 10.31"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
PCRE2 - Perl-compatible regular expressions (revised API)
|
PCRE2 - Perl-compatible regular expressions (revised API)
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
|
@ -31,8 +31,9 @@ point to a uint32_t integer variable. The available codes are:
|
||||||
PCRE2_CONFIG_BSR Indicates what \eR matches by default:
|
PCRE2_CONFIG_BSR Indicates what \eR matches by default:
|
||||||
PCRE2_BSR_UNICODE
|
PCRE2_BSR_UNICODE
|
||||||
PCRE2_BSR_ANYCRLF
|
PCRE2_BSR_ANYCRLF
|
||||||
PCRE2_CONFIG_HEAPLIMIT Default heap memory limit
|
PCRE2_CONFIG_COMPILED_WIDTHS Which of 8/16/32 support was compiled
|
||||||
PCRE2_CONFIG_DEPTHLIMIT Default backtracking depth limit
|
PCRE2_CONFIG_DEPTHLIMIT Default backtracking depth limit
|
||||||
|
PCRE2_CONFIG_HEAPLIMIT Default heap memory limit
|
||||||
.\" JOIN
|
.\" JOIN
|
||||||
PCRE2_CONFIG_JIT Availability of just-in-time compiler
|
PCRE2_CONFIG_JIT Availability of just-in-time compiler
|
||||||
support (1=yes 0=no)
|
support (1=yes 0=no)
|
||||||
|
@ -41,6 +42,7 @@ point to a uint32_t integer variable. The available codes are:
|
||||||
architecture for the JIT compiler
|
architecture for the JIT compiler
|
||||||
PCRE2_CONFIG_LINKSIZE Configured internal link size (2, 3, 4)
|
PCRE2_CONFIG_LINKSIZE Configured internal link size (2, 3, 4)
|
||||||
PCRE2_CONFIG_MATCHLIMIT Default internal resource limit
|
PCRE2_CONFIG_MATCHLIMIT Default internal resource limit
|
||||||
|
PCRE2_CONFIG_NEVER_BACKSLASH_C Whether or not \eC is disabled
|
||||||
PCRE2_CONFIG_NEWLINE Code for the default newline sequence:
|
PCRE2_CONFIG_NEWLINE Code for the default newline sequence:
|
||||||
PCRE2_NEWLINE_CR
|
PCRE2_NEWLINE_CR
|
||||||
PCRE2_NEWLINE_LF
|
PCRE2_NEWLINE_LF
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
.TH PCRE2API 3 "10 July 2017" "PCRE2 10.30"
|
.TH PCRE2API 3 "16 September 2017" "PCRE2 10.31"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
PCRE2 - Perl-compatible regular expressions (revised API)
|
PCRE2 - Perl-compatible regular expressions (revised API)
|
||||||
.sp
|
.sp
|
||||||
|
@ -1014,6 +1014,12 @@ sequences the \eR escape sequence matches by default. A value of
|
||||||
PCRE2_BSR_UNICODE means that \eR matches any Unicode line ending sequence; a
|
PCRE2_BSR_UNICODE means that \eR matches any Unicode line ending sequence; a
|
||||||
value of PCRE2_BSR_ANYCRLF means that \eR matches only CR, LF, or CRLF. The
|
value of PCRE2_BSR_ANYCRLF means that \eR matches only CR, LF, or CRLF. The
|
||||||
default can be overridden when a pattern is compiled.
|
default can be overridden when a pattern is compiled.
|
||||||
|
.sp
|
||||||
|
PCRE2_CONFIG_COMPILED_WIDTHS
|
||||||
|
.sp
|
||||||
|
The output is a uint32_t integer whose lower bits indicate which code unit
|
||||||
|
widths were selected when PCRE2 was built. The 1-bit indicates 8-bit support,
|
||||||
|
and the 2-bit and 4-bit indicate 16-bit and 32-bit support, respectively.
|
||||||
.sp
|
.sp
|
||||||
PCRE2_CONFIG_DEPTHLIMIT
|
PCRE2_CONFIG_DEPTHLIMIT
|
||||||
.sp
|
.sp
|
||||||
|
@ -1079,6 +1085,11 @@ sequence that is recognized as meaning "newline". The values are:
|
||||||
.sp
|
.sp
|
||||||
The default should normally correspond to the standard sequence for your
|
The default should normally correspond to the standard sequence for your
|
||||||
operating system.
|
operating system.
|
||||||
|
.sp
|
||||||
|
PCRE2_CONFIG_NEVER_BACKSLASH_C
|
||||||
|
.sp
|
||||||
|
The output is a uint32_t integer that is set to one if the use of \eC was
|
||||||
|
permanently disabled when PCRE2 was built; otherwise it is set to zero.
|
||||||
.sp
|
.sp
|
||||||
PCRE2_CONFIG_PARENSLIMIT
|
PCRE2_CONFIG_PARENSLIMIT
|
||||||
.sp
|
.sp
|
||||||
|
@ -3574,6 +3585,6 @@ Cambridge, England.
|
||||||
.rs
|
.rs
|
||||||
.sp
|
.sp
|
||||||
.nf
|
.nf
|
||||||
Last updated: 10 July 2017
|
Last updated: 16 September 2017
|
||||||
Copyright (c) 1997-2017 University of Cambridge.
|
Copyright (c) 1997-2017 University of Cambridge.
|
||||||
.fi
|
.fi
|
||||||
|
|
|
@ -338,6 +338,9 @@ numbers must not be changed. */
|
||||||
#define PCRE2_CONFIG_UNICODE_VERSION 10
|
#define PCRE2_CONFIG_UNICODE_VERSION 10
|
||||||
#define PCRE2_CONFIG_VERSION 11
|
#define PCRE2_CONFIG_VERSION 11
|
||||||
#define PCRE2_CONFIG_HEAPLIMIT 12
|
#define PCRE2_CONFIG_HEAPLIMIT 12
|
||||||
|
#define PCRE2_CONFIG_NEVER_BACKSLASH_C 13
|
||||||
|
#define PCRE2_CONFIG_COMPILED_WIDTHS 14
|
||||||
|
|
||||||
|
|
||||||
/* Types for code units in patterns and subject strings. */
|
/* Types for code units in patterns and subject strings. */
|
||||||
|
|
||||||
|
|
|
@ -338,6 +338,9 @@ numbers must not be changed. */
|
||||||
#define PCRE2_CONFIG_UNICODE_VERSION 10
|
#define PCRE2_CONFIG_UNICODE_VERSION 10
|
||||||
#define PCRE2_CONFIG_VERSION 11
|
#define PCRE2_CONFIG_VERSION 11
|
||||||
#define PCRE2_CONFIG_HEAPLIMIT 12
|
#define PCRE2_CONFIG_HEAPLIMIT 12
|
||||||
|
#define PCRE2_CONFIG_NEVER_BACKSLASH_C 13
|
||||||
|
#define PCRE2_CONFIG_COMPILED_WIDTHS 14
|
||||||
|
|
||||||
|
|
||||||
/* Types for code units in patterns and subject strings. */
|
/* Types for code units in patterns and subject strings. */
|
||||||
|
|
||||||
|
|
|
@ -84,11 +84,13 @@ if (where == NULL) /* Requests a length */
|
||||||
return PCRE2_ERROR_BADOPTION;
|
return PCRE2_ERROR_BADOPTION;
|
||||||
|
|
||||||
case PCRE2_CONFIG_BSR:
|
case PCRE2_CONFIG_BSR:
|
||||||
|
case PCRE2_CONFIG_COMPILED_WIDTHS:
|
||||||
|
case PCRE2_CONFIG_DEPTHLIMIT:
|
||||||
case PCRE2_CONFIG_HEAPLIMIT:
|
case PCRE2_CONFIG_HEAPLIMIT:
|
||||||
case PCRE2_CONFIG_JIT:
|
case PCRE2_CONFIG_JIT:
|
||||||
case PCRE2_CONFIG_LINKSIZE:
|
case PCRE2_CONFIG_LINKSIZE:
|
||||||
case PCRE2_CONFIG_MATCHLIMIT:
|
case PCRE2_CONFIG_MATCHLIMIT:
|
||||||
case PCRE2_CONFIG_DEPTHLIMIT:
|
case PCRE2_CONFIG_NEVER_BACKSLASH_C:
|
||||||
case PCRE2_CONFIG_NEWLINE:
|
case PCRE2_CONFIG_NEWLINE:
|
||||||
case PCRE2_CONFIG_PARENSLIMIT:
|
case PCRE2_CONFIG_PARENSLIMIT:
|
||||||
case PCRE2_CONFIG_STACKRECURSE: /* Obsolete */
|
case PCRE2_CONFIG_STACKRECURSE: /* Obsolete */
|
||||||
|
@ -117,6 +119,24 @@ switch (what)
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case PCRE2_CONFIG_COMPILED_WIDTHS:
|
||||||
|
*((uint32_t *)where) = 0
|
||||||
|
#ifdef SUPPORT_PCRE2_8
|
||||||
|
+ 1
|
||||||
|
#endif
|
||||||
|
#ifdef SUPPORT_PCRE2_16
|
||||||
|
+ 2
|
||||||
|
#endif
|
||||||
|
#ifdef SUPPORT_PCRE2_32
|
||||||
|
+ 4
|
||||||
|
#endif
|
||||||
|
;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case PCRE2_CONFIG_DEPTHLIMIT:
|
||||||
|
*((uint32_t *)where) = MATCH_LIMIT_DEPTH;
|
||||||
|
break;
|
||||||
|
|
||||||
case PCRE2_CONFIG_HEAPLIMIT:
|
case PCRE2_CONFIG_HEAPLIMIT:
|
||||||
*((uint32_t *)where) = HEAP_LIMIT;
|
*((uint32_t *)where) = HEAP_LIMIT;
|
||||||
break;
|
break;
|
||||||
|
@ -148,14 +168,18 @@ switch (what)
|
||||||
*((uint32_t *)where) = MATCH_LIMIT;
|
*((uint32_t *)where) = MATCH_LIMIT;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PCRE2_CONFIG_DEPTHLIMIT:
|
|
||||||
*((uint32_t *)where) = MATCH_LIMIT_DEPTH;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case PCRE2_CONFIG_NEWLINE:
|
case PCRE2_CONFIG_NEWLINE:
|
||||||
*((uint32_t *)where) = NEWLINE_DEFAULT;
|
*((uint32_t *)where) = NEWLINE_DEFAULT;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case PCRE2_CONFIG_NEVER_BACKSLASH_C:
|
||||||
|
#ifdef NEVER_BACKSLASH_C
|
||||||
|
*((uint32_t *)where) = 1;
|
||||||
|
#else
|
||||||
|
*((uint32_t *)where) = 0;
|
||||||
|
#endif
|
||||||
|
break;
|
||||||
|
|
||||||
case PCRE2_CONFIG_PARENSLIMIT:
|
case PCRE2_CONFIG_PARENSLIMIT:
|
||||||
*((uint32_t *)where) = PARENS_NEST_LIMIT;
|
*((uint32_t *)where) = PARENS_NEST_LIMIT;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -7807,15 +7807,11 @@ printf(" EBCDIC code page %s or similar\n", pcrz_cpversion());
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef SUPPORT_PCRE2_8
|
(void)PCRE2_CONFIG(PCRE2_CONFIG_COMPILED_WIDTHS, &optval);
|
||||||
printf(" 8-bit support\n");
|
if (optval & 1) printf(" 8-bit support\n");
|
||||||
#endif
|
if (optval & 2) printf(" 16-bit support\n");
|
||||||
#ifdef SUPPORT_PCRE2_16
|
if (optval & 4) printf(" 32-bit support\n");
|
||||||
printf(" 16-bit support\n");
|
|
||||||
#endif
|
|
||||||
#ifdef SUPPORT_PCRE2_32
|
|
||||||
printf(" 32-bit support\n");
|
|
||||||
#endif
|
|
||||||
#ifdef SUPPORT_VALGRIND
|
#ifdef SUPPORT_VALGRIND
|
||||||
printf(" Valgrind support\n");
|
printf(" Valgrind support\n");
|
||||||
#endif
|
#endif
|
||||||
|
@ -7846,11 +7842,8 @@ print_newline_config(optval, FALSE);
|
||||||
(void)PCRE2_CONFIG(PCRE2_CONFIG_BSR, &optval);
|
(void)PCRE2_CONFIG(PCRE2_CONFIG_BSR, &optval);
|
||||||
printf(" \\R matches %s\n", optval? "CR, LF, or CRLF only" :
|
printf(" \\R matches %s\n", optval? "CR, LF, or CRLF only" :
|
||||||
"all Unicode newlines");
|
"all Unicode newlines");
|
||||||
#ifdef NEVER_BACKSLASH_C
|
(void)PCRE2_CONFIG(PCRE2_CONFIG_NEVER_BACKSLASH_C, &optval);
|
||||||
printf(" \\C is not supported\n");
|
printf(" \\C is %ssupported\n", optval? "not ":"");
|
||||||
#else
|
|
||||||
printf(" \\C is supported\n");
|
|
||||||
#endif
|
|
||||||
(void)PCRE2_CONFIG(PCRE2_CONFIG_LINKSIZE, &optval);
|
(void)PCRE2_CONFIG(PCRE2_CONFIG_LINKSIZE, &optval);
|
||||||
printf(" Internal link size = %d\n", optval);
|
printf(" Internal link size = %d\n", optval);
|
||||||
(void)PCRE2_CONFIG(PCRE2_CONFIG_PARENSLIMIT, &optval);
|
(void)PCRE2_CONFIG(PCRE2_CONFIG_PARENSLIMIT, &optval);
|
||||||
|
|
Loading…
Reference in New Issue