Ruby 1.9.3p327(2012-11-10revision37606)
internal.h
Go to the documentation of this file.
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 VALUE rb_file_expand_path_fast(VALUE, VALUE);
00096 VALUE rb_file_expand_path_internal(VALUE, VALUE, int, int, VALUE);
00097 void Init_File(void);
00098 
00099 #ifdef _WIN32
00100 /* file.c, win32/file.c */
00101 void rb_w32_init_file(void);
00102 #endif
00103 
00104 /* gc.c */
00105 void Init_heap(void);
00106 
00107 /* inits.c */
00108 void rb_call_inits(void);
00109 
00110 /* io.c */
00111 const char *ruby_get_inplace_mode(void);
00112 void ruby_set_inplace_mode(const char *);
00113 ssize_t rb_io_bufread(VALUE io, void *buf, size_t size);
00114 void rb_stdio_set_default_encoding(void);
00115 
00116 /* iseq.c */
00117 VALUE rb_iseq_compile_with_option(VALUE src, VALUE file, VALUE filepath, VALUE line, VALUE opt);
00118 VALUE rb_iseq_clone(VALUE iseqval, VALUE newcbase);
00119 
00120 /* load.c */
00121 VALUE rb_get_load_path(void);
00122 
00123 /* math.c */
00124 VALUE rb_math_atan2(VALUE, VALUE);
00125 VALUE rb_math_cos(VALUE);
00126 VALUE rb_math_cosh(VALUE);
00127 VALUE rb_math_exp(VALUE);
00128 VALUE rb_math_hypot(VALUE, VALUE);
00129 VALUE rb_math_log(int argc, VALUE *argv);
00130 VALUE rb_math_sin(VALUE);
00131 VALUE rb_math_sinh(VALUE);
00132 VALUE rb_math_sqrt(VALUE);
00133 
00134 /* newline.c */
00135 void Init_newline(void);
00136 
00137 /* numeric.c */
00138 int rb_num_to_uint(VALUE val, unsigned int *ret);
00139 int ruby_float_step(VALUE from, VALUE to, VALUE step, int excl);
00140 double ruby_float_mod(double x, double y);
00141 
00142 /* object.c */
00143 VALUE rb_obj_equal(VALUE obj1, VALUE obj2);
00144 
00145 /* parse.y */
00146 VALUE rb_parser_get_yydebug(VALUE);
00147 VALUE rb_parser_set_yydebug(VALUE, VALUE);
00148 
00149 /* proc.c */
00150 VALUE rb_proc_location(VALUE self);
00151 
00152 /* rational.c */
00153 VALUE rb_lcm(VALUE x, VALUE y);
00154 VALUE rb_rational_reciprocal(VALUE x);
00155 
00156 /* re.c */
00157 VALUE rb_reg_compile(VALUE str, int options, const char *sourcefile, int sourceline);
00158 VALUE rb_reg_check_preprocess(VALUE);
00159 
00160 /* signal.c */
00161 int rb_get_next_signal(void);
00162 
00163 /* strftime.c */
00164 size_t rb_strftime_timespec(char *s, size_t maxsize, const char *format, const struct vtm *vtm, struct timespec *ts, int gmt);
00165 
00166 /* string.c */
00167 int rb_str_buf_cat_escaped_char(VALUE result, unsigned int c, int unicode_p);
00168 
00169 /* struct.c */
00170 VALUE rb_struct_init_copy(VALUE copy, VALUE s);
00171 
00172 /* time.c */
00173 struct timeval rb_time_timeval(VALUE);
00174 
00175 /* thread.c */
00176 VALUE rb_obj_is_mutex(VALUE obj);
00177 VALUE ruby_suppress_tracing(VALUE (*func)(VALUE, int), VALUE arg, int always);
00178 void rb_thread_execute_interrupts(VALUE th);
00179 void rb_clear_trace_func(void);
00180 VALUE rb_thread_backtrace(VALUE thval);
00181 VALUE rb_get_coverages(void);
00182 
00183 /* thread_pthread.c, thread_win32.c */
00184 void Init_native_thread(void);
00185 
00186 /* vm.c */
00187 VALUE rb_obj_is_thread(VALUE obj);
00188 void rb_vm_mark(void *ptr);
00189 void Init_BareVM(void);
00190 VALUE rb_vm_top_self(void);
00191 void rb_thread_recycle_stack_release(VALUE *);
00192 void rb_vm_change_state(void);
00193 void rb_vm_inc_const_missing_count(void);
00194 void rb_thread_mark(void *th);
00195 const void **rb_vm_get_insns_address_table(void);
00196 
00197 /* vm_dump.c */
00198 void rb_vm_bugreport(void);
00199 
00200 /* vm_eval.c */
00201 void Init_vm_eval(void);
00202 VALUE rb_current_realfilepath(void);
00203 
00204 /* vm_method.c */
00205 void Init_eval_method(void);
00206 
00207 /* miniprelude.c, prelude.c */
00208 void Init_prelude(void);
00209 
00210 #if defined __GNUC__ && __GNUC__ >= 4
00211 #pragma GCC visibility push(default)
00212 #endif
00213 const char *rb_objspace_data_type_name(VALUE obj);
00214 
00215 /* Temporary.  This API will be removed (renamed). */
00216 VALUE rb_thread_io_blocking_region(rb_blocking_function_t *func, void *data1, int fd);
00217 
00218 /* experimental.
00219  * These APIs can be changed on Ruby 1.9.4 or later.
00220  * We will change these APIs (spac, name and so on) if there are something wrong.
00221  * If you use these APIs, catch up future changes.
00222  */
00223 void *rb_thread_call_with_gvl(void *(*func)(void *), void *data1);
00224 VALUE rb_thread_call_without_gvl(
00225     rb_blocking_function_t *func, void *data1,
00226     rb_unblock_function_t *ubf, void *data2);
00227 
00228 #if defined __GNUC__ && __GNUC__ >= 4
00229 #pragma GCC visibility pop
00230 #endif
00231 
00232 #if defined(__cplusplus)
00233 #if 0
00234 { /* satisfy cc-mode */
00235 #endif
00236 }  /* extern "C" { */
00237 #endif
00238 
00239 #endif /* RUBY_INTERNAL_H */
00240