75 |
void *where) |
void *where) |
76 |
#endif |
#endif |
77 |
{ |
{ |
|
real_pcre internal_re; |
|
|
pcre_study_data internal_study; |
|
78 |
const real_pcre *re = (const real_pcre *)argument_re; |
const real_pcre *re = (const real_pcre *)argument_re; |
79 |
const pcre_study_data *study = NULL; |
const pcre_study_data *study = NULL; |
80 |
|
|
83 |
if (extra_data != NULL && (extra_data->flags & PCRE_EXTRA_STUDY_DATA) != 0) |
if (extra_data != NULL && (extra_data->flags & PCRE_EXTRA_STUDY_DATA) != 0) |
84 |
study = (const pcre_study_data *)extra_data->study_data; |
study = (const pcre_study_data *)extra_data->study_data; |
85 |
|
|
86 |
|
/* Check that the first field in the block is the magic number. If it is not, |
87 |
|
return with PCRE_ERROR_BADMAGIC. However, if the magic number is equal to |
88 |
|
REVERSED_MAGIC_NUMBER we return with PCRE_ERROR_BADENDIANNESS, which |
89 |
|
means that the pattern is likely compiled with different endianness. */ |
90 |
|
|
91 |
if (re->magic_number != MAGIC_NUMBER) |
if (re->magic_number != MAGIC_NUMBER) |
92 |
{ |
return re->magic_number == REVERSED_MAGIC_NUMBER? |
93 |
re = PRIV(try_flipped)(re, &internal_re, study, &internal_study); |
PCRE_ERROR_BADENDIANNESS:PCRE_ERROR_BADMAGIC; |
|
if (re == NULL) return PCRE_ERROR_BADMAGIC; |
|
|
if (study != NULL) study = &internal_study; |
|
|
} |
|
94 |
if ((re->flags & PCRE_MODE) == 0) return PCRE_ERROR_BADMODE; |
if ((re->flags & PCRE_MODE) == 0) return PCRE_ERROR_BADMODE; |
95 |
|
|
96 |
switch (what) |
switch (what) |