version 1.1.1.2, 2012/10/09 09:19:17
|
version 1.1.1.4, 2014/06/15 19:46:05
|
Line 42 man page, in case the conversion went wrong.
|
Line 42 man page, in case the conversion went wrong.
|
<br><a name="SEC1" href="#TOC1">PCRE 16-BIT API BASIC FUNCTIONS</a><br> |
<br><a name="SEC1" href="#TOC1">PCRE 16-BIT API BASIC FUNCTIONS</a><br> |
<P> |
<P> |
<b>pcre16 *pcre16_compile(PCRE_SPTR16 <i>pattern</i>, int <i>options</i>,</b> |
<b>pcre16 *pcre16_compile(PCRE_SPTR16 <i>pattern</i>, int <i>options</i>,</b> |
<b>const char **<i>errptr</i>, int *<i>erroffset</i>,</b> | <b> const char **<i>errptr</i>, int *<i>erroffset</i>,</b> |
<b>const unsigned char *<i>tableptr</i>);</b> | <b> const unsigned char *<i>tableptr</i>);</b> |
</P> | <br> |
<P> | <br> |
<b>pcre16 *pcre16_compile2(PCRE_SPTR16 <i>pattern</i>, int <i>options</i>,</b> |
<b>pcre16 *pcre16_compile2(PCRE_SPTR16 <i>pattern</i>, int <i>options</i>,</b> |
<b>int *<i>errorcodeptr</i>,</b> | <b> int *<i>errorcodeptr</i>,</b> |
<b>const char **<i>errptr</i>, int *<i>erroffset</i>,</b> | <b> const char **<i>errptr</i>, int *<i>erroffset</i>,</b> |
<b>const unsigned char *<i>tableptr</i>);</b> | <b> const unsigned char *<i>tableptr</i>);</b> |
</P> | <br> |
<P> | <br> |
<b>pcre16_extra *pcre16_study(const pcre16 *<i>code</i>, int <i>options</i>,</b> |
<b>pcre16_extra *pcre16_study(const pcre16 *<i>code</i>, int <i>options</i>,</b> |
<b>const char **<i>errptr</i>);</b> | <b> const char **<i>errptr</i>);</b> |
</P> | <br> |
<P> | <br> |
<b>void pcre16_free_study(pcre16_extra *<i>extra</i>);</b> |
<b>void pcre16_free_study(pcre16_extra *<i>extra</i>);</b> |
</P> | <br> |
<P> | <br> |
<b>int pcre16_exec(const pcre16 *<i>code</i>, const pcre16_extra *<i>extra</i>,</b> |
<b>int pcre16_exec(const pcre16 *<i>code</i>, const pcre16_extra *<i>extra</i>,</b> |
<b>PCRE_SPTR16 <i>subject</i>, int <i>length</i>, int <i>startoffset</i>,</b> | <b> PCRE_SPTR16 <i>subject</i>, int <i>length</i>, int <i>startoffset</i>,</b> |
<b>int <i>options</i>, int *<i>ovector</i>, int <i>ovecsize</i>);</b> | <b> int <i>options</i>, int *<i>ovector</i>, int <i>ovecsize</i>);</b> |
</P> | <br> |
<P> | <br> |
<b>int pcre16_dfa_exec(const pcre16 *<i>code</i>, const pcre16_extra *<i>extra</i>,</b> |
<b>int pcre16_dfa_exec(const pcre16 *<i>code</i>, const pcre16_extra *<i>extra</i>,</b> |
<b>PCRE_SPTR16 <i>subject</i>, int <i>length</i>, int <i>startoffset</i>,</b> | <b> PCRE_SPTR16 <i>subject</i>, int <i>length</i>, int <i>startoffset</i>,</b> |
<b>int <i>options</i>, int *<i>ovector</i>, int <i>ovecsize</i>,</b> | <b> int <i>options</i>, int *<i>ovector</i>, int <i>ovecsize</i>,</b> |
<b>int *<i>workspace</i>, int <i>wscount</i>);</b> | <b> int *<i>workspace</i>, int <i>wscount</i>);</b> |
</P> |
</P> |
<br><a name="SEC2" href="#TOC1">PCRE 16-BIT API STRING EXTRACTION FUNCTIONS</a><br> |
<br><a name="SEC2" href="#TOC1">PCRE 16-BIT API STRING EXTRACTION FUNCTIONS</a><br> |
<P> |
<P> |
<b>int pcre16_copy_named_substring(const pcre16 *<i>code</i>,</b> |
<b>int pcre16_copy_named_substring(const pcre16 *<i>code</i>,</b> |
<b>PCRE_SPTR16 <i>subject</i>, int *<i>ovector</i>,</b> | <b> PCRE_SPTR16 <i>subject</i>, int *<i>ovector</i>,</b> |
<b>int <i>stringcount</i>, PCRE_SPTR16 <i>stringname</i>,</b> | <b> int <i>stringcount</i>, PCRE_SPTR16 <i>stringname</i>,</b> |
<b>PCRE_UCHAR16 *<i>buffer</i>, int <i>buffersize</i>);</b> | <b> PCRE_UCHAR16 *<i>buffer</i>, int <i>buffersize</i>);</b> |
</P> | <br> |
<P> | <br> |
<b>int pcre16_copy_substring(PCRE_SPTR16 <i>subject</i>, int *<i>ovector</i>,</b> |
<b>int pcre16_copy_substring(PCRE_SPTR16 <i>subject</i>, int *<i>ovector</i>,</b> |
<b>int <i>stringcount</i>, int <i>stringnumber</i>, PCRE_UCHAR16 *<i>buffer</i>,</b> | <b> int <i>stringcount</i>, int <i>stringnumber</i>, PCRE_UCHAR16 *<i>buffer</i>,</b> |
<b>int <i>buffersize</i>);</b> | <b> int <i>buffersize</i>);</b> |
</P> | <br> |
<P> | <br> |
<b>int pcre16_get_named_substring(const pcre16 *<i>code</i>,</b> |
<b>int pcre16_get_named_substring(const pcre16 *<i>code</i>,</b> |
<b>PCRE_SPTR16 <i>subject</i>, int *<i>ovector</i>,</b> | <b> PCRE_SPTR16 <i>subject</i>, int *<i>ovector</i>,</b> |
<b>int <i>stringcount</i>, PCRE_SPTR16 <i>stringname</i>,</b> | <b> int <i>stringcount</i>, PCRE_SPTR16 <i>stringname</i>,</b> |
<b>PCRE_SPTR16 *<i>stringptr</i>);</b> | <b> PCRE_SPTR16 *<i>stringptr</i>);</b> |
</P> | <br> |
<P> | <br> |
<b>int pcre16_get_stringnumber(const pcre16 *<i>code</i>,</b> |
<b>int pcre16_get_stringnumber(const pcre16 *<i>code</i>,</b> |
<b>PCRE_SPTR16 <i>name</i>);</b> | <b>" PCRE_SPTR16 <i>name</i>);</b> |
</P> | <br> |
<P> | <br> |
<b>int pcre16_get_stringtable_entries(const pcre16 *<i>code</i>,</b> |
<b>int pcre16_get_stringtable_entries(const pcre16 *<i>code</i>,</b> |
<b>PCRE_SPTR16 <i>name</i>, PCRE_UCHAR16 **<i>first</i>, PCRE_UCHAR16 **<i>last</i>);</b> | <b> PCRE_SPTR16 <i>name</i>, PCRE_UCHAR16 **<i>first</i>, PCRE_UCHAR16 **<i>last</i>);</b> |
</P> | <br> |
<P> | <br> |
<b>int pcre16_get_substring(PCRE_SPTR16 <i>subject</i>, int *<i>ovector</i>,</b> |
<b>int pcre16_get_substring(PCRE_SPTR16 <i>subject</i>, int *<i>ovector</i>,</b> |
<b>int <i>stringcount</i>, int <i>stringnumber</i>,</b> | <b> int <i>stringcount</i>, int <i>stringnumber</i>,</b> |
<b>PCRE_SPTR16 *<i>stringptr</i>);</b> | <b> PCRE_SPTR16 *<i>stringptr</i>);</b> |
</P> | <br> |
<P> | <br> |
<b>int pcre16_get_substring_list(PCRE_SPTR16 <i>subject</i>,</b> |
<b>int pcre16_get_substring_list(PCRE_SPTR16 <i>subject</i>,</b> |
<b>int *<i>ovector</i>, int <i>stringcount</i>, PCRE_SPTR16 **<i>listptr</i>);</b> | <b> int *<i>ovector</i>, int <i>stringcount</i>, PCRE_SPTR16 **<i>listptr</i>);</b> |
</P> | <br> |
<P> | <br> |
<b>void pcre16_free_substring(PCRE_SPTR16 <i>stringptr</i>);</b> |
<b>void pcre16_free_substring(PCRE_SPTR16 <i>stringptr</i>);</b> |
</P> | <br> |
<P> | <br> |
<b>void pcre16_free_substring_list(PCRE_SPTR16 *<i>stringptr</i>);</b> |
<b>void pcre16_free_substring_list(PCRE_SPTR16 *<i>stringptr</i>);</b> |
</P> |
</P> |
<br><a name="SEC3" href="#TOC1">PCRE 16-BIT API AUXILIARY FUNCTIONS</a><br> |
<br><a name="SEC3" href="#TOC1">PCRE 16-BIT API AUXILIARY FUNCTIONS</a><br> |
<P> |
<P> |
<b>pcre16_jit_stack *pcre16_jit_stack_alloc(int <i>startsize</i>, int <i>maxsize</i>);</b> |
<b>pcre16_jit_stack *pcre16_jit_stack_alloc(int <i>startsize</i>, int <i>maxsize</i>);</b> |
</P> | <br> |
<P> | <br> |
<b>void pcre16_jit_stack_free(pcre16_jit_stack *<i>stack</i>);</b> |
<b>void pcre16_jit_stack_free(pcre16_jit_stack *<i>stack</i>);</b> |
</P> | <br> |
<P> | <br> |
<b>void pcre16_assign_jit_stack(pcre16_extra *<i>extra</i>,</b> |
<b>void pcre16_assign_jit_stack(pcre16_extra *<i>extra</i>,</b> |
<b>pcre16_jit_callback <i>callback</i>, void *<i>data</i>);</b> | <b> pcre16_jit_callback <i>callback</i>, void *<i>data</i>);</b> |
</P> | <br> |
<P> | <br> |
<b>const unsigned char *pcre16_maketables(void);</b> |
<b>const unsigned char *pcre16_maketables(void);</b> |
</P> | <br> |
<P> | <br> |
<b>int pcre16_fullinfo(const pcre16 *<i>code</i>, const pcre16_extra *<i>extra</i>,</b> |
<b>int pcre16_fullinfo(const pcre16 *<i>code</i>, const pcre16_extra *<i>extra</i>,</b> |
<b>int <i>what</i>, void *<i>where</i>);</b> | <b> int <i>what</i>, void *<i>where</i>);</b> |
</P> | <br> |
<P> | <br> |
<b>int pcre16_refcount(pcre16 *<i>code</i>, int <i>adjust</i>);</b> |
<b>int pcre16_refcount(pcre16 *<i>code</i>, int <i>adjust</i>);</b> |
</P> | <br> |
<P> | <br> |
<b>int pcre16_config(int <i>what</i>, void *<i>where</i>);</b> |
<b>int pcre16_config(int <i>what</i>, void *<i>where</i>);</b> |
</P> | <br> |
<P> | <br> |
<b>const char *pcre16_version(void);</b> |
<b>const char *pcre16_version(void);</b> |
</P> | <br> |
<P> | <br> |
<b>int pcre16_pattern_to_host_byte_order(pcre16 *<i>code</i>,</b> |
<b>int pcre16_pattern_to_host_byte_order(pcre16 *<i>code</i>,</b> |
<b>pcre16_extra *<i>extra</i>, const unsigned char *<i>tables</i>);</b> | <b> pcre16_extra *<i>extra</i>, const unsigned char *<i>tables</i>);</b> |
</P> |
</P> |
<br><a name="SEC4" href="#TOC1">PCRE 16-BIT API INDIRECTED FUNCTIONS</a><br> |
<br><a name="SEC4" href="#TOC1">PCRE 16-BIT API INDIRECTED FUNCTIONS</a><br> |
<P> |
<P> |
<b>void *(*pcre16_malloc)(size_t);</b> |
<b>void *(*pcre16_malloc)(size_t);</b> |
</P> | <br> |
<P> | <br> |
<b>void (*pcre16_free)(void *);</b> |
<b>void (*pcre16_free)(void *);</b> |
</P> | <br> |
<P> | <br> |
<b>void *(*pcre16_stack_malloc)(size_t);</b> |
<b>void *(*pcre16_stack_malloc)(size_t);</b> |
</P> | <br> |
<P> | <br> |
<b>void (*pcre16_stack_free)(void *);</b> |
<b>void (*pcre16_stack_free)(void *);</b> |
</P> | <br> |
<P> | <br> |
<b>int (*pcre16_callout)(pcre16_callout_block *);</b> |
<b>int (*pcre16_callout)(pcre16_callout_block *);</b> |
</P> |
</P> |
<br><a name="SEC5" href="#TOC1">PCRE 16-BIT API 16-BIT-ONLY FUNCTION</a><br> |
<br><a name="SEC5" href="#TOC1">PCRE 16-BIT API 16-BIT-ONLY FUNCTION</a><br> |
<P> |
<P> |
<b>int pcre16_utf16_to_host_byte_order(PCRE_UCHAR16 *<i>output</i>,</b> |
<b>int pcre16_utf16_to_host_byte_order(PCRE_UCHAR16 *<i>output</i>,</b> |
<b>PCRE_SPTR16 <i>input</i>, int <i>length</i>, int *<i>byte_order</i>,</b> | <b> PCRE_SPTR16 <i>input</i>, int <i>length</i>, int *<i>byte_order</i>,</b> |
<b>int <i>keep_boms</i>);</b> | <b> int <i>keep_boms</i>);</b> |
</P> |
</P> |
<br><a name="SEC6" href="#TOC1">THE PCRE 16-BIT LIBRARY</a><br> |
<br><a name="SEC6" href="#TOC1">THE PCRE 16-BIT LIBRARY</a><br> |
<P> |
<P> |
Line 187 library. For example, if you want to study a pattern t
|
Line 187 library. For example, if you want to study a pattern t
|
<br><a name="SEC7" href="#TOC1">THE HEADER FILE</a><br> |
<br><a name="SEC7" href="#TOC1">THE HEADER FILE</a><br> |
<P> |
<P> |
There is only one header file, <b>pcre.h</b>. It contains prototypes for all the |
There is only one header file, <b>pcre.h</b>. It contains prototypes for all the |
functions in both libraries, as well as definitions of flags, structures, error | functions in all libraries, as well as definitions of flags, structures, error |
codes, etc. |
codes, etc. |
</P> |
</P> |
<br><a name="SEC8" href="#TOC1">THE LIBRARY NAME</a><br> |
<br><a name="SEC8" href="#TOC1">THE LIBRARY NAME</a><br> |
Line 203 of bytes with the C type "char *". In the 16-bit libra
|
Line 203 of bytes with the C type "char *". In the 16-bit libra
|
vectors of unsigned 16-bit quantities. The macro PCRE_UCHAR16 specifies an |
vectors of unsigned 16-bit quantities. The macro PCRE_UCHAR16 specifies an |
appropriate data type, and PCRE_SPTR16 is defined as "const PCRE_UCHAR16 *". In |
appropriate data type, and PCRE_SPTR16 is defined as "const PCRE_UCHAR16 *". In |
very many environments, "short int" is a 16-bit data type. When PCRE is built, |
very many environments, "short int" is a 16-bit data type. When PCRE is built, |
it defines PCRE_UCHAR16 as "short int", but checks that it really is a 16-bit | it defines PCRE_UCHAR16 as "unsigned short int", but checks that it really is a |
data type. If it is not, the build fails with an error message telling the | 16-bit data type. If it is not, the build fails with an error message telling |
maintainer to modify the definition appropriately. | the maintainer to modify the definition appropriately. |
</P> |
</P> |
<br><a name="SEC10" href="#TOC1">STRUCTURE TYPES</a><br> |
<br><a name="SEC10" href="#TOC1">STRUCTURE TYPES</a><br> |
<P> |
<P> |
Line 259 buffer, including the zero terminator if the string wa
|
Line 259 buffer, including the zero terminator if the string wa
|
</P> |
</P> |
<br><a name="SEC12" href="#TOC1">SUBJECT STRING OFFSETS</a><br> |
<br><a name="SEC12" href="#TOC1">SUBJECT STRING OFFSETS</a><br> |
<P> |
<P> |
The offsets within subject strings that are returned by the matching functions | The lengths and starting offsets of subject strings must be specified in 16-bit |
are in 16-bit units rather than bytes. | data units, and the offsets within subject strings that are returned by the |
| matching functions are in also 16-bit units rather than bytes. |
</P> |
</P> |
<br><a name="SEC13" href="#TOC1">NAMED SUBPATTERNS</a><br> |
<br><a name="SEC13" href="#TOC1">NAMED SUBPATTERNS</a><br> |
<P> |
<P> |
Line 283 page.
|
Line 284 page.
|
<P> |
<P> |
For the <b>pcre16_config()</b> function there is an option PCRE_CONFIG_UTF16 |
For the <b>pcre16_config()</b> function there is an option PCRE_CONFIG_UTF16 |
that returns 1 if UTF-16 support is configured, otherwise 0. If this option is |
that returns 1 if UTF-16 support is configured, otherwise 0. If this option is |
given to <b>pcre_config()</b>, or if the PCRE_CONFIG_UTF8 option is given to | given to <b>pcre_config()</b> or <b>pcre32_config()</b>, or if the |
<b>pcre16_config()</b>, the result is the PCRE_ERROR_BADOPTION error. | PCRE_CONFIG_UTF8 or PCRE_CONFIG_UTF32 option is given to <b>pcre16_config()</b>, |
| the result is the PCRE_ERROR_BADOPTION error. |
</P> |
</P> |
<br><a name="SEC15" href="#TOC1">CHARACTER CODES</a><br> |
<br><a name="SEC15" href="#TOC1">CHARACTER CODES</a><br> |
<P> |
<P> |
Line 327 page. The UTF-16 errors are:
|
Line 329 page. The UTF-16 errors are:
|
PCRE_UTF16_ERR1 Missing low surrogate at end of string |
PCRE_UTF16_ERR1 Missing low surrogate at end of string |
PCRE_UTF16_ERR2 Invalid low surrogate follows high surrogate |
PCRE_UTF16_ERR2 Invalid low surrogate follows high surrogate |
PCRE_UTF16_ERR3 Isolated low surrogate |
PCRE_UTF16_ERR3 Isolated low surrogate |
PCRE_UTF16_ERR4 Invalid character 0xfffe | PCRE_UTF16_ERR4 Non-character |
</PRE> |
</PRE> |
</P> |
</P> |
<br><a name="SEC17" href="#TOC1">ERROR TEXTS</a><br> |
<br><a name="SEC17" href="#TOC1">ERROR TEXTS</a><br> |
Line 348 files, but it can be used for testing the 16-bit libra
|
Line 350 files, but it can be used for testing the 16-bit libra
|
command line option <b>-16</b>, patterns and subject strings are converted from |
command line option <b>-16</b>, patterns and subject strings are converted from |
8-bit to 16-bit before being passed to PCRE, and the 16-bit library functions |
8-bit to 16-bit before being passed to PCRE, and the 16-bit library functions |
are used instead of the 8-bit ones. Returned 16-bit strings are converted to |
are used instead of the 8-bit ones. Returned 16-bit strings are converted to |
8-bit for output. If the 8-bit library was not compiled, <b>pcretest</b> | 8-bit for output. If both the 8-bit and the 32-bit libraries were not compiled, |
defaults to 16-bit and the <b>-16</b> option is ignored. | <b>pcretest</b> defaults to 16-bit and the <b>-16</b> option is ignored. |
</P> |
</P> |
<P> |
<P> |
When PCRE is being built, the <b>RunTest</b> script that is called by "make |
When PCRE is being built, the <b>RunTest</b> script that is called by "make |
check" uses the <b>pcretest</b> <b>-C</b> option to discover which of the 8-bit | check" uses the <b>pcretest</b> <b>-C</b> option to discover which of the 8-bit, |
and 16-bit libraries has been built, and runs the tests appropriately. | 16-bit and 32-bit libraries has been built, and runs the tests appropriately. |
</P> |
</P> |
<br><a name="SEC20" href="#TOC1">NOT SUPPORTED IN 16-BIT MODE</a><br> |
<br><a name="SEC20" href="#TOC1">NOT SUPPORTED IN 16-BIT MODE</a><br> |
<P> |
<P> |
Line 373 Cambridge CB2 3QH, England.
|
Line 375 Cambridge CB2 3QH, England.
|
</P> |
</P> |
<br><a name="SEC22" href="#TOC1">REVISION</a><br> |
<br><a name="SEC22" href="#TOC1">REVISION</a><br> |
<P> |
<P> |
Last updated: 14 April 2012 | Last updated: 12 May 2013 |
<br> |
<br> |
Copyright © 1997-2012 University of Cambridge. | Copyright © 1997-2013 University of Cambridge. |
<br> |
<br> |
<p> |
<p> |
Return to the <a href="index.html">PCRE index page</a>. |
Return to the <a href="index.html">PCRE index page</a>. |