bindex 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (146) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +13 -33
  3. data/bindex.gemspec +1 -1
  4. data/ext/bindex/com/gsamokovarov/bindex/JRubyIntegration.java +2 -2
  5. data/ext/bindex/cruby.c +41 -13
  6. data/ext/bindex/extconf.rb +0 -15
  7. data/lib/bindex/jruby.rb +0 -1
  8. data/lib/bindex/jruby_internals.jar +0 -0
  9. data/lib/bindex/jruby_internals_9k.jar +0 -0
  10. data/lib/bindex/version.rb +1 -1
  11. metadata +17 -152
  12. data/ext/bindex/bindex.h +0 -11
  13. data/ext/bindex/bindings.c +0 -106
  14. data/ext/bindex/ruby_193.h +0 -101
  15. data/ext/bindex/ruby_193/addr2line.h +0 -21
  16. data/ext/bindex/ruby_193/constant.h +0 -34
  17. data/ext/bindex/ruby_193/debug.h +0 -41
  18. data/ext/bindex/ruby_193/dln.h +0 -50
  19. data/ext/bindex/ruby_193/encdb.h +0 -167
  20. data/ext/bindex/ruby_193/eval_intern.h +0 -234
  21. data/ext/bindex/ruby_193/gc.h +0 -99
  22. data/ext/bindex/ruby_193/id.h +0 -177
  23. data/ext/bindex/ruby_193/internal.h +0 -242
  24. data/ext/bindex/ruby_193/iseq.h +0 -126
  25. data/ext/bindex/ruby_193/method.h +0 -105
  26. data/ext/bindex/ruby_193/node.h +0 -504
  27. data/ext/bindex/ruby_193/parse.h +0 -302
  28. data/ext/bindex/ruby_193/probes.h +0 -369
  29. data/ext/bindex/ruby_193/regenc.h +0 -219
  30. data/ext/bindex/ruby_193/regint.h +0 -850
  31. data/ext/bindex/ruby_193/regparse.h +0 -362
  32. data/ext/bindex/ruby_193/revision.h +0 -1
  33. data/ext/bindex/ruby_193/ruby_atomic.h +0 -175
  34. data/ext/bindex/ruby_193/siphash.h +0 -48
  35. data/ext/bindex/ruby_193/thread_pthread.h +0 -51
  36. data/ext/bindex/ruby_193/thread_win32.h +0 -40
  37. data/ext/bindex/ruby_193/timev.h +0 -21
  38. data/ext/bindex/ruby_193/transcode_data.h +0 -117
  39. data/ext/bindex/ruby_193/transdb.h +0 -186
  40. data/ext/bindex/ruby_193/verconf.h +0 -12
  41. data/ext/bindex/ruby_193/version.h +0 -52
  42. data/ext/bindex/ruby_193/vm_core.h +0 -763
  43. data/ext/bindex/ruby_193/vm_exec.h +0 -184
  44. data/ext/bindex/ruby_193/vm_insnhelper.h +0 -220
  45. data/ext/bindex/ruby_193/vm_opts.h +0 -51
  46. data/ext/bindex/ruby_20.h +0 -142
  47. data/ext/bindex/ruby_20/addr2line.h +0 -21
  48. data/ext/bindex/ruby_20/constant.h +0 -36
  49. data/ext/bindex/ruby_20/dln.h +0 -50
  50. data/ext/bindex/ruby_20/encdb.h +0 -169
  51. data/ext/bindex/ruby_20/eval_intern.h +0 -241
  52. data/ext/bindex/ruby_20/gc.h +0 -104
  53. data/ext/bindex/ruby_20/id.h +0 -135
  54. data/ext/bindex/ruby_20/internal.h +0 -395
  55. data/ext/bindex/ruby_20/iseq.h +0 -140
  56. data/ext/bindex/ruby_20/method.h +0 -138
  57. data/ext/bindex/ruby_20/node.h +0 -541
  58. data/ext/bindex/ruby_20/parse.h +0 -292
  59. data/ext/bindex/ruby_20/probes.h +0 -369
  60. data/ext/bindex/ruby_20/probes_helper.h +0 -67
  61. data/ext/bindex/ruby_20/regenc.h +0 -227
  62. data/ext/bindex/ruby_20/regint.h +0 -915
  63. data/ext/bindex/ruby_20/regparse.h +0 -367
  64. data/ext/bindex/ruby_20/revision.h +0 -1
  65. data/ext/bindex/ruby_20/ruby_atomic.h +0 -170
  66. data/ext/bindex/ruby_20/siphash.h +0 -48
  67. data/ext/bindex/ruby_20/thread_pthread.h +0 -56
  68. data/ext/bindex/ruby_20/thread_win32.h +0 -45
  69. data/ext/bindex/ruby_20/timev.h +0 -21
  70. data/ext/bindex/ruby_20/transcode_data.h +0 -127
  71. data/ext/bindex/ruby_20/transdb.h +0 -190
  72. data/ext/bindex/ruby_20/verconf.h +0 -12
  73. data/ext/bindex/ruby_20/version.h +0 -52
  74. data/ext/bindex/ruby_20/vm_core.h +0 -1018
  75. data/ext/bindex/ruby_20/vm_debug.h +0 -41
  76. data/ext/bindex/ruby_20/vm_exec.h +0 -173
  77. data/ext/bindex/ruby_20/vm_insnhelper.h +0 -274
  78. data/ext/bindex/ruby_20/vm_opts.h +0 -56
  79. data/ext/bindex/ruby_21.h +0 -142
  80. data/ext/bindex/ruby_21/addr2line.h +0 -21
  81. data/ext/bindex/ruby_21/constant.h +0 -36
  82. data/ext/bindex/ruby_21/dln.h +0 -51
  83. data/ext/bindex/ruby_21/encdb.h +0 -170
  84. data/ext/bindex/ruby_21/eval_intern.h +0 -260
  85. data/ext/bindex/ruby_21/gc.h +0 -101
  86. data/ext/bindex/ruby_21/id.h +0 -210
  87. data/ext/bindex/ruby_21/internal.h +0 -889
  88. data/ext/bindex/ruby_21/iseq.h +0 -136
  89. data/ext/bindex/ruby_21/method.h +0 -142
  90. data/ext/bindex/ruby_21/node.h +0 -543
  91. data/ext/bindex/ruby_21/parse.h +0 -298
  92. data/ext/bindex/ruby_21/probes.h +0 -401
  93. data/ext/bindex/ruby_21/probes_helper.h +0 -67
  94. data/ext/bindex/ruby_21/regenc.h +0 -223
  95. data/ext/bindex/ruby_21/regint.h +0 -911
  96. data/ext/bindex/ruby_21/regparse.h +0 -363
  97. data/ext/bindex/ruby_21/revision.h +0 -1
  98. data/ext/bindex/ruby_21/ruby_atomic.h +0 -170
  99. data/ext/bindex/ruby_21/siphash.h +0 -48
  100. data/ext/bindex/ruby_21/thread_native.h +0 -23
  101. data/ext/bindex/ruby_21/thread_pthread.h +0 -56
  102. data/ext/bindex/ruby_21/thread_win32.h +0 -45
  103. data/ext/bindex/ruby_21/timev.h +0 -42
  104. data/ext/bindex/ruby_21/transcode_data.h +0 -123
  105. data/ext/bindex/ruby_21/transdb.h +0 -190
  106. data/ext/bindex/ruby_21/verconf.h +0 -13
  107. data/ext/bindex/ruby_21/version.h +0 -52
  108. data/ext/bindex/ruby_21/vm_core.h +0 -1043
  109. data/ext/bindex/ruby_21/vm_debug.h +0 -37
  110. data/ext/bindex/ruby_21/vm_exec.h +0 -182
  111. data/ext/bindex/ruby_21/vm_insnhelper.h +0 -273
  112. data/ext/bindex/ruby_21/vm_opts.h +0 -56
  113. data/ext/bindex/ruby_21preview.h +0 -146
  114. data/ext/bindex/ruby_21preview/addr2line.h +0 -21
  115. data/ext/bindex/ruby_21preview/constant.h +0 -36
  116. data/ext/bindex/ruby_21preview/dln.h +0 -51
  117. data/ext/bindex/ruby_21preview/encdb.h +0 -270
  118. data/ext/bindex/ruby_21preview/eval_intern.h +0 -217
  119. data/ext/bindex/ruby_21preview/gc.h +0 -100
  120. data/ext/bindex/ruby_21preview/id.h +0 -169
  121. data/ext/bindex/ruby_21preview/internal.h +0 -765
  122. data/ext/bindex/ruby_21preview/iseq.h +0 -136
  123. data/ext/bindex/ruby_21preview/method.h +0 -141
  124. data/ext/bindex/ruby_21preview/node.h +0 -543
  125. data/ext/bindex/ruby_21preview/parse.h +0 -298
  126. data/ext/bindex/ruby_21preview/probes.h +0 -385
  127. data/ext/bindex/ruby_21preview/probes_helper.h +0 -67
  128. data/ext/bindex/ruby_21preview/regenc.h +0 -223
  129. data/ext/bindex/ruby_21preview/regint.h +0 -911
  130. data/ext/bindex/ruby_21preview/regparse.h +0 -363
  131. data/ext/bindex/ruby_21preview/revision.h +0 -1
  132. data/ext/bindex/ruby_21preview/ruby_atomic.h +0 -130
  133. data/ext/bindex/ruby_21preview/siphash.h +0 -48
  134. data/ext/bindex/ruby_21preview/thread_native.h +0 -23
  135. data/ext/bindex/ruby_21preview/thread_pthread.h +0 -56
  136. data/ext/bindex/ruby_21preview/thread_win32.h +0 -45
  137. data/ext/bindex/ruby_21preview/timev.h +0 -42
  138. data/ext/bindex/ruby_21preview/transcode_data.h +0 -123
  139. data/ext/bindex/ruby_21preview/transdb.h +0 -190
  140. data/ext/bindex/ruby_21preview/verconf.h +0 -13
  141. data/ext/bindex/ruby_21preview/version.h +0 -53
  142. data/ext/bindex/ruby_21preview/vm_core.h +0 -1017
  143. data/ext/bindex/ruby_21preview/vm_debug.h +0 -37
  144. data/ext/bindex/ruby_21preview/vm_exec.h +0 -180
  145. data/ext/bindex/ruby_21preview/vm_insnhelper.h +0 -272
  146. data/ext/bindex/ruby_21preview/vm_opts.h +0 -56
@@ -1,765 +0,0 @@
1
- /**********************************************************************
2
-
3
- internal.h -
4
-
5
- $Author$
6
- created at: Tue May 17 11:42:20 JST 2011
7
-
8
- Copyright (C) 2011 Yukihiro Matsumoto
9
-
10
- **********************************************************************/
11
-
12
- #ifndef RUBY_INTERNAL_H
13
- #define RUBY_INTERNAL_H 1
14
-
15
- #if defined(__cplusplus)
16
- extern "C" {
17
- #if 0
18
- } /* satisfy cc-mode */
19
- #endif
20
- #endif
21
-
22
- #ifdef HAVE_VALGRIND_MEMCHECK_H
23
- # include <valgrind/memcheck.h>
24
- # ifndef VALGRIND_MAKE_MEM_DEFINED
25
- # define VALGRIND_MAKE_MEM_DEFINED(p, n) VALGRIND_MAKE_READABLE((p), (n))
26
- # endif
27
- # ifndef VALGRIND_MAKE_MEM_UNDEFINED
28
- # define VALGRIND_MAKE_MEM_UNDEFINED(p, n) VALGRIND_MAKE_WRITABLE((p), (n))
29
- # endif
30
- #else
31
- # define VALGRIND_MAKE_MEM_DEFINED(p, n) 0
32
- # define VALGRIND_MAKE_MEM_UNDEFINED(p, n) 0
33
- #endif
34
-
35
- #define numberof(array) ((int)(sizeof(array) / sizeof((array)[0])))
36
-
37
- #define STATIC_ASSERT(name, expr) typedef int static_assert_##name##_check[1 - 2*!(expr)]
38
-
39
- #define GCC_VERSION_SINCE(major, minor, patchlevel) \
40
- (defined(__GNUC__) && !defined(__INTEL_COMPILER) && \
41
- ((__GNUC__ > (major)) || \
42
- (__GNUC__ == (major) && __GNUC_MINOR__ > (minor)) || \
43
- (__GNUC__ == (major) && __GNUC_MINOR__ == (minor) && __GNUC_PATCHLEVEL__ >= (patchlevel))))
44
-
45
- #define SIGNED_INTEGER_TYPE_P(int_type) (0 > ((int_type)0)-1)
46
- #define SIGNED_INTEGER_MAX(sint_type) \
47
- (sint_type) \
48
- ((((sint_type)1) << (sizeof(sint_type) * CHAR_BIT - 2)) | \
49
- ((((sint_type)1) << (sizeof(sint_type) * CHAR_BIT - 2)) - 1))
50
- #define SIGNED_INTEGER_MIN(sint_type) (-SIGNED_INTEGER_MAX(sint_type)-1)
51
- #define UNSIGNED_INTEGER_MAX(uint_type) (~(uint_type)0)
52
-
53
- #if SIGNEDNESS_OF_TIME_T < 0 /* signed */
54
- # define TIMET_MAX SIGNED_INTEGER_MAX(time_t)
55
- # define TIMET_MIN SIGNED_INTEGER_MIN(time_t)
56
- #elif SIGNEDNESS_OF_TIME_T > 0 /* unsigned */
57
- # define TIMET_MAX UNSIGNED_INTEGER_MAX(time_t)
58
- # define TIMET_MIN ((time_t)0)
59
- #endif
60
- #define TIMET_MAX_PLUS_ONE (2*(double)(TIMET_MAX/2+1))
61
-
62
- #define MUL_OVERFLOW_SIGNED_INTEGER_P(a, b, min, max) ( \
63
- (a) == 0 ? 0 : \
64
- (a) == -1 ? (b) < -(max) : \
65
- (a) > 0 ? \
66
- ((b) > 0 ? (max) / (a) < (b) : (min) / (a) > (b)) : \
67
- ((b) > 0 ? (min) / (a) < (b) : (max) / (a) > (b)))
68
- #define MUL_OVERFLOW_FIXNUM_P(a, b) MUL_OVERFLOW_SIGNED_INTEGER_P(a, b, FIXNUM_MIN, FIXNUM_MAX)
69
- #define MUL_OVERFLOW_LONG_P(a, b) MUL_OVERFLOW_SIGNED_INTEGER_P(a, b, LONG_MIN, LONG_MAX)
70
- #define MUL_OVERFLOW_INT_P(a, b) MUL_OVERFLOW_SIGNED_INTEGER_P(a, b, INT_MIN, INT_MAX)
71
-
72
- #ifndef swap16
73
- # define swap16(x) ((uint16_t)((((x)&0xFF)<<8) | (((x)>>8)&0xFF)))
74
- #endif
75
-
76
- #ifndef swap32
77
- # ifdef HAVE_BUILTIN___BUILTIN_BSWAP32
78
- # define swap32(x) __builtin_bswap32(x)
79
- # endif
80
- #endif
81
-
82
- #ifndef swap32
83
- # define swap32(x) ((uint32_t)((((x)&0xFF)<<24) \
84
- |(((x)>>24)&0xFF) \
85
- |(((x)&0x0000FF00)<<8) \
86
- |(((x)&0x00FF0000)>>8) ))
87
- #endif
88
-
89
- #ifndef swap64
90
- # ifdef HAVE_BUILTIN___BUILTIN_BSWAP64
91
- # define swap64(x) __builtin_bswap64(x)
92
- # endif
93
- #endif
94
-
95
- #ifndef swap64
96
- # ifdef HAVE_INT64_T
97
- # define byte_in_64bit(n) ((uint64_t)0xff << (n))
98
- # define swap64(x) ((uint64_t)((((x)&byte_in_64bit(0))<<56) \
99
- |(((x)>>56)&0xFF) \
100
- |(((x)&byte_in_64bit(8))<<40) \
101
- |(((x)&byte_in_64bit(48))>>40) \
102
- |(((x)&byte_in_64bit(16))<<24) \
103
- |(((x)&byte_in_64bit(40))>>24) \
104
- |(((x)&byte_in_64bit(24))<<8) \
105
- |(((x)&byte_in_64bit(32))>>8)))
106
- # endif
107
- #endif
108
-
109
- static inline int
110
- nlz_int(unsigned int x)
111
- {
112
- #if defined(HAVE_BUILTIN___BUILTIN_CLZ)
113
- if (x == 0) return SIZEOF_INT * CHAR_BIT;
114
- return __builtin_clz(x);
115
- #else
116
- unsigned int y;
117
- # if 64 < SIZEOF_INT * CHAR_BIT
118
- int n = 128;
119
- # elif 32 < SIZEOF_INT * CHAR_BIT
120
- int n = 64;
121
- # else
122
- int n = 32;
123
- # endif
124
- # if 64 < SIZEOF_INT * CHAR_BIT
125
- y = x >> 64; if (y) {n -= 64; x = y;}
126
- # endif
127
- # if 32 < SIZEOF_INT * CHAR_BIT
128
- y = x >> 32; if (y) {n -= 32; x = y;}
129
- # endif
130
- y = x >> 16; if (y) {n -= 16; x = y;}
131
- y = x >> 8; if (y) {n -= 8; x = y;}
132
- y = x >> 4; if (y) {n -= 4; x = y;}
133
- y = x >> 2; if (y) {n -= 2; x = y;}
134
- y = x >> 1; if (y) {return n - 2;}
135
- return (int)(n - x);
136
- #endif
137
- }
138
-
139
- static inline int
140
- nlz_long(unsigned long x)
141
- {
142
- #if defined(HAVE_BUILTIN___BUILTIN_CLZL)
143
- if (x == 0) return SIZEOF_LONG * CHAR_BIT;
144
- return __builtin_clzl(x);
145
- #else
146
- unsigned long y;
147
- # if 64 < SIZEOF_LONG * CHAR_BIT
148
- int n = 128;
149
- # elif 32 < SIZEOF_LONG * CHAR_BIT
150
- int n = 64;
151
- # else
152
- int n = 32;
153
- # endif
154
- # if 64 < SIZEOF_LONG * CHAR_BIT
155
- y = x >> 64; if (y) {n -= 64; x = y;}
156
- # endif
157
- # if 32 < SIZEOF_LONG * CHAR_BIT
158
- y = x >> 32; if (y) {n -= 32; x = y;}
159
- # endif
160
- y = x >> 16; if (y) {n -= 16; x = y;}
161
- y = x >> 8; if (y) {n -= 8; x = y;}
162
- y = x >> 4; if (y) {n -= 4; x = y;}
163
- y = x >> 2; if (y) {n -= 2; x = y;}
164
- y = x >> 1; if (y) {return n - 2;}
165
- return (int)(n - x);
166
- #endif
167
- }
168
-
169
- #ifdef HAVE_LONG_LONG
170
- static inline int
171
- nlz_long_long(unsigned LONG_LONG x)
172
- {
173
- #if defined(HAVE_BUILTIN___BUILTIN_CLZLL)
174
- if (x == 0) return SIZEOF_LONG_LONG * CHAR_BIT;
175
- return __builtin_clzll(x);
176
- #else
177
- unsigned LONG_LONG y;
178
- # if 64 < SIZEOF_LONG_LONG * CHAR_BIT
179
- int n = 128;
180
- # elif 32 < SIZEOF_LONG_LONG * CHAR_BIT
181
- int n = 64;
182
- # else
183
- int n = 32;
184
- # endif
185
- # if 64 < SIZEOF_LONG_LONG * CHAR_BIT
186
- y = x >> 64; if (y) {n -= 64; x = y;}
187
- # endif
188
- # if 32 < SIZEOF_LONG_LONG * CHAR_BIT
189
- y = x >> 32; if (y) {n -= 32; x = y;}
190
- # endif
191
- y = x >> 16; if (y) {n -= 16; x = y;}
192
- y = x >> 8; if (y) {n -= 8; x = y;}
193
- y = x >> 4; if (y) {n -= 4; x = y;}
194
- y = x >> 2; if (y) {n -= 2; x = y;}
195
- y = x >> 1; if (y) {return n - 2;}
196
- return (int)(n - x);
197
- #endif
198
- }
199
- #endif
200
-
201
- #ifdef HAVE_UINT128_T
202
- static inline int
203
- nlz_int128(uint128_t x)
204
- {
205
- uint128_t y;
206
- int n = 128;
207
- y = x >> 64; if (y) {n -= 64; x = y;}
208
- y = x >> 32; if (y) {n -= 32; x = y;}
209
- y = x >> 16; if (y) {n -= 16; x = y;}
210
- y = x >> 8; if (y) {n -= 8; x = y;}
211
- y = x >> 4; if (y) {n -= 4; x = y;}
212
- y = x >> 2; if (y) {n -= 2; x = y;}
213
- y = x >> 1; if (y) {return n - 2;}
214
- return (int)(n - x);
215
- }
216
- #endif
217
-
218
- #if defined(HAVE_UINT128_T)
219
- # define bit_length(x) \
220
- (sizeof(x) <= SIZEOF_INT ? SIZEOF_INT * CHAR_BIT - nlz_int((unsigned int)(x)) : \
221
- sizeof(x) <= SIZEOF_LONG ? SIZEOF_LONG * CHAR_BIT - nlz_long((unsigned long)(x)) : \
222
- sizeof(x) <= SIZEOF_LONG_LONG ? SIZEOF_LONG_LONG * CHAR_BIT - nlz_long_long((unsigned LONG_LONG)(x)) : \
223
- SIZEOF_INT128_T * CHAR_BIT - nlz_int128((uint128_t)(x)))
224
- #elif defined(HAVE_LONG_LONG)
225
- # define bit_length(x) \
226
- (sizeof(x) <= SIZEOF_INT ? SIZEOF_INT * CHAR_BIT - nlz_int((unsigned int)(x)) : \
227
- sizeof(x) <= SIZEOF_LONG ? SIZEOF_LONG * CHAR_BIT - nlz_long((unsigned long)(x)) : \
228
- SIZEOF_LONG_LONG * CHAR_BIT - nlz_long_long((unsigned LONG_LONG)(x)))
229
- #else
230
- # define bit_length(x) \
231
- (sizeof(x) <= SIZEOF_INT ? SIZEOF_INT * CHAR_BIT - nlz_int((unsigned int)(x)) : \
232
- SIZEOF_LONG * CHAR_BIT - nlz_long((unsigned long)(x)))
233
- #endif
234
-
235
- struct rb_deprecated_classext_struct {
236
- char conflict[sizeof(VALUE) * 3];
237
- };
238
-
239
- struct rb_subclass_entry;
240
- typedef struct rb_subclass_entry rb_subclass_entry_t;
241
-
242
- struct rb_subclass_entry {
243
- VALUE klass;
244
- rb_subclass_entry_t *next;
245
- };
246
-
247
- #if defined(HAVE_LONG_LONG)
248
- typedef unsigned LONG_LONG vm_state_version_t;
249
- #elif defined(HAVE_UINT64_T)
250
- typedef uint64_t vm_state_version_t;
251
- #else
252
- typedef unsigned long vm_state_version_t;
253
- #endif
254
-
255
- struct rb_method_entry_struct;
256
-
257
- typedef struct method_cache_entry {
258
- vm_state_version_t vm_state;
259
- vm_state_version_t seq;
260
- ID mid;
261
- VALUE defined_class;
262
- struct rb_method_entry_struct *me;
263
- } method_cache_entry_t;
264
-
265
- struct rb_classext_struct {
266
- VALUE super;
267
- struct st_table *iv_tbl;
268
- struct st_table *const_tbl;
269
- struct st_table *mc_tbl;
270
- rb_subclass_entry_t *subclasses;
271
- rb_subclass_entry_t **parent_subclasses;
272
- /**
273
- * In the case that this is an `ICLASS`, `module_subclasses` points to the link
274
- * in the module's `subclasses` list that indicates that the klass has been
275
- * included. Hopefully that makes sense.
276
- */
277
- rb_subclass_entry_t **module_subclasses;
278
- vm_state_version_t seq;
279
- VALUE origin;
280
- VALUE refined_class;
281
- rb_alloc_func_t allocator;
282
- };
283
-
284
- /* class.c */
285
- void rb_class_subclass_add(VALUE super, VALUE klass);
286
- void rb_class_remove_from_super_subclasses(VALUE);
287
-
288
- #define RCLASS_EXT(c) (RCLASS(c)->ptr)
289
- #define RCLASS_IV_TBL(c) (RCLASS_EXT(c)->iv_tbl)
290
- #define RCLASS_CONST_TBL(c) (RCLASS_EXT(c)->const_tbl)
291
- #define RCLASS_M_TBL(c) (RCLASS(c)->m_tbl)
292
- #define RCLASS_IV_INDEX_TBL(c) (RCLASS(c)->iv_index_tbl)
293
- #define RCLASS_ORIGIN(c) (RCLASS_EXT(c)->origin)
294
- #define RCLASS_REFINED_CLASS(c) (RCLASS_EXT(c)->refined_class)
295
-
296
- #undef RCLASS_SUPER
297
- static inline VALUE
298
- RCLASS_SUPER(VALUE klass)
299
- {
300
- return RCLASS_EXT(klass)->super;
301
- }
302
-
303
- static inline VALUE
304
- RCLASS_SET_SUPER(VALUE klass, VALUE super)
305
- {
306
- if (super) {
307
- rb_class_remove_from_super_subclasses(klass);
308
- rb_class_subclass_add(super, klass);
309
- }
310
- OBJ_WRITE(klass, &RCLASS_EXT(klass)->super, super);
311
- return super;
312
- }
313
-
314
- struct vtm; /* defined by timev.h */
315
-
316
- /* array.c */
317
- VALUE rb_ary_last(int, VALUE *, VALUE);
318
- void rb_ary_set_len(VALUE, long);
319
- VALUE rb_ary_cat(VALUE, const VALUE *, long);
320
- void rb_ary_delete_same(VALUE, VALUE);
321
-
322
- /* bignum.c */
323
- VALUE rb_big_fdiv(VALUE x, VALUE y);
324
- VALUE rb_big_uminus(VALUE x);
325
- VALUE rb_integer_float_cmp(VALUE x, VALUE y);
326
- VALUE rb_integer_float_eq(VALUE x, VALUE y);
327
-
328
- /* class.c */
329
- void rb_class_foreach_subclass(VALUE klass, void(*f)(VALUE));
330
- void rb_class_detach_subclasses(VALUE);
331
- void rb_class_detach_module_subclasses(VALUE);
332
- void rb_class_remove_from_module_subclasses(VALUE);
333
- VALUE rb_obj_methods(int argc, VALUE *argv, VALUE obj);
334
- VALUE rb_obj_protected_methods(int argc, VALUE *argv, VALUE obj);
335
- VALUE rb_obj_private_methods(int argc, VALUE *argv, VALUE obj);
336
- VALUE rb_obj_public_methods(int argc, VALUE *argv, VALUE obj);
337
- int rb_obj_basic_to_s_p(VALUE);
338
- VALUE rb_special_singleton_class(VALUE);
339
- VALUE rb_singleton_class_clone_and_attach(VALUE obj, VALUE attach);
340
- VALUE rb_singleton_class_get(VALUE obj);
341
- void Init_class_hierarchy(void);
342
-
343
- /* compar.c */
344
- VALUE rb_invcmp(VALUE, VALUE);
345
-
346
- /* compile.c */
347
- int rb_dvar_defined(ID);
348
- int rb_local_defined(ID);
349
- int rb_parse_in_eval(void);
350
- int rb_parse_in_main(void);
351
- const char * rb_insns_name(int i);
352
- VALUE rb_insns_name_array(void);
353
-
354
- /* cont.c */
355
- VALUE rb_obj_is_fiber(VALUE);
356
- void rb_fiber_reset_root_local_storage(VALUE);
357
-
358
- /* debug.c */
359
- PRINTF_ARGS(void ruby_debug_printf(const char*, ...), 1, 2);
360
-
361
- /* dmyext.c */
362
- void Init_ext(void);
363
-
364
- /* encoding.c */
365
- #ifdef RUBY_ENCODING_H
366
- enum ruby_preserved_encindex {
367
- ENCINDEX_ASCII,
368
- ENCINDEX_UTF_8,
369
- ENCINDEX_US_ASCII,
370
-
371
- /* preserved indexes */
372
- ENCINDEX_UTF_16BE,
373
- ENCINDEX_UTF_16LE,
374
- ENCINDEX_UTF_32BE,
375
- ENCINDEX_UTF_32LE,
376
- ENCINDEX_UTF_16,
377
- ENCINDEX_UTF_32,
378
- ENCINDEX_UTF8_MAC,
379
-
380
- /* for old options of regexp */
381
- ENCINDEX_EUC_JP,
382
- ENCINDEX_Windows_31J,
383
-
384
- ENCINDEX_BUILTIN_MAX
385
- };
386
- #endif
387
- #define rb_ascii8bit_encindex() ENCINDEX_ASCII
388
- #define rb_utf8_encindex() ENCINDEX_UTF_8
389
- #define rb_usascii_encindex() ENCINDEX_US_ASCII
390
- ID rb_id_encoding(void);
391
- void rb_gc_mark_encodings(void);
392
-
393
- /* error.c */
394
- NORETURN(PRINTF_ARGS(void rb_compile_bug(const char*, int, const char*, ...), 3, 4));
395
- VALUE rb_check_backtrace(VALUE);
396
- NORETURN(void rb_async_bug_errno(const char *,int));
397
- const char *rb_builtin_type_name(int t);
398
- const char *rb_builtin_class_name(VALUE x);
399
-
400
- /* eval.c */
401
- VALUE rb_refinement_module_get_refined_class(VALUE module);
402
-
403
- /* eval_error.c */
404
- void ruby_error_print(void);
405
- VALUE rb_get_backtrace(VALUE info);
406
-
407
- /* eval_jump.c */
408
- void rb_call_end_proc(VALUE data);
409
- void rb_mark_end_proc(void);
410
-
411
- /* file.c */
412
- VALUE rb_home_dir_of(VALUE user, VALUE result);
413
- VALUE rb_default_home_dir(VALUE result);
414
- VALUE rb_realpath_internal(VALUE basedir, VALUE path, int strict);
415
- void rb_file_const(const char*, VALUE);
416
- int rb_file_load_ok(const char *);
417
- VALUE rb_file_expand_path_fast(VALUE, VALUE);
418
- VALUE rb_file_expand_path_internal(VALUE, VALUE, int, int, VALUE);
419
- VALUE rb_get_path_check_to_string(VALUE, int);
420
- VALUE rb_get_path_check_convert(VALUE, VALUE, int);
421
- void Init_File(void);
422
-
423
- #ifdef RUBY_FUNCTION_NAME_STRING
424
- # if defined __GNUC__ && __GNUC__ >= 4
425
- # pragma GCC visibility push(default)
426
- # endif
427
- NORETURN(void rb_sys_fail_path_in(const char *func_name, VALUE path));
428
- # if defined __GNUC__ && __GNUC__ >= 4
429
- # pragma GCC visibility pop
430
- # endif
431
- # define rb_sys_fail_path(path) rb_sys_fail_path_in(RUBY_FUNCTION_NAME_STRING, path)
432
- #else
433
- # define rb_sys_fail_path(path) rb_sys_fail_str(path)
434
- #endif
435
-
436
- #ifdef _WIN32
437
- /* file.c, win32/file.c */
438
- void rb_w32_init_file(void);
439
- #endif
440
-
441
- /* gc.c */
442
- void Init_heap(void);
443
- void *ruby_mimmalloc(size_t size);
444
- void rb_objspace_set_event_hook(const rb_event_flag_t event);
445
- void rb_gc_writebarrier_remember_promoted(VALUE obj);
446
-
447
- /* hash.c */
448
- struct st_table *rb_hash_tbl_raw(VALUE hash);
449
- #define RHASH_TBL_RAW(h) rb_hash_tbl_raw(h)
450
-
451
- /* inits.c */
452
- void rb_call_inits(void);
453
-
454
- /* io.c */
455
- const char *ruby_get_inplace_mode(void);
456
- void ruby_set_inplace_mode(const char *);
457
- ssize_t rb_io_bufread(VALUE io, void *buf, size_t size);
458
- void rb_stdio_set_default_encoding(void);
459
- void rb_write_error_str(VALUE mesg);
460
- VALUE rb_io_flush_raw(VALUE, int);
461
-
462
- /* iseq.c */
463
- VALUE rb_iseq_clone(VALUE iseqval, VALUE newcbase);
464
-
465
- /* load.c */
466
- VALUE rb_get_load_path(void);
467
- VALUE rb_get_expanded_load_path(void);
468
- NORETURN(void rb_load_fail(VALUE, const char*));
469
-
470
- /* math.c */
471
- VALUE rb_math_atan2(VALUE, VALUE);
472
- VALUE rb_math_cos(VALUE);
473
- VALUE rb_math_cosh(VALUE);
474
- VALUE rb_math_exp(VALUE);
475
- VALUE rb_math_hypot(VALUE, VALUE);
476
- VALUE rb_math_log(int argc, VALUE *argv);
477
- VALUE rb_math_sin(VALUE);
478
- VALUE rb_math_sinh(VALUE);
479
- VALUE rb_math_sqrt(VALUE);
480
-
481
- /* newline.c */
482
- void Init_newline(void);
483
-
484
- /* numeric.c */
485
- int rb_num_to_uint(VALUE val, unsigned int *ret);
486
- VALUE ruby_num_interval_step_size(VALUE from, VALUE to, VALUE step, int excl);
487
- int ruby_float_step(VALUE from, VALUE to, VALUE step, int excl);
488
- double ruby_float_mod(double x, double y);
489
- int rb_num_negative_p(VALUE);
490
- VALUE rb_int_succ(VALUE num);
491
- VALUE rb_int_pred(VALUE num);
492
-
493
- /* object.c */
494
- VALUE rb_obj_equal(VALUE obj1, VALUE obj2);
495
-
496
- struct RBasicRaw {
497
- VALUE flags;
498
- VALUE klass;
499
- };
500
-
501
- #define RBASIC_CLEAR_CLASS(obj) (((struct RBasicRaw *)((VALUE)(obj)))->klass = 0)
502
- #define RBASIC_SET_CLASS_RAW(obj, cls) (((struct RBasicRaw *)((VALUE)(obj)))->klass = (cls))
503
- #define RBASIC_SET_CLASS(obj, cls) do { \
504
- VALUE _obj_ = (obj); \
505
- OBJ_WRITE(_obj_, &((struct RBasicRaw *)(_obj_))->klass, cls); \
506
- } while (0)
507
-
508
- /* parse.y */
509
- VALUE rb_parser_get_yydebug(VALUE);
510
- VALUE rb_parser_set_yydebug(VALUE, VALUE);
511
- int rb_is_const_name(VALUE name);
512
- int rb_is_class_name(VALUE name);
513
- int rb_is_global_name(VALUE name);
514
- int rb_is_instance_name(VALUE name);
515
- int rb_is_attrset_name(VALUE name);
516
- int rb_is_local_name(VALUE name);
517
- int rb_is_method_name(VALUE name);
518
- int rb_is_junk_name(VALUE name);
519
- void rb_gc_mark_parser(void);
520
- void rb_gc_mark_symbols(void);
521
-
522
- /* proc.c */
523
- VALUE rb_proc_location(VALUE self);
524
- st_index_t rb_hash_proc(st_index_t hash, VALUE proc);
525
- int rb_block_arity(void);
526
-
527
- /* process.c */
528
- #define RB_MAX_GROUPS (65536)
529
-
530
- struct rb_execarg {
531
- int use_shell;
532
- union {
533
- struct {
534
- VALUE shell_script;
535
- } sh;
536
- struct {
537
- VALUE command_name;
538
- VALUE command_abspath; /* full path string or nil */
539
- VALUE argv_str;
540
- VALUE argv_buf;
541
- } cmd;
542
- } invoke;
543
- VALUE redirect_fds;
544
- VALUE envp_str;
545
- VALUE envp_buf;
546
- VALUE dup2_tmpbuf;
547
- unsigned pgroup_given : 1;
548
- unsigned umask_given : 1;
549
- unsigned unsetenv_others_given : 1;
550
- unsigned unsetenv_others_do : 1;
551
- unsigned close_others_given : 1;
552
- unsigned close_others_do : 1;
553
- unsigned chdir_given : 1;
554
- unsigned new_pgroup_given : 1;
555
- unsigned new_pgroup_flag : 1;
556
- unsigned uid_given : 1;
557
- unsigned gid_given : 1;
558
- rb_pid_t pgroup_pgid; /* asis(-1), new pgroup(0), specified pgroup (0<V). */
559
- VALUE rlimit_limits; /* Qfalse or [[rtype, softlim, hardlim], ...] */
560
- mode_t umask_mask;
561
- rb_uid_t uid;
562
- rb_gid_t gid;
563
- VALUE fd_dup2;
564
- VALUE fd_close;
565
- VALUE fd_open;
566
- VALUE fd_dup2_child;
567
- int close_others_maxhint;
568
- VALUE env_modification; /* Qfalse or [[k1,v1], ...] */
569
- VALUE chdir_dir;
570
- };
571
-
572
- /* argv_str contains extra two elements.
573
- * The beginning one is for /bin/sh used by exec_with_sh.
574
- * The last one for terminating NULL used by execve.
575
- * See rb_exec_fillarg() in process.c. */
576
- #define ARGVSTR2ARGC(argv_str) (RSTRING_LEN(argv_str) / sizeof(char *) - 2)
577
- #define ARGVSTR2ARGV(argv_str) ((char **)RSTRING_PTR(argv_str) + 1)
578
-
579
- rb_pid_t rb_fork_ruby(int *status);
580
- void rb_last_status_clear(void);
581
-
582
- /* rational.c */
583
- VALUE rb_lcm(VALUE x, VALUE y);
584
- VALUE rb_rational_reciprocal(VALUE x);
585
-
586
- /* re.c */
587
- VALUE rb_reg_compile(VALUE str, int options, const char *sourcefile, int sourceline);
588
- VALUE rb_reg_check_preprocess(VALUE);
589
-
590
- /* signal.c */
591
- int rb_get_next_signal(void);
592
- int rb_sigaltstack_size(void);
593
-
594
- /* strftime.c */
595
- #ifdef RUBY_ENCODING_H
596
- size_t rb_strftime_timespec(char *s, size_t maxsize, const char *format, rb_encoding *enc,
597
- const struct vtm *vtm, struct timespec *ts, int gmt);
598
- size_t rb_strftime(char *s, size_t maxsize, const char *format, rb_encoding *enc,
599
- const struct vtm *vtm, VALUE timev, int gmt);
600
- #endif
601
-
602
- /* string.c */
603
- VALUE rb_fstring(VALUE);
604
- int rb_str_buf_cat_escaped_char(VALUE result, unsigned int c, int unicode_p);
605
- int rb_str_symname_p(VALUE);
606
- VALUE rb_str_quote_unprintable(VALUE);
607
- VALUE rb_id_quote_unprintable(ID);
608
- #define QUOTE(str) rb_str_quote_unprintable(str)
609
- #define QUOTE_ID(id) rb_id_quote_unprintable(id)
610
- void rb_str_fill_terminator(VALUE str, const int termlen);
611
- VALUE rb_str_locktmp_ensure(VALUE str, VALUE (*func)(VALUE), VALUE arg);
612
- #ifdef RUBY_ENCODING_H
613
- VALUE rb_external_str_with_enc(VALUE str, rb_encoding *eenc);
614
- #endif
615
-
616
- /* struct.c */
617
- VALUE rb_struct_init_copy(VALUE copy, VALUE s);
618
-
619
- /* time.c */
620
- struct timeval rb_time_timeval(VALUE);
621
-
622
- /* thread.c */
623
- VALUE rb_obj_is_mutex(VALUE obj);
624
- VALUE rb_suppress_tracing(VALUE (*func)(VALUE), VALUE arg);
625
- void rb_thread_execute_interrupts(VALUE th);
626
- void rb_clear_trace_func(void);
627
- VALUE rb_get_coverages(void);
628
- VALUE rb_thread_shield_new(void);
629
- VALUE rb_thread_shield_wait(VALUE self);
630
- VALUE rb_thread_shield_release(VALUE self);
631
- VALUE rb_thread_shield_destroy(VALUE self);
632
- void rb_mutex_allow_trap(VALUE self, int val);
633
- VALUE rb_uninterruptible(VALUE (*b_proc)(ANYARGS), VALUE data);
634
- VALUE rb_mutex_owned_p(VALUE self);
635
- void ruby_kill(rb_pid_t pid, int sig);
636
-
637
- /* thread_pthread.c, thread_win32.c */
638
- void Init_native_thread(void);
639
-
640
- /* vm_insnhelper.h */
641
- vm_state_version_t rb_next_class_sequence(void);
642
-
643
- /* vm.c */
644
- VALUE rb_obj_is_thread(VALUE obj);
645
- void rb_vm_mark(void *ptr);
646
- void Init_BareVM(void);
647
- VALUE rb_vm_top_self(void);
648
- void rb_thread_recycle_stack_release(VALUE *);
649
- void rb_vm_change_state(void);
650
- void rb_vm_inc_const_missing_count(void);
651
- void rb_thread_mark(void *th);
652
- const void **rb_vm_get_insns_address_table(void);
653
- VALUE rb_sourcefilename(void);
654
-
655
- /* vm_dump.c */
656
- void rb_vm_bugreport(void);
657
- void rb_print_backtrace(void);
658
-
659
- /* vm_eval.c */
660
- void Init_vm_eval(void);
661
- VALUE rb_current_realfilepath(void);
662
- VALUE rb_check_block_call(VALUE, ID, int, VALUE *, VALUE (*)(ANYARGS), VALUE);
663
- typedef void rb_check_funcall_hook(int, VALUE, ID, int, const VALUE *, VALUE);
664
- VALUE rb_check_funcall_with_hook(VALUE recv, ID mid, int argc, const VALUE *argv,
665
- rb_check_funcall_hook *hook, VALUE arg);
666
-
667
- /* vm_insnhelper.c */
668
- VALUE rb_equal_opt(VALUE obj1, VALUE obj2);
669
-
670
- /* vm_method.c */
671
- void Init_eval_method(void);
672
- int rb_method_defined_by(VALUE obj, ID mid, VALUE (*cfunc)(ANYARGS));
673
-
674
- /* miniprelude.c, prelude.c */
675
- void Init_prelude(void);
676
-
677
- /* vm_backtrace.c */
678
- void Init_vm_backtrace(void);
679
- VALUE rb_vm_thread_backtrace(int argc, VALUE *argv, VALUE thval);
680
- VALUE rb_vm_thread_backtrace_locations(int argc, VALUE *argv, VALUE thval);
681
-
682
- VALUE rb_make_backtrace(void);
683
- void rb_backtrace_print_as_bugreport(void);
684
- int rb_backtrace_p(VALUE obj);
685
- VALUE rb_backtrace_to_str_ary(VALUE obj);
686
- VALUE rb_vm_backtrace_object();
687
-
688
- RUBY_SYMBOL_EXPORT_BEGIN
689
- const char *rb_objspace_data_type_name(VALUE obj);
690
-
691
- /* Temporary. This API will be removed (renamed). */
692
- VALUE rb_thread_io_blocking_region(rb_blocking_function_t *func, void *data1, int fd);
693
-
694
- /* bignum.c */
695
- VALUE rb_big_mul_normal(VALUE x, VALUE y);
696
- VALUE rb_big_mul_balance(VALUE x, VALUE y);
697
- VALUE rb_big_mul_karatsuba(VALUE x, VALUE y);
698
- VALUE rb_big_mul_toom3(VALUE x, VALUE y);
699
- VALUE rb_big_sq_fast(VALUE x);
700
- VALUE rb_big_divrem_normal(VALUE x, VALUE y);
701
- VALUE rb_big2str_poweroftwo(VALUE x, int base);
702
- VALUE rb_big2str_generic(VALUE x, int base);
703
- VALUE rb_str2big_poweroftwo(VALUE arg, int base, int badcheck);
704
- VALUE rb_str2big_normal(VALUE arg, int base, int badcheck);
705
- VALUE rb_str2big_karatsuba(VALUE arg, int base, int badcheck);
706
- #if defined(HAVE_LIBGMP) && defined(HAVE_GMP_H)
707
- VALUE rb_big_mul_gmp(VALUE x, VALUE y);
708
- VALUE rb_big_divrem_gmp(VALUE x, VALUE y);
709
- VALUE rb_big2str_gmp(VALUE x, int base);
710
- VALUE rb_str2big_gmp(VALUE arg, int base, int badcheck);
711
- #endif
712
-
713
- /* file.c */
714
- #ifdef __APPLE__
715
- VALUE rb_str_normalize_ospath(const char *ptr, long len);
716
- #endif
717
-
718
- /* io.c */
719
- void rb_maygvl_fd_fix_cloexec(int fd);
720
-
721
- /* numeric.c */
722
- VALUE rb_int_positive_pow(long x, unsigned long y);
723
-
724
- /* process.c */
725
- int rb_exec_async_signal_safe(const struct rb_execarg *e, char *errmsg, size_t errmsg_buflen);
726
- 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);
727
- VALUE rb_execarg_new(int argc, VALUE *argv, int accept_shell);
728
- struct rb_execarg *rb_execarg_get(VALUE execarg_obj); /* dangerous. needs GC guard. */
729
- VALUE rb_execarg_init(int argc, VALUE *argv, int accept_shell, VALUE execarg_obj);
730
- int rb_execarg_addopt(VALUE execarg_obj, VALUE key, VALUE val);
731
- void rb_execarg_fixup(VALUE execarg_obj);
732
- int rb_execarg_run_options(const struct rb_execarg *e, struct rb_execarg *s, char* errmsg, size_t errmsg_buflen);
733
- VALUE rb_execarg_extract_options(VALUE execarg_obj, VALUE opthash);
734
- void rb_execarg_setenv(VALUE execarg_obj, VALUE env);
735
-
736
- /* rational.c */
737
- VALUE rb_gcd_normal(VALUE self, VALUE other);
738
- #if defined(HAVE_LIBGMP) && defined(HAVE_GMP_H)
739
- VALUE rb_gcd_gmp(VALUE x, VALUE y);
740
- #endif
741
-
742
- /* util.c */
743
- extern const signed char ruby_digit36_to_number_table[];
744
-
745
- /* variable.c */
746
- void rb_gc_mark_global_tbl(void);
747
- void rb_mark_generic_ivar(VALUE);
748
- void rb_mark_generic_ivar_tbl(void);
749
-
750
- int rb_st_insert_id_and_value(VALUE obj, st_table *tbl, ID key, VALUE value);
751
- st_table *rb_st_copy(VALUE obj, struct st_table *orig_tbl);
752
-
753
- /* gc.c */
754
- size_t rb_gc_count();
755
-
756
- RUBY_SYMBOL_EXPORT_END
757
-
758
- #if defined(__cplusplus)
759
- #if 0
760
- { /* satisfy cc-mode */
761
- #endif
762
- } /* extern "C" { */
763
- #endif
764
-
765
- #endif /* RUBY_INTERNAL_H */