/[pcre]/code/trunk/doc/html/pcrecallout.html
ViewVC logotype

Diff of /code/trunk/doc/html/pcrecallout.html

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

revision 461 by ph10, Mon Oct 5 10:59:35 2009 UTC revision 691 by ph10, Sun Sep 11 14:31:21 2011 UTC
# Line 60  command has an option that sets automati Line 60  command has an option that sets automati
60  indicates how the pattern is matched. This is useful information when you are  indicates how the pattern is matched. This is useful information when you are
61  trying to optimize the performance of a particular pattern.  trying to optimize the performance of a particular pattern.
62  </P>  </P>
63    <P>
64    The use of callouts in a pattern makes it ineligible for optimization by the
65    just-in-time compiler. Studying such a pattern with the PCRE_STUDY_JIT_COMPILE
66    option always fails.
67    </P>
68  <br><a name="SEC2" href="#TOC1">MISSING CALLOUTS</a><br>  <br><a name="SEC2" href="#TOC1">MISSING CALLOUTS</a><br>
69  <P>  <P>
70  You should be aware that, because of optimizations in the way PCRE matches  You should be aware that, because of optimizations in the way PCRE matches
# Line 81  been scanned far enough. Line 86  been scanned far enough.
86  </P>  </P>
87  <P>  <P>
88  You can disable these optimizations by passing the PCRE_NO_START_OPTIMIZE  You can disable these optimizations by passing the PCRE_NO_START_OPTIMIZE
89  option to <b>pcre_exec()</b> or <b>pcre_dfa_exec()</b>. This slows down the  option to <b>pcre_compile()</b>, <b>pcre_exec()</b>, or <b>pcre_dfa_exec()</b>,
90  matching process, but does ensure that callouts such as the example above are  or by starting the pattern with (*NO_START_OPT). This slows down the matching
91  obeyed.  process, but does ensure that callouts such as the example above are obeyed.
92  </P>  </P>
93  <br><a name="SEC3" href="#TOC1">THE CALLOUT INTERFACE</a><br>  <br><a name="SEC3" href="#TOC1">THE CALLOUT INTERFACE</a><br>
94  <P>  <P>
# Line 93  the <b>pcre_exec()</b> and the <b>pcre_d Line 98  the <b>pcre_exec()</b> and the <b>pcre_d
98  only argument to the callout function is a pointer to a <b>pcre_callout</b>  only argument to the callout function is a pointer to a <b>pcre_callout</b>
99  block. This structure contains the following fields:  block. This structure contains the following fields:
100  <pre>  <pre>
101    int          <i>version</i>;    int         <i>version</i>;
102    int          <i>callout_number</i>;    int         <i>callout_number</i>;
103    int         *<i>offset_vector</i>;    int        *<i>offset_vector</i>;
104    const char  *<i>subject</i>;    const char *<i>subject</i>;
105    int          <i>subject_length</i>;    int         <i>subject_length</i>;
106    int          <i>start_match</i>;    int         <i>start_match</i>;
107    int          <i>current_position</i>;    int         <i>current_position</i>;
108    int          <i>capture_top</i>;    int         <i>capture_top</i>;
109    int          <i>capture_last</i>;    int         <i>capture_last</i>;
110    void        *<i>callout_data</i>;    void       *<i>callout_data</i>;
111    int          <i>pattern_position</i>;    int         <i>pattern_position</i>;
112    int          <i>next_item_length</i>;    int         <i>next_item_length</i>;
113      const unsigned char *<i>mark</i>;
114  </pre>  </pre>
115  The <i>version</i> field is an integer containing the version number of the  The <i>version</i> field is an integer containing the version number of the
116  block format. The initial version was 0; the current version is 1. The version  block format. The initial version was 0; the current version is 2. The version
117  number will change again in future if additional fields are added, but the  number will change again in future if additional fields are added, but the
118  intention is never to remove any of the existing fields.  intention is never to remove any of the existing fields.
119  </P>  </P>
# Line 180  The <i>pattern_position</i> and <i>next_ Line 186  The <i>pattern_position</i> and <i>next_
186  help in distinguishing between different automatic callouts, which all have the  help in distinguishing between different automatic callouts, which all have the
187  same callout number. However, they are set for all callouts.  same callout number. However, they are set for all callouts.
188  </P>  </P>
189    <P>
190    The <i>mark</i> field is present from version 2 of the <i>pcre_callout</i>
191    structure. In callouts from <b>pcre_exec()</b> it contains a pointer to the
192    zero-terminated name of the most recently passed (*MARK) item in the match, or
193    NULL if there are no (*MARK)s in the current matching path. In callouts from
194    <b>pcre_dfa_exec()</b> this field always contains NULL.
195    </P>
196  <br><a name="SEC4" href="#TOC1">RETURN VALUES</a><br>  <br><a name="SEC4" href="#TOC1">RETURN VALUES</a><br>
197  <P>  <P>
198  The external callout function returns an integer to PCRE. If the value is zero,  The external callout function returns an integer to PCRE. If the value is zero,
# Line 206  Cambridge CB2 3QH, England. Line 219  Cambridge CB2 3QH, England.
219  </P>  </P>
220  <br><a name="SEC6" href="#TOC1">REVISION</a><br>  <br><a name="SEC6" href="#TOC1">REVISION</a><br>
221  <P>  <P>
222  Last updated: 29 September 2009  Last updated: 26 August 2011
223  <br>  <br>
224  Copyright &copy; 1997-2009 University of Cambridge.  Copyright &copy; 1997-2011 University of Cambridge.
225  <br>  <br>
226  <p>  <p>
227  Return to the <a href="index.html">PCRE index page</a>.  Return to the <a href="index.html">PCRE index page</a>.

Legend:
Removed from v.461  
changed lines
  Added in v.691

  ViewVC Help
Powered by ViewVC 1.1.5