Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

* internal.h: declare internal functions here.

* node.h: declare NODE dependent internal functions here.

* iseq.h: declare rb_iseq_t dependent internal functions here.

* vm_core.h: declare rb_thread_t dependent internal functions here.

* bignum.c, class.c, compile.c, complex.c, cont.c, dir.c, encoding.c,
  enumerator.c, error.c, eval.c, file.c, gc.c, hash.c, inits.c, io.c,
  iseq.c, load.c, marshal.c, math.c, numeric.c, object.c, parse.y,
  proc.c, process.c, range.c, rational.c, re.c, ruby.c, string.c,
  thread.c, time.c, transcode.c, variable.c, vm.c,
  tool/compile_prelude.rb: don't declare internal functions declared
  in above headers.  include above headers if required.

  Note that rb_thread_mark() was declared as
  void rb_thread_mark(rb_thread_t *th) in cont.c but defined as
  void rb_thread_mark(void *ptr) in vm.c.  Now it is declared as
  the later in internal.h.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information...
commit e7996eb3cc1687d1f70ea8f78befddf821ad3ff0 1 parent aba879a
akr authored June 17, 2011
23  ChangeLog
... ...
@@ -1,3 +1,26 @@
  1
+Sat Jun 18 07:27:27 2011  Tanaka Akira  <akr@fsij.org>
  2
+
  3
+	* internal.h: declare internal functions here.
  4
+
  5
+	* node.h: declare NODE dependent internal functions here.
  6
+
  7
+	* iseq.h: declare rb_iseq_t dependent internal functions here.
  8
+
  9
+	* vm_core.h: declare rb_thread_t dependent internal functions here.
  10
+
  11
+	* bignum.c, class.c, compile.c, complex.c, cont.c, dir.c, encoding.c,
  12
+	  enumerator.c, error.c, eval.c, file.c, gc.c, hash.c, inits.c, io.c,
  13
+	  iseq.c, load.c, marshal.c, math.c, numeric.c, object.c, parse.y,
  14
+	  proc.c, process.c, range.c, rational.c, re.c, ruby.c, string.c,
  15
+	  thread.c, time.c, transcode.c, variable.c, vm.c,
  16
+	  tool/compile_prelude.rb: don't declare internal functions declared
  17
+	  in above headers.  include above headers if required.
  18
+
  19
+	  Note that rb_thread_mark() was declared as
  20
+	  void rb_thread_mark(rb_thread_t *th) in cont.c but defined as
  21
+	  void rb_thread_mark(void *ptr) in vm.c.  Now it is declared as
  22
+	  the later in internal.h.
  23
+
1 24
 Sat Jun 18 02:36:00 2011  Kenta Murata  <mrkn@mrkn.jp>
2 25
 
3 26
 	* ext/bigdecimal/bigdecimal.c (VpNewRbClass): fix type of the 2nd
1  bignum.c
@@ -11,6 +11,7 @@
11 11
 
12 12
 #include "ruby/ruby.h"
13 13
 #include "ruby/util.h"
  14
+#include "internal.h"
14 15
 
15 16
 #include <math.h>
16 17
 #include <float.h>
2  class.c
@@ -120,8 +120,6 @@ rb_class_new(VALUE super)
120 120
     return rb_class_boot(super);
121 121
 }
122 122
 
123  
-VALUE rb_iseq_clone(VALUE iseqval, VALUE newcbase);
124  
-
125 123
 static void
126 124
 rb_mod_clone_method(VALUE klass, ID mid, const rb_method_entry_t *me)
127 125
 {
2  compile.c
@@ -10,6 +10,7 @@
10 10
 **********************************************************************/
11 11
 
12 12
 #include "ruby/ruby.h"
  13
+#include "internal.h"
13 14
 #include <math.h>
14 15
 
15 16
 #define USE_INSN_STACK_INCREASE 1
@@ -155,7 +156,6 @@ r_value(VALUE value)
155 156
 #endif
156 157
 
157 158
 #if CPDEBUG > 1 || CPDEBUG < 0
158  
-PRINTF_ARGS(void ruby_debug_printf(const char*, ...), 1, 2);
159 159
 #define debugs if (compile_debug_print_indent(1)) ruby_debug_printf
160 160
 #define debug_compile(msg, v) ((void)(compile_debug_print_indent(1) && fputs((msg), stderr)), (v))
161 161
 #else
5  complex.c
@@ -6,6 +6,7 @@
6 6
 */
7 7
 
8 8
 #include "ruby.h"
  9
+#include "internal.h"
9 10
 #include <math.h>
10 11
 
11 12
 #define NDEBUG
@@ -508,8 +509,6 @@ imp2(hypot)
508 509
 
509 510
 #define m_hypot(x,y) m_hypot_bang((x),(y))
510 511
 
511  
-extern VALUE rb_math_log(int argc, VALUE *argv);
512  
-
513 512
 static VALUE
514 513
 m_log_bang(VALUE x)
515 514
 {
@@ -1092,8 +1091,6 @@ nucomp_inexact_p(VALUE self)
1092 1091
 }
1093 1092
 #endif
1094 1093
 
1095  
-extern VALUE rb_lcm(VALUE x, VALUE y);
1096  
-
1097 1094
 /*
1098 1095
  * call-seq:
1099 1096
  *    cmp.denominator  ->  integer
4  cont.c
@@ -10,6 +10,7 @@
10 10
 **********************************************************************/
11 11
 
12 12
 #include "ruby/ruby.h"
  13
+#include "internal.h"
13 14
 #include "vm_core.h"
14 15
 #include "gc.h"
15 16
 #include "eval_intern.h"
@@ -126,7 +127,6 @@ static VALUE rb_eFiberError;
126 127
 
127 128
 NOINLINE(static VALUE cont_capture(volatile int *stat));
128 129
 
129  
-void rb_thread_mark(rb_thread_t *th);
130 130
 #define THREAD_MUST_BE_RUNNING(th) do { \
131 131
 	if (!(th)->tag) rb_raise(rb_eThreadError, "not running thread");	\
132 132
     } while (0)
@@ -409,8 +409,6 @@ cont_new(VALUE klass)
409 409
     return cont;
410 410
 }
411 411
 
412  
-void rb_vm_stack_to_heap(rb_thread_t *th);
413  
-
414 412
 static VALUE
415 413
 cont_capture(volatile int *stat)
416 414
 {
3  dir.c
@@ -13,6 +13,7 @@
13 13
 
14 14
 #include "ruby/ruby.h"
15 15
 #include "ruby/encoding.h"
  16
+#include "internal.h"
16 17
 
17 18
 #include <sys/types.h>
18 19
 #include <sys/stat.h>
@@ -1996,8 +1997,6 @@ file_s_fnmatch(int argc, VALUE *argv, VALUE obj)
1996 1997
     return Qfalse;
1997 1998
 }
1998 1999
 
1999  
-VALUE rb_home_dir(const char *user, VALUE result);
2000  
-
2001 2000
 /*
2002 2001
  *  call-seq:
2003 2002
  *    Dir.home()       -> "/home/me"
1  encoding.c
@@ -11,6 +11,7 @@
11 11
 
12 12
 #include "ruby/ruby.h"
13 13
 #include "ruby/encoding.h"
  14
+#include "internal.h"
14 15
 #include "regenc.h"
15 16
 #include <ctype.h>
16 17
 #ifndef NO_LOCALE_CHARMAP
2  enumerator.c
@@ -1018,8 +1018,6 @@ generator_init(VALUE obj, VALUE proc)
1018 1018
     return obj;
1019 1019
 }
1020 1020
 
1021  
-VALUE rb_obj_is_proc(VALUE proc);
1022  
-
1023 1021
 /* :nodoc: */
1024 1022
 static VALUE
1025 1023
 generator_initialize(int argc, VALUE *argv, VALUE obj)
3  error.c
@@ -12,6 +12,7 @@
12 12
 #include "ruby/ruby.h"
13 13
 #include "ruby/st.h"
14 14
 #include "ruby/encoding.h"
  15
+#include "internal.h"
15 16
 #include "vm_core.h"
16 17
 
17 18
 #include <stdio.h>
@@ -230,8 +231,6 @@ rb_warn_m(VALUE self, VALUE mesg)
230 231
     return Qnil;
231 232
 }
232 233
 
233  
-void rb_vm_bugreport(void);
234  
-
235 234
 static void
236 235
 report_bug(const char *file, int line, const char *fmt, va_list args)
237 236
 {
12  eval.c
@@ -16,6 +16,7 @@
16 16
 #include "gc.h"
17 17
 #include "ruby/vm.h"
18 18
 #include "ruby/encoding.h"
  19
+#include "internal.h"
19 20
 #include "vm_core.h"
20 21
 
21 22
 #define numberof(array) (int)(sizeof(array) / sizeof((array)[0]))
@@ -35,12 +36,6 @@ VALUE rb_eSysStackError;
35 36
 
36 37
 /* initialize ruby */
37 38
 
38  
-void rb_clear_trace_func(void);
39  
-
40  
-void rb_call_inits(void);
41  
-void Init_heap(void);
42  
-void Init_BareVM(void);
43  
-
44 39
 void
45 40
 ruby_init(void)
46 41
 {
@@ -69,8 +64,6 @@ ruby_init(void)
69 64
     GET_VM()->running = 1;
70 65
 }
71 66
 
72  
-extern void rb_clear_trace_func(void);
73  
-
74 67
 void *
75 68
 ruby_options(int argc, char **argv)
76 69
 {
@@ -1053,9 +1046,6 @@ top_include(int argc, VALUE *argv, VALUE self)
1053 1046
     return rb_mod_include(argc, argv, rb_cObject);
1054 1047
 }
1055 1048
 
1056  
-VALUE rb_f_trace_var();
1057  
-VALUE rb_f_untrace_var();
1058  
-
1059 1049
 static VALUE *
1060 1050
 errinfo_place(rb_thread_t *th)
1061 1051
 {
5  file.c
@@ -23,6 +23,7 @@
23 23
 #include "ruby/io.h"
24 24
 #include "ruby/util.h"
25 25
 #include "dln.h"
  26
+#include "internal.h"
26 27
 
27 28
 #ifdef HAVE_UNISTD_H
28 29
 #include <unistd.h>
@@ -2203,8 +2204,6 @@ rb_file_s_lchown(int argc, VALUE *argv)
2203 2204
 #define rb_file_s_lchown rb_f_notimplement
2204 2205
 #endif
2205 2206
 
2206  
-struct timespec rb_time_timespec(VALUE time);
2207  
-
2208 2207
 struct utime_args {
2209 2208
     const struct timespec* tsp;
2210 2209
     VALUE atime, mtime;
@@ -5088,8 +5087,6 @@ is_explicit_relative(const char *path)
5088 5087
     return isdirsep(*path);
5089 5088
 }
5090 5089
 
5091  
-VALUE rb_get_load_path(void);
5092  
-
5093 5090
 static VALUE
5094 5091
 copy_path_class(VALUE path, VALUE orig)
5095 5092
 {
6  gc.c
@@ -50,8 +50,6 @@
50 50
 # define VALGRIND_MAKE_MEM_UNDEFINED(p, n) /* empty */
51 51
 #endif
52 52
 
53  
-int rb_io_fptr_finalize(struct rb_io_t*);
54  
-
55 53
 #define rb_setjmp(env) RUBY_SETJMP(env)
56 54
 #define rb_jmp_buf rb_jmpbuf_t
57 55
 
@@ -2364,8 +2362,6 @@ obj_free(rb_objspace_t *objspace, VALUE obj)
2364 2362
 
2365 2363
 #define GC_NOTIFY 0
2366 2364
 
2367  
-void rb_vm_mark(void *ptr);
2368  
-
2369 2365
 #if STACK_GROW_DIRECTION < 0
2370 2366
 #define GET_STACK_BOUNDS(start, end, appendix) ((start) = STACK_END, (end) = STACK_START)
2371 2367
 #elif STACK_GROW_DIRECTION > 0
@@ -2406,8 +2402,6 @@ mark_current_machine_context(rb_objspace_t *objspace, rb_thread_t *th)
2406 2402
 #endif
2407 2403
 }
2408 2404
 
2409  
-void rb_gc_mark_encodings(void);
2410  
-
2411 2405
 static void
2412 2406
 gc_clear_mark_on_sweep_slots(rb_objspace_t *objspace)
2413 2407
 {
2  hash.c
@@ -690,8 +690,6 @@ rb_hash_default_proc(VALUE hash)
690 690
     return Qnil;
691 691
 }
692 692
 
693  
-VALUE rb_obj_is_proc(VALUE proc);
694  
-
695 693
 /*
696 694
  *  call-seq:
697 695
  *     hsh.default_proc = proc_obj     -> proc_obj
1  inits.c
@@ -10,6 +10,7 @@
10 10
 **********************************************************************/
11 11
 
12 12
 #include "ruby/ruby.h"
  13
+#include "internal.h"
13 14
 
14 15
 #define CALL(n) {void Init_##n(void); Init_##n();}
15 16
 
119  internal.h
@@ -25,13 +25,128 @@ struct rb_classext_struct {
25 25
     struct st_table *const_tbl;
26 26
 };
27 27
 
  28
+/* bignum.c */
  29
+VALUE rb_big_fdiv(VALUE x, VALUE y);
28 30
 VALUE rb_big_uminus(VALUE x);
29 31
 
30  
-VALUE rb_obj_is_thread(VALUE obj);
31  
-VALUE rb_obj_is_mutex(VALUE obj);
  32
+/* class.c */
  33
+VALUE rb_obj_methods(int argc, VALUE *argv, VALUE obj);
  34
+VALUE rb_obj_protected_methods(int argc, VALUE *argv, VALUE obj);
  35
+VALUE rb_obj_private_methods(int argc, VALUE *argv, VALUE obj);
  36
+VALUE rb_obj_public_methods(int argc, VALUE *argv, VALUE obj);
  37
+
  38
+/* compile.c */
  39
+int rb_dvar_defined(ID);
  40
+int rb_local_defined(ID);
  41
+int rb_parse_in_eval(void);
  42
+int rb_parse_in_main(void);
  43
+
  44
+/* debug.c */
  45
+PRINTF_ARGS(void ruby_debug_printf(const char*, ...), 1, 2);
  46
+
  47
+/* dmyext.c */
  48
+void Init_ext(void);
  49
+
  50
+/* encoding.c */
  51
+ID rb_id_encoding(void);
  52
+
  53
+/* encoding.c */
  54
+void rb_gc_mark_encodings(void);
  55
+
  56
+/* file.c */
  57
+VALUE rb_home_dir(const char *user, VALUE result);
  58
+VALUE rb_realpath_internal(VALUE basedir, VALUE path, int strict);
  59
+void Init_File(void);
  60
+
  61
+/* gc.c */
  62
+void Init_heap(void);
  63
+
  64
+/* inits.c */
  65
+void rb_call_inits(void);
  66
+
  67
+/* io.c */
  68
+const char *ruby_get_inplace_mode(void);
  69
+void ruby_set_inplace_mode(const char *);
  70
+int rb_io_fptr_finalize(struct rb_io_t*);
  71
+ssize_t rb_io_bufwrite(VALUE io, const void *buf, size_t size);
  72
+ssize_t rb_io_bufread(VALUE io, void *buf, size_t size);
  73
+void rb_stdio_set_default_encoding(void);
  74
+
  75
+/* iseq.c */
  76
+VALUE rb_iseq_compile_with_option(VALUE src, VALUE file, VALUE filepath, VALUE line, VALUE opt);
  77
+VALUE rb_iseq_clone(VALUE iseqval, VALUE newcbase);
  78
+
  79
+/* load.c */
  80
+VALUE rb_get_load_path(void);
  81
+
  82
+/* math.c */
  83
+VALUE rb_math_log(int argc, VALUE *argv);
  84
+
  85
+/* newline.c */
  86
+void Init_newline(void);
  87
+
  88
+/* numeric.c */
  89
+VALUE rb_rational_reciprocal(VALUE x);
  90
+int rb_num_to_uint(VALUE val, unsigned int *ret);
32 91
 
  92
+/* parse.y */
  93
+VALUE rb_parser_get_yydebug(VALUE);
  94
+VALUE rb_parser_set_yydebug(VALUE, VALUE);
  95
+
  96
+/* rational.c */
  97
+VALUE rb_lcm(VALUE x, VALUE y);
  98
+
  99
+/* re.c */
  100
+VALUE rb_reg_compile(VALUE str, int options, const char *sourcefile, int sourceline);
  101
+VALUE rb_reg_check_preprocess(VALUE);
  102
+
  103
+/* signal.c */
  104
+int rb_get_next_signal(void);
  105
+
  106
+/* string.c */
  107
+int rb_str_buf_cat_escaped_char(VALUE result, unsigned int c, int unicode_p);
  108
+
  109
+/* struct.c */
  110
+VALUE rb_struct_init_copy(VALUE copy, VALUE s);
  111
+
  112
+/* time.c */
  113
+struct timespec rb_time_timespec(VALUE time);
  114
+struct timeval rb_time_timeval(VALUE);
  115
+struct timeval rb_time_interval(VALUE);
  116
+
  117
+/* thread.c */
  118
+VALUE rb_obj_is_mutex(VALUE obj);
  119
+VALUE ruby_suppress_tracing(VALUE (*func)(VALUE, int), VALUE arg, int always);
33 120
 void rb_thread_execute_interrupts(VALUE th);
34 121
 void *rb_thread_call_with_gvl(void *(*func)(void *), void *data1);
  122
+void rb_clear_trace_func(void);
  123
+VALUE rb_thread_backtrace(VALUE thval);
  124
+
  125
+/* thread_pthread.c, thread_win32.c */
  126
+void Init_native_thread(void);
  127
+
  128
+/* variable.c */
  129
+VALUE rb_f_trace_var(int argc, VALUE *argv);
  130
+VALUE rb_f_untrace_var(int argc, VALUE *argv);
  131
+
  132
+/* vm.c */
  133
+VALUE rb_obj_is_thread(VALUE obj);
  134
+void rb_vm_mark(void *ptr);
  135
+void Init_BareVM(void);
  136
+VALUE rb_vm_top_self(void);
  137
+void rb_thread_recycle_stack_release(VALUE *);
  138
+void rb_vm_change_state(void);
  139
+void rb_vm_inc_const_missing_count(void);
  140
+void rb_thread_mark(void *th);
  141
+
  142
+/* vm_dump.c */
  143
+void rb_vm_bugreport(void);
  144
+
  145
+/* vm_eval.c */
  146
+VALUE rb_funcall_passing_block(VALUE recv, ID mid, int argc, const VALUE *argv);
  147
+
  148
+/* miniprelude.c, prelude.c */
  149
+void Init_prelude(void);
35 150
 
36 151
 #if defined(__cplusplus)
37 152
 #if 0
4  io.c
@@ -82,8 +82,6 @@
82 82
 #include <sys/syscall.h>
83 83
 #endif
84 84
 
85  
-extern void Init_File(void);
86  
-
87 85
 #if defined(__BEOS__) || defined(__HAIKU__)
88 86
 # ifndef NOFILE
89 87
 #  define NOFILE (OPEN_MAX)
@@ -142,8 +140,6 @@ static ID id_write, id_read, id_getc, id_flush, id_readpartial, id_set_encoding;
142 140
 static VALUE sym_mode, sym_perm, sym_extenc, sym_intenc, sym_encoding, sym_open_args;
143 141
 static VALUE sym_textmode, sym_binmode, sym_autoclose;
144 142
 
145  
-struct timeval rb_time_interval(VALUE);
146  
-
147 143
 struct argf {
148 144
     VALUE filename, current_file;
149 145
     long last_lineno;		/* $. */
3  iseq.c
@@ -10,6 +10,7 @@
10 10
 **********************************************************************/
11 11
 
12 12
 #include "ruby/ruby.h"
  13
+#include "internal.h"
13 14
 
14 15
 /* #define RUBY_MARK_FREE_DEBUG 1 */
15 16
 #include "gc.h"
@@ -217,8 +218,6 @@ set_relation(rb_iseq_t *iseq, const VALUE parent)
217 218
     }
218 219
 }
219 220
 
220  
-VALUE rb_realpath_internal(VALUE basedir, VALUE path, int strict);
221  
-
222 221
 static VALUE
223 222
 prepare_iseq_build(rb_iseq_t *iseq,
224 223
 		   VALUE name, VALUE filename, VALUE filepath, VALUE line_no,
1  iseq.h
@@ -24,6 +24,7 @@ VALUE rb_iseq_build_from_ary(rb_iseq_t *iseq, VALUE locals, VALUE args,
24 24
 
25 25
 /* iseq.c */
26 26
 VALUE rb_iseq_load(VALUE data, VALUE parent, VALUE opt);
  27
+VALUE rb_iseq_parameters(const rb_iseq_t *iseq, int is_proc);
27 28
 struct st_table *ruby_insn_make_insn_table(void);
28 29
 
29 30
 struct rb_compile_option_struct {
2  load.c
@@ -4,6 +4,7 @@
4 4
 
5 5
 #include "ruby/ruby.h"
6 6
 #include "ruby/util.h"
  7
+#include "internal.h"
7 8
 #include "dln.h"
8 9
 #include "eval_intern.h"
9 10
 
@@ -267,7 +268,6 @@ rb_provide(const char *feature)
267 268
 }
268 269
 
269 270
 NORETURN(static void load_failed(VALUE));
270  
-VALUE rb_realpath_internal(VALUE basedir, VALUE path, int strict);
271 271
 
272 272
 static void
273 273
 rb_load_internal(VALUE fname, int wrap)
2  marshal.c
@@ -83,8 +83,6 @@ static ID s_dump, s_load, s_mdump, s_mload;
83 83
 static ID s_dump_data, s_load_data, s_alloc, s_call;
84 84
 static ID s_getbyte, s_read, s_write, s_binmode;
85 85
 
86  
-ID rb_id_encoding(void);
87  
-
88 86
 typedef struct {
89 87
     VALUE newclass;
90 88
     VALUE oldclass;
2  math.c
@@ -10,6 +10,7 @@
10 10
 **********************************************************************/
11 11
 
12 12
 #include "ruby/ruby.h"
  13
+#include "internal.h"
13 14
 #include <math.h>
14 15
 #include <errno.h>
15 16
 
@@ -18,7 +19,6 @@
18 19
 VALUE rb_mMath;
19 20
 VALUE rb_eMathDomainError;
20 21
 
21  
-extern VALUE rb_to_float(VALUE val);
22 22
 #define Need_Float(x) do {if (TYPE(x) != T_FLOAT) {(x) = rb_to_float(x);}} while(0)
23 23
 #define Need_Float2(x,y) do {\
24 24
     Need_Float(x);\
3  node.h
@@ -457,6 +457,9 @@ VALUE rb_parser_end_seen_p(VALUE);
457 457
 VALUE rb_parser_encoding(VALUE);
458 458
 VALUE rb_parser_get_yydebug(VALUE);
459 459
 VALUE rb_parser_set_yydebug(VALUE, VALUE);
  460
+VALUE rb_parser_dump_tree(NODE *node, int comment);
  461
+NODE *rb_parser_append_print(VALUE, NODE *);
  462
+NODE *rb_parser_while_loop(VALUE, NODE *, int, int);
460 463
 
461 464
 NODE *rb_parser_compile_cstr(volatile VALUE, const char*, const char*, int, int);
462 465
 NODE *rb_parser_compile_string(volatile VALUE, const char*, VALUE, int);
4  numeric.c
@@ -2445,8 +2445,6 @@ fixdivmod(long x, long y, long *divp, long *modp)
2445 2445
     if (modp) *modp = mod;
2446 2446
 }
2447 2447
 
2448  
-VALUE rb_big_fdiv(VALUE x, VALUE y);
2449  
-
2450 2448
 /*
2451 2449
  *  call-seq:
2452 2450
  *     fix.fdiv(numeric)  ->  float
@@ -2475,8 +2473,6 @@ fix_fdiv(VALUE x, VALUE y)
2475 2473
     }
2476 2474
 }
2477 2475
 
2478  
-VALUE rb_rational_reciprocal(VALUE x);
2479  
-
2480 2476
 static VALUE
2481 2477
 fix_divide(VALUE x, VALUE y, ID op)
2482 2478
 {
5  object.c
@@ -1838,11 +1838,6 @@ rb_mod_const_defined(int argc, VALUE *argv, VALUE mod)
1838 1838
     return RTEST(recur) ? rb_const_defined(mod, id) : rb_const_defined_at(mod, id);
1839 1839
 }
1840 1840
 
1841  
-VALUE rb_obj_methods(int argc, VALUE *argv, VALUE obj); /* in class.c */
1842  
-VALUE rb_obj_protected_methods(int argc, VALUE *argv, VALUE obj); /* in class.c */
1843  
-VALUE rb_obj_private_methods(int argc, VALUE *argv, VALUE obj); /* in class.c */
1844  
-VALUE rb_obj_public_methods(int argc, VALUE *argv, VALUE obj); /* in class.c */
1845  
-
1846 1841
 /*
1847 1842
  *  call-seq:
1848 1843
  *     obj.instance_variable_get(symbol)    -> obj
11  parse.y
@@ -18,6 +18,7 @@
18 18
 #include "ruby/ruby.h"
19 19
 #include "ruby/st.h"
20 20
 #include "ruby/encoding.h"
  21
+#include "internal.h"
21 22
 #include "node.h"
22 23
 #include "parse.h"
23 24
 #include "id.h"
@@ -404,11 +405,6 @@ static ID  *local_tbl_gen(struct parser_params*);
404 405
 
405 406
 static void fixup_nodes(NODE **);
406 407
 
407  
-extern int rb_dvar_defined(ID);
408  
-extern int rb_local_defined(ID);
409  
-extern int rb_parse_in_eval(void);
410  
-extern int rb_parse_in_main(void);
411  
-
412 408
 static VALUE reg_compile_gen(struct parser_params*, VALUE, int);
413 409
 #define reg_compile(str,options) reg_compile_gen(parser, (str), (options))
414 410
 static void reg_fragment_setenc_gen(struct parser_params*, VALUE, int);
@@ -5095,8 +5091,6 @@ parser_yyerror(struct parser_params *parser, const char *msg)
5095 5091
 static void parser_prepare(struct parser_params *parser);
5096 5092
 
5097 5093
 #ifndef RIPPER
5098  
-VALUE ruby_suppress_tracing(VALUE (*func)(VALUE, int), VALUE arg, int always);
5099  
-
5100 5094
 static VALUE
5101 5095
 debug_lines(const char *f)
5102 5096
 {
@@ -9213,9 +9207,6 @@ dvar_curr_gen(struct parser_params *parser, ID id)
9213 9207
 }
9214 9208
 
9215 9209
 #ifndef RIPPER
9216  
-VALUE rb_reg_compile(VALUE str, int options, const char *sourcefile, int sourceline);
9217  
-VALUE rb_reg_check_preprocess(VALUE);
9218  
-
9219 9210
 static void
9220 9211
 reg_fragment_setenc_gen(struct parser_params* parser, VALUE str, int options)
9221 9212
 {
3  proc.c
@@ -12,6 +12,7 @@
12 12
 #include "eval_intern.h"
13 13
 #include "internal.h"
14 14
 #include "gc.h"
  15
+#include "iseq.h"
15 16
 
16 17
 struct METHOD {
17 18
     VALUE recv;
@@ -25,8 +26,6 @@ VALUE rb_cMethod;
25 26
 VALUE rb_cBinding;
26 27
 VALUE rb_cProc;
27 28
 
28  
-VALUE rb_iseq_parameters(const rb_iseq_t *iseq, int is_proc);
29  
-
30 29
 static VALUE bmcall(VALUE, VALUE);
31 30
 static int method_arity(VALUE);
32 31
 rb_iseq_t *rb_method_get_iseq(VALUE method);
6  process.c
@@ -14,6 +14,7 @@
14 14
 #include "ruby/ruby.h"
15 15
 #include "ruby/io.h"
16 16
 #include "ruby/util.h"
  17
+#include "internal.h"
17 18
 #include "vm_core.h"
18 19
 
19 20
 #include <stdio.h>
@@ -39,8 +40,6 @@
39 40
 #define EXIT_FAILURE 1
40 41
 #endif
41 42
 
42  
-struct timeval rb_time_interval(VALUE);
43  
-
44 43
 #ifdef HAVE_SYS_WAIT_H
45 44
 # include <sys/wait.h>
46 45
 #endif
@@ -126,9 +125,6 @@ static VALUE rb_cProcessTms;
126 125
 	do {int saved_errno = errno; stmts; errno = saved_errno;} while (0)
127 126
 
128 127
 
129  
-ssize_t rb_io_bufwrite(VALUE io, const void *buf, size_t size);
130  
-ssize_t rb_io_bufread(VALUE io, void *buf, size_t size);
131  
-
132 128
 /*
133 129
  *  call-seq:
134 130
  *     Process.pid   -> fixnum
3  range.c
@@ -11,12 +11,11 @@
11 11
 
12 12
 #include "ruby/ruby.h"
13 13
 #include "ruby/encoding.h"
  14
+#include "internal.h"
14 15
 
15 16
 VALUE rb_cRange;
16 17
 static ID id_cmp, id_succ, id_beg, id_end, id_excl;
17 18
 
18  
-extern VALUE rb_struct_init_copy(VALUE copy, VALUE s);
19  
-
20 19
 #define RANGE_BEG(r) (RSTRUCT(r)->as.ary[0])
21 20
 #define RANGE_END(r) (RSTRUCT(r)->as.ary[1])
22 21
 #define RANGE_EXCL(r) (RSTRUCT(r)->as.ary[2])
1  rational.c
@@ -6,6 +6,7 @@
6 6
 */
7 7
 
8 8
 #include "ruby.h"
  9
+#include "internal.h"
9 10
 #include <math.h>
10 11
 #include <float.h>
11 12
 
3  re.c
@@ -13,6 +13,7 @@
13 13
 #include "ruby/re.h"
14 14
 #include "ruby/encoding.h"
15 15
 #include "ruby/util.h"
  16
+#include "internal.h"
16 17
 #include "regint.h"
17 18
 #include <ctype.h>
18 19
 
@@ -314,8 +315,6 @@ rb_reg_check(VALUE re)
314 315
     }
315 316
 }
316 317
 
317  
-int rb_str_buf_cat_escaped_char(VALUE result, unsigned int c, int unicode_p);
318  
-
319 318
 static void
320 319
 rb_reg_expr_str(VALUE str, const char *s, long len,
321 320
 	rb_encoding *enc, rb_encoding *resenc)
19  ruby.c
@@ -17,6 +17,7 @@
17 17
 #endif
18 18
 #include "ruby/ruby.h"
19 19
 #include "ruby/encoding.h"
  20
+#include "internal.h"
20 21
 #include "eval_intern.h"
21 22
 #include "dln.h"
22 23
 #include <stdio.h>
@@ -51,12 +52,6 @@
51 52
 char *getenv();
52 53
 #endif
53 54
 
54  
-VALUE rb_parser_get_yydebug(VALUE);
55  
-VALUE rb_parser_set_yydebug(VALUE, VALUE);
56  
-
57  
-const char *ruby_get_inplace_mode(void);
58  
-void ruby_set_inplace_mode(const char *);
59  
-
60 55
 #define DISABLE_BIT(bit) (1U << disable_##bit)
61 56
 enum disable_flag_bits {
62 57
     disable_gems,
@@ -377,7 +372,6 @@ ruby_init_loadpath_safe(int safe_level)
377 372
 #elif defined(HAVE_DLADDR)
378 373
     Dl_info dli;
379 374
     if (dladdr((void *)(VALUE)expand_include_path, &dli)) {
380  
-	VALUE rb_realpath_internal(VALUE basedir, VALUE path, int strict);
381 375
 	char fbuf[MAXPATHLEN];
382 376
 	char *f = dln_find_file_r(dli.dli_fname, getenv(PATH_ENV), fbuf, sizeof(fbuf));
383 377
 	VALUE fname = rb_str_new_cstr(f ? f : dli.dli_fname);
@@ -477,9 +471,6 @@ add_modules(VALUE *req_list, const char *mod)
477 471
     rb_ary_push(list, rb_obj_freeze(rb_str_new2(mod)));
478 472
 }
479 473
 
480  
-extern void Init_ext(void);
481  
-extern VALUE rb_vm_top_self(void);
482  
-
483 474
 static void
484 475
 require_libraries(VALUE *req_list)
485 476
 {
@@ -568,8 +559,6 @@ process_sflag(int *sflag)
568 559
     }
569 560
 }
570 561
 
571  
-NODE *rb_parser_append_print(VALUE, NODE *);
572  
-NODE *rb_parser_while_loop(VALUE, NODE *, int, int);
573 562
 static long proc_options(long argc, char **argv, struct cmdline_options *opt, int envopt);
574 563
 
575 564
 static void
@@ -1101,8 +1090,6 @@ proc_options(long argc, char **argv, struct cmdline_options *opt, int envopt)
1101 1090
     return argc0 - argc;
1102 1091
 }
1103 1092
 
1104  
-void Init_prelude(void);
1105  
-
1106 1093
 static void
1107 1094
 ruby_init_prelude(void)
1108 1095
 {
@@ -1237,10 +1224,6 @@ rb_f_chomp(argc, argv)
1237 1224
     return str;
1238 1225
 }
1239 1226
 
1240  
-void rb_stdio_set_default_encoding(void);
1241  
-VALUE rb_parser_dump_tree(NODE *node, int comment);
1242  
-VALUE rb_realpath_internal(VALUE basedir, VALUE path, int strict);
1243  
-
1244 1227
 static VALUE
1245 1228
 process_options(int argc, char **argv, struct cmdline_options *opt)
1246 1229
 {
5  string.c
@@ -14,6 +14,7 @@
14 14
 #include "ruby/ruby.h"
15 15
 #include "ruby/re.h"
16 16
 #include "ruby/encoding.h"
  17
+#include "internal.h"
17 18
 #include <assert.h>
18 19
 
19 20
 #define BEG(no) (regs->beg[(no)])
@@ -2053,8 +2054,6 @@ rb_str_append(VALUE str, VALUE str2)
2053 2054
     return rb_str_buf_append(str, str2);
2054 2055
 }
2055 2056
 
2056  
-int rb_num_to_uint(VALUE val, unsigned int *ret);
2057  
-
2058 2057
 /*
2059 2058
  *  call-seq:
2060 2059
  *     str << integer       -> str
@@ -7459,8 +7458,6 @@ sym_to_sym(VALUE sym)
7459 7458
     return sym;
7460 7459
 }
7461 7460
 
7462  
-VALUE rb_funcall_passing_block(VALUE recv, ID mid, int argc, const VALUE *argv);
7463  
-
7464 7461
 static VALUE
7465 7462
 sym_call(VALUE args, VALUE sym, int argc, VALUE *argv)
7466 7463
 {
9  thread.c
@@ -66,7 +66,6 @@ static void sleep_timeval(rb_thread_t *th, struct timeval time);
66 66
 static void sleep_wait_for_interrupt(rb_thread_t *th, double sleepsec);
67 67
 static void sleep_forever(rb_thread_t *th, int nodeadlock);
68 68
 static double timeofday(void);
69  
-struct timeval rb_time_interval(VALUE);
70 69
 static int rb_threadptr_dead(rb_thread_t *th);
71 70
 
72 71
 static void rb_check_deadlock(rb_vm_t *vm);
@@ -409,7 +408,6 @@ thread_cleanup_func(void *th_ptr, int atfork)
409 408
 
410 409
 extern void ruby_error_print(void);
411 410
 static VALUE rb_threadptr_raise(rb_thread_t *, int, VALUE *);
412  
-void rb_thread_recycle_stack_release(VALUE *);
413 411
 
414 412
 void
415 413
 ruby_thread_init_stack(rb_thread_t *th)
@@ -997,8 +995,6 @@ rb_thread_interrupted(VALUE thval)
997 995
     return RUBY_VM_INTERRUPTED(th);
998 996
 }
999 997
 
1000  
-struct timeval rb_time_timeval(VALUE);
1001  
-
1002 998
 void
1003 999
 rb_thread_sleep(int sec)
1004 1000
 {
@@ -2951,8 +2947,6 @@ rb_gc_save_machine_context(rb_thread_t *th)
2951 2947
  *
2952 2948
  */
2953 2949
 
2954  
-int rb_get_next_signal(void);
2955  
-
2956 2950
 void
2957 2951
 rb_threadptr_check_signal(rb_thread_t *mth)
2958 2952
 {
@@ -4024,7 +4018,6 @@ enum {
4024 4018
 };
4025 4019
 
4026 4020
 static VALUE thread_suppress_tracing(rb_thread_t *th, int ev, VALUE (*func)(VALUE, int), VALUE arg, int always);
4027  
-VALUE ruby_suppress_tracing(VALUE (*func)(VALUE, int), VALUE arg, int always);
4028 4021
 
4029 4022
 struct event_call_args {
4030 4023
     rb_thread_t *th;
@@ -4562,8 +4555,6 @@ thread_suppress_tracing(rb_thread_t *th, int ev, VALUE (*func)(VALUE, int), VALU
4562 4555
     return result;
4563 4556
 }
4564 4557
 
4565  
-VALUE rb_thread_backtrace(VALUE thval);
4566  
-
4567 4558
 /*
4568 4559
  *  call-seq:
4569 4560
  *     thr.backtrace    -> array
1  time.c
@@ -14,6 +14,7 @@
14 14
 #include <time.h>
15 15
 #include <errno.h>
16 16
 #include "ruby/encoding.h"
  17
+#include "internal.h"
17 18
 
18 19
 #ifdef HAVE_UNISTD_H
19 20
 #include <unistd.h>
3  tool/compile_prelude.rb
@@ -83,6 +83,7 @@ def emit(outfile)
83 83
  sources: <%= @preludes.map {|n,*| prelude_base(n)}.join(', ') %>
84 84
 */
85 85
 #include "ruby/ruby.h"
  86
+#include "internal.h"
86 87
 #include "vm_core.h"
87 88
 
88 89
 % preludes = @preludes.values.sort
@@ -115,8 +116,6 @@ def emit(outfile)
115 116
 % end
116 117
 
117 118
 % unless preludes.empty?
118  
-VALUE rb_iseq_compile_with_option(VALUE src, VALUE file, VALUE filepath, VALUE line, VALUE opt);
119  
-
120 119
 static void
121 120
 prelude_eval(VALUE code, VALUE name, VALUE line)
122 121
 {
3  transcode.c
@@ -11,6 +11,7 @@
11 11
 
12 12
 #include "ruby/ruby.h"
13 13
 #include "ruby/encoding.h"
  14
+#include "internal.h"
14 15
 #include "transcode_data.h"
15 16
 #include <ctype.h>
16 17
 
@@ -4299,8 +4300,6 @@ ecerr_incomplete_input(VALUE self)
4299 4300
     return rb_attr_get(self, rb_intern("incomplete_input"));
4300 4301
 }
4301 4302
 
4302  
-extern void Init_newline(void);
4303  
-
4304 4303
 /*
4305 4304
  *  Document-class: Encoding::UndefinedConversionError
4306 4305
  *
3  variable.c
@@ -19,9 +19,6 @@
19 19
 #include "constant.h"
20 20
 #include "internal.h"
21 21
 
22  
-void rb_vm_change_state(void);
23  
-void rb_vm_inc_const_missing_count(void);
24  
-
25 22
 st_table *rb_global_tbl;
26 23
 st_table *rb_class_tbl;
27 24
 static ID autoload, classpath, tmp_classpath, classid;
8  vm.c
@@ -12,6 +12,7 @@
12 12
 #include "ruby/vm.h"
13 13
 #include "ruby/st.h"
14 14
 #include "ruby/encoding.h"
  15
+#include "internal.h"
15 16
 
16 17
 #include "gc.h"
17 18
 #include "vm_core.h"
@@ -1662,8 +1663,6 @@ thread_recycle_struct(void)
1662 1663
 }
1663 1664
 #endif
1664 1665
 
1665  
-void rb_gc_mark_machine_stack(rb_thread_t *th);
1666  
-
1667 1666
 void
1668 1667
 rb_thread_mark(void *ptr)
1669 1668
 {
@@ -1866,8 +1865,6 @@ rb_thread_alloc(VALUE klass)
1866 1865
     return self;
1867 1866
 }
1868 1867
 
1869  
-VALUE rb_iseq_clone(VALUE iseqval, VALUE newcbase);
1870  
-
1871 1868
 static void
1872 1869
 vm_define_method(rb_thread_t *th, VALUE obj, ID id, VALUE iseqval,
1873 1870
 		 rb_num_t is_singleton, NODE *cref)
@@ -2151,9 +2148,6 @@ rb_vm_set_progname(VALUE filename)
2151 2148
 #if defined(ENABLE_VM_OBJSPACE) && ENABLE_VM_OBJSPACE
2152 2149
 struct rb_objspace *rb_objspace_alloc(void);
2153 2150
 #endif
2154  
-void ruby_thread_init_stack(rb_thread_t *th);
2155  
-
2156  
-extern void Init_native_thread(void);
2157 2151
 
2158 2152
 void
2159 2153
 Init_BareVM(void)
3  vm_core.h
@@ -658,8 +658,11 @@ int rb_backtrace_each(rb_backtrace_iter_func *iter, void *arg);
658 658
 rb_control_frame_t *rb_vm_get_ruby_level_next_cfp(rb_thread_t *th, rb_control_frame_t *cfp);
659 659
 int rb_vm_get_sourceline(const rb_control_frame_t *);
660 660
 VALUE rb_name_err_mesg_new(VALUE obj, VALUE mesg, VALUE recv, VALUE method);
  661
+void rb_vm_stack_to_heap(rb_thread_t *th);
  662
+void ruby_thread_init_stack(rb_thread_t *th);
661 663
 
662 664
 NOINLINE(void rb_gc_save_machine_context(rb_thread_t *));
  665
+void rb_gc_mark_machine_stack(rb_thread_t *th);
663 666
 
664 667
 #define sysstack_error GET_VM()->special_exceptions[ruby_error_sysstack]
665 668
 

0 notes on commit e7996eb

Please sign in to comment.
Something went wrong with that request. Please try again.