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

Diff of /code/trunk/pcretest.c

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

revision 455 by ph10, Sat Sep 26 19:12:32 2009 UTC revision 498 by ph10, Wed Mar 3 19:29:38 2010 UTC
# Line 118  external symbols to prevent clashes. */ Line 118  external symbols to prevent clashes. */
118    
119  /* We also need the pcre_printint() function for printing out compiled  /* We also need the pcre_printint() function for printing out compiled
120  patterns. This function is in a separate file so that it can be included in  patterns. This function is in a separate file so that it can be included in
121  pcre_compile.c when that module is compiled with debugging enabled.  pcre_compile.c when that module is compiled with debugging enabled. It needs to
122    know which case is being compiled. */
 The definition of the macro PRINTABLE, which determines whether to print an  
 output character as-is or as a hex value when showing compiled patterns, is  
 contained in this file. We uses it here also, in cases when the locale has not  
 been explicitly changed, so as to get consistent output from systems that  
 differ in their output from isprint() even in the "C" locale. */  
123    
124    #define COMPILING_PCRETEST
125  #include "pcre_printint.src"  #include "pcre_printint.src"
126    
127  #define PRINTHEX(c) (locale_set? isprint(c) : PRINTABLE(c))  /* The definition of the macro PRINTABLE, which determines whether to print an
128    output character as-is or as a hex value when showing compiled patterns, is
129    contained in the printint.src file. We uses it here also, in cases when the
130    locale has not been explicitly changed, so as to get consistent output from
131    systems that differ in their output from isprint() even in the "C" locale. */
132    
133    #define PRINTHEX(c) (locale_set? isprint(c) : PRINTABLE(c))
134    
135  /* It is possible to compile this test program without including support for  /* It is possible to compile this test program without including support for
136  testing the POSIX interface, though this is not available via the standard  testing the POSIX interface, though this is not available via the standard
# Line 1305  while (!done) Line 1306  while (!done)
1306      if ((options & PCRE_DOTALL) != 0) cflags |= REG_DOTALL;      if ((options & PCRE_DOTALL) != 0) cflags |= REG_DOTALL;
1307      if ((options & PCRE_NO_AUTO_CAPTURE) != 0) cflags |= REG_NOSUB;      if ((options & PCRE_NO_AUTO_CAPTURE) != 0) cflags |= REG_NOSUB;
1308      if ((options & PCRE_UTF8) != 0) cflags |= REG_UTF8;      if ((options & PCRE_UTF8) != 0) cflags |= REG_UTF8;
1309      if ((options & PCRE_UNGREEDY) != 0) cflags |= REG_UNGREEDY;      if ((options & PCRE_UNGREEDY) != 0) cflags |= REG_UNGREEDY;
1310    
1311      rc = regcomp(&preg, (char *)p, cflags);      rc = regcomp(&preg, (char *)p, cflags);
1312    
# Line 1630  while (!done) Line 1631  while (!done)
1631            {            {
1632            uschar *start_bits = NULL;            uschar *start_bits = NULL;
1633            int minlength;            int minlength;
1634    
1635            new_info(re, extra, PCRE_INFO_MINLENGTH, &minlength);            new_info(re, extra, PCRE_INFO_MINLENGTH, &minlength);
1636            fprintf(outfile, "Subject length lower bound = %d\n", minlength);            fprintf(outfile, "Subject length lower bound = %d\n", minlength);
1637    
1638            new_info(re, extra, PCRE_INFO_FIRSTTABLE, &start_bits);            new_info(re, extra, PCRE_INFO_FIRSTTABLE, &start_bits);
1639            if (start_bits == NULL)            if (start_bits == NULL)
1640              fprintf(outfile, "No set of starting bytes\n");              fprintf(outfile, "No set of starting bytes\n");
# Line 1977  while (!done) Line 1978  while (!done)
1978          case 'N':          case 'N':
1979          if ((options & PCRE_NOTEMPTY) != 0)          if ((options & PCRE_NOTEMPTY) != 0)
1980            options = (options & ~PCRE_NOTEMPTY) | PCRE_NOTEMPTY_ATSTART;            options = (options & ~PCRE_NOTEMPTY) | PCRE_NOTEMPTY_ATSTART;
1981          else          else
1982            options |= PCRE_NOTEMPTY;            options |= PCRE_NOTEMPTY;
1983          continue;          continue;
1984    
# Line 2001  while (!done) Line 2002  while (!done)
2002          continue;          continue;
2003    
2004          case 'P':          case 'P':
2005          options |= ((options & PCRE_PARTIAL_SOFT) == 0)?          options |= ((options & PCRE_PARTIAL_SOFT) == 0)?
2006            PCRE_PARTIAL_SOFT : PCRE_PARTIAL_HARD;            PCRE_PARTIAL_SOFT : PCRE_PARTIAL_HARD;
2007          continue;          continue;
2008    
# Line 2377  while (!done) Line 2378  while (!done)
2378            {            {
2379            fprintf(outfile, ": ");            fprintf(outfile, ": ");
2380            pchars(bptr + use_offsets[0], use_offsets[1] - use_offsets[0],            pchars(bptr + use_offsets[0], use_offsets[1] - use_offsets[0],
2381              outfile);              outfile);
2382            }            }
2383          fprintf(outfile, "\n");          fprintf(outfile, "\n");
2384          break;  /* Out of the /g loop */          break;  /* Out of the /g loop */
2385          }          }

Legend:
Removed from v.455  
changed lines
  Added in v.498

  ViewVC Help
Powered by ViewVC 1.1.5