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

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

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

revision 805 by ph10, Wed Dec 14 16:49:20 2011 UTC revision 826 by zherczeg, Tue Dec 27 09:42:33 2011 UTC
# Line 44  local functions. This source file is use Line 44  local functions. This source file is use
44    
45  (1) It is #included by pcre_compile.c when it is compiled in debugging mode  (1) It is #included by pcre_compile.c when it is compiled in debugging mode
46  (PCRE_DEBUG defined in pcre_internal.h). It is not included in production  (PCRE_DEBUG defined in pcre_internal.h). It is not included in production
47  compiles.  compiles. In this case PCRE_INCLUDED is defined.
48    
49  (2) It is also compiled separately and linked with pcretest.c, which can be  (2) It is also compiled separately and linked with pcretest.c, which can be
50  asked to print out a compiled regex for debugging purposes. */  asked to print out a compiled regex for debugging purposes. */
51    
52    #ifndef PCRE_INCLUDED
53    
54  #ifdef HAVE_CONFIG_H  #ifdef HAVE_CONFIG_H
55  #include "config.h"  #include "config.h"
56  #endif  #endif
# Line 68  appropriately for an application, not fo Line 70  appropriately for an application, not fo
70  /* These are the funtions that are contained within. It doesn't seem worth  /* These are the funtions that are contained within. It doesn't seem worth
71  having a separate .h file just for this. */  having a separate .h file just for this. */
72    
73    #endif /* PCRE_INCLUDED */
74    
75    #ifdef PCRE_INCLUDED
76    static /* Keep the following function as private. */
77    #endif
78  #ifdef COMPILE_PCRE8  #ifdef COMPILE_PCRE8
79  void pcre_printint(pcre *external_re, FILE *f, BOOL print_lengths);  void pcre_printint(pcre *external_re, FILE *f, BOOL print_lengths);
80  #endif  #else
 #ifdef COMPILE_PCRE16  
81  void pcre16_printint(pcre *external_re, FILE *f, BOOL print_lengths);  void pcre16_printint(pcre *external_re, FILE *f, BOOL print_lengths);
82  #endif  #endif
83    
# Line 108  print_char(FILE *f, pcre_uchar *ptr, BOO Line 114  print_char(FILE *f, pcre_uchar *ptr, BOO
114  int c = *ptr;  int c = *ptr;
115    
116  #ifndef SUPPORT_UTF  #ifndef SUPPORT_UTF
117    
118  (void)utf;  /* Avoid compiler warning */  (void)utf;  /* Avoid compiler warning */
119  if (PRINTABLE(c)) fprintf(f, "%c", c); else fprintf(f, "\\x%02x", c);  if (PRINTABLE(c)) fprintf(f, "%c", c);
120    else if (c <= 0xff) fprintf(f, "\\x%02x", c);
121    else fprintf(f, "\\x{%x}", c);
122  return 0;  return 0;
123    
124  #else  #else
# Line 230  print_lengths flag controls whether offs Line 239  print_lengths flag controls whether offs
239  They can be turned off from pcretest so that automatic tests on bytecode can be  They can be turned off from pcretest so that automatic tests on bytecode can be
240  written that do not depend on the value of LINK_SIZE. */  written that do not depend on the value of LINK_SIZE. */
241    
242    #ifdef PCRE_INCLUDED
243    static /* Keep the following function as private. */
244    #endif
245  #ifdef COMPILE_PCRE8  #ifdef COMPILE_PCRE8
246  void  void
247  pcre_printint(pcre *external_re, FILE *f, BOOL print_lengths)  pcre_printint(pcre *external_re, FILE *f, BOOL print_lengths)
# Line 464  for(;;) Line 476  for(;;)
476      case OP_NOT:      case OP_NOT:
477      c = code[1];      c = code[1];
478      if (PRINTABLE(c)) fprintf(f, " %s [^%c]", flag, c);      if (PRINTABLE(c)) fprintf(f, " %s [^%c]", flag, c);
479        else fprintf(f, " %s [^\\x%02x]", flag, c);      else if (utf || c > 0xff)
480          fprintf(f, " %s [^\\x{%02x}]", flag, c);
481        else
482          fprintf(f, " %s [^\\x%02x]", flag, c);
483      break;      break;
484    
485      case OP_NOTSTARI:      case OP_NOTSTARI:

Legend:
Removed from v.805  
changed lines
  Added in v.826

  ViewVC Help
Powered by ViewVC 1.1.5