debase-ruby_core_source 0.10.5 → 0.10.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +5 -0
  3. data/lib/debase/ruby_core_source.rb +1 -1
  4. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/addr2line.h +21 -0
  5. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/ccan/build_assert/build_assert.h +40 -0
  6. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/ccan/check_type/check_type.h +63 -0
  7. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/ccan/container_of/container_of.h +142 -0
  8. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/ccan/list/list.h +788 -0
  9. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/ccan/str/str.h +16 -0
  10. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/constant.h +51 -0
  11. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/debug_counter.h +283 -0
  12. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/dln.h +51 -0
  13. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/encindex.h +69 -0
  14. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/eval_intern.h +333 -0
  15. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/gc.h +116 -0
  16. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/hrtime.h +168 -0
  17. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/id.h +252 -0
  18. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/id_table.h +31 -0
  19. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/insns.inc +249 -0
  20. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/insns_info.inc +9374 -0
  21. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/internal.h +2470 -0
  22. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/iseq.h +304 -0
  23. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/known_errors.inc +791 -0
  24. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/method.h +229 -0
  25. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/mjit.h +148 -0
  26. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/mjit_compile.inc +4226 -0
  27. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/node.h +449 -0
  28. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/node_name.inc +200 -0
  29. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/opt_sc.inc +109 -0
  30. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/optinsn.inc +128 -0
  31. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/optunifs.inc +43 -0
  32. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/parse.h +207 -0
  33. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/probes_helper.h +42 -0
  34. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/regenc.h +254 -0
  35. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/regint.h +938 -0
  36. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/regparse.h +370 -0
  37. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/revision.h +1 -0
  38. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/ruby_assert.h +60 -0
  39. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/ruby_atomic.h +244 -0
  40. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/siphash.h +48 -0
  41. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/symbol.h +112 -0
  42. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/thread_pthread.h +75 -0
  43. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/thread_win32.h +36 -0
  44. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/timev.h +53 -0
  45. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/transcode_data.h +139 -0
  46. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/transient_heap.h +60 -0
  47. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/version.h +73 -0
  48. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/vm.inc +4504 -0
  49. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/vm_call_iseq_optimized.inc +213 -0
  50. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/vm_core.h +1910 -0
  51. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/vm_debug.h +37 -0
  52. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/vm_exec.h +202 -0
  53. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/vm_insnhelper.h +316 -0
  54. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/vm_opts.h +70 -0
  55. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/vmtc.inc +243 -0
  56. data/lib/debase/ruby_core_source/version.rb +1 -1
  57. metadata +55 -3
@@ -0,0 +1,16 @@
1
+ /* CC0 (Public domain) - see ccan/licenses/CC0 file for details */
2
+ #ifndef CCAN_STR_H
3
+ #define CCAN_STR_H
4
+ /**
5
+ * stringify - Turn expression into a string literal
6
+ * @expr: any C expression
7
+ *
8
+ * Example:
9
+ * #define PRINT_COND_IF_FALSE(cond) \
10
+ * ((cond) || printf("%s is false!", stringify(cond)))
11
+ */
12
+ #define stringify(expr) stringify_1(expr)
13
+ /* Double-indirection required to stringify expansions */
14
+ #define stringify_1(expr) #expr
15
+
16
+ #endif /* CCAN_STR_H */
@@ -0,0 +1,51 @@
1
+ /**********************************************************************
2
+
3
+ constant.h -
4
+
5
+ $Author$
6
+ created at: Sun Nov 15 00:09:33 2009
7
+
8
+ Copyright (C) 2009 Yusuke Endoh
9
+
10
+ **********************************************************************/
11
+ #ifndef CONSTANT_H
12
+ #define CONSTANT_H
13
+
14
+ typedef enum {
15
+ CONST_DEPRECATED = 0x100,
16
+
17
+ CONST_VISIBILITY_MASK = 0xff,
18
+ CONST_PUBLIC = 0x00,
19
+ CONST_PRIVATE,
20
+ CONST_VISIBILITY_MAX
21
+ } rb_const_flag_t;
22
+
23
+ #define RB_CONST_PRIVATE_P(ce) \
24
+ (((ce)->flag & CONST_VISIBILITY_MASK) == CONST_PRIVATE)
25
+ #define RB_CONST_PUBLIC_P(ce) \
26
+ (((ce)->flag & CONST_VISIBILITY_MASK) == CONST_PUBLIC)
27
+
28
+ #define RB_CONST_DEPRECATED_P(ce) \
29
+ ((ce)->flag & CONST_DEPRECATED)
30
+
31
+ typedef struct rb_const_entry_struct {
32
+ rb_const_flag_t flag;
33
+ int line;
34
+ const VALUE value; /* should be mark */
35
+ const VALUE file; /* should be mark */
36
+ } rb_const_entry_t;
37
+
38
+ VALUE rb_mod_private_constant(int argc, const VALUE *argv, VALUE obj);
39
+ VALUE rb_mod_public_constant(int argc, const VALUE *argv, VALUE obj);
40
+ VALUE rb_mod_deprecate_constant(int argc, const VALUE *argv, VALUE obj);
41
+ void rb_free_const_table(struct rb_id_table *tbl);
42
+ VALUE rb_public_const_get(VALUE klass, ID id);
43
+ VALUE rb_public_const_get_at(VALUE klass, ID id);
44
+ VALUE rb_public_const_get_from(VALUE klass, ID id);
45
+ int rb_public_const_defined(VALUE klass, ID id);
46
+ int rb_public_const_defined_at(VALUE klass, ID id);
47
+ int rb_public_const_defined_from(VALUE klass, ID id);
48
+ rb_const_entry_t *rb_const_lookup(VALUE klass, ID id);
49
+ int rb_autoloading_value(VALUE mod, ID id, VALUE *value, rb_const_flag_t *flag);
50
+
51
+ #endif /* CONSTANT_H */
@@ -0,0 +1,283 @@
1
+ /**********************************************************************
2
+
3
+ debug_counter.h -
4
+
5
+ created at: Tue Feb 21 16:51:18 2017
6
+
7
+ Copyright (C) 2017 Koichi Sasada
8
+
9
+ **********************************************************************/
10
+
11
+ #ifndef USE_DEBUG_COUNTER
12
+ #define USE_DEBUG_COUNTER 0
13
+ #endif
14
+
15
+ #ifdef RB_DEBUG_COUNTER
16
+
17
+ /*
18
+ * method cache (mc) counts.
19
+ *
20
+ * * mc_inline_hit/miss: inline mc hit/miss counts (VM send insn)
21
+ * * mc_global_hit/miss: global method cache hit/miss counts
22
+ * two types: (1) inline cache miss (VM send insn)
23
+ * (2) called from C (rb_funcall).
24
+ * * mc_global_state_miss: inline mc miss by global_state miss.
25
+ * * mc_class_serial_miss: ... by mc_class_serial_miss
26
+ * * mc_cme_complement: cme complement counts.
27
+ * * mc_cme_complement_hit: cme cache hit counts.
28
+ * * mc_search_super: search_method() call counts.
29
+ */
30
+ RB_DEBUG_COUNTER(mc_inline_hit)
31
+ RB_DEBUG_COUNTER(mc_inline_miss)
32
+ RB_DEBUG_COUNTER(mc_global_hit)
33
+ RB_DEBUG_COUNTER(mc_global_miss)
34
+ RB_DEBUG_COUNTER(mc_global_state_miss)
35
+ RB_DEBUG_COUNTER(mc_class_serial_miss)
36
+ RB_DEBUG_COUNTER(mc_cme_complement)
37
+ RB_DEBUG_COUNTER(mc_cme_complement_hit)
38
+ RB_DEBUG_COUNTER(mc_search_super)
39
+
40
+ /*
41
+ * control frame push counts.
42
+ *
43
+ * * frame_push: frame push counts.
44
+ * * frame_push_*: frame push counts per each type.
45
+ * * frame_R2R: Ruby frame to Ruby frame
46
+ * * frame_R2C: Ruby frame to C frame
47
+ * * frame_C2C: C frame to C frame
48
+ * * frame_C2R: C frame to Ruby frame
49
+ */
50
+ RB_DEBUG_COUNTER(frame_push)
51
+ RB_DEBUG_COUNTER(frame_push_method)
52
+ RB_DEBUG_COUNTER(frame_push_block)
53
+ RB_DEBUG_COUNTER(frame_push_class)
54
+ RB_DEBUG_COUNTER(frame_push_top)
55
+ RB_DEBUG_COUNTER(frame_push_cfunc)
56
+ RB_DEBUG_COUNTER(frame_push_ifunc)
57
+ RB_DEBUG_COUNTER(frame_push_eval)
58
+ RB_DEBUG_COUNTER(frame_push_rescue)
59
+ RB_DEBUG_COUNTER(frame_push_dummy)
60
+
61
+ RB_DEBUG_COUNTER(frame_R2R)
62
+ RB_DEBUG_COUNTER(frame_R2C)
63
+ RB_DEBUG_COUNTER(frame_C2C)
64
+ RB_DEBUG_COUNTER(frame_C2R)
65
+
66
+ /* instance variable counts
67
+ *
68
+ * * ivar_get_ic_hit/miss: ivar_get inline cache (ic) hit/miss counts (VM insn)
69
+ * * ivar_get_ic_miss_serial: ivar_get ic miss reason by serial (VM insn)
70
+ * * ivar_get_ic_miss_unset: ... by unset (VM insn)
71
+ * * ivar_get_ic_miss_noobject: ... by "not T_OBJECT" (VM insn)
72
+ * * ivar_set_...: same counts with ivar_set (VM insn)
73
+ * * ivar_get/set_base: call counts of "rb_ivar_get/set()".
74
+ * because of (1) ic miss.
75
+ * (2) direct call by C extensions.
76
+ */
77
+ RB_DEBUG_COUNTER(ivar_get_ic_hit)
78
+ RB_DEBUG_COUNTER(ivar_get_ic_miss)
79
+ RB_DEBUG_COUNTER(ivar_get_ic_miss_serial)
80
+ RB_DEBUG_COUNTER(ivar_get_ic_miss_unset)
81
+ RB_DEBUG_COUNTER(ivar_get_ic_miss_noobject)
82
+ RB_DEBUG_COUNTER(ivar_set_ic_hit)
83
+ RB_DEBUG_COUNTER(ivar_set_ic_miss)
84
+ RB_DEBUG_COUNTER(ivar_set_ic_miss_serial)
85
+ RB_DEBUG_COUNTER(ivar_set_ic_miss_unset)
86
+ RB_DEBUG_COUNTER(ivar_set_ic_miss_oorange)
87
+ RB_DEBUG_COUNTER(ivar_set_ic_miss_noobject)
88
+ RB_DEBUG_COUNTER(ivar_get_base)
89
+ RB_DEBUG_COUNTER(ivar_set_base)
90
+
91
+ /* local variable counts
92
+ *
93
+ * * lvar_get: total lvar get counts (VM insn)
94
+ * * lvar_get_dynamic: lvar get counts if accessing upper env (VM insn)
95
+ * * lvar_set*: same as "get"
96
+ * * lvar_set_slowpath: counts using vm_env_write_slowpath()
97
+ */
98
+ RB_DEBUG_COUNTER(lvar_get)
99
+ RB_DEBUG_COUNTER(lvar_get_dynamic)
100
+ RB_DEBUG_COUNTER(lvar_set)
101
+ RB_DEBUG_COUNTER(lvar_set_dynamic)
102
+ RB_DEBUG_COUNTER(lvar_set_slowpath)
103
+
104
+ /* GC counts:
105
+ *
106
+ * * count: simple count
107
+ * * _minor: minor gc
108
+ * * _major: major gc
109
+ * * other suffix is corresponding to last_gc_info or
110
+ * gc_profile_record_flag in gc.c.
111
+ */
112
+ RB_DEBUG_COUNTER(gc_count)
113
+ RB_DEBUG_COUNTER(gc_minor_newobj)
114
+ RB_DEBUG_COUNTER(gc_minor_malloc)
115
+ RB_DEBUG_COUNTER(gc_minor_method)
116
+ RB_DEBUG_COUNTER(gc_minor_capi)
117
+ RB_DEBUG_COUNTER(gc_minor_stress)
118
+ RB_DEBUG_COUNTER(gc_major_nofree)
119
+ RB_DEBUG_COUNTER(gc_major_oldgen)
120
+ RB_DEBUG_COUNTER(gc_major_shady)
121
+ RB_DEBUG_COUNTER(gc_major_force)
122
+ RB_DEBUG_COUNTER(gc_major_oldmalloc)
123
+
124
+ /* object allocation counts:
125
+ *
126
+ * * obj_newobj: newobj counts
127
+ * * obj_newobj_slowpath: newobj with slowpath counts
128
+ * * obj_newobj_wb_unprotected: newobj for wb_unprotecte.
129
+ * * obj_free: obj_free() counts
130
+ * * obj_promote: promoted counts (oldgen)
131
+ * * obj_wb_unprotect: wb unprotect counts
132
+ *
133
+ * * obj_[type]_[attr]: *free'ed counts* for each type.
134
+ * Note that it is not a allocated counts.
135
+ * * [type]
136
+ * * _obj: T_OBJECT
137
+ * * _str: T_STRING
138
+ * * _ary: T_ARRAY
139
+ * * _xxx: T_XXX (hash, struct, ...)
140
+ *
141
+ * * [attr]
142
+ * * _ptr: R?? is not embed.
143
+ * * _embed: R?? is embed.
144
+ * * _transient: R?? uses transient heap.
145
+ * * type specific attr.
146
+ * * str_shared: str is shared.
147
+ * * str_nofree: nofree
148
+ * * str_fstr: fstr
149
+ * * hash_empty: hash is empty
150
+ * * hash_under4: has under 4 entries
151
+ * * hash_ge4: has n entries (4<=n<8)
152
+ * * hash_ge8: has n entries (8<=n)
153
+ * * data_empty: T_DATA but no memory free.
154
+ * * data_xfree: free'ed by xfree().
155
+ * * data_imm_free: free'ed immediately.
156
+ * * data_zombie: free'ed with zombie.
157
+ * * imemo_*: T_IMEMO with each type.
158
+ */
159
+ RB_DEBUG_COUNTER(obj_newobj)
160
+ RB_DEBUG_COUNTER(obj_newobj_slowpath)
161
+ RB_DEBUG_COUNTER(obj_newobj_wb_unprotected)
162
+ RB_DEBUG_COUNTER(obj_free)
163
+ RB_DEBUG_COUNTER(obj_promote)
164
+ RB_DEBUG_COUNTER(obj_wb_unprotect)
165
+
166
+ RB_DEBUG_COUNTER(obj_obj_embed)
167
+ RB_DEBUG_COUNTER(obj_obj_transient)
168
+ RB_DEBUG_COUNTER(obj_obj_ptr)
169
+
170
+ RB_DEBUG_COUNTER(obj_str_ptr)
171
+ RB_DEBUG_COUNTER(obj_str_embed)
172
+ RB_DEBUG_COUNTER(obj_str_shared)
173
+ RB_DEBUG_COUNTER(obj_str_nofree)
174
+ RB_DEBUG_COUNTER(obj_str_fstr)
175
+
176
+ RB_DEBUG_COUNTER(obj_ary_embed)
177
+ RB_DEBUG_COUNTER(obj_ary_transient)
178
+ RB_DEBUG_COUNTER(obj_ary_ptr)
179
+
180
+ RB_DEBUG_COUNTER(obj_hash_empty)
181
+ RB_DEBUG_COUNTER(obj_hash_under4)
182
+ RB_DEBUG_COUNTER(obj_hash_ge4)
183
+ RB_DEBUG_COUNTER(obj_hash_ge8)
184
+ RB_DEBUG_COUNTER(obj_hash_ar)
185
+ RB_DEBUG_COUNTER(obj_hash_st)
186
+ RB_DEBUG_COUNTER(obj_hash_transient)
187
+
188
+ RB_DEBUG_COUNTER(obj_hash_force_convert)
189
+
190
+ RB_DEBUG_COUNTER(obj_struct_embed)
191
+ RB_DEBUG_COUNTER(obj_struct_transient)
192
+ RB_DEBUG_COUNTER(obj_struct_ptr)
193
+
194
+ RB_DEBUG_COUNTER(obj_regexp_ptr)
195
+
196
+ RB_DEBUG_COUNTER(obj_data_empty)
197
+ RB_DEBUG_COUNTER(obj_data_xfree)
198
+ RB_DEBUG_COUNTER(obj_data_imm_free)
199
+ RB_DEBUG_COUNTER(obj_data_zombie)
200
+
201
+ RB_DEBUG_COUNTER(obj_match_ptr)
202
+ RB_DEBUG_COUNTER(obj_file_ptr)
203
+ RB_DEBUG_COUNTER(obj_bignum_ptr)
204
+
205
+ RB_DEBUG_COUNTER(obj_symbol)
206
+
207
+ RB_DEBUG_COUNTER(obj_imemo_ment)
208
+ RB_DEBUG_COUNTER(obj_imemo_iseq)
209
+ RB_DEBUG_COUNTER(obj_imemo_env)
210
+ RB_DEBUG_COUNTER(obj_imemo_tmpbuf)
211
+ RB_DEBUG_COUNTER(obj_imemo_ast)
212
+ RB_DEBUG_COUNTER(obj_imemo_cref)
213
+ RB_DEBUG_COUNTER(obj_imemo_svar)
214
+ RB_DEBUG_COUNTER(obj_imemo_throw_data)
215
+ RB_DEBUG_COUNTER(obj_imemo_ifunc)
216
+ RB_DEBUG_COUNTER(obj_imemo_memo)
217
+ RB_DEBUG_COUNTER(obj_imemo_parser_strterm)
218
+
219
+ RB_DEBUG_COUNTER(obj_iclass_ptr)
220
+ RB_DEBUG_COUNTER(obj_class_ptr)
221
+ RB_DEBUG_COUNTER(obj_module_ptr)
222
+
223
+ /* heap function counts
224
+ *
225
+ * * heap_xmalloc/realloc/xfree: call counts
226
+ */
227
+ RB_DEBUG_COUNTER(heap_xmalloc)
228
+ RB_DEBUG_COUNTER(heap_xrealloc)
229
+ RB_DEBUG_COUNTER(heap_xfree)
230
+
231
+ /* transient_heap */
232
+ RB_DEBUG_COUNTER(theap_alloc)
233
+ RB_DEBUG_COUNTER(theap_alloc_fail)
234
+ RB_DEBUG_COUNTER(theap_evacuate)
235
+
236
+ /* load (not implemented yet) */
237
+ /*
238
+ RB_DEBUG_COUNTER(load_files)
239
+ RB_DEBUG_COUNTER(load_path_is_not_realpath)
240
+ */
241
+ #endif
242
+
243
+ #ifndef RUBY_DEBUG_COUNTER_H
244
+ #define RUBY_DEBUG_COUNTER_H 1
245
+
246
+ #if !defined(__GNUC__) && USE_DEBUG_COUNTER
247
+ #error "USE_DEBUG_COUNTER is not supported by other than __GNUC__"
248
+ #endif
249
+
250
+ enum rb_debug_counter_type {
251
+ #define RB_DEBUG_COUNTER(name) RB_DEBUG_COUNTER_##name,
252
+ #include __FILE__
253
+ RB_DEBUG_COUNTER_MAX
254
+ #undef RB_DEBUG_COUNTER
255
+ };
256
+
257
+ #if USE_DEBUG_COUNTER
258
+ #include "ruby/ruby.h"
259
+
260
+ extern size_t rb_debug_counter[];
261
+
262
+ inline static int
263
+ rb_debug_counter_add(enum rb_debug_counter_type type, int add, int cond)
264
+ {
265
+ if (cond) {
266
+ rb_debug_counter[(int)type] += add;
267
+ }
268
+ return cond;
269
+ }
270
+
271
+ #define RB_DEBUG_COUNTER_INC(type) rb_debug_counter_add(RB_DEBUG_COUNTER_##type, 1, 1)
272
+ #define RB_DEBUG_COUNTER_INC_UNLESS(type, cond) (!rb_debug_counter_add(RB_DEBUG_COUNTER_##type, 1, !(cond)))
273
+ #define RB_DEBUG_COUNTER_INC_IF(type, cond) rb_debug_counter_add(RB_DEBUG_COUNTER_##type, 1, (cond))
274
+
275
+ #else
276
+ #define RB_DEBUG_COUNTER_INC(type) ((void)0)
277
+ #define RB_DEBUG_COUNTER_INC_UNLESS(type, cond) (cond)
278
+ #define RB_DEBUG_COUNTER_INC_IF(type, cond) (cond)
279
+ #endif
280
+
281
+ void rb_debug_counter_show_results(const char *msg);
282
+
283
+ #endif /* RUBY_DEBUG_COUNTER_H */
@@ -0,0 +1,51 @@
1
+ /**********************************************************************
2
+
3
+ dln.h -
4
+
5
+ $Author: nobu $
6
+ created at: Wed Jan 19 16:53:09 JST 1994
7
+
8
+ Copyright (C) 1993-2007 Yukihiro Matsumoto
9
+
10
+ **********************************************************************/
11
+
12
+ #ifndef DLN_H
13
+ #define DLN_H
14
+
15
+ #ifdef __cplusplus
16
+ # ifndef HAVE_PROTOTYPES
17
+ # define HAVE_PROTOTYPES 1
18
+ # endif
19
+ # ifndef HAVE_STDARG_PROTOTYPES
20
+ # define HAVE_STDARG_PROTOTYPES 1
21
+ # endif
22
+ #endif
23
+
24
+ #undef _
25
+ #ifdef HAVE_PROTOTYPES
26
+ # define _(args) args
27
+ #else
28
+ # define _(args) ()
29
+ #endif
30
+
31
+ RUBY_SYMBOL_EXPORT_BEGIN
32
+
33
+ #ifndef DLN_FIND_EXTRA_ARG
34
+ #define DLN_FIND_EXTRA_ARG
35
+ #endif
36
+ #ifndef DLN_FIND_EXTRA_ARG_DECL
37
+ #define DLN_FIND_EXTRA_ARG_DECL
38
+ #endif
39
+
40
+ char *dln_find_exe_r(const char*,const char*,char*,size_t DLN_FIND_EXTRA_ARG_DECL);
41
+ char *dln_find_file_r(const char*,const char*,char*,size_t DLN_FIND_EXTRA_ARG_DECL);
42
+
43
+ #ifdef USE_DLN_A_OUT
44
+ extern char *dln_argv0;
45
+ #endif
46
+
47
+ void *dln_load(const char*);
48
+
49
+ RUBY_SYMBOL_EXPORT_END
50
+
51
+ #endif
@@ -0,0 +1,69 @@
1
+ /**********************************************************************
2
+
3
+ encindex.h -
4
+
5
+ $Author$
6
+ created at: Tue Sep 15 13:21:14 JST 2015
7
+
8
+ Copyright (C) 2015 Yukihiro Matsumoto
9
+
10
+ **********************************************************************/
11
+
12
+ #ifndef RUBY_ENCINDEX_H
13
+ #define RUBY_ENCINDEX_H 1
14
+ #if defined(__cplusplus)
15
+ extern "C" {
16
+ #if 0
17
+ } /* satisfy cc-mode */
18
+ #endif
19
+ #endif
20
+
21
+ enum ruby_preserved_encindex {
22
+ RUBY_ENCINDEX_ASCII,
23
+ RUBY_ENCINDEX_UTF_8,
24
+ RUBY_ENCINDEX_US_ASCII,
25
+
26
+ /* preserved indexes */
27
+ RUBY_ENCINDEX_UTF_16BE,
28
+ RUBY_ENCINDEX_UTF_16LE,
29
+ RUBY_ENCINDEX_UTF_32BE,
30
+ RUBY_ENCINDEX_UTF_32LE,
31
+ RUBY_ENCINDEX_UTF_16,
32
+ RUBY_ENCINDEX_UTF_32,
33
+ RUBY_ENCINDEX_UTF8_MAC,
34
+
35
+ /* for old options of regexp */
36
+ RUBY_ENCINDEX_EUC_JP,
37
+ RUBY_ENCINDEX_Windows_31J,
38
+
39
+ RUBY_ENCINDEX_BUILTIN_MAX
40
+ };
41
+
42
+ #define ENCINDEX_ASCII RUBY_ENCINDEX_ASCII
43
+ #define ENCINDEX_UTF_8 RUBY_ENCINDEX_UTF_8
44
+ #define ENCINDEX_US_ASCII RUBY_ENCINDEX_US_ASCII
45
+ #define ENCINDEX_UTF_16BE RUBY_ENCINDEX_UTF_16BE
46
+ #define ENCINDEX_UTF_16LE RUBY_ENCINDEX_UTF_16LE
47
+ #define ENCINDEX_UTF_32BE RUBY_ENCINDEX_UTF_32BE
48
+ #define ENCINDEX_UTF_32LE RUBY_ENCINDEX_UTF_32LE
49
+ #define ENCINDEX_UTF_16 RUBY_ENCINDEX_UTF_16
50
+ #define ENCINDEX_UTF_32 RUBY_ENCINDEX_UTF_32
51
+ #define ENCINDEX_UTF8_MAC RUBY_ENCINDEX_UTF8_MAC
52
+ #define ENCINDEX_EUC_JP RUBY_ENCINDEX_EUC_JP
53
+ #define ENCINDEX_Windows_31J RUBY_ENCINDEX_Windows_31J
54
+ #define ENCINDEX_BUILTIN_MAX RUBY_ENCINDEX_BUILTIN_MAX
55
+
56
+ #define rb_ascii8bit_encindex() RUBY_ENCINDEX_ASCII
57
+ #define rb_utf8_encindex() RUBY_ENCINDEX_UTF_8
58
+ #define rb_usascii_encindex() RUBY_ENCINDEX_US_ASCII
59
+
60
+ int rb_enc_find_index2(const char *name, long len);
61
+
62
+ #if defined(__cplusplus)
63
+ #if 0
64
+ { /* satisfy cc-mode */
65
+ #endif
66
+ } /* extern "C" { */
67
+ #endif
68
+
69
+ #endif /* RUBY_ENCINDEX_H */