|
Ruby
1.9.3p286(2012-10-12revision37165)
|
00001 /********************************************************************** 00002 00003 internal.h - 00004 00005 $Author$ 00006 created at: Tue May 17 11:42:20 JST 2011 00007 00008 Copyright (C) 2011 Yukihiro Matsumoto 00009 00010 **********************************************************************/ 00011 00012 #ifndef RUBY_INTERNAL_H 00013 #define RUBY_INTERNAL_H 1 00014 00015 #if defined(__cplusplus) 00016 extern "C" { 00017 #if 0 00018 } /* satisfy cc-mode */ 00019 #endif 00020 #endif 00021 00022 struct rb_deprecated_classext_struct { 00023 char conflict[sizeof(VALUE) * 3]; 00024 }; 00025 00026 struct rb_classext_struct { 00027 VALUE super; 00028 struct st_table *iv_tbl; 00029 struct st_table *const_tbl; 00030 }; 00031 00032 #undef RCLASS_SUPER 00033 #define RCLASS_EXT(c) (RCLASS(c)->ptr) 00034 #define RCLASS_SUPER(c) (RCLASS_EXT(c)->super) 00035 #define RCLASS_IV_TBL(c) (RCLASS_EXT(c)->iv_tbl) 00036 #define RCLASS_CONST_TBL(c) (RCLASS_EXT(c)->const_tbl) 00037 #define RCLASS_M_TBL(c) (RCLASS(c)->m_tbl) 00038 #define RCLASS_IV_INDEX_TBL(c) (RCLASS(c)->iv_index_tbl) 00039 00040 struct vtm; /* defined by timev.h */ 00041 00042 /* array.c */ 00043 VALUE rb_ary_last(int, VALUE *, VALUE); 00044 00045 /* bignum.c */ 00046 VALUE rb_big_fdiv(VALUE x, VALUE y); 00047 VALUE rb_big_uminus(VALUE x); 00048 00049 /* class.c */ 00050 VALUE rb_obj_methods(int argc, VALUE *argv, VALUE obj); 00051 VALUE rb_obj_protected_methods(int argc, VALUE *argv, VALUE obj); 00052 VALUE rb_obj_private_methods(int argc, VALUE *argv, VALUE obj); 00053 VALUE rb_obj_public_methods(int argc, VALUE *argv, VALUE obj); 00054 int rb_obj_basic_to_s_p(VALUE); 00055 void Init_class_hierarchy(void); 00056 00057 /* compile.c */ 00058 int rb_dvar_defined(ID); 00059 int rb_local_defined(ID); 00060 int rb_parse_in_eval(void); 00061 int rb_parse_in_main(void); 00062 VALUE rb_insns_name_array(void); 00063 00064 /* cont.c */ 00065 VALUE rb_obj_is_fiber(VALUE); 00066 void rb_fiber_reset_root_local_storage(VALUE); 00067 00068 /* debug.c */ 00069 PRINTF_ARGS(void ruby_debug_printf(const char*, ...), 1, 2); 00070 00071 /* dmyext.c */ 00072 void Init_ext(void); 00073 00074 /* encoding.c */ 00075 ID rb_id_encoding(void); 00076 00077 /* encoding.c */ 00078 void rb_gc_mark_encodings(void); 00079 00080 /* error.c */ 00081 NORETURN(PRINTF_ARGS(void rb_compile_bug(const char*, int, const char*, ...), 3, 4)); 00082 VALUE rb_check_backtrace(VALUE); 00083 NORETURN(void rb_async_bug_errno(const char *,int)); 00084 00085 /* eval_error.c */ 00086 void ruby_error_print(void); 00087 VALUE rb_get_backtrace(VALUE info); 00088 00089 /* eval_jump.c */ 00090 void rb_call_end_proc(VALUE data); 00091 00092 /* file.c */ 00093 VALUE rb_home_dir(const char *user, VALUE result); 00094 VALUE rb_realpath_internal(VALUE basedir, VALUE path, int strict); 00095 void Init_File(void); 00096 00097 /* gc.c */ 00098 void Init_heap(void); 00099 00100 /* inits.c */ 00101 void rb_call_inits(void); 00102 00103 /* io.c */ 00104 const char *ruby_get_inplace_mode(void); 00105 void ruby_set_inplace_mode(const char *); 00106 ssize_t rb_io_bufread(VALUE io, void *buf, size_t size); 00107 void rb_stdio_set_default_encoding(void); 00108 00109 /* iseq.c */ 00110 VALUE rb_iseq_compile_with_option(VALUE src, VALUE file, VALUE filepath, VALUE line, VALUE opt); 00111 VALUE rb_iseq_clone(VALUE iseqval, VALUE newcbase); 00112 00113 /* load.c */ 00114 VALUE rb_get_load_path(void); 00115 00116 /* math.c */ 00117 VALUE rb_math_atan2(VALUE, VALUE); 00118 VALUE rb_math_cos(VALUE); 00119 VALUE rb_math_cosh(VALUE); 00120 VALUE rb_math_exp(VALUE); 00121 VALUE rb_math_hypot(VALUE, VALUE); 00122 VALUE rb_math_log(int argc, VALUE *argv); 00123 VALUE rb_math_sin(VALUE); 00124 VALUE rb_math_sinh(VALUE); 00125 VALUE rb_math_sqrt(VALUE); 00126 00127 /* newline.c */ 00128 void Init_newline(void); 00129 00130 /* numeric.c */ 00131 int rb_num_to_uint(VALUE val, unsigned int *ret); 00132 int ruby_float_step(VALUE from, VALUE to, VALUE step, int excl); 00133 double ruby_float_mod(double x, double y); 00134 00135 /* object.c */ 00136 VALUE rb_obj_equal(VALUE obj1, VALUE obj2); 00137 00138 /* parse.y */ 00139 VALUE rb_parser_get_yydebug(VALUE); 00140 VALUE rb_parser_set_yydebug(VALUE, VALUE); 00141 00142 /* proc.c */ 00143 VALUE rb_proc_location(VALUE self); 00144 00145 /* rational.c */ 00146 VALUE rb_lcm(VALUE x, VALUE y); 00147 VALUE rb_rational_reciprocal(VALUE x); 00148 00149 /* re.c */ 00150 VALUE rb_reg_compile(VALUE str, int options, const char *sourcefile, int sourceline); 00151 VALUE rb_reg_check_preprocess(VALUE); 00152 00153 /* signal.c */ 00154 int rb_get_next_signal(void); 00155 00156 /* strftime.c */ 00157 size_t rb_strftime_timespec(char *s, size_t maxsize, const char *format, const struct vtm *vtm, struct timespec *ts, int gmt); 00158 00159 /* string.c */ 00160 int rb_str_buf_cat_escaped_char(VALUE result, unsigned int c, int unicode_p); 00161 00162 /* struct.c */ 00163 VALUE rb_struct_init_copy(VALUE copy, VALUE s); 00164 00165 /* time.c */ 00166 struct timeval rb_time_timeval(VALUE); 00167 00168 /* thread.c */ 00169 VALUE rb_obj_is_mutex(VALUE obj); 00170 VALUE ruby_suppress_tracing(VALUE (*func)(VALUE, int), VALUE arg, int always); 00171 void rb_thread_execute_interrupts(VALUE th); 00172 void rb_clear_trace_func(void); 00173 VALUE rb_thread_backtrace(VALUE thval); 00174 VALUE rb_get_coverages(void); 00175 00176 /* thread_pthread.c, thread_win32.c */ 00177 void Init_native_thread(void); 00178 00179 /* vm.c */ 00180 VALUE rb_obj_is_thread(VALUE obj); 00181 void rb_vm_mark(void *ptr); 00182 void Init_BareVM(void); 00183 VALUE rb_vm_top_self(void); 00184 void rb_thread_recycle_stack_release(VALUE *); 00185 void rb_vm_change_state(void); 00186 void rb_vm_inc_const_missing_count(void); 00187 void rb_thread_mark(void *th); 00188 const void **rb_vm_get_insns_address_table(void); 00189 00190 /* vm_dump.c */ 00191 void rb_vm_bugreport(void); 00192 00193 /* vm_eval.c */ 00194 void Init_vm_eval(void); 00195 VALUE rb_current_realfilepath(void); 00196 00197 /* vm_method.c */ 00198 void Init_eval_method(void); 00199 00200 /* miniprelude.c, prelude.c */ 00201 void Init_prelude(void); 00202 00203 #if defined __GNUC__ && __GNUC__ >= 4 00204 #pragma GCC visibility push(default) 00205 #endif 00206 const char *rb_objspace_data_type_name(VALUE obj); 00207 00208 /* Temporary. This API will be removed (renamed). */ 00209 VALUE rb_thread_io_blocking_region(rb_blocking_function_t *func, void *data1, int fd); 00210 00211 /* experimental. 00212 * These APIs can be changed on Ruby 1.9.4 or later. 00213 * We will change these APIs (spac, name and so on) if there are something wrong. 00214 * If you use these APIs, catch up future changes. 00215 */ 00216 void *rb_thread_call_with_gvl(void *(*func)(void *), void *data1); 00217 VALUE rb_thread_call_without_gvl( 00218 rb_blocking_function_t *func, void *data1, 00219 rb_unblock_function_t *ubf, void *data2); 00220 00221 #if defined __GNUC__ && __GNUC__ >= 4 00222 #pragma GCC visibility pop 00223 #endif 00224 00225 #if defined(__cplusplus) 00226 #if 0 00227 { /* satisfy cc-mode */ 00228 #endif 00229 } /* extern "C" { */ 00230 #endif 00231 00232 #endif /* RUBY_INTERNAL_H */ 00233
1.7.6.1