1
/**********************************************************************
6
created at: Tue May 17 11:42:20 JST 2011
8
Copyright (C) 2011 Yukihiro Matsumoto
10
**********************************************************************/
12
#ifndef RUBY_INTERNAL_H
13
#define RUBY_INTERNAL_H 1
15
#if defined(__cplusplus)
18
} /* satisfy cc-mode */
22
struct rb_deprecated_classext_struct {
23
char conflict[sizeof(VALUE) * 3];
26
struct rb_classext_struct {
28
struct st_table *iv_tbl;
29
struct st_table *const_tbl;
33
#define RCLASS_EXT(c) (RCLASS(c)->ptr)
34
#define RCLASS_SUPER(c) (RCLASS_EXT(c)->super)
35
#define RCLASS_IV_TBL(c) (RCLASS_EXT(c)->iv_tbl)
36
#define RCLASS_CONST_TBL(c) (RCLASS_EXT(c)->const_tbl)
37
#define RCLASS_M_TBL(c) (RCLASS(c)->m_tbl)
38
#define RCLASS_IV_INDEX_TBL(c) (RCLASS(c)->iv_index_tbl)
40
struct vtm; /* defined by timev.h */
43
VALUE rb_ary_last(int, VALUE *, VALUE);
46
VALUE rb_big_fdiv(VALUE x, VALUE y);
47
VALUE rb_big_uminus(VALUE x);
50
VALUE rb_obj_methods(int argc, VALUE *argv, VALUE obj);
51
VALUE rb_obj_protected_methods(int argc, VALUE *argv, VALUE obj);
52
VALUE rb_obj_private_methods(int argc, VALUE *argv, VALUE obj);
53
VALUE rb_obj_public_methods(int argc, VALUE *argv, VALUE obj);
54
int rb_obj_basic_to_s_p(VALUE);
55
void Init_class_hierarchy(void);
58
int rb_dvar_defined(ID);
59
int rb_local_defined(ID);
60
int rb_parse_in_eval(void);
61
int rb_parse_in_main(void);
62
VALUE rb_insns_name_array(void);
65
PRINTF_ARGS(void ruby_debug_printf(const char*, ...), 1, 2);
71
ID rb_id_encoding(void);
74
void rb_gc_mark_encodings(void);
77
NORETURN(PRINTF_ARGS(void rb_compile_bug(const char*, int, const char*, ...), 3, 4));
78
VALUE rb_check_backtrace(VALUE);
79
NORETURN(void rb_async_bug_errno(const char *,int));
82
void ruby_error_print(void);
83
VALUE rb_get_backtrace(VALUE info);
86
void rb_call_end_proc(VALUE data);
89
VALUE rb_home_dir(const char *user, VALUE result);
90
VALUE rb_realpath_internal(VALUE basedir, VALUE path, int strict);
97
void rb_call_inits(void);
100
const char *ruby_get_inplace_mode(void);
101
void ruby_set_inplace_mode(const char *);
102
ssize_t rb_io_bufread(VALUE io, void *buf, size_t size);
103
void rb_stdio_set_default_encoding(void);
106
VALUE rb_iseq_compile_with_option(VALUE src, VALUE file, VALUE filepath, VALUE line, VALUE opt);
107
VALUE rb_iseq_clone(VALUE iseqval, VALUE newcbase);
110
VALUE rb_get_load_path(void);
113
VALUE rb_math_atan2(VALUE, VALUE);
114
VALUE rb_math_cos(VALUE);
115
VALUE rb_math_cosh(VALUE);
116
VALUE rb_math_exp(VALUE);
117
VALUE rb_math_hypot(VALUE, VALUE);
118
VALUE rb_math_log(int argc, VALUE *argv);
119
VALUE rb_math_sin(VALUE);
120
VALUE rb_math_sinh(VALUE);
121
VALUE rb_math_sqrt(VALUE);
124
void Init_newline(void);
127
int rb_num_to_uint(VALUE val, unsigned int *ret);
128
int ruby_float_step(VALUE from, VALUE to, VALUE step, int excl);
131
VALUE rb_obj_equal(VALUE obj1, VALUE obj2);
134
VALUE rb_parser_get_yydebug(VALUE);
135
VALUE rb_parser_set_yydebug(VALUE, VALUE);
138
VALUE rb_proc_location(VALUE self);
141
VALUE rb_lcm(VALUE x, VALUE y);
142
VALUE rb_rational_reciprocal(VALUE x);
145
VALUE rb_reg_compile(VALUE str, int options, const char *sourcefile, int sourceline);
146
VALUE rb_reg_check_preprocess(VALUE);
149
int rb_get_next_signal(void);
152
size_t rb_strftime_timespec(char *s, size_t maxsize, const char *format, const struct vtm *vtm, struct timespec *ts, int gmt);
155
int rb_str_buf_cat_escaped_char(VALUE result, unsigned int c, int unicode_p);
158
VALUE rb_struct_init_copy(VALUE copy, VALUE s);
161
struct timeval rb_time_timeval(VALUE);
164
VALUE rb_obj_is_mutex(VALUE obj);
165
VALUE ruby_suppress_tracing(VALUE (*func)(VALUE, int), VALUE arg, int always);
166
void rb_thread_execute_interrupts(VALUE th);
167
void rb_clear_trace_func(void);
168
VALUE rb_thread_backtrace(VALUE thval);
169
VALUE rb_get_coverages(void);
171
/* thread_pthread.c, thread_win32.c */
172
void Init_native_thread(void);
175
VALUE rb_obj_is_thread(VALUE obj);
176
void rb_vm_mark(void *ptr);
177
void Init_BareVM(void);
178
VALUE rb_vm_top_self(void);
179
void rb_thread_recycle_stack_release(VALUE *);
180
void rb_vm_change_state(void);
181
void rb_vm_inc_const_missing_count(void);
182
void rb_thread_mark(void *th);
183
const void **rb_vm_get_insns_address_table(void);
186
void rb_vm_bugreport(void);
189
void Init_vm_eval(void);
190
VALUE rb_current_realfilepath(void);
193
void Init_eval_method(void);
195
/* miniprelude.c, prelude.c */
196
void Init_prelude(void);
198
#if defined __GNUC__ && __GNUC__ >= 4
199
#pragma GCC visibility push(default)
201
const char *rb_objspace_data_type_name(VALUE obj);
203
/* Temporary. This API will be removed (renamed). */
204
VALUE rb_thread_io_blocking_region(rb_blocking_function_t *func, void *data1, int fd);
207
* These APIs can be changed on Ruby 1.9.4 or later.
208
* We will change these APIs (spac, name and so on) if there are something wrong.
209
* If you use these APIs, catch up future changes.
211
void *rb_thread_call_with_gvl(void *(*func)(void *), void *data1);
212
VALUE rb_thread_call_without_gvl(
213
rb_blocking_function_t *func, void *data1,
214
rb_unblock_function_t *ubf, void *data2);
216
#if defined __GNUC__ && __GNUC__ >= 4
217
#pragma GCC visibility pop
220
#if defined(__cplusplus)
222
{ /* satisfy cc-mode */
227
#endif /* RUBY_INTERNAL_H */