debase-ruby_core_source 0.10.0 → 0.10.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (191) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +7 -0
  3. data/README.md +1 -0
  4. data/Rakefile +2 -2
  5. data/lib/debase/ruby_core_source.rb +1 -0
  6. data/lib/debase/ruby_core_source/ruby-2.2.9-p480/addr2line.h +21 -0
  7. data/lib/debase/ruby_core_source/ruby-2.2.9-p480/ccan/build_assert/build_assert.h +40 -0
  8. data/lib/debase/ruby_core_source/ruby-2.2.9-p480/ccan/check_type/check_type.h +63 -0
  9. data/lib/debase/ruby_core_source/ruby-2.2.9-p480/ccan/container_of/container_of.h +142 -0
  10. data/lib/debase/ruby_core_source/ruby-2.2.9-p480/ccan/list/list.h +635 -0
  11. data/lib/debase/ruby_core_source/ruby-2.2.9-p480/ccan/str/str.h +16 -0
  12. data/lib/debase/ruby_core_source/ruby-2.2.9-p480/constant.h +43 -0
  13. data/lib/debase/ruby_core_source/ruby-2.2.9-p480/dln.h +51 -0
  14. data/lib/debase/ruby_core_source/ruby-2.2.9-p480/eval_intern.h +275 -0
  15. data/lib/debase/ruby_core_source/ruby-2.2.9-p480/gc.h +107 -0
  16. data/lib/debase/ruby_core_source/ruby-2.2.9-p480/id.h +210 -0
  17. data/lib/debase/ruby_core_source/ruby-2.2.9-p480/insns.inc +107 -0
  18. data/lib/debase/ruby_core_source/ruby-2.2.9-p480/insns_info.inc +752 -0
  19. data/lib/debase/ruby_core_source/ruby-2.2.9-p480/internal.h +1198 -0
  20. data/lib/debase/ruby_core_source/ruby-2.2.9-p480/iseq.h +158 -0
  21. data/lib/debase/ruby_core_source/ruby-2.2.9-p480/known_errors.inc +746 -0
  22. data/lib/debase/ruby_core_source/ruby-2.2.9-p480/method.h +144 -0
  23. data/lib/debase/ruby_core_source/ruby-2.2.9-p480/node.h +544 -0
  24. data/lib/debase/ruby_core_source/ruby-2.2.9-p480/node_name.inc +212 -0
  25. data/lib/debase/ruby_core_source/ruby-2.2.9-p480/opt_sc.inc +734 -0
  26. data/lib/debase/ruby_core_source/ruby-2.2.9-p480/optinsn.inc +83 -0
  27. data/lib/debase/ruby_core_source/ruby-2.2.9-p480/optunifs.inc +124 -0
  28. data/lib/debase/ruby_core_source/ruby-2.2.9-p480/parse.h +184 -0
  29. data/lib/debase/ruby_core_source/ruby-2.2.9-p480/probes_helper.h +67 -0
  30. data/lib/debase/ruby_core_source/ruby-2.2.9-p480/regenc.h +237 -0
  31. data/lib/debase/ruby_core_source/ruby-2.2.9-p480/regint.h +972 -0
  32. data/lib/debase/ruby_core_source/ruby-2.2.9-p480/regparse.h +363 -0
  33. data/lib/debase/ruby_core_source/ruby-2.2.9-p480/revision.h +1 -0
  34. data/lib/debase/ruby_core_source/ruby-2.2.9-p480/ruby_atomic.h +170 -0
  35. data/lib/debase/ruby_core_source/ruby-2.2.9-p480/siphash.h +48 -0
  36. data/lib/debase/ruby_core_source/ruby-2.2.9-p480/symbol.h +88 -0
  37. data/lib/debase/ruby_core_source/ruby-2.2.9-p480/thread_pthread.h +54 -0
  38. data/lib/debase/ruby_core_source/ruby-2.2.9-p480/thread_win32.h +36 -0
  39. data/lib/debase/ruby_core_source/ruby-2.2.9-p480/timev.h +42 -0
  40. data/lib/debase/ruby_core_source/ruby-2.2.9-p480/transcode_data.h +123 -0
  41. data/lib/debase/ruby_core_source/ruby-2.2.9-p480/version.h +52 -0
  42. data/lib/debase/ruby_core_source/ruby-2.2.9-p480/vm.inc +3372 -0
  43. data/lib/debase/ruby_core_source/ruby-2.2.9-p480/vm_core.h +1163 -0
  44. data/lib/debase/ruby_core_source/ruby-2.2.9-p480/vm_debug.h +37 -0
  45. data/lib/debase/ruby_core_source/ruby-2.2.9-p480/vm_exec.h +182 -0
  46. data/lib/debase/ruby_core_source/ruby-2.2.9-p480/vm_insnhelper.h +233 -0
  47. data/lib/debase/ruby_core_source/ruby-2.2.9-p480/vm_opts.h +56 -0
  48. data/lib/debase/ruby_core_source/ruby-2.2.9-p480/vmtc.inc +105 -0
  49. data/lib/debase/ruby_core_source/ruby-2.3.6-p384/addr2line.h +21 -0
  50. data/lib/debase/ruby_core_source/ruby-2.3.6-p384/ccan/build_assert/build_assert.h +40 -0
  51. data/lib/debase/ruby_core_source/ruby-2.3.6-p384/ccan/check_type/check_type.h +63 -0
  52. data/lib/debase/ruby_core_source/ruby-2.3.6-p384/ccan/container_of/container_of.h +142 -0
  53. data/lib/debase/ruby_core_source/ruby-2.3.6-p384/ccan/list/list.h +773 -0
  54. data/lib/debase/ruby_core_source/ruby-2.3.6-p384/ccan/str/str.h +16 -0
  55. data/lib/debase/ruby_core_source/ruby-2.3.6-p384/constant.h +50 -0
  56. data/lib/debase/ruby_core_source/ruby-2.3.6-p384/dln.h +51 -0
  57. data/lib/debase/ruby_core_source/ruby-2.3.6-p384/encindex.h +67 -0
  58. data/lib/debase/ruby_core_source/ruby-2.3.6-p384/eval_intern.h +304 -0
  59. data/lib/debase/ruby_core_source/ruby-2.3.6-p384/gc.h +114 -0
  60. data/lib/debase/ruby_core_source/ruby-2.3.6-p384/id.h +211 -0
  61. data/lib/debase/ruby_core_source/ruby-2.3.6-p384/id_table.h +30 -0
  62. data/lib/debase/ruby_core_source/ruby-2.3.6-p384/insns.inc +110 -0
  63. data/lib/debase/ruby_core_source/ruby-2.3.6-p384/insns_info.inc +776 -0
  64. data/lib/debase/ruby_core_source/ruby-2.3.6-p384/internal.h +1408 -0
  65. data/lib/debase/ruby_core_source/ruby-2.3.6-p384/iseq.h +249 -0
  66. data/lib/debase/ruby_core_source/ruby-2.3.6-p384/known_errors.inc +746 -0
  67. data/lib/debase/ruby_core_source/ruby-2.3.6-p384/method.h +213 -0
  68. data/lib/debase/ruby_core_source/ruby-2.3.6-p384/node.h +520 -0
  69. data/lib/debase/ruby_core_source/ruby-2.3.6-p384/node_name.inc +208 -0
  70. data/lib/debase/ruby_core_source/ruby-2.3.6-p384/opt_sc.inc +758 -0
  71. data/lib/debase/ruby_core_source/ruby-2.3.6-p384/optinsn.inc +83 -0
  72. data/lib/debase/ruby_core_source/ruby-2.3.6-p384/optunifs.inc +127 -0
  73. data/lib/debase/ruby_core_source/ruby-2.3.6-p384/parse.h +185 -0
  74. data/lib/debase/ruby_core_source/ruby-2.3.6-p384/probes_helper.h +43 -0
  75. data/lib/debase/ruby_core_source/ruby-2.3.6-p384/regenc.h +237 -0
  76. data/lib/debase/ruby_core_source/ruby-2.3.6-p384/regint.h +987 -0
  77. data/lib/debase/ruby_core_source/ruby-2.3.6-p384/regparse.h +367 -0
  78. data/lib/debase/ruby_core_source/ruby-2.3.6-p384/revision.h +1 -0
  79. data/lib/debase/ruby_core_source/ruby-2.3.6-p384/ruby_atomic.h +233 -0
  80. data/lib/debase/ruby_core_source/ruby-2.3.6-p384/siphash.h +48 -0
  81. data/lib/debase/ruby_core_source/ruby-2.3.6-p384/symbol.h +108 -0
  82. data/lib/debase/ruby_core_source/ruby-2.3.6-p384/thread_pthread.h +54 -0
  83. data/lib/debase/ruby_core_source/ruby-2.3.6-p384/thread_win32.h +36 -0
  84. data/lib/debase/ruby_core_source/ruby-2.3.6-p384/timev.h +42 -0
  85. data/lib/debase/ruby_core_source/ruby-2.3.6-p384/transcode_data.h +139 -0
  86. data/lib/debase/ruby_core_source/ruby-2.3.6-p384/version.h +55 -0
  87. data/lib/debase/ruby_core_source/ruby-2.3.6-p384/vm.inc +3414 -0
  88. data/lib/debase/ruby_core_source/ruby-2.3.6-p384/vm_call_iseq_optimized.inc +212 -0
  89. data/lib/debase/ruby_core_source/ruby-2.3.6-p384/vm_core.h +1240 -0
  90. data/lib/debase/ruby_core_source/ruby-2.3.6-p384/vm_debug.h +37 -0
  91. data/lib/debase/ruby_core_source/ruby-2.3.6-p384/vm_exec.h +182 -0
  92. data/lib/debase/ruby_core_source/ruby-2.3.6-p384/vm_insnhelper.h +243 -0
  93. data/lib/debase/ruby_core_source/ruby-2.3.6-p384/vm_opts.h +57 -0
  94. data/lib/debase/ruby_core_source/ruby-2.3.6-p384/vmtc.inc +108 -0
  95. data/lib/debase/ruby_core_source/ruby-2.4.3-p205/addr2line.h +21 -0
  96. data/lib/debase/ruby_core_source/ruby-2.4.3-p205/ccan/build_assert/build_assert.h +40 -0
  97. data/lib/debase/ruby_core_source/ruby-2.4.3-p205/ccan/check_type/check_type.h +63 -0
  98. data/lib/debase/ruby_core_source/ruby-2.4.3-p205/ccan/container_of/container_of.h +142 -0
  99. data/lib/debase/ruby_core_source/ruby-2.4.3-p205/ccan/list/list.h +773 -0
  100. data/lib/debase/ruby_core_source/ruby-2.4.3-p205/ccan/str/str.h +16 -0
  101. data/lib/debase/ruby_core_source/ruby-2.4.3-p205/constant.h +50 -0
  102. data/lib/debase/ruby_core_source/ruby-2.4.3-p205/dln.h +51 -0
  103. data/lib/debase/ruby_core_source/ruby-2.4.3-p205/encindex.h +67 -0
  104. data/lib/debase/ruby_core_source/ruby-2.4.3-p205/eval_intern.h +315 -0
  105. data/lib/debase/ruby_core_source/ruby-2.4.3-p205/gc.h +114 -0
  106. data/lib/debase/ruby_core_source/ruby-2.4.3-p205/id.h +220 -0
  107. data/lib/debase/ruby_core_source/ruby-2.4.3-p205/id_table.h +31 -0
  108. data/lib/debase/ruby_core_source/ruby-2.4.3-p205/insns.inc +112 -0
  109. data/lib/debase/ruby_core_source/ruby-2.4.3-p205/insns_info.inc +796 -0
  110. data/lib/debase/ruby_core_source/ruby-2.4.3-p205/internal.h +1790 -0
  111. data/lib/debase/ruby_core_source/ruby-2.4.3-p205/iseq.h +252 -0
  112. data/lib/debase/ruby_core_source/ruby-2.4.3-p205/known_errors.inc +746 -0
  113. data/lib/debase/ruby_core_source/ruby-2.4.3-p205/method.h +213 -0
  114. data/lib/debase/ruby_core_source/ruby-2.4.3-p205/node.h +520 -0
  115. data/lib/debase/ruby_core_source/ruby-2.4.3-p205/node_name.inc +208 -0
  116. data/lib/debase/ruby_core_source/ruby-2.4.3-p205/opt_sc.inc +774 -0
  117. data/lib/debase/ruby_core_source/ruby-2.4.3-p205/optinsn.inc +83 -0
  118. data/lib/debase/ruby_core_source/ruby-2.4.3-p205/optunifs.inc +129 -0
  119. data/lib/debase/ruby_core_source/ruby-2.4.3-p205/parse.h +185 -0
  120. data/lib/debase/ruby_core_source/ruby-2.4.3-p205/probes_helper.h +43 -0
  121. data/lib/debase/ruby_core_source/ruby-2.4.3-p205/regenc.h +254 -0
  122. data/lib/debase/ruby_core_source/ruby-2.4.3-p205/regint.h +938 -0
  123. data/lib/debase/ruby_core_source/ruby-2.4.3-p205/regparse.h +370 -0
  124. data/lib/debase/ruby_core_source/ruby-2.4.3-p205/revision.h +1 -0
  125. data/lib/debase/ruby_core_source/ruby-2.4.3-p205/ruby_assert.h +54 -0
  126. data/lib/debase/ruby_core_source/ruby-2.4.3-p205/ruby_atomic.h +233 -0
  127. data/lib/debase/ruby_core_source/ruby-2.4.3-p205/siphash.h +48 -0
  128. data/lib/debase/ruby_core_source/ruby-2.4.3-p205/symbol.h +108 -0
  129. data/lib/debase/ruby_core_source/ruby-2.4.3-p205/thread_pthread.h +54 -0
  130. data/lib/debase/ruby_core_source/ruby-2.4.3-p205/thread_win32.h +36 -0
  131. data/lib/debase/ruby_core_source/ruby-2.4.3-p205/timev.h +42 -0
  132. data/lib/debase/ruby_core_source/ruby-2.4.3-p205/transcode_data.h +139 -0
  133. data/lib/debase/ruby_core_source/ruby-2.4.3-p205/version.h +73 -0
  134. data/lib/debase/ruby_core_source/ruby-2.4.3-p205/vm.inc +3415 -0
  135. data/lib/debase/ruby_core_source/ruby-2.4.3-p205/vm_call_iseq_optimized.inc +212 -0
  136. data/lib/debase/ruby_core_source/ruby-2.4.3-p205/vm_core.h +1646 -0
  137. data/lib/debase/ruby_core_source/ruby-2.4.3-p205/vm_debug.h +37 -0
  138. data/lib/debase/ruby_core_source/ruby-2.4.3-p205/vm_exec.h +182 -0
  139. data/lib/debase/ruby_core_source/ruby-2.4.3-p205/vm_insnhelper.h +243 -0
  140. data/lib/debase/ruby_core_source/ruby-2.4.3-p205/vm_opts.h +57 -0
  141. data/lib/debase/ruby_core_source/ruby-2.4.3-p205/vmtc.inc +110 -0
  142. data/lib/debase/ruby_core_source/ruby-2.5.0-rc1/addr2line.h +21 -0
  143. data/lib/debase/ruby_core_source/ruby-2.5.0-rc1/ccan/build_assert/build_assert.h +40 -0
  144. data/lib/debase/ruby_core_source/ruby-2.5.0-rc1/ccan/check_type/check_type.h +63 -0
  145. data/lib/debase/ruby_core_source/ruby-2.5.0-rc1/ccan/container_of/container_of.h +142 -0
  146. data/lib/debase/ruby_core_source/ruby-2.5.0-rc1/ccan/list/list.h +773 -0
  147. data/lib/debase/ruby_core_source/ruby-2.5.0-rc1/ccan/str/str.h +16 -0
  148. data/lib/debase/ruby_core_source/ruby-2.5.0-rc1/constant.h +50 -0
  149. data/lib/debase/ruby_core_source/ruby-2.5.0-rc1/debug_counter.h +109 -0
  150. data/lib/debase/ruby_core_source/ruby-2.5.0-rc1/dln.h +51 -0
  151. data/lib/debase/ruby_core_source/ruby-2.5.0-rc1/encindex.h +67 -0
  152. data/lib/debase/ruby_core_source/ruby-2.5.0-rc1/eval_intern.h +334 -0
  153. data/lib/debase/ruby_core_source/ruby-2.5.0-rc1/gc.h +116 -0
  154. data/lib/debase/ruby_core_source/ruby-2.5.0-rc1/id.h +250 -0
  155. data/lib/debase/ruby_core_source/ruby-2.5.0-rc1/id_table.h +31 -0
  156. data/lib/debase/ruby_core_source/ruby-2.5.0-rc1/insns.inc +217 -0
  157. data/lib/debase/ruby_core_source/ruby-2.5.0-rc1/insns_info.inc +1570 -0
  158. data/lib/debase/ruby_core_source/ruby-2.5.0-rc1/internal.h +2035 -0
  159. data/lib/debase/ruby_core_source/ruby-2.5.0-rc1/iseq.h +307 -0
  160. data/lib/debase/ruby_core_source/ruby-2.5.0-rc1/known_errors.inc +746 -0
  161. data/lib/debase/ruby_core_source/ruby-2.5.0-rc1/method.h +218 -0
  162. data/lib/debase/ruby_core_source/ruby-2.5.0-rc1/node.h +540 -0
  163. data/lib/debase/ruby_core_source/ruby-2.5.0-rc1/node_name.inc +198 -0
  164. data/lib/debase/ruby_core_source/ruby-2.5.0-rc1/opt_sc.inc +1601 -0
  165. data/lib/debase/ruby_core_source/ruby-2.5.0-rc1/optinsn.inc +103 -0
  166. data/lib/debase/ruby_core_source/ruby-2.5.0-rc1/optunifs.inc +61 -0
  167. data/lib/debase/ruby_core_source/ruby-2.5.0-rc1/parse.h +206 -0
  168. data/lib/debase/ruby_core_source/ruby-2.5.0-rc1/probes_helper.h +43 -0
  169. data/lib/debase/ruby_core_source/ruby-2.5.0-rc1/regenc.h +254 -0
  170. data/lib/debase/ruby_core_source/ruby-2.5.0-rc1/regint.h +938 -0
  171. data/lib/debase/ruby_core_source/ruby-2.5.0-rc1/regparse.h +370 -0
  172. data/lib/debase/ruby_core_source/ruby-2.5.0-rc1/revision.h +1 -0
  173. data/lib/debase/ruby_core_source/ruby-2.5.0-rc1/ruby_assert.h +54 -0
  174. data/lib/debase/ruby_core_source/ruby-2.5.0-rc1/ruby_atomic.h +233 -0
  175. data/lib/debase/ruby_core_source/ruby-2.5.0-rc1/siphash.h +48 -0
  176. data/lib/debase/ruby_core_source/ruby-2.5.0-rc1/symbol.h +108 -0
  177. data/lib/debase/ruby_core_source/ruby-2.5.0-rc1/thread_pthread.h +54 -0
  178. data/lib/debase/ruby_core_source/ruby-2.5.0-rc1/thread_win32.h +36 -0
  179. data/lib/debase/ruby_core_source/ruby-2.5.0-rc1/timev.h +42 -0
  180. data/lib/debase/ruby_core_source/ruby-2.5.0-rc1/transcode_data.h +139 -0
  181. data/lib/debase/ruby_core_source/ruby-2.5.0-rc1/version.h +73 -0
  182. data/lib/debase/ruby_core_source/ruby-2.5.0-rc1/vm.inc +3667 -0
  183. data/lib/debase/ruby_core_source/ruby-2.5.0-rc1/vm_call_iseq_optimized.inc +213 -0
  184. data/lib/debase/ruby_core_source/ruby-2.5.0-rc1/vm_core.h +1768 -0
  185. data/lib/debase/ruby_core_source/ruby-2.5.0-rc1/vm_debug.h +37 -0
  186. data/lib/debase/ruby_core_source/ruby-2.5.0-rc1/vm_exec.h +192 -0
  187. data/lib/debase/ruby_core_source/ruby-2.5.0-rc1/vm_insnhelper.h +255 -0
  188. data/lib/debase/ruby_core_source/ruby-2.5.0-rc1/vm_opts.h +57 -0
  189. data/lib/debase/ruby_core_source/ruby-2.5.0-rc1/vmtc.inc +214 -0
  190. data/lib/debase/ruby_core_source/version.rb +1 -1
  191. metadata +186 -2
@@ -0,0 +1,48 @@
1
+ #ifndef SIPHASH_H
2
+ #define SIPHASH_H 1
3
+ #include <stdlib.h>
4
+ #ifdef HAVE_STDINT_H
5
+ #include <stdint.h>
6
+ #endif
7
+ #ifdef HAVE_INTTYPES_H
8
+ #include <inttypes.h>
9
+ #endif
10
+
11
+ #ifndef HAVE_UINT64_T
12
+ typedef struct {
13
+ uint32_t u32[2];
14
+ } sip_uint64_t;
15
+ #define uint64_t sip_uint64_t
16
+ #else
17
+ typedef uint64_t sip_uint64_t;
18
+ #endif
19
+
20
+ typedef struct {
21
+ int c;
22
+ int d;
23
+ uint64_t v[4];
24
+ uint8_t buf[sizeof(uint64_t)];
25
+ uint8_t buflen;
26
+ uint8_t msglen_byte;
27
+ } sip_state;
28
+
29
+ typedef struct sip_interface_st sip_interface;
30
+
31
+ typedef struct {
32
+ sip_state state[1];
33
+ const sip_interface *methods;
34
+ } sip_hash;
35
+
36
+ sip_hash *sip_hash_new(const uint8_t key[16], int c, int d);
37
+ sip_hash *sip_hash_init(sip_hash *h, const uint8_t key[16], int c, int d);
38
+ int sip_hash_update(sip_hash *h, const uint8_t *data, size_t len);
39
+ int sip_hash_final(sip_hash *h, uint8_t **digest, size_t *len);
40
+ int sip_hash_final_integer(sip_hash *h, uint64_t *digest);
41
+ int sip_hash_digest(sip_hash *h, const uint8_t *data, size_t data_len, uint8_t **digest, size_t *digest_len);
42
+ int sip_hash_digest_integer(sip_hash *h, const uint8_t *data, size_t data_len, uint64_t *digest);
43
+ void sip_hash_free(sip_hash *h);
44
+ void sip_hash_dump(sip_hash *h);
45
+
46
+ uint64_t sip_hash13(const uint8_t key[16], const uint8_t *data, size_t len);
47
+
48
+ #endif
@@ -0,0 +1,108 @@
1
+ /**********************************************************************
2
+
3
+ symbol.h -
4
+
5
+ $Author$
6
+ created at: Tue Jul 8 15:49:54 JST 2014
7
+
8
+ Copyright (C) 2014 Yukihiro Matsumoto
9
+
10
+ **********************************************************************/
11
+
12
+ #ifndef RUBY_SYMBOL_H
13
+ #define RUBY_SYMBOL_H 1
14
+
15
+ #include "id.h"
16
+
17
+ #define DYNAMIC_ID_P(id) (!(id&ID_STATIC_SYM)&&id>tLAST_OP_ID)
18
+ #define STATIC_ID2SYM(id) (((VALUE)(id)<<RUBY_SPECIAL_SHIFT)|SYMBOL_FLAG)
19
+
20
+ #ifdef HAVE_BUILTIN___BUILTIN_CONSTANT_P
21
+ #define rb_id2sym(id) \
22
+ RB_GNUC_EXTENSION_BLOCK(__builtin_constant_p(id) && !DYNAMIC_ID_P(id) ? \
23
+ STATIC_ID2SYM(id) : rb_id2sym(id))
24
+ #endif
25
+
26
+ struct RSymbol {
27
+ struct RBasic basic;
28
+ st_index_t hashval;
29
+ VALUE fstr;
30
+ ID id;
31
+ };
32
+
33
+ #define RSYMBOL(obj) (R_CAST(RSymbol)(obj))
34
+
35
+ #define is_notop_id(id) ((id)>tLAST_OP_ID)
36
+ #define is_local_id(id) (id_type(id)==ID_LOCAL)
37
+ #define is_global_id(id) (id_type(id)==ID_GLOBAL)
38
+ #define is_instance_id(id) (id_type(id)==ID_INSTANCE)
39
+ #define is_attrset_id(id) ((id)==idASET||id_type(id)==ID_ATTRSET)
40
+ #define is_const_id(id) (id_type(id)==ID_CONST)
41
+ #define is_class_id(id) (id_type(id)==ID_CLASS)
42
+ #define is_junk_id(id) (id_type(id)==ID_JUNK)
43
+
44
+ static inline int
45
+ id_type(ID id)
46
+ {
47
+ if (is_notop_id(id)) {
48
+ return (int)(id&ID_SCOPE_MASK);
49
+ }
50
+ else {
51
+ return -1;
52
+ }
53
+ }
54
+
55
+ typedef uint32_t rb_id_serial_t;
56
+
57
+ static inline rb_id_serial_t
58
+ rb_id_to_serial(ID id)
59
+ {
60
+ if (is_notop_id(id)) {
61
+ return (rb_id_serial_t)(id >> ID_SCOPE_SHIFT);
62
+ }
63
+ else {
64
+ return (rb_id_serial_t)id;
65
+ }
66
+ }
67
+
68
+ static inline int
69
+ sym_type(VALUE sym)
70
+ {
71
+ ID id;
72
+ if (STATIC_SYM_P(sym)) {
73
+ id = RSHIFT(sym, RUBY_SPECIAL_SHIFT);
74
+ if (id<=tLAST_OP_ID) {
75
+ return -1;
76
+ }
77
+ }
78
+ else {
79
+ id = RSYMBOL(sym)->id;
80
+ }
81
+ return (int)(id&ID_SCOPE_MASK);
82
+ }
83
+
84
+ #define is_local_sym(sym) (sym_type(sym)==ID_LOCAL)
85
+ #define is_global_sym(sym) (sym_type(sym)==ID_GLOBAL)
86
+ #define is_instance_sym(sym) (sym_type(sym)==ID_INSTANCE)
87
+ #define is_attrset_sym(sym) (sym_type(sym)==ID_ATTRSET)
88
+ #define is_const_sym(sym) (sym_type(sym)==ID_CONST)
89
+ #define is_class_sym(sym) (sym_type(sym)==ID_CLASS)
90
+ #define is_junk_sym(sym) (sym_type(sym)==ID_JUNK)
91
+
92
+ RUBY_FUNC_EXPORTED const unsigned int ruby_global_name_punct_bits[(0x7e - 0x20 + 31) / 32];
93
+
94
+ static inline int
95
+ is_global_name_punct(const int c)
96
+ {
97
+ if (c <= 0x20 || 0x7e < c) return 0;
98
+ return (ruby_global_name_punct_bits[(c - 0x20) / 32] >> (c % 32)) & 1;
99
+ }
100
+
101
+ ID rb_intern_cstr_without_pindown(const char *, long, rb_encoding *);
102
+
103
+ RUBY_SYMBOL_EXPORT_BEGIN
104
+
105
+ size_t rb_sym_immortal_count(void);
106
+
107
+ RUBY_SYMBOL_EXPORT_END
108
+ #endif
@@ -0,0 +1,54 @@
1
+ /**********************************************************************
2
+
3
+ thread_pthread.h -
4
+
5
+ $Author: kosaki $
6
+
7
+ Copyright (C) 2004-2007 Koichi Sasada
8
+
9
+ **********************************************************************/
10
+
11
+ #ifndef RUBY_THREAD_PTHREAD_H
12
+ #define RUBY_THREAD_PTHREAD_H
13
+
14
+ #ifdef HAVE_PTHREAD_NP_H
15
+ #include <pthread_np.h>
16
+ #endif
17
+
18
+ #define RB_NATIVETHREAD_LOCK_INIT PTHREAD_MUTEX_INITIALIZER
19
+ #define RB_NATIVETHREAD_COND_INIT { PTHREAD_COND_INITIALIZER, }
20
+
21
+ typedef struct rb_thread_cond_struct {
22
+ pthread_cond_t cond;
23
+ #ifdef HAVE_CLOCKID_T
24
+ clockid_t clockid;
25
+ #endif
26
+ } rb_nativethread_cond_t;
27
+
28
+ typedef struct native_thread_data_struct {
29
+ struct list_node ubf_list;
30
+ rb_nativethread_cond_t sleep_cond;
31
+ } native_thread_data_t;
32
+
33
+ #undef except
34
+ #undef try
35
+ #undef leave
36
+ #undef finally
37
+
38
+ typedef struct rb_global_vm_lock_struct {
39
+ /* fast path */
40
+ unsigned long acquired;
41
+ rb_nativethread_lock_t lock;
42
+
43
+ /* slow path */
44
+ volatile unsigned long waiting;
45
+ rb_nativethread_cond_t cond;
46
+
47
+ /* yield */
48
+ rb_nativethread_cond_t switch_cond;
49
+ rb_nativethread_cond_t switch_wait_cond;
50
+ int need_yield;
51
+ int wait_yield;
52
+ } rb_global_vm_lock_t;
53
+
54
+ #endif /* RUBY_THREAD_PTHREAD_H */
@@ -0,0 +1,36 @@
1
+ /**********************************************************************
2
+
3
+ thread_win32.h -
4
+
5
+ $Author: ko1 $
6
+
7
+ Copyright (C) 2004-2007 Koichi Sasada
8
+
9
+ **********************************************************************/
10
+
11
+ /* interface */
12
+ #ifndef RUBY_THREAD_WIN32_H
13
+ #define RUBY_THREAD_WIN32_H
14
+
15
+ # ifdef __CYGWIN__
16
+ # undef _WIN32
17
+ # endif
18
+
19
+ WINBASEAPI BOOL WINAPI
20
+ TryEnterCriticalSection(IN OUT LPCRITICAL_SECTION lpCriticalSection);
21
+
22
+ typedef struct rb_thread_cond_struct {
23
+ struct cond_event_entry *next;
24
+ struct cond_event_entry *prev;
25
+ } rb_nativethread_cond_t;
26
+
27
+ typedef struct native_thread_data_struct {
28
+ HANDLE interrupt_event;
29
+ } native_thread_data_t;
30
+
31
+ typedef struct rb_global_vm_lock_struct {
32
+ HANDLE lock;
33
+ } rb_global_vm_lock_t;
34
+
35
+ #endif /* RUBY_THREAD_WIN32_H */
36
+
@@ -0,0 +1,42 @@
1
+ #ifndef RUBY_TIMEV_H
2
+ #define RUBY_TIMEV_H
3
+
4
+ PACKED_STRUCT_UNALIGNED(struct vtm {
5
+ VALUE year; /* 2000 for example. Integer. */
6
+ VALUE subsecx; /* 0 <= subsecx < TIME_SCALE. possibly Rational. */
7
+ VALUE utc_offset; /* -3600 as -01:00 for example. possibly Rational. */
8
+ const char *zone; /* "JST", "EST", "EDT", etc. */
9
+ uint16_t yday:9; /* 1..366 */
10
+ uint8_t mon:4; /* 1..12 */
11
+ uint8_t mday:5; /* 1..31 */
12
+ uint8_t hour:5; /* 0..23 */
13
+ uint8_t min:6; /* 0..59 */
14
+ uint8_t sec:6; /* 0..60 */
15
+ uint8_t wday:3; /* 0:Sunday, 1:Monday, ..., 6:Saturday 7:init */
16
+ uint8_t isdst:2; /* 0:StandardTime 1:DayLightSavingTime 3:init */
17
+ });
18
+
19
+ #define TIME_SCALE 1000000000
20
+
21
+ #ifndef TYPEOF_TIMEVAL_TV_SEC
22
+ # define TYPEOF_TIMEVAL_TV_SEC time_t
23
+ #endif
24
+ #ifndef TYPEOF_TIMEVAL_TV_USEC
25
+ # if INT_MAX >= 1000000
26
+ # define TYPEOF_TIMEVAL_TV_USEC int
27
+ # else
28
+ # define TYPEOF_TIMEVAL_TV_USEC long
29
+ # endif
30
+ #endif
31
+
32
+ #if SIZEOF_TIME_T == SIZEOF_LONG
33
+ typedef unsigned long unsigned_time_t;
34
+ #elif SIZEOF_TIME_T == SIZEOF_INT
35
+ typedef unsigned int unsigned_time_t;
36
+ #elif SIZEOF_TIME_T == SIZEOF_LONG_LONG
37
+ typedef unsigned LONG_LONG unsigned_time_t;
38
+ #else
39
+ # error cannot find integer type which size is same as time_t.
40
+ #endif
41
+
42
+ #endif
@@ -0,0 +1,139 @@
1
+ /**********************************************************************
2
+
3
+ transcode_data.h -
4
+
5
+ $Author: nobu $
6
+ created at: Mon 10 Dec 2007 14:01:47 JST 2007
7
+
8
+ Copyright (C) 2007 Martin Duerst
9
+
10
+ **********************************************************************/
11
+
12
+ #include "ruby/ruby.h"
13
+
14
+ #ifndef RUBY_TRANSCODE_DATA_H
15
+ #define RUBY_TRANSCODE_DATA_H 1
16
+
17
+ RUBY_SYMBOL_EXPORT_BEGIN
18
+
19
+ #define WORDINDEX_SHIFT_BITS 2
20
+ #define WORDINDEX2INFO(widx) ((widx) << WORDINDEX_SHIFT_BITS)
21
+ #define INFO2WORDINDEX(info) ((info) >> WORDINDEX_SHIFT_BITS)
22
+ #define BYTE_LOOKUP_BASE(bl) ((bl)[0])
23
+ #define BYTE_LOOKUP_INFO(bl) ((bl)[1])
24
+
25
+ #define PType (unsigned int)
26
+
27
+ #define NOMAP (PType 0x01) /* direct map */
28
+ #define ONEbt (0x02) /* one byte payload */
29
+ #define TWObt (0x03) /* two bytes payload */
30
+ #define THREEbt (0x05) /* three bytes payload */
31
+ #define FOURbt (0x06) /* four bytes payload, UTF-8 only, macros start at getBT0 */
32
+ #define INVALID (PType 0x07) /* invalid byte sequence */
33
+ #define UNDEF (PType 0x09) /* legal but undefined */
34
+ #define ZERObt (PType 0x0A) /* zero bytes of payload, i.e. remove */
35
+ #define FUNii (PType 0x0B) /* function from info to info */
36
+ #define FUNsi (PType 0x0D) /* function from start to info */
37
+ #define FUNio (PType 0x0E) /* function from info to output */
38
+ #define FUNso (PType 0x0F) /* function from start to output */
39
+ #define STR1 (PType 0x11) /* string 4 <= len <= 259 bytes: 1byte length + content */
40
+ #define GB4bt (PType 0x12) /* GB18030 four bytes payload */
41
+ #define FUNsio (PType 0x13) /* function from start and info to output */
42
+
43
+ #define STR1_LENGTH(byte_addr) (unsigned int)(*(byte_addr) + 4)
44
+ #define STR1_BYTEINDEX(w) ((w) >> 6)
45
+ #define makeSTR1(bi) (((bi) << 6) | STR1)
46
+ #define makeSTR1LEN(len) ((len)-4)
47
+
48
+ #define o1(b1) (PType((((unsigned char)(b1))<<8)|ONEbt))
49
+ #define o2(b1,b2) (PType((((unsigned char)(b1))<<8)|\
50
+ (((unsigned char)(b2))<<16)|\
51
+ TWObt))
52
+ #define o3(b1,b2,b3) (PType(((((unsigned char)(b1))<<8)|\
53
+ (((unsigned char)(b2))<<16)|\
54
+ (((unsigned int)(unsigned char)(b3))<<24)|\
55
+ THREEbt)&\
56
+ 0xffffffffU))
57
+ #define o4(b0,b1,b2,b3) (PType(((((unsigned char)(b1))<<8)|\
58
+ (((unsigned char)(b2))<<16)|\
59
+ (((unsigned int)(unsigned char)(b3))<<24)|\
60
+ ((((unsigned char)(b0))&0x07)<<5)|\
61
+ FOURbt)&\
62
+ 0xffffffffU))
63
+ #define g4(b0,b1,b2,b3) (PType(((((unsigned char)(b0))<<8)|\
64
+ (((unsigned char)(b2))<<16)|\
65
+ ((((unsigned char)(b1))&0x0f)<<24)|\
66
+ ((((unsigned int)(unsigned char)(b3))&0x0f)<<28)|\
67
+ GB4bt)&\
68
+ 0xffffffffU))
69
+ #define funsio(diff) (PType((((unsigned int)(diff))<<8)|FUNsio))
70
+
71
+ #define getBT1(a) ((unsigned char)((a)>> 8))
72
+ #define getBT2(a) ((unsigned char)((a)>>16))
73
+ #define getBT3(a) ((unsigned char)((a)>>24))
74
+ #define getBT0(a) (((unsigned char)((a)>> 5)&0x07)|0xF0) /* for UTF-8 only!!! */
75
+
76
+ #define getGB4bt0(a) ((unsigned char)((a)>> 8))
77
+ #define getGB4bt1(a) (((unsigned char)((a)>>24)&0x0F)|0x30)
78
+ #define getGB4bt2(a) ((unsigned char)((a)>>16))
79
+ #define getGB4bt3(a) (((unsigned char)((a)>>28)&0x0F)|0x30)
80
+
81
+ #define o2FUNii(b1,b2) (PType((((unsigned char)(b1))<<8)|(((unsigned char)(b2))<<16)|FUNii))
82
+
83
+ /* do we need these??? maybe not, can be done with simple tables */
84
+ #define ONETRAIL /* legal but undefined if one more trailing UTF-8 */
85
+ #define TWOTRAIL /* legal but undefined if two more trailing UTF-8 */
86
+ #define THREETRAIL /* legal but undefined if three more trailing UTF-8 */
87
+
88
+ typedef enum {
89
+ asciicompat_converter, /* ASCII-compatible -> ASCII-compatible */
90
+ asciicompat_decoder, /* ASCII-incompatible -> ASCII-compatible */
91
+ asciicompat_encoder /* ASCII-compatible -> ASCII-incompatible */
92
+ /* ASCII-incompatible -> ASCII-incompatible is intentionally omitted. */
93
+ } rb_transcoder_asciicompat_type_t;
94
+
95
+ typedef struct rb_transcoder rb_transcoder;
96
+
97
+ /* static structure, one per supported encoding pair */
98
+ struct rb_transcoder {
99
+ const char *src_encoding;
100
+ const char *dst_encoding;
101
+ unsigned int conv_tree_start;
102
+ const unsigned char *byte_array;
103
+ unsigned int byte_array_length;
104
+ const unsigned int *word_array;
105
+ unsigned int word_array_length;
106
+ int word_size;
107
+ int input_unit_length;
108
+ int max_input;
109
+ int max_output;
110
+ rb_transcoder_asciicompat_type_t asciicompat_type;
111
+ size_t state_size;
112
+ int (*state_init_func)(void*); /* ret==0:success ret!=0:failure(errno) */
113
+ int (*state_fini_func)(void*); /* ret==0:success ret!=0:failure(errno) */
114
+ VALUE (*func_ii)(void*, VALUE); /* info -> info */
115
+ VALUE (*func_si)(void*, const unsigned char*, size_t); /* start -> info */
116
+ ssize_t (*func_io)(void*, VALUE, const unsigned char*, size_t); /* info -> output */
117
+ ssize_t (*func_so)(void*, const unsigned char*, size_t, unsigned char*, size_t); /* start -> output */
118
+ ssize_t (*finish_func)(void*, unsigned char*, size_t); /* -> output */
119
+ ssize_t (*resetsize_func)(void*); /* -> len */
120
+ ssize_t (*resetstate_func)(void*, unsigned char*, size_t); /* -> output */
121
+ ssize_t (*func_sio)(void*, const unsigned char*, size_t, VALUE, unsigned char*, size_t); /* start -> output */
122
+ };
123
+
124
+ void rb_declare_transcoder(const char *enc1, const char *enc2, const char *lib);
125
+ void rb_register_transcoder(const rb_transcoder *);
126
+
127
+ /*
128
+ * To get rid of collision of initializer symbols in statically-linked encodings
129
+ * and transcoders
130
+ */
131
+ #if defined(EXTSTATIC) && EXTSTATIC
132
+ # define TRANS_INIT(name) void Init_trans_ ## name(void)
133
+ #else
134
+ # define TRANS_INIT(name) void Init_ ## name(void)
135
+ #endif
136
+
137
+ RUBY_SYMBOL_EXPORT_END
138
+
139
+ #endif /* RUBY_TRANSCODE_DATA_H */
@@ -0,0 +1,73 @@
1
+ #define RUBY_VERSION "2.5.0"
2
+ #define RUBY_RELEASE_DATE RUBY_RELEASE_YEAR_STR"-"RUBY_RELEASE_MONTH_STR"-"RUBY_RELEASE_DAY_STR
3
+ #define RUBY_PATCHLEVEL -1
4
+
5
+ #define RUBY_RELEASE_YEAR 2017
6
+ #define RUBY_RELEASE_MONTH 12
7
+ #define RUBY_RELEASE_DAY 14
8
+
9
+ #include "ruby/version.h"
10
+
11
+ #ifndef TOKEN_PASTE
12
+ #define TOKEN_PASTE(x,y) x##y
13
+ #endif
14
+ #define ONLY_ONE_DIGIT(x) TOKEN_PASTE(10,x) < 1000
15
+ #define WITH_ZERO_PADDING(x) TOKEN_PASTE(0,x)
16
+ #define RUBY_BIRTH_YEAR_STR STRINGIZE(RUBY_BIRTH_YEAR)
17
+ #define RUBY_RELEASE_YEAR_STR STRINGIZE(RUBY_RELEASE_YEAR)
18
+ #if ONLY_ONE_DIGIT(RUBY_RELEASE_MONTH)
19
+ #define RUBY_RELEASE_MONTH_STR STRINGIZE(WITH_ZERO_PADDING(RUBY_RELEASE_MONTH))
20
+ #else
21
+ #define RUBY_RELEASE_MONTH_STR STRINGIZE(RUBY_RELEASE_MONTH)
22
+ #endif
23
+ #if ONLY_ONE_DIGIT(RUBY_RELEASE_DAY)
24
+ #define RUBY_RELEASE_DAY_STR STRINGIZE(WITH_ZERO_PADDING(RUBY_RELEASE_DAY))
25
+ #else
26
+ #define RUBY_RELEASE_DAY_STR STRINGIZE(RUBY_RELEASE_DAY)
27
+ #endif
28
+
29
+ #if !defined RUBY_LIB_VERSION && defined RUBY_LIB_VERSION_STYLE
30
+ # if RUBY_LIB_VERSION_STYLE == 3
31
+ # define RUBY_LIB_VERSION STRINGIZE(RUBY_API_VERSION_MAJOR)"."STRINGIZE(RUBY_API_VERSION_MINOR)"."STRINGIZE(RUBY_API_VERSION_TEENY)
32
+ # elif RUBY_LIB_VERSION_STYLE == 2
33
+ # define RUBY_LIB_VERSION STRINGIZE(RUBY_API_VERSION_MAJOR)"."STRINGIZE(RUBY_API_VERSION_MINOR)
34
+ # endif
35
+ #endif
36
+
37
+ #if RUBY_PATCHLEVEL == -1
38
+ #define RUBY_PATCHLEVEL_STR "rc1"
39
+ #else
40
+ #define RUBY_PATCHLEVEL_STR "p"STRINGIZE(RUBY_PATCHLEVEL)
41
+ #endif
42
+
43
+ #ifndef RUBY_REVISION
44
+ # include "revision.h"
45
+ #endif
46
+ #ifndef RUBY_REVISION
47
+ # define RUBY_REVISION 0
48
+ #endif
49
+
50
+ #if RUBY_REVISION
51
+ # if RUBY_PATCHLEVEL == -1
52
+ # ifndef RUBY_BRANCH_NAME
53
+ # define RUBY_BRANCH_NAME "trunk"
54
+ # endif
55
+ # define RUBY_REVISION_STR " "RUBY_BRANCH_NAME" "STRINGIZE(RUBY_REVISION)
56
+ # else
57
+ # define RUBY_REVISION_STR " revision "STRINGIZE(RUBY_REVISION)
58
+ # endif
59
+ #else
60
+ # define RUBY_REVISION_STR ""
61
+ #endif
62
+
63
+ # define RUBY_DESCRIPTION \
64
+ "ruby "RUBY_VERSION \
65
+ RUBY_PATCHLEVEL_STR \
66
+ " ("RUBY_RELEASE_DATE \
67
+ RUBY_REVISION_STR") " \
68
+ "["RUBY_PLATFORM"]"
69
+ # define RUBY_COPYRIGHT \
70
+ "ruby - Copyright (C) " \
71
+ RUBY_BIRTH_YEAR_STR"-" \
72
+ RUBY_RELEASE_YEAR_STR" " \
73
+ RUBY_AUTHOR