зеркало из https://github.com/github/ruby.git
* 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
This commit is contained in:
Родитель
aba879a3f0
Коммит
e7996eb3cc
23
ChangeLog
23
ChangeLog
|
@ -1,3 +1,26 @@
|
|||
Sat Jun 18 07:27:27 2011 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* 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.
|
||||
|
||||
Sat Jun 18 02:36:00 2011 Kenta Murata <mrkn@mrkn.jp>
|
||||
|
||||
* ext/bigdecimal/bigdecimal.c (VpNewRbClass): fix type of the 2nd
|
||||
|
|
1
bignum.c
1
bignum.c
|
@ -11,6 +11,7 @@
|
|||
|
||||
#include "ruby/ruby.h"
|
||||
#include "ruby/util.h"
|
||||
#include "internal.h"
|
||||
|
||||
#include <math.h>
|
||||
#include <float.h>
|
||||
|
|
2
class.c
2
class.c
|
@ -120,8 +120,6 @@ rb_class_new(VALUE super)
|
|||
return rb_class_boot(super);
|
||||
}
|
||||
|
||||
VALUE rb_iseq_clone(VALUE iseqval, VALUE newcbase);
|
||||
|
||||
static void
|
||||
rb_mod_clone_method(VALUE klass, ID mid, const rb_method_entry_t *me)
|
||||
{
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
**********************************************************************/
|
||||
|
||||
#include "ruby/ruby.h"
|
||||
#include "internal.h"
|
||||
#include <math.h>
|
||||
|
||||
#define USE_INSN_STACK_INCREASE 1
|
||||
|
@ -155,7 +156,6 @@ r_value(VALUE value)
|
|||
#endif
|
||||
|
||||
#if CPDEBUG > 1 || CPDEBUG < 0
|
||||
PRINTF_ARGS(void ruby_debug_printf(const char*, ...), 1, 2);
|
||||
#define debugs if (compile_debug_print_indent(1)) ruby_debug_printf
|
||||
#define debug_compile(msg, v) ((void)(compile_debug_print_indent(1) && fputs((msg), stderr)), (v))
|
||||
#else
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
*/
|
||||
|
||||
#include "ruby.h"
|
||||
#include "internal.h"
|
||||
#include <math.h>
|
||||
|
||||
#define NDEBUG
|
||||
|
@ -508,8 +509,6 @@ imp2(hypot)
|
|||
|
||||
#define m_hypot(x,y) m_hypot_bang((x),(y))
|
||||
|
||||
extern VALUE rb_math_log(int argc, VALUE *argv);
|
||||
|
||||
static VALUE
|
||||
m_log_bang(VALUE x)
|
||||
{
|
||||
|
@ -1092,8 +1091,6 @@ nucomp_inexact_p(VALUE self)
|
|||
}
|
||||
#endif
|
||||
|
||||
extern VALUE rb_lcm(VALUE x, VALUE y);
|
||||
|
||||
/*
|
||||
* call-seq:
|
||||
* cmp.denominator -> integer
|
||||
|
|
4
cont.c
4
cont.c
|
@ -10,6 +10,7 @@
|
|||
**********************************************************************/
|
||||
|
||||
#include "ruby/ruby.h"
|
||||
#include "internal.h"
|
||||
#include "vm_core.h"
|
||||
#include "gc.h"
|
||||
#include "eval_intern.h"
|
||||
|
@ -126,7 +127,6 @@ static VALUE rb_eFiberError;
|
|||
|
||||
NOINLINE(static VALUE cont_capture(volatile int *stat));
|
||||
|
||||
void rb_thread_mark(rb_thread_t *th);
|
||||
#define THREAD_MUST_BE_RUNNING(th) do { \
|
||||
if (!(th)->tag) rb_raise(rb_eThreadError, "not running thread"); \
|
||||
} while (0)
|
||||
|
@ -409,8 +409,6 @@ cont_new(VALUE klass)
|
|||
return cont;
|
||||
}
|
||||
|
||||
void rb_vm_stack_to_heap(rb_thread_t *th);
|
||||
|
||||
static VALUE
|
||||
cont_capture(volatile int *stat)
|
||||
{
|
||||
|
|
3
dir.c
3
dir.c
|
@ -13,6 +13,7 @@
|
|||
|
||||
#include "ruby/ruby.h"
|
||||
#include "ruby/encoding.h"
|
||||
#include "internal.h"
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
|
@ -1996,8 +1997,6 @@ file_s_fnmatch(int argc, VALUE *argv, VALUE obj)
|
|||
return Qfalse;
|
||||
}
|
||||
|
||||
VALUE rb_home_dir(const char *user, VALUE result);
|
||||
|
||||
/*
|
||||
* call-seq:
|
||||
* Dir.home() -> "/home/me"
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
|
||||
#include "ruby/ruby.h"
|
||||
#include "ruby/encoding.h"
|
||||
#include "internal.h"
|
||||
#include "regenc.h"
|
||||
#include <ctype.h>
|
||||
#ifndef NO_LOCALE_CHARMAP
|
||||
|
|
|
@ -1018,8 +1018,6 @@ generator_init(VALUE obj, VALUE proc)
|
|||
return obj;
|
||||
}
|
||||
|
||||
VALUE rb_obj_is_proc(VALUE proc);
|
||||
|
||||
/* :nodoc: */
|
||||
static VALUE
|
||||
generator_initialize(int argc, VALUE *argv, VALUE obj)
|
||||
|
|
3
error.c
3
error.c
|
@ -12,6 +12,7 @@
|
|||
#include "ruby/ruby.h"
|
||||
#include "ruby/st.h"
|
||||
#include "ruby/encoding.h"
|
||||
#include "internal.h"
|
||||
#include "vm_core.h"
|
||||
|
||||
#include <stdio.h>
|
||||
|
@ -230,8 +231,6 @@ rb_warn_m(VALUE self, VALUE mesg)
|
|||
return Qnil;
|
||||
}
|
||||
|
||||
void rb_vm_bugreport(void);
|
||||
|
||||
static void
|
||||
report_bug(const char *file, int line, const char *fmt, va_list args)
|
||||
{
|
||||
|
|
12
eval.c
12
eval.c
|
@ -16,6 +16,7 @@
|
|||
#include "gc.h"
|
||||
#include "ruby/vm.h"
|
||||
#include "ruby/encoding.h"
|
||||
#include "internal.h"
|
||||
#include "vm_core.h"
|
||||
|
||||
#define numberof(array) (int)(sizeof(array) / sizeof((array)[0]))
|
||||
|
@ -35,12 +36,6 @@ VALUE rb_eSysStackError;
|
|||
|
||||
/* initialize ruby */
|
||||
|
||||
void rb_clear_trace_func(void);
|
||||
|
||||
void rb_call_inits(void);
|
||||
void Init_heap(void);
|
||||
void Init_BareVM(void);
|
||||
|
||||
void
|
||||
ruby_init(void)
|
||||
{
|
||||
|
@ -69,8 +64,6 @@ ruby_init(void)
|
|||
GET_VM()->running = 1;
|
||||
}
|
||||
|
||||
extern void rb_clear_trace_func(void);
|
||||
|
||||
void *
|
||||
ruby_options(int argc, char **argv)
|
||||
{
|
||||
|
@ -1053,9 +1046,6 @@ top_include(int argc, VALUE *argv, VALUE self)
|
|||
return rb_mod_include(argc, argv, rb_cObject);
|
||||
}
|
||||
|
||||
VALUE rb_f_trace_var();
|
||||
VALUE rb_f_untrace_var();
|
||||
|
||||
static VALUE *
|
||||
errinfo_place(rb_thread_t *th)
|
||||
{
|
||||
|
|
5
file.c
5
file.c
|
@ -23,6 +23,7 @@
|
|||
#include "ruby/io.h"
|
||||
#include "ruby/util.h"
|
||||
#include "dln.h"
|
||||
#include "internal.h"
|
||||
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
|
@ -2203,8 +2204,6 @@ rb_file_s_lchown(int argc, VALUE *argv)
|
|||
#define rb_file_s_lchown rb_f_notimplement
|
||||
#endif
|
||||
|
||||
struct timespec rb_time_timespec(VALUE time);
|
||||
|
||||
struct utime_args {
|
||||
const struct timespec* tsp;
|
||||
VALUE atime, mtime;
|
||||
|
@ -5088,8 +5087,6 @@ is_explicit_relative(const char *path)
|
|||
return isdirsep(*path);
|
||||
}
|
||||
|
||||
VALUE rb_get_load_path(void);
|
||||
|
||||
static VALUE
|
||||
copy_path_class(VALUE path, VALUE orig)
|
||||
{
|
||||
|
|
6
gc.c
6
gc.c
|
@ -50,8 +50,6 @@
|
|||
# define VALGRIND_MAKE_MEM_UNDEFINED(p, n) /* empty */
|
||||
#endif
|
||||
|
||||
int rb_io_fptr_finalize(struct rb_io_t*);
|
||||
|
||||
#define rb_setjmp(env) RUBY_SETJMP(env)
|
||||
#define rb_jmp_buf rb_jmpbuf_t
|
||||
|
||||
|
@ -2364,8 +2362,6 @@ obj_free(rb_objspace_t *objspace, VALUE obj)
|
|||
|
||||
#define GC_NOTIFY 0
|
||||
|
||||
void rb_vm_mark(void *ptr);
|
||||
|
||||
#if STACK_GROW_DIRECTION < 0
|
||||
#define GET_STACK_BOUNDS(start, end, appendix) ((start) = STACK_END, (end) = STACK_START)
|
||||
#elif STACK_GROW_DIRECTION > 0
|
||||
|
@ -2406,8 +2402,6 @@ mark_current_machine_context(rb_objspace_t *objspace, rb_thread_t *th)
|
|||
#endif
|
||||
}
|
||||
|
||||
void rb_gc_mark_encodings(void);
|
||||
|
||||
static void
|
||||
gc_clear_mark_on_sweep_slots(rb_objspace_t *objspace)
|
||||
{
|
||||
|
|
2
hash.c
2
hash.c
|
@ -690,8 +690,6 @@ rb_hash_default_proc(VALUE hash)
|
|||
return Qnil;
|
||||
}
|
||||
|
||||
VALUE rb_obj_is_proc(VALUE proc);
|
||||
|
||||
/*
|
||||
* call-seq:
|
||||
* hsh.default_proc = proc_obj -> proc_obj
|
||||
|
|
1
inits.c
1
inits.c
|
@ -10,6 +10,7 @@
|
|||
**********************************************************************/
|
||||
|
||||
#include "ruby/ruby.h"
|
||||
#include "internal.h"
|
||||
|
||||
#define CALL(n) {void Init_##n(void); Init_##n();}
|
||||
|
||||
|
|
119
internal.h
119
internal.h
|
@ -25,13 +25,128 @@ struct rb_classext_struct {
|
|||
struct st_table *const_tbl;
|
||||
};
|
||||
|
||||
/* bignum.c */
|
||||
VALUE rb_big_fdiv(VALUE x, VALUE y);
|
||||
VALUE rb_big_uminus(VALUE x);
|
||||
|
||||
VALUE rb_obj_is_thread(VALUE obj);
|
||||
VALUE rb_obj_is_mutex(VALUE obj);
|
||||
/* class.c */
|
||||
VALUE rb_obj_methods(int argc, VALUE *argv, VALUE obj);
|
||||
VALUE rb_obj_protected_methods(int argc, VALUE *argv, VALUE obj);
|
||||
VALUE rb_obj_private_methods(int argc, VALUE *argv, VALUE obj);
|
||||
VALUE rb_obj_public_methods(int argc, VALUE *argv, VALUE obj);
|
||||
|
||||
/* compile.c */
|
||||
int rb_dvar_defined(ID);
|
||||
int rb_local_defined(ID);
|
||||
int rb_parse_in_eval(void);
|
||||
int rb_parse_in_main(void);
|
||||
|
||||
/* debug.c */
|
||||
PRINTF_ARGS(void ruby_debug_printf(const char*, ...), 1, 2);
|
||||
|
||||
/* dmyext.c */
|
||||
void Init_ext(void);
|
||||
|
||||
/* encoding.c */
|
||||
ID rb_id_encoding(void);
|
||||
|
||||
/* encoding.c */
|
||||
void rb_gc_mark_encodings(void);
|
||||
|
||||
/* file.c */
|
||||
VALUE rb_home_dir(const char *user, VALUE result);
|
||||
VALUE rb_realpath_internal(VALUE basedir, VALUE path, int strict);
|
||||
void Init_File(void);
|
||||
|
||||
/* gc.c */
|
||||
void Init_heap(void);
|
||||
|
||||
/* inits.c */
|
||||
void rb_call_inits(void);
|
||||
|
||||
/* io.c */
|
||||
const char *ruby_get_inplace_mode(void);
|
||||
void ruby_set_inplace_mode(const char *);
|
||||
int rb_io_fptr_finalize(struct rb_io_t*);
|
||||
ssize_t rb_io_bufwrite(VALUE io, const void *buf, size_t size);
|
||||
ssize_t rb_io_bufread(VALUE io, void *buf, size_t size);
|
||||
void rb_stdio_set_default_encoding(void);
|
||||
|
||||
/* iseq.c */
|
||||
VALUE rb_iseq_compile_with_option(VALUE src, VALUE file, VALUE filepath, VALUE line, VALUE opt);
|
||||
VALUE rb_iseq_clone(VALUE iseqval, VALUE newcbase);
|
||||
|
||||
/* load.c */
|
||||
VALUE rb_get_load_path(void);
|
||||
|
||||
/* math.c */
|
||||
VALUE rb_math_log(int argc, VALUE *argv);
|
||||
|
||||
/* newline.c */
|
||||
void Init_newline(void);
|
||||
|
||||
/* numeric.c */
|
||||
VALUE rb_rational_reciprocal(VALUE x);
|
||||
int rb_num_to_uint(VALUE val, unsigned int *ret);
|
||||
|
||||
/* parse.y */
|
||||
VALUE rb_parser_get_yydebug(VALUE);
|
||||
VALUE rb_parser_set_yydebug(VALUE, VALUE);
|
||||
|
||||
/* rational.c */
|
||||
VALUE rb_lcm(VALUE x, VALUE y);
|
||||
|
||||
/* re.c */
|
||||
VALUE rb_reg_compile(VALUE str, int options, const char *sourcefile, int sourceline);
|
||||
VALUE rb_reg_check_preprocess(VALUE);
|
||||
|
||||
/* signal.c */
|
||||
int rb_get_next_signal(void);
|
||||
|
||||
/* string.c */
|
||||
int rb_str_buf_cat_escaped_char(VALUE result, unsigned int c, int unicode_p);
|
||||
|
||||
/* struct.c */
|
||||
VALUE rb_struct_init_copy(VALUE copy, VALUE s);
|
||||
|
||||
/* time.c */
|
||||
struct timespec rb_time_timespec(VALUE time);
|
||||
struct timeval rb_time_timeval(VALUE);
|
||||
struct timeval rb_time_interval(VALUE);
|
||||
|
||||
/* thread.c */
|
||||
VALUE rb_obj_is_mutex(VALUE obj);
|
||||
VALUE ruby_suppress_tracing(VALUE (*func)(VALUE, int), VALUE arg, int always);
|
||||
void rb_thread_execute_interrupts(VALUE th);
|
||||
void *rb_thread_call_with_gvl(void *(*func)(void *), void *data1);
|
||||
void rb_clear_trace_func(void);
|
||||
VALUE rb_thread_backtrace(VALUE thval);
|
||||
|
||||
/* thread_pthread.c, thread_win32.c */
|
||||
void Init_native_thread(void);
|
||||
|
||||
/* variable.c */
|
||||
VALUE rb_f_trace_var(int argc, VALUE *argv);
|
||||
VALUE rb_f_untrace_var(int argc, VALUE *argv);
|
||||
|
||||
/* vm.c */
|
||||
VALUE rb_obj_is_thread(VALUE obj);
|
||||
void rb_vm_mark(void *ptr);
|
||||
void Init_BareVM(void);
|
||||
VALUE rb_vm_top_self(void);
|
||||
void rb_thread_recycle_stack_release(VALUE *);
|
||||
void rb_vm_change_state(void);
|
||||
void rb_vm_inc_const_missing_count(void);
|
||||
void rb_thread_mark(void *th);
|
||||
|
||||
/* vm_dump.c */
|
||||
void rb_vm_bugreport(void);
|
||||
|
||||
/* vm_eval.c */
|
||||
VALUE rb_funcall_passing_block(VALUE recv, ID mid, int argc, const VALUE *argv);
|
||||
|
||||
/* miniprelude.c, prelude.c */
|
||||
void Init_prelude(void);
|
||||
|
||||
#if defined(__cplusplus)
|
||||
#if 0
|
||||
|
|
4
io.c
4
io.c
|
@ -82,8 +82,6 @@
|
|||
#include <sys/syscall.h>
|
||||
#endif
|
||||
|
||||
extern void Init_File(void);
|
||||
|
||||
#if defined(__BEOS__) || defined(__HAIKU__)
|
||||
# ifndef NOFILE
|
||||
# define NOFILE (OPEN_MAX)
|
||||
|
@ -142,8 +140,6 @@ static ID id_write, id_read, id_getc, id_flush, id_readpartial, id_set_encoding;
|
|||
static VALUE sym_mode, sym_perm, sym_extenc, sym_intenc, sym_encoding, sym_open_args;
|
||||
static VALUE sym_textmode, sym_binmode, sym_autoclose;
|
||||
|
||||
struct timeval rb_time_interval(VALUE);
|
||||
|
||||
struct argf {
|
||||
VALUE filename, current_file;
|
||||
long last_lineno; /* $. */
|
||||
|
|
3
iseq.c
3
iseq.c
|
@ -10,6 +10,7 @@
|
|||
**********************************************************************/
|
||||
|
||||
#include "ruby/ruby.h"
|
||||
#include "internal.h"
|
||||
|
||||
/* #define RUBY_MARK_FREE_DEBUG 1 */
|
||||
#include "gc.h"
|
||||
|
@ -217,8 +218,6 @@ set_relation(rb_iseq_t *iseq, const VALUE parent)
|
|||
}
|
||||
}
|
||||
|
||||
VALUE rb_realpath_internal(VALUE basedir, VALUE path, int strict);
|
||||
|
||||
static VALUE
|
||||
prepare_iseq_build(rb_iseq_t *iseq,
|
||||
VALUE name, VALUE filename, VALUE filepath, VALUE line_no,
|
||||
|
|
1
iseq.h
1
iseq.h
|
@ -24,6 +24,7 @@ VALUE rb_iseq_build_from_ary(rb_iseq_t *iseq, VALUE locals, VALUE args,
|
|||
|
||||
/* iseq.c */
|
||||
VALUE rb_iseq_load(VALUE data, VALUE parent, VALUE opt);
|
||||
VALUE rb_iseq_parameters(const rb_iseq_t *iseq, int is_proc);
|
||||
struct st_table *ruby_insn_make_insn_table(void);
|
||||
|
||||
struct rb_compile_option_struct {
|
||||
|
|
2
load.c
2
load.c
|
@ -4,6 +4,7 @@
|
|||
|
||||
#include "ruby/ruby.h"
|
||||
#include "ruby/util.h"
|
||||
#include "internal.h"
|
||||
#include "dln.h"
|
||||
#include "eval_intern.h"
|
||||
|
||||
|
@ -267,7 +268,6 @@ rb_provide(const char *feature)
|
|||
}
|
||||
|
||||
NORETURN(static void load_failed(VALUE));
|
||||
VALUE rb_realpath_internal(VALUE basedir, VALUE path, int strict);
|
||||
|
||||
static void
|
||||
rb_load_internal(VALUE fname, int wrap)
|
||||
|
|
|
@ -83,8 +83,6 @@ static ID s_dump, s_load, s_mdump, s_mload;
|
|||
static ID s_dump_data, s_load_data, s_alloc, s_call;
|
||||
static ID s_getbyte, s_read, s_write, s_binmode;
|
||||
|
||||
ID rb_id_encoding(void);
|
||||
|
||||
typedef struct {
|
||||
VALUE newclass;
|
||||
VALUE oldclass;
|
||||
|
|
2
math.c
2
math.c
|
@ -10,6 +10,7 @@
|
|||
**********************************************************************/
|
||||
|
||||
#include "ruby/ruby.h"
|
||||
#include "internal.h"
|
||||
#include <math.h>
|
||||
#include <errno.h>
|
||||
|
||||
|
@ -18,7 +19,6 @@
|
|||
VALUE rb_mMath;
|
||||
VALUE rb_eMathDomainError;
|
||||
|
||||
extern VALUE rb_to_float(VALUE val);
|
||||
#define Need_Float(x) do {if (TYPE(x) != T_FLOAT) {(x) = rb_to_float(x);}} while(0)
|
||||
#define Need_Float2(x,y) do {\
|
||||
Need_Float(x);\
|
||||
|
|
3
node.h
3
node.h
|
@ -457,6 +457,9 @@ VALUE rb_parser_end_seen_p(VALUE);
|
|||
VALUE rb_parser_encoding(VALUE);
|
||||
VALUE rb_parser_get_yydebug(VALUE);
|
||||
VALUE rb_parser_set_yydebug(VALUE, VALUE);
|
||||
VALUE rb_parser_dump_tree(NODE *node, int comment);
|
||||
NODE *rb_parser_append_print(VALUE, NODE *);
|
||||
NODE *rb_parser_while_loop(VALUE, NODE *, int, int);
|
||||
|
||||
NODE *rb_parser_compile_cstr(volatile VALUE, const char*, const char*, int, int);
|
||||
NODE *rb_parser_compile_string(volatile VALUE, const char*, VALUE, int);
|
||||
|
|
|
@ -2445,8 +2445,6 @@ fixdivmod(long x, long y, long *divp, long *modp)
|
|||
if (modp) *modp = mod;
|
||||
}
|
||||
|
||||
VALUE rb_big_fdiv(VALUE x, VALUE y);
|
||||
|
||||
/*
|
||||
* call-seq:
|
||||
* fix.fdiv(numeric) -> float
|
||||
|
@ -2475,8 +2473,6 @@ fix_fdiv(VALUE x, VALUE y)
|
|||
}
|
||||
}
|
||||
|
||||
VALUE rb_rational_reciprocal(VALUE x);
|
||||
|
||||
static VALUE
|
||||
fix_divide(VALUE x, VALUE y, ID op)
|
||||
{
|
||||
|
|
5
object.c
5
object.c
|
@ -1838,11 +1838,6 @@ rb_mod_const_defined(int argc, VALUE *argv, VALUE mod)
|
|||
return RTEST(recur) ? rb_const_defined(mod, id) : rb_const_defined_at(mod, id);
|
||||
}
|
||||
|
||||
VALUE rb_obj_methods(int argc, VALUE *argv, VALUE obj); /* in class.c */
|
||||
VALUE rb_obj_protected_methods(int argc, VALUE *argv, VALUE obj); /* in class.c */
|
||||
VALUE rb_obj_private_methods(int argc, VALUE *argv, VALUE obj); /* in class.c */
|
||||
VALUE rb_obj_public_methods(int argc, VALUE *argv, VALUE obj); /* in class.c */
|
||||
|
||||
/*
|
||||
* call-seq:
|
||||
* obj.instance_variable_get(symbol) -> obj
|
||||
|
|
11
parse.y
11
parse.y
|
@ -18,6 +18,7 @@
|
|||
#include "ruby/ruby.h"
|
||||
#include "ruby/st.h"
|
||||
#include "ruby/encoding.h"
|
||||
#include "internal.h"
|
||||
#include "node.h"
|
||||
#include "parse.h"
|
||||
#include "id.h"
|
||||
|
@ -404,11 +405,6 @@ static ID *local_tbl_gen(struct parser_params*);
|
|||
|
||||
static void fixup_nodes(NODE **);
|
||||
|
||||
extern int rb_dvar_defined(ID);
|
||||
extern int rb_local_defined(ID);
|
||||
extern int rb_parse_in_eval(void);
|
||||
extern int rb_parse_in_main(void);
|
||||
|
||||
static VALUE reg_compile_gen(struct parser_params*, VALUE, int);
|
||||
#define reg_compile(str,options) reg_compile_gen(parser, (str), (options))
|
||||
static void reg_fragment_setenc_gen(struct parser_params*, VALUE, int);
|
||||
|
@ -5095,8 +5091,6 @@ parser_yyerror(struct parser_params *parser, const char *msg)
|
|||
static void parser_prepare(struct parser_params *parser);
|
||||
|
||||
#ifndef RIPPER
|
||||
VALUE ruby_suppress_tracing(VALUE (*func)(VALUE, int), VALUE arg, int always);
|
||||
|
||||
static VALUE
|
||||
debug_lines(const char *f)
|
||||
{
|
||||
|
@ -9213,9 +9207,6 @@ dvar_curr_gen(struct parser_params *parser, ID id)
|
|||
}
|
||||
|
||||
#ifndef RIPPER
|
||||
VALUE rb_reg_compile(VALUE str, int options, const char *sourcefile, int sourceline);
|
||||
VALUE rb_reg_check_preprocess(VALUE);
|
||||
|
||||
static void
|
||||
reg_fragment_setenc_gen(struct parser_params* parser, VALUE str, int options)
|
||||
{
|
||||
|
|
3
proc.c
3
proc.c
|
@ -12,6 +12,7 @@
|
|||
#include "eval_intern.h"
|
||||
#include "internal.h"
|
||||
#include "gc.h"
|
||||
#include "iseq.h"
|
||||
|
||||
struct METHOD {
|
||||
VALUE recv;
|
||||
|
@ -25,8 +26,6 @@ VALUE rb_cMethod;
|
|||
VALUE rb_cBinding;
|
||||
VALUE rb_cProc;
|
||||
|
||||
VALUE rb_iseq_parameters(const rb_iseq_t *iseq, int is_proc);
|
||||
|
||||
static VALUE bmcall(VALUE, VALUE);
|
||||
static int method_arity(VALUE);
|
||||
rb_iseq_t *rb_method_get_iseq(VALUE method);
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
#include "ruby/ruby.h"
|
||||
#include "ruby/io.h"
|
||||
#include "ruby/util.h"
|
||||
#include "internal.h"
|
||||
#include "vm_core.h"
|
||||
|
||||
#include <stdio.h>
|
||||
|
@ -39,8 +40,6 @@
|
|||
#define EXIT_FAILURE 1
|
||||
#endif
|
||||
|
||||
struct timeval rb_time_interval(VALUE);
|
||||
|
||||
#ifdef HAVE_SYS_WAIT_H
|
||||
# include <sys/wait.h>
|
||||
#endif
|
||||
|
@ -126,9 +125,6 @@ static VALUE rb_cProcessTms;
|
|||
do {int saved_errno = errno; stmts; errno = saved_errno;} while (0)
|
||||
|
||||
|
||||
ssize_t rb_io_bufwrite(VALUE io, const void *buf, size_t size);
|
||||
ssize_t rb_io_bufread(VALUE io, void *buf, size_t size);
|
||||
|
||||
/*
|
||||
* call-seq:
|
||||
* Process.pid -> fixnum
|
||||
|
|
3
range.c
3
range.c
|
@ -11,12 +11,11 @@
|
|||
|
||||
#include "ruby/ruby.h"
|
||||
#include "ruby/encoding.h"
|
||||
#include "internal.h"
|
||||
|
||||
VALUE rb_cRange;
|
||||
static ID id_cmp, id_succ, id_beg, id_end, id_excl;
|
||||
|
||||
extern VALUE rb_struct_init_copy(VALUE copy, VALUE s);
|
||||
|
||||
#define RANGE_BEG(r) (RSTRUCT(r)->as.ary[0])
|
||||
#define RANGE_END(r) (RSTRUCT(r)->as.ary[1])
|
||||
#define RANGE_EXCL(r) (RSTRUCT(r)->as.ary[2])
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
*/
|
||||
|
||||
#include "ruby.h"
|
||||
#include "internal.h"
|
||||
#include <math.h>
|
||||
#include <float.h>
|
||||
|
||||
|
|
3
re.c
3
re.c
|
@ -13,6 +13,7 @@
|
|||
#include "ruby/re.h"
|
||||
#include "ruby/encoding.h"
|
||||
#include "ruby/util.h"
|
||||
#include "internal.h"
|
||||
#include "regint.h"
|
||||
#include <ctype.h>
|
||||
|
||||
|
@ -314,8 +315,6 @@ rb_reg_check(VALUE re)
|
|||
}
|
||||
}
|
||||
|
||||
int rb_str_buf_cat_escaped_char(VALUE result, unsigned int c, int unicode_p);
|
||||
|
||||
static void
|
||||
rb_reg_expr_str(VALUE str, const char *s, long len,
|
||||
rb_encoding *enc, rb_encoding *resenc)
|
||||
|
|
19
ruby.c
19
ruby.c
|
@ -17,6 +17,7 @@
|
|||
#endif
|
||||
#include "ruby/ruby.h"
|
||||
#include "ruby/encoding.h"
|
||||
#include "internal.h"
|
||||
#include "eval_intern.h"
|
||||
#include "dln.h"
|
||||
#include <stdio.h>
|
||||
|
@ -51,12 +52,6 @@
|
|||
char *getenv();
|
||||
#endif
|
||||
|
||||
VALUE rb_parser_get_yydebug(VALUE);
|
||||
VALUE rb_parser_set_yydebug(VALUE, VALUE);
|
||||
|
||||
const char *ruby_get_inplace_mode(void);
|
||||
void ruby_set_inplace_mode(const char *);
|
||||
|
||||
#define DISABLE_BIT(bit) (1U << disable_##bit)
|
||||
enum disable_flag_bits {
|
||||
disable_gems,
|
||||
|
@ -377,7 +372,6 @@ ruby_init_loadpath_safe(int safe_level)
|
|||
#elif defined(HAVE_DLADDR)
|
||||
Dl_info dli;
|
||||
if (dladdr((void *)(VALUE)expand_include_path, &dli)) {
|
||||
VALUE rb_realpath_internal(VALUE basedir, VALUE path, int strict);
|
||||
char fbuf[MAXPATHLEN];
|
||||
char *f = dln_find_file_r(dli.dli_fname, getenv(PATH_ENV), fbuf, sizeof(fbuf));
|
||||
VALUE fname = rb_str_new_cstr(f ? f : dli.dli_fname);
|
||||
|
@ -477,9 +471,6 @@ add_modules(VALUE *req_list, const char *mod)
|
|||
rb_ary_push(list, rb_obj_freeze(rb_str_new2(mod)));
|
||||
}
|
||||
|
||||
extern void Init_ext(void);
|
||||
extern VALUE rb_vm_top_self(void);
|
||||
|
||||
static void
|
||||
require_libraries(VALUE *req_list)
|
||||
{
|
||||
|
@ -568,8 +559,6 @@ process_sflag(int *sflag)
|
|||
}
|
||||
}
|
||||
|
||||
NODE *rb_parser_append_print(VALUE, NODE *);
|
||||
NODE *rb_parser_while_loop(VALUE, NODE *, int, int);
|
||||
static long proc_options(long argc, char **argv, struct cmdline_options *opt, int envopt);
|
||||
|
||||
static void
|
||||
|
@ -1101,8 +1090,6 @@ proc_options(long argc, char **argv, struct cmdline_options *opt, int envopt)
|
|||
return argc0 - argc;
|
||||
}
|
||||
|
||||
void Init_prelude(void);
|
||||
|
||||
static void
|
||||
ruby_init_prelude(void)
|
||||
{
|
||||
|
@ -1237,10 +1224,6 @@ rb_f_chomp(argc, argv)
|
|||
return str;
|
||||
}
|
||||
|
||||
void rb_stdio_set_default_encoding(void);
|
||||
VALUE rb_parser_dump_tree(NODE *node, int comment);
|
||||
VALUE rb_realpath_internal(VALUE basedir, VALUE path, int strict);
|
||||
|
||||
static VALUE
|
||||
process_options(int argc, char **argv, struct cmdline_options *opt)
|
||||
{
|
||||
|
|
5
string.c
5
string.c
|
@ -14,6 +14,7 @@
|
|||
#include "ruby/ruby.h"
|
||||
#include "ruby/re.h"
|
||||
#include "ruby/encoding.h"
|
||||
#include "internal.h"
|
||||
#include <assert.h>
|
||||
|
||||
#define BEG(no) (regs->beg[(no)])
|
||||
|
@ -2053,8 +2054,6 @@ rb_str_append(VALUE str, VALUE str2)
|
|||
return rb_str_buf_append(str, str2);
|
||||
}
|
||||
|
||||
int rb_num_to_uint(VALUE val, unsigned int *ret);
|
||||
|
||||
/*
|
||||
* call-seq:
|
||||
* str << integer -> str
|
||||
|
@ -7459,8 +7458,6 @@ sym_to_sym(VALUE sym)
|
|||
return sym;
|
||||
}
|
||||
|
||||
VALUE rb_funcall_passing_block(VALUE recv, ID mid, int argc, const VALUE *argv);
|
||||
|
||||
static VALUE
|
||||
sym_call(VALUE args, VALUE sym, int argc, VALUE *argv)
|
||||
{
|
||||
|
|
9
thread.c
9
thread.c
|
@ -66,7 +66,6 @@ static void sleep_timeval(rb_thread_t *th, struct timeval time);
|
|||
static void sleep_wait_for_interrupt(rb_thread_t *th, double sleepsec);
|
||||
static void sleep_forever(rb_thread_t *th, int nodeadlock);
|
||||
static double timeofday(void);
|
||||
struct timeval rb_time_interval(VALUE);
|
||||
static int rb_threadptr_dead(rb_thread_t *th);
|
||||
|
||||
static void rb_check_deadlock(rb_vm_t *vm);
|
||||
|
@ -409,7 +408,6 @@ thread_cleanup_func(void *th_ptr, int atfork)
|
|||
|
||||
extern void ruby_error_print(void);
|
||||
static VALUE rb_threadptr_raise(rb_thread_t *, int, VALUE *);
|
||||
void rb_thread_recycle_stack_release(VALUE *);
|
||||
|
||||
void
|
||||
ruby_thread_init_stack(rb_thread_t *th)
|
||||
|
@ -997,8 +995,6 @@ rb_thread_interrupted(VALUE thval)
|
|||
return RUBY_VM_INTERRUPTED(th);
|
||||
}
|
||||
|
||||
struct timeval rb_time_timeval(VALUE);
|
||||
|
||||
void
|
||||
rb_thread_sleep(int sec)
|
||||
{
|
||||
|
@ -2951,8 +2947,6 @@ rb_gc_save_machine_context(rb_thread_t *th)
|
|||
*
|
||||
*/
|
||||
|
||||
int rb_get_next_signal(void);
|
||||
|
||||
void
|
||||
rb_threadptr_check_signal(rb_thread_t *mth)
|
||||
{
|
||||
|
@ -4024,7 +4018,6 @@ enum {
|
|||
};
|
||||
|
||||
static VALUE thread_suppress_tracing(rb_thread_t *th, int ev, VALUE (*func)(VALUE, int), VALUE arg, int always);
|
||||
VALUE ruby_suppress_tracing(VALUE (*func)(VALUE, int), VALUE arg, int always);
|
||||
|
||||
struct event_call_args {
|
||||
rb_thread_t *th;
|
||||
|
@ -4562,8 +4555,6 @@ thread_suppress_tracing(rb_thread_t *th, int ev, VALUE (*func)(VALUE, int), VALU
|
|||
return result;
|
||||
}
|
||||
|
||||
VALUE rb_thread_backtrace(VALUE thval);
|
||||
|
||||
/*
|
||||
* call-seq:
|
||||
* thr.backtrace -> array
|
||||
|
|
1
time.c
1
time.c
|
@ -14,6 +14,7 @@
|
|||
#include <time.h>
|
||||
#include <errno.h>
|
||||
#include "ruby/encoding.h"
|
||||
#include "internal.h"
|
||||
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
|
|
|
@ -83,6 +83,7 @@ class Prelude
|
|||
sources: <%= @preludes.map {|n,*| prelude_base(n)}.join(', ') %>
|
||||
*/
|
||||
#include "ruby/ruby.h"
|
||||
#include "internal.h"
|
||||
#include "vm_core.h"
|
||||
|
||||
% preludes = @preludes.values.sort
|
||||
|
@ -115,8 +116,6 @@ prelude_prefix_path(VALUE self)
|
|||
% end
|
||||
|
||||
% unless preludes.empty?
|
||||
VALUE rb_iseq_compile_with_option(VALUE src, VALUE file, VALUE filepath, VALUE line, VALUE opt);
|
||||
|
||||
static void
|
||||
prelude_eval(VALUE code, VALUE name, VALUE line)
|
||||
{
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
|
||||
#include "ruby/ruby.h"
|
||||
#include "ruby/encoding.h"
|
||||
#include "internal.h"
|
||||
#include "transcode_data.h"
|
||||
#include <ctype.h>
|
||||
|
||||
|
@ -4299,8 +4300,6 @@ ecerr_incomplete_input(VALUE self)
|
|||
return rb_attr_get(self, rb_intern("incomplete_input"));
|
||||
}
|
||||
|
||||
extern void Init_newline(void);
|
||||
|
||||
/*
|
||||
* Document-class: Encoding::UndefinedConversionError
|
||||
*
|
||||
|
|
|
@ -19,9 +19,6 @@
|
|||
#include "constant.h"
|
||||
#include "internal.h"
|
||||
|
||||
void rb_vm_change_state(void);
|
||||
void rb_vm_inc_const_missing_count(void);
|
||||
|
||||
st_table *rb_global_tbl;
|
||||
st_table *rb_class_tbl;
|
||||
static ID autoload, classpath, tmp_classpath, classid;
|
||||
|
|
8
vm.c
8
vm.c
|
@ -12,6 +12,7 @@
|
|||
#include "ruby/vm.h"
|
||||
#include "ruby/st.h"
|
||||
#include "ruby/encoding.h"
|
||||
#include "internal.h"
|
||||
|
||||
#include "gc.h"
|
||||
#include "vm_core.h"
|
||||
|
@ -1662,8 +1663,6 @@ thread_recycle_struct(void)
|
|||
}
|
||||
#endif
|
||||
|
||||
void rb_gc_mark_machine_stack(rb_thread_t *th);
|
||||
|
||||
void
|
||||
rb_thread_mark(void *ptr)
|
||||
{
|
||||
|
@ -1866,8 +1865,6 @@ rb_thread_alloc(VALUE klass)
|
|||
return self;
|
||||
}
|
||||
|
||||
VALUE rb_iseq_clone(VALUE iseqval, VALUE newcbase);
|
||||
|
||||
static void
|
||||
vm_define_method(rb_thread_t *th, VALUE obj, ID id, VALUE iseqval,
|
||||
rb_num_t is_singleton, NODE *cref)
|
||||
|
@ -2151,9 +2148,6 @@ rb_vm_set_progname(VALUE filename)
|
|||
#if defined(ENABLE_VM_OBJSPACE) && ENABLE_VM_OBJSPACE
|
||||
struct rb_objspace *rb_objspace_alloc(void);
|
||||
#endif
|
||||
void ruby_thread_init_stack(rb_thread_t *th);
|
||||
|
||||
extern void Init_native_thread(void);
|
||||
|
||||
void
|
||||
Init_BareVM(void)
|
||||
|
|
|
@ -658,8 +658,11 @@ int rb_backtrace_each(rb_backtrace_iter_func *iter, void *arg);
|
|||
rb_control_frame_t *rb_vm_get_ruby_level_next_cfp(rb_thread_t *th, rb_control_frame_t *cfp);
|
||||
int rb_vm_get_sourceline(const rb_control_frame_t *);
|
||||
VALUE rb_name_err_mesg_new(VALUE obj, VALUE mesg, VALUE recv, VALUE method);
|
||||
void rb_vm_stack_to_heap(rb_thread_t *th);
|
||||
void ruby_thread_init_stack(rb_thread_t *th);
|
||||
|
||||
NOINLINE(void rb_gc_save_machine_context(rb_thread_t *));
|
||||
void rb_gc_mark_machine_stack(rb_thread_t *th);
|
||||
|
||||
#define sysstack_error GET_VM()->special_exceptions[ruby_error_sysstack]
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче