|
version 1.1.1.3, 2012/10/09 09:19:17
|
version 1.1.1.5, 2014/06/15 19:46:04
|
|
Line 6
|
Line 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. |
| |
|
| Written by Philip Hazel |
Written by Philip Hazel |
| Copyright (c) 1997-2012 University of Cambridge | Copyright (c) 1997-2013 University of Cambridge |
| |
|
| ----------------------------------------------------------------------------- |
----------------------------------------------------------------------------- |
| Redistribution and use in source and binary forms, with or without |
Redistribution and use in source and binary forms, with or without |
|
Line 65 Arguments:
|
Line 65 Arguments:
|
| Returns: 0 if data returned, negative on error |
Returns: 0 if data returned, negative on error |
| */ |
*/ |
| |
|
| #ifdef COMPILE_PCRE8 | #if defined COMPILE_PCRE8 |
| PCRE_EXP_DEFN int PCRE_CALL_CONVENTION |
PCRE_EXP_DEFN int PCRE_CALL_CONVENTION |
| pcre_fullinfo(const pcre *argument_re, const pcre_extra *extra_data, |
pcre_fullinfo(const pcre *argument_re, const pcre_extra *extra_data, |
| int what, void *where) |
int what, void *where) |
| #else | #elif defined COMPILE_PCRE16 |
| PCRE_EXP_DEFN int PCRE_CALL_CONVENTION |
PCRE_EXP_DEFN int PCRE_CALL_CONVENTION |
| pcre16_fullinfo(const pcre16 *argument_re, const pcre16_extra *extra_data, |
pcre16_fullinfo(const pcre16 *argument_re, const pcre16_extra *extra_data, |
| int what, void *where) |
int what, void *where) |
| |
#elif defined COMPILE_PCRE32 |
| |
PCRE_EXP_DEFN int PCRE_CALL_CONVENTION |
| |
pcre32_fullinfo(const pcre32 *argument_re, const pcre32_extra *extra_data, |
| |
int what, void *where) |
| #endif |
#endif |
| { |
{ |
| const REAL_PCRE *re = (const REAL_PCRE *)argument_re; |
const REAL_PCRE *re = (const REAL_PCRE *)argument_re; |
|
Line 132 switch (what)
|
Line 136 switch (what)
|
| |
|
| case PCRE_INFO_FIRSTBYTE: |
case PCRE_INFO_FIRSTBYTE: |
| *((int *)where) = |
*((int *)where) = |
| ((re->flags & PCRE_FIRSTSET) != 0)? re->first_char : | ((re->flags & PCRE_FIRSTSET) != 0)? (int)re->first_char : |
| ((re->flags & PCRE_STARTLINE) != 0)? -1 : -2; |
((re->flags & PCRE_STARTLINE) != 0)? -1 : -2; |
| break; |
break; |
| |
|
| |
case PCRE_INFO_FIRSTCHARACTER: |
| |
*((pcre_uint32 *)where) = |
| |
(re->flags & PCRE_FIRSTSET) != 0 ? re->first_char : 0; |
| |
break; |
| |
|
| |
case PCRE_INFO_FIRSTCHARACTERFLAGS: |
| |
*((int *)where) = |
| |
((re->flags & PCRE_FIRSTSET) != 0) ? 1 : |
| |
((re->flags & PCRE_STARTLINE) != 0) ? 2 : 0; |
| |
break; |
| |
|
| /* 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 |
| block, not the internal copy (with flipped integer fields). */ |
block, not the internal copy (with flipped integer fields). */ |
| |
|
|
Line 159 switch (what)
|
Line 174 switch (what)
|
| |
|
| case PCRE_INFO_LASTLITERAL: |
case PCRE_INFO_LASTLITERAL: |
| *((int *)where) = |
*((int *)where) = |
| ((re->flags & PCRE_REQCHSET) != 0)? re->req_char : -1; | ((re->flags & PCRE_REQCHSET) != 0)? (int)re->req_char : -1; |
| break; |
break; |
| |
|
| |
case PCRE_INFO_REQUIREDCHAR: |
| |
*((pcre_uint32 *)where) = |
| |
((re->flags & PCRE_REQCHSET) != 0) ? re->req_char : 0; |
| |
break; |
| |
|
| |
case PCRE_INFO_REQUIREDCHARFLAGS: |
| |
*((int *)where) = |
| |
((re->flags & PCRE_REQCHSET) != 0); |
| |
break; |
| |
|
| case PCRE_INFO_NAMEENTRYSIZE: |
case PCRE_INFO_NAMEENTRYSIZE: |
| *((int *)where) = re->name_entry_size; |
*((int *)where) = re->name_entry_size; |
| break; |
break; |
|
Line 195 switch (what)
|
Line 220 switch (what)
|
| |
|
| case PCRE_INFO_MAXLOOKBEHIND: |
case PCRE_INFO_MAXLOOKBEHIND: |
| *((int *)where) = re->max_lookbehind; |
*((int *)where) = re->max_lookbehind; |
| |
break; |
| |
|
| |
case PCRE_INFO_MATCHLIMIT: |
| |
if ((re->flags & PCRE_MLSET) == 0) return PCRE_ERROR_UNSET; |
| |
*((pcre_uint32 *)where) = re->limit_match; |
| |
break; |
| |
|
| |
case PCRE_INFO_RECURSIONLIMIT: |
| |
if ((re->flags & PCRE_RLSET) == 0) return PCRE_ERROR_UNSET; |
| |
*((pcre_uint32 *)where) = re->limit_recursion; |
| |
break; |
| |
|
| |
case PCRE_INFO_MATCH_EMPTY: |
| |
*((int *)where) = (re->flags & PCRE_MATCH_EMPTY) != 0; |
| break; |
break; |
| |
|
| default: return PCRE_ERROR_BADOPTION; |
default: return PCRE_ERROR_BADOPTION; |