common.bmx 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407
  1. ' Copyright (c) 2007-2021 Bruce A Henderson
  2. ' All rights reserved.
  3. '
  4. ' Redistribution and use in source and binary forms, with or without
  5. ' modification, are permitted provided that the following conditions are met:
  6. ' * Redistributions of source code must retain the above copyright
  7. ' notice, this list of conditions and the following disclaimer.
  8. ' * Redistributions in binary form must reproduce the above copyright
  9. ' notice, this list of conditions and the following disclaimer in the
  10. ' documentation and/or other materials provided with the distribution.
  11. ' * Neither the name of Bruce A Henderson nor the
  12. ' names of its contributors may be used to endorse or promote products
  13. ' derived from this software without specific prior written permission.
  14. '
  15. ' THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
  16. ' EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  17. ' WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  18. ' DISCLAIMED. IN NO EVENT SHALL Bruce A Henderson BE LIABLE FOR ANY
  19. ' DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  20. ' (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  21. ' LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  22. ' ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  23. ' (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  24. ' SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  25. '
  26. SuperStrict
  27. Import "src/*.h"
  28. Import "pcre/src/pcre2_auto_possess.c"
  29. Import "pcre/src/pcre2_chartables.c"
  30. Import "pcre/src/pcre2_compile.c"
  31. Import "pcre/src/pcre2_config.c"
  32. Import "pcre/src/pcre2_context.c"
  33. Import "pcre/src/pcre2_dfa_match.c"
  34. Import "pcre/src/pcre2_error.c"
  35. Import "pcre/src/pcre2_extuni.c"
  36. Import "pcre/src/pcre2_find_bracket.c"
  37. Import "pcre/src/pcre2_jit_compile.c"
  38. Import "pcre/src/pcre2_maketables.c"
  39. Import "pcre/src/pcre2_match.c"
  40. Import "pcre/src/pcre2_match_data.c"
  41. Import "pcre/src/pcre2_newline.c"
  42. Import "pcre/src/pcre2_ord2utf.c"
  43. Import "pcre/src/pcre2_pattern_info.c"
  44. Import "pcre/src/pcre2_script_run.c"
  45. Import "pcre/src/pcre2_string_utils.c"
  46. Import "pcre/src/pcre2_study.c"
  47. Import "pcre/src/pcre2_substitute.c"
  48. Import "pcre/src/pcre2_substring.c"
  49. Import "pcre/src/pcre2_tables.c"
  50. Import "pcre/src/pcre2_ucd.c"
  51. Import "pcre/src/pcre2_valid_utf.c"
  52. Import "pcre/src/pcre2_xclass.c"
  53. ' Request types for pcre2_config().
  54. Const PCRE2_CONFIG_BSR:Int = 0
  55. Const PCRE2_CONFIG_JIT:Int = 1
  56. Const PCRE2_CONFIG_JITTARGET:Int = 2
  57. Const PCRE2_CONFIG_LINKSIZE:Int = 3
  58. Const PCRE2_CONFIG_MATCHLIMIT:Int = 4
  59. Const PCRE2_CONFIG_NEWLINE:Int = 5
  60. Const PCRE2_CONFIG_PARENSLIMIT:Int = 6
  61. Const PCRE2_CONFIG_DEPTHLIMIT:Int = 7
  62. Const PCRE2_CONFIG_RECURSIONLIMIT:Int = PCRE2_CONFIG_DEPTHLIMIT ' obsolete synonym
  63. 'Const PCRE2_CONFIG_STACKRECURSE:Int = 8
  64. Const PCRE2_CONFIG_UNICODE:Int = 9
  65. Const PCRE2_CONFIG_UNICODE_VERSION:Int = 10
  66. Const PCRE2_CONFIG_VERSION:Int = 11
  67. Const PCRE2_CONFIG_HEAPLIMIT:Int = 12
  68. Const PCRE2_CONFIG_NEVER_BACKSLASH_C:Int = 13
  69. Const PCRE2_CONFIG_COMPILED_WIDTHS:Int = 14
  70. ' Exec-time and get/set-time error codes
  71. ' Error codes: no match and partial match are "expected" errors.
  72. Const PCRE2_ERROR_NOMATCH:Int = -1
  73. Const PCRE2_ERROR_PARTIAL:Int = -2
  74. ' Error codes for UTF-8 validity checks
  75. Const PCRE2_ERROR_UTF8_ERR1:Int = -3
  76. Const PCRE2_ERROR_UTF8_ERR2:Int = -4
  77. Const PCRE2_ERROR_UTF8_ERR3:Int = -5
  78. Const PCRE2_ERROR_UTF8_ERR4:Int = -6
  79. Const PCRE2_ERROR_UTF8_ERR5:Int = -7
  80. Const PCRE2_ERROR_UTF8_ERR6:Int = -8
  81. Const PCRE2_ERROR_UTF8_ERR7:Int = -9
  82. Const PCRE2_ERROR_UTF8_ERR8:Int = -10
  83. Const PCRE2_ERROR_UTF8_ERR9:Int = -11
  84. Const PCRE2_ERROR_UTF8_ERR10:Int = -12
  85. Const PCRE2_ERROR_UTF8_ERR11:Int = -13
  86. Const PCRE2_ERROR_UTF8_ERR12:Int = -14
  87. Const PCRE2_ERROR_UTF8_ERR13:Int = -15
  88. Const PCRE2_ERROR_UTF8_ERR14:Int = -16
  89. Const PCRE2_ERROR_UTF8_ERR15:Int = -17
  90. Const PCRE2_ERROR_UTF8_ERR16:Int = -18
  91. Const PCRE2_ERROR_UTF8_ERR17:Int = -19
  92. Const PCRE2_ERROR_UTF8_ERR18:Int = -20
  93. Const PCRE2_ERROR_UTF8_ERR19:Int = -21
  94. Const PCRE2_ERROR_UTF8_ERR20:Int = -22
  95. Const PCRE2_ERROR_UTF8_ERR21:Int = -23
  96. ' Error codes for UTF-16 validity checks
  97. Const PCRE2_ERROR_UTF16_ERR1:Int = -24
  98. Const PCRE2_ERROR_UTF16_ERR2:Int = -25
  99. Const PCRE2_ERROR_UTF16_ERR3:Int = -26
  100. ' Error codes for UTF-32 validity checks
  101. Const PCRE2_ERROR_UTF32_ERR1:Int = -27
  102. Const PCRE2_ERROR_UTF32_ERR2:Int = -28
  103. ' Error codes for pcre2[_dfa]_match(), substring extraction functions, and context functions.
  104. Const PCRE2_ERROR_BADDATA:Int = -29
  105. Const PCRE2_ERROR_BADLENGTH:Int = -30
  106. Const PCRE2_ERROR_BADMAGIC:Int = -31
  107. Const PCRE2_ERROR_BADMODE:Int = -32
  108. Const PCRE2_ERROR_BADOFFSET:Int = -33
  109. Const PCRE2_ERROR_BADOPTION:Int = -34
  110. Const PCRE2_ERROR_BADREPLACEMENT:Int = -35
  111. Const PCRE2_ERROR_BADUTFOFFSET:Int = -36
  112. Const PCRE2_ERROR_CALLOUT:Int = -37 ' Never used by PCRE2 itself
  113. Const PCRE2_ERROR_DFA_BADRESTART:Int = -38
  114. Const PCRE2_ERROR_DFA_RECURSE:Int = -39
  115. Const PCRE2_ERROR_DFA_UCOND:Int = -40
  116. Const PCRE2_ERROR_DFA_UFUNC:Int = -41
  117. Const PCRE2_ERROR_DFA_UITEM:Int = -42
  118. Const PCRE2_ERROR_DFA_WSSIZE:Int = -43
  119. Const PCRE2_ERROR_INTERNAL:Int = -44
  120. Const PCRE2_ERROR_JIT_BADOPTION:Int = -45
  121. Const PCRE2_ERROR_JIT_STACKLIMIT:Int = -46
  122. Const PCRE2_ERROR_MATCHLIMIT:Int = -47
  123. Const PCRE2_ERROR_NOMEMORY:Int = -48
  124. Const PCRE2_ERROR_NOSUBSTRING:Int = -49
  125. Const PCRE2_ERROR_NOUNIQUESUBSTRING:Int = -50
  126. Const PCRE2_ERROR_NULL:Int = -51
  127. Const PCRE2_ERROR_RECURSELOOP:Int = -52
  128. Const PCRE2_ERROR_DEPTHLIMIT:Int = -53
  129. Const PCRE2_ERROR_RECURSIONLIMIT:Int = PCRE2_ERROR_DEPTHLIMIT ' Obsolete synonym
  130. Const PCRE2_ERROR_UNAVAILABLE:Int = -54
  131. Const PCRE2_ERROR_UNSET:Int = -55
  132. Const PCRE2_ERROR_BADOFFSETLIMIT:Int = -56
  133. Const PCRE2_ERROR_BADREPESCAPE:Int = -57
  134. Const PCRE2_ERROR_REPMISSINGBRACE:Int = -58
  135. Const PCRE2_ERROR_BADSUBSTITUTION:Int = -59
  136. Const PCRE2_ERROR_BADSUBSPATTERN:Int = -60
  137. Const PCRE2_ERROR_TOOMANYREPLACE:Int = -61
  138. Const PCRE2_ERROR_BADSERIALIZEDDATA:Int = -62
  139. Const PCRE2_ERROR_HEAPLIMIT:Int = -63
  140. Const PCRE2_ERROR_CONVERT_SYNTAX:Int = -64
  141. ' Error codes for pcre2_compile(). Some of these are also used by
  142. ' pcre2_pattern_convert()
  143. Const PCRE2_ERROR_END_BACKSLASH:Int = 101
  144. Const PCRE2_ERROR_END_BACKSLASH_C:Int = 102
  145. Const PCRE2_ERROR_UNKNOWN_ESCAPE:Int = 103
  146. Const PCRE2_ERROR_QUANTIFIER_OUT_OF_ORDER:Int = 104
  147. Const PCRE2_ERROR_QUANTIFIER_TOO_BIG:Int = 105
  148. Const PCRE2_ERROR_MISSING_SQUARE_BRACKET:Int = 106
  149. Const PCRE2_ERROR_ESCAPE_INVALID_IN_CLASS:Int = 107
  150. Const PCRE2_ERROR_CLASS_RANGE_ORDER:Int = 108
  151. Const PCRE2_ERROR_QUANTIFIER_INVALID:Int = 109
  152. Const PCRE2_ERROR_INTERNAL_UNEXPECTED_REPEAT:Int = 110
  153. Const PCRE2_ERROR_INVALID_AFTER_PARENS_QUERY:Int = 111
  154. Const PCRE2_ERROR_POSIX_CLASS_NOT_IN_CLASS:Int = 112
  155. Const PCRE2_ERROR_POSIX_NO_SUPPORT_COLLATING:Int = 113
  156. Const PCRE2_ERROR_MISSING_CLOSING_PARENTHESIS:Int = 114
  157. Const PCRE2_ERROR_BAD_SUBPATTERN_REFERENCE:Int = 115
  158. Const PCRE2_ERROR_NULL_PATTERN:Int = 116
  159. Const PCRE2_ERROR_BAD_OPTIONS:Int = 117
  160. Const PCRE2_ERROR_MISSING_COMMENT_CLOSING:Int = 118
  161. Const PCRE2_ERROR_PARENTHESES_NEST_TOO_DEEP:Int = 119
  162. Const PCRE2_ERROR_PATTERN_TOO_LARGE:Int = 120
  163. Const PCRE2_ERROR_HEAP_FAILED:Int = 121
  164. Const PCRE2_ERROR_UNMATCHED_CLOSING_PARENTHESIS:Int = 122
  165. Const PCRE2_ERROR_INTERNAL_CODE_OVERFLOW:Int = 123
  166. Const PCRE2_ERROR_MISSING_CONDITION_CLOSING:Int = 124
  167. Const PCRE2_ERROR_LOOKBEHIND_NOT_FIXED_LENGTH:Int = 125
  168. Const PCRE2_ERROR_ZERO_RELATIVE_REFERENCE:Int = 126
  169. Const PCRE2_ERROR_TOO_MANY_CONDITION_BRANCHES:Int = 127
  170. Const PCRE2_ERROR_CONDITION_ASSERTION_EXPECTED:Int = 128
  171. Const PCRE2_ERROR_BAD_RELATIVE_REFERENCE:Int = 129
  172. Const PCRE2_ERROR_UNKNOWN_POSIX_CLASS:Int = 130
  173. Const PCRE2_ERROR_INTERNAL_STUDY_ERROR:Int = 131
  174. Const PCRE2_ERROR_UNICODE_NOT_SUPPORTED:Int = 132
  175. Const PCRE2_ERROR_PARENTHESES_STACK_CHECK:Int = 133
  176. Const PCRE2_ERROR_CODE_POINT_TOO_BIG:Int = 134
  177. Const PCRE2_ERROR_LOOKBEHIND_TOO_COMPLICATED:Int = 135
  178. Const PCRE2_ERROR_LOOKBEHIND_INVALID_BACKSLASH_C:Int = 136
  179. Const PCRE2_ERROR_UNSUPPORTED_ESCAPE_SEQUENCE:Int = 137
  180. Const PCRE2_ERROR_CALLOUT_NUMBER_TOO_BIG:Int = 138
  181. Const PCRE2_ERROR_MISSING_CALLOUT_CLOSING:Int = 139
  182. Const PCRE2_ERROR_ESCAPE_INVALID_IN_VERB:Int = 140
  183. Const PCRE2_ERROR_UNRECOGNIZED_AFTER_QUERY_P:Int = 141
  184. Const PCRE2_ERROR_MISSING_NAME_TERMINATOR:Int = 142
  185. Const PCRE2_ERROR_DUPLICATE_SUBPATTERN_NAME:Int = 143
  186. Const PCRE2_ERROR_INVALID_SUBPATTERN_NAME:Int = 144
  187. Const PCRE2_ERROR_UNICODE_PROPERTIES_UNAVAILABLE:Int = 145
  188. Const PCRE2_ERROR_MALFORMED_UNICODE_PROPERTY:Int = 146
  189. Const PCRE2_ERROR_UNKNOWN_UNICODE_PROPERTY:Int = 147
  190. Const PCRE2_ERROR_SUBPATTERN_NAME_TOO_LONG:Int = 148
  191. Const PCRE2_ERROR_TOO_MANY_NAMED_SUBPATTERNS:Int = 149
  192. Const PCRE2_ERROR_CLASS_INVALID_RANGE:Int = 150
  193. Const PCRE2_ERROR_OCTAL_BYTE_TOO_BIG:Int = 151
  194. Const PCRE2_ERROR_INTERNAL_OVERRAN_WORKSPACE:Int = 152
  195. Const PCRE2_ERROR_INTERNAL_MISSING_SUBPATTERN:Int = 153
  196. Const PCRE2_ERROR_DEFINE_TOO_MANY_BRANCHES:Int = 154
  197. Const PCRE2_ERROR_BACKSLASH_O_MISSING_BRACE:Int = 155
  198. Const PCRE2_ERROR_INTERNAL_UNKNOWN_NEWLINE:Int = 156
  199. Const PCRE2_ERROR_BACKSLASH_G_SYNTAX:Int = 157
  200. Const PCRE2_ERROR_PARENS_QUERY_R_MISSING_CLOSING:Int = 158
  201. Const PCRE2_ERROR_VERB_ARGUMENT_NOT_ALLOWED:Int = 159
  202. Const PCRE2_ERROR_VERB_UNKNOWN:Int = 160
  203. Const PCRE2_ERROR_SUBPATTERN_NUMBER_TOO_BIG:Int = 161
  204. Const PCRE2_ERROR_SUBPATTERN_NAME_EXPECTED:Int = 162
  205. Const PCRE2_ERROR_INTERNAL_PARSED_OVERFLOW:Int = 163
  206. Const PCRE2_ERROR_INVALID_OCTAL:Int = 164
  207. Const PCRE2_ERROR_SUBPATTERN_NAMES_MISMATCH:Int = 165
  208. Const PCRE2_ERROR_MARK_MISSING_ARGUMENT:Int = 166
  209. Const PCRE2_ERROR_INVALID_HEXADECIMAL:Int = 167
  210. Const PCRE2_ERROR_BACKSLASH_C_SYNTAX:Int = 168
  211. Const PCRE2_ERROR_BACKSLASH_K_SYNTAX:Int = 169
  212. Const PCRE2_ERROR_INTERNAL_BAD_CODE_LOOKBEHINDS:Int = 170
  213. Const PCRE2_ERROR_BACKSLASH_N_IN_CLASS:Int = 171
  214. Const PCRE2_ERROR_CALLOUT_STRING_TOO_LONG:Int = 172
  215. Const PCRE2_ERROR_UNICODE_DISALLOWED_CODE_POINT:Int = 173
  216. Const PCRE2_ERROR_UTF_IS_DISABLED:Int = 174
  217. Const PCRE2_ERROR_UCP_IS_DISABLED:Int = 175
  218. Const PCRE2_ERROR_VERB_NAME_TOO_LONG:Int = 176
  219. Const PCRE2_ERROR_BACKSLASH_U_CODE_POINT_TOO_BIG:Int = 177
  220. Const PCRE2_ERROR_MISSING_OCTAL_OR_HEX_DIGITS:Int = 178
  221. Const PCRE2_ERROR_VERSION_CONDITION_SYNTAX:Int = 179
  222. Const PCRE2_ERROR_INTERNAL_BAD_CODE_AUTO_POSSESS:Int = 180
  223. Const PCRE2_ERROR_CALLOUT_NO_STRING_DELIMITER:Int = 181
  224. Const PCRE2_ERROR_CALLOUT_BAD_STRING_DELIMITER:Int = 182
  225. Const PCRE2_ERROR_BACKSLASH_C_CALLER_DISABLED:Int = 183
  226. Const PCRE2_ERROR_QUERY_BARJX_NEST_TOO_DEEP:Int = 184
  227. Const PCRE2_ERROR_BACKSLASH_C_LIBRARY_DISABLED:Int = 185
  228. Const PCRE2_ERROR_PATTERN_TOO_COMPLICATED:Int = 186
  229. Const PCRE2_ERROR_LOOKBEHIND_TOO_LONG:Int = 187
  230. Const PCRE2_ERROR_PATTERN_STRING_TOO_LONG:Int = 188
  231. Const PCRE2_ERROR_INTERNAL_BAD_CODE:Int = 189
  232. Const PCRE2_ERROR_INTERNAL_BAD_CODE_IN_SKIP:Int = 190
  233. Const PCRE2_ERROR_NO_SURROGATES_IN_UTF16:Int = 191
  234. Const PCRE2_ERROR_BAD_LITERAL_OPTIONS:Int = 192
  235. ' The following option bits can be passed to pcre2_compile(), pcre2_match(),
  236. ' or pcre2_dfa_match(). PCRE2_NO_UTF_CHECK affects only the function to which it
  237. ' is passed. Put these bits at the most significant end of the options word so
  238. ' others can be added next to them.
  239. Const PCRE2_ANCHORED:Int = $80000000
  240. Const PCRE2_NO_UTF_CHECK:Int = $40000000
  241. ' The following option bits can be passed only to pcre2_compile(). However,
  242. ' they may affect compilation, JIT compilation, and/or interpretive execution.
  243. ' The following tags indicate which:
  244. '
  245. ' C alters what is compiled by pcre2_compile()
  246. ' J alters what is compiled by pcre2_jit_compile()
  247. ' M is inspected during pcre2_match() execution
  248. ' D is inspected during pcre2_dfa_match() execution
  249. Const PCRE2_ALLOW_EMPTY_CLASS:Int = $00000001 ' C
  250. Const PCRE2_ALT_BSUX:Int = $00000002 ' C
  251. Const PCRE2_AUTO_CALLOUT:Int = $00000004 ' C
  252. Const PCRE2_CASELESS:Int = $00000008 ' C
  253. Const PCRE2_DOLLAR_ENDONLY:Int = $00000010 ' J M D
  254. Const PCRE2_DOTALL:Int = $00000020 ' C
  255. Const PCRE2_DUPNAMES:Int = $00000040 ' C
  256. Const PCRE2_EXTENDED:Int = $00000080 ' C
  257. Const PCRE2_FIRSTLINE:Int = $00000100 ' J M D
  258. Const PCRE2_MATCH_UNSET_BACKREF:Int = $00000200 ' C J M
  259. Const PCRE2_MULTILINE:Int = $00000400 ' C
  260. Const PCRE2_NEVER_UCP:Int = $00000800 ' C
  261. Const PCRE2_NEVER_UTF:Int = $00001000 ' C
  262. Const PCRE2_NO_AUTO_CAPTURE:Int = $00002000 ' C
  263. Const PCRE2_NO_AUTO_POSSESS:Int = $00004000 ' C
  264. Const PCRE2_NO_DOTSTAR_ANCHOR:Int = $00008000 ' C
  265. Const PCRE2_NO_START_OPTIMIZE:Int = $00010000 ' J M D
  266. Const PCRE2_UCP:Int = $00020000 ' C J M D
  267. Const PCRE2_UNGREEDY:Int = $00040000 ' C
  268. Const PCRE2_UTF:Int = $00080000 ' C J M D
  269. Const PCRE2_NEVER_BACKSLASH_C:Int = $00100000 ' C
  270. Const PCRE2_ALT_CIRCUMFLEX:Int = $00200000 ' J M D
  271. Const PCRE2_ALT_VERBNAMES:Int = $00400000 ' C
  272. Const PCRE2_USE_OFFSET_LIMIT:Int = $00800000 ' J M D
  273. Const PCRE2_EXTENDED_MORE:Int = $01000000 ' C
  274. Const PCRE2_LITERAL:Int = $02000000 ' C
  275. ' These are for pcre2_jit_compile().
  276. Const PCRE2_JIT_COMPLETE:Int = $00000001 ' For full matching
  277. Const PCRE2_JIT_PARTIAL_SOFT:Int = $00000002
  278. Const PCRE2_JIT_PARTIAL_HARD:Int = $00000004
  279. ' These are for pcre2_match() and pcre2_dfa_match(). Note that PCRE2_ANCHORED,
  280. ' and PCRE2_NO_UTF_CHECK can also be passed to these functions, so take care not
  281. ' to define synonyms by mistake.
  282. Const PCRE2_NOTBOL:Int = $00000001
  283. Const PCRE2_NOTEOL:Int = $00000002
  284. Const PCRE2_NOTEMPTY:Int = $00000004 ' ) These two must be kept
  285. Const PCRE2_NOTEMPTY_ATSTART:Int = $00000008 ' ) adjacent to each other.
  286. Const PCRE2_PARTIAL_SOFT:Int = $00000010
  287. Const PCRE2_PARTIAL_HARD:Int = $00000020
  288. ' These are additional options for pcre2_dfa_match().
  289. Const PCRE2_DFA_RESTART:Int = $00000040
  290. Const PCRE2_DFA_SHORTEST:Int = $00000080
  291. ' This is an additional option for pcre2_substitute(), which passes any others through to pcre2_match().
  292. Const PCRE2_SUBSTITUTE_GLOBAL:Int = $00000100
  293. Const PCRE2_SUBSTITUTE_EXTENDED:Int = $00000200
  294. Const PCRE2_SUBSTITUTE_UNSET_EMPTY:Int = $00000400
  295. Const PCRE2_SUBSTITUTE_UNKNOWN_UNSET:Int = $00000800
  296. Const PCRE2_SUBSTITUTE_OVERFLOW_LENGTH:Int = $00001000
  297. ' Request types for Request types for pcre2_pattern_info()
  298. Const PCRE2_INFO_ALLOPTIONS:Int = 0
  299. Const PCRE2_INFO_ARGOPTIONS:Int = 1
  300. Const PCRE2_INFO_BACKREFMAX:Int = 2
  301. Const PCRE2_INFO_BSR:Int = 3
  302. Const PCRE2_INFO_CAPTURECOUNT:Int = 4
  303. Const PCRE2_INFO_FIRSTCODEUNIT:Int = 5
  304. Const PCRE2_INFO_FIRSTCODETYPE:Int = 6
  305. Const PCRE2_INFO_FIRSTBITMAP:Int = 7
  306. Const PCRE2_INFO_HASCRORLF:Int = 8
  307. Const PCRE2_INFO_JCHANGED:Int = 9
  308. Const PCRE2_INFO_JITSIZE:Int = 10
  309. Const PCRE2_INFO_LASTCODEUNIT:Int = 11
  310. Const PCRE2_INFO_LASTCODETYPE:Int = 12
  311. Const PCRE2_INFO_MATCHEMPTY:Int = 13
  312. Const PCRE2_INFO_MATCHLIMIT:Int = 14
  313. Const PCRE2_INFO_MAXLOOKBEHIND:Int = 15
  314. Const PCRE2_INFO_MINLENGTH:Int = 16
  315. Const PCRE2_INFO_NAMECOUNT:Int = 17
  316. Const PCRE2_INFO_NAMEENTRYSIZE:Int = 18
  317. Const PCRE2_INFO_NAMETABLE:Int = 19
  318. Const PCRE2_INFO_NEWLINE:Int = 20
  319. Const PCRE2_INFO_DEPTHLIMIT:Int = 21
  320. Const PCRE2_INFO_RECURSIONLIMIT:Int = PCRE2_INFO_DEPTHLIMIT ' Obsolete synonym
  321. Const PCRE2_INFO_SIZE:Int = 22
  322. Const PCRE2_INFO_HASBACKSLASHC:Int = 23
  323. Const PCRE2_INFO_FRAMESIZE:Int = 24
  324. Const PCRE2_INFO_HEAPLIMIT:Int = 25
  325. Const PCRE2_INFO_EXTRAOPTIONS:Int = 26
  326. ' Newline and \R settings, for use in compile contexts. The newline values
  327. ' must be kept in step with values set in config.h and both sets must all be
  328. ' greater than zero.
  329. Const PCRE2_NEWLINE_CR:Int = 1
  330. Const PCRE2_NEWLINE_LF:Int = 2
  331. Const PCRE2_NEWLINE_CRLF:Int = 3
  332. Const PCRE2_NEWLINE_ANY:Int = 4
  333. Const PCRE2_NEWLINE_ANYCRLF:Int = 5
  334. Const PCRE2_NEWLINE_NUL:Int = 6
  335. Extern
  336. Function _strlen:Int(s:Byte Ptr) = "size_t strlen(const char *)!"
  337. Function pcre2_config_16:Int(what:Int, where_:Int Ptr)
  338. ?ptr64
  339. Function pcre2_compile_16:Byte Ptr(pattern:Short Ptr, patternLength:Long, options:Int, errorcodeptr:Int Ptr, ..
  340. erroffset:Long Ptr, contextptr:Byte Ptr)
  341. Function pcre2_match_16:Int(pattern:Byte Ptr, subject:Byte Ptr, subjectLength:Long, startOffset:Long, ..
  342. options:Int, matchPtr:Byte Ptr, context:Byte Ptr)
  343. Function pcre2_substring_get_bynumber_16:Int(matchPtr:Byte Ptr, stringnumber:Int, ..
  344. stringptr:Short Ptr Ptr, stringlength:Long Ptr)
  345. Function pcre2_substring_get_byname_16:Int(matchPtr:Byte Ptr, name:Short Ptr, stringptr:Short Ptr Ptr, stringlength:Long Ptr)
  346. Function pcre2_get_error_message_16:Int(errorcode:Int, buffer:Short Ptr, length:Long)
  347. Function pcre2_get_ovector_pointer_16:Long Ptr(matchPtr:Byte Ptr)
  348. ?Not ptr64
  349. Function pcre2_compile_16:Byte Ptr(pattern:Short Ptr, patternLength:Int, options:Int, errorcodeptr:Int Ptr, ..
  350. erroffset:Int Ptr, contextptr:Byte Ptr)
  351. Function pcre2_match_16:Int(pattern:Byte Ptr, subject:Byte Ptr, subjectLength:Int, startOffset:Int, ..
  352. options:Int, matchPtr:Byte Ptr, context:Byte Ptr)
  353. Function pcre2_substring_get_bynumber_16:Int(matchPtr:Byte Ptr, stringnumber:Int, ..
  354. stringptr:Short Ptr Ptr, stringlength:Int Ptr)
  355. Function pcre2_substring_get_byname_16:Int(matchPtr:Byte Ptr, name:Short Ptr, stringptr:Short Ptr Ptr, stringlength:Int Ptr)
  356. Function pcre2_get_error_message_16:Int(errorcode:Int, buffer:Short Ptr, length:Int)
  357. Function pcre2_get_ovector_pointer_16:Int Ptr(matchPtr:Byte Ptr)
  358. ?
  359. Function pcre2_substring_free_16(strinptr:Short Ptr)
  360. Function pcre2_match_data_create_from_pattern_16:Byte Ptr(pcre:Byte Ptr, context:Byte Ptr)
  361. Function pcre2_match_data_free_16(matchPtr:Byte Ptr)
  362. Function pcre2_pattern_info_16:Int(pcre:Byte Ptr, what:Int, where_:Int Ptr)
  363. Function pcre2_get_ovector_count_16:Int(matchPtr:Byte Ptr)
  364. Function pcre2_jit_compile_16:Int(pcre:Byte Ptr, options:Int)
  365. Function pcre2_substring_number_from_name_16:Int(pcre:Byte Ptr, name:Short Ptr)
  366. End Extern