debase-ruby_core_source 3.3.1 → 3.3.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (435) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +2 -1
  3. data/.idea/vcs.xml +28 -0
  4. data/CHANGELOG.md +8 -0
  5. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/addr2line.h +22 -0
  6. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/builtin.h +117 -0
  7. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/ccan/build_assert/build_assert.h +40 -0
  8. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/ccan/check_type/check_type.h +63 -0
  9. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/ccan/container_of/container_of.h +142 -0
  10. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/ccan/list/list.h +791 -0
  11. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/ccan/str/str.h +17 -0
  12. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/constant.h +53 -0
  13. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/darray.h +246 -0
  14. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/debug_counter.h +423 -0
  15. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/dln.h +32 -0
  16. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/encindex.h +70 -0
  17. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/eval_intern.h +343 -0
  18. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/hrtime.h +227 -0
  19. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/id.h +343 -0
  20. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/id_table.h +39 -0
  21. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/insns.inc +251 -0
  22. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/insns_info.inc +9215 -0
  23. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/array.h +151 -0
  24. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/basic_operators.h +63 -0
  25. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/bignum.h +244 -0
  26. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/bits.h +568 -0
  27. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/class.h +277 -0
  28. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/cmdlineopt.h +65 -0
  29. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/compar.h +29 -0
  30. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/compile.h +34 -0
  31. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/compilers.h +107 -0
  32. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/complex.h +29 -0
  33. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/cont.h +35 -0
  34. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/dir.h +16 -0
  35. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/enc.h +19 -0
  36. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/encoding.h +35 -0
  37. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/enum.h +18 -0
  38. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/enumerator.h +21 -0
  39. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/error.h +216 -0
  40. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/eval.h +33 -0
  41. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/file.h +38 -0
  42. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/fixnum.h +184 -0
  43. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/gc.h +364 -0
  44. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/hash.h +191 -0
  45. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/imemo.h +240 -0
  46. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/inits.h +50 -0
  47. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/io.h +137 -0
  48. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/load.h +18 -0
  49. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/loadpath.h +16 -0
  50. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/math.h +23 -0
  51. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/missing.h +18 -0
  52. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/numeric.h +273 -0
  53. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/object.h +62 -0
  54. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/parse.h +108 -0
  55. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/proc.h +30 -0
  56. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/process.h +124 -0
  57. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/ractor.h +6 -0
  58. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/random.h +17 -0
  59. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/range.h +40 -0
  60. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/rational.h +71 -0
  61. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/re.h +28 -0
  62. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/ruby_parser.h +69 -0
  63. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/sanitizers.h +186 -0
  64. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/serial.h +23 -0
  65. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/signal.h +25 -0
  66. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/static_assert.h +16 -0
  67. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/string.h +160 -0
  68. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/struct.h +127 -0
  69. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/symbol.h +45 -0
  70. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/thread.h +78 -0
  71. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/time.h +34 -0
  72. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/transcode.h +23 -0
  73. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/util.h +27 -0
  74. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/variable.h +72 -0
  75. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/vm.h +136 -0
  76. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/warnings.h +16 -0
  77. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal.h +112 -0
  78. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/iseq.h +338 -0
  79. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/known_errors.inc +791 -0
  80. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/method.h +254 -0
  81. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/node.h +128 -0
  82. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/node_name.inc +212 -0
  83. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/optinsn.inc +128 -0
  84. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/optunifs.inc +43 -0
  85. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/parse.h +243 -0
  86. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/parser_bits.h +564 -0
  87. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/parser_node.h +32 -0
  88. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/parser_st.h +162 -0
  89. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/parser_value.h +106 -0
  90. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/prism/ast.h +4612 -0
  91. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/prism/defines.h +94 -0
  92. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/prism/diagnostic.h +297 -0
  93. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/prism/encoding.h +248 -0
  94. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/prism/extension.h +18 -0
  95. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/prism/node.h +57 -0
  96. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/prism/options.h +204 -0
  97. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/prism/pack.h +152 -0
  98. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/prism/parser.h +716 -0
  99. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/prism/prettyprint.h +26 -0
  100. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/prism/prism.h +272 -0
  101. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/prism/regexp.h +33 -0
  102. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/prism/util/pm_buffer.h +146 -0
  103. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/prism/util/pm_char.h +205 -0
  104. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/prism/util/pm_constant_pool.h +191 -0
  105. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/prism/util/pm_list.h +97 -0
  106. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/prism/util/pm_memchr.h +29 -0
  107. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/prism/util/pm_newline_list.h +104 -0
  108. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/prism/util/pm_state_stack.h +42 -0
  109. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/prism/util/pm_string.h +150 -0
  110. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/prism/util/pm_string_list.h +44 -0
  111. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/prism/util/pm_strncasecmp.h +32 -0
  112. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/prism/util/pm_strpbrk.h +43 -0
  113. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/prism/version.h +29 -0
  114. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/prism_compile.h +29 -0
  115. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/probes_helper.h +42 -0
  116. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/ractor_core.h +393 -0
  117. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/regenc.h +254 -0
  118. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/regint.h +1006 -0
  119. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/regparse.h +371 -0
  120. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/revision.h +5 -0
  121. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/rjit.h +101 -0
  122. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/rjit_c.h +164 -0
  123. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/ruby_assert.h +14 -0
  124. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/ruby_atomic.h +23 -0
  125. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/rubyparser.h +1405 -0
  126. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/shape.h +233 -0
  127. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/siphash.h +48 -0
  128. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/symbol.h +118 -0
  129. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/thread_none.h +21 -0
  130. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/thread_pthread.h +166 -0
  131. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/thread_win32.h +58 -0
  132. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/timev.h +58 -0
  133. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/transcode_data.h +138 -0
  134. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/variable.h +39 -0
  135. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/version.h +69 -0
  136. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/vm.inc +5436 -0
  137. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/vm_call_iseq_optimized.inc +244 -0
  138. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/vm_callinfo.h +614 -0
  139. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/vm_core.h +2202 -0
  140. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/vm_debug.h +122 -0
  141. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/vm_exec.h +199 -0
  142. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/vm_insnhelper.h +261 -0
  143. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/vm_opts.h +67 -0
  144. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/vm_sync.h +137 -0
  145. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/vmtc.inc +245 -0
  146. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/yjit.h +72 -0
  147. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/addr2line.h +22 -0
  148. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/builtin.h +119 -0
  149. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/ccan/build_assert/build_assert.h +40 -0
  150. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/ccan/check_type/check_type.h +63 -0
  151. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/ccan/container_of/container_of.h +142 -0
  152. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/ccan/list/list.h +791 -0
  153. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/ccan/str/str.h +17 -0
  154. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/constant.h +53 -0
  155. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/darray.h +191 -0
  156. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/debug_counter.h +423 -0
  157. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/dln.h +34 -0
  158. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/encindex.h +70 -0
  159. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/eval_intern.h +324 -0
  160. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/hrtime.h +237 -0
  161. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/id.h +343 -0
  162. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/id_table.h +39 -0
  163. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/insns.inc +259 -0
  164. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/insns_info.inc +9530 -0
  165. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/array.h +151 -0
  166. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/basic_operators.h +63 -0
  167. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/bignum.h +244 -0
  168. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/bits.h +568 -0
  169. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/class.h +283 -0
  170. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/cmdlineopt.h +65 -0
  171. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/compar.h +29 -0
  172. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/compile.h +34 -0
  173. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/compilers.h +107 -0
  174. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/complex.h +29 -0
  175. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/cont.h +35 -0
  176. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/dir.h +16 -0
  177. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/enc.h +19 -0
  178. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/encoding.h +36 -0
  179. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/enum.h +18 -0
  180. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/enumerator.h +21 -0
  181. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/error.h +216 -0
  182. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/eval.h +33 -0
  183. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/file.h +38 -0
  184. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/fixnum.h +184 -0
  185. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/gc.h +334 -0
  186. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/hash.h +191 -0
  187. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/imemo.h +260 -0
  188. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/inits.h +47 -0
  189. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/io.h +140 -0
  190. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/load.h +18 -0
  191. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/loadpath.h +16 -0
  192. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/math.h +23 -0
  193. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/missing.h +19 -0
  194. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/numeric.h +274 -0
  195. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/object.h +63 -0
  196. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/parse.h +117 -0
  197. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/proc.h +30 -0
  198. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/process.h +124 -0
  199. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/ractor.h +6 -0
  200. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/random.h +17 -0
  201. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/range.h +40 -0
  202. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/rational.h +71 -0
  203. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/re.h +28 -0
  204. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/ruby_parser.h +102 -0
  205. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/sanitizers.h +297 -0
  206. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/serial.h +23 -0
  207. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/signal.h +24 -0
  208. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/st.h +11 -0
  209. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/static_assert.h +16 -0
  210. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/string.h +182 -0
  211. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/struct.h +127 -0
  212. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/symbol.h +45 -0
  213. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/thread.h +79 -0
  214. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/time.h +34 -0
  215. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/transcode.h +23 -0
  216. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/util.h +27 -0
  217. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/variable.h +72 -0
  218. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/vm.h +137 -0
  219. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/warnings.h +16 -0
  220. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal.h +108 -0
  221. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/iseq.h +340 -0
  222. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/known_errors.inc +1419 -0
  223. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/method.h +255 -0
  224. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/node.h +111 -0
  225. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/node_name.inc +224 -0
  226. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/optinsn.inc +128 -0
  227. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/optunifs.inc +43 -0
  228. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/parse.h +243 -0
  229. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/parser_bits.h +564 -0
  230. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/parser_node.h +32 -0
  231. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/parser_st.h +162 -0
  232. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/parser_value.h +106 -0
  233. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/ast.h +6245 -0
  234. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/defines.h +206 -0
  235. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/diagnostic.h +433 -0
  236. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/encoding.h +283 -0
  237. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/extension.h +19 -0
  238. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/node.h +150 -0
  239. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/options.h +305 -0
  240. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/pack.h +163 -0
  241. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/parser.h +891 -0
  242. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/prettyprint.h +34 -0
  243. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/prism.h +347 -0
  244. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/regexp.h +33 -0
  245. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/static_literals.h +120 -0
  246. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/util/pm_buffer.h +218 -0
  247. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/util/pm_char.h +205 -0
  248. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/util/pm_constant_pool.h +226 -0
  249. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/util/pm_integer.h +119 -0
  250. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/util/pm_list.h +97 -0
  251. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/util/pm_memchr.h +29 -0
  252. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/util/pm_newline_list.h +102 -0
  253. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/util/pm_string.h +174 -0
  254. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/util/pm_string_list.h +44 -0
  255. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/util/pm_strncasecmp.h +32 -0
  256. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/util/pm_strpbrk.h +46 -0
  257. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/version.h +29 -0
  258. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism_compile.h +88 -0
  259. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/probes_helper.h +42 -0
  260. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/ractor_core.h +393 -0
  261. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/regenc.h +254 -0
  262. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/regint.h +1010 -0
  263. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/regparse.h +371 -0
  264. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/revision.h +5 -0
  265. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/rjit.h +101 -0
  266. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/rjit_c.h +165 -0
  267. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/ruby_assert.h +14 -0
  268. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/ruby_atomic.h +23 -0
  269. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/rubyparser.h +1430 -0
  270. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/shape.h +233 -0
  271. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/siphash.h +48 -0
  272. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/symbol.h +118 -0
  273. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/thread_none.h +21 -0
  274. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/thread_pthread.h +166 -0
  275. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/thread_win32.h +58 -0
  276. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/timev.h +58 -0
  277. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/transcode_data.h +138 -0
  278. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/variable.h +39 -0
  279. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/version.h +69 -0
  280. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/vm.inc +5643 -0
  281. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/vm_call_iseq_optimized.inc +244 -0
  282. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/vm_callinfo.h +605 -0
  283. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/vm_core.h +2236 -0
  284. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/vm_debug.h +124 -0
  285. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/vm_exec.h +199 -0
  286. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/vm_insnhelper.h +272 -0
  287. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/vm_opts.h +67 -0
  288. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/vm_sync.h +137 -0
  289. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/vmtc.inc +253 -0
  290. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/yjit.h +79 -0
  291. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/addr2line.h +22 -0
  292. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/builtin.h +119 -0
  293. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/ccan/build_assert/build_assert.h +40 -0
  294. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/ccan/check_type/check_type.h +63 -0
  295. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/ccan/container_of/container_of.h +142 -0
  296. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/ccan/list/list.h +791 -0
  297. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/ccan/str/str.h +17 -0
  298. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/constant.h +53 -0
  299. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/darray.h +209 -0
  300. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/debug_counter.h +423 -0
  301. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/dln.h +32 -0
  302. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/encindex.h +70 -0
  303. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/eval_intern.h +324 -0
  304. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/hrtime.h +237 -0
  305. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/id.h +347 -0
  306. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/id_table.h +39 -0
  307. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/insns.inc +265 -0
  308. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/insns_info.inc +9902 -0
  309. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/array.h +152 -0
  310. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/basic_operators.h +64 -0
  311. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/bignum.h +244 -0
  312. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/bits.h +568 -0
  313. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/class.h +283 -0
  314. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/cmdlineopt.h +65 -0
  315. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/compar.h +29 -0
  316. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/compile.h +34 -0
  317. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/compilers.h +107 -0
  318. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/complex.h +29 -0
  319. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/cont.h +35 -0
  320. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/dir.h +16 -0
  321. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/enc.h +19 -0
  322. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/encoding.h +36 -0
  323. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/enum.h +18 -0
  324. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/enumerator.h +21 -0
  325. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/error.h +218 -0
  326. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/eval.h +33 -0
  327. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/file.h +38 -0
  328. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/fixnum.h +184 -0
  329. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/gc.h +322 -0
  330. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/hash.h +192 -0
  331. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/imemo.h +261 -0
  332. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/inits.h +47 -0
  333. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/io.h +143 -0
  334. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/load.h +18 -0
  335. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/loadpath.h +16 -0
  336. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/math.h +23 -0
  337. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/missing.h +19 -0
  338. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/numeric.h +274 -0
  339. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/object.h +63 -0
  340. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/parse.h +129 -0
  341. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/proc.h +30 -0
  342. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/process.h +124 -0
  343. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/ractor.h +6 -0
  344. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/random.h +17 -0
  345. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/range.h +40 -0
  346. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/rational.h +71 -0
  347. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/re.h +28 -0
  348. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/ruby_parser.h +102 -0
  349. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/sanitizers.h +326 -0
  350. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/serial.h +23 -0
  351. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/signal.h +24 -0
  352. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/st.h +11 -0
  353. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/static_assert.h +16 -0
  354. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/string.h +186 -0
  355. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/struct.h +127 -0
  356. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/symbol.h +45 -0
  357. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/thread.h +85 -0
  358. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/time.h +34 -0
  359. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/transcode.h +23 -0
  360. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/util.h +27 -0
  361. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/variable.h +72 -0
  362. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/vm.h +137 -0
  363. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal/warnings.h +16 -0
  364. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/internal.h +108 -0
  365. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/iseq.h +340 -0
  366. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/known_errors.inc +1419 -0
  367. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/method.h +255 -0
  368. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/node.h +111 -0
  369. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/node_name.inc +224 -0
  370. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/optinsn.inc +128 -0
  371. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/optunifs.inc +43 -0
  372. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/parse.h +244 -0
  373. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/parser_bits.h +564 -0
  374. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/parser_node.h +32 -0
  375. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/parser_st.h +162 -0
  376. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/parser_value.h +106 -0
  377. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/ast.h +7524 -0
  378. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/defines.h +242 -0
  379. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/diagnostic.h +450 -0
  380. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/encoding.h +283 -0
  381. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/extension.h +19 -0
  382. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/node.h +129 -0
  383. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/options.h +396 -0
  384. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/pack.h +163 -0
  385. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/parser.h +933 -0
  386. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/prettyprint.h +34 -0
  387. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/prism.h +336 -0
  388. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/regexp.h +43 -0
  389. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/static_literals.h +121 -0
  390. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/util/pm_buffer.h +218 -0
  391. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/util/pm_char.h +204 -0
  392. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/util/pm_constant_pool.h +218 -0
  393. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/util/pm_integer.h +126 -0
  394. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/util/pm_list.h +97 -0
  395. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/util/pm_memchr.h +29 -0
  396. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/util/pm_newline_list.h +113 -0
  397. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/util/pm_string.h +190 -0
  398. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/util/pm_strncasecmp.h +32 -0
  399. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/util/pm_strpbrk.h +46 -0
  400. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism/version.h +29 -0
  401. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/prism_compile.h +99 -0
  402. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/probes_helper.h +42 -0
  403. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/ractor_core.h +382 -0
  404. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/regenc.h +254 -0
  405. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/regint.h +1006 -0
  406. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/regparse.h +371 -0
  407. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/revision.h +5 -0
  408. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/rjit.h +101 -0
  409. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/rjit_c.h +165 -0
  410. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/ruby_assert.h +14 -0
  411. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/ruby_atomic.h +23 -0
  412. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/rubyparser.h +1350 -0
  413. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/shape.h +234 -0
  414. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/siphash.h +48 -0
  415. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/symbol.h +123 -0
  416. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/thread_none.h +21 -0
  417. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/thread_pthread.h +168 -0
  418. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/thread_win32.h +58 -0
  419. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/timev.h +58 -0
  420. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/transcode_data.h +138 -0
  421. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/variable.h +39 -0
  422. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/version.h +69 -0
  423. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/vm.inc +5840 -0
  424. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/vm_call_iseq_optimized.inc +244 -0
  425. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/vm_callinfo.h +627 -0
  426. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/vm_core.h +2222 -0
  427. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/vm_debug.h +124 -0
  428. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/vm_exec.h +199 -0
  429. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/vm_insnhelper.h +277 -0
  430. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/vm_opts.h +67 -0
  431. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/vm_sync.h +137 -0
  432. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/vmtc.inc +259 -0
  433. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/yjit.h +79 -0
  434. data/lib/debase/ruby_core_source/version.rb +1 -1
  435. metadata +436 -6
@@ -0,0 +1,274 @@
1
+ #ifndef INTERNAL_NUMERIC_H /*-*-C-*-vi:se ft=c:*/
2
+ #define INTERNAL_NUMERIC_H
3
+ /**
4
+ * @author Ruby developers <ruby-core@ruby-lang.org>
5
+ * @copyright This file is a part of the programming language Ruby.
6
+ * Permission is hereby granted, to either redistribute and/or
7
+ * modify this file, provided that the conditions mentioned in the
8
+ * file COPYING are met. Consult the file for details.
9
+ * @brief Internal header for Numeric.
10
+ */
11
+ #include "internal/bignum.h" /* for BIGNUM_POSITIVE_P */
12
+ #include "internal/bits.h" /* for RUBY_BIT_ROTL */
13
+ #include "internal/fixnum.h" /* for FIXNUM_POSITIVE_P */
14
+ #include "internal/vm.h" /* for rb_method_basic_definition_p */
15
+ #include "ruby/intern.h" /* for rb_cmperr */
16
+ #include "ruby/ruby.h" /* for USE_FLONUM */
17
+
18
+ #define ROUND_TO(mode, even, up, down) \
19
+ ((mode) == RUBY_NUM_ROUND_HALF_EVEN ? even : \
20
+ (mode) == RUBY_NUM_ROUND_HALF_UP ? up : down)
21
+ #define ROUND_FUNC(mode, name) \
22
+ ROUND_TO(mode, name##_half_even, name##_half_up, name##_half_down)
23
+ #define ROUND_CALL(mode, name, args) \
24
+ ROUND_TO(mode, name##_half_even args, \
25
+ name##_half_up args, name##_half_down args)
26
+
27
+ #ifndef ROUND_DEFAULT
28
+ # define ROUND_DEFAULT RUBY_NUM_ROUND_HALF_UP
29
+ #endif
30
+
31
+ enum ruby_num_rounding_mode {
32
+ RUBY_NUM_ROUND_HALF_UP,
33
+ RUBY_NUM_ROUND_HALF_EVEN,
34
+ RUBY_NUM_ROUND_HALF_DOWN,
35
+ RUBY_NUM_ROUND_DEFAULT = ROUND_DEFAULT,
36
+ };
37
+
38
+ /* same as internal.h */
39
+ #define numberof(array) ((int)(sizeof(array) / sizeof((array)[0])))
40
+ #define roomof(x, y) (((x) + (y) - 1) / (y))
41
+ #define type_roomof(x, y) roomof(sizeof(x), sizeof(y))
42
+
43
+ #if SIZEOF_DOUBLE <= SIZEOF_VALUE
44
+ typedef double rb_float_value_type;
45
+ #else
46
+ typedef struct {
47
+ VALUE values[roomof(SIZEOF_DOUBLE, SIZEOF_VALUE)];
48
+ } rb_float_value_type;
49
+ #endif
50
+
51
+ struct RFloat {
52
+ struct RBasic basic;
53
+ rb_float_value_type float_value;
54
+ };
55
+
56
+ #define RFLOAT(obj) ((struct RFloat *)(obj))
57
+
58
+ /* numeric.c */
59
+ int rb_num_to_uint(VALUE val, unsigned int *ret);
60
+ VALUE ruby_num_interval_step_size(VALUE from, VALUE to, VALUE step, int excl);
61
+ double ruby_float_step_size(double beg, double end, double unit, int excl);
62
+ int ruby_float_step(VALUE from, VALUE to, VALUE step, int excl, int allow_endless);
63
+ int rb_num_negative_p(VALUE);
64
+ VALUE rb_int_succ(VALUE num);
65
+ VALUE rb_float_uminus(VALUE num);
66
+ VALUE rb_int_plus(VALUE x, VALUE y);
67
+ VALUE rb_float_plus(VALUE x, VALUE y);
68
+ VALUE rb_int_minus(VALUE x, VALUE y);
69
+ VALUE rb_float_minus(VALUE x, VALUE y);
70
+ VALUE rb_int_mul(VALUE x, VALUE y);
71
+ VALUE rb_float_mul(VALUE x, VALUE y);
72
+ VALUE rb_float_div(VALUE x, VALUE y);
73
+ VALUE rb_int_idiv(VALUE x, VALUE y);
74
+ VALUE rb_int_modulo(VALUE x, VALUE y);
75
+ VALUE rb_int2str(VALUE num, int base);
76
+ VALUE rb_fix_plus(VALUE x, VALUE y);
77
+ VALUE rb_int_gt(VALUE x, VALUE y);
78
+ VALUE rb_float_gt(VALUE x, VALUE y);
79
+ VALUE rb_int_ge(VALUE x, VALUE y);
80
+ enum ruby_num_rounding_mode rb_num_get_rounding_option(VALUE opts);
81
+ double rb_int_fdiv_double(VALUE x, VALUE y);
82
+ VALUE rb_int_pow(VALUE x, VALUE y);
83
+ VALUE rb_float_pow(VALUE x, VALUE y);
84
+ VALUE rb_int_cmp(VALUE x, VALUE y);
85
+ VALUE rb_int_equal(VALUE x, VALUE y);
86
+ VALUE rb_int_divmod(VALUE x, VALUE y);
87
+ VALUE rb_int_and(VALUE x, VALUE y);
88
+ VALUE rb_int_lshift(VALUE x, VALUE y);
89
+ VALUE rb_int_rshift(VALUE x, VALUE y);
90
+ VALUE rb_int_div(VALUE x, VALUE y);
91
+ int rb_int_positive_p(VALUE num);
92
+ int rb_int_negative_p(VALUE num);
93
+ VALUE rb_check_integer_type(VALUE);
94
+ VALUE rb_num_pow(VALUE x, VALUE y);
95
+ VALUE rb_float_ceil(VALUE num, int ndigits);
96
+ VALUE rb_float_floor(VALUE x, int ndigits);
97
+ VALUE rb_float_abs(VALUE flt);
98
+ static inline VALUE rb_num_compare_with_zero(VALUE num, ID mid);
99
+ static inline int rb_num_positive_int_p(VALUE num);
100
+ static inline int rb_num_negative_int_p(VALUE num);
101
+ static inline double rb_float_flonum_value(VALUE v);
102
+ static inline double rb_float_noflonum_value(VALUE v);
103
+ static inline double rb_float_value_inline(VALUE v);
104
+ static inline VALUE rb_float_new_inline(double d);
105
+ static inline bool INT_POSITIVE_P(VALUE num);
106
+ static inline bool INT_NEGATIVE_P(VALUE num);
107
+ static inline bool FLOAT_ZERO_P(VALUE num);
108
+ #define rb_float_value rb_float_value_inline
109
+ #define rb_float_new rb_float_new_inline
110
+
111
+ RUBY_SYMBOL_EXPORT_BEGIN
112
+ /* numeric.c (export) */
113
+ RUBY_SYMBOL_EXPORT_END
114
+
115
+ VALUE rb_flo_div_flo(VALUE x, VALUE y);
116
+ double ruby_float_mod(double x, double y);
117
+ VALUE rb_float_equal(VALUE x, VALUE y);
118
+ int rb_float_cmp(VALUE x, VALUE y);
119
+ VALUE rb_float_eql(VALUE x, VALUE y);
120
+ VALUE rb_fix_aref(VALUE fix, VALUE idx);
121
+ VALUE rb_int_zero_p(VALUE num);
122
+ VALUE rb_int_even_p(VALUE num);
123
+ VALUE rb_int_odd_p(VALUE num);
124
+ VALUE rb_int_abs(VALUE num);
125
+ VALUE rb_int_bit_length(VALUE num);
126
+ VALUE rb_int_uminus(VALUE num);
127
+ VALUE rb_int_comp(VALUE num);
128
+
129
+ static inline bool
130
+ INT_POSITIVE_P(VALUE num)
131
+ {
132
+ if (FIXNUM_P(num)) {
133
+ return FIXNUM_POSITIVE_P(num);
134
+ }
135
+ else {
136
+ return BIGNUM_POSITIVE_P(num);
137
+ }
138
+ }
139
+
140
+ static inline bool
141
+ INT_NEGATIVE_P(VALUE num)
142
+ {
143
+ if (FIXNUM_P(num)) {
144
+ return FIXNUM_NEGATIVE_P(num);
145
+ }
146
+ else {
147
+ return BIGNUM_NEGATIVE_P(num);
148
+ }
149
+ }
150
+
151
+ static inline bool
152
+ FLOAT_ZERO_P(VALUE num)
153
+ {
154
+ return RFLOAT_VALUE(num) == 0.0;
155
+ }
156
+
157
+ static inline VALUE
158
+ rb_num_compare_with_zero(VALUE num, ID mid)
159
+ {
160
+ VALUE zero = INT2FIX(0);
161
+ VALUE r = rb_check_funcall(num, mid, 1, &zero);
162
+ if (RB_UNDEF_P(r)) {
163
+ rb_cmperr(num, zero);
164
+ }
165
+ return r;
166
+ }
167
+
168
+ static inline int
169
+ rb_num_positive_int_p(VALUE num)
170
+ {
171
+ const ID mid = '>';
172
+
173
+ if (FIXNUM_P(num)) {
174
+ if (rb_method_basic_definition_p(rb_cInteger, mid))
175
+ return FIXNUM_POSITIVE_P(num);
176
+ }
177
+ else if (RB_TYPE_P(num, T_BIGNUM)) {
178
+ if (rb_method_basic_definition_p(rb_cInteger, mid))
179
+ return BIGNUM_POSITIVE_P(num);
180
+ }
181
+ return RTEST(rb_num_compare_with_zero(num, mid));
182
+ }
183
+
184
+ static inline int
185
+ rb_num_negative_int_p(VALUE num)
186
+ {
187
+ const ID mid = '<';
188
+
189
+ if (FIXNUM_P(num)) {
190
+ if (rb_method_basic_definition_p(rb_cInteger, mid))
191
+ return FIXNUM_NEGATIVE_P(num);
192
+ }
193
+ else if (RB_TYPE_P(num, T_BIGNUM)) {
194
+ if (rb_method_basic_definition_p(rb_cInteger, mid))
195
+ return BIGNUM_NEGATIVE_P(num);
196
+ }
197
+ return RTEST(rb_num_compare_with_zero(num, mid));
198
+ }
199
+
200
+ static inline double
201
+ rb_float_flonum_value(VALUE v)
202
+ {
203
+ #if USE_FLONUM
204
+ if (v != (VALUE)0x8000000000000002) { /* LIKELY */
205
+ union {
206
+ double d;
207
+ VALUE v;
208
+ } t;
209
+
210
+ VALUE b63 = (v >> 63);
211
+ /* e: xx1... -> 011... */
212
+ /* xx0... -> 100... */
213
+ /* ^b63 */
214
+ t.v = RUBY_BIT_ROTR((2 - b63) | (v & ~(VALUE)0x03), 3);
215
+ return t.d;
216
+ }
217
+ #endif
218
+ return 0.0;
219
+ }
220
+
221
+ static inline double
222
+ rb_float_noflonum_value(VALUE v)
223
+ {
224
+ #if SIZEOF_DOUBLE <= SIZEOF_VALUE
225
+ return RFLOAT(v)->float_value;
226
+ #else
227
+ union {
228
+ rb_float_value_type v;
229
+ double d;
230
+ } u = {RFLOAT(v)->float_value};
231
+ return u.d;
232
+ #endif
233
+ }
234
+
235
+ static inline double
236
+ rb_float_value_inline(VALUE v)
237
+ {
238
+ if (FLONUM_P(v)) {
239
+ return rb_float_flonum_value(v);
240
+ }
241
+ return rb_float_noflonum_value(v);
242
+ }
243
+
244
+ static inline VALUE
245
+ rb_float_new_inline(double d)
246
+ {
247
+ #if USE_FLONUM
248
+ union {
249
+ double d;
250
+ VALUE v;
251
+ } t;
252
+ int bits;
253
+
254
+ t.d = d;
255
+ bits = (int)((VALUE)(t.v >> 60) & 0x7);
256
+ /* bits contains 3 bits of b62..b60. */
257
+ /* bits - 3 = */
258
+ /* b011 -> b000 */
259
+ /* b100 -> b001 */
260
+
261
+ if (t.v != 0x3000000000000000 /* 1.72723e-77 */ &&
262
+ !((bits-3) & ~0x01)) {
263
+ return (RUBY_BIT_ROTL(t.v, 3) & ~(VALUE)0x01) | 0x02;
264
+ }
265
+ else if (t.v == (VALUE)0) {
266
+ /* +0.0 */
267
+ return 0x8000000000000002;
268
+ }
269
+ /* out of range */
270
+ #endif
271
+ return rb_float_new_in_heap(d);
272
+ }
273
+
274
+ #endif /* INTERNAL_NUMERIC_H */
@@ -0,0 +1,63 @@
1
+ #ifndef INTERNAL_OBJECT_H /*-*-C-*-vi:se ft=c:*/
2
+ #define INTERNAL_OBJECT_H
3
+ /**
4
+ * @author Ruby developers <ruby-core@ruby-lang.org>
5
+ * @copyright This file is a part of the programming language Ruby.
6
+ * Permission is hereby granted, to either redistribute and/or
7
+ * modify this file, provided that the conditions mentioned in the
8
+ * file COPYING are met. Consult the file for details.
9
+ * @brief Internal header for Object.
10
+ */
11
+ #include "ruby/ruby.h" /* for VALUE */
12
+
13
+ /* object.c */
14
+ size_t rb_obj_embedded_size(uint32_t numiv);
15
+ VALUE rb_class_allocate_instance(VALUE klass);
16
+ VALUE rb_class_search_ancestor(VALUE klass, VALUE super);
17
+ NORETURN(void rb_undefined_alloc(VALUE klass));
18
+ double rb_num_to_dbl(VALUE val);
19
+ VALUE rb_obj_dig(int argc, VALUE *argv, VALUE self, VALUE notfound);
20
+ VALUE rb_obj_clone_setup(VALUE obj, VALUE clone, VALUE kwfreeze);
21
+ VALUE rb_obj_dup_setup(VALUE obj, VALUE dup);
22
+ VALUE rb_immutable_obj_clone(int, VALUE *, VALUE);
23
+ VALUE rb_check_convert_type_with_id(VALUE,int,const char*,ID);
24
+ int rb_bool_expected(VALUE, const char *, int raise);
25
+ static inline void RBASIC_CLEAR_CLASS(VALUE obj);
26
+ static inline void RBASIC_SET_CLASS_RAW(VALUE obj, VALUE klass);
27
+ static inline void RBASIC_SET_CLASS(VALUE obj, VALUE klass);
28
+
29
+ RUBY_SYMBOL_EXPORT_BEGIN
30
+ /* object.c (export) */
31
+ int rb_opts_exception_p(VALUE opts, int default_value);
32
+ RUBY_SYMBOL_EXPORT_END
33
+
34
+ CONSTFUNC(VALUE rb_obj_equal(VALUE obj1, VALUE obj2));
35
+ CONSTFUNC(VALUE rb_obj_not(VALUE obj));
36
+ VALUE rb_obj_not_equal(VALUE obj1, VALUE obj2);
37
+ void rb_obj_copy_ivar(VALUE dest, VALUE obj);
38
+ VALUE rb_false(VALUE obj);
39
+ VALUE rb_convert_type_with_id(VALUE v, int t, const char* nam, ID mid);
40
+ VALUE rb_obj_size(VALUE self, VALUE args, VALUE obj);
41
+ VALUE rb_get_freeze_opt(int argc, VALUE *argv);
42
+
43
+ static inline void
44
+ RBASIC_SET_CLASS_RAW(VALUE obj, VALUE klass)
45
+ {
46
+ const VALUE *ptr = &RBASIC(obj)->klass;
47
+ *(VALUE *)ptr = klass;
48
+ }
49
+
50
+ static inline void
51
+ RBASIC_CLEAR_CLASS(VALUE obj)
52
+ {
53
+ RBASIC_SET_CLASS_RAW(obj, 0);
54
+ }
55
+
56
+ static inline void
57
+ RBASIC_SET_CLASS(VALUE obj, VALUE klass)
58
+ {
59
+ VALUE oldv = RBASIC_CLASS(obj);
60
+ RBASIC_SET_CLASS_RAW(obj, klass);
61
+ RB_OBJ_WRITTEN(obj, oldv, klass);
62
+ }
63
+ #endif /* INTERNAL_OBJECT_H */
@@ -0,0 +1,117 @@
1
+ #ifndef INTERNAL_PARSE_H /*-*-C-*-vi:se ft=c:*/
2
+ #define INTERNAL_PARSE_H
3
+ /**
4
+ * @author Ruby developers <ruby-core@ruby-lang.org>
5
+ * @copyright This file is a part of the programming language Ruby.
6
+ * Permission is hereby granted, to either redistribute and/or
7
+ * modify this file, provided that the conditions mentioned in the
8
+ * file COPYING are met. Consult the file for details.
9
+ * @brief Internal header for the parser.
10
+ */
11
+ #include <limits.h>
12
+ #include "rubyparser.h"
13
+ #include "internal/static_assert.h"
14
+
15
+ #ifdef UNIVERSAL_PARSER
16
+ #define rb_encoding const void
17
+ #endif
18
+
19
+ struct rb_iseq_struct; /* in vm_core.h */
20
+
21
+ /* structs for managing terminator of string literal and heredocment */
22
+ typedef struct rb_strterm_literal_struct {
23
+ long nest;
24
+ int func; /* STR_FUNC_* (e.g., STR_FUNC_ESCAPE and STR_FUNC_EXPAND) */
25
+ int paren; /* '(' of `%q(...)` */
26
+ int term; /* ')' of `%q(...)` */
27
+ } rb_strterm_literal_t;
28
+
29
+ typedef struct rb_strterm_heredoc_struct {
30
+ rb_parser_string_t *lastline; /* the string of line that contains `<<"END"` */
31
+ long offset; /* the column of END in `<<"END"` */
32
+ int sourceline; /* lineno of the line that contains `<<"END"` */
33
+ unsigned length; /* the length of END in `<<"END"` */
34
+ uint8_t quote;
35
+ uint8_t func;
36
+ } rb_strterm_heredoc_t;
37
+
38
+ #define HERETERM_LENGTH_MAX UINT_MAX
39
+
40
+ typedef struct rb_strterm_struct {
41
+ bool heredoc;
42
+ union {
43
+ rb_strterm_literal_t literal;
44
+ rb_strterm_heredoc_t heredoc;
45
+ } u;
46
+ } rb_strterm_t;
47
+
48
+ /* parse.y */
49
+ void rb_ruby_parser_mark(void *ptr);
50
+ size_t rb_ruby_parser_memsize(const void *ptr);
51
+
52
+ void rb_ruby_parser_set_options(rb_parser_t *p, int print, int loop, int chomp, int split);
53
+ rb_parser_t *rb_ruby_parser_set_context(rb_parser_t *p, const struct rb_iseq_struct *base, int main);
54
+ void rb_ruby_parser_set_script_lines(rb_parser_t *p);
55
+ void rb_ruby_parser_error_tolerant(rb_parser_t *p);
56
+ void rb_ruby_parser_keep_tokens(rb_parser_t *p);
57
+ typedef rb_parser_string_t*(rb_parser_lex_gets_func)(struct parser_params*, rb_parser_input_data, int);
58
+ rb_ast_t *rb_parser_compile(rb_parser_t *p, rb_parser_lex_gets_func *gets, const char *fname_ptr, long fname_len, rb_encoding *fname_enc, rb_parser_input_data input, int line);
59
+
60
+ RUBY_SYMBOL_EXPORT_BEGIN
61
+
62
+ rb_encoding *rb_ruby_parser_encoding(rb_parser_t *p);
63
+ int rb_ruby_parser_end_seen_p(rb_parser_t *p);
64
+ int rb_ruby_parser_set_yydebug(rb_parser_t *p, int flag);
65
+ rb_parser_string_t *rb_str_to_parser_string(rb_parser_t *p, VALUE str);
66
+
67
+ int rb_parser_dvar_defined_ref(struct parser_params*, ID, ID**);
68
+ ID rb_parser_internal_id(struct parser_params*);
69
+ int rb_parser_reg_fragment_check(struct parser_params*, rb_parser_string_t*, int);
70
+ int rb_reg_named_capture_assign_iter_impl(struct parser_params *p, const char *s, long len, rb_encoding *enc, NODE **succ_block, const rb_code_location_t *loc);
71
+ int rb_parser_local_defined(struct parser_params *p, ID id, const struct rb_iseq_struct *iseq);
72
+
73
+ RUBY_SYMBOL_EXPORT_END
74
+
75
+ #ifndef UNIVERSAL_PARSER
76
+ rb_parser_t *rb_ruby_parser_allocate(void);
77
+ rb_parser_t *rb_ruby_parser_new(void);
78
+ #endif
79
+
80
+ #ifdef RIPPER
81
+ void ripper_parser_mark(void *ptr);
82
+ void ripper_parser_free(void *ptr);
83
+ size_t ripper_parser_memsize(const void *ptr);
84
+ void ripper_error(struct parser_params *p);
85
+ VALUE ripper_value(struct parser_params *p);
86
+ int rb_ruby_parser_get_yydebug(rb_parser_t *p);
87
+ void rb_ruby_parser_set_value(rb_parser_t *p, VALUE value);
88
+ int rb_ruby_parser_error_p(rb_parser_t *p);
89
+ VALUE rb_ruby_parser_debug_output(rb_parser_t *p);
90
+ void rb_ruby_parser_set_debug_output(rb_parser_t *p, VALUE output);
91
+ VALUE rb_ruby_parser_parsing_thread(rb_parser_t *p);
92
+ void rb_ruby_parser_set_parsing_thread(rb_parser_t *p, VALUE parsing_thread);
93
+ void rb_ruby_parser_ripper_initialize(rb_parser_t *p, rb_parser_lex_gets_func *gets, rb_parser_input_data input, VALUE sourcefile_string, const char *sourcefile, int sourceline);
94
+ VALUE rb_ruby_parser_result(rb_parser_t *p);
95
+ rb_encoding *rb_ruby_parser_enc(rb_parser_t *p);
96
+ VALUE rb_ruby_parser_ruby_sourcefile_string(rb_parser_t *p);
97
+ int rb_ruby_parser_ruby_sourceline(rb_parser_t *p);
98
+ int rb_ruby_parser_lex_state(rb_parser_t *p);
99
+ void rb_ruby_ripper_parse0(rb_parser_t *p);
100
+ int rb_ruby_ripper_dedent_string(rb_parser_t *p, VALUE string, int width);
101
+ int rb_ruby_ripper_initialized_p(rb_parser_t *p);
102
+ void rb_ruby_ripper_parser_initialize(rb_parser_t *p);
103
+ long rb_ruby_ripper_column(rb_parser_t *p);
104
+ long rb_ruby_ripper_token_len(rb_parser_t *p);
105
+ rb_parser_string_t *rb_ruby_ripper_lex_lastline(rb_parser_t *p);
106
+ VALUE rb_ruby_ripper_lex_state_name(struct parser_params *p, int state);
107
+ #ifdef UNIVERSAL_PARSER
108
+ rb_parser_t *rb_ripper_parser_params_allocate(const rb_parser_config_t *config);
109
+ #endif
110
+ struct parser_params *rb_ruby_ripper_parser_allocate(void);
111
+ #endif
112
+
113
+ #ifdef UNIVERSAL_PARSER
114
+ #undef rb_encoding
115
+ #endif
116
+
117
+ #endif /* INTERNAL_PARSE_H */
@@ -0,0 +1,30 @@
1
+ #ifndef INTERNAL_PROC_H /*-*-C-*-vi:se ft=c:*/
2
+ #define INTERNAL_PROC_H
3
+ /**
4
+ * @author Ruby developers <ruby-core@ruby-lang.org>
5
+ * @copyright This file is a part of the programming language Ruby.
6
+ * Permission is hereby granted, to either redistribute and/or
7
+ * modify this file, provided that the conditions mentioned in the
8
+ * file COPYING are met. Consult the file for details.
9
+ * @brief Internal header for Proc.
10
+ */
11
+ #include "ruby/ruby.h" /* for rb_block_call_func_t */
12
+ #include "ruby/st.h" /* for st_index_t */
13
+ struct rb_block; /* in vm_core.h */
14
+ struct rb_iseq_struct; /* in vm_core.h */
15
+
16
+ /* proc.c */
17
+ VALUE rb_proc_location(VALUE self);
18
+ st_index_t rb_hash_proc(st_index_t hash, VALUE proc);
19
+ int rb_block_pair_yield_optimizable(void);
20
+ int rb_block_arity(void);
21
+ int rb_block_min_max_arity(int *max);
22
+ VALUE rb_block_to_s(VALUE self, const struct rb_block *block, const char *additional_info);
23
+ VALUE rb_callable_receiver(VALUE);
24
+
25
+ VALUE rb_func_proc_new(rb_block_call_func_t func, VALUE val);
26
+ VALUE rb_func_lambda_new(rb_block_call_func_t func, VALUE val, int min_argc, int max_argc);
27
+ VALUE rb_iseq_location(const struct rb_iseq_struct *iseq);
28
+ VALUE rb_sym_to_proc(VALUE sym);
29
+
30
+ #endif /* INTERNAL_PROC_H */
@@ -0,0 +1,124 @@
1
+ #ifndef INTERNAL_PROCESS_H /*-*-C-*-vi:se ft=c:*/
2
+ #define INTERNAL_PROCESS_H
3
+ /**
4
+ * @author Ruby developers <ruby-core@ruby-lang.org>
5
+ * @copyright This file is a part of the programming language Ruby.
6
+ * Permission is hereby granted, to either redistribute and/or
7
+ * modify this file, provided that the conditions mentioned in the
8
+ * file COPYING are met. Consult the file for details.
9
+ * @brief Internal header for Process.
10
+ */
11
+ #include "ruby/internal/config.h" /* for rb_pid_t */
12
+ #include <stddef.h> /* for size_t */
13
+
14
+ #ifdef HAVE_SYS_TYPES_H
15
+ # include <sys/types.h> /* for mode_t */
16
+ #endif
17
+
18
+ #ifdef _WIN32
19
+ # include "ruby/win32.h" /* for mode_t */
20
+ #endif
21
+
22
+ #include "ruby/ruby.h" /* for VALUE */
23
+ #include "internal/compilers.h" /* for __has_warning */
24
+ #include "internal/imemo.h" /* for RB_IMEMO_TMPBUF_PTR */
25
+
26
+ #define RB_MAX_GROUPS (65536)
27
+
28
+ struct waitpid_state;
29
+ struct rb_process_status;
30
+ struct rb_execarg {
31
+ union {
32
+ struct {
33
+ VALUE shell_script;
34
+ } sh;
35
+ struct {
36
+ VALUE command_name;
37
+ VALUE command_abspath; /* full path string or nil */
38
+ VALUE argv_str;
39
+ VALUE argv_buf;
40
+ } cmd;
41
+ } invoke;
42
+ VALUE redirect_fds;
43
+ VALUE envp_str;
44
+ VALUE envp_buf;
45
+ VALUE dup2_tmpbuf;
46
+ unsigned use_shell : 1;
47
+ unsigned pgroup_given : 1;
48
+ unsigned umask_given : 1;
49
+ unsigned unsetenv_others_given : 1;
50
+ unsigned unsetenv_others_do : 1;
51
+ unsigned close_others_given : 1;
52
+ unsigned close_others_do : 1;
53
+ unsigned chdir_given : 1;
54
+ unsigned new_pgroup_given : 1;
55
+ unsigned new_pgroup_flag : 1;
56
+ unsigned uid_given : 1;
57
+ unsigned gid_given : 1;
58
+ unsigned exception : 1;
59
+ unsigned exception_given : 1;
60
+ struct rb_process_status *status;
61
+ struct waitpid_state *waitpid_state; /* for async process management */
62
+ rb_pid_t pgroup_pgid; /* asis(-1), new pgroup(0), specified pgroup (0<V). */
63
+ VALUE rlimit_limits; /* Qfalse or [[rtype, softlim, hardlim], ...] */
64
+ mode_t umask_mask;
65
+ rb_uid_t uid;
66
+ rb_gid_t gid;
67
+ int close_others_maxhint;
68
+ VALUE fd_dup2;
69
+ VALUE fd_close;
70
+ VALUE fd_open;
71
+ VALUE fd_dup2_child;
72
+ VALUE env_modification; /* Qfalse or [[k1,v1], ...] */
73
+ VALUE path_env;
74
+ VALUE chdir_dir;
75
+ };
76
+
77
+ /* process.c */
78
+ rb_pid_t rb_call_proc__fork(void);
79
+ void rb_last_status_clear(void);
80
+ static inline char **ARGVSTR2ARGV(VALUE argv_str);
81
+ static inline size_t ARGVSTR2ARGC(VALUE argv_str);
82
+
83
+ #ifdef HAVE_PWD_H
84
+ VALUE rb_getlogin(void);
85
+ VALUE rb_getpwdirnam_for_login(VALUE login); /* read as: "get pwd db home dir by username for login" */
86
+ VALUE rb_getpwdiruid(void); /* read as: "get pwd db home dir for getuid()" */
87
+ #endif
88
+
89
+ RUBY_SYMBOL_EXPORT_BEGIN
90
+ /* process.c (export) */
91
+ int rb_exec_async_signal_safe(const struct rb_execarg *e, char *errmsg, size_t errmsg_buflen);
92
+ rb_pid_t rb_fork_async_signal_safe(int *status, int (*chfunc)(void*, char *, size_t), void *charg, VALUE fds, char *errmsg, size_t errmsg_buflen);
93
+ VALUE rb_execarg_new(int argc, const VALUE *argv, int accept_shell, int allow_exc_opt);
94
+ struct rb_execarg *rb_execarg_get(VALUE execarg_obj); /* dangerous. needs GC guard. */
95
+ int rb_execarg_addopt(VALUE execarg_obj, VALUE key, VALUE val);
96
+ void rb_execarg_parent_start(VALUE execarg_obj);
97
+ void rb_execarg_parent_end(VALUE execarg_obj);
98
+ int rb_execarg_run_options(const struct rb_execarg *e, struct rb_execarg *s, char* errmsg, size_t errmsg_buflen);
99
+ VALUE rb_execarg_extract_options(VALUE execarg_obj, VALUE opthash);
100
+ void rb_execarg_setenv(VALUE execarg_obj, VALUE env);
101
+ RUBY_SYMBOL_EXPORT_END
102
+
103
+ /* argv_str contains extra two elements.
104
+ * The beginning one is for /bin/sh used by exec_with_sh.
105
+ * The last one for terminating NULL used by execve.
106
+ * See rb_exec_fillarg() in process.c. */
107
+ static inline char **
108
+ ARGVSTR2ARGV(VALUE argv_str)
109
+ {
110
+ char **buf = RB_IMEMO_TMPBUF_PTR(argv_str);
111
+ return &buf[1];
112
+ }
113
+
114
+ static inline size_t
115
+ ARGVSTR2ARGC(VALUE argv_str)
116
+ {
117
+ size_t i = 0;
118
+ char *const *p = ARGVSTR2ARGV(argv_str);
119
+ while (p[i++])
120
+ ;
121
+ return i - 1;
122
+ }
123
+
124
+ #endif /* INTERNAL_PROCESS_H */
@@ -0,0 +1,6 @@
1
+ #ifndef INTERNAL_RACTOR_H /*-*-C-*-vi:se ft=c:*/
2
+ #define INTERNAL_RACTOR_H
3
+
4
+ void rb_ractor_ensure_main_ractor(const char *msg);
5
+
6
+ #endif /* INTERNAL_RACTOR_H */
@@ -0,0 +1,17 @@
1
+ #ifndef INTERNAL_RANDOM_H /*-*-C-*-vi:se ft=c:*/
2
+ #define INTERNAL_RANDOM_H
3
+ /**
4
+ * @author Ruby developers <ruby-core@ruby-lang.org>
5
+ * @copyright This file is a part of the programming language Ruby.
6
+ * Permission is hereby granted, to either redistribute and/or
7
+ * modify this file, provided that the conditions mentioned in the
8
+ * file COPYING are met. Consult the file for details.
9
+ * @brief Internal header for Random.
10
+ */
11
+ #include <stddef.h> /* for size_t */
12
+
13
+ /* random.c */
14
+ int ruby_fill_random_bytes(void *, size_t, int);
15
+ void rb_free_default_rand_key(void);
16
+
17
+ #endif /* INTERNAL_RANDOM_H */
@@ -0,0 +1,40 @@
1
+ #ifndef INTERNAL_RANGE_H /*-*-C-*-vi:se ft=c:*/
2
+ #define INTERNAL_RANGE_H
3
+ /**
4
+ * @author Ruby developers <ruby-core@ruby-lang.org>
5
+ * @copyright This file is a part of the programming language Ruby.
6
+ * Permission is hereby granted, to either redistribute and/or
7
+ * modify this file, provided that the conditions mentioned in the
8
+ * file COPYING are met. Consult the file for details.
9
+ * @brief Internal header for Range.
10
+ */
11
+ #include "internal/struct.h" /* for RSTRUCT */
12
+
13
+ /* range.c */
14
+ static inline VALUE RANGE_BEG(VALUE r);
15
+ static inline VALUE RANGE_END(VALUE r);
16
+ static inline VALUE RANGE_EXCL(VALUE r);
17
+
18
+ static inline VALUE
19
+ RANGE_BEG(VALUE r)
20
+ {
21
+ return RSTRUCT(r)->as.ary[0];
22
+ }
23
+
24
+ static inline VALUE
25
+ RANGE_END(VALUE r)
26
+ {
27
+ return RSTRUCT_GET(r, 1);
28
+ }
29
+
30
+ static inline VALUE
31
+ RANGE_EXCL(VALUE r)
32
+ {
33
+ return RSTRUCT_GET(r, 2);
34
+ }
35
+
36
+ VALUE
37
+ rb_range_component_beg_len(VALUE b, VALUE e, int excl,
38
+ long *begp, long *lenp, long len, int err);
39
+
40
+ #endif /* INTERNAL_RANGE_H */