00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef RUBY_INTERN_H
00015 #define RUBY_INTERN_H 1
00016
00017 #if defined(__cplusplus)
00018 extern "C" {
00019 #if 0
00020 }
00021 #endif
00022 #endif
00023
00024 #ifdef HAVE_STDARG_PROTOTYPES
00025 # include <stdarg.h>
00026 #else
00027 # include <varargs.h>
00028 #endif
00029 #include "ruby/st.h"
00030
00031
00032
00033
00034
00035
00036 #define ID_ALLOCATOR 1
00037
00038
00039 void rb_mem_clear(register VALUE*, register long);
00040 VALUE rb_assoc_new(VALUE, VALUE);
00041 VALUE rb_check_array_type(VALUE);
00042 VALUE rb_ary_new(void);
00043 VALUE rb_ary_new2(long);
00044 VALUE rb_ary_new3(long,...);
00045 VALUE rb_ary_new4(long, const VALUE *);
00046 VALUE rb_ary_tmp_new(long);
00047 void rb_ary_free(VALUE);
00048 VALUE rb_ary_freeze(VALUE);
00049 VALUE rb_ary_aref(int, VALUE*, VALUE);
00050 VALUE rb_ary_subseq(VALUE, long, long);
00051 void rb_ary_store(VALUE, long, VALUE);
00052 VALUE rb_ary_dup(VALUE);
00053 VALUE rb_ary_to_ary(VALUE);
00054 VALUE rb_ary_to_s(VALUE);
00055 VALUE rb_ary_push(VALUE, VALUE);
00056 VALUE rb_ary_pop(VALUE);
00057 VALUE rb_ary_shift(VALUE);
00058 VALUE rb_ary_unshift(VALUE, VALUE);
00059 VALUE rb_ary_entry(VALUE, long);
00060 VALUE rb_ary_each(VALUE);
00061 VALUE rb_ary_join(VALUE, VALUE);
00062 VALUE rb_ary_print_on(VALUE, VALUE);
00063 VALUE rb_ary_reverse(VALUE);
00064 VALUE rb_ary_sort(VALUE);
00065 VALUE rb_ary_sort_bang(VALUE);
00066 VALUE rb_ary_delete(VALUE, VALUE);
00067 VALUE rb_ary_delete_at(VALUE, long);
00068 VALUE rb_ary_clear(VALUE);
00069 VALUE rb_ary_plus(VALUE, VALUE);
00070 VALUE rb_ary_concat(VALUE, VALUE);
00071 VALUE rb_ary_assoc(VALUE, VALUE);
00072 VALUE rb_ary_rassoc(VALUE, VALUE);
00073 VALUE rb_ary_includes(VALUE, VALUE);
00074 VALUE rb_ary_cmp(VALUE, VALUE);
00075 VALUE rb_ary_replace(VALUE copy, VALUE orig);
00076 VALUE rb_get_values_at(VALUE, long, int, VALUE*, VALUE(*)(VALUE,long));
00077
00078 VALUE rb_big_new(long, int);
00079 int rb_bigzero_p(VALUE x);
00080 VALUE rb_big_clone(VALUE);
00081 void rb_big_2comp(VALUE);
00082 VALUE rb_big_norm(VALUE);
00083 void rb_big_resize(VALUE big, long len);
00084 VALUE rb_uint2big(VALUE);
00085 VALUE rb_int2big(SIGNED_VALUE);
00086 VALUE rb_uint2inum(VALUE);
00087 VALUE rb_int2inum(SIGNED_VALUE);
00088 VALUE rb_cstr_to_inum(const char*, int, int);
00089 VALUE rb_str_to_inum(VALUE, int, int);
00090 VALUE rb_cstr2inum(const char*, int);
00091 VALUE rb_str2inum(VALUE, int);
00092 VALUE rb_big2str(VALUE, int);
00093 VALUE rb_big2str0(VALUE, int, int);
00094 SIGNED_VALUE rb_big2long(VALUE);
00095 #define rb_big2int(x) rb_big2long(x)
00096 VALUE rb_big2ulong(VALUE);
00097 #define rb_big2uint(x) rb_big2ulong(x)
00098 #if HAVE_LONG_LONG
00099 VALUE rb_ll2inum(LONG_LONG);
00100 VALUE rb_ull2inum(unsigned LONG_LONG);
00101 LONG_LONG rb_big2ll(VALUE);
00102 unsigned LONG_LONG rb_big2ull(VALUE);
00103 #endif
00104 void rb_quad_pack(char*,VALUE);
00105 VALUE rb_quad_unpack(const char*,int);
00106 void rb_big_pack(VALUE val, unsigned long *buf, long num_longs);
00107 VALUE rb_big_unpack(unsigned long *buf, long num_longs);
00108 int rb_uv_to_utf8(char[6],unsigned long);
00109 VALUE rb_dbl2big(double);
00110 double rb_big2dbl(VALUE);
00111 VALUE rb_big_cmp(VALUE, VALUE);
00112 VALUE rb_big_eq(VALUE, VALUE);
00113 VALUE rb_big_plus(VALUE, VALUE);
00114 VALUE rb_big_minus(VALUE, VALUE);
00115 VALUE rb_big_mul(VALUE, VALUE);
00116 VALUE rb_big_div(VALUE, VALUE);
00117 VALUE rb_big_modulo(VALUE, VALUE);
00118 VALUE rb_big_divmod(VALUE, VALUE);
00119 VALUE rb_big_pow(VALUE, VALUE);
00120 VALUE rb_big_and(VALUE, VALUE);
00121 VALUE rb_big_or(VALUE, VALUE);
00122 VALUE rb_big_xor(VALUE, VALUE);
00123 VALUE rb_big_lshift(VALUE, VALUE);
00124 VALUE rb_big_rshift(VALUE, VALUE);
00125
00126 VALUE rb_rational_raw(VALUE, VALUE);
00127 #define rb_rational_raw1(x) rb_rational_raw(x, INT2FIX(1))
00128 #define rb_rational_raw2(x,y) rb_rational_raw(x, y)
00129 VALUE rb_rational_new(VALUE, VALUE);
00130 #define rb_rational_new1(x) rb_rational_new(x, INT2FIX(1))
00131 #define rb_rational_new2(x,y) rb_rational_new(x, y)
00132 VALUE rb_Rational(VALUE, VALUE);
00133 #define rb_Rational1(x) rb_Rational(x, INT2FIX(1))
00134 #define rb_Rational2(x,y) rb_Rational(x, y)
00135
00136 VALUE rb_complex_raw(VALUE, VALUE);
00137 #define rb_complex_raw1(x) rb_complex_raw(x, INT2FIX(0))
00138 #define rb_complex_raw2(x,y) rb_complex_raw(x, y)
00139 VALUE rb_complex_new(VALUE, VALUE);
00140 #define rb_complex_new1(x) rb_complex_new(x, INT2FIX(0))
00141 #define rb_complex_new2(x,y) rb_complex_new(x, y)
00142 VALUE rb_complex_polar(VALUE, VALUE);
00143 VALUE rb_Complex(VALUE, VALUE);
00144 #define rb_Complex1(x) rb_Complex(x, INT2FIX(0))
00145 #define rb_Complex2(x,y) rb_Complex(x, y)
00146
00147 VALUE rb_class_boot(VALUE);
00148 VALUE rb_class_new(VALUE);
00149 VALUE rb_mod_init_copy(VALUE, VALUE);
00150 VALUE rb_class_init_copy(VALUE, VALUE);
00151 VALUE rb_singleton_class_clone(VALUE);
00152 void rb_singleton_class_attached(VALUE,VALUE);
00153 VALUE rb_make_metaclass(VALUE, VALUE);
00154 void rb_check_inheritable(VALUE);
00155 VALUE rb_class_inherited(VALUE, VALUE);
00156 VALUE rb_define_class_id(ID, VALUE);
00157 VALUE rb_define_class_id_under(VALUE, ID, VALUE);
00158 VALUE rb_module_new(void);
00159 VALUE rb_define_module_id(ID);
00160 VALUE rb_define_module_id_under(VALUE, ID);
00161 VALUE rb_mod_included_modules(VALUE);
00162 VALUE rb_mod_include_p(VALUE, VALUE);
00163 VALUE rb_mod_ancestors(VALUE);
00164 VALUE rb_class_instance_methods(int, VALUE*, VALUE);
00165 VALUE rb_class_public_instance_methods(int, VALUE*, VALUE);
00166 VALUE rb_class_protected_instance_methods(int, VALUE*, VALUE);
00167 VALUE rb_class_private_instance_methods(int, VALUE*, VALUE);
00168 VALUE rb_obj_singleton_methods(int, VALUE*, VALUE);
00169 void rb_define_method_id(VALUE, ID, VALUE (*)(ANYARGS), int);
00170 void rb_frozen_class_p(VALUE);
00171 void rb_undef(VALUE, ID);
00172 void rb_define_protected_method(VALUE, const char*, VALUE (*)(ANYARGS), int);
00173 void rb_define_private_method(VALUE, const char*, VALUE (*)(ANYARGS), int);
00174 void rb_define_singleton_method(VALUE, const char*, VALUE(*)(ANYARGS), int);
00175 VALUE rb_singleton_class(VALUE);
00176
00177 int rb_cmpint(VALUE, VALUE, VALUE);
00178 NORETURN(void rb_cmperr(VALUE, VALUE));
00179
00180 VALUE rb_fiber_new(VALUE (*)(ANYARGS), VALUE);
00181 VALUE rb_fiber_resume(VALUE fib, int argc, VALUE *args);
00182 VALUE rb_fiber_yield(int argc, VALUE *args);
00183 VALUE rb_fiber_current(void);
00184 VALUE rb_fiber_alive_p(VALUE);
00185
00186
00187 VALUE rb_enumeratorize(VALUE, VALUE, int, VALUE *);
00188 #define RETURN_ENUMERATOR(obj, argc, argv) do { \
00189 if (!rb_block_given_p()) \
00190 return rb_enumeratorize(obj, ID2SYM(rb_frame_this_func()), \
00191 argc, argv); \
00192 } while (0)
00193
00194 VALUE rb_exc_new(VALUE, const char*, long);
00195 VALUE rb_exc_new2(VALUE, const char*);
00196 VALUE rb_exc_new3(VALUE, VALUE);
00197 PRINTF_ARGS(NORETURN(void rb_loaderror(const char*, ...)), 1, 2);
00198 PRINTF_ARGS(NORETURN(void rb_name_error(ID, const char*, ...)), 2, 3);
00199 NORETURN(void rb_invalid_str(const char*, const char*));
00200 PRINTF_ARGS(void rb_compile_error(const char*, int, const char*, ...), 3, 4);
00201 PRINTF_ARGS(void rb_compile_error_append(const char*, ...), 1, 2);
00202 NORETURN(void rb_load_fail(const char*));
00203 NORETURN(void rb_error_frozen(const char*));
00204 void rb_check_frozen(VALUE);
00205
00206 int rb_sourceline(void);
00207 const char *rb_sourcefile(void);
00208 VALUE rb_check_funcall(VALUE, ID, int, VALUE*);
00209
00210 #if defined(NFDBITS) && defined(HAVE_RB_FD_INIT)
00211 typedef struct {
00212 int maxfd;
00213 fd_set *fdset;
00214 } rb_fdset_t;
00215
00216 void rb_fd_init(volatile rb_fdset_t *);
00217 void rb_fd_term(rb_fdset_t *);
00218 void rb_fd_zero(rb_fdset_t *);
00219 void rb_fd_set(int, rb_fdset_t *);
00220 void rb_fd_clr(int, rb_fdset_t *);
00221 int rb_fd_isset(int, const rb_fdset_t *);
00222 void rb_fd_copy(rb_fdset_t *, const fd_set *, int);
00223 int rb_fd_select(int, rb_fdset_t *, rb_fdset_t *, rb_fdset_t *, struct timeval *);
00224
00225 #define rb_fd_ptr(f) ((f)->fdset)
00226 #define rb_fd_max(f) ((f)->maxfd)
00227
00228 #elif defined(_WIN32)
00229
00230 typedef struct {
00231 int capa;
00232 fd_set *fdset;
00233 } rb_fdset_t;
00234
00235 void rb_fd_init(volatile rb_fdset_t *);
00236 void rb_fd_term(rb_fdset_t *);
00237 #define rb_fd_zero(f) ((f)->fdset->fd_count = 0)
00238 void rb_fd_set(int, rb_fdset_t *);
00239 #define rb_fd_clr(n, f) rb_w32_fdclr(n, (f)->fdset)
00240 #define rb_fd_isset(n, f) rb_w32_fdisset(n, (f)->fdset)
00241 #define rb_fd_select(n, rfds, wfds, efds, timeout) rb_w32_select(n, (rfds) ? ((rb_fdset_t*)rfds)->fdset : NULL, (wfds) ? ((rb_fdset_t*)wfds)->fdset : NULL, (efds) ? ((rb_fdset_t*)efds)->fdset: NULL, timeout)
00242 #define rb_fd_resize(n, f) (void)(f)
00243
00244 #define rb_fd_ptr(f) ((f)->fdset)
00245 #define rb_fd_max(f) ((f)->fdset->fd_count)
00246
00247 #else
00248
00249 typedef fd_set rb_fdset_t;
00250 #define rb_fd_zero(f) FD_ZERO(f)
00251 #define rb_fd_set(n, f) FD_SET(n, f)
00252 #define rb_fd_clr(n, f) FD_CLR(n, f)
00253 #define rb_fd_isset(n, f) FD_ISSET(n, f)
00254 #define rb_fd_copy(d, s, n) (*(d) = *(s))
00255 #define rb_fd_resize(n, f) (void)(f)
00256 #define rb_fd_ptr(f) (f)
00257 #define rb_fd_init(f) FD_ZERO(f)
00258 #define rb_fd_term(f) (void)(f)
00259 #define rb_fd_max(f) FD_SETSIZE
00260 #define rb_fd_select(n, rfds, wfds, efds, timeout) select(n, rfds, wfds, efds, timeout)
00261
00262 #endif
00263
00264 NORETURN(void rb_exc_raise(VALUE));
00265 NORETURN(void rb_exc_fatal(VALUE));
00266 VALUE rb_f_exit(int,VALUE*);
00267 VALUE rb_f_abort(int,VALUE*);
00268 void rb_remove_method(VALUE, const char*);
00269 void rb_remove_method_id(VALUE, ID);
00270 #define rb_disable_super(klass, name) ((void)0)
00271 #define rb_enable_super(klass, name) ((void)0)
00272 #define HAVE_RB_DEFINE_ALLOC_FUNC 1
00273 typedef VALUE (*rb_alloc_func_t)(VALUE);
00274 void rb_define_alloc_func(VALUE, rb_alloc_func_t);
00275 void rb_undef_alloc_func(VALUE);
00276 rb_alloc_func_t rb_get_alloc_func(VALUE);
00277 void rb_clear_cache(void);
00278 void rb_clear_cache_by_class(VALUE);
00279 void rb_alias(VALUE, ID, ID);
00280 void rb_attr(VALUE,ID,int,int,int);
00281 int rb_method_boundp(VALUE, ID, int);
00282 int rb_method_basic_definition_p(VALUE, ID);
00283 VALUE rb_eval_cmd(VALUE, VALUE, int);
00284 int rb_obj_respond_to(VALUE, ID, int);
00285 int rb_respond_to(VALUE, ID);
00286 VALUE rb_f_notimplement(int argc, VALUE *argv, VALUE obj);
00287 void rb_interrupt(void);
00288 VALUE rb_apply(VALUE, ID, VALUE);
00289 void rb_backtrace(void);
00290 ID rb_frame_this_func(void);
00291 VALUE rb_obj_instance_eval(int, VALUE*, VALUE);
00292 VALUE rb_obj_instance_exec(int, VALUE*, VALUE);
00293 VALUE rb_mod_module_eval(int, VALUE*, VALUE);
00294 VALUE rb_mod_module_exec(int, VALUE*, VALUE);
00295 void rb_load(VALUE, int);
00296 void rb_load_protect(VALUE, int, int*);
00297 NORETURN(void rb_jump_tag(int));
00298 int rb_provided(const char*);
00299 int rb_feature_provided(const char *, const char **);
00300 void rb_provide(const char*);
00301 VALUE rb_f_require(VALUE, VALUE);
00302 VALUE rb_require_safe(VALUE, int);
00303 void rb_obj_call_init(VALUE, int, VALUE*);
00304 VALUE rb_class_new_instance(int, VALUE*, VALUE);
00305 VALUE rb_block_proc(void);
00306 VALUE rb_f_lambda(void);
00307 VALUE rb_proc_new(VALUE (*)(ANYARGS), VALUE);
00308 VALUE rb_obj_is_proc(VALUE);
00309 VALUE rb_proc_call(VALUE, VALUE);
00310 VALUE rb_proc_call_with_block(VALUE, int argc, VALUE *argv, VALUE);
00311 int rb_proc_arity(VALUE);
00312 VALUE rb_proc_lambda_p(VALUE);
00313 VALUE rb_binding_new(void);
00314 VALUE rb_obj_method(VALUE, VALUE);
00315 VALUE rb_method_call(int, VALUE*, VALUE);
00316 int rb_mod_method_arity(VALUE, ID);
00317 int rb_obj_method_arity(VALUE, ID);
00318 VALUE rb_protect(VALUE (*)(VALUE), VALUE, int*);
00319 void rb_set_end_proc(void (*)(VALUE), VALUE);
00320 void rb_mark_end_proc(void);
00321 void rb_exec_end_proc(void);
00322 void ruby_finalize(void);
00323 NORETURN(void ruby_stop(int));
00324 int ruby_cleanup(volatile int);
00325 void rb_gc_mark_threads(void);
00326 void rb_thread_schedule(void);
00327 void rb_thread_wait_fd(int);
00328 int rb_thread_fd_writable(int);
00329 void rb_thread_fd_close(int);
00330 int rb_thread_alone(void);
00331 void rb_thread_polling(void);
00332 void rb_thread_sleep(int);
00333 void rb_thread_sleep_forever(void);
00334 VALUE rb_thread_stop(void);
00335 VALUE rb_thread_wakeup(VALUE);
00336 VALUE rb_thread_run(VALUE);
00337 VALUE rb_thread_kill(VALUE);
00338 VALUE rb_thread_create(VALUE (*)(ANYARGS), void*);
00339 int rb_thread_select(int, fd_set *, fd_set *, fd_set *, struct timeval *);
00340 int rb_thread_fd_select(int, rb_fdset_t *, rb_fdset_t *, rb_fdset_t *, struct timeval *);
00341 void rb_thread_wait_for(struct timeval);
00342 VALUE rb_thread_current(void);
00343 VALUE rb_thread_main(void);
00344 VALUE rb_thread_local_aref(VALUE, ID);
00345 VALUE rb_thread_local_aset(VALUE, ID, VALUE);
00346 void rb_thread_atfork(void);
00347 void rb_thread_atfork_before_exec(void);
00348 VALUE rb_exec_recursive(VALUE(*)(VALUE, VALUE, int),VALUE,VALUE);
00349 VALUE rb_exec_recursive_paired(VALUE(*)(VALUE, VALUE, int),VALUE,VALUE,VALUE);
00350 VALUE rb_exec_recursive_outer(VALUE(*)(VALUE, VALUE, int),VALUE,VALUE);
00351
00352 VALUE rb_dir_getwd(void);
00353
00354 VALUE rb_file_s_expand_path(int, VALUE *);
00355 VALUE rb_file_expand_path(VALUE, VALUE);
00356 VALUE rb_file_s_absolute_path(int, VALUE *);
00357 VALUE rb_file_absolute_path(VALUE, VALUE);
00358 VALUE rb_file_dirname(VALUE fname);
00359 void rb_file_const(const char*, VALUE);
00360 int rb_file_load_ok(const char *);
00361 int rb_find_file_ext_safe(VALUE*, const char* const*, int);
00362 VALUE rb_find_file_safe(VALUE, int);
00363 int rb_find_file_ext(VALUE*, const char* const*);
00364 VALUE rb_find_file(VALUE);
00365 char *rb_path_next(const char *);
00366 char *rb_path_skip_prefix(const char *);
00367 char *rb_path_last_separator(const char *);
00368 char *rb_path_end(const char *);
00369 VALUE rb_file_directory_p(VALUE,VALUE);
00370 VALUE rb_str_encode_ospath(VALUE);
00371 int rb_is_absolute_path(const char *);
00372
00373 void ruby_set_stack_size(size_t);
00374 NORETURN(void rb_memerror(void));
00375 int ruby_stack_check(void);
00376 size_t ruby_stack_length(VALUE**);
00377 int rb_during_gc(void);
00378 void rb_gc_mark_locations(VALUE*, VALUE*);
00379 void rb_mark_tbl(struct st_table*);
00380 void rb_mark_set(struct st_table*);
00381 void rb_mark_hash(struct st_table*);
00382 void rb_gc_mark_maybe(VALUE);
00383 void rb_gc_mark(VALUE);
00384 void rb_gc_force_recycle(VALUE);
00385 void rb_gc(void);
00386 void rb_gc_copy_finalizer(VALUE,VALUE);
00387 void rb_gc_finalize_deferred(void);
00388 void rb_gc_call_finalizer_at_exit(void);
00389 VALUE rb_gc_enable(void);
00390 VALUE rb_gc_disable(void);
00391 VALUE rb_gc_start(void);
00392 #define Init_stack(addr) ruby_init_stack(addr)
00393
00394 void st_foreach_safe(struct st_table *, int (*)(ANYARGS), st_data_t);
00395 void rb_hash_foreach(VALUE, int (*)(ANYARGS), VALUE);
00396 VALUE rb_hash(VALUE);
00397 VALUE rb_hash_new(void);
00398 VALUE rb_hash_dup(VALUE);
00399 VALUE rb_hash_freeze(VALUE);
00400 VALUE rb_hash_aref(VALUE, VALUE);
00401 VALUE rb_hash_lookup(VALUE, VALUE);
00402 VALUE rb_hash_lookup2(VALUE, VALUE, VALUE);
00403 VALUE rb_hash_fetch(VALUE, VALUE);
00404 VALUE rb_hash_aset(VALUE, VALUE, VALUE);
00405 VALUE rb_hash_delete_if(VALUE);
00406 VALUE rb_hash_delete(VALUE,VALUE);
00407 struct st_table *rb_hash_tbl(VALUE);
00408 int rb_path_check(const char*);
00409 int rb_env_path_tainted(void);
00410 VALUE rb_env_clear(void);
00411
00412 #define rb_defout rb_stdout
00413 RUBY_EXTERN VALUE rb_fs;
00414 RUBY_EXTERN VALUE rb_output_fs;
00415 RUBY_EXTERN VALUE rb_rs;
00416 RUBY_EXTERN VALUE rb_default_rs;
00417 RUBY_EXTERN VALUE rb_output_rs;
00418 VALUE rb_io_write(VALUE, VALUE);
00419 VALUE rb_io_gets(VALUE);
00420 VALUE rb_io_getbyte(VALUE);
00421 VALUE rb_io_ungetc(VALUE, VALUE);
00422 VALUE rb_io_ungetbyte(VALUE, VALUE);
00423 VALUE rb_io_close(VALUE);
00424 VALUE rb_io_flush(VALUE);
00425 VALUE rb_io_eof(VALUE);
00426 VALUE rb_io_binmode(VALUE);
00427 VALUE rb_io_ascii8bit_binmode(VALUE);
00428 VALUE rb_io_addstr(VALUE, VALUE);
00429 VALUE rb_io_printf(int, VALUE*, VALUE);
00430 VALUE rb_io_print(int, VALUE*, VALUE);
00431 VALUE rb_io_puts(int, VALUE*, VALUE);
00432 VALUE rb_io_fdopen(int, int, const char*);
00433 VALUE rb_io_get_io(VALUE);
00434 VALUE rb_file_open(const char*, const char*);
00435 VALUE rb_file_open_str(VALUE, const char*);
00436 VALUE rb_gets(void);
00437 void rb_write_error(const char*);
00438 void rb_write_error2(const char*, long);
00439 void rb_close_before_exec(int lowfd, int maxhint, VALUE noclose_fds);
00440 int rb_pipe(int *pipes);
00441
00442 VALUE rb_marshal_dump(VALUE, VALUE);
00443 VALUE rb_marshal_load(VALUE);
00444 void rb_marshal_define_compat(VALUE newclass, VALUE oldclass, VALUE (*dumper)(VALUE), VALUE (*loader)(VALUE, VALUE));
00445
00446 void rb_num_zerodiv(void);
00447 #define RB_NUM_COERCE_FUNCS_NEED_OPID 1
00448 VALUE rb_num_coerce_bin(VALUE, VALUE, ID);
00449 VALUE rb_num_coerce_cmp(VALUE, VALUE, ID);
00450 VALUE rb_num_coerce_relop(VALUE, VALUE, ID);
00451 VALUE rb_float_new(double);
00452 VALUE rb_num2fix(VALUE);
00453 VALUE rb_fix2str(VALUE, int);
00454 VALUE rb_dbl_cmp(double, double);
00455
00456 int rb_eql(VALUE, VALUE);
00457 VALUE rb_any_to_s(VALUE);
00458 VALUE rb_inspect(VALUE);
00459 VALUE rb_obj_is_instance_of(VALUE, VALUE);
00460 VALUE rb_obj_is_kind_of(VALUE, VALUE);
00461 VALUE rb_obj_alloc(VALUE);
00462 VALUE rb_obj_clone(VALUE);
00463 VALUE rb_obj_dup(VALUE);
00464 VALUE rb_obj_init_copy(VALUE,VALUE);
00465 VALUE rb_obj_taint(VALUE);
00466 VALUE rb_obj_tainted(VALUE);
00467 VALUE rb_obj_untaint(VALUE);
00468 VALUE rb_obj_untrust(VALUE);
00469 VALUE rb_obj_untrusted(VALUE);
00470 VALUE rb_obj_trust(VALUE);
00471 VALUE rb_obj_freeze(VALUE);
00472 VALUE rb_obj_frozen_p(VALUE);
00473 VALUE rb_obj_id(VALUE);
00474 VALUE rb_obj_class(VALUE);
00475 VALUE rb_class_real(VALUE);
00476 VALUE rb_class_inherited_p(VALUE, VALUE);
00477 VALUE rb_convert_type(VALUE,int,const char*,const char*);
00478 VALUE rb_check_convert_type(VALUE,int,const char*,const char*);
00479 VALUE rb_check_to_integer(VALUE, const char *);
00480 VALUE rb_check_to_float(VALUE);
00481 VALUE rb_to_int(VALUE);
00482 VALUE rb_Integer(VALUE);
00483 VALUE rb_to_float(VALUE);
00484 VALUE rb_Float(VALUE);
00485 VALUE rb_String(VALUE);
00486 VALUE rb_Array(VALUE);
00487 double rb_cstr_to_dbl(const char*, int);
00488 double rb_str_to_dbl(VALUE, int);
00489
00490 RUBY_EXTERN int ruby_sourceline;
00491 RUBY_EXTERN char *ruby_sourcefile;
00492 ID rb_id_attrset(ID);
00493 void rb_gc_mark_parser(void);
00494 int rb_is_const_id(ID);
00495 int rb_is_instance_id(ID);
00496 int rb_is_class_id(ID);
00497 int rb_is_local_id(ID);
00498 int rb_is_junk_id(ID);
00499 int rb_symname_p(const char*);
00500 int rb_sym_interned_p(VALUE);
00501 void rb_gc_mark_symbols(void);
00502 VALUE rb_backref_get(void);
00503 void rb_backref_set(VALUE);
00504 VALUE rb_lastline_get(void);
00505 void rb_lastline_set(VALUE);
00506 VALUE rb_sym_all_symbols(void);
00507
00508 void rb_last_status_set(int status, rb_pid_t pid);
00509 VALUE rb_last_status_get(void);
00510 struct rb_exec_arg {
00511 int argc;
00512 VALUE *argv;
00513 const char *prog;
00514 VALUE options;
00515 VALUE redirect_fds;
00516 };
00517 int rb_proc_exec_n(int, VALUE*, const char*);
00518 int rb_proc_exec(const char*);
00519 VALUE rb_exec_arg_init(int argc, VALUE *argv, int accept_shell, struct rb_exec_arg *e);
00520 int rb_exec_arg_addopt(struct rb_exec_arg *e, VALUE key, VALUE val);
00521 void rb_exec_arg_fixup(struct rb_exec_arg *e);
00522 int rb_run_exec_options(const struct rb_exec_arg *e, struct rb_exec_arg *s);
00523 int rb_run_exec_options_err(const struct rb_exec_arg *e, struct rb_exec_arg *s, char*, size_t);
00524 int rb_exec(const struct rb_exec_arg*);
00525 int rb_exec_err(const struct rb_exec_arg*, char*, size_t);
00526 rb_pid_t rb_fork(int*, int (*)(void*), void*, VALUE);
00527 rb_pid_t rb_fork_err(int*, int (*)(void*, char*, size_t), void*, VALUE, char*, size_t);
00528 VALUE rb_f_exec(int,VALUE*);
00529 rb_pid_t rb_waitpid(rb_pid_t pid, int *status, int flags);
00530 void rb_syswait(rb_pid_t pid);
00531 rb_pid_t rb_spawn(int, VALUE*);
00532 rb_pid_t rb_spawn_err(int, VALUE*, char*, size_t);
00533 VALUE rb_proc_times(VALUE);
00534 VALUE rb_detach_process(rb_pid_t pid);
00535
00536 VALUE rb_range_new(VALUE, VALUE, int);
00537 VALUE rb_range_beg_len(VALUE, long*, long*, long, int);
00538 int rb_range_values(VALUE range, VALUE *begp, VALUE *endp, int *exclp);
00539
00540 unsigned int rb_genrand_int32(void);
00541 double rb_genrand_real(void);
00542 void rb_reset_random_seed(void);
00543 VALUE rb_random_bytes(VALUE rnd, long n);
00544 VALUE rb_random_int(VALUE rnd, VALUE max);
00545 unsigned int rb_random_int32(VALUE rnd);
00546 double rb_random_real(VALUE rnd);
00547
00548 #define rb_memcmp memcmp
00549 int rb_memcicmp(const void*,const void*,long);
00550 void rb_match_busy(VALUE);
00551 VALUE rb_reg_nth_defined(int, VALUE);
00552 VALUE rb_reg_nth_match(int, VALUE);
00553 int rb_reg_backref_number(VALUE match, VALUE backref);
00554 VALUE rb_reg_last_match(VALUE);
00555 VALUE rb_reg_match_pre(VALUE);
00556 VALUE rb_reg_match_post(VALUE);
00557 VALUE rb_reg_match_last(VALUE);
00558 #define HAVE_RB_REG_NEW_STR 1
00559 VALUE rb_reg_new_str(VALUE, int);
00560 VALUE rb_reg_new(const char *, long, int);
00561 VALUE rb_reg_alloc(void);
00562 VALUE rb_reg_init_str(VALUE re, VALUE s, int options);
00563 VALUE rb_reg_match(VALUE, VALUE);
00564 VALUE rb_reg_match2(VALUE);
00565 int rb_reg_options(VALUE);
00566 void rb_set_kcode(const char*);
00567 const char* rb_get_kcode(void);
00568
00569 #define rb_argv rb_get_argv()
00570 RUBY_EXTERN VALUE rb_argv0;
00571 VALUE rb_get_argv(void);
00572 void *rb_load_file(const char*);
00573 void ruby_script(const char*);
00574 void ruby_prog_init(void);
00575 void ruby_set_argv(int, char**);
00576 void *ruby_process_options(int, char**);
00577 void ruby_init_loadpath(void);
00578 void ruby_incpush(const char*);
00579
00580 VALUE rb_f_kill(int, VALUE*);
00581 void rb_gc_mark_trap_list(void);
00582 #ifdef POSIX_SIGNAL
00583 #define posix_signal ruby_posix_signal
00584 RETSIGTYPE (*posix_signal(int, RETSIGTYPE (*)(int)))(int);
00585 #endif
00586 void ruby_sig_finalize(void);
00587 void rb_trap_exit(void);
00588 void rb_trap_exec(void);
00589 const char *ruby_signal_name(int);
00590 void ruby_default_signal(int);
00591
00592 VALUE rb_f_sprintf(int, const VALUE*);
00593 PRINTF_ARGS(VALUE rb_sprintf(const char*, ...), 1, 2);
00594 VALUE rb_vsprintf(const char*, va_list);
00595 PRINTF_ARGS(VALUE rb_str_catf(VALUE, const char*, ...), 2, 3);
00596 VALUE rb_str_vcatf(VALUE, const char*, va_list);
00597 VALUE rb_str_format(int, const VALUE *, VALUE);
00598
00599 VALUE rb_str_new(const char*, long);
00600 VALUE rb_str_new_cstr(const char*);
00601 VALUE rb_str_new2(const char*);
00602 VALUE rb_str_new_shared(VALUE);
00603 VALUE rb_str_new3(VALUE);
00604 VALUE rb_str_new_frozen(VALUE);
00605 VALUE rb_str_new4(VALUE);
00606 VALUE rb_str_new_with_class(VALUE, const char*, long);
00607 VALUE rb_str_new5(VALUE, const char*, long);
00608 VALUE rb_tainted_str_new_cstr(const char*);
00609 VALUE rb_tainted_str_new(const char*, long);
00610 VALUE rb_tainted_str_new2(const char*);
00611 VALUE rb_external_str_new(const char*, long);
00612 VALUE rb_external_str_new_cstr(const char*);
00613 VALUE rb_locale_str_new(const char*, long);
00614 VALUE rb_locale_str_new_cstr(const char*);
00615 VALUE rb_filesystem_str_new(const char*, long);
00616 VALUE rb_filesystem_str_new_cstr(const char*);
00617 VALUE rb_str_buf_new(long);
00618 VALUE rb_str_buf_new_cstr(const char*);
00619 VALUE rb_str_buf_new2(const char*);
00620 VALUE rb_str_tmp_new(long);
00621 VALUE rb_usascii_str_new(const char*, long);
00622 VALUE rb_usascii_str_new_cstr(const char*);
00623 VALUE rb_usascii_str_new2(const char*);
00624 void rb_str_free(VALUE);
00625 void rb_str_shared_replace(VALUE, VALUE);
00626 VALUE rb_str_buf_append(VALUE, VALUE);
00627 VALUE rb_str_buf_cat(VALUE, const char*, long);
00628 VALUE rb_str_buf_cat2(VALUE, const char*);
00629 VALUE rb_str_buf_cat_ascii(VALUE, const char*);
00630 VALUE rb_obj_as_string(VALUE);
00631 VALUE rb_check_string_type(VALUE);
00632 VALUE rb_str_dup(VALUE);
00633 VALUE rb_str_locktmp(VALUE);
00634 VALUE rb_str_unlocktmp(VALUE);
00635 VALUE rb_str_dup_frozen(VALUE);
00636 #define rb_str_dup_frozen rb_str_new_frozen
00637 VALUE rb_str_plus(VALUE, VALUE);
00638 VALUE rb_str_times(VALUE, VALUE);
00639 long rb_str_sublen(VALUE, long);
00640 VALUE rb_str_substr(VALUE, long, long);
00641 VALUE rb_str_subseq(VALUE, long, long);
00642 void rb_str_modify(VALUE);
00643 VALUE rb_str_freeze(VALUE);
00644 void rb_str_set_len(VALUE, long);
00645 VALUE rb_str_resize(VALUE, long);
00646 VALUE rb_str_cat(VALUE, const char*, long);
00647 VALUE rb_str_cat2(VALUE, const char*);
00648 VALUE rb_str_append(VALUE, VALUE);
00649 VALUE rb_str_concat(VALUE, VALUE);
00650 st_index_t rb_memhash(const void *ptr, long len);
00651 st_index_t rb_hash_start(st_index_t);
00652 st_index_t rb_hash_uint32(st_index_t, uint32_t);
00653 st_index_t rb_hash_uint(st_index_t, st_index_t);
00654 st_index_t rb_hash_end(st_index_t);
00655 #define rb_hash_uint32(h, i) st_hash_uint32(h, i)
00656 #define rb_hash_uint(h, i) st_hash_uint(h, i)
00657 #define rb_hash_end(h) st_hash_end(h)
00658 st_index_t rb_str_hash(VALUE);
00659 int rb_str_hash_cmp(VALUE,VALUE);
00660 int rb_str_comparable(VALUE, VALUE);
00661 int rb_str_cmp(VALUE, VALUE);
00662 VALUE rb_str_equal(VALUE str1, VALUE str2);
00663 VALUE rb_str_drop_bytes(VALUE, long);
00664 void rb_str_update(VALUE, long, long, VALUE);
00665 VALUE rb_str_replace(VALUE, VALUE);
00666 VALUE rb_str_inspect(VALUE);
00667 VALUE rb_str_dump(VALUE);
00668 VALUE rb_str_split(VALUE, const char*);
00669 void rb_str_associate(VALUE, VALUE);
00670 VALUE rb_str_associated(VALUE);
00671 void rb_str_setter(VALUE, ID, VALUE*);
00672 VALUE rb_str_intern(VALUE);
00673 VALUE rb_sym_to_s(VALUE);
00674 long rb_str_strlen(VALUE);
00675 VALUE rb_str_length(VALUE);
00676 long rb_str_offset(VALUE, long);
00677 size_t rb_str_capacity(VALUE);
00678 #if defined __GNUC__
00679 #define rb_str_new_cstr(str) __extension__ ( \
00680 { \
00681 (__builtin_constant_p(str)) ? \
00682 rb_str_new(str, (long)strlen(str)) : \
00683 rb_str_new_cstr(str); \
00684 })
00685 #define rb_tainted_str_new_cstr(str) __extension__ ( \
00686 { \
00687 (__builtin_constant_p(str)) ? \
00688 rb_tainted_str_new(str, (long)strlen(str)) : \
00689 rb_tainted_str_new_cstr(str); \
00690 })
00691 #define rb_usascii_str_new_cstr(str) __extension__ ( \
00692 { \
00693 (__builtin_constant_p(str)) ? \
00694 rb_usascii_str_new(str, (long)strlen(str)) : \
00695 rb_usascii_str_new_cstr(str); \
00696 })
00697 #define rb_external_str_new_cstr(str) __extension__ ( \
00698 { \
00699 (__builtin_constant_p(str)) ? \
00700 rb_external_str_new(str, (long)strlen(str)) : \
00701 rb_external_str_new_cstr(str); \
00702 })
00703 #define rb_locale_str_new_cstr(str) __extension__ ( \
00704 { \
00705 (__builtin_constant_p(str)) ? \
00706 rb_locale_str_new(str, (long)strlen(str)) : \
00707 rb_locale_str_new_cstr(str); \
00708 })
00709 #define rb_str_buf_new_cstr(str) __extension__ ( \
00710 { \
00711 (__builtin_constant_p(str)) ? \
00712 rb_str_buf_cat(rb_str_buf_new((long)strlen(str)), \
00713 str, (long)strlen(str)) : \
00714 rb_str_buf_new_cstr(str); \
00715 })
00716 #define rb_str_buf_cat2(str, ptr) __extension__ ( \
00717 { \
00718 (__builtin_constant_p(ptr)) ? \
00719 rb_str_buf_cat(str, ptr, (long)strlen(ptr)) : \
00720 rb_str_buf_cat2(str, ptr); \
00721 })
00722 #define rb_str_cat2(str, ptr) __extension__ ( \
00723 { \
00724 (__builtin_constant_p(ptr)) ? \
00725 rb_str_cat(str, ptr, (long)strlen(ptr)) : \
00726 rb_str_cat2(str, ptr); \
00727 })
00728 #define rb_exc_new2(klass, ptr) __extension__ ( \
00729 { \
00730 (__builtin_constant_p(ptr)) ? \
00731 rb_exc_new(klass, ptr, (long)strlen(ptr)) : \
00732 rb_exc_new2(klass, ptr); \
00733 })
00734 #endif
00735 #define rb_str_new2 rb_str_new_cstr
00736 #define rb_str_new3 rb_str_new_shared
00737 #define rb_str_new4 rb_str_new_frozen
00738 #define rb_str_new5 rb_str_new_with_class
00739 #define rb_tainted_str_new2 rb_tainted_str_new_cstr
00740 #define rb_str_buf_new2 rb_str_buf_new_cstr
00741 #define rb_usascii_str_new2 rb_usascii_str_new_cstr
00742
00743 VALUE rb_struct_new(VALUE, ...);
00744 VALUE rb_struct_define(const char*, ...);
00745 VALUE rb_struct_alloc(VALUE, VALUE);
00746 VALUE rb_struct_initialize(VALUE, VALUE);
00747 VALUE rb_struct_aref(VALUE, VALUE);
00748 VALUE rb_struct_aset(VALUE, VALUE, VALUE);
00749 VALUE rb_struct_getmember(VALUE, ID);
00750 DEPRECATED(VALUE rb_struct_iv_get(VALUE, const char*));
00751 VALUE rb_struct_s_members(VALUE);
00752 VALUE rb_struct_members(VALUE);
00753 VALUE rb_struct_alloc_noinit(VALUE);
00754 VALUE rb_struct_define_without_accessor(const char *, VALUE, rb_alloc_func_t, ...);
00755
00756 typedef void rb_unblock_function_t(void *);
00757 typedef VALUE rb_blocking_function_t(void *);
00758 void rb_thread_check_ints(void);
00759 int rb_thread_interrupted(VALUE thval);
00760 VALUE rb_thread_blocking_region(rb_blocking_function_t *func, void *data1,
00761 rb_unblock_function_t *ubf, void *data2);
00762 #define RUBY_UBF_IO ((rb_unblock_function_t *)-1)
00763 #define RUBY_UBF_PROCESS ((rb_unblock_function_t *)-1)
00764 VALUE rb_mutex_new(void);
00765 VALUE rb_mutex_locked_p(VALUE mutex);
00766 VALUE rb_mutex_try_lock(VALUE mutex);
00767 VALUE rb_mutex_lock(VALUE mutex);
00768 VALUE rb_mutex_unlock(VALUE mutex);
00769 VALUE rb_mutex_sleep(VALUE self, VALUE timeout);
00770 VALUE rb_mutex_synchronize(VALUE mutex, VALUE (*func)(VALUE arg), VALUE arg);
00771 VALUE rb_barrier_new(void);
00772 VALUE rb_barrier_wait(VALUE self);
00773 VALUE rb_barrier_release(VALUE self);
00774 VALUE rb_barrier_destroy(VALUE self);
00775
00776 VALUE rb_time_new(time_t, long);
00777 VALUE rb_time_nano_new(time_t, long);
00778 VALUE rb_time_num_new(VALUE, VALUE);
00779
00780 VALUE rb_mod_name(VALUE);
00781 VALUE rb_class_path(VALUE);
00782 void rb_set_class_path(VALUE, VALUE, const char*);
00783 void rb_set_class_path_string(VALUE, VALUE, VALUE);
00784 VALUE rb_path_to_class(VALUE);
00785 VALUE rb_path2class(const char*);
00786 void rb_name_class(VALUE, ID);
00787 VALUE rb_class_name(VALUE);
00788 void rb_autoload(VALUE, ID, const char*);
00789 VALUE rb_autoload_load(VALUE, ID);
00790 VALUE rb_autoload_p(VALUE, ID);
00791 void rb_gc_mark_global_tbl(void);
00792 VALUE rb_f_trace_var(int, VALUE*);
00793 VALUE rb_f_untrace_var(int, VALUE*);
00794 VALUE rb_f_global_variables(void);
00795 void rb_alias_variable(ID, ID);
00796 struct st_table* rb_generic_ivar_table(VALUE);
00797 void rb_copy_generic_ivar(VALUE,VALUE);
00798 void rb_mark_generic_ivar(VALUE);
00799 void rb_mark_generic_ivar_tbl(void);
00800 void rb_free_generic_ivar(VALUE);
00801 VALUE rb_ivar_get(VALUE, ID);
00802 VALUE rb_ivar_set(VALUE, ID, VALUE);
00803 VALUE rb_ivar_defined(VALUE, ID);
00804 void rb_ivar_foreach(VALUE, int (*)(ANYARGS), st_data_t);
00805 st_index_t rb_ivar_count(VALUE);
00806 VALUE rb_iv_set(VALUE, const char*, VALUE);
00807 VALUE rb_iv_get(VALUE, const char*);
00808 VALUE rb_attr_get(VALUE, ID);
00809 VALUE rb_obj_instance_variables(VALUE);
00810 VALUE rb_obj_remove_instance_variable(VALUE, VALUE);
00811 void *rb_mod_const_at(VALUE, void*);
00812 void *rb_mod_const_of(VALUE, void*);
00813 VALUE rb_const_list(void*);
00814 VALUE rb_mod_constants(int, VALUE *, VALUE);
00815 VALUE rb_mod_remove_const(VALUE, VALUE);
00816 int rb_const_defined(VALUE, ID);
00817 int rb_const_defined_at(VALUE, ID);
00818 int rb_const_defined_from(VALUE, ID);
00819 VALUE rb_const_get(VALUE, ID);
00820 VALUE rb_const_get_at(VALUE, ID);
00821 VALUE rb_const_get_from(VALUE, ID);
00822 void rb_const_set(VALUE, ID, VALUE);
00823 VALUE rb_const_remove(VALUE, ID);
00824 VALUE rb_mod_const_missing(VALUE,VALUE);
00825 VALUE rb_cvar_defined(VALUE, ID);
00826 void rb_cvar_set(VALUE, ID, VALUE);
00827 VALUE rb_cvar_get(VALUE, ID);
00828 void rb_cv_set(VALUE, const char*, VALUE);
00829 VALUE rb_cv_get(VALUE, const char*);
00830 void rb_define_class_variable(VALUE, const char*, VALUE);
00831 VALUE rb_mod_class_variables(VALUE);
00832 VALUE rb_mod_remove_cvar(VALUE, VALUE);
00833
00834 void ruby_show_version(void);
00835 void ruby_show_copyright(void);
00836
00837 ID rb_frame_callee(void);
00838 VALUE rb_str_succ(VALUE);
00839 VALUE rb_time_succ(VALUE);
00840 void rb_frame_pop(void);
00841 int rb_frame_method_id_and_class(ID *idp, VALUE *klassp);
00842
00843 #if defined(__cplusplus)
00844 #if 0
00845 {
00846 #endif
00847 }
00848 #endif
00849
00850 #endif
00851