| 188 |
#define PCHARSV8(p, len, f) \ |
#define PCHARSV8(p, len, f) \ |
| 189 |
(void)pchars((pcre_uint8 *)p, len, f) |
(void)pchars((pcre_uint8 *)p, len, f) |
| 190 |
|
|
| 191 |
#define STRLEN8(p) (int)strlen((char *)p) |
#define STRLEN8(p) ((int)strlen((char *)p)) |
| 192 |
|
|
| 193 |
#define PCRE_COMPILE8(re, pat, options, error, erroffset, tables) \ |
#define PCRE_COMPILE8(re, pat, options, error, erroffset, tables) \ |
| 194 |
re = pcre_compile((char *)pat, options, error, erroffset, tables) |
re = pcre_compile((char *)pat, options, error, erroffset, tables) |
| 240 |
#define PCRE_STUDY8(extra, re, options, error) \ |
#define PCRE_STUDY8(extra, re, options, error) \ |
| 241 |
extra = pcre_study(re, options, error) |
extra = pcre_study(re, options, error) |
| 242 |
|
|
| 243 |
|
#define SET_PCRE_CALLOUT8(callout) \ |
| 244 |
|
pcre_callout = callout |
| 245 |
|
|
| 246 |
#endif /* SUPPORT_PCRE8 */ |
#endif /* SUPPORT_PCRE8 */ |
| 247 |
|
|
| 248 |
/* -----------------------------------------------------------*/ |
/* -----------------------------------------------------------*/ |
| 255 |
#define PCHARSV16(p, len, f) \ |
#define PCHARSV16(p, len, f) \ |
| 256 |
(void)pchars16((PCRE_SPTR16)p, len, f) |
(void)pchars16((PCRE_SPTR16)p, len, f) |
| 257 |
|
|
| 258 |
#define STRLEN16(p) (int)strlen16((PCRE_SPTR16)p) |
#define STRLEN16(p) ((int)strlen16((PCRE_SPTR16)p)) |
| 259 |
|
|
| 260 |
#define PCRE_COMPILE16(re, pat, options, error, erroffset, tables) \ |
#define PCRE_COMPILE16(re, pat, options, error, erroffset, tables) \ |
| 261 |
re = pcre16_compile((PCRE_SPTR16)pat, options, error, erroffset, tables) |
re = pcre16_compile((PCRE_SPTR16)pat, options, error, erroffset, tables) |
| 310 |
#define PCRE_STUDY16(extra, re, options, error) \ |
#define PCRE_STUDY16(extra, re, options, error) \ |
| 311 |
extra = pcre16_study(re, options, error) |
extra = pcre16_study(re, options, error) |
| 312 |
|
|
| 313 |
|
#define SET_PCRE_CALLOUT16(callout) \ |
| 314 |
|
pcre16_callout = callout |
| 315 |
|
|
| 316 |
#endif /* SUPPORT_PCRE16 */ |
#endif /* SUPPORT_PCRE16 */ |
| 317 |
|
|
| 318 |
|
|
| 332 |
else \ |
else \ |
| 333 |
PCHARSV8(p, len, f) |
PCHARSV8(p, len, f) |
| 334 |
|
|
| 335 |
#define STRLEN(p) use_pcre16? STRLEN16(p) : STRLEN8(p) |
#define STRLEN(p) (use_pcre16? STRLEN16(p) : STRLEN8(p)) |
| 336 |
|
|
| 337 |
#define PCRE_COMPILE(re, pat, options, error, erroffset, tables) \ |
#define PCRE_COMPILE(re, pat, options, error, erroffset, tables) \ |
| 338 |
if (use_pcre16) \ |
if (use_pcre16) \ |
| 430 |
else \ |
else \ |
| 431 |
PCRE_STUDY8(extra, re, options, error) |
PCRE_STUDY8(extra, re, options, error) |
| 432 |
|
|
| 433 |
|
#define SET_PCRE_CALLOUT(callout) \ |
| 434 |
|
if (use_pcre16) \ |
| 435 |
|
SET_PCRE_CALLOUT16(callout); \ |
| 436 |
|
else \ |
| 437 |
|
SET_PCRE_CALLOUT8(callout) |
| 438 |
|
|
| 439 |
/* ----- Only 8-bit mode is supported ----- */ |
/* ----- Only 8-bit mode is supported ----- */ |
| 440 |
|
|
| 441 |
#elif defined SUPPORT_PCRE8 |
#elif defined SUPPORT_PCRE8 |
| 456 |
#define PCRE_GET_SUBSTRING_LIST PCRE_GET_SUBSTRING_LIST8 |
#define PCRE_GET_SUBSTRING_LIST PCRE_GET_SUBSTRING_LIST8 |
| 457 |
#define PCRE_PATTERN_TO_HOST_BYTE_ORDER PCRE_PATTERN_TO_HOST_BYTE_ORDER8 |
#define PCRE_PATTERN_TO_HOST_BYTE_ORDER PCRE_PATTERN_TO_HOST_BYTE_ORDER8 |
| 458 |
#define PCRE_STUDY PCRE_STUDY8 |
#define PCRE_STUDY PCRE_STUDY8 |
| 459 |
|
#define SET_PCRE_CALLOUT SET_PCRE_CALLOUT8 |
| 460 |
|
|
| 461 |
/* ----- Only 16-bit mode is supported ----- */ |
/* ----- Only 16-bit mode is supported ----- */ |
| 462 |
|
|
| 478 |
#define PCRE_GET_SUBSTRING_LIST PCRE_GET_SUBSTRING_LIST16 |
#define PCRE_GET_SUBSTRING_LIST PCRE_GET_SUBSTRING_LIST16 |
| 479 |
#define PCRE_PATTERN_TO_HOST_BYTE_ORDER PCRE_PATTERN_TO_HOST_BYTE_ORDER16 |
#define PCRE_PATTERN_TO_HOST_BYTE_ORDER PCRE_PATTERN_TO_HOST_BYTE_ORDER16 |
| 480 |
#define PCRE_STUDY PCRE_STUDY16 |
#define PCRE_STUDY PCRE_STUDY16 |
| 481 |
|
#define SET_PCRE_CALLOUT SET_PCRE_CALLOUT16 |
| 482 |
#endif |
#endif |
| 483 |
|
|
| 484 |
/* ----- End of mode-specific function call macros ----- */ |
/* ----- End of mode-specific function call macros ----- */ |
| 1672 |
case OP_END: |
case OP_END: |
| 1673 |
return; |
return; |
| 1674 |
|
|
| 1675 |
|
#ifdef SUPPORT_UTF |
| 1676 |
case OP_CHAR: |
case OP_CHAR: |
| 1677 |
case OP_CHARI: |
case OP_CHARI: |
| 1678 |
case OP_NOT: |
case OP_NOT: |
| 1729 |
case OP_NOTPOSPLUSI: |
case OP_NOTPOSPLUSI: |
| 1730 |
case OP_NOTPOSQUERYI: |
case OP_NOTPOSQUERYI: |
| 1731 |
case OP_NOTPOSUPTOI: |
case OP_NOTPOSUPTOI: |
|
#ifdef SUPPORT_UTF |
|
| 1732 |
if (utf) utf16_char = TRUE; |
if (utf) utf16_char = TRUE; |
| 1733 |
#endif |
#endif |
| 1734 |
|
/* Fall through. */ |
| 1735 |
|
|
| 1736 |
|
default: |
| 1737 |
length = OP_lengths16[op] - 1; |
length = OP_lengths16[op] - 1; |
| 1738 |
break; |
break; |
| 1739 |
|
|
| 1771 |
length -= 32/sizeof(pcre_uint16); |
length -= 32/sizeof(pcre_uint16); |
| 1772 |
} |
} |
| 1773 |
break; |
break; |
|
|
|
|
default: |
|
|
length = OP_lengths16[op] - 1; |
|
|
break; |
|
| 1774 |
} |
} |
| 1775 |
} |
} |
| 1776 |
/* Control should never reach here in 16 bit mode. */ |
/* Control should never reach here in 16 bit mode. */ |
| 2684 |
size_t jitsize; |
size_t jitsize; |
| 2685 |
new_info(re, extra, PCRE_INFO_JITSIZE, &jitsize); |
new_info(re, extra, PCRE_INFO_JITSIZE, &jitsize); |
| 2686 |
if (jitsize != 0) |
if (jitsize != 0) |
| 2687 |
fprintf(outfile, "Memory allocation (JIT code): %d\n", jitsize); |
fprintf(outfile, "Memory allocation (JIT code): %d\n", (int)jitsize); |
| 2688 |
} |
} |
| 2689 |
} |
} |
| 2690 |
} |
} |
| 2785 |
fprintf(outfile, "Named capturing subpatterns:\n"); |
fprintf(outfile, "Named capturing subpatterns:\n"); |
| 2786 |
while (namecount-- > 0) |
while (namecount-- > 0) |
| 2787 |
{ |
{ |
| 2788 |
fprintf(outfile, " %s %*s%3d\n", nametable + 2, |
#if defined SUPPORT_PCRE8 && defined SUPPORT_PCRE16 |
| 2789 |
nameentrysize - 3 - (int)strlen((char *)nametable + 2), "", |
int imm2_size = use_pcre16 ? 1 : 2; |
| 2790 |
GET2(nametable, 0)); |
#else |
| 2791 |
|
int imm2_size = IMM2_SIZE; |
| 2792 |
|
#endif |
| 2793 |
|
int length = (int)STRLEN(nametable + imm2_size); |
| 2794 |
|
fprintf(outfile, " "); |
| 2795 |
|
PCHARSV(nametable + imm2_size, length, outfile); |
| 2796 |
|
while (length++ < nameentrysize - imm2_size) putc(' ', outfile); |
| 2797 |
|
#if defined SUPPORT_PCRE8 && defined SUPPORT_PCRE16 |
| 2798 |
|
fprintf(outfile, "%3d\n", use_pcre16? |
| 2799 |
|
(int)nametable[0] : ((int)nametable[0] << 8) | (int)nametable[1]); |
| 2800 |
|
nametable += nameentrysize * (use_pcre16 ? 2 : 1); |
| 2801 |
|
#else |
| 2802 |
|
fprintf(outfile, "%3d\n", GET2(nametable, 0)); |
| 2803 |
nametable += nameentrysize; |
nametable += nameentrysize; |
| 2804 |
|
#endif |
| 2805 |
} |
} |
| 2806 |
} |
} |
| 2807 |
|
|
| 3068 |
copynamesptr = copynames; |
copynamesptr = copynames; |
| 3069 |
getnamesptr = getnames; |
getnamesptr = getnames; |
| 3070 |
|
|
| 3071 |
pcre_callout = callout; |
SET_PCRE_CALLOUT(callout); |
| 3072 |
first_callout = 1; |
first_callout = 1; |
| 3073 |
last_callout_mark = NULL; |
last_callout_mark = NULL; |
| 3074 |
callout_extra = 0; |
callout_extra = 0; |
| 3231 |
} |
} |
| 3232 |
else if (isalnum(*p)) |
else if (isalnum(*p)) |
| 3233 |
{ |
{ |
| 3234 |
pcre_uchar *npp = copynamesptr; |
pcre_uchar *namestart = copynamesptr; |
| 3235 |
while (isalnum(*p)) *npp++ = *p++; |
#if defined SUPPORT_PCRE8 && defined SUPPORT_PCRE16 |
| 3236 |
*npp++ = 0; |
if (use_pcre16) |
| 3237 |
*npp = 0; |
{ |
| 3238 |
PCRE_GET_STRINGNUMBER(n, re, copynamesptr); |
PCRE_SCHAR16 *npp = (PCRE_SCHAR16 *)copynamesptr; |
| 3239 |
|
while (isalnum(*p)) *npp++ = *p++; |
| 3240 |
|
*npp++ = 0; |
| 3241 |
|
*npp = 0; |
| 3242 |
|
PCRE_GET_STRINGNUMBER(n, re, copynamesptr); |
| 3243 |
|
copynamesptr = (pcre_uchar *)npp; |
| 3244 |
|
} |
| 3245 |
|
else |
| 3246 |
|
{ |
| 3247 |
|
#endif |
| 3248 |
|
pcre_uchar *npp = copynamesptr; |
| 3249 |
|
while (isalnum(*p)) *npp++ = *p++; |
| 3250 |
|
*npp++ = 0; |
| 3251 |
|
*npp = 0; |
| 3252 |
|
PCRE_GET_STRINGNUMBER(n, re, copynamesptr); |
| 3253 |
|
copynamesptr = npp; |
| 3254 |
|
#if defined SUPPORT_PCRE8 && defined SUPPORT_PCRE16 |
| 3255 |
|
} |
| 3256 |
|
#endif |
| 3257 |
if (n < 0) |
if (n < 0) |
| 3258 |
fprintf(outfile, "no parentheses with name \"%s\"\n", copynamesptr); |
{ |
| 3259 |
copynamesptr = npp; |
fprintf(outfile, "no parentheses with name \""); |
| 3260 |
|
PCHARSV(namestart, STRLEN(namestart), outfile); |
| 3261 |
|
fprintf(outfile, "\"\n"); |
| 3262 |
|
} |
| 3263 |
} |
} |
| 3264 |
else if (*p == '+') |
else if (*p == '+') |
| 3265 |
{ |
{ |
| 3268 |
} |
} |
| 3269 |
else if (*p == '-') |
else if (*p == '-') |
| 3270 |
{ |
{ |
| 3271 |
pcre_callout = NULL; |
SET_PCRE_CALLOUT(NULL); |
| 3272 |
p++; |
p++; |
| 3273 |
} |
} |
| 3274 |
else if (*p == '!') |
else if (*p == '!') |
| 3735 |
} |
} |
| 3736 |
|
|
| 3737 |
for (copynamesptr = copynames; |
for (copynamesptr = copynames; |
| 3738 |
|
#if defined SUPPORT_PCRE8 && defined SUPPORT_PCRE16 |
| 3739 |
|
use_pcre16? |
| 3740 |
|
(*(PCRE_SCHAR16*)copynamesptr) != 0 : *copynamesptr != 0; |
| 3741 |
|
copynamesptr += (int)(STRLEN(copynamesptr) + 1) * |
| 3742 |
|
(use_pcre16? 2:1) |
| 3743 |
|
#else |
| 3744 |
*copynamesptr != 0; |
*copynamesptr != 0; |
| 3745 |
copynamesptr += (int)strlen((char*)copynamesptr) + 1) |
copynamesptr += (int)STRLEN(copynamesptr) + 1 |
| 3746 |
|
#endif |
| 3747 |
|
) |
| 3748 |
{ |
{ |
| 3749 |
int rc; |
int rc; |
| 3750 |
char copybuffer[256]; |
char copybuffer[256]; |
| 3756 |
{ |
{ |
| 3757 |
fprintf(outfile, " C "); |
fprintf(outfile, " C "); |
| 3758 |
PCHARSV(copybuffer, rc, outfile); |
PCHARSV(copybuffer, rc, outfile); |
| 3759 |
fprintf(outfile, " (%d) %s\n", rc, copynamesptr); |
fprintf(outfile, " (%d) ", rc); |
| 3760 |
|
PCHARSV(copynamesptr, STRLEN(copynamesptr), outfile); |
| 3761 |
|
putc('\n', outfile); |
| 3762 |
} |
} |
| 3763 |
} |
} |
| 3764 |
|
|