/[pcre]/code/trunk/pcre_fullinfo.c
ViewVC logotype

Diff of /code/trunk/pcre_fullinfo.c

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

revision 199 by ph10, Tue Jul 31 14:39:09 2007 UTC revision 426 by ph10, Wed Aug 26 15:38:32 2009 UTC
# Line 2  Line 2 
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-2007 University of Cambridge             Copyright (c) 1997-2009 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
# Line 42  POSSIBILITY OF SUCH DAMAGE. Line 42  POSSIBILITY OF SUCH DAMAGE.
42  information about a compiled pattern. */  information about a compiled pattern. */
43    
44    
45  #ifdef HAVE_CONFIG_H  #ifdef HAVE_CONFIG_H
46  #include <config.h>  #include "config.h"
47  #endif  #endif
48    
49  #include "pcre_internal.h"  #include "pcre_internal.h"
50    
# Line 65  Arguments: Line 65  Arguments:
65  Returns:           0 if data returned, negative on error  Returns:           0 if data returned, negative on error
66  */  */
67    
68  PCRE_EXP_DEFN 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  {  {
# Line 89  if (re->magic_number != MAGIC_NUMBER) Line 89  if (re->magic_number != MAGIC_NUMBER)
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:
# Line 110  switch (what) Line 110  switch (what)
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
# Line 125  switch (what) Line 125  switch (what)
125    
126    case PCRE_INFO_LASTLITERAL:    case PCRE_INFO_LASTLITERAL:
127    *((int *)where) =    *((int *)where) =
128      ((re->options & PCRE_REQCHSET) != 0)? re->req_byte : -1;      ((re->flags & PCRE_REQCHSET) != 0)? re->req_byte : -1;
129    break;    break;
130    
131    case PCRE_INFO_NAMEENTRYSIZE:    case PCRE_INFO_NAMEENTRYSIZE:
# Line 144  switch (what) Line 144  switch (what)
144    *((const uschar **)where) = (const uschar *)(_pcre_default_tables);    *((const uschar **)where) = (const uschar *)(_pcre_default_tables);
145    break;    break;
146    
147      /* From release 8.00 this will always return TRUE because NOPARTIAL is
148      no longer ever set (the restrictions have been removed). */
149    
150    case PCRE_INFO_OKPARTIAL:    case PCRE_INFO_OKPARTIAL:
151    *((int *)where) = (re->options & PCRE_NOPARTIAL) == 0;    *((int *)where) = (re->flags & PCRE_NOPARTIAL) == 0;
152    break;    break;
153    
154    case PCRE_INFO_JCHANGED:    case PCRE_INFO_JCHANGED:
155    *((int *)where) = (re->options & PCRE_JCHANGED) != 0;    *((int *)where) = (re->flags & PCRE_JCHANGED) != 0;
156      break;
157    
158      case PCRE_INFO_HASCRORLF:
159      *((int *)where) = (re->flags & PCRE_HASCRORLF) != 0;
160    break;    break;
161    
162    default: return PCRE_ERROR_BADOPTION;    default: return PCRE_ERROR_BADOPTION;

Legend:
Removed from v.199  
changed lines
  Added in v.426

  ViewVC Help
Powered by ViewVC 1.1.5