Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Globals

error.c File Reference

#include "ruby.h"
#include "env.h"
#include "st.h"
#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
#include <errno.h>

Go to the source code of this file.

Data Structures

struct  types

Defines

#define va_init_list(a, b)   va_start(a,b)
#define EXIT_SUCCESS   0

Functions

int err_position (char *buf, long len)
void err_snprintf (char *buf, long len, const char *fmt, va_list args)
void err_append (const char *)
void err_print (char *fmt, va_list args) const
void rb_compile_error (const char *fmt,...)
void rb_compile_error_append (const char *fmt,...)
void warn_print (char *fmt, va_list args) const
void rb_warn (const char *fmt,...)
void rb_warning (const char *fmt,...)
VALUE rb_warn_m (VALUE self, VALUE mesg)
void rb_bug (const char *fmt,...)
void rb_check_type (VALUE x, int t)
VALUE rb_exc_new (VALUE etype, const char *ptr, long len)
VALUE rb_exc_new2 (VALUE etype, const char *s)
VALUE rb_exc_new3 (VALUE etype, VALUE str)
VALUE exc_initialize (int argc, VALUE *argv, VALUE exc)
VALUE exc_exception (int argc, VALUE *argv, VALUE self)
VALUE exc_to_s (VALUE exc)
VALUE exc_to_str (VALUE exc)
VALUE exc_inspect (VALUE exc)
VALUE exc_backtrace (VALUE exc)
VALUE check_backtrace (VALUE bt)
VALUE exc_set_backtrace (VALUE exc, VALUE bt)
VALUE exit_initialize (int argc, VALUE *argv, VALUE exc)
VALUE exit_status (VALUE exc)
VALUE exit_success_p (VALUE exc)
void rb_name_error (ID id, const char *fmt,...)
VALUE name_err_initialize (int argc, VALUE *argv, VALUE self)
VALUE name_err_name (VALUE self)
VALUE name_err_to_s (VALUE exc)
VALUE nometh_err_initialize (int argc, VALUE *argv, VALUE self)
void name_err_mesg_mark (VALUE *ptr)
VALUE name_err_mesg_new (VALUE obj, VALUE mesg, VALUE recv, VALUE method)
VALUE name_err_mesg_to_str (VALUE obj)
VALUE name_err_mesg_load (VALUE klass, VALUE str)
VALUE nometh_err_args (VALUE self)
void rb_invalid_str (char *str, char *type) const
VALUE set_syserr (int n, const char *name)
VALUE get_syserr (int n)
VALUE syserr_initialize (int argc, VALUE *argv, VALUE self)
VALUE syserr_errno (VALUE self)
VALUE syserr_eqq (VALUE self, VALUE exc)
void Init_Exception ()
void rb_raise (VALUE exc, const char *fmt,...)
void rb_loaderror (const char *fmt,...)
void rb_notimplement ()
void rb_fatal (const char *fmt,...)
void rb_sys_fail (char *mesg) const
void rb_sys_warning (const char *fmt,...)
void rb_load_fail (char *path) const
void rb_error_frozen (char *what) const
void rb_check_frozen (VALUE obj)
void Init_syserr ()
void err_append (char *s) const

Variables

const char ruby_version []
const char ruby_release_date []
const char ruby_platform []
int ruby_nerrs
types builtin_types []
VALUE rb_eException
VALUE rb_eSystemExit
VALUE rb_eInterrupt
VALUE rb_eSignal
VALUE rb_eFatal
VALUE rb_eStandardError
VALUE rb_eRuntimeError
VALUE rb_eTypeError
VALUE rb_eArgError
VALUE rb_eIndexError
VALUE rb_eRangeError
VALUE rb_eNameError
VALUE rb_eNoMethodError
VALUE rb_eSecurityError
VALUE rb_eNotImpError
VALUE rb_eNoMemError
VALUE rb_cNameErrorMesg
VALUE rb_eScriptError
VALUE rb_eSyntaxError
VALUE rb_eLoadError
VALUE rb_eSystemCallError
VALUE rb_mErrno
st_tablesyserr_tbl


Define Documentation

#define EXIT_SUCCESS   0
 

Definition at line 29 of file error.c.

Referenced by error_handle(), exit_initialize(), exit_success_p(), pst_success_p(), rb_f_exit(), rb_f_exit_bang(), rb_f_system(), rb_thread_kill(), and rb_thread_signal_exit().

#define va_init_list a,
 )     va_start(a,b)
 

Definition at line 20 of file error.c.


Function Documentation

VALUE check_backtrace VALUE  bt  )  [static]
 

Definition at line 498 of file error.c.

References NIL_P, RARRAY, rb_ary_new3(), rb_eTypeError, rb_raise(), T_ARRAY, T_STRING, TYPE, and VALUE.

Referenced by exc_set_backtrace().

void err_append char *  s  )  const [static]
 

Definition at line 1545 of file error.c.

References NIL_P, rb_eSyntaxError, rb_exc_new2(), rb_exc_new3(), rb_obj_as_string(), rb_str_cat2(), rb_write_error(), ruby_errinfo, ruby_in_eval, and VALUE.

Referenced by err_print(), and rb_compile_error_append().

void err_append const char *   )  [static]
 

int err_position char *  buf,
long  len
[static]
 

Definition at line 37 of file error.c.

References ruby_set_current_source(), ruby_sourcefile, ruby_sourceline, and snprintf().

Referenced by err_snprintf(), and rb_bug().

void err_print char *  fmt,
va_list  args
const [static]
 

Definition at line 70 of file error.c.

References args, err_append(), and err_snprintf().

Referenced by rb_compile_error().

void err_snprintf char *  buf,
long  len,
const char *  fmt,
va_list  args
[static]
 

Definition at line 54 of file error.c.

References args, err_position(), and vsnprintf().

Referenced by err_print(), and warn_print().

VALUE exc_backtrace VALUE  exc  )  [static]
 

Definition at line 488 of file error.c.

References ID, Qnil, rb_intern(), rb_ivar_defined(), rb_ivar_get(), and VALUE.

Referenced by Init_Exception().

VALUE exc_exception int  argc,
VALUE argv,
VALUE  self
[static]
 

Definition at line 377 of file error.c.

References exc_initialize(), rb_obj_clone(), and VALUE.

Referenced by Init_Exception().

VALUE exc_initialize int  argc,
VALUE argv,
VALUE  exc
[static]
 

Definition at line 349 of file error.c.

References Qnil, rb_iv_set(), rb_scan_args(), and VALUE.

Referenced by exc_exception(), and Init_Exception().

VALUE exc_inspect VALUE  exc  )  [static]
 

Definition at line 437 of file error.c.

References CLASS_OF, rb_class_name(), rb_obj_as_string(), rb_str_buf_append(), rb_str_buf_cat(), rb_str_buf_new2(), rb_str_dup(), RSTRING, and VALUE.

Referenced by Init_Exception().

VALUE exc_set_backtrace VALUE  exc,
VALUE  bt
[static]
 

Definition at line 531 of file error.c.

References check_backtrace(), rb_iv_set(), and VALUE.

Referenced by Init_Exception().

VALUE exc_to_s VALUE  exc  )  [static]
 

Definition at line 401 of file error.c.

References CLASS_OF, NIL_P, OBJ_TAINT, OBJ_TAINTED, rb_attr_get(), rb_class_name(), rb_intern(), and VALUE.

Referenced by Init_Exception().

VALUE exc_to_str VALUE  exc  )  [static]
 

Definition at line 423 of file error.c.

References rb_funcall(), rb_intern(), and VALUE.

Referenced by Init_Exception().

VALUE exit_initialize int  argc,
VALUE argv,
VALUE  exc
[static]
 

Definition at line 546 of file error.c.

References EXIT_SUCCESS, FIXNUM_P, INT2FIX, rb_call_super(), rb_iv_set(), and VALUE.

Referenced by Init_Exception().

VALUE exit_status VALUE  exc  )  [static]
 

Definition at line 570 of file error.c.

References rb_attr_get(), rb_intern(), and VALUE.

Referenced by Init_Exception().

VALUE exit_success_p VALUE  exc  )  [static]
 

Definition at line 585 of file error.c.

References EXIT_SUCCESS, INT2FIX, NIL_P, Qfalse, Qtrue, rb_attr_get(), rb_intern(), and VALUE.

Referenced by Init_Exception().

VALUE get_syserr int  n  )  [static]
 

Definition at line 851 of file error.c.

References name, set_syserr(), snprintf(), st_lookup(), syserr_tbl, and VALUE.

Referenced by rb_sys_fail().

void Init_Exception void   ) 
 

Definition at line 985 of file error.c.

References exc_backtrace(), exc_exception(), exc_initialize(), exc_inspect(), exc_set_backtrace(), exc_to_s(), exc_to_str(), exit_initialize(), exit_status(), exit_success_p(), name_err_initialize(), name_err_mesg_load(), name_err_mesg_new(), name_err_mesg_to_str(), name_err_name(), name_err_to_s(), nometh_err_args(), nometh_err_initialize(), rb_cData, rb_class_new_instance(), rb_cNameErrorMesg, rb_cObject, rb_define_class(), rb_define_class_under(), rb_define_global_function(), rb_define_method(), rb_define_module(), rb_define_singleton_method(), rb_eArgError, rb_eException, rb_eFatal, rb_eIndexError, rb_eInterrupt, rb_eLoadError, rb_eNameError, rb_eNoMemError, rb_eNoMethodError, rb_eNotImpError, rb_eRangeError, rb_eRuntimeError, rb_eScriptError, rb_eSecurityError, rb_eSignal, rb_eStandardError, rb_eSyntaxError, rb_eSystemCallError, rb_eSystemExit, rb_eTypeError, rb_mErrno, rb_warn_m(), st_init_numtable(), syserr_eqq(), syserr_errno(), syserr_initialize(), and syserr_tbl.

Referenced by rb_call_inits().

void Init_syserr void   ) 
 

Definition at line 1174 of file error.c.

References set_syserr().

Referenced by rb_call_inits().

VALUE name_err_initialize int  argc,
VALUE argv,
VALUE  self
[static]
 

Definition at line 628 of file error.c.

References name, Qnil, rb_call_super(), rb_iv_set(), and VALUE.

Referenced by Init_Exception(), and nometh_err_initialize().

VALUE name_err_mesg_load VALUE  klass,
VALUE  str
[static]
 

Definition at line 769 of file error.c.

References VALUE.

Referenced by Init_Exception().

void name_err_mesg_mark VALUE ptr  )  [static]
 

Definition at line 701 of file error.c.

References rb_gc_mark_locations(), and VALUE.

Referenced by name_err_mesg_new().

VALUE name_err_mesg_new VALUE  obj,
VALUE  mesg,
VALUE  recv,
VALUE  method
[static]
 

Definition at line 709 of file error.c.

References ALLOC_N, Data_Wrap_Struct, name_err_mesg_mark(), rb_cNameErrorMesg, and VALUE.

Referenced by Init_Exception().

VALUE name_err_mesg_to_str VALUE  obj  )  [static]
 

Definition at line 722 of file error.c.

References args, Data_Get_Struct, NIL_P, OBJ_TAINT, OBJ_TAINTED, Qnil, rb_any_to_s(), rb_f_sprintf(), rb_inspect(), rb_obj_classname(), rb_protect(), rb_str_cat2(), rb_str_new2(), RSTRING, T_FALSE, T_NIL, T_TRUE, TYPE, and VALUE.

Referenced by Init_Exception().

VALUE name_err_name VALUE  self  )  [static]
 

Definition at line 649 of file error.c.

References rb_attr_get(), rb_intern(), and VALUE.

Referenced by Init_Exception().

VALUE name_err_to_s VALUE  exc  )  [static]
 

Definition at line 663 of file error.c.

References CLASS_OF, NIL_P, OBJ_TAINT, OBJ_TAINTED, rb_attr_get(), rb_class_name(), rb_intern(), rb_iv_set(), StringValue, and VALUE.

Referenced by Init_Exception().

VALUE nometh_err_args VALUE  self  )  [static]
 

Definition at line 784 of file error.c.

References rb_attr_get(), rb_intern(), and VALUE.

Referenced by Init_Exception().

VALUE nometh_err_initialize int  argc,
VALUE argv,
VALUE  self
[static]
 

Definition at line 688 of file error.c.

References args, name_err_initialize(), Qnil, rb_iv_set(), and VALUE.

Referenced by Init_Exception().

void rb_error_frozen char *  what  )  const
 

Definition at line 1160 of file error.c.

References rb_eTypeError, and rb_raise().

void rb_invalid_str char *  str,
char *  type
const
 

Definition at line 791 of file error.c.

References rb_eArgError, rb_raise(), rb_str_inspect(), rb_str_new2(), RSTRING, and VALUE.

void rb_load_fail char *  path  )  const
 

Definition at line 1153 of file error.c.

References rb_loaderror(), and strerror().

void rb_sys_fail char *  mesg  )  const
 

Definition at line 1111 of file error.c.

References get_syserr(), Qnil, rb_bug(), rb_class_new_instance(), rb_exc_raise(), rb_str_new2(), and VALUE.

VALUE rb_warn_m VALUE  self,
VALUE  mesg
[static]
 

Definition at line 181 of file error.c.

References NIL_P, Qnil, rb_default_rs, rb_io_write(), rb_stderr, ruby_verbose, and VALUE.

Referenced by Init_Exception().

VALUE set_syserr int  n,
const char *  name
[static]
 

Definition at line 833 of file error.c.

References INT2NUM, name, rb_define_class_under(), rb_define_const(), rb_eSystemCallError, rb_mErrno, st_add_direct(), st_lookup(), syserr_tbl, and VALUE.

Referenced by get_syserr(), and Init_syserr().

VALUE syserr_eqq VALUE  self,
VALUE  exc
[static]
 

Definition at line 951 of file error.c.

References CLASS_OF, FIXNUM_P, FL_SINGLETON, FL_TEST, NIL_P, Qfalse, Qtrue, rb_attr_get(), rb_const_get(), rb_equal(), rb_eSystemCallError, rb_intern(), rb_obj_is_kind_of(), RCLASS, T_ICLASS, TYPE, and VALUE.

Referenced by Init_Exception().

VALUE syserr_errno VALUE  self  )  [static]
 

Definition at line 935 of file error.c.

References rb_attr_get(), rb_intern(), and VALUE.

Referenced by Init_Exception().

VALUE syserr_initialize int  argc,
VALUE argv,
VALUE  self
[static]
 

Definition at line 877 of file error.c.

References FIXNUM_P, NIL_P, NUM2LONG, Qnil, rb_call_super(), rb_const_get(), rb_eSystemCallError, rb_eTypeError, rb_intern(), rb_iv_set(), rb_obj_class(), rb_raise(), rb_scan_args(), rb_str_new(), rb_str_new2(), rb_str_resize(), RBASIC, RSTRING, snprintf(), st_lookup(), strerror(), StringValue, syserr_tbl, T_OBJECT, TYPE, and VALUE.

Referenced by Init_Exception().

void warn_print char *  fmt,
va_list  args
const [static]
 

Definition at line 116 of file error.c.

References args, err_snprintf(), and rb_write_error2().


Variable Documentation

struct types builtin_types[] [static]
 

Referenced by rb_check_type().

VALUE rb_cNameErrorMesg [static]
 

Definition at line 306 of file error.c.

Referenced by Init_Exception(), and name_err_mesg_new().

VALUE rb_eArgError
 

Definition at line 298 of file error.c.

Referenced by add_final(), argf_fileno(), argf_rewind(), argf_seek_m(), argf_set_pos(), argf_tell(), ary_new(), ary_sort_check(), autoload_file(), call_cfunc(), define_final(), dir_s_chdir(), env_aset(), env_delete(), env_fetch(), env_has_key(), env_select(), errat_setter(), file_expand_path(), flatten(), Init_Exception(), io_getpartial(), io_read(), massign(), match_select(), num_step(), pack_pack(), pack_unpack(), path2class(), path2module(), proc_alloc(), proc_setgroups(), r_byte(), r_bytes0(), r_object0(), r_symlink(), range_failed(), range_step(), rb_ary_aset(), rb_ary_initialize(), rb_ary_insert(), rb_ary_store(), rb_ary_times(), rb_attr(), rb_autoload(), rb_big2str(), rb_call0(), rb_cmperr(), rb_cstr_to_dbl(), rb_cstr_to_inum(), rb_eval(), rb_f_at_exit(), rb_f_caller(), rb_f_exec(), rb_f_getenv(), rb_f_kill(), rb_f_send(), rb_f_sleep(), rb_f_sprintf(), rb_f_syscall(), rb_f_system(), rb_f_test(), rb_file_s_umask(), rb_fix2str(), rb_Float(), rb_hash_initialize(), rb_hash_s_create(), rb_hash_select(), rb_include_module(), rb_invalid_str(), rb_io_ctl(), rb_io_flags_mode(), rb_io_mode_flags(), rb_io_mode_modenum(), rb_io_modenum_mode(), rb_make_exception(), rb_method_missing(), rb_mod_define_method(), rb_obj_extend(), rb_path2class(), rb_reg_initialize_m(), rb_reg_s_union(), rb_scan_args(), rb_str_aref_m(), rb_str_aset_m(), rb_str_buf_cat(), rb_str_cat(), rb_str_count(), rb_str_crypt(), rb_str_delete_bang(), rb_str_intern(), rb_str_justify(), rb_str_new2(), rb_str_resize(), rb_str_slice_bang(), rb_str_sub_bang(), rb_str_times(), rb_str_to_dbl(), rb_str_to_i(), rb_string_value_cstr(), rb_struct_initialize(), rb_struct_select(), rb_thread_raise(), rb_to_id(), rb_waitpid(), rb_yield_0(), ruby_xrealloc(), search_time_t(), sig_trap(), specific_eval(), str_gsub(), str_new(), str_to_id(), test_check(), time_arg(), time_gmtime(), time_localtime(), time_mdump(), time_overflow_p(), time_utc_offset(), trap(), utf8_to_uv(), and w_object().

VALUE rb_eException
 

Definition at line 290 of file error.c.

Referenced by errinfo_setter(), Init_Exception(), and rb_make_exception().

VALUE rb_eFatal
 

Definition at line 294 of file error.c.

Referenced by Init_Exception(), Init_Proc(), rb_fatal(), and rb_thread_deadlock().

VALUE rb_eIndexError
 

Definition at line 299 of file error.c.

Referenced by env_fetch(), Init_Exception(), match_begin(), match_end(), match_offset(), rb_ary_fetch(), rb_ary_splice(), rb_ary_store(), rb_ary_transpose(), rb_hash_fetch(), rb_str_aset(), rb_str_splice(), rb_str_subpat_set(), rb_struct_aref(), and rb_struct_aset().

VALUE rb_eInterrupt
 

Definition at line 292 of file error.c.

Referenced by Init_Exception(), and rb_interrupt().

VALUE rb_eLoadError
 

Definition at line 310 of file error.c.

Referenced by dln_load(), Init_Exception(), load_failed(), load_file(), and rb_loaderror().

VALUE rb_eNameError
 

Definition at line 301 of file error.c.

Referenced by Init_Exception(), process_sflag(), rb_autoload(), rb_method_missing(), and rb_name_error().

VALUE rb_eNoMemError
 

Definition at line 305 of file error.c.

Referenced by Init_Exception(), Init_GC(), and ruby_xmalloc().

VALUE rb_eNoMethodError
 

Definition at line 302 of file error.c.

Referenced by Init_Exception(), rb_eval(), and rb_method_missing().

VALUE rb_eNotImpError
 

Definition at line 304 of file error.c.

Referenced by Init_Exception(), rb_call(), and rb_notimplement().

VALUE rb_eRangeError
 

Definition at line 300 of file error.c.

Referenced by big2ull(), big2ulong(), id2ref(), Init_Exception(), Init_Numeric(), int_chr(), pack_pack(), rb_big2ll(), rb_big2long(), rb_big2ulong(), rb_num2fix(), rb_num2ll(), rb_num2long(), rb_quad_pack(), rb_range_beg_len(), time_add(), time_overflow_p(), and uv_to_utf8().

VALUE rb_eRuntimeError
 

Definition at line 296 of file error.c.

Referenced by check_gid_switch(), check_uid_switch(), enum_sort_by(), error_print(), hash_foreach_call(), hash_foreach_iter(), Init_Exception(), io_getpartial(), io_read(), pack_pack(), proc_options(), rb_alias_variable(), rb_ary_modify_check(), rb_cont_call(), rb_file_initialize(), rb_io_sysread(), rb_longjmp(), rb_make_exception(), rb_str_locktmp(), rb_str_unlocktmp(), rscheck(), set_arg0(), sort_by_i(), st_foreach_safe(), str_frozen_check(), str_gsub(), str_independent(), and str_mod_check().

VALUE rb_eScriptError
 

Definition at line 308 of file error.c.

Referenced by Init_Exception().

VALUE rb_eSecurityError
 

Definition at line 303 of file error.c.

Referenced by block_pass(), env_aset(), forbid_setid(), Init_Exception(), io_reopen(), mod_av_set(), rb_add_method(), rb_alias_variable(), rb_ary_modify_check(), rb_call0(), rb_check_safe_obj(), rb_cvar_set(), rb_eval(), rb_f_eval(), rb_f_trace_var(), rb_find_file(), rb_find_file_ext(), rb_gvar_set(), rb_hash_modify(), rb_io_close_m(), rb_io_close_read(), rb_io_close_write(), rb_io_taint_check(), rb_ivar_set(), rb_mod_remove_const(), rb_mod_remove_cvar(), rb_obj_freeze(), rb_obj_remove_instance_variable(), rb_secure(), rb_struct_modify(), rb_thread_local_aref(), rb_thread_local_aset(), rb_thread_start_0(), rb_undef(), remove_method(), safe_setter(), secure_visibility(), security(), sig_trap(), str_independent(), and time_modify().

VALUE rb_eSignal
 

Definition at line 293 of file error.c.

Referenced by Init_Exception(), rb_thread_signal_raise(), and rb_thread_switch().

VALUE rb_eStandardError
 

Definition at line 295 of file error.c.

Referenced by handle_rescue(), Init_Exception(), Init_IO(), Init_Numeric(), Init_Proc(), Init_Regexp(), Init_Thread(), and rb_rescue().

VALUE rb_eSyntaxError
 

Definition at line 309 of file error.c.

Referenced by compile_error(), err_append(), and Init_Exception().

VALUE rb_eSystemCallError
 

Definition at line 312 of file error.c.

Referenced by Init_Exception(), set_syserr(), syserr_eqq(), and syserr_initialize().

VALUE rb_eSystemExit
 

Definition at line 291 of file error.c.

Referenced by error_handle(), Init_Exception(), rb_longjmp(), rb_thread_signal_exit(), rb_thread_start_0(), rb_thread_switch(), ruby_cleanup(), and terminate_process().

VALUE rb_eTypeError
 

Definition at line 297 of file error.c.

Referenced by block_pass(), check_autoload_table(), check_backtrace(), class2path(), class_prefix(), coerce_rescue(), convert_type(), cvar_cbase(), do_coerce(), errinfo_setter(), eval(), get_stat(), handle_rescue(), init_copy(), Init_Exception(), long_toobig(), marshal_dump(), marshal_load(), match_init_copy(), method_call(), method_missing(), must_respond_to(), num2i32(), num_init_copy(), num_sadded(), prec_induced_from(), r_object0(), rand_init(), range_each(), range_step(), rb_Array(), rb_ary_aref(), rb_ary_aset(), rb_big_coerce(), rb_check_convert_type(), rb_check_inheritable(), rb_check_safe_str(), rb_check_type(), rb_class_inherited_p(), rb_class_init_copy(), rb_class_initialize(), rb_class_new(), rb_class_superclass(), rb_convert_type(), rb_define_class(), rb_define_class_under(), rb_define_module(), rb_define_module_under(), rb_error_frozen(), rb_eval(), rb_flo_induced_from(), rb_Float(), rb_hash_modify(), rb_int_induced_from(), rb_make_exception(), rb_mod_define_method(), rb_mod_ge(), rb_mod_modfunc(),