| 2 |
* Perl-Compatible Regular Expressions * |
* Perl-Compatible Regular Expressions * |
| 3 |
*************************************************/ |
*************************************************/ |
| 4 |
|
|
| 5 |
/*PCRE is a library of functions to support regular expressions whose syntax |
/* PCRE is a library of functions to support regular expressions whose syntax |
| 6 |
and semantics are as close as possible to those of the Perl 5 language. |
and semantics are as close as possible to those of the Perl 5 language. |
| 7 |
|
|
| 8 |
Written by Philip Hazel |
Written by Philip Hazel |
| 9 |
Copyright (c) 1997-2006 University of Cambridge |
Copyright (c) 1997-2011 University of Cambridge |
| 10 |
|
|
| 11 |
----------------------------------------------------------------------------- |
----------------------------------------------------------------------------- |
| 12 |
Redistribution and use in source and binary forms, with or without |
Redistribution and use in source and binary forms, with or without |
| 42 |
information about a compiled pattern. */ |
information about a compiled pattern. */ |
| 43 |
|
|
| 44 |
|
|
| 45 |
|
#ifdef HAVE_CONFIG_H |
| 46 |
|
#include "config.h" |
| 47 |
|
#endif |
| 48 |
|
|
| 49 |
#include "pcre_internal.h" |
#include "pcre_internal.h" |
| 50 |
|
|
| 51 |
|
|
| 65 |
Returns: 0 if data returned, negative on error |
Returns: 0 if data returned, negative on error |
| 66 |
*/ |
*/ |
| 67 |
|
|
| 68 |
PCRE_DATA_SCOPE int |
PCRE_EXP_DEFN int PCRE_CALL_CONVENTION |
| 69 |
pcre_fullinfo(const pcre *argument_re, const pcre_extra *extra_data, int what, |
pcre_fullinfo(const pcre *argument_re, const pcre_extra *extra_data, int what, |
| 70 |
void *where) |
void *where) |
| 71 |
{ |
{ |
| 89 |
switch (what) |
switch (what) |
| 90 |
{ |
{ |
| 91 |
case PCRE_INFO_OPTIONS: |
case PCRE_INFO_OPTIONS: |
| 92 |
*((unsigned long int *)where) = re->options & PUBLIC_OPTIONS; |
*((unsigned long int *)where) = re->options & PUBLIC_COMPILE_OPTIONS; |
| 93 |
break; |
break; |
| 94 |
|
|
| 95 |
case PCRE_INFO_SIZE: |
case PCRE_INFO_SIZE: |
| 110 |
|
|
| 111 |
case PCRE_INFO_FIRSTBYTE: |
case PCRE_INFO_FIRSTBYTE: |
| 112 |
*((int *)where) = |
*((int *)where) = |
| 113 |
((re->options & PCRE_FIRSTSET) != 0)? re->first_byte : |
((re->flags & PCRE_FIRSTSET) != 0)? re->first_byte : |
| 114 |
((re->options & PCRE_STARTLINE) != 0)? -1 : -2; |
((re->flags & PCRE_STARTLINE) != 0)? -1 : -2; |
| 115 |
break; |
break; |
| 116 |
|
|
| 117 |
/* Make sure we pass back the pointer to the bit vector in the external |
/* Make sure we pass back the pointer to the bit vector in the external |
| 119 |
|
|
| 120 |
case PCRE_INFO_FIRSTTABLE: |
case PCRE_INFO_FIRSTTABLE: |
| 121 |
*((const uschar **)where) = |
*((const uschar **)where) = |
| 122 |
(study != NULL && (study->options & PCRE_STUDY_MAPPED) != 0)? |
(study != NULL && (study->flags & PCRE_STUDY_MAPPED) != 0)? |
| 123 |
((const pcre_study_data *)extra_data->study_data)->start_bits : NULL; |
((const pcre_study_data *)extra_data->study_data)->start_bits : NULL; |
| 124 |
break; |
break; |
| 125 |
|
|
| 126 |
|
case PCRE_INFO_MINLENGTH: |
| 127 |
|
*((int *)where) = |
| 128 |
|
(study != NULL && (study->flags & PCRE_STUDY_MINLEN) != 0)? |
| 129 |
|
study->minlength : -1; |
| 130 |
|
break; |
| 131 |
|
|
| 132 |
|
case PCRE_INFO_JIT: |
| 133 |
|
*((int *)where) = extra_data != NULL && |
| 134 |
|
(extra_data->flags & PCRE_EXTRA_EXECUTABLE_JIT) != 0 && |
| 135 |
|
extra_data->executable_jit != NULL; |
| 136 |
|
break; |
| 137 |
|
|
| 138 |
case PCRE_INFO_LASTLITERAL: |
case PCRE_INFO_LASTLITERAL: |
| 139 |
*((int *)where) = |
*((int *)where) = |
| 140 |
((re->options & PCRE_REQCHSET) != 0)? re->req_byte : -1; |
((re->flags & PCRE_REQCHSET) != 0)? re->req_byte : -1; |
| 141 |
break; |
break; |
| 142 |
|
|
| 143 |
case PCRE_INFO_NAMEENTRYSIZE: |
case PCRE_INFO_NAMEENTRYSIZE: |
| 156 |
*((const uschar **)where) = (const uschar *)(_pcre_default_tables); |
*((const uschar **)where) = (const uschar *)(_pcre_default_tables); |
| 157 |
break; |
break; |
| 158 |
|
|
| 159 |
|
/* From release 8.00 this will always return TRUE because NOPARTIAL is |
| 160 |
|
no longer ever set (the restrictions have been removed). */ |
| 161 |
|
|
| 162 |
|
case PCRE_INFO_OKPARTIAL: |
| 163 |
|
*((int *)where) = (re->flags & PCRE_NOPARTIAL) == 0; |
| 164 |
|
break; |
| 165 |
|
|
| 166 |
|
case PCRE_INFO_JCHANGED: |
| 167 |
|
*((int *)where) = (re->flags & PCRE_JCHANGED) != 0; |
| 168 |
|
break; |
| 169 |
|
|
| 170 |
|
case PCRE_INFO_HASCRORLF: |
| 171 |
|
*((int *)where) = (re->flags & PCRE_HASCRORLF) != 0; |
| 172 |
|
break; |
| 173 |
|
|
| 174 |
default: return PCRE_ERROR_BADOPTION; |
default: return PCRE_ERROR_BADOPTION; |
| 175 |
} |
} |
| 176 |
|
|