/[pcre]/code/branches/pcre16/pcre_info.c
ViewVC logotype

Diff of /code/branches/pcre16/pcre_info.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 795 by zherczeg, Sat Dec 10 02:20:06 2011 UTC revision 809 by zherczeg, Mon Dec 19 11:04:45 2011 UTC
# Line 80  PCRE_EXP_DEFN int PCRE_CALL_CONVENTION Line 80  PCRE_EXP_DEFN int PCRE_CALL_CONVENTION
80  pcre16_info(const pcre *argument_re, int *optptr, int *first_char)  pcre16_info(const pcre *argument_re, int *optptr, int *first_char)
81  #endif  #endif
82  {  {
 real_pcre internal_re;  
83  const real_pcre *re = (const real_pcre *)argument_re;  const real_pcre *re = (const real_pcre *)argument_re;
84  if (re == NULL) return PCRE_ERROR_NULL;  if (re == NULL) return PCRE_ERROR_NULL;
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, NULL, NULL);      PCRE_ERROR_BADENDIANNESS:PCRE_ERROR_BADMAGIC;
   if (re == NULL) return PCRE_ERROR_BADMAGIC;  
   }  
94  if ((re->flags & PCRE_MODE) == 0) return PCRE_ERROR_BADMODE;  if ((re->flags & PCRE_MODE) == 0) return PCRE_ERROR_BADMODE;
95    
96  if (optptr != NULL) *optptr = (int)(re->options & PUBLIC_COMPILE_OPTIONS);  if (optptr != NULL) *optptr = (int)(re->options & PUBLIC_COMPILE_OPTIONS);
97  if (first_char != NULL)  if (first_char != NULL)
98    *first_char = ((re->flags & PCRE_FIRSTSET) != 0)? re->first_char :    *first_char = ((re->flags & PCRE_FIRSTSET) != 0)? re->first_char :

Legend:
Removed from v.795  
changed lines
  Added in v.809

  ViewVC Help
Powered by ViewVC 1.1.5