2014-02-28 10:40:55 +01:00
|
|
|
/*************************************************
|
|
|
|
* Perl-Compatible Regular Expressions *
|
|
|
|
*************************************************/
|
|
|
|
|
|
|
|
/* This is the public header file for the PCRE library, second API, to be
|
|
|
|
#included by applications that call PCRE2 functions.
|
|
|
|
|
2017-03-12 14:47:01 +01:00
|
|
|
Copyright (c) 2016-2017 University of Cambridge
|
2014-02-28 10:40:55 +01:00
|
|
|
|
|
|
|
-----------------------------------------------------------------------------
|
|
|
|
Redistribution and use in source and binary forms, with or without
|
|
|
|
modification, are permitted provided that the following conditions are met:
|
|
|
|
|
|
|
|
* Redistributions of source code must retain the above copyright notice,
|
|
|
|
this list of conditions and the following disclaimer.
|
|
|
|
|
|
|
|
* Redistributions in binary form must reproduce the above copyright
|
|
|
|
notice, this list of conditions and the following disclaimer in the
|
|
|
|
documentation and/or other materials provided with the distribution.
|
|
|
|
|
|
|
|
* Neither the name of the University of Cambridge nor the names of its
|
|
|
|
contributors may be used to endorse or promote products derived from
|
|
|
|
this software without specific prior written permission.
|
|
|
|
|
|
|
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
|
|
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
|
|
|
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
|
|
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
|
|
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
|
|
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
|
|
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
|
|
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
|
|
POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
-----------------------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
|
2016-11-20 13:46:11 +01:00
|
|
|
#ifndef PCRE2_H_IDEMPOTENT_GUARD
|
|
|
|
#define PCRE2_H_IDEMPOTENT_GUARD
|
2014-02-28 10:40:55 +01:00
|
|
|
|
|
|
|
/* The current PCRE version information. */
|
|
|
|
|
|
|
|
#define PCRE2_MAJOR @PCRE2_MAJOR@
|
|
|
|
#define PCRE2_MINOR @PCRE2_MINOR@
|
|
|
|
#define PCRE2_PRERELEASE @PCRE2_PRERELEASE@
|
|
|
|
#define PCRE2_DATE @PCRE2_DATE@
|
|
|
|
|
|
|
|
/* When an application links to a PCRE DLL in Windows, the symbols that are
|
2014-06-24 17:30:10 +02:00
|
|
|
imported have to be identified as such. When building PCRE2, the appropriate
|
2014-02-28 10:40:55 +01:00
|
|
|
export setting is defined in pcre2_internal.h, which includes this file. So we
|
|
|
|
don't change existing definitions of PCRE2_EXP_DECL. */
|
|
|
|
|
|
|
|
#if defined(_WIN32) && !defined(PCRE2_STATIC)
|
|
|
|
# ifndef PCRE2_EXP_DECL
|
|
|
|
# define PCRE2_EXP_DECL extern __declspec(dllimport)
|
|
|
|
# endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* By default, we use the standard "extern" declarations. */
|
|
|
|
|
|
|
|
#ifndef PCRE2_EXP_DECL
|
|
|
|
# ifdef __cplusplus
|
|
|
|
# define PCRE2_EXP_DECL extern "C"
|
|
|
|
# else
|
|
|
|
# define PCRE2_EXP_DECL extern
|
|
|
|
# endif
|
|
|
|
#endif
|
|
|
|
|
2016-11-19 13:46:24 +01:00
|
|
|
/* When compiling with the MSVC compiler, it is sometimes necessary to include
|
|
|
|
a "calling convention" before exported function names. (This is secondhand
|
|
|
|
information; I know nothing about MSVC myself). For example, something like
|
|
|
|
|
|
|
|
void __cdecl function(....)
|
|
|
|
|
|
|
|
might be needed. In order so make this easy, all the exported functions have
|
|
|
|
PCRE2_CALL_CONVENTION just before their names. It is rarely needed; if not
|
|
|
|
set, we ensure here that it has no effect. */
|
|
|
|
|
|
|
|
#ifndef PCRE2_CALL_CONVENTION
|
|
|
|
#define PCRE2_CALL_CONVENTION
|
|
|
|
#endif
|
|
|
|
|
2014-07-15 10:46:12 +02:00
|
|
|
/* Have to include limits.h, stdlib.h and stdint.h to ensure that size_t and
|
|
|
|
uint8_t, UCHAR_MAX, etc are defined. */
|
2014-02-28 10:40:55 +01:00
|
|
|
|
2014-07-15 10:46:12 +02:00
|
|
|
#include <limits.h>
|
2014-02-28 10:40:55 +01:00
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
/* Allow for C++ users compiling this directly. */
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2014-12-13 18:43:26 +01:00
|
|
|
/* The following option bits can be passed to pcre2_compile(), pcre2_match(),
|
|
|
|
or pcre2_dfa_match(). PCRE2_NO_UTF_CHECK affects only the function to which it
|
|
|
|
is passed. Put these bits at the most significant end of the options word so
|
2014-08-11 20:43:15 +02:00
|
|
|
others can be added next to them */
|
2014-02-28 10:40:55 +01:00
|
|
|
|
2014-08-11 20:43:15 +02:00
|
|
|
#define PCRE2_ANCHORED 0x80000000u
|
2014-10-01 18:16:27 +02:00
|
|
|
#define PCRE2_NO_UTF_CHECK 0x40000000u
|
2017-04-04 19:09:33 +02:00
|
|
|
#define PCRE2_ENDANCHORED 0x20000000u
|
2014-02-28 10:40:55 +01:00
|
|
|
|
2014-12-13 18:43:26 +01:00
|
|
|
/* The following option bits can be passed only to pcre2_compile(). However,
|
|
|
|
they may affect compilation, JIT compilation, and/or interpretive execution.
|
|
|
|
The following tags indicate which:
|
2014-02-28 10:40:55 +01:00
|
|
|
|
2014-12-13 18:43:26 +01:00
|
|
|
C alters what is compiled by pcre2_compile()
|
|
|
|
J alters what is compiled by pcre2_jit_compile()
|
2014-10-01 18:16:27 +02:00
|
|
|
M is inspected during pcre2_match() execution
|
2014-06-22 16:08:59 +02:00
|
|
|
D is inspected during pcre2_dfa_match() execution
|
2014-04-18 17:37:56 +02:00
|
|
|
*/
|
2014-02-28 10:40:55 +01:00
|
|
|
|
2014-08-11 20:43:15 +02:00
|
|
|
#define PCRE2_ALLOW_EMPTY_CLASS 0x00000001u /* C */
|
|
|
|
#define PCRE2_ALT_BSUX 0x00000002u /* C */
|
|
|
|
#define PCRE2_AUTO_CALLOUT 0x00000004u /* C */
|
|
|
|
#define PCRE2_CASELESS 0x00000008u /* C */
|
2014-10-01 18:16:27 +02:00
|
|
|
#define PCRE2_DOLLAR_ENDONLY 0x00000010u /* J M D */
|
2014-08-11 20:43:15 +02:00
|
|
|
#define PCRE2_DOTALL 0x00000020u /* C */
|
|
|
|
#define PCRE2_DUPNAMES 0x00000040u /* C */
|
|
|
|
#define PCRE2_EXTENDED 0x00000080u /* C */
|
2014-10-01 18:16:27 +02:00
|
|
|
#define PCRE2_FIRSTLINE 0x00000100u /* J M D */
|
|
|
|
#define PCRE2_MATCH_UNSET_BACKREF 0x00000200u /* C J M */
|
2014-08-11 20:43:15 +02:00
|
|
|
#define PCRE2_MULTILINE 0x00000400u /* C */
|
|
|
|
#define PCRE2_NEVER_UCP 0x00000800u /* C */
|
|
|
|
#define PCRE2_NEVER_UTF 0x00001000u /* C */
|
|
|
|
#define PCRE2_NO_AUTO_CAPTURE 0x00002000u /* C */
|
|
|
|
#define PCRE2_NO_AUTO_POSSESS 0x00004000u /* C */
|
2015-01-02 18:09:16 +01:00
|
|
|
#define PCRE2_NO_DOTSTAR_ANCHOR 0x00008000u /* C */
|
|
|
|
#define PCRE2_NO_START_OPTIMIZE 0x00010000u /* J M D */
|
|
|
|
#define PCRE2_UCP 0x00020000u /* C J M D */
|
|
|
|
#define PCRE2_UNGREEDY 0x00040000u /* C */
|
|
|
|
#define PCRE2_UTF 0x00080000u /* C J M D */
|
2015-04-13 19:29:05 +02:00
|
|
|
#define PCRE2_NEVER_BACKSLASH_C 0x00100000u /* C */
|
2015-04-22 19:39:25 +02:00
|
|
|
#define PCRE2_ALT_CIRCUMFLEX 0x00200000u /* J M D */
|
2015-08-30 19:47:36 +02:00
|
|
|
#define PCRE2_ALT_VERBNAMES 0x00400000u /* C */
|
2015-09-22 13:24:28 +02:00
|
|
|
#define PCRE2_USE_OFFSET_LIMIT 0x00800000u /* J M D */
|
2017-04-18 14:32:52 +02:00
|
|
|
#define PCRE2_EXTENDED_MORE 0x01000000u /* C */
|
2014-02-28 10:40:55 +01:00
|
|
|
|
2017-05-17 19:55:11 +02:00
|
|
|
/* An additional compile options word is available in the compile context. */
|
|
|
|
|
|
|
|
#define PCRE2_EXTRA_ALLOW_SURROGATE_ESCAPES 0x00000001u /* C */
|
|
|
|
|
2014-02-28 10:40:55 +01:00
|
|
|
/* These are for pcre2_jit_compile(). */
|
|
|
|
|
2014-09-29 18:45:37 +02:00
|
|
|
#define PCRE2_JIT_COMPLETE 0x00000001u /* For full matching */
|
2014-08-11 20:43:15 +02:00
|
|
|
#define PCRE2_JIT_PARTIAL_SOFT 0x00000002u
|
|
|
|
#define PCRE2_JIT_PARTIAL_HARD 0x00000004u
|
2014-02-28 10:40:55 +01:00
|
|
|
|
2015-04-22 19:39:25 +02:00
|
|
|
/* These are for pcre2_match(), pcre2_dfa_match(), and pcre2_jit_match(). Note
|
|
|
|
that PCRE2_ANCHORED and PCRE2_NO_UTF_CHECK can also be passed to these
|
2015-06-18 18:39:25 +02:00
|
|
|
functions (though pcre2_jit_match() ignores the latter since it bypasses all
|
2015-04-22 19:39:25 +02:00
|
|
|
sanity checks). */
|
2014-02-28 10:40:55 +01:00
|
|
|
|
2014-08-11 20:43:15 +02:00
|
|
|
#define PCRE2_NOTBOL 0x00000001u
|
|
|
|
#define PCRE2_NOTEOL 0x00000002u
|
2014-08-26 13:46:21 +02:00
|
|
|
#define PCRE2_NOTEMPTY 0x00000004u /* ) These two must be kept */
|
|
|
|
#define PCRE2_NOTEMPTY_ATSTART 0x00000008u /* ) adjacent to each other. */
|
2014-08-11 20:43:15 +02:00
|
|
|
#define PCRE2_PARTIAL_SOFT 0x00000010u
|
|
|
|
#define PCRE2_PARTIAL_HARD 0x00000020u
|
2014-02-28 10:40:55 +01:00
|
|
|
|
2014-06-22 16:08:59 +02:00
|
|
|
/* These are additional options for pcre2_dfa_match(). */
|
2014-02-28 10:40:55 +01:00
|
|
|
|
2014-08-11 20:43:15 +02:00
|
|
|
#define PCRE2_DFA_RESTART 0x00000040u
|
|
|
|
#define PCRE2_DFA_SHORTEST 0x00000080u
|
2014-02-28 10:40:55 +01:00
|
|
|
|
2016-06-05 18:05:34 +02:00
|
|
|
/* These are additional options for pcre2_substitute(), which passes any others
|
|
|
|
through to pcre2_match(). */
|
2014-11-08 17:09:24 +01:00
|
|
|
|
2015-12-12 19:45:40 +01:00
|
|
|
#define PCRE2_SUBSTITUTE_GLOBAL 0x00000100u
|
|
|
|
#define PCRE2_SUBSTITUTE_EXTENDED 0x00000200u
|
|
|
|
#define PCRE2_SUBSTITUTE_UNSET_EMPTY 0x00000400u
|
|
|
|
#define PCRE2_SUBSTITUTE_UNKNOWN_UNSET 0x00000800u
|
|
|
|
#define PCRE2_SUBSTITUTE_OVERFLOW_LENGTH 0x00001000u
|
2014-11-08 17:09:24 +01:00
|
|
|
|
2016-06-29 18:52:05 +02:00
|
|
|
/* A further option for pcre2_match(), not allowed for pcre2_dfa_match(),
|
2016-06-05 18:05:34 +02:00
|
|
|
ignored for pcre2_jit_match(). */
|
|
|
|
|
|
|
|
#define PCRE2_NO_JIT 0x00002000u
|
|
|
|
|
2017-05-06 18:19:39 +02:00
|
|
|
/* Options for pcre2_pattern_convert(). */
|
|
|
|
|
2017-05-18 16:42:19 +02:00
|
|
|
#define PCRE2_CONVERT_UTF 0x00000001u
|
|
|
|
#define PCRE2_CONVERT_NO_UTF_CHECK 0x00000002u
|
|
|
|
#define PCRE2_CONVERT_POSIX_BASIC 0x00000004u
|
|
|
|
#define PCRE2_CONVERT_POSIX_EXTENDED 0x00000008u
|
|
|
|
#define PCRE2_CONVERT_GLOB 0x00000010u
|
2017-05-25 18:34:22 +02:00
|
|
|
#define PCRE2_CONVERT_GLOB_NO_WILD_SEPARATOR 0x00000030u
|
|
|
|
#define PCRE2_CONVERT_GLOB_NO_STARSTAR 0x00000050u
|
|
|
|
#define PCRE2_CONVERT_GLOB_BASIC 0x00000070u
|
|
|
|
#define PCRE2_CONVERT_GLOB_IGNORE_DOT_START 0x00000080u
|
2017-05-06 18:19:39 +02:00
|
|
|
|
2014-10-01 19:02:33 +02:00
|
|
|
/* Newline and \R settings, for use in compile contexts. The newline values
|
|
|
|
must be kept in step with values set in config.h and both sets must all be
|
|
|
|
greater than zero. */
|
2014-02-28 10:40:55 +01:00
|
|
|
|
2014-04-30 18:55:24 +02:00
|
|
|
#define PCRE2_NEWLINE_CR 1
|
|
|
|
#define PCRE2_NEWLINE_LF 2
|
|
|
|
#define PCRE2_NEWLINE_CRLF 3
|
|
|
|
#define PCRE2_NEWLINE_ANY 4
|
|
|
|
#define PCRE2_NEWLINE_ANYCRLF 5
|
2014-02-28 10:40:55 +01:00
|
|
|
|
2014-04-30 18:55:24 +02:00
|
|
|
#define PCRE2_BSR_UNICODE 1
|
|
|
|
#define PCRE2_BSR_ANYCRLF 2
|
2014-02-28 10:40:55 +01:00
|
|
|
|
2014-06-14 20:29:51 +02:00
|
|
|
/* Error codes: no match and partial match are "expected" errors. */
|
2014-02-28 10:40:55 +01:00
|
|
|
|
|
|
|
#define PCRE2_ERROR_NOMATCH (-1)
|
2014-06-14 20:29:51 +02:00
|
|
|
#define PCRE2_ERROR_PARTIAL (-2)
|
|
|
|
|
|
|
|
/* Error codes for UTF-8 validity checks */
|
|
|
|
|
|
|
|
#define PCRE2_ERROR_UTF8_ERR1 (-3)
|
|
|
|
#define PCRE2_ERROR_UTF8_ERR2 (-4)
|
|
|
|
#define PCRE2_ERROR_UTF8_ERR3 (-5)
|
|
|
|
#define PCRE2_ERROR_UTF8_ERR4 (-6)
|
|
|
|
#define PCRE2_ERROR_UTF8_ERR5 (-7)
|
|
|
|
#define PCRE2_ERROR_UTF8_ERR6 (-8)
|
|
|
|
#define PCRE2_ERROR_UTF8_ERR7 (-9)
|
|
|
|
#define PCRE2_ERROR_UTF8_ERR8 (-10)
|
|
|
|
#define PCRE2_ERROR_UTF8_ERR9 (-11)
|
|
|
|
#define PCRE2_ERROR_UTF8_ERR10 (-12)
|
|
|
|
#define PCRE2_ERROR_UTF8_ERR11 (-13)
|
|
|
|
#define PCRE2_ERROR_UTF8_ERR12 (-14)
|
|
|
|
#define PCRE2_ERROR_UTF8_ERR13 (-15)
|
|
|
|
#define PCRE2_ERROR_UTF8_ERR14 (-16)
|
|
|
|
#define PCRE2_ERROR_UTF8_ERR15 (-17)
|
|
|
|
#define PCRE2_ERROR_UTF8_ERR16 (-18)
|
|
|
|
#define PCRE2_ERROR_UTF8_ERR17 (-19)
|
|
|
|
#define PCRE2_ERROR_UTF8_ERR18 (-20)
|
|
|
|
#define PCRE2_ERROR_UTF8_ERR19 (-21)
|
|
|
|
#define PCRE2_ERROR_UTF8_ERR20 (-22)
|
|
|
|
#define PCRE2_ERROR_UTF8_ERR21 (-23)
|
|
|
|
|
|
|
|
/* Error codes for UTF-16 validity checks */
|
|
|
|
|
|
|
|
#define PCRE2_ERROR_UTF16_ERR1 (-24)
|
|
|
|
#define PCRE2_ERROR_UTF16_ERR2 (-25)
|
|
|
|
#define PCRE2_ERROR_UTF16_ERR3 (-26)
|
|
|
|
|
|
|
|
/* Error codes for UTF-32 validity checks */
|
|
|
|
|
|
|
|
#define PCRE2_ERROR_UTF32_ERR1 (-27)
|
|
|
|
#define PCRE2_ERROR_UTF32_ERR2 (-28)
|
|
|
|
|
2015-01-23 17:51:47 +01:00
|
|
|
/* Error codes for pcre2[_dfa]_match(), substring extraction functions, context
|
|
|
|
functions, and serializing functions. They are in numerical order. Originally
|
|
|
|
they were in alphabetical order too, but now that PCRE2 is released, the
|
|
|
|
numbers must not be changed. */
|
2014-09-19 09:43:39 +02:00
|
|
|
|
2014-10-31 13:34:34 +01:00
|
|
|
#define PCRE2_ERROR_BADDATA (-29)
|
2015-01-23 17:51:47 +01:00
|
|
|
#define PCRE2_ERROR_MIXEDTABLES (-30) /* Name was changed */
|
2014-10-31 13:34:34 +01:00
|
|
|
#define PCRE2_ERROR_BADMAGIC (-31)
|
|
|
|
#define PCRE2_ERROR_BADMODE (-32)
|
|
|
|
#define PCRE2_ERROR_BADOFFSET (-33)
|
|
|
|
#define PCRE2_ERROR_BADOPTION (-34)
|
2014-11-11 11:19:23 +01:00
|
|
|
#define PCRE2_ERROR_BADREPLACEMENT (-35)
|
|
|
|
#define PCRE2_ERROR_BADUTFOFFSET (-36)
|
|
|
|
#define PCRE2_ERROR_CALLOUT (-37) /* Never used by PCRE2 itself */
|
|
|
|
#define PCRE2_ERROR_DFA_BADRESTART (-38)
|
|
|
|
#define PCRE2_ERROR_DFA_RECURSE (-39)
|
|
|
|
#define PCRE2_ERROR_DFA_UCOND (-40)
|
2014-12-14 18:17:06 +01:00
|
|
|
#define PCRE2_ERROR_DFA_UFUNC (-41)
|
|
|
|
#define PCRE2_ERROR_DFA_UITEM (-42)
|
|
|
|
#define PCRE2_ERROR_DFA_WSSIZE (-43)
|
|
|
|
#define PCRE2_ERROR_INTERNAL (-44)
|
|
|
|
#define PCRE2_ERROR_JIT_BADOPTION (-45)
|
|
|
|
#define PCRE2_ERROR_JIT_STACKLIMIT (-46)
|
|
|
|
#define PCRE2_ERROR_MATCHLIMIT (-47)
|
|
|
|
#define PCRE2_ERROR_NOMEMORY (-48)
|
|
|
|
#define PCRE2_ERROR_NOSUBSTRING (-49)
|
|
|
|
#define PCRE2_ERROR_NOUNIQUESUBSTRING (-50)
|
|
|
|
#define PCRE2_ERROR_NULL (-51)
|
|
|
|
#define PCRE2_ERROR_RECURSELOOP (-52)
|
2017-03-12 14:47:01 +01:00
|
|
|
#define PCRE2_ERROR_DEPTHLIMIT (-53)
|
|
|
|
#define PCRE2_ERROR_RECURSIONLIMIT (-53) /* Obsolete synonym */
|
2014-12-14 18:17:06 +01:00
|
|
|
#define PCRE2_ERROR_UNAVAILABLE (-54)
|
|
|
|
#define PCRE2_ERROR_UNSET (-55)
|
2015-09-22 13:24:28 +02:00
|
|
|
#define PCRE2_ERROR_BADOFFSETLIMIT (-56)
|
2015-10-07 19:32:48 +02:00
|
|
|
#define PCRE2_ERROR_BADREPESCAPE (-57)
|
|
|
|
#define PCRE2_ERROR_REPMISSINGBRACE (-58)
|
|
|
|
#define PCRE2_ERROR_BADSUBSTITUTION (-59)
|
2015-11-03 18:38:00 +01:00
|
|
|
#define PCRE2_ERROR_BADSUBSPATTERN (-60)
|
2015-11-11 19:35:14 +01:00
|
|
|
#define PCRE2_ERROR_TOOMANYREPLACE (-61)
|
2016-05-24 18:37:13 +02:00
|
|
|
#define PCRE2_ERROR_BADSERIALIZEDDATA (-62)
|
2017-04-11 13:47:25 +02:00
|
|
|
#define PCRE2_ERROR_HEAPLIMIT (-63)
|
2017-05-06 18:19:39 +02:00
|
|
|
#define PCRE2_ERROR_CONVERT_SYNTAX (-64)
|
|
|
|
|
2014-02-28 10:40:55 +01:00
|
|
|
|
2014-03-07 18:28:52 +01:00
|
|
|
/* Request types for pcre2_pattern_info() */
|
2014-02-28 10:40:55 +01:00
|
|
|
|
2014-06-24 17:30:10 +02:00
|
|
|
#define PCRE2_INFO_ALLOPTIONS 0
|
|
|
|
#define PCRE2_INFO_ARGOPTIONS 1
|
|
|
|
#define PCRE2_INFO_BACKREFMAX 2
|
|
|
|
#define PCRE2_INFO_BSR 3
|
|
|
|
#define PCRE2_INFO_CAPTURECOUNT 4
|
|
|
|
#define PCRE2_INFO_FIRSTCODEUNIT 5
|
|
|
|
#define PCRE2_INFO_FIRSTCODETYPE 6
|
|
|
|
#define PCRE2_INFO_FIRSTBITMAP 7
|
|
|
|
#define PCRE2_INFO_HASCRORLF 8
|
|
|
|
#define PCRE2_INFO_JCHANGED 9
|
2014-04-30 18:55:24 +02:00
|
|
|
#define PCRE2_INFO_JITSIZE 10
|
|
|
|
#define PCRE2_INFO_LASTCODEUNIT 11
|
|
|
|
#define PCRE2_INFO_LASTCODETYPE 12
|
2014-06-24 17:30:10 +02:00
|
|
|
#define PCRE2_INFO_MATCHEMPTY 13
|
|
|
|
#define PCRE2_INFO_MATCHLIMIT 14
|
2014-04-30 18:55:24 +02:00
|
|
|
#define PCRE2_INFO_MAXLOOKBEHIND 15
|
|
|
|
#define PCRE2_INFO_MINLENGTH 16
|
|
|
|
#define PCRE2_INFO_NAMECOUNT 17
|
|
|
|
#define PCRE2_INFO_NAMEENTRYSIZE 18
|
|
|
|
#define PCRE2_INFO_NAMETABLE 19
|
2014-06-24 17:30:10 +02:00
|
|
|
#define PCRE2_INFO_NEWLINE 20
|
2017-03-12 14:47:01 +01:00
|
|
|
#define PCRE2_INFO_DEPTHLIMIT 21
|
|
|
|
#define PCRE2_INFO_RECURSIONLIMIT 21 /* Obsolete synonym */
|
2014-06-24 17:30:10 +02:00
|
|
|
#define PCRE2_INFO_SIZE 22
|
2015-11-14 18:28:19 +01:00
|
|
|
#define PCRE2_INFO_HASBACKSLASHC 23
|
2017-03-16 18:55:55 +01:00
|
|
|
#define PCRE2_INFO_FRAMESIZE 24
|
2017-04-11 13:47:25 +02:00
|
|
|
#define PCRE2_INFO_HEAPLIMIT 25
|
2014-02-28 10:40:55 +01:00
|
|
|
|
|
|
|
/* Request types for pcre2_config(). */
|
|
|
|
|
|
|
|
#define PCRE2_CONFIG_BSR 0
|
|
|
|
#define PCRE2_CONFIG_JIT 1
|
|
|
|
#define PCRE2_CONFIG_JITTARGET 2
|
2014-06-24 17:30:10 +02:00
|
|
|
#define PCRE2_CONFIG_LINKSIZE 3
|
|
|
|
#define PCRE2_CONFIG_MATCHLIMIT 4
|
2014-11-25 12:55:07 +01:00
|
|
|
#define PCRE2_CONFIG_NEWLINE 5
|
|
|
|
#define PCRE2_CONFIG_PARENSLIMIT 6
|
2017-03-12 14:47:01 +01:00
|
|
|
#define PCRE2_CONFIG_DEPTHLIMIT 7
|
|
|
|
#define PCRE2_CONFIG_RECURSIONLIMIT 7 /* Obsolete synonym */
|
2017-03-11 18:39:02 +01:00
|
|
|
#define PCRE2_CONFIG_STACKRECURSE 8 /* Obsolete */
|
2014-09-19 09:43:39 +02:00
|
|
|
#define PCRE2_CONFIG_UNICODE 9
|
|
|
|
#define PCRE2_CONFIG_UNICODE_VERSION 10
|
2014-08-12 11:48:56 +02:00
|
|
|
#define PCRE2_CONFIG_VERSION 11
|
2017-04-11 13:47:25 +02:00
|
|
|
#define PCRE2_CONFIG_HEAPLIMIT 12
|
2014-02-28 10:40:55 +01:00
|
|
|
|
2014-07-15 10:46:12 +02:00
|
|
|
/* Types for code units in patterns and subject strings. */
|
2014-04-18 17:37:56 +02:00
|
|
|
|
2014-08-11 20:43:15 +02:00
|
|
|
typedef uint8_t PCRE2_UCHAR8;
|
|
|
|
typedef uint16_t PCRE2_UCHAR16;
|
|
|
|
typedef uint32_t PCRE2_UCHAR32;
|
2014-04-18 17:37:56 +02:00
|
|
|
|
2014-08-11 20:43:15 +02:00
|
|
|
typedef const PCRE2_UCHAR8 *PCRE2_SPTR8;
|
|
|
|
typedef const PCRE2_UCHAR16 *PCRE2_SPTR16;
|
|
|
|
typedef const PCRE2_UCHAR32 *PCRE2_SPTR32;
|
|
|
|
|
2014-08-29 14:12:34 +02:00
|
|
|
/* The PCRE2_SIZE type is used for all string lengths and offsets in PCRE2,
|
2014-08-16 11:46:58 +02:00
|
|
|
including pattern offsets for errors and subject offsets after a match. We
|
|
|
|
define special values to indicate zero-terminated strings and unset offsets in
|
|
|
|
the offset vector (ovector). */
|
2014-02-28 10:40:55 +01:00
|
|
|
|
2014-08-16 11:46:58 +02:00
|
|
|
#define PCRE2_SIZE size_t
|
2015-12-09 18:33:07 +01:00
|
|
|
#define PCRE2_SIZE_MAX SIZE_MAX
|
2014-08-16 11:46:58 +02:00
|
|
|
#define PCRE2_ZERO_TERMINATED (~(PCRE2_SIZE)0)
|
|
|
|
#define PCRE2_UNSET (~(PCRE2_SIZE)0)
|
2014-02-28 10:40:55 +01:00
|
|
|
|
|
|
|
/* Generic types for opaque structures and JIT callback functions. These
|
|
|
|
declarations are defined in a macro that is expanded for each width later. */
|
|
|
|
|
|
|
|
#define PCRE2_TYPES_LIST \
|
2014-04-18 17:37:56 +02:00
|
|
|
struct pcre2_real_general_context; \
|
|
|
|
typedef struct pcre2_real_general_context pcre2_general_context; \
|
|
|
|
\
|
|
|
|
struct pcre2_real_compile_context; \
|
|
|
|
typedef struct pcre2_real_compile_context pcre2_compile_context; \
|
|
|
|
\
|
|
|
|
struct pcre2_real_match_context; \
|
|
|
|
typedef struct pcre2_real_match_context pcre2_match_context; \
|
2014-02-28 10:40:55 +01:00
|
|
|
\
|
2017-05-06 18:19:39 +02:00
|
|
|
struct pcre2_real_convert_context; \
|
|
|
|
typedef struct pcre2_real_convert_context pcre2_convert_context; \
|
|
|
|
\
|
2014-03-07 18:28:52 +01:00
|
|
|
struct pcre2_real_code; \
|
|
|
|
typedef struct pcre2_real_code pcre2_code; \
|
2014-02-28 10:40:55 +01:00
|
|
|
\
|
|
|
|
struct pcre2_real_match_data; \
|
|
|
|
typedef struct pcre2_real_match_data pcre2_match_data; \
|
|
|
|
\
|
|
|
|
struct pcre2_real_jit_stack; \
|
|
|
|
typedef struct pcre2_real_jit_stack pcre2_jit_stack; \
|
|
|
|
\
|
|
|
|
typedef pcre2_jit_stack *(*pcre2_jit_callback)(void *);
|
|
|
|
|
2014-03-07 18:28:52 +01:00
|
|
|
|
2014-02-28 10:40:55 +01:00
|
|
|
/* The structure for passing out data via the pcre_callout_function. We use a
|
|
|
|
structure so that new fields can be added on the end in future versions,
|
|
|
|
without changing the API of the function, thereby allowing old clients to work
|
|
|
|
without modification. Define the generic version in a macro; the width-specific
|
|
|
|
versions are generated from this macro below. */
|
|
|
|
|
|
|
|
#define PCRE2_STRUCTURE_LIST \
|
|
|
|
typedef struct pcre2_callout_block { \
|
2014-09-19 19:38:26 +02:00
|
|
|
uint32_t version; /* Identifies version of block */ \
|
2014-02-28 10:40:55 +01:00
|
|
|
/* ------------------------ Version 0 ------------------------------- */ \
|
2014-07-04 18:26:09 +02:00
|
|
|
uint32_t callout_number; /* Number compiled into pattern */ \
|
2014-09-19 19:38:26 +02:00
|
|
|
uint32_t capture_top; /* Max current capture */ \
|
|
|
|
uint32_t capture_last; /* Most recently closed capture */ \
|
2014-08-16 11:46:58 +02:00
|
|
|
PCRE2_SIZE *offset_vector; /* The offset vector */ \
|
2014-09-19 19:38:26 +02:00
|
|
|
PCRE2_SPTR mark; /* Pointer to current mark or NULL */ \
|
2014-07-04 18:26:09 +02:00
|
|
|
PCRE2_SPTR subject; /* The subject being matched */ \
|
2014-08-31 19:03:37 +02:00
|
|
|
PCRE2_SIZE subject_length; /* The length of the subject */ \
|
2014-08-16 11:46:58 +02:00
|
|
|
PCRE2_SIZE start_match; /* Offset to start of this match attempt */ \
|
|
|
|
PCRE2_SIZE current_position; /* Where we currently are in the subject */ \
|
|
|
|
PCRE2_SIZE pattern_position; /* Offset to next item in the pattern */ \
|
|
|
|
PCRE2_SIZE next_item_length; /* Length of next item in the pattern */ \
|
2015-03-11 18:44:16 +01:00
|
|
|
/* ------------------- Added for Version 1 -------------------------- */ \
|
2015-03-14 13:20:18 +01:00
|
|
|
PCRE2_SIZE callout_string_offset; /* Offset to string within pattern */ \
|
2015-03-16 16:38:26 +01:00
|
|
|
PCRE2_SIZE callout_string_length; /* Length of string compiled into pattern */ \
|
2015-03-11 18:44:16 +01:00
|
|
|
PCRE2_SPTR callout_string; /* String compiled into pattern */ \
|
2014-02-28 10:40:55 +01:00
|
|
|
/* ------------------------------------------------------------------ */ \
|
2015-03-23 16:52:08 +01:00
|
|
|
} pcre2_callout_block; \
|
|
|
|
\
|
|
|
|
typedef struct pcre2_callout_enumerate_block { \
|
|
|
|
uint32_t version; /* Identifies version of block */ \
|
|
|
|
/* ------------------------ Version 0 ------------------------------- */ \
|
|
|
|
PCRE2_SIZE pattern_position; /* Offset to next item in the pattern */ \
|
|
|
|
PCRE2_SIZE next_item_length; /* Length of next item in the pattern */ \
|
|
|
|
uint32_t callout_number; /* Number compiled into pattern */ \
|
|
|
|
PCRE2_SIZE callout_string_offset; /* Offset to string within pattern */ \
|
|
|
|
PCRE2_SIZE callout_string_length; /* Length of string compiled into pattern */ \
|
|
|
|
PCRE2_SPTR callout_string; /* String compiled into pattern */ \
|
|
|
|
/* ------------------------------------------------------------------ */ \
|
|
|
|
} pcre2_callout_enumerate_block;
|
2014-02-28 10:40:55 +01:00
|
|
|
|
2014-03-07 18:28:52 +01:00
|
|
|
|
|
|
|
/* List the generic forms of all other functions in macros, which will be
|
|
|
|
expanded for each width below. Start with functions that give general
|
|
|
|
information. */
|
|
|
|
|
|
|
|
#define PCRE2_GENERAL_INFO_FUNCTIONS \
|
2016-11-19 13:46:24 +01:00
|
|
|
PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION pcre2_config(uint32_t, void *);
|
2014-03-07 18:28:52 +01:00
|
|
|
|
|
|
|
|
|
|
|
/* Functions for manipulating contexts. */
|
|
|
|
|
2014-04-18 17:37:56 +02:00
|
|
|
#define PCRE2_GENERAL_CONTEXT_FUNCTIONS \
|
2016-11-19 13:46:24 +01:00
|
|
|
PCRE2_EXP_DECL pcre2_general_context PCRE2_CALL_CONVENTION \
|
|
|
|
*pcre2_general_context_copy(pcre2_general_context *); \
|
|
|
|
PCRE2_EXP_DECL pcre2_general_context PCRE2_CALL_CONVENTION \
|
|
|
|
*pcre2_general_context_create(void *(*)(PCRE2_SIZE, void *), \
|
|
|
|
void (*)(void *, void *), void *); \
|
|
|
|
PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \
|
|
|
|
pcre2_general_context_free(pcre2_general_context *);
|
2014-04-18 17:37:56 +02:00
|
|
|
|
|
|
|
#define PCRE2_COMPILE_CONTEXT_FUNCTIONS \
|
2016-11-19 13:46:24 +01:00
|
|
|
PCRE2_EXP_DECL pcre2_compile_context PCRE2_CALL_CONVENTION \
|
|
|
|
*pcre2_compile_context_copy(pcre2_compile_context *); \
|
|
|
|
PCRE2_EXP_DECL pcre2_compile_context PCRE2_CALL_CONVENTION \
|
|
|
|
*pcre2_compile_context_create(pcre2_general_context *);\
|
|
|
|
PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \
|
|
|
|
pcre2_compile_context_free(pcre2_compile_context *); \
|
|
|
|
PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
|
|
|
|
pcre2_set_bsr(pcre2_compile_context *, uint32_t); \
|
|
|
|
PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
|
|
|
|
pcre2_set_character_tables(pcre2_compile_context *, const unsigned char *); \
|
2017-05-17 19:55:11 +02:00
|
|
|
PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
|
|
|
|
pcre2_set_compile_extra_options(pcre2_compile_context *, uint32_t); \
|
2016-11-19 13:46:24 +01:00
|
|
|
PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
|
|
|
|
pcre2_set_max_pattern_length(pcre2_compile_context *, PCRE2_SIZE); \
|
|
|
|
PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
|
|
|
|
pcre2_set_newline(pcre2_compile_context *, uint32_t); \
|
|
|
|
PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
|
|
|
|
pcre2_set_parens_nest_limit(pcre2_compile_context *, uint32_t); \
|
|
|
|
PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
|
|
|
|
pcre2_set_compile_recursion_guard(pcre2_compile_context *, \
|
|
|
|
int (*)(uint32_t, void *), void *);
|
2014-04-18 17:37:56 +02:00
|
|
|
|
|
|
|
#define PCRE2_MATCH_CONTEXT_FUNCTIONS \
|
2016-11-19 13:46:24 +01:00
|
|
|
PCRE2_EXP_DECL pcre2_match_context PCRE2_CALL_CONVENTION \
|
|
|
|
*pcre2_match_context_copy(pcre2_match_context *); \
|
|
|
|
PCRE2_EXP_DECL pcre2_match_context PCRE2_CALL_CONVENTION \
|
|
|
|
*pcre2_match_context_create(pcre2_general_context *); \
|
|
|
|
PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \
|
|
|
|
pcre2_match_context_free(pcre2_match_context *); \
|
|
|
|
PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
|
|
|
|
pcre2_set_callout(pcre2_match_context *, \
|
|
|
|
int (*)(pcre2_callout_block *, void *), void *); \
|
2017-03-12 14:47:01 +01:00
|
|
|
PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
|
|
|
|
pcre2_set_depth_limit(pcre2_match_context *, uint32_t); \
|
2017-04-11 13:47:25 +02:00
|
|
|
PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
|
|
|
|
pcre2_set_heap_limit(pcre2_match_context *, uint32_t); \
|
2016-11-19 13:46:24 +01:00
|
|
|
PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
|
|
|
|
pcre2_set_match_limit(pcre2_match_context *, uint32_t); \
|
|
|
|
PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
|
|
|
|
pcre2_set_offset_limit(pcre2_match_context *, PCRE2_SIZE); \
|
|
|
|
PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
|
|
|
|
pcre2_set_recursion_memory_management(pcre2_match_context *, \
|
|
|
|
void *(*)(PCRE2_SIZE, void *), void (*)(void *, void *), void *);
|
2014-03-07 18:28:52 +01:00
|
|
|
|
2017-05-06 18:19:39 +02:00
|
|
|
#define PCRE2_CONVERT_CONTEXT_FUNCTIONS \
|
|
|
|
PCRE2_EXP_DECL pcre2_convert_context PCRE2_CALL_CONVENTION \
|
|
|
|
*pcre2_convert_context_copy(pcre2_convert_context *); \
|
|
|
|
PCRE2_EXP_DECL pcre2_convert_context PCRE2_CALL_CONVENTION \
|
|
|
|
*pcre2_convert_context_create(pcre2_general_context *); \
|
|
|
|
PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \
|
|
|
|
pcre2_convert_context_free(pcre2_convert_context *); \
|
2017-05-23 18:08:48 +02:00
|
|
|
PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
|
|
|
|
pcre2_set_glob_escape(pcre2_convert_context *, uint32_t); \
|
2017-05-06 18:19:39 +02:00
|
|
|
PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
|
|
|
|
pcre2_set_glob_separator(pcre2_convert_context *, uint32_t);
|
|
|
|
|
2014-03-07 18:28:52 +01:00
|
|
|
|
|
|
|
/* Functions concerned with compiling a pattern to PCRE internal code. */
|
|
|
|
|
|
|
|
#define PCRE2_COMPILE_FUNCTIONS \
|
2016-11-19 13:46:24 +01:00
|
|
|
PCRE2_EXP_DECL pcre2_code PCRE2_CALL_CONVENTION \
|
|
|
|
*pcre2_compile(PCRE2_SPTR, PCRE2_SIZE, uint32_t, int *, PCRE2_SIZE *, \
|
|
|
|
pcre2_compile_context *); \
|
|
|
|
PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \
|
|
|
|
pcre2_code_free(pcre2_code *); \
|
|
|
|
PCRE2_EXP_DECL pcre2_code PCRE2_CALL_CONVENTION \
|
2016-11-22 16:37:02 +01:00
|
|
|
*pcre2_code_copy(const pcre2_code *); \
|
|
|
|
PCRE2_EXP_DECL pcre2_code PCRE2_CALL_CONVENTION \
|
|
|
|
*pcre2_code_copy_with_tables(const pcre2_code *);
|
2014-03-07 18:28:52 +01:00
|
|
|
|
|
|
|
|
|
|
|
/* Functions that give information about a compiled pattern. */
|
|
|
|
|
|
|
|
#define PCRE2_PATTERN_INFO_FUNCTIONS \
|
2016-11-19 13:46:24 +01:00
|
|
|
PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
|
|
|
|
pcre2_pattern_info(const pcre2_code *, uint32_t, void *); \
|
|
|
|
PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
|
|
|
|
pcre2_callout_enumerate(const pcre2_code *, \
|
|
|
|
int (*)(pcre2_callout_enumerate_block *, void *), void *);
|
2014-03-07 18:28:52 +01:00
|
|
|
|
|
|
|
|
|
|
|
/* Functions for running a match and inspecting the result. */
|
|
|
|
|
|
|
|
#define PCRE2_MATCH_FUNCTIONS \
|
2016-11-19 13:46:24 +01:00
|
|
|
PCRE2_EXP_DECL pcre2_match_data PCRE2_CALL_CONVENTION \
|
|
|
|
*pcre2_match_data_create(uint32_t, pcre2_general_context *); \
|
|
|
|
PCRE2_EXP_DECL pcre2_match_data PCRE2_CALL_CONVENTION \
|
|
|
|
*pcre2_match_data_create_from_pattern(const pcre2_code *, \
|
|
|
|
pcre2_general_context *); \
|
|
|
|
PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
|
|
|
|
pcre2_dfa_match(const pcre2_code *, PCRE2_SPTR, PCRE2_SIZE, PCRE2_SIZE, \
|
|
|
|
uint32_t, pcre2_match_data *, pcre2_match_context *, int *, PCRE2_SIZE); \
|
|
|
|
PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
|
|
|
|
pcre2_match(const pcre2_code *, PCRE2_SPTR, PCRE2_SIZE, PCRE2_SIZE, \
|
|
|
|
uint32_t, pcre2_match_data *, pcre2_match_context *); \
|
|
|
|
PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \
|
|
|
|
pcre2_match_data_free(pcre2_match_data *); \
|
|
|
|
PCRE2_EXP_DECL PCRE2_SPTR PCRE2_CALL_CONVENTION \
|
|
|
|
pcre2_get_mark(pcre2_match_data *); \
|
|
|
|
PCRE2_EXP_DECL uint32_t PCRE2_CALL_CONVENTION \
|
|
|
|
pcre2_get_ovector_count(pcre2_match_data *); \
|
|
|
|
PCRE2_EXP_DECL PCRE2_SIZE PCRE2_CALL_CONVENTION \
|
|
|
|
*pcre2_get_ovector_pointer(pcre2_match_data *); \
|
|
|
|
PCRE2_EXP_DECL PCRE2_SIZE PCRE2_CALL_CONVENTION \
|
|
|
|
pcre2_get_startchar(pcre2_match_data *);
|
2014-03-07 18:28:52 +01:00
|
|
|
|
|
|
|
|
|
|
|
/* Convenience functions for handling matched substrings. */
|
|
|
|
|
|
|
|
#define PCRE2_SUBSTRING_FUNCTIONS \
|
2016-11-19 13:46:24 +01:00
|
|
|
PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
|
|
|
|
pcre2_substring_copy_byname(pcre2_match_data *, PCRE2_SPTR, PCRE2_UCHAR *, \
|
|
|
|
PCRE2_SIZE *); \
|
|
|
|
PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
|
|
|
|
pcre2_substring_copy_bynumber(pcre2_match_data *, uint32_t, PCRE2_UCHAR *, \
|
|
|
|
PCRE2_SIZE *); \
|
|
|
|
PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \
|
|
|
|
pcre2_substring_free(PCRE2_UCHAR *); \
|
|
|
|
PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
|
|
|
|
pcre2_substring_get_byname(pcre2_match_data *, PCRE2_SPTR, PCRE2_UCHAR **, \
|
|
|
|
PCRE2_SIZE *); \
|
|
|
|
PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
|
|
|
|
pcre2_substring_get_bynumber(pcre2_match_data *, uint32_t, PCRE2_UCHAR **, \
|
|
|
|
PCRE2_SIZE *); \
|
|
|
|
PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
|
|
|
|
pcre2_substring_length_byname(pcre2_match_data *, PCRE2_SPTR, PCRE2_SIZE *); \
|
|
|
|
PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
|
|
|
|
pcre2_substring_length_bynumber(pcre2_match_data *, uint32_t, PCRE2_SIZE *); \
|
|
|
|
PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
|
|
|
|
pcre2_substring_nametable_scan(const pcre2_code *, PCRE2_SPTR, PCRE2_SPTR *, \
|
|
|
|
PCRE2_SPTR *); \
|
|
|
|
PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
|
|
|
|
pcre2_substring_number_from_name(const pcre2_code *, PCRE2_SPTR); \
|
|
|
|
PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \
|
|
|
|
pcre2_substring_list_free(PCRE2_SPTR *); \
|
|
|
|
PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
|
|
|
|
pcre2_substring_list_get(pcre2_match_data *, PCRE2_UCHAR ***, PCRE2_SIZE **);
|
2014-03-07 18:28:52 +01:00
|
|
|
|
2015-01-23 17:51:47 +01:00
|
|
|
/* Functions for serializing / deserializing compiled patterns. */
|
|
|
|
|
|
|
|
#define PCRE2_SERIALIZE_FUNCTIONS \
|
2016-11-19 13:46:24 +01:00
|
|
|
PCRE2_EXP_DECL int32_t PCRE2_CALL_CONVENTION \
|
|
|
|
pcre2_serialize_encode(const pcre2_code **, int32_t, uint8_t **, \
|
|
|
|
PCRE2_SIZE *, pcre2_general_context *); \
|
|
|
|
PCRE2_EXP_DECL int32_t PCRE2_CALL_CONVENTION \
|
|
|
|
pcre2_serialize_decode(pcre2_code **, int32_t, const uint8_t *, \
|
|
|
|
pcre2_general_context *); \
|
|
|
|
PCRE2_EXP_DECL int32_t PCRE2_CALL_CONVENTION \
|
|
|
|
pcre2_serialize_get_number_of_codes(const uint8_t *); \
|
|
|
|
PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \
|
|
|
|
pcre2_serialize_free(uint8_t *);
|
2015-01-23 17:51:47 +01:00
|
|
|
|
2014-03-07 18:28:52 +01:00
|
|
|
|
2014-11-08 17:09:24 +01:00
|
|
|
/* Convenience function for match + substitute. */
|
|
|
|
|
|
|
|
#define PCRE2_SUBSTITUTE_FUNCTION \
|
2016-11-19 13:46:24 +01:00
|
|
|
PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
|
|
|
|
pcre2_substitute(const pcre2_code *, PCRE2_SPTR, PCRE2_SIZE, PCRE2_SIZE, \
|
|
|
|
uint32_t, pcre2_match_data *, pcre2_match_context *, PCRE2_SPTR, \
|
|
|
|
PCRE2_SIZE, PCRE2_UCHAR *, PCRE2_SIZE *);
|
2014-11-08 17:09:24 +01:00
|
|
|
|
|
|
|
|
2017-05-06 18:19:39 +02:00
|
|
|
/* Functions for converting pattern source strings. */
|
|
|
|
|
|
|
|
#define PCRE2_CONVERT_FUNCTIONS \
|
|
|
|
PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
|
|
|
|
pcre2_pattern_convert(PCRE2_SPTR, PCRE2_SIZE, uint32_t, PCRE2_UCHAR **, \
|
|
|
|
PCRE2_SIZE *, pcre2_convert_context *); \
|
|
|
|
PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \
|
|
|
|
pcre2_converted_pattern_free(PCRE2_UCHAR *);
|
|
|
|
|
|
|
|
|
2014-03-07 18:28:52 +01:00
|
|
|
/* Functions for JIT processing */
|
|
|
|
|
|
|
|
#define PCRE2_JIT_FUNCTIONS \
|
2016-11-19 13:46:24 +01:00
|
|
|
PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
|
|
|
|
pcre2_jit_compile(pcre2_code *, uint32_t); \
|
|
|
|
PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
|
|
|
|
pcre2_jit_match(const pcre2_code *, PCRE2_SPTR, PCRE2_SIZE, PCRE2_SIZE, \
|
|
|
|
uint32_t, pcre2_match_data *, pcre2_match_context *); \
|
|
|
|
PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \
|
|
|
|
pcre2_jit_free_unused_memory(pcre2_general_context *); \
|
|
|
|
PCRE2_EXP_DECL pcre2_jit_stack PCRE2_CALL_CONVENTION \
|
|
|
|
*pcre2_jit_stack_create(PCRE2_SIZE, PCRE2_SIZE, pcre2_general_context *); \
|
|
|
|
PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \
|
|
|
|
pcre2_jit_stack_assign(pcre2_match_context *, pcre2_jit_callback, void *); \
|
|
|
|
PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \
|
|
|
|
pcre2_jit_stack_free(pcre2_jit_stack *);
|
2014-03-07 18:28:52 +01:00
|
|
|
|
|
|
|
|
|
|
|
/* Other miscellaneous functions. */
|
|
|
|
|
|
|
|
#define PCRE2_OTHER_FUNCTIONS \
|
2016-11-19 13:46:24 +01:00
|
|
|
PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
|
|
|
|
pcre2_get_error_message(int, PCRE2_UCHAR *, PCRE2_SIZE); \
|
|
|
|
PCRE2_EXP_DECL const uint8_t PCRE2_CALL_CONVENTION \
|
|
|
|
*pcre2_maketables(pcre2_general_context *); \
|
2014-02-28 10:40:55 +01:00
|
|
|
|
|
|
|
|
|
|
|
/* Define macros that generate width-specific names from generic versions. The
|
|
|
|
three-level macro scheme is necessary to get the macros expanded when we want
|
|
|
|
them to be. First we get the width from PCRE2_LOCAL_WIDTH, which is used for
|
2014-03-07 18:28:52 +01:00
|
|
|
generating three versions of everything below. After that, PCRE2_SUFFIX will be
|
|
|
|
re-defined to use PCRE2_CODE_UNIT_WIDTH, for use when macros such as
|
|
|
|
pcre2_compile are called by application code. */
|
2014-02-28 10:40:55 +01:00
|
|
|
|
|
|
|
#define PCRE2_JOIN(a,b) a ## b
|
|
|
|
#define PCRE2_GLUE(a,b) PCRE2_JOIN(a,b)
|
2014-03-07 18:28:52 +01:00
|
|
|
#define PCRE2_SUFFIX(a) PCRE2_GLUE(a,PCRE2_LOCAL_WIDTH)
|
|
|
|
|
2014-02-28 10:40:55 +01:00
|
|
|
|
|
|
|
/* Data types */
|
|
|
|
|
2014-04-18 17:37:56 +02:00
|
|
|
#define PCRE2_UCHAR PCRE2_SUFFIX(PCRE2_UCHAR)
|
|
|
|
#define PCRE2_SPTR PCRE2_SUFFIX(PCRE2_SPTR)
|
2014-02-28 10:40:55 +01:00
|
|
|
|
2014-04-18 17:37:56 +02:00
|
|
|
#define pcre2_code PCRE2_SUFFIX(pcre2_code_)
|
|
|
|
#define pcre2_jit_callback PCRE2_SUFFIX(pcre2_jit_callback_)
|
|
|
|
#define pcre2_jit_stack PCRE2_SUFFIX(pcre2_jit_stack_)
|
2014-03-07 18:28:52 +01:00
|
|
|
|
2014-04-18 17:37:56 +02:00
|
|
|
#define pcre2_real_code PCRE2_SUFFIX(pcre2_real_code_)
|
|
|
|
#define pcre2_real_general_context PCRE2_SUFFIX(pcre2_real_general_context_)
|
|
|
|
#define pcre2_real_compile_context PCRE2_SUFFIX(pcre2_real_compile_context_)
|
2017-05-06 18:19:39 +02:00
|
|
|
#define pcre2_real_convert_context PCRE2_SUFFIX(pcre2_real_convert_context_)
|
2014-04-18 17:37:56 +02:00
|
|
|
#define pcre2_real_match_context PCRE2_SUFFIX(pcre2_real_match_context_)
|
|
|
|
#define pcre2_real_jit_stack PCRE2_SUFFIX(pcre2_real_jit_stack_)
|
|
|
|
#define pcre2_real_match_data PCRE2_SUFFIX(pcre2_real_match_data_)
|
2014-02-28 10:40:55 +01:00
|
|
|
|
|
|
|
|
|
|
|
/* Data blocks */
|
|
|
|
|
2015-03-23 16:52:08 +01:00
|
|
|
#define pcre2_callout_block PCRE2_SUFFIX(pcre2_callout_block_)
|
|
|
|
#define pcre2_callout_enumerate_block PCRE2_SUFFIX(pcre2_callout_enumerate_block_)
|
|
|
|
#define pcre2_general_context PCRE2_SUFFIX(pcre2_general_context_)
|
|
|
|
#define pcre2_compile_context PCRE2_SUFFIX(pcre2_compile_context_)
|
2017-05-06 18:19:39 +02:00
|
|
|
#define pcre2_convert_context PCRE2_SUFFIX(pcre2_convert_context_)
|
2015-03-23 16:52:08 +01:00
|
|
|
#define pcre2_match_context PCRE2_SUFFIX(pcre2_match_context_)
|
|
|
|
#define pcre2_match_data PCRE2_SUFFIX(pcre2_match_data_)
|
2014-03-07 18:28:52 +01:00
|
|
|
|
|
|
|
|
|
|
|
/* Functions: the complete list in alphabetical order */
|
|
|
|
|
2015-03-23 16:52:08 +01:00
|
|
|
#define pcre2_callout_enumerate PCRE2_SUFFIX(pcre2_callout_enumerate_)
|
2016-02-26 19:26:17 +01:00
|
|
|
#define pcre2_code_copy PCRE2_SUFFIX(pcre2_code_copy_)
|
2016-11-22 16:37:02 +01:00
|
|
|
#define pcre2_code_copy_with_tables PCRE2_SUFFIX(pcre2_code_copy_with_tables_)
|
2014-07-04 18:26:09 +02:00
|
|
|
#define pcre2_code_free PCRE2_SUFFIX(pcre2_code_free_)
|
2014-03-07 18:28:52 +01:00
|
|
|
#define pcre2_compile PCRE2_SUFFIX(pcre2_compile_)
|
2014-07-04 18:26:09 +02:00
|
|
|
#define pcre2_compile_context_copy PCRE2_SUFFIX(pcre2_compile_context_copy_)
|
|
|
|
#define pcre2_compile_context_create PCRE2_SUFFIX(pcre2_compile_context_create_)
|
|
|
|
#define pcre2_compile_context_free PCRE2_SUFFIX(pcre2_compile_context_free_)
|
2014-03-07 18:28:52 +01:00
|
|
|
#define pcre2_config PCRE2_SUFFIX(pcre2_config_)
|
2017-05-06 18:19:39 +02:00
|
|
|
#define pcre2_convert_context_copy PCRE2_SUFFIX(pcre2_convert_context_copy_)
|
|
|
|
#define pcre2_convert_context_create PCRE2_SUFFIX(pcre2_convert_context_create_)
|
|
|
|
#define pcre2_convert_context_free PCRE2_SUFFIX(pcre2_convert_context_free_)
|
|
|
|
#define pcre2_converted_pattern_free PCRE2_SUFFIX(pcre2_converted_pattern_free_)
|
2014-04-18 17:37:56 +02:00
|
|
|
#define pcre2_dfa_match PCRE2_SUFFIX(pcre2_dfa_match_)
|
2014-07-04 18:26:09 +02:00
|
|
|
#define pcre2_general_context_copy PCRE2_SUFFIX(pcre2_general_context_copy_)
|
|
|
|
#define pcre2_general_context_create PCRE2_SUFFIX(pcre2_general_context_create_)
|
|
|
|
#define pcre2_general_context_free PCRE2_SUFFIX(pcre2_general_context_free_)
|
2014-03-07 18:28:52 +01:00
|
|
|
#define pcre2_get_error_message PCRE2_SUFFIX(pcre2_get_error_message_)
|
|
|
|
#define pcre2_get_mark PCRE2_SUFFIX(pcre2_get_mark_)
|
2014-04-18 17:37:56 +02:00
|
|
|
#define pcre2_get_ovector_pointer PCRE2_SUFFIX(pcre2_get_ovector_pointer_)
|
|
|
|
#define pcre2_get_ovector_count PCRE2_SUFFIX(pcre2_get_ovector_count_)
|
2014-03-07 18:28:52 +01:00
|
|
|
#define pcre2_get_startchar PCRE2_SUFFIX(pcre2_get_startchar_)
|
|
|
|
#define pcre2_jit_compile PCRE2_SUFFIX(pcre2_jit_compile_)
|
2014-04-18 17:37:56 +02:00
|
|
|
#define pcre2_jit_match PCRE2_SUFFIX(pcre2_jit_match_)
|
2014-03-07 18:28:52 +01:00
|
|
|
#define pcre2_jit_free_unused_memory PCRE2_SUFFIX(pcre2_jit_free_unused_memory_)
|
|
|
|
#define pcre2_jit_stack_assign PCRE2_SUFFIX(pcre2_jit_stack_assign_)
|
2014-11-03 18:13:00 +01:00
|
|
|
#define pcre2_jit_stack_create PCRE2_SUFFIX(pcre2_jit_stack_create_)
|
2014-03-07 18:28:52 +01:00
|
|
|
#define pcre2_jit_stack_free PCRE2_SUFFIX(pcre2_jit_stack_free_)
|
|
|
|
#define pcre2_maketables PCRE2_SUFFIX(pcre2_maketables_)
|
2015-03-23 16:52:08 +01:00
|
|
|
#define pcre2_match PCRE2_SUFFIX(pcre2_match_)
|
2014-07-04 18:26:09 +02:00
|
|
|
#define pcre2_match_context_copy PCRE2_SUFFIX(pcre2_match_context_copy_)
|
|
|
|
#define pcre2_match_context_create PCRE2_SUFFIX(pcre2_match_context_create_)
|
|
|
|
#define pcre2_match_context_free PCRE2_SUFFIX(pcre2_match_context_free_)
|
|
|
|
#define pcre2_match_data_create PCRE2_SUFFIX(pcre2_match_data_create_)
|
|
|
|
#define pcre2_match_data_create_from_pattern PCRE2_SUFFIX(pcre2_match_data_create_from_pattern_)
|
|
|
|
#define pcre2_match_data_free PCRE2_SUFFIX(pcre2_match_data_free_)
|
2017-05-06 18:19:39 +02:00
|
|
|
#define pcre2_pattern_convert PCRE2_SUFFIX(pcre2_pattern_convert_)
|
2014-03-07 18:28:52 +01:00
|
|
|
#define pcre2_pattern_info PCRE2_SUFFIX(pcre2_pattern_info_)
|
2015-01-23 17:51:47 +01:00
|
|
|
#define pcre2_serialize_decode PCRE2_SUFFIX(pcre2_serialize_decode_)
|
|
|
|
#define pcre2_serialize_encode PCRE2_SUFFIX(pcre2_serialize_encode_)
|
|
|
|
#define pcre2_serialize_free PCRE2_SUFFIX(pcre2_serialize_free_)
|
|
|
|
#define pcre2_serialize_get_number_of_codes PCRE2_SUFFIX(pcre2_serialize_get_number_of_codes_)
|
2014-10-01 19:02:33 +02:00
|
|
|
#define pcre2_set_bsr PCRE2_SUFFIX(pcre2_set_bsr_)
|
2014-03-07 18:28:52 +01:00
|
|
|
#define pcre2_set_callout PCRE2_SUFFIX(pcre2_set_callout_)
|
|
|
|
#define pcre2_set_character_tables PCRE2_SUFFIX(pcre2_set_character_tables_)
|
2017-05-17 19:55:11 +02:00
|
|
|
#define pcre2_set_compile_extra_options PCRE2_SUFFIX(pcre2_set_compile_extra_options_)
|
2014-04-18 17:37:56 +02:00
|
|
|
#define pcre2_set_compile_recursion_guard PCRE2_SUFFIX(pcre2_set_compile_recursion_guard_)
|
2017-03-12 14:47:01 +01:00
|
|
|
#define pcre2_set_depth_limit PCRE2_SUFFIX(pcre2_set_depth_limit_)
|
2017-05-23 18:08:48 +02:00
|
|
|
#define pcre2_set_glob_escape PCRE2_SUFFIX(pcre2_set_glob_escape_)
|
2017-05-06 18:19:39 +02:00
|
|
|
#define pcre2_set_glob_separator PCRE2_SUFFIX(pcre2_set_glob_separator_)
|
2017-04-11 13:47:25 +02:00
|
|
|
#define pcre2_set_heap_limit PCRE2_SUFFIX(pcre2_set_heap_limit_)
|
2014-03-07 18:28:52 +01:00
|
|
|
#define pcre2_set_match_limit PCRE2_SUFFIX(pcre2_set_match_limit_)
|
2015-11-05 18:33:39 +01:00
|
|
|
#define pcre2_set_max_pattern_length PCRE2_SUFFIX(pcre2_set_max_pattern_length_)
|
2014-10-01 19:02:33 +02:00
|
|
|
#define pcre2_set_newline PCRE2_SUFFIX(pcre2_set_newline_)
|
2014-03-07 18:28:52 +01:00
|
|
|
#define pcre2_set_parens_nest_limit PCRE2_SUFFIX(pcre2_set_parens_nest_limit_)
|
2015-09-22 13:24:28 +02:00
|
|
|
#define pcre2_set_offset_limit PCRE2_SUFFIX(pcre2_set_offset_limit_)
|
2014-11-08 17:09:24 +01:00
|
|
|
#define pcre2_substitute PCRE2_SUFFIX(pcre2_substitute_)
|
2014-07-04 18:26:09 +02:00
|
|
|
#define pcre2_substring_copy_byname PCRE2_SUFFIX(pcre2_substring_copy_byname_)
|
|
|
|
#define pcre2_substring_copy_bynumber PCRE2_SUFFIX(pcre2_substring_copy_bynumber_)
|
|
|
|
#define pcre2_substring_free PCRE2_SUFFIX(pcre2_substring_free_)
|
|
|
|
#define pcre2_substring_get_byname PCRE2_SUFFIX(pcre2_substring_get_byname_)
|
|
|
|
#define pcre2_substring_get_bynumber PCRE2_SUFFIX(pcre2_substring_get_bynumber_)
|
|
|
|
#define pcre2_substring_length_byname PCRE2_SUFFIX(pcre2_substring_length_byname_)
|
|
|
|
#define pcre2_substring_length_bynumber PCRE2_SUFFIX(pcre2_substring_length_bynumber_)
|
|
|
|
#define pcre2_substring_list_get PCRE2_SUFFIX(pcre2_substring_list_get_)
|
|
|
|
#define pcre2_substring_list_free PCRE2_SUFFIX(pcre2_substring_list_free_)
|
|
|
|
#define pcre2_substring_nametable_scan PCRE2_SUFFIX(pcre2_substring_nametable_scan_)
|
|
|
|
#define pcre2_substring_number_from_name PCRE2_SUFFIX(pcre2_substring_number_from_name_)
|
2014-03-07 18:28:52 +01:00
|
|
|
|
2017-03-12 14:47:01 +01:00
|
|
|
/* Keep this old function name for backwards compatibility */
|
|
|
|
#define pcre2_set_recursion_limit pcre2_set_depth_limit
|
|
|
|
|
|
|
|
/* Keep this obsolete function for backwards compatibility: it is now a noop. */
|
|
|
|
#define pcre2_set_recursion_memory_management PCRE2_SUFFIX(pcre2_set_recursion_memory_management_)
|
2014-02-28 10:40:55 +01:00
|
|
|
|
|
|
|
/* Now generate all three sets of width-specific structures and function
|
|
|
|
prototypes. */
|
|
|
|
|
2014-06-22 16:08:59 +02:00
|
|
|
#define PCRE2_TYPES_STRUCTURES_AND_FUNCTIONS \
|
|
|
|
PCRE2_TYPES_LIST \
|
|
|
|
PCRE2_STRUCTURE_LIST \
|
|
|
|
PCRE2_GENERAL_INFO_FUNCTIONS \
|
|
|
|
PCRE2_GENERAL_CONTEXT_FUNCTIONS \
|
|
|
|
PCRE2_COMPILE_CONTEXT_FUNCTIONS \
|
2017-05-06 18:19:39 +02:00
|
|
|
PCRE2_CONVERT_CONTEXT_FUNCTIONS \
|
|
|
|
PCRE2_CONVERT_FUNCTIONS \
|
2014-06-22 16:08:59 +02:00
|
|
|
PCRE2_MATCH_CONTEXT_FUNCTIONS \
|
|
|
|
PCRE2_COMPILE_FUNCTIONS \
|
|
|
|
PCRE2_PATTERN_INFO_FUNCTIONS \
|
|
|
|
PCRE2_MATCH_FUNCTIONS \
|
|
|
|
PCRE2_SUBSTRING_FUNCTIONS \
|
2015-01-23 17:51:47 +01:00
|
|
|
PCRE2_SERIALIZE_FUNCTIONS \
|
|
|
|
PCRE2_SUBSTITUTE_FUNCTION \
|
2014-06-22 16:08:59 +02:00
|
|
|
PCRE2_JIT_FUNCTIONS \
|
2014-03-07 18:28:52 +01:00
|
|
|
PCRE2_OTHER_FUNCTIONS
|
2014-06-22 16:08:59 +02:00
|
|
|
|
|
|
|
#define PCRE2_LOCAL_WIDTH 8
|
|
|
|
PCRE2_TYPES_STRUCTURES_AND_FUNCTIONS
|
2014-02-28 10:40:55 +01:00
|
|
|
#undef PCRE2_LOCAL_WIDTH
|
|
|
|
|
|
|
|
#define PCRE2_LOCAL_WIDTH 16
|
2014-06-22 16:08:59 +02:00
|
|
|
PCRE2_TYPES_STRUCTURES_AND_FUNCTIONS
|
2014-02-28 10:40:55 +01:00
|
|
|
#undef PCRE2_LOCAL_WIDTH
|
|
|
|
|
|
|
|
#define PCRE2_LOCAL_WIDTH 32
|
2014-06-22 16:08:59 +02:00
|
|
|
PCRE2_TYPES_STRUCTURES_AND_FUNCTIONS
|
2014-02-28 10:40:55 +01:00
|
|
|
#undef PCRE2_LOCAL_WIDTH
|
|
|
|
|
2014-03-07 18:28:52 +01:00
|
|
|
/* Undefine the list macros; they are no longer needed. */
|
|
|
|
|
2014-02-28 10:40:55 +01:00
|
|
|
#undef PCRE2_TYPES_LIST
|
|
|
|
#undef PCRE2_STRUCTURE_LIST
|
2014-03-07 18:28:52 +01:00
|
|
|
#undef PCRE2_GENERAL_INFO_FUNCTIONS
|
2014-04-18 17:37:56 +02:00
|
|
|
#undef PCRE2_GENERAL_CONTEXT_FUNCTIONS
|
|
|
|
#undef PCRE2_COMPILE_CONTEXT_FUNCTIONS
|
2017-05-06 18:19:39 +02:00
|
|
|
#undef PCRE2_CONVERT_CONTEXT_FUNCTIONS
|
2014-04-18 17:37:56 +02:00
|
|
|
#undef PCRE2_MATCH_CONTEXT_FUNCTIONS
|
2014-03-07 18:28:52 +01:00
|
|
|
#undef PCRE2_COMPILE_FUNCTIONS
|
|
|
|
#undef PCRE2_PATTERN_INFO_FUNCTIONS
|
|
|
|
#undef PCRE2_MATCH_FUNCTIONS
|
|
|
|
#undef PCRE2_SUBSTRING_FUNCTIONS
|
2015-01-23 17:51:47 +01:00
|
|
|
#undef PCRE2_SERIALIZE_FUNCTIONS
|
|
|
|
#undef PCRE2_SUBSTITUTE_FUNCTION
|
2014-03-07 18:28:52 +01:00
|
|
|
#undef PCRE2_JIT_FUNCTIONS
|
|
|
|
#undef PCRE2_OTHER_FUNCTIONS
|
2014-06-22 16:08:59 +02:00
|
|
|
#undef PCRE2_TYPES_STRUCTURES_AND_FUNCTIONS
|
2014-03-07 18:28:52 +01:00
|
|
|
|
2014-09-19 09:43:39 +02:00
|
|
|
/* PCRE2_CODE_UNIT_WIDTH must be defined. If it is 8, 16, or 32, redefine
|
|
|
|
PCRE2_SUFFIX to use it. If it is 0, undefine the other macros and make
|
|
|
|
PCRE2_SUFFIX a no-op. Otherwise, generate an error. */
|
2014-02-28 10:40:55 +01:00
|
|
|
|
2014-03-07 18:28:52 +01:00
|
|
|
#undef PCRE2_SUFFIX
|
2014-09-19 09:43:39 +02:00
|
|
|
#ifndef PCRE2_CODE_UNIT_WIDTH
|
|
|
|
#error PCRE2_CODE_UNIT_WIDTH must be defined before including pcre2.h.
|
|
|
|
#error Use 8, 16, or 32; or 0 for a multi-width application.
|
|
|
|
#else /* PCRE2_CODE_UNIT_WIDTH is defined */
|
|
|
|
#if PCRE2_CODE_UNIT_WIDTH == 8 || \
|
|
|
|
PCRE2_CODE_UNIT_WIDTH == 16 || \
|
|
|
|
PCRE2_CODE_UNIT_WIDTH == 32
|
2014-03-07 18:28:52 +01:00
|
|
|
#define PCRE2_SUFFIX(a) PCRE2_GLUE(a, PCRE2_CODE_UNIT_WIDTH)
|
2014-09-19 09:43:39 +02:00
|
|
|
#elif PCRE2_CODE_UNIT_WIDTH == 0
|
2014-02-28 10:40:55 +01:00
|
|
|
#undef PCRE2_JOIN
|
|
|
|
#undef PCRE2_GLUE
|
2014-03-07 18:28:52 +01:00
|
|
|
#define PCRE2_SUFFIX(a) a
|
2014-09-19 09:43:39 +02:00
|
|
|
#else
|
|
|
|
#error PCRE2_CODE_UNIT_WIDTH must be 0, 8, 16, or 32.
|
2014-09-19 19:38:26 +02:00
|
|
|
#endif
|
2014-09-19 09:43:39 +02:00
|
|
|
#endif /* PCRE2_CODE_UNIT_WIDTH is defined */
|
2014-03-07 18:28:52 +01:00
|
|
|
|
2014-02-28 10:40:55 +01:00
|
|
|
#ifdef __cplusplus
|
|
|
|
} /* extern "C" */
|
|
|
|
#endif
|
|
|
|
|
2016-11-20 13:46:11 +01:00
|
|
|
#endif /* PCRE2_H_IDEMPOTENT_GUARD */
|
|
|
|
|
|
|
|
/* End of pcre2.h */
|