[pcre-dev] [Bug 820] New: USing pcre_callout

トップ ページ
このメッセージを削除
著者: Jing Lan
日付:  
To: pcre-dev
題目: [pcre-dev] [Bug 820] New: USing pcre_callout
------- You are receiving this mail because: -------
You are on the CC list for the bug.

http://bugs.exim.org/show_bug.cgi?id=820
           Summary: USing pcre_callout
           Product: PCRE
           Version: 7.8
          Platform: x86-64
        OS/Version: Linux
            Status: NEW
          Severity: wishlist
          Priority: high
         Component: Code
        AssignedTo: ph10@???
        ReportedBy: lan@???
                CC: pcre-dev@???



Hi,

I am new on PCRE. I am trying to use pcre_callout. In pcre_exec.c callout part,
I add some code like following. Could you please help me validate my patch
and/or give me any comments? Many thanks.


    case OP_CALLOUT:
    if (pcre_callout != NULL)
      {
      rrc = 1; //new
      pcre_callout_block cb;
      cb.version          = 1;
      cb.callout_number   = ecode[1];
      cb.offset_vector    = md->offset_vector;
      cb.subject          = (PCRE_SPTR)md->start_subject;
      cb.subject_length   = md->end_subject - md->start_subject;
      cb.start_match      = mstart - md->start_subject;
      cb.current_position = eptr - md->start_subject;
      cb.pattern_position = GET(ecode, 2);
      cb.next_item_length = GET(ecode, 2 + LINK_SIZE);
      cb.capture_top      = offset_top/2;
      cb.capture_last     = md->capture_last;
      cb.callout_data     = md->callout_data;
      if ((rrc = (*pcre_callout)(&cb)) > 0) RRETURN(MATCH_NOMATCH);
      if (rrc < 0) RRETURN(rrc);
      else if(rrc == 0) { //new
        md->end_offset_top=offset_top; //new
        md->end_match_ptr = md->start_subject + cb.capture_last; //new
        RRETURN(MATCH_MATCH); //new
        } //new
      } //new
    ecode += 2 + 2*LINK_SIZE;
    break;



--
Configure bugmail: http://bugs.exim.org/userprefs.cgi?tab=email