Ruby  1.9.3p537(2014-02-19revision0)
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 VALUE rb_int_succ(VALUE num);
00142 VALUE rb_int_pred(VALUE num);
00143 
00144 /* object.c */
00145 VALUE rb_obj_equal(VALUE obj1, VALUE obj2);
00146 
00147 /* parse.y */
00148 VALUE rb_parser_get_yydebug(VALUE);
00149 VALUE rb_parser_set_yydebug(VALUE, VALUE);
00150 
00151 /* proc.c */
00152 VALUE rb_proc_location(VALUE self);
00153 
00154 /* rational.c */
00155 VALUE rb_lcm(VALUE x, VALUE y);
00156 VALUE rb_rational_reciprocal(VALUE x);
00157 
00158 /* re.c */
00159 VALUE rb_reg_compile(VALUE str, int options, const char *sourcefile, int sourceline);
00160 VALUE rb_reg_check_preprocess(VALUE);
00161 
00162 /* signal.c */
00163 int rb_get_next_signal(void);
00164 
00165 /* strftime.c */
00166 size_t rb_strftime_timespec(char *s, size_t maxsize, const char *format, const struct vtm *vtm, struct timespec *ts, int gmt);
00167 
00168 /* string.c */
00169 int rb_str_buf_cat_escaped_char(VALUE result, unsigned int c, int unicode_p);
00170 VALUE rb_str_locktmp_ensure(VALUE str, VALUE (*func)(VALUE), VALUE arg);
00171 
00172 /* struct.c */
00173 VALUE rb_struct_init_copy(VALUE copy, VALUE s);
00174 
00175 /* time.c */
00176 struct timeval rb_time_timeval(VALUE);
00177 
00178 /* thread.c */
00179 VALUE rb_obj_is_mutex(VALUE obj);
00180 VALUE ruby_suppress_tracing(VALUE (*func)(VALUE, int), VALUE arg, int always);
00181 void rb_thread_execute_interrupts(VALUE th);
00182 void rb_clear_trace_func(void);
00183 VALUE rb_thread_backtrace(VALUE thval);
00184 VALUE rb_get_coverages(void);
00185 
00186 /* thread_pthread.c, thread_win32.c */
00187 void Init_native_thread(void);
00188 
00189 /* vm.c */
00190 VALUE rb_obj_is_thread(VALUE obj);
00191 void rb_vm_mark(void *ptr);
00192 void Init_BareVM(void);
00193 VALUE rb_vm_top_self(void);
00194 void rb_thread_recycle_stack_release(VALUE *);
00195 void rb_vm_change_state(void);
00196 void rb_vm_inc_const_missing_count(void);
00197 void rb_thread_mark(void *th);
00198 const void **rb_vm_get_insns_address_table(void);
00199 
00200 /* vm_dump.c */
00201 void rb_vm_bugreport(void);
00202 
00203 /* vm_eval.c */
00204 void Init_vm_eval(void);
00205 VALUE rb_current_realfilepath(void);
00206 
00207 /* vm_method.c */
00208 void Init_eval_method(void);
00209 
00210 /* miniprelude.c, prelude.c */
00211 void Init_prelude(void);
00212 
00213 #if defined __GNUC__ && __GNUC__ >= 4
00214 #pragma GCC visibility push(default)
00215 #endif
00216 const char *rb_objspace_data_type_name(VALUE obj);
00217 
00218 /* Temporary.  This API will be removed (renamed). */
00219 VALUE rb_thread_io_blocking_region(rb_blocking_function_t *func, void *data1, int fd);
00220 
00221 /* experimental.
00222  * These APIs can be changed on Ruby 1.9.4 or later.
00223  * We will change these APIs (spac, name and so on) if there are something wrong.
00224  * If you use these APIs, catch up future changes.
00225  */
00226 void *rb_thread_call_with_gvl(void *(*func)(void *), void *data1);
00227 VALUE rb_thread_call_without_gvl(
00228     rb_blocking_function_t *func, void *data1,
00229     rb_unblock_function_t *ubf, void *data2);
00230 
00231 #if defined __GNUC__ && __GNUC__ >= 4
00232 #pragma GCC visibility pop
00233 #endif
00234 
00235 #if defined(__cplusplus)
00236 #if 0
00237 { /* satisfy cc-mode */
00238 #endif
00239 }  /* extern "C" { */
00240 #endif
00241 
00242 #endif /* RUBY_INTERNAL_H */
00243