Diff for /embedaddon/pcre/pcre_fullinfo.c between versions 1.1.1.2 and 1.1.1.4

version 1.1.1.2, 2012/02/21 23:50:25 version 1.1.1.4, 2013/07/22 08:25:56
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 191  switch (what) Line 216  switch (what)
   
   case PCRE_INFO_HASCRORLF:    case PCRE_INFO_HASCRORLF:
   *((int *)where) = (re->flags & PCRE_HASCRORLF) != 0;    *((int *)where) = (re->flags & PCRE_HASCRORLF) != 0;
     break;
   
     case PCRE_INFO_MAXLOOKBEHIND:
     *((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;    break;
   
   default: return PCRE_ERROR_BADOPTION;    default: return PCRE_ERROR_BADOPTION;

Removed from v.1.1.1.2  
changed lines
  Added in v.1.1.1.4


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>