man-pages/man3/pcre2_callout_enumerate.3.html
2021-03-31 01:06:50 +01:00

84 lines
3.3 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Man page of PCRE2_COMPILE</TITLE>
</HEAD><BODY>
<H1>PCRE2_COMPILE</H1>
Section: C Library Functions (3)<BR>Updated: 23 March 2017<BR><A HREF="#index">Index</A>
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
<A NAME="lbAB">&nbsp;</A>
<H2>NAME</H2>
PCRE2 - Perl-compatible regular expressions (revised API)
<A NAME="lbAC">&nbsp;</A>
<H2>SYNOPSIS</H2>
<P>
<B>#include &lt;<A HREF="file:///usr/include/pcre2.h">pcre2.h</A>&gt;</B>
<P>
<PRE>
<B>int pcre2_callout_enumerate(const pcre2_code *</B><I>code</I>,
<B> int (*</B><I>callback</I>)(pcre2_callout_enumerate_block *, void *),
<B> void *</B><I>callout_data</I>);
</PRE>
<A NAME="lbAD">&nbsp;</A>
<H2>DESCRIPTION</H2>
<P>
This function scans a compiled regular expression and calls the <I>callback()</I>
function for each callout within the pattern. The yield of the function is zero
for success and non-zero otherwise. The arguments are:
<P>
<BR>&nbsp;&nbsp;<I>code</I>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Points&nbsp;to&nbsp;the&nbsp;compiled&nbsp;pattern
<BR>&nbsp;&nbsp;<I>callback</I>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;callback&nbsp;function
<BR>&nbsp;&nbsp;<I>callout_data</I>&nbsp;&nbsp;&nbsp;User&nbsp;data&nbsp;that&nbsp;is&nbsp;passed&nbsp;to&nbsp;the&nbsp;callback
<P>
The <I>callback()</I> function is passed a pointer to a data block containing
the following fields (not necessarily in this order):
<P>
<BR>&nbsp;&nbsp;uint32_t&nbsp;&nbsp;&nbsp;<I>version</I>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Block&nbsp;version&nbsp;number
<BR>&nbsp;&nbsp;uint32_t&nbsp;&nbsp;&nbsp;<I>callout_number</I>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Number&nbsp;for&nbsp;numbered&nbsp;callouts
<BR>&nbsp;&nbsp;PCRE2_SIZE&nbsp;<I>pattern_position</I>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Offset&nbsp;to&nbsp;next&nbsp;item&nbsp;in&nbsp;pattern
<BR>&nbsp;&nbsp;PCRE2_SIZE&nbsp;<I>next_item_length</I>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Length&nbsp;of&nbsp;next&nbsp;item&nbsp;in&nbsp;pattern
<BR>&nbsp;&nbsp;PCRE2_SIZE&nbsp;<I>callout_string_offset</I>&nbsp;&nbsp;Offset&nbsp;to&nbsp;string&nbsp;within&nbsp;pattern
<BR>&nbsp;&nbsp;PCRE2_SIZE&nbsp;<I>callout_string_length</I>&nbsp;&nbsp;Length&nbsp;of&nbsp;callout&nbsp;string
<BR>&nbsp;&nbsp;PCRE2_SPTR&nbsp;<I>callout_string</I>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Points&nbsp;to&nbsp;callout&nbsp;string&nbsp;or&nbsp;is&nbsp;NULL
<P>
The second argument passed to the <B>callback()</B> function is the callout data
that was passed to <B>pcre2_callout_enumerate()</B>. The <B>callback()</B>
function must return zero for success. Any other value causes the pattern scan
to stop, with the value being passed back as the result of
<B>pcre2_callout_enumerate()</B>.
<P>
There is a complete description of the PCRE2 native API in the
<B>pcre2api</B>
page and a description of the POSIX API in the
<B>pcre2posix</B>
page.
<P>
<HR>
<A NAME="index">&nbsp;</A><H2>Index</H2>
<DL>
<DT id="1"><A HREF="#lbAB">NAME</A><DD>
<DT id="2"><A HREF="#lbAC">SYNOPSIS</A><DD>
<DT id="3"><A HREF="#lbAD">DESCRIPTION</A><DD>
</DL>
<HR>
This document was created by
<A HREF="/cgi-bin/man/man2html">man2html</A>,
using the manual pages.<BR>
Time: 00:05:49 GMT, March 31, 2021
</BODY>
</HTML>