@port-labs/jq-node-bindings 0.0.4 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (286) hide show
  1. package/binding.gyp +3 -3
  2. package/configure +8 -6
  3. package/deps/jq/.travis.yml +184 -35
  4. package/deps/jq/AUTHORS +31 -30
  5. package/deps/jq/COPYING +2 -2
  6. package/deps/jq/KEYS +8 -0
  7. package/deps/jq/Makefile.am +85 -70
  8. package/deps/jq/NEWS +5 -4
  9. package/deps/jq/README.md +18 -9
  10. package/deps/jq/appveyor.yml +53 -0
  11. package/deps/jq/compile-ios.sh +5 -5
  12. package/deps/jq/config/m4/check-math-func.m4 +7 -2
  13. package/deps/jq/configure.ac +130 -68
  14. package/deps/jq/docs/Rakefile +14 -135
  15. package/deps/jq/docs/Rakefile.manual +49 -0
  16. package/deps/jq/docs/Rakefile.website +76 -0
  17. package/deps/jq/docs/content/2.download/default.yml +115 -39
  18. package/deps/jq/docs/content/3.manual/manual.yml +641 -231
  19. package/deps/jq/docs/content/3.manual/v1.3/manual.yml +130 -130
  20. package/deps/jq/docs/content/3.manual/v1.4/manual.yml +160 -160
  21. package/deps/jq/docs/content/3.manual/v1.5/manual.yml +2878 -0
  22. package/deps/jq/docs/content/3.manual/v1.6/manual.yml +3287 -0
  23. package/deps/jq/docs/content/index/index.yml +28 -6
  24. package/deps/jq/docs/public/.htaccess +2 -2
  25. package/deps/jq/docs/public/css/base.scss +141 -59
  26. package/deps/jq/docs/public/js/manual-search.js +52 -0
  27. package/deps/jq/docs/site.yml +1 -10
  28. package/deps/jq/docs/templates/default.liquid +10 -10
  29. package/deps/jq/docs/templates/index.liquid +45 -32
  30. package/deps/jq/docs/templates/manual.liquid +67 -90
  31. package/deps/jq/docs/templates/shared/_footer.liquid +10 -5
  32. package/deps/jq/docs/templates/shared/_head.liquid +17 -12
  33. package/deps/jq/docs/templates/shared/_navbar.liquid +27 -0
  34. package/deps/jq/jq.1.prebuilt +523 -139
  35. package/deps/jq/modules/oniguruma/AUTHORS +1 -0
  36. package/deps/jq/modules/oniguruma/CMakeLists.txt +86 -0
  37. package/deps/jq/modules/oniguruma/COPYING +28 -0
  38. package/deps/jq/modules/oniguruma/ChangeLog +0 -0
  39. package/deps/jq/modules/oniguruma/HISTORY +2138 -0
  40. package/deps/jq/modules/oniguruma/Makefile.am +33 -0
  41. package/deps/jq/modules/oniguruma/NEWS +0 -0
  42. package/deps/jq/modules/oniguruma/README +189 -0
  43. package/deps/jq/modules/oniguruma/README.ja +195 -0
  44. package/deps/jq/modules/oniguruma/README.md +203 -0
  45. package/deps/jq/modules/oniguruma/cmake/dist.cmake +321 -0
  46. package/deps/jq/modules/oniguruma/compile +348 -0
  47. package/deps/jq/modules/oniguruma/config.guess +1754 -0
  48. package/deps/jq/modules/oniguruma/config.sub +1890 -0
  49. package/deps/jq/modules/oniguruma/configure.ac +87 -0
  50. package/deps/jq/modules/oniguruma/contributed/libfuzzer-onig.cpp +31 -0
  51. package/deps/jq/modules/oniguruma/depcomp +791 -0
  52. package/deps/jq/modules/oniguruma/dist.info +10 -0
  53. package/deps/jq/modules/oniguruma/doc/API +660 -0
  54. package/deps/jq/modules/oniguruma/doc/API.ja +667 -0
  55. package/deps/jq/modules/oniguruma/doc/FAQ +12 -0
  56. package/deps/jq/modules/oniguruma/doc/FAQ.ja +22 -0
  57. package/deps/jq/modules/oniguruma/doc/RE +436 -0
  58. package/deps/jq/modules/oniguruma/doc/RE.ja +448 -0
  59. package/deps/jq/modules/oniguruma/doc/UNICODE_PROPERTIES +698 -0
  60. package/deps/jq/modules/oniguruma/index.html +181 -0
  61. package/deps/jq/modules/oniguruma/index_ja.html +184 -0
  62. package/deps/jq/modules/oniguruma/install-sh +541 -0
  63. package/deps/jq/modules/oniguruma/m4/.whatever +0 -0
  64. package/deps/jq/modules/oniguruma/make_win32.bat +3 -0
  65. package/deps/jq/modules/oniguruma/make_win64.bat +3 -0
  66. package/deps/jq/modules/oniguruma/missing +215 -0
  67. package/deps/jq/modules/oniguruma/onig-config.in +78 -0
  68. package/deps/jq/modules/oniguruma/oniguruma.pc.cmake.in +13 -0
  69. package/deps/jq/modules/oniguruma/oniguruma.pc.in +14 -0
  70. package/deps/jq/modules/oniguruma/sample/CMakeLists.txt +28 -0
  71. package/deps/jq/modules/oniguruma/sample/Makefile.am +34 -0
  72. package/deps/jq/modules/oniguruma/sample/bug_fix.c +131 -0
  73. package/deps/jq/modules/oniguruma/sample/crnl.c +127 -0
  74. package/deps/jq/modules/oniguruma/sample/encode.c +308 -0
  75. package/deps/jq/modules/oniguruma/sample/listcap.c +110 -0
  76. package/deps/jq/modules/oniguruma/sample/names.c +75 -0
  77. package/deps/jq/modules/oniguruma/sample/posix.c +96 -0
  78. package/deps/jq/modules/oniguruma/sample/scan.c +88 -0
  79. package/deps/jq/modules/oniguruma/sample/simple.c +59 -0
  80. package/deps/jq/modules/oniguruma/sample/sql.c +76 -0
  81. package/deps/jq/modules/oniguruma/sample/syntax.c +76 -0
  82. package/deps/jq/modules/oniguruma/sample/user_property.c +87 -0
  83. package/deps/jq/modules/oniguruma/src/Makefile.am +58 -0
  84. package/deps/jq/modules/oniguruma/src/Makefile.windows +183 -0
  85. package/deps/jq/modules/oniguruma/src/ascii.c +61 -0
  86. package/deps/jq/modules/oniguruma/src/big5.c +190 -0
  87. package/deps/jq/modules/oniguruma/src/config.h.cmake.in +71 -0
  88. package/deps/jq/modules/oniguruma/src/config.h.win32 +84 -0
  89. package/deps/jq/modules/oniguruma/src/config.h.win64 +84 -0
  90. package/deps/jq/modules/oniguruma/src/cp1251.c +203 -0
  91. package/deps/jq/modules/oniguruma/src/euc_jp.c +310 -0
  92. package/deps/jq/modules/oniguruma/src/euc_jp_prop.c +158 -0
  93. package/deps/jq/modules/oniguruma/src/euc_jp_prop.gperf +27 -0
  94. package/deps/jq/modules/oniguruma/src/euc_kr.c +188 -0
  95. package/deps/jq/modules/oniguruma/src/euc_tw.c +171 -0
  96. package/deps/jq/modules/oniguruma/src/gb18030.c +538 -0
  97. package/deps/jq/modules/oniguruma/src/gperf_fold_key_conv.py +67 -0
  98. package/deps/jq/modules/oniguruma/src/gperf_unfold_key_conv.py +55 -0
  99. package/deps/jq/modules/oniguruma/src/iso8859_1.c +275 -0
  100. package/deps/jq/modules/oniguruma/src/iso8859_10.c +242 -0
  101. package/deps/jq/modules/oniguruma/src/iso8859_11.c +99 -0
  102. package/deps/jq/modules/oniguruma/src/iso8859_13.c +231 -0
  103. package/deps/jq/modules/oniguruma/src/iso8859_14.c +244 -0
  104. package/deps/jq/modules/oniguruma/src/iso8859_15.c +238 -0
  105. package/deps/jq/modules/oniguruma/src/iso8859_16.c +240 -0
  106. package/deps/jq/modules/oniguruma/src/iso8859_2.c +238 -0
  107. package/deps/jq/modules/oniguruma/src/iso8859_3.c +238 -0
  108. package/deps/jq/modules/oniguruma/src/iso8859_4.c +240 -0
  109. package/deps/jq/modules/oniguruma/src/iso8859_5.c +229 -0
  110. package/deps/jq/modules/oniguruma/src/iso8859_6.c +99 -0
  111. package/deps/jq/modules/oniguruma/src/iso8859_7.c +225 -0
  112. package/deps/jq/modules/oniguruma/src/iso8859_8.c +99 -0
  113. package/deps/jq/modules/oniguruma/src/iso8859_9.c +231 -0
  114. package/deps/jq/modules/oniguruma/src/koi8.c +253 -0
  115. package/deps/jq/modules/oniguruma/src/koi8_r.c +215 -0
  116. package/deps/jq/modules/oniguruma/src/make_unicode_fold.sh +22 -0
  117. package/deps/jq/modules/oniguruma/src/make_unicode_fold_data.py +306 -0
  118. package/deps/jq/modules/oniguruma/src/make_unicode_property.sh +18 -0
  119. package/deps/jq/modules/oniguruma/src/make_unicode_property_data.py +545 -0
  120. package/deps/jq/modules/oniguruma/src/mktable.c +1184 -0
  121. package/deps/jq/modules/oniguruma/src/onig_init.c +45 -0
  122. package/deps/jq/modules/oniguruma/src/oniggnu.h +85 -0
  123. package/deps/jq/modules/oniguruma/src/onigposix.h +169 -0
  124. package/deps/jq/modules/oniguruma/src/oniguruma.h +841 -0
  125. package/deps/jq/modules/oniguruma/src/regcomp.c +6300 -0
  126. package/deps/jq/modules/oniguruma/src/regenc.c +917 -0
  127. package/deps/jq/modules/oniguruma/src/regenc.h +243 -0
  128. package/deps/jq/modules/oniguruma/src/regerror.c +393 -0
  129. package/deps/jq/modules/oniguruma/src/regexec.c +3856 -0
  130. package/deps/jq/modules/oniguruma/src/regext.c +202 -0
  131. package/deps/jq/modules/oniguruma/src/reggnu.c +147 -0
  132. package/deps/jq/modules/oniguruma/src/regint.h +779 -0
  133. package/deps/jq/modules/oniguruma/src/regparse.c +5403 -0
  134. package/deps/jq/modules/oniguruma/src/regparse.h +351 -0
  135. package/deps/jq/modules/oniguruma/src/regposerr.c +105 -0
  136. package/deps/jq/modules/oniguruma/src/regposix.c +306 -0
  137. package/deps/jq/modules/oniguruma/src/regsyntax.c +315 -0
  138. package/deps/jq/modules/oniguruma/src/regtrav.c +76 -0
  139. package/deps/jq/modules/oniguruma/src/regversion.c +57 -0
  140. package/deps/jq/modules/oniguruma/src/sjis.c +341 -0
  141. package/deps/jq/modules/oniguruma/src/sjis_prop.c +158 -0
  142. package/deps/jq/modules/oniguruma/src/sjis_prop.gperf +27 -0
  143. package/deps/jq/modules/oniguruma/src/st.c +589 -0
  144. package/deps/jq/modules/oniguruma/src/st.h +68 -0
  145. package/deps/jq/modules/oniguruma/src/unicode-7.0/unicode_fold1_key.c +2250 -0
  146. package/deps/jq/modules/oniguruma/src/unicode-7.0/unicode_fold2_key.c +203 -0
  147. package/deps/jq/modules/oniguruma/src/unicode-7.0/unicode_fold3_key.c +113 -0
  148. package/deps/jq/modules/oniguruma/src/unicode-7.0/unicode_fold_data.c +1225 -0
  149. package/deps/jq/modules/oniguruma/src/unicode-7.0/unicode_property_data.c +24742 -0
  150. package/deps/jq/modules/oniguruma/src/unicode-7.0/unicode_property_data_posix.c +4846 -0
  151. package/deps/jq/modules/oniguruma/src/unicode-7.0/unicode_unfold_key.c +2571 -0
  152. package/deps/jq/modules/oniguruma/src/unicode.c +664 -0
  153. package/deps/jq/modules/oniguruma/src/unicode_fold1_key.c +2548 -0
  154. package/deps/jq/modules/oniguruma/src/unicode_fold2_key.c +203 -0
  155. package/deps/jq/modules/oniguruma/src/unicode_fold3_key.c +113 -0
  156. package/deps/jq/modules/oniguruma/src/unicode_fold_data.c +1366 -0
  157. package/deps/jq/modules/oniguruma/src/unicode_property_data.c +25306 -0
  158. package/deps/jq/modules/oniguruma/src/unicode_property_data_posix.c +4940 -0
  159. package/deps/jq/modules/oniguruma/src/unicode_unfold_key.c +2854 -0
  160. package/deps/jq/modules/oniguruma/src/utf16_be.c +235 -0
  161. package/deps/jq/modules/oniguruma/src/utf16_le.c +245 -0
  162. package/deps/jq/modules/oniguruma/src/utf32_be.c +194 -0
  163. package/deps/jq/modules/oniguruma/src/utf32_le.c +194 -0
  164. package/deps/jq/modules/oniguruma/src/utf8.c +335 -0
  165. package/deps/jq/modules/oniguruma/test/Makefile.am +28 -0
  166. package/deps/jq/modules/oniguruma/test/testc.c +874 -0
  167. package/deps/jq/modules/oniguruma/test/testu.c +916 -0
  168. package/deps/jq/modules/oniguruma/test-driver +153 -0
  169. package/deps/jq/modules/oniguruma/windows/testc.c +869 -0
  170. package/deps/jq/scripts/crosscompile +2 -1
  171. package/deps/jq/scripts/gen_utf8_tables.py +2 -3
  172. package/deps/jq/scripts/update-website +29 -0
  173. package/deps/jq/scripts/version +7 -2
  174. package/deps/jq/sig/jq-release.key +41 -0
  175. package/deps/jq/sig/v1.3/jq-linux-x86.asc +17 -0
  176. package/deps/jq/sig/v1.3/jq-linux-x86_64.asc +17 -0
  177. package/deps/jq/sig/v1.3/jq-osx-x86.asc +17 -0
  178. package/deps/jq/sig/v1.3/jq-osx-x86_64.asc +17 -0
  179. package/deps/jq/sig/v1.3/jq-win32.exe.asc +17 -0
  180. package/deps/jq/sig/v1.3/jq-win64.exe.asc +17 -0
  181. package/deps/jq/sig/v1.3/sha256sum.txt +6 -0
  182. package/deps/jq/sig/v1.4/jq-linux-x86.asc +17 -0
  183. package/deps/jq/sig/v1.4/jq-linux-x86_64.asc +17 -0
  184. package/deps/jq/sig/v1.4/jq-osx-x86.asc +17 -0
  185. package/deps/jq/sig/v1.4/jq-osx-x86_64.asc +17 -0
  186. package/deps/jq/sig/v1.4/jq-solaris11-32.asc +17 -0
  187. package/deps/jq/sig/v1.4/jq-solaris11-64.asc +17 -0
  188. package/deps/jq/sig/v1.4/jq-win32.exe.asc +17 -0
  189. package/deps/jq/sig/v1.4/jq-win64.exe.asc +17 -0
  190. package/deps/jq/sig/v1.4/sha256sum.txt +8 -0
  191. package/deps/jq/sig/v1.5/jq-linux32-no-oniguruma.asc +17 -0
  192. package/deps/jq/sig/v1.5/jq-linux32.asc +17 -0
  193. package/deps/jq/sig/v1.5/jq-linux64.asc +17 -0
  194. package/deps/jq/sig/v1.5/jq-osx-amd64.asc +17 -0
  195. package/deps/jq/sig/v1.5/jq-win32.exe.asc +17 -0
  196. package/deps/jq/sig/v1.5/jq-win64.exe.asc +17 -0
  197. package/deps/jq/sig/v1.5/sha256sum.txt +5 -0
  198. package/deps/jq/sig/v1.5rc1/jq-linux-x86_64-static.asc +17 -0
  199. package/deps/jq/sig/v1.5rc1/jq-win32.exe.asc +17 -0
  200. package/deps/jq/sig/v1.5rc1/jq-win64.exe.asc +17 -0
  201. package/deps/jq/sig/v1.5rc1/sha256sum.txt +3 -0
  202. package/deps/jq/sig/v1.5rc2/jq-linux-x86.asc +17 -0
  203. package/deps/jq/sig/v1.5rc2/jq-linux-x86_64.asc +17 -0
  204. package/deps/jq/sig/v1.5rc2/jq-osx-x86_64.asc +17 -0
  205. package/deps/jq/sig/v1.5rc2/jq-win32.exe.asc +17 -0
  206. package/deps/jq/sig/v1.5rc2/jq-win64.exe.asc +17 -0
  207. package/deps/jq/sig/v1.5rc2/sha256sum.txt +5 -0
  208. package/deps/jq/sig/v1.6/jq-linux32.asc +16 -0
  209. package/deps/jq/sig/v1.6/jq-linux64.asc +16 -0
  210. package/deps/jq/sig/v1.6/jq-osx-amd64.asc +16 -0
  211. package/deps/jq/sig/v1.6/jq-win32.exe.asc +16 -0
  212. package/deps/jq/sig/v1.6/jq-win64.exe.asc +16 -0
  213. package/deps/jq/sig/v1.6/sha256sum.txt +5 -0
  214. package/deps/jq/{builtin.c → src/builtin.c} +449 -344
  215. package/deps/jq/{builtin.h → src/builtin.h} +0 -0
  216. package/deps/jq/src/builtin.jq +311 -0
  217. package/deps/jq/{bytecode.c → src/bytecode.c} +0 -0
  218. package/deps/jq/{bytecode.h → src/bytecode.h} +0 -0
  219. package/deps/jq/{compile.c → src/compile.c} +213 -37
  220. package/deps/jq/{compile.h → src/compile.h} +7 -2
  221. package/deps/jq/{exec_stack.h → src/exec_stack.h} +0 -0
  222. package/deps/jq/{execute.c → src/execute.c} +127 -24
  223. package/deps/jq/{inject_errors.c → src/inject_errors.c} +0 -0
  224. package/deps/jq/{jq.h → src/jq.h} +13 -2
  225. package/deps/jq/{jq_parser.h → src/jq_parser.h} +0 -0
  226. package/deps/jq/{jq_test.c → src/jq_test.c} +1 -1
  227. package/deps/jq/{jv.c → src/jv.c} +24 -5
  228. package/deps/jq/{jv.h → src/jv.h} +46 -11
  229. package/deps/jq/{jv_alloc.c → src/jv_alloc.c} +0 -0
  230. package/deps/jq/{jv_alloc.h → src/jv_alloc.h} +0 -0
  231. package/deps/jq/{jv_aux.c → src/jv_aux.c} +38 -14
  232. package/deps/jq/{jv_dtoa.c → src/jv_dtoa.c} +4 -5
  233. package/deps/jq/{jv_dtoa.h → src/jv_dtoa.h} +0 -0
  234. package/deps/jq/src/jv_file.c +81 -0
  235. package/deps/jq/{jv_parse.c → src/jv_parse.c} +8 -2
  236. package/deps/jq/{jv_print.c → src/jv_print.c} +80 -27
  237. package/deps/jq/{jv_unicode.c → src/jv_unicode.c} +28 -4
  238. package/deps/jq/{jv_unicode.h → src/jv_unicode.h} +1 -0
  239. package/deps/jq/{jv_utf8_tables.h → src/jv_utf8_tables.h} +0 -0
  240. package/deps/jq/{lexer.c → src/lexer.c} +317 -292
  241. package/deps/jq/{lexer.h → src/lexer.h} +16 -12
  242. package/deps/jq/{lexer.l → src/lexer.l} +5 -4
  243. package/deps/jq/src/libm.h +291 -0
  244. package/deps/jq/{linker.c → src/linker.c} +5 -3
  245. package/deps/jq/{linker.h → src/linker.h} +0 -0
  246. package/deps/jq/{locfile.c → src/locfile.c} +1 -1
  247. package/deps/jq/{locfile.h → src/locfile.h} +0 -0
  248. package/deps/jq/{main.c → src/main.c} +202 -100
  249. package/deps/jq/{opcode_list.h → src/opcode_list.h} +4 -0
  250. package/deps/jq/{parser.c → src/parser.c} +1149 -1069
  251. package/deps/jq/{parser.h → src/parser.h} +28 -24
  252. package/deps/jq/{parser.y → src/parser.y} +108 -52
  253. package/deps/jq/{util.c → src/util.c} +12 -9
  254. package/deps/jq/{util.h → src/util.h} +0 -0
  255. package/deps/jq/tests/base64.test +35 -0
  256. package/deps/jq/tests/base64test +5 -0
  257. package/deps/jq/tests/jq-f-test.sh +4 -0
  258. package/deps/jq/tests/jq.test +305 -21
  259. package/deps/jq/tests/jqtest +1 -1
  260. package/deps/jq/tests/mantest +1 -1
  261. package/deps/jq/tests/onig.test +13 -0
  262. package/deps/jq/tests/onigtest +1 -1
  263. package/deps/jq/tests/optional.test +20 -0
  264. package/deps/jq/tests/optionaltest +5 -0
  265. package/deps/jq/tests/setup +7 -1
  266. package/deps/jq/tests/shtest +133 -29
  267. package/deps/jq/tests/utf8-truncate.jq +3 -0
  268. package/deps/jq/tests/utf8test +10 -0
  269. package/lib/index.js +7 -1
  270. package/package.json +3 -3
  271. package/test/santiy.test.js +24 -0
  272. package/deps/jq/docs/default_manpage.md +0 -22
  273. package/deps/jq/docs/public/bootstrap/css/bootstrap-responsive.css +0 -1058
  274. package/deps/jq/docs/public/bootstrap/css/bootstrap-responsive.min.css +0 -9
  275. package/deps/jq/docs/public/bootstrap/css/bootstrap.css +0 -5224
  276. package/deps/jq/docs/public/bootstrap/css/bootstrap.min.css +0 -9
  277. package/deps/jq/docs/public/bootstrap/img/glyphicons-halflings-white.png +0 -0
  278. package/deps/jq/docs/public/bootstrap/img/glyphicons-halflings.png +0 -0
  279. package/deps/jq/docs/public/bootstrap/js/bootstrap.js +0 -2027
  280. package/deps/jq/docs/public/bootstrap/js/bootstrap.min.js +0 -6
  281. package/deps/jq/docs/templates/shared/_header.liquid +0 -26
  282. package/deps/jq/jq.1.default +0 -39
  283. package/deps/jq/jv_file.c +0 -49
  284. package/deps/jq/libm.h +0 -160
  285. package/deps/jq/setup.sh +0 -33
  286. package/reports/jest-port-api.xml +0 -35
@@ -0,0 +1,841 @@
1
+ #ifndef ONIGURUMA_H
2
+ #define ONIGURUMA_H
3
+ /**********************************************************************
4
+ oniguruma.h - Oniguruma (regular expression library)
5
+ **********************************************************************/
6
+ /*-
7
+ * Copyright (c) 2002-2016 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
8
+ * All rights reserved.
9
+ *
10
+ * Redistribution and use in source and binary forms, with or without
11
+ * modification, are permitted provided that the following conditions
12
+ * are met:
13
+ * 1. Redistributions of source code must retain the above copyright
14
+ * notice, this list of conditions and the following disclaimer.
15
+ * 2. Redistributions in binary form must reproduce the above copyright
16
+ * notice, this list of conditions and the following disclaimer in the
17
+ * documentation and/or other materials provided with the distribution.
18
+ *
19
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
20
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
23
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29
+ * SUCH DAMAGE.
30
+ */
31
+
32
+ #ifdef __cplusplus
33
+ extern "C" {
34
+ #endif
35
+
36
+ #define ONIGURUMA
37
+ #define ONIGURUMA_VERSION_MAJOR 6
38
+ #define ONIGURUMA_VERSION_MINOR 1
39
+ #define ONIGURUMA_VERSION_TEENY 3
40
+
41
+ #ifdef __cplusplus
42
+ # ifndef HAVE_PROTOTYPES
43
+ # define HAVE_PROTOTYPES 1
44
+ # endif
45
+ # ifndef HAVE_STDARG_PROTOTYPES
46
+ # define HAVE_STDARG_PROTOTYPES 1
47
+ # endif
48
+ #endif
49
+
50
+ /* escape Mac OS X/Xcode 2.4/gcc 4.0.1 problem */
51
+ #if defined(__APPLE__) && defined(__GNUC__) && __GNUC__ >= 4
52
+ # ifndef HAVE_STDARG_PROTOTYPES
53
+ # define HAVE_STDARG_PROTOTYPES 1
54
+ # endif
55
+ #endif
56
+
57
+ #ifdef HAVE_STDARG_H
58
+ # ifndef HAVE_STDARG_PROTOTYPES
59
+ # define HAVE_STDARG_PROTOTYPES 1
60
+ # endif
61
+ #endif
62
+
63
+ #ifndef P_
64
+ #if defined(__STDC__) || defined(_WIN32)
65
+ # define P_(args) args
66
+ #else
67
+ # define P_(args) ()
68
+ #endif
69
+ #endif
70
+
71
+ #ifndef PV_
72
+ #ifdef HAVE_STDARG_PROTOTYPES
73
+ # define PV_(args) args
74
+ #else
75
+ # define PV_(args) ()
76
+ #endif
77
+ #endif
78
+
79
+ #ifndef ONIG_EXTERN
80
+ #if defined(_WIN32) && !defined(__GNUC__)
81
+ #if defined(EXPORT) || defined(RUBY_EXPORT)
82
+ #define ONIG_EXTERN extern __declspec(dllexport)
83
+ #else
84
+ #define ONIG_EXTERN extern __declspec(dllimport)
85
+ #endif
86
+ #endif
87
+ #endif
88
+
89
+ #ifndef ONIG_EXTERN
90
+ #define ONIG_EXTERN extern
91
+ #endif
92
+
93
+ /* PART: character encoding */
94
+
95
+ #ifndef ONIG_ESCAPE_UCHAR_COLLISION
96
+ #define UChar OnigUChar
97
+ #endif
98
+
99
+ #ifdef _WIN32
100
+ #include <windows.h>
101
+ #endif
102
+
103
+ typedef unsigned int OnigCodePoint;
104
+ typedef unsigned char OnigUChar;
105
+ typedef unsigned int OnigCtype;
106
+ typedef unsigned int OnigLen;
107
+
108
+ #define ONIG_INFINITE_DISTANCE ~((OnigLen )0)
109
+
110
+ typedef unsigned int OnigCaseFoldType; /* case fold flag */
111
+
112
+ ONIG_EXTERN OnigCaseFoldType OnigDefaultCaseFoldFlag;
113
+
114
+ /* #define ONIGENC_CASE_FOLD_HIRAGANA_KATAKANA (1<<1) */
115
+ /* #define ONIGENC_CASE_FOLD_KATAKANA_WIDTH (1<<2) */
116
+ #define ONIGENC_CASE_FOLD_TURKISH_AZERI (1<<20)
117
+ #define INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR (1<<30)
118
+
119
+ #define ONIGENC_CASE_FOLD_MIN INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR
120
+ #define ONIGENC_CASE_FOLD_DEFAULT OnigDefaultCaseFoldFlag
121
+
122
+
123
+ #define ONIGENC_MAX_COMP_CASE_FOLD_CODE_LEN 3
124
+ #define ONIGENC_GET_CASE_FOLD_CODES_MAX_NUM 13
125
+ /* 13 => Unicode:0x1ffc */
126
+
127
+ /* code range */
128
+ #define ONIGENC_CODE_RANGE_NUM(range) ((int )range[0])
129
+ #define ONIGENC_CODE_RANGE_FROM(range,i) range[((i)*2) + 1]
130
+ #define ONIGENC_CODE_RANGE_TO(range,i) range[((i)*2) + 2]
131
+
132
+ typedef struct {
133
+ int byte_len; /* argument(original) character(s) byte length */
134
+ int code_len; /* number of code */
135
+ OnigCodePoint code[ONIGENC_MAX_COMP_CASE_FOLD_CODE_LEN];
136
+ } OnigCaseFoldCodeItem;
137
+
138
+ typedef struct {
139
+ OnigCodePoint esc;
140
+ OnigCodePoint anychar;
141
+ OnigCodePoint anytime;
142
+ OnigCodePoint zero_or_one_time;
143
+ OnigCodePoint one_or_more_time;
144
+ OnigCodePoint anychar_anytime;
145
+ } OnigMetaCharTableType;
146
+
147
+ typedef int (*OnigApplyAllCaseFoldFunc)(OnigCodePoint from, OnigCodePoint* to, int to_len, void* arg);
148
+
149
+ typedef struct OnigEncodingTypeST {
150
+ int (*mbc_enc_len)(const OnigUChar* p);
151
+ const char* name;
152
+ int max_enc_len;
153
+ int min_enc_len;
154
+ int (*is_mbc_newline)(const OnigUChar* p, const OnigUChar* end);
155
+ OnigCodePoint (*mbc_to_code)(const OnigUChar* p, const OnigUChar* end);
156
+ int (*code_to_mbclen)(OnigCodePoint code);
157
+ int (*code_to_mbc)(OnigCodePoint code, OnigUChar *buf);
158
+ int (*mbc_case_fold)(OnigCaseFoldType flag, const OnigUChar** pp, const OnigUChar* end, OnigUChar* to);
159
+ int (*apply_all_case_fold)(OnigCaseFoldType flag, OnigApplyAllCaseFoldFunc f, void* arg);
160
+ int (*get_case_fold_codes_by_str)(OnigCaseFoldType flag, const OnigUChar* p, const OnigUChar* end, OnigCaseFoldCodeItem acs[]);
161
+ int (*property_name_to_ctype)(struct OnigEncodingTypeST* enc, OnigUChar* p, OnigUChar* end);
162
+ int (*is_code_ctype)(OnigCodePoint code, OnigCtype ctype);
163
+ int (*get_ctype_code_range)(OnigCtype ctype, OnigCodePoint* sb_out, const OnigCodePoint* ranges[]);
164
+ OnigUChar* (*left_adjust_char_head)(const OnigUChar* start, const OnigUChar* p);
165
+ int (*is_allowed_reverse_match)(const OnigUChar* p, const OnigUChar* end);
166
+ int (*init)(void);
167
+ int (*is_initialized)(void);
168
+ int (*is_valid_mbc_string)(const OnigUChar* s, const OnigUChar* end);
169
+ } OnigEncodingType;
170
+
171
+ typedef OnigEncodingType* OnigEncoding;
172
+
173
+ ONIG_EXTERN OnigEncodingType OnigEncodingASCII;
174
+ ONIG_EXTERN OnigEncodingType OnigEncodingISO_8859_1;
175
+ ONIG_EXTERN OnigEncodingType OnigEncodingISO_8859_2;
176
+ ONIG_EXTERN OnigEncodingType OnigEncodingISO_8859_3;
177
+ ONIG_EXTERN OnigEncodingType OnigEncodingISO_8859_4;
178
+ ONIG_EXTERN OnigEncodingType OnigEncodingISO_8859_5;
179
+ ONIG_EXTERN OnigEncodingType OnigEncodingISO_8859_6;
180
+ ONIG_EXTERN OnigEncodingType OnigEncodingISO_8859_7;
181
+ ONIG_EXTERN OnigEncodingType OnigEncodingISO_8859_8;
182
+ ONIG_EXTERN OnigEncodingType OnigEncodingISO_8859_9;
183
+ ONIG_EXTERN OnigEncodingType OnigEncodingISO_8859_10;
184
+ ONIG_EXTERN OnigEncodingType OnigEncodingISO_8859_11;
185
+ ONIG_EXTERN OnigEncodingType OnigEncodingISO_8859_13;
186
+ ONIG_EXTERN OnigEncodingType OnigEncodingISO_8859_14;
187
+ ONIG_EXTERN OnigEncodingType OnigEncodingISO_8859_15;
188
+ ONIG_EXTERN OnigEncodingType OnigEncodingISO_8859_16;
189
+ ONIG_EXTERN OnigEncodingType OnigEncodingUTF8;
190
+ ONIG_EXTERN OnigEncodingType OnigEncodingUTF16_BE;
191
+ ONIG_EXTERN OnigEncodingType OnigEncodingUTF16_LE;
192
+ ONIG_EXTERN OnigEncodingType OnigEncodingUTF32_BE;
193
+ ONIG_EXTERN OnigEncodingType OnigEncodingUTF32_LE;
194
+ ONIG_EXTERN OnigEncodingType OnigEncodingEUC_JP;
195
+ ONIG_EXTERN OnigEncodingType OnigEncodingEUC_TW;
196
+ ONIG_EXTERN OnigEncodingType OnigEncodingEUC_KR;
197
+ ONIG_EXTERN OnigEncodingType OnigEncodingEUC_CN;
198
+ ONIG_EXTERN OnigEncodingType OnigEncodingSJIS;
199
+ ONIG_EXTERN OnigEncodingType OnigEncodingKOI8;
200
+ ONIG_EXTERN OnigEncodingType OnigEncodingKOI8_R;
201
+ ONIG_EXTERN OnigEncodingType OnigEncodingCP1251;
202
+ ONIG_EXTERN OnigEncodingType OnigEncodingBIG5;
203
+ ONIG_EXTERN OnigEncodingType OnigEncodingGB18030;
204
+
205
+ #define ONIG_ENCODING_ASCII (&OnigEncodingASCII)
206
+ #define ONIG_ENCODING_ISO_8859_1 (&OnigEncodingISO_8859_1)
207
+ #define ONIG_ENCODING_ISO_8859_2 (&OnigEncodingISO_8859_2)
208
+ #define ONIG_ENCODING_ISO_8859_3 (&OnigEncodingISO_8859_3)
209
+ #define ONIG_ENCODING_ISO_8859_4 (&OnigEncodingISO_8859_4)
210
+ #define ONIG_ENCODING_ISO_8859_5 (&OnigEncodingISO_8859_5)
211
+ #define ONIG_ENCODING_ISO_8859_6 (&OnigEncodingISO_8859_6)
212
+ #define ONIG_ENCODING_ISO_8859_7 (&OnigEncodingISO_8859_7)
213
+ #define ONIG_ENCODING_ISO_8859_8 (&OnigEncodingISO_8859_8)
214
+ #define ONIG_ENCODING_ISO_8859_9 (&OnigEncodingISO_8859_9)
215
+ #define ONIG_ENCODING_ISO_8859_10 (&OnigEncodingISO_8859_10)
216
+ #define ONIG_ENCODING_ISO_8859_11 (&OnigEncodingISO_8859_11)
217
+ #define ONIG_ENCODING_ISO_8859_13 (&OnigEncodingISO_8859_13)
218
+ #define ONIG_ENCODING_ISO_8859_14 (&OnigEncodingISO_8859_14)
219
+ #define ONIG_ENCODING_ISO_8859_15 (&OnigEncodingISO_8859_15)
220
+ #define ONIG_ENCODING_ISO_8859_16 (&OnigEncodingISO_8859_16)
221
+ #define ONIG_ENCODING_UTF8 (&OnigEncodingUTF8)
222
+ #define ONIG_ENCODING_UTF16_BE (&OnigEncodingUTF16_BE)
223
+ #define ONIG_ENCODING_UTF16_LE (&OnigEncodingUTF16_LE)
224
+ #define ONIG_ENCODING_UTF32_BE (&OnigEncodingUTF32_BE)
225
+ #define ONIG_ENCODING_UTF32_LE (&OnigEncodingUTF32_LE)
226
+ #define ONIG_ENCODING_EUC_JP (&OnigEncodingEUC_JP)
227
+ #define ONIG_ENCODING_EUC_TW (&OnigEncodingEUC_TW)
228
+ #define ONIG_ENCODING_EUC_KR (&OnigEncodingEUC_KR)
229
+ #define ONIG_ENCODING_EUC_CN (&OnigEncodingEUC_CN)
230
+ #define ONIG_ENCODING_SJIS (&OnigEncodingSJIS)
231
+ #define ONIG_ENCODING_KOI8 (&OnigEncodingKOI8)
232
+ #define ONIG_ENCODING_KOI8_R (&OnigEncodingKOI8_R)
233
+ #define ONIG_ENCODING_CP1251 (&OnigEncodingCP1251)
234
+ #define ONIG_ENCODING_BIG5 (&OnigEncodingBIG5)
235
+ #define ONIG_ENCODING_GB18030 (&OnigEncodingGB18030)
236
+
237
+ #define ONIG_ENCODING_UNDEF ((OnigEncoding )0)
238
+
239
+
240
+ /* work size */
241
+ #define ONIGENC_CODE_TO_MBC_MAXLEN 7
242
+ #define ONIGENC_MBC_CASE_FOLD_MAXLEN 18
243
+ /* 18: 6(max-byte) * 3(case-fold chars) */
244
+
245
+ /* character types */
246
+ #define ONIGENC_CTYPE_NEWLINE 0
247
+ #define ONIGENC_CTYPE_ALPHA 1
248
+ #define ONIGENC_CTYPE_BLANK 2
249
+ #define ONIGENC_CTYPE_CNTRL 3
250
+ #define ONIGENC_CTYPE_DIGIT 4
251
+ #define ONIGENC_CTYPE_GRAPH 5
252
+ #define ONIGENC_CTYPE_LOWER 6
253
+ #define ONIGENC_CTYPE_PRINT 7
254
+ #define ONIGENC_CTYPE_PUNCT 8
255
+ #define ONIGENC_CTYPE_SPACE 9
256
+ #define ONIGENC_CTYPE_UPPER 10
257
+ #define ONIGENC_CTYPE_XDIGIT 11
258
+ #define ONIGENC_CTYPE_WORD 12
259
+ #define ONIGENC_CTYPE_ALNUM 13 /* alpha || digit */
260
+ #define ONIGENC_CTYPE_ASCII 14
261
+ #define ONIGENC_MAX_STD_CTYPE ONIGENC_CTYPE_ASCII
262
+
263
+
264
+ #define onig_enc_len(enc,p,end) ONIGENC_MBC_ENC_LEN(enc,p)
265
+
266
+ #define ONIGENC_IS_UNDEF(enc) ((enc) == ONIG_ENCODING_UNDEF)
267
+ #define ONIGENC_IS_SINGLEBYTE(enc) (ONIGENC_MBC_MAXLEN(enc) == 1)
268
+ #define ONIGENC_IS_MBC_HEAD(enc,p) (ONIGENC_MBC_ENC_LEN(enc,p) != 1)
269
+ #define ONIGENC_IS_MBC_ASCII(p) (*(p) < 128)
270
+ #define ONIGENC_IS_CODE_ASCII(code) ((code) < 128)
271
+ #define ONIGENC_IS_MBC_WORD(enc,s,end) \
272
+ ONIGENC_IS_CODE_WORD(enc,ONIGENC_MBC_TO_CODE(enc,s,end))
273
+
274
+
275
+ #define ONIGENC_NAME(enc) ((enc)->name)
276
+
277
+ #define ONIGENC_MBC_CASE_FOLD(enc,flag,pp,end,buf) \
278
+ (enc)->mbc_case_fold(flag,(const OnigUChar** )pp,end,buf)
279
+ #define ONIGENC_IS_ALLOWED_REVERSE_MATCH(enc,s,end) \
280
+ (enc)->is_allowed_reverse_match(s,end)
281
+ #define ONIGENC_LEFT_ADJUST_CHAR_HEAD(enc,start,s) \
282
+ (enc)->left_adjust_char_head(start, s)
283
+ #define ONIGENC_IS_VALID_MBC_STRING(enc,s,end) \
284
+ (enc)->is_valid_mbc_string(s,end)
285
+ #define ONIGENC_APPLY_ALL_CASE_FOLD(enc,case_fold_flag,f,arg) \
286
+ (enc)->apply_all_case_fold(case_fold_flag,f,arg)
287
+ #define ONIGENC_GET_CASE_FOLD_CODES_BY_STR(enc,case_fold_flag,p,end,acs) \
288
+ (enc)->get_case_fold_codes_by_str(case_fold_flag,p,end,acs)
289
+ #define ONIGENC_STEP_BACK(enc,start,s,n) \
290
+ onigenc_step_back((enc),(start),(s),(n))
291
+
292
+ #define ONIGENC_MBC_ENC_LEN(enc,p) (enc)->mbc_enc_len(p)
293
+ #define ONIGENC_MBC_MAXLEN(enc) ((enc)->max_enc_len)
294
+ #define ONIGENC_MBC_MAXLEN_DIST(enc) ONIGENC_MBC_MAXLEN(enc)
295
+ #define ONIGENC_MBC_MINLEN(enc) ((enc)->min_enc_len)
296
+ #define ONIGENC_IS_MBC_NEWLINE(enc,p,end) (enc)->is_mbc_newline((p),(end))
297
+ #define ONIGENC_MBC_TO_CODE(enc,p,end) (enc)->mbc_to_code((p),(end))
298
+ #define ONIGENC_CODE_TO_MBCLEN(enc,code) (enc)->code_to_mbclen(code)
299
+ #define ONIGENC_CODE_TO_MBC(enc,code,buf) (enc)->code_to_mbc(code,buf)
300
+ #define ONIGENC_PROPERTY_NAME_TO_CTYPE(enc,p,end) \
301
+ (enc)->property_name_to_ctype(enc,p,end)
302
+
303
+ #define ONIGENC_IS_CODE_CTYPE(enc,code,ctype) (enc)->is_code_ctype(code,ctype)
304
+
305
+ #define ONIGENC_IS_CODE_NEWLINE(enc,code) \
306
+ ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_NEWLINE)
307
+ #define ONIGENC_IS_CODE_GRAPH(enc,code) \
308
+ ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_GRAPH)
309
+ #define ONIGENC_IS_CODE_PRINT(enc,code) \
310
+ ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_PRINT)
311
+ #define ONIGENC_IS_CODE_ALNUM(enc,code) \
312
+ ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_ALNUM)
313
+ #define ONIGENC_IS_CODE_ALPHA(enc,code) \
314
+ ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_ALPHA)
315
+ #define ONIGENC_IS_CODE_LOWER(enc,code) \
316
+ ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_LOWER)
317
+ #define ONIGENC_IS_CODE_UPPER(enc,code) \
318
+ ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_UPPER)
319
+ #define ONIGENC_IS_CODE_CNTRL(enc,code) \
320
+ ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_CNTRL)
321
+ #define ONIGENC_IS_CODE_PUNCT(enc,code) \
322
+ ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_PUNCT)
323
+ #define ONIGENC_IS_CODE_SPACE(enc,code) \
324
+ ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_SPACE)
325
+ #define ONIGENC_IS_CODE_BLANK(enc,code) \
326
+ ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_BLANK)
327
+ #define ONIGENC_IS_CODE_DIGIT(enc,code) \
328
+ ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_DIGIT)
329
+ #define ONIGENC_IS_CODE_XDIGIT(enc,code) \
330
+ ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_XDIGIT)
331
+ #define ONIGENC_IS_CODE_WORD(enc,code) \
332
+ ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_WORD)
333
+
334
+ #define ONIGENC_GET_CTYPE_CODE_RANGE(enc,ctype,sbout,ranges) \
335
+ (enc)->get_ctype_code_range(ctype,sbout,ranges)
336
+
337
+ ONIG_EXTERN
338
+ OnigUChar* onigenc_step_back P_((OnigEncoding enc, const OnigUChar* start, const OnigUChar* s, int n));
339
+
340
+
341
+ /* encoding API */
342
+ ONIG_EXTERN
343
+ int onigenc_init P_((void));
344
+ ONIG_EXTERN
345
+ int onig_initialize_encoding P_((OnigEncoding enc));
346
+ ONIG_EXTERN
347
+ int onigenc_set_default_encoding P_((OnigEncoding enc));
348
+ ONIG_EXTERN
349
+ OnigEncoding onigenc_get_default_encoding P_((void));
350
+ ONIG_EXTERN
351
+ void onigenc_set_default_caseconv_table P_((const OnigUChar* table));
352
+ ONIG_EXTERN
353
+ OnigUChar* onigenc_get_right_adjust_char_head_with_prev P_((OnigEncoding enc, const OnigUChar* start, const OnigUChar* s, const OnigUChar** prev));
354
+ ONIG_EXTERN
355
+ OnigUChar* onigenc_get_prev_char_head P_((OnigEncoding enc, const OnigUChar* start, const OnigUChar* s));
356
+ ONIG_EXTERN
357
+ OnigUChar* onigenc_get_left_adjust_char_head P_((OnigEncoding enc, const OnigUChar* start, const OnigUChar* s));
358
+ ONIG_EXTERN
359
+ OnigUChar* onigenc_get_right_adjust_char_head P_((OnigEncoding enc, const OnigUChar* start, const OnigUChar* s));
360
+ ONIG_EXTERN
361
+ int onigenc_strlen P_((OnigEncoding enc, const OnigUChar* p, const OnigUChar* end));
362
+ ONIG_EXTERN
363
+ int onigenc_strlen_null P_((OnigEncoding enc, const OnigUChar* p));
364
+ ONIG_EXTERN
365
+ int onigenc_str_bytelen_null P_((OnigEncoding enc, const OnigUChar* p));
366
+ ONIG_EXTERN
367
+ int onigenc_is_valid_mbc_string P_((OnigEncoding enc, const OnigUChar* s, const OnigUChar* end));
368
+
369
+
370
+
371
+ /* PART: regular expression */
372
+
373
+ /* config parameters */
374
+ #define ONIG_NREGION 10
375
+ #define ONIG_MAX_CAPTURE_NUM 32767
376
+ #define ONIG_MAX_BACKREF_NUM 1000
377
+ #define ONIG_MAX_REPEAT_NUM 100000
378
+ #define ONIG_MAX_MULTI_BYTE_RANGES_NUM 10000
379
+ /* constants */
380
+ #define ONIG_MAX_ERROR_MESSAGE_LEN 90
381
+
382
+ typedef unsigned int OnigOptionType;
383
+
384
+ #define ONIG_OPTION_DEFAULT ONIG_OPTION_NONE
385
+
386
+ /* options */
387
+ #define ONIG_OPTION_NONE 0U
388
+ #define ONIG_OPTION_IGNORECASE 1U
389
+ #define ONIG_OPTION_EXTEND (ONIG_OPTION_IGNORECASE << 1)
390
+ #define ONIG_OPTION_MULTILINE (ONIG_OPTION_EXTEND << 1)
391
+ #define ONIG_OPTION_SINGLELINE (ONIG_OPTION_MULTILINE << 1)
392
+ #define ONIG_OPTION_FIND_LONGEST (ONIG_OPTION_SINGLELINE << 1)
393
+ #define ONIG_OPTION_FIND_NOT_EMPTY (ONIG_OPTION_FIND_LONGEST << 1)
394
+ #define ONIG_OPTION_NEGATE_SINGLELINE (ONIG_OPTION_FIND_NOT_EMPTY << 1)
395
+ #define ONIG_OPTION_DONT_CAPTURE_GROUP (ONIG_OPTION_NEGATE_SINGLELINE << 1)
396
+ #define ONIG_OPTION_CAPTURE_GROUP (ONIG_OPTION_DONT_CAPTURE_GROUP << 1)
397
+ /* options (search time) */
398
+ #define ONIG_OPTION_NOTBOL (ONIG_OPTION_CAPTURE_GROUP << 1)
399
+ #define ONIG_OPTION_NOTEOL (ONIG_OPTION_NOTBOL << 1)
400
+ #define ONIG_OPTION_POSIX_REGION (ONIG_OPTION_NOTEOL << 1)
401
+ #define ONIG_OPTION_CHECK_VALIDITY_OF_STRING (ONIG_OPTION_POSIX_REGION << 1)
402
+ #define ONIG_OPTION_MAXBIT ONIG_OPTION_CHECK_VALIDITY_OF_STRING /* limit */
403
+
404
+ #define ONIG_OPTION_ON(options,regopt) ((options) |= (regopt))
405
+ #define ONIG_OPTION_OFF(options,regopt) ((options) &= ~(regopt))
406
+ #define ONIG_IS_OPTION_ON(options,option) ((options) & (option))
407
+
408
+ /* syntax */
409
+ typedef struct {
410
+ unsigned int op;
411
+ unsigned int op2;
412
+ unsigned int behavior;
413
+ OnigOptionType options; /* default option */
414
+ OnigMetaCharTableType meta_char_table;
415
+ } OnigSyntaxType;
416
+
417
+ ONIG_EXTERN OnigSyntaxType OnigSyntaxASIS;
418
+ ONIG_EXTERN OnigSyntaxType OnigSyntaxPosixBasic;
419
+ ONIG_EXTERN OnigSyntaxType OnigSyntaxPosixExtended;
420
+ ONIG_EXTERN OnigSyntaxType OnigSyntaxEmacs;
421
+ ONIG_EXTERN OnigSyntaxType OnigSyntaxGrep;
422
+ ONIG_EXTERN OnigSyntaxType OnigSyntaxGnuRegex;
423
+ ONIG_EXTERN OnigSyntaxType OnigSyntaxJava;
424
+ ONIG_EXTERN OnigSyntaxType OnigSyntaxPerl;
425
+ ONIG_EXTERN OnigSyntaxType OnigSyntaxPerl_NG;
426
+ ONIG_EXTERN OnigSyntaxType OnigSyntaxRuby;
427
+
428
+ /* predefined syntaxes (see regsyntax.c) */
429
+ #define ONIG_SYNTAX_ASIS (&OnigSyntaxASIS)
430
+ #define ONIG_SYNTAX_POSIX_BASIC (&OnigSyntaxPosixBasic)
431
+ #define ONIG_SYNTAX_POSIX_EXTENDED (&OnigSyntaxPosixExtended)
432
+ #define ONIG_SYNTAX_EMACS (&OnigSyntaxEmacs)
433
+ #define ONIG_SYNTAX_GREP (&OnigSyntaxGrep)
434
+ #define ONIG_SYNTAX_GNU_REGEX (&OnigSyntaxGnuRegex)
435
+ #define ONIG_SYNTAX_JAVA (&OnigSyntaxJava)
436
+ #define ONIG_SYNTAX_PERL (&OnigSyntaxPerl)
437
+ #define ONIG_SYNTAX_PERL_NG (&OnigSyntaxPerl_NG)
438
+ #define ONIG_SYNTAX_RUBY (&OnigSyntaxRuby)
439
+
440
+ /* default syntax */
441
+ ONIG_EXTERN OnigSyntaxType* OnigDefaultSyntax;
442
+ #define ONIG_SYNTAX_DEFAULT OnigDefaultSyntax
443
+
444
+ /* syntax (operators) */
445
+ #define ONIG_SYN_OP_VARIABLE_META_CHARACTERS (1U<<0)
446
+ #define ONIG_SYN_OP_DOT_ANYCHAR (1U<<1) /* . */
447
+ #define ONIG_SYN_OP_ASTERISK_ZERO_INF (1U<<2) /* * */
448
+ #define ONIG_SYN_OP_ESC_ASTERISK_ZERO_INF (1U<<3)
449
+ #define ONIG_SYN_OP_PLUS_ONE_INF (1U<<4) /* + */
450
+ #define ONIG_SYN_OP_ESC_PLUS_ONE_INF (1U<<5)
451
+ #define ONIG_SYN_OP_QMARK_ZERO_ONE (1U<<6) /* ? */
452
+ #define ONIG_SYN_OP_ESC_QMARK_ZERO_ONE (1U<<7)
453
+ #define ONIG_SYN_OP_BRACE_INTERVAL (1U<<8) /* {lower,upper} */
454
+ #define ONIG_SYN_OP_ESC_BRACE_INTERVAL (1U<<9) /* \{lower,upper\} */
455
+ #define ONIG_SYN_OP_VBAR_ALT (1U<<10) /* | */
456
+ #define ONIG_SYN_OP_ESC_VBAR_ALT (1U<<11) /* \| */
457
+ #define ONIG_SYN_OP_LPAREN_SUBEXP (1U<<12) /* (...) */
458
+ #define ONIG_SYN_OP_ESC_LPAREN_SUBEXP (1U<<13) /* \(...\) */
459
+ #define ONIG_SYN_OP_ESC_AZ_BUF_ANCHOR (1U<<14) /* \A, \Z, \z */
460
+ #define ONIG_SYN_OP_ESC_CAPITAL_G_BEGIN_ANCHOR (1U<<15) /* \G */
461
+ #define ONIG_SYN_OP_DECIMAL_BACKREF (1U<<16) /* \num */
462
+ #define ONIG_SYN_OP_BRACKET_CC (1U<<17) /* [...] */
463
+ #define ONIG_SYN_OP_ESC_W_WORD (1U<<18) /* \w, \W */
464
+ #define ONIG_SYN_OP_ESC_LTGT_WORD_BEGIN_END (1U<<19) /* \<. \> */
465
+ #define ONIG_SYN_OP_ESC_B_WORD_BOUND (1U<<20) /* \b, \B */
466
+ #define ONIG_SYN_OP_ESC_S_WHITE_SPACE (1U<<21) /* \s, \S */
467
+ #define ONIG_SYN_OP_ESC_D_DIGIT (1U<<22) /* \d, \D */
468
+ #define ONIG_SYN_OP_LINE_ANCHOR (1U<<23) /* ^, $ */
469
+ #define ONIG_SYN_OP_POSIX_BRACKET (1U<<24) /* [:xxxx:] */
470
+ #define ONIG_SYN_OP_QMARK_NON_GREEDY (1U<<25) /* ??,*?,+?,{n,m}? */
471
+ #define ONIG_SYN_OP_ESC_CONTROL_CHARS (1U<<26) /* \n,\r,\t,\a ... */
472
+ #define ONIG_SYN_OP_ESC_C_CONTROL (1U<<27) /* \cx */
473
+ #define ONIG_SYN_OP_ESC_OCTAL3 (1U<<28) /* \OOO */
474
+ #define ONIG_SYN_OP_ESC_X_HEX2 (1U<<29) /* \xHH */
475
+ #define ONIG_SYN_OP_ESC_X_BRACE_HEX8 (1U<<30) /* \x{7HHHHHHH} */
476
+
477
+ #define ONIG_SYN_OP2_ESC_CAPITAL_Q_QUOTE (1U<<0) /* \Q...\E */
478
+ #define ONIG_SYN_OP2_QMARK_GROUP_EFFECT (1U<<1) /* (?...) */
479
+ #define ONIG_SYN_OP2_OPTION_PERL (1U<<2) /* (?imsx),(?-imsx) */
480
+ #define ONIG_SYN_OP2_OPTION_RUBY (1U<<3) /* (?imx), (?-imx) */
481
+ #define ONIG_SYN_OP2_PLUS_POSSESSIVE_REPEAT (1U<<4) /* ?+,*+,++ */
482
+ #define ONIG_SYN_OP2_PLUS_POSSESSIVE_INTERVAL (1U<<5) /* {n,m}+ */
483
+ #define ONIG_SYN_OP2_CCLASS_SET_OP (1U<<6) /* [...&&..[..]..] */
484
+ #define ONIG_SYN_OP2_QMARK_LT_NAMED_GROUP (1U<<7) /* (?<name>...) */
485
+ #define ONIG_SYN_OP2_ESC_K_NAMED_BACKREF (1U<<8) /* \k<name> */
486
+ #define ONIG_SYN_OP2_ESC_G_SUBEXP_CALL (1U<<9) /* \g<name>, \g<n> */
487
+ #define ONIG_SYN_OP2_ATMARK_CAPTURE_HISTORY (1U<<10) /* (?@..),(?@<x>..) */
488
+ #define ONIG_SYN_OP2_ESC_CAPITAL_C_BAR_CONTROL (1U<<11) /* \C-x */
489
+ #define ONIG_SYN_OP2_ESC_CAPITAL_M_BAR_META (1U<<12) /* \M-x */
490
+ #define ONIG_SYN_OP2_ESC_V_VTAB (1U<<13) /* \v as VTAB */
491
+ #define ONIG_SYN_OP2_ESC_U_HEX4 (1U<<14) /* \uHHHH */
492
+ #define ONIG_SYN_OP2_ESC_GNU_BUF_ANCHOR (1U<<15) /* \`, \' */
493
+ #define ONIG_SYN_OP2_ESC_P_BRACE_CHAR_PROPERTY (1U<<16) /* \p{...}, \P{...} */
494
+ #define ONIG_SYN_OP2_ESC_P_BRACE_CIRCUMFLEX_NOT (1U<<17) /* \p{^..}, \P{^..} */
495
+ /* #define ONIG_SYN_OP2_CHAR_PROPERTY_PREFIX_IS (1U<<18) */
496
+ #define ONIG_SYN_OP2_ESC_H_XDIGIT (1U<<19) /* \h, \H */
497
+ #define ONIG_SYN_OP2_INEFFECTIVE_ESCAPE (1U<<20) /* \ */
498
+
499
+ /* syntax (behavior) */
500
+ #define ONIG_SYN_CONTEXT_INDEP_ANCHORS (1U<<31) /* not implemented */
501
+ #define ONIG_SYN_CONTEXT_INDEP_REPEAT_OPS (1U<<0) /* ?, *, +, {n,m} */
502
+ #define ONIG_SYN_CONTEXT_INVALID_REPEAT_OPS (1U<<1) /* error or ignore */
503
+ #define ONIG_SYN_ALLOW_UNMATCHED_CLOSE_SUBEXP (1U<<2) /* ...)... */
504
+ #define ONIG_SYN_ALLOW_INVALID_INTERVAL (1U<<3) /* {??? */
505
+ #define ONIG_SYN_ALLOW_INTERVAL_LOW_ABBREV (1U<<4) /* {,n} => {0,n} */
506
+ #define ONIG_SYN_STRICT_CHECK_BACKREF (1U<<5) /* /(\1)/,/\1()/ ..*/
507
+ #define ONIG_SYN_DIFFERENT_LEN_ALT_LOOK_BEHIND (1U<<6) /* (?<=a|bc) */
508
+ #define ONIG_SYN_CAPTURE_ONLY_NAMED_GROUP (1U<<7) /* see doc/RE */
509
+ #define ONIG_SYN_ALLOW_MULTIPLEX_DEFINITION_NAME (1U<<8) /* (?<x>)(?<x>) */
510
+ #define ONIG_SYN_FIXED_INTERVAL_IS_GREEDY_ONLY (1U<<9) /* a{n}?=(?:a{n})? */
511
+
512
+ /* syntax (behavior) in char class [...] */
513
+ #define ONIG_SYN_NOT_NEWLINE_IN_NEGATIVE_CC (1U<<20) /* [^...] */
514
+ #define ONIG_SYN_BACKSLASH_ESCAPE_IN_CC (1U<<21) /* [..\w..] etc.. */
515
+ #define ONIG_SYN_ALLOW_EMPTY_RANGE_IN_CC (1U<<22)
516
+ #define ONIG_SYN_ALLOW_DOUBLE_RANGE_OP_IN_CC (1U<<23) /* [0-9-a]=[0-9\-a] */
517
+ /* syntax (behavior) warning */
518
+ #define ONIG_SYN_WARN_CC_OP_NOT_ESCAPED (1U<<24) /* [,-,] */
519
+ #define ONIG_SYN_WARN_REDUNDANT_NESTED_REPEAT (1U<<25) /* (?:a*)+ */
520
+
521
+ /* meta character specifiers (onig_set_meta_char()) */
522
+ #define ONIG_META_CHAR_ESCAPE 0
523
+ #define ONIG_META_CHAR_ANYCHAR 1
524
+ #define ONIG_META_CHAR_ANYTIME 2
525
+ #define ONIG_META_CHAR_ZERO_OR_ONE_TIME 3
526
+ #define ONIG_META_CHAR_ONE_OR_MORE_TIME 4
527
+ #define ONIG_META_CHAR_ANYCHAR_ANYTIME 5
528
+
529
+ #define ONIG_INEFFECTIVE_META_CHAR 0
530
+
531
+ /* error codes */
532
+ #define ONIG_IS_PATTERN_ERROR(ecode) ((ecode) <= -100 && (ecode) > -1000)
533
+ /* normal return */
534
+ #define ONIG_NORMAL 0
535
+ #define ONIG_MISMATCH -1
536
+ #define ONIG_NO_SUPPORT_CONFIG -2
537
+
538
+ /* internal error */
539
+ #define ONIGERR_MEMORY -5
540
+ #define ONIGERR_TYPE_BUG -6
541
+ #define ONIGERR_PARSER_BUG -11
542
+ #define ONIGERR_STACK_BUG -12
543
+ #define ONIGERR_UNDEFINED_BYTECODE -13
544
+ #define ONIGERR_UNEXPECTED_BYTECODE -14
545
+ #define ONIGERR_MATCH_STACK_LIMIT_OVER -15
546
+ #define ONIGERR_PARSE_DEPTH_LIMIT_OVER -16
547
+ #define ONIGERR_DEFAULT_ENCODING_IS_NOT_SETTED -21
548
+ #define ONIGERR_SPECIFIED_ENCODING_CANT_CONVERT_TO_WIDE_CHAR -22
549
+ #define ONIGERR_FAIL_TO_INITIALIZE -23
550
+ /* general error */
551
+ #define ONIGERR_INVALID_ARGUMENT -30
552
+ /* syntax error */
553
+ #define ONIGERR_END_PATTERN_AT_LEFT_BRACE -100
554
+ #define ONIGERR_END_PATTERN_AT_LEFT_BRACKET -101
555
+ #define ONIGERR_EMPTY_CHAR_CLASS -102
556
+ #define ONIGERR_PREMATURE_END_OF_CHAR_CLASS -103
557
+ #define ONIGERR_END_PATTERN_AT_ESCAPE -104
558
+ #define ONIGERR_END_PATTERN_AT_META -105
559
+ #define ONIGERR_END_PATTERN_AT_CONTROL -106
560
+ #define ONIGERR_META_CODE_SYNTAX -108
561
+ #define ONIGERR_CONTROL_CODE_SYNTAX -109
562
+ #define ONIGERR_CHAR_CLASS_VALUE_AT_END_OF_RANGE -110
563
+ #define ONIGERR_CHAR_CLASS_VALUE_AT_START_OF_RANGE -111
564
+ #define ONIGERR_UNMATCHED_RANGE_SPECIFIER_IN_CHAR_CLASS -112
565
+ #define ONIGERR_TARGET_OF_REPEAT_OPERATOR_NOT_SPECIFIED -113
566
+ #define ONIGERR_TARGET_OF_REPEAT_OPERATOR_INVALID -114
567
+ #define ONIGERR_NESTED_REPEAT_OPERATOR -115
568
+ #define ONIGERR_UNMATCHED_CLOSE_PARENTHESIS -116
569
+ #define ONIGERR_END_PATTERN_WITH_UNMATCHED_PARENTHESIS -117
570
+ #define ONIGERR_END_PATTERN_IN_GROUP -118
571
+ #define ONIGERR_UNDEFINED_GROUP_OPTION -119
572
+ #define ONIGERR_INVALID_POSIX_BRACKET_TYPE -121
573
+ #define ONIGERR_INVALID_LOOK_BEHIND_PATTERN -122
574
+ #define ONIGERR_INVALID_REPEAT_RANGE_PATTERN -123
575
+ /* values error (syntax error) */
576
+ #define ONIGERR_TOO_BIG_NUMBER -200
577
+ #define ONIGERR_TOO_BIG_NUMBER_FOR_REPEAT_RANGE -201
578
+ #define ONIGERR_UPPER_SMALLER_THAN_LOWER_IN_REPEAT_RANGE -202
579
+ #define ONIGERR_EMPTY_RANGE_IN_CHAR_CLASS -203
580
+ #define ONIGERR_MISMATCH_CODE_LENGTH_IN_CLASS_RANGE -204
581
+ #define ONIGERR_TOO_MANY_MULTI_BYTE_RANGES -205
582
+ #define ONIGERR_TOO_SHORT_MULTI_BYTE_STRING -206
583
+ #define ONIGERR_TOO_BIG_BACKREF_NUMBER -207
584
+ #define ONIGERR_INVALID_BACKREF -208
585
+ #define ONIGERR_NUMBERED_BACKREF_OR_CALL_NOT_ALLOWED -209
586
+ #define ONIGERR_TOO_MANY_CAPTURES -210
587
+ #define ONIGERR_TOO_LONG_WIDE_CHAR_VALUE -212
588
+ #define ONIGERR_EMPTY_GROUP_NAME -214
589
+ #define ONIGERR_INVALID_GROUP_NAME -215
590
+ #define ONIGERR_INVALID_CHAR_IN_GROUP_NAME -216
591
+ #define ONIGERR_UNDEFINED_NAME_REFERENCE -217
592
+ #define ONIGERR_UNDEFINED_GROUP_REFERENCE -218
593
+ #define ONIGERR_MULTIPLEX_DEFINED_NAME -219
594
+ #define ONIGERR_MULTIPLEX_DEFINITION_NAME_CALL -220
595
+ #define ONIGERR_NEVER_ENDING_RECURSION -221
596
+ #define ONIGERR_GROUP_NUMBER_OVER_FOR_CAPTURE_HISTORY -222
597
+ #define ONIGERR_INVALID_CHAR_PROPERTY_NAME -223
598
+ #define ONIGERR_INVALID_CODE_POINT_VALUE -400
599
+ #define ONIGERR_INVALID_WIDE_CHAR_VALUE -400
600
+ #define ONIGERR_TOO_BIG_WIDE_CHAR_VALUE -401
601
+ #define ONIGERR_NOT_SUPPORTED_ENCODING_COMBINATION -402
602
+ #define ONIGERR_INVALID_COMBINATION_OF_OPTIONS -403
603
+ #define ONIGERR_TOO_MANY_USER_DEFINED_OBJECTS -404
604
+ #define ONIGERR_TOO_LONG_PROPERTY_NAME -405
605
+ #define ONIGERR_LIBRARY_IS_NOT_INITIALIZED -500
606
+
607
+ /* errors related to thread */
608
+ /* #define ONIGERR_OVER_THREAD_PASS_LIMIT_COUNT -1001 */
609
+
610
+
611
+ /* must be smaller than BIT_STATUS_BITS_NUM (unsigned int * 8) */
612
+ #define ONIG_MAX_CAPTURE_HISTORY_GROUP 31
613
+ #define ONIG_IS_CAPTURE_HISTORY_GROUP(r, i) \
614
+ ((i) <= ONIG_MAX_CAPTURE_HISTORY_GROUP && (r)->list && (r)->list[i])
615
+
616
+ typedef struct OnigCaptureTreeNodeStruct {
617
+ int group; /* group number */
618
+ int beg;
619
+ int end;
620
+ int allocated;
621
+ int num_childs;
622
+ struct OnigCaptureTreeNodeStruct** childs;
623
+ } OnigCaptureTreeNode;
624
+
625
+ /* match result region type */
626
+ struct re_registers {
627
+ int allocated;
628
+ int num_regs;
629
+ int* beg;
630
+ int* end;
631
+ /* extended */
632
+ OnigCaptureTreeNode* history_root; /* capture history tree root */
633
+ };
634
+
635
+ /* capture tree traverse */
636
+ #define ONIG_TRAVERSE_CALLBACK_AT_FIRST 1
637
+ #define ONIG_TRAVERSE_CALLBACK_AT_LAST 2
638
+ #define ONIG_TRAVERSE_CALLBACK_AT_BOTH \
639
+ ( ONIG_TRAVERSE_CALLBACK_AT_FIRST | ONIG_TRAVERSE_CALLBACK_AT_LAST )
640
+
641
+
642
+ #define ONIG_REGION_NOTPOS -1
643
+
644
+ typedef struct re_registers OnigRegion;
645
+
646
+ typedef struct {
647
+ OnigEncoding enc;
648
+ OnigUChar* par;
649
+ OnigUChar* par_end;
650
+ } OnigErrorInfo;
651
+
652
+ typedef struct {
653
+ int lower;
654
+ int upper;
655
+ } OnigRepeatRange;
656
+
657
+ typedef void (*OnigWarnFunc) P_((const char* s));
658
+ extern void onig_null_warn P_((const char* s));
659
+ #define ONIG_NULL_WARN onig_null_warn
660
+
661
+ #define ONIG_CHAR_TABLE_SIZE 256
662
+
663
+ typedef struct re_pattern_buffer {
664
+ /* common members of BBuf(bytes-buffer) */
665
+ unsigned char* p; /* compiled pattern */
666
+ unsigned int used; /* used space for p */
667
+ unsigned int alloc; /* allocated space for p */
668
+
669
+ int num_mem; /* used memory(...) num counted from 1 */
670
+ int num_repeat; /* OP_REPEAT/OP_REPEAT_NG id-counter */
671
+ int num_null_check; /* OP_NULL_CHECK_START/END id counter */
672
+ int num_comb_exp_check; /* combination explosion check */
673
+ int num_call; /* number of subexp call */
674
+ unsigned int capture_history; /* (?@...) flag (1-31) */
675
+ unsigned int bt_mem_start; /* need backtrack flag */
676
+ unsigned int bt_mem_end; /* need backtrack flag */
677
+ int stack_pop_level;
678
+ int repeat_range_alloc;
679
+ OnigRepeatRange* repeat_range;
680
+
681
+ OnigEncoding enc;
682
+ OnigOptionType options;
683
+ OnigSyntaxType* syntax;
684
+ OnigCaseFoldType case_fold_flag;
685
+ void* name_table;
686
+
687
+ /* optimization info (string search, char-map and anchors) */
688
+ int optimize; /* optimize flag */
689
+ int threshold_len; /* search str-length for apply optimize */
690
+ int anchor; /* BEGIN_BUF, BEGIN_POS, (SEMI_)END_BUF */
691
+ OnigLen anchor_dmin; /* (SEMI_)END_BUF anchor distance */
692
+ OnigLen anchor_dmax; /* (SEMI_)END_BUF anchor distance */
693
+ int sub_anchor; /* start-anchor for exact or map */
694
+ unsigned char *exact;
695
+ unsigned char *exact_end;
696
+ unsigned char map[ONIG_CHAR_TABLE_SIZE]; /* used as BM skip or char-map */
697
+ int *int_map; /* BM skip for exact_len > 255 */
698
+ int *int_map_backward; /* BM skip for backward search */
699
+ OnigLen dmin; /* min-distance of exact or map */
700
+ OnigLen dmax; /* max-distance of exact or map */
701
+
702
+ /* regex_t link chain */
703
+ struct re_pattern_buffer* chain; /* escape compile-conflict */
704
+ } OnigRegexType;
705
+
706
+ typedef OnigRegexType* OnigRegex;
707
+
708
+ #ifndef ONIG_ESCAPE_REGEX_T_COLLISION
709
+ typedef OnigRegexType regex_t;
710
+ #endif
711
+
712
+
713
+ typedef struct {
714
+ int num_of_elements;
715
+ OnigEncoding pattern_enc;
716
+ OnigEncoding target_enc;
717
+ OnigSyntaxType* syntax;
718
+ OnigOptionType option;
719
+ OnigCaseFoldType case_fold_flag;
720
+ } OnigCompileInfo;
721
+
722
+ /* Oniguruma Native API */
723
+
724
+ ONIG_EXTERN
725
+ int onig_initialize P_((OnigEncoding encodings[], int n));
726
+ /* onig_init(): deprecated function. Use onig_initialize(). */
727
+ ONIG_EXTERN
728
+ int onig_init P_((void));
729
+ ONIG_EXTERN
730
+ int onig_error_code_to_str PV_((OnigUChar* s, int err_code, ...));
731
+ ONIG_EXTERN
732
+ void onig_set_warn_func P_((OnigWarnFunc f));
733
+ ONIG_EXTERN
734
+ void onig_set_verb_warn_func P_((OnigWarnFunc f));
735
+ ONIG_EXTERN
736
+ int onig_new P_((OnigRegex*, const OnigUChar* pattern, const OnigUChar* pattern_end, OnigOptionType option, OnigEncoding enc, OnigSyntaxType* syntax, OnigErrorInfo* einfo));
737
+ ONIG_EXTERN
738
+ int onig_reg_init P_((regex_t* reg, OnigOptionType option, OnigCaseFoldType case_fold_flag, OnigEncoding enc, OnigSyntaxType* syntax));
739
+ int onig_new_without_alloc P_((OnigRegex, const OnigUChar* pattern, const OnigUChar* pattern_end, OnigOptionType option, OnigEncoding enc, OnigSyntaxType* syntax, OnigErrorInfo* einfo));
740
+ ONIG_EXTERN
741
+ int onig_new_deluxe P_((OnigRegex* reg, const OnigUChar* pattern, const OnigUChar* pattern_end, OnigCompileInfo* ci, OnigErrorInfo* einfo));
742
+ ONIG_EXTERN
743
+ void onig_free P_((OnigRegex));
744
+ ONIG_EXTERN
745
+ void onig_free_body P_((OnigRegex));
746
+ ONIG_EXTERN
747
+ int onig_scan(regex_t* reg, const OnigUChar* str, const OnigUChar* end, OnigRegion* region, OnigOptionType option, int (*scan_callback)(int, int, OnigRegion*, void*), void* callback_arg);
748
+ ONIG_EXTERN
749
+ int onig_search P_((OnigRegex, const OnigUChar* str, const OnigUChar* end, const OnigUChar* start, const OnigUChar* range, OnigRegion* region, OnigOptionType option));
750
+ ONIG_EXTERN
751
+ int onig_match P_((OnigRegex, const OnigUChar* str, const OnigUChar* end, const OnigUChar* at, OnigRegion* region, OnigOptionType option));
752
+ ONIG_EXTERN
753
+ OnigRegion* onig_region_new P_((void));
754
+ ONIG_EXTERN
755
+ void onig_region_init P_((OnigRegion* region));
756
+ ONIG_EXTERN
757
+ void onig_region_free P_((OnigRegion* region, int free_self));
758
+ ONIG_EXTERN
759
+ void onig_region_copy P_((OnigRegion* to, OnigRegion* from));
760
+ ONIG_EXTERN
761
+ void onig_region_clear P_((OnigRegion* region));
762
+ ONIG_EXTERN
763
+ int onig_region_resize P_((OnigRegion* region, int n));
764
+ ONIG_EXTERN
765
+ int onig_region_set P_((OnigRegion* region, int at, int beg, int end));
766
+ ONIG_EXTERN
767
+ int onig_name_to_group_numbers P_((OnigRegex reg, const OnigUChar* name, const OnigUChar* name_end, int** nums));
768
+ ONIG_EXTERN
769
+ int onig_name_to_backref_number P_((OnigRegex reg, const OnigUChar* name, const OnigUChar* name_end, OnigRegion *region));
770
+ ONIG_EXTERN
771
+ int onig_foreach_name P_((OnigRegex reg, int (*func)(const OnigUChar*, const OnigUChar*,int,int*,OnigRegex,void*), void* arg));
772
+ ONIG_EXTERN
773
+ int onig_number_of_names P_((OnigRegex reg));
774
+ ONIG_EXTERN
775
+ int onig_number_of_captures P_((OnigRegex reg));
776
+ ONIG_EXTERN
777
+ int onig_number_of_capture_histories P_((OnigRegex reg));
778
+ ONIG_EXTERN
779
+ OnigCaptureTreeNode* onig_get_capture_tree P_((OnigRegion* region));
780
+ ONIG_EXTERN
781
+ int onig_capture_tree_traverse P_((OnigRegion* region, int at, int(*callback_func)(int,int,int,int,int,void*), void* arg));
782
+ ONIG_EXTERN
783
+ int onig_noname_group_capture_is_active P_((OnigRegex reg));
784
+ ONIG_EXTERN
785
+ OnigEncoding onig_get_encoding P_((OnigRegex reg));
786
+ ONIG_EXTERN
787
+ OnigOptionType onig_get_options P_((OnigRegex reg));
788
+ ONIG_EXTERN
789
+ OnigCaseFoldType onig_get_case_fold_flag P_((OnigRegex reg));
790
+ ONIG_EXTERN
791
+ OnigSyntaxType* onig_get_syntax P_((OnigRegex reg));
792
+ ONIG_EXTERN
793
+ int onig_set_default_syntax P_((OnigSyntaxType* syntax));
794
+ ONIG_EXTERN
795
+ void onig_copy_syntax P_((OnigSyntaxType* to, OnigSyntaxType* from));
796
+ ONIG_EXTERN
797
+ unsigned int onig_get_syntax_op P_((OnigSyntaxType* syntax));
798
+ ONIG_EXTERN
799
+ unsigned int onig_get_syntax_op2 P_((OnigSyntaxType* syntax));
800
+ ONIG_EXTERN
801
+ unsigned int onig_get_syntax_behavior P_((OnigSyntaxType* syntax));
802
+ ONIG_EXTERN
803
+ OnigOptionType onig_get_syntax_options P_((OnigSyntaxType* syntax));
804
+ ONIG_EXTERN
805
+ void onig_set_syntax_op P_((OnigSyntaxType* syntax, unsigned int op));
806
+ ONIG_EXTERN
807
+ void onig_set_syntax_op2 P_((OnigSyntaxType* syntax, unsigned int op2));
808
+ ONIG_EXTERN
809
+ void onig_set_syntax_behavior P_((OnigSyntaxType* syntax, unsigned int behavior));
810
+ ONIG_EXTERN
811
+ void onig_set_syntax_options P_((OnigSyntaxType* syntax, OnigOptionType options));
812
+ ONIG_EXTERN
813
+ int onig_set_meta_char P_((OnigSyntaxType* syntax, unsigned int what, OnigCodePoint code));
814
+ ONIG_EXTERN
815
+ void onig_copy_encoding P_((OnigEncoding to, OnigEncoding from));
816
+ ONIG_EXTERN
817
+ OnigCaseFoldType onig_get_default_case_fold_flag P_((void));
818
+ ONIG_EXTERN
819
+ int onig_set_default_case_fold_flag P_((OnigCaseFoldType case_fold_flag));
820
+ ONIG_EXTERN
821
+ unsigned int onig_get_match_stack_limit_size P_((void));
822
+ ONIG_EXTERN
823
+ int onig_set_match_stack_limit_size P_((unsigned int size));
824
+ ONIG_EXTERN
825
+ unsigned int onig_get_parse_depth_limit P_((void));
826
+ ONIG_EXTERN
827
+ int onig_set_parse_depth_limit P_((unsigned int depth));
828
+ ONIG_EXTERN
829
+ int onig_unicode_define_user_property P_((const char* name, OnigCodePoint* ranges));
830
+ ONIG_EXTERN
831
+ int onig_end P_((void));
832
+ ONIG_EXTERN
833
+ const char* onig_version P_((void));
834
+ ONIG_EXTERN
835
+ const char* onig_copyright P_((void));
836
+
837
+ #ifdef __cplusplus
838
+ }
839
+ #endif
840
+
841
+ #endif /* ONIGURUMA_H */