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

Diff of /code/trunk/pcre_dfa_exec.c

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

revision 836 by ph10, Wed Dec 28 17:16:11 2011 UTC revision 904 by ph10, Mon Jan 23 17:30:49 2012 UTC
# Line 2553  for (;;) Line 2553  for (;;)
2553            rrc = 0;            rrc = 0;
2554            if (PUBL(callout) != NULL)            if (PUBL(callout) != NULL)
2555              {              {
2556              pcre_callout_block cb;              PUBL(callout_block) cb;
2557              cb.version          = 1;   /* Version 1 of the callout block */              cb.version          = 1;   /* Version 1 of the callout block */
2558              cb.callout_number   = code[LINK_SIZE+2];              cb.callout_number   = code[LINK_SIZE+2];
2559              cb.offset_vector    = offsets;              cb.offset_vector    = offsets;
2560    #ifdef COMPILE_PCRE8
2561              cb.subject          = (PCRE_SPTR)start_subject;              cb.subject          = (PCRE_SPTR)start_subject;
2562    #else
2563                cb.subject          = (PCRE_SPTR16)start_subject;
2564    #endif
2565              cb.subject_length   = (int)(end_subject - start_subject);              cb.subject_length   = (int)(end_subject - start_subject);
2566              cb.start_match      = (int)(current_subject - start_subject);              cb.start_match      = (int)(current_subject - start_subject);
2567              cb.current_position = (int)(ptr - start_subject);              cb.current_position = (int)(ptr - start_subject);
# Line 2686  for (;;) Line 2690  for (;;)
2690            {            {
2691            for (rc = rc*2 - 2; rc >= 0; rc -= 2)            for (rc = rc*2 - 2; rc >= 0; rc -= 2)
2692              {              {
             const pcre_uchar *p = start_subject + local_offsets[rc];  
             const pcre_uchar *pp = start_subject + local_offsets[rc+1];  
2693              int charcount = local_offsets[rc+1] - local_offsets[rc];              int charcount = local_offsets[rc+1] - local_offsets[rc];
2694  #ifdef SUPPORT_UTF  #ifdef SUPPORT_UTF
2695                const pcre_uchar *p = start_subject + local_offsets[rc];
2696                const pcre_uchar *pp = start_subject + local_offsets[rc+1];
2697              while (p < pp) if (NOT_FIRSTCHAR(*p++)) charcount--;              while (p < pp) if (NOT_FIRSTCHAR(*p++)) charcount--;
2698  #endif  #endif
2699              if (charcount > 0)              if (charcount > 0)
# Line 2892  for (;;) Line 2896  for (;;)
2896        rrc = 0;        rrc = 0;
2897        if (PUBL(callout) != NULL)        if (PUBL(callout) != NULL)
2898          {          {
2899          pcre_callout_block cb;          PUBL(callout_block) cb;
2900          cb.version          = 1;   /* Version 1 of the callout block */          cb.version          = 1;   /* Version 1 of the callout block */
2901          cb.callout_number   = code[1];          cb.callout_number   = code[1];
2902          cb.offset_vector    = offsets;          cb.offset_vector    = offsets;
2903    #ifdef COMPILE_PCRE8
2904          cb.subject          = (PCRE_SPTR)start_subject;          cb.subject          = (PCRE_SPTR)start_subject;
2905    #else
2906            cb.subject          = (PCRE_SPTR16)start_subject;
2907    #endif
2908          cb.subject_length   = (int)(end_subject - start_subject);          cb.subject_length   = (int)(end_subject - start_subject);
2909          cb.start_match      = (int)(current_subject - start_subject);          cb.start_match      = (int)(current_subject - start_subject);
2910          cb.current_position = (int)(ptr - start_subject);          cb.current_position = (int)(ptr - start_subject);
# Line 3013  pcre_dfa_exec(const pcre *argument_re, c Line 3021  pcre_dfa_exec(const pcre *argument_re, c
3021    int offsetcount, int *workspace, int wscount)    int offsetcount, int *workspace, int wscount)
3022  #else  #else
3023  PCRE_EXP_DEFN int PCRE_CALL_CONVENTION  PCRE_EXP_DEFN int PCRE_CALL_CONVENTION
3024  pcre16_dfa_exec(const pcre *argument_re, const pcre_extra *extra_data,  pcre16_dfa_exec(const pcre16 *argument_re, const pcre16_extra *extra_data,
3025    PCRE_SPTR16 subject, int length, int start_offset, int options, int *offsets,    PCRE_SPTR16 subject, int length, int start_offset, int options, int *offsets,
3026    int offsetcount, int *workspace, int wscount)    int offsetcount, int *workspace, int wscount)
3027  #endif  #endif
3028  {  {
3029  real_pcre *re = (real_pcre *)argument_re;  REAL_PCRE *re = (REAL_PCRE *)argument_re;
3030  dfa_match_data match_block;  dfa_match_data match_block;
3031  dfa_match_data *md = &match_block;  dfa_match_data *md = &match_block;
3032  BOOL utf, anchored, startline, firstline;  BOOL utf, anchored, startline, firstline;
3033  const pcre_uchar *current_subject, *end_subject;  const pcre_uchar *current_subject, *end_subject;
 const pcre_uint8 *lcc;  
   
3034  const pcre_study_data *study = NULL;  const pcre_study_data *study = NULL;
3035    
3036  const pcre_uchar *req_char_ptr;  const pcre_uchar *req_char_ptr;
# Line 3186  in other programs later. */ Line 3192  in other programs later. */
3192    
3193  if (md->tables == NULL) md->tables = PRIV(default_tables);  if (md->tables == NULL) md->tables = PRIV(default_tables);
3194    
3195  /* The lower casing table and the "must be at the start of a line" flag are  /* The "must be at the start of a line" flags are used in a loop when finding
3196  used in a loop when finding where to start. */  where to start. */
3197    
 lcc = md->tables + lcc_offset;  
3198  startline = (re->flags & PCRE_STARTLINE) != 0;  startline = (re->flags & PCRE_STARTLINE) != 0;
3199  firstline = (re->options & PCRE_FIRSTLINE) != 0;  firstline = (re->options & PCRE_FIRSTLINE) != 0;
3200    
# Line 3204  if (!anchored) Line 3209  if (!anchored)
3209    if ((re->flags & PCRE_FIRSTSET) != 0)    if ((re->flags & PCRE_FIRSTSET) != 0)
3210      {      {
3211      has_first_char = TRUE;      has_first_char = TRUE;
3212      first_char = first_char2 = re->first_char;      first_char = first_char2 = (pcre_uchar)(re->first_char);
3213      if ((re->flags & PCRE_FCH_CASELESS) != 0)      if ((re->flags & PCRE_FCH_CASELESS) != 0)
3214        {        {
3215        first_char2 = TABLE_GET(first_char, md->tables + fcc_offset, first_char);        first_char2 = TABLE_GET(first_char, md->tables + fcc_offset, first_char);
# Line 3228  character" set. */ Line 3233  character" set. */
3233  if ((re->flags & PCRE_REQCHSET) != 0)  if ((re->flags & PCRE_REQCHSET) != 0)
3234    {    {
3235    has_req_char = TRUE;    has_req_char = TRUE;
3236    req_char = req_char2 = re->req_char;    req_char = req_char2 = (pcre_uchar)(re->req_char);
3237    if ((re->flags & PCRE_RCH_CASELESS) != 0)    if ((re->flags & PCRE_RCH_CASELESS) != 0)
3238      {      {
3239      req_char2 = TABLE_GET(req_char, md->tables + fcc_offset, req_char);      req_char2 = TABLE_GET(req_char, md->tables + fcc_offset, req_char);

Legend:
Removed from v.836  
changed lines
  Added in v.904

  ViewVC Help
Powered by ViewVC 1.1.5