common.bmx 19 KB

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