/[pcre]/code/tags/pcre-4.1/pcre.c
ViewVC logotype

Diff of /code/tags/pcre-4.1/pcre.c

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

revision 13 by nigel, Sat Feb 24 21:38:21 2007 UTC revision 15 by nigel, Sat Feb 24 21:38:25 2007 UTC
# Line 9  the file Tech.Notes for some information Line 9  the file Tech.Notes for some information
9    
10  Written by: Philip Hazel <ph10@cam.ac.uk>  Written by: Philip Hazel <ph10@cam.ac.uk>
11    
12             Copyright (c) 1997 University of Cambridge             Copyright (c) 1998 University of Cambridge
13    
14  -----------------------------------------------------------------------------  -----------------------------------------------------------------------------
15  Permission is granted to anyone to use this software for any purpose on any  Permission is granted to anyone to use this software for any purpose on any
# Line 49  the external pcre header. */ Line 49  the external pcre header. */
49  #include "internal.h"  #include "internal.h"
50    
51    
52    /* Allow compilation as C++ source code, should anybody want to do that. */
53    
54    #ifdef __cplusplus
55    #define class pcre_class
56    #endif
57    
58    
59  /* Min and max values for the common repeats; for the maxima, 0 => infinity */  /* Min and max values for the common repeats; for the maxima, 0 => infinity */
60    
61  static char rep_min[] = { 0, 0, 1, 1, 0, 0 };  static const char rep_min[] = { 0, 0, 1, 1, 0, 0 };
62  static char rep_max[] = { 0, 0, 0, 0, 1, 1 };  static const char rep_max[] = { 0, 0, 0, 0, 1, 1 };
63    
64  /* Text forms of OP_ values and things, for debugging (not all used) */  /* Text forms of OP_ values and things, for debugging (not all used) */
65    
# Line 76  are simple data values; negative values Line 83  are simple data values; negative values
83  on. Zero means further processing is needed (for things like \x), or the escape  on. Zero means further processing is needed (for things like \x), or the escape
84  is invalid. */  is invalid. */
85    
86  static short int escapes[] = {  static const short int escapes[] = {
87      0,      0,      0,      0,      0,      0,      0,      0,   /* 0 - 7 */      0,      0,      0,      0,      0,      0,      0,      0,   /* 0 - 7 */
88      0,      0,    ':',    ';',    '<',    '=',    '>',    '?',   /* 8 - ? */      0,      0,    ':',    ';',    '<',    '=',    '>',    '?',   /* 8 - ? */
89    '@', -ESC_A, -ESC_B,      0, -ESC_D,      0,      0,      0,   /* @ - G */    '@', -ESC_A, -ESC_B,      0, -ESC_D,      0,      0,      0,   /* @ - G */
# Line 1296  for (;; ptr++) Line 1303  for (;; ptr++)
1303      the next state. */      the next state. */
1304    
1305      previous[1] = length;      previous[1] = length;
1306      ptr--;      if (length < 255) ptr--;
1307      break;      break;
1308      }      }
1309    }                   /* end of big loop */    }                   /* end of big loop */
# Line 3450  ocount = offsetcount & (-2); Line 3457  ocount = offsetcount & (-2);
3457  if (re->top_backref > 0 && re->top_backref >= ocount/2)  if (re->top_backref > 0 && re->top_backref >= ocount/2)
3458    {    {
3459    ocount = re->top_backref * 2 + 2;    ocount = re->top_backref * 2 + 2;
3460    match_block.offset_vector = (pcre_malloc)(ocount * sizeof(int));    match_block.offset_vector = (int *)(pcre_malloc)(ocount * sizeof(int));
3461    if (match_block.offset_vector == NULL) return PCRE_ERROR_NOMEMORY;    if (match_block.offset_vector == NULL) return PCRE_ERROR_NOMEMORY;
3462    using_temporary_offsets = TRUE;    using_temporary_offsets = TRUE;
3463    DPRINTF(("Got memory to hold back references\n"));    DPRINTF(("Got memory to hold back references\n"));

Legend:
Removed from v.13  
changed lines
  Added in v.15

webmaster@exim.org
ViewVC Help
Powered by ViewVC 1.1.12