Ruby  2.5.0dev(2017-10-22revision60238)
Data Structures | Macros | Enumerations | Functions | Variables
error.c File Reference
#include "internal.h"
#include "ruby/st.h"
#include "ruby_assert.h"
#include "vm_core.h"
#include <stdio.h>
#include <stdarg.h>
#include <errno.h>
#include "known_errors.inc"

Go to the source code of this file.

Data Structures

struct  bug_reporters
 

Macros

#define EXIT_SUCCESS   0
 
#define WIFEXITED(status)   1
 
#define WEXITSTATUS(status)   (status)
 
#define defined_error(name, num)   if (err == (num)) return (name);
 
#define undefined_error(name)
 
#define with_warning_string(mesg, enc, fmt)
 
#define MAX_BUG_REPORTERS   0x100
 
#define REPORT_BUG_BUFSIZ   256
 
#define bug_report_begin(out, fmt)
 
#define report_bug(file, line, fmt, ctx)
 
#define report_bug_valist(file, line, fmt, ctx, args)
 
#define write_or_abort(fd, str, len)   (write((fd), (str), (len)) < 0 ? abort() : (void)0)
 
#define WRITE_CONST(fd, str)   write_or_abort((fd),(str),sizeof(str) - 1)
 
#define UNDEF_LEAKED   "undef leaked to the Ruby space"
 
#define id_bt   idBt
 
#define id_bt_locations   idBt_locations
 
#define id_mesg   idMesg
 
#define id_status   ruby_static_id_status
 
#define name_err_mesg_free   RUBY_TYPED_DEFAULT_FREE
 
#define FAKE_CSTR(v, str)   rb_setup_fake_str((v), (str), rb_strlen_lit(str), usascii)
 
#define defined_error(name, num)   set_syserr((num), (name));
 
#define undefined_error(name)   set_syserr(0, (name));
 

Enumerations

enum  { NAME_ERR_MESG__MESG, NAME_ERR_MESG__RECV, NAME_ERR_MESG__NAME, NAME_ERR_MESG_COUNT }
 

Functions

VALUE rb_iseqw_local_variables (VALUE iseqval)
 
VALUE rb_iseqw_new (const rb_iseq_t *)
 
int rb_str_end_with_asciichar (VALUE str, int c)
 
VALUE rb_syntax_error_append (VALUE exc, VALUE file, int line, int column, rb_encoding *enc, const char *fmt, va_list args)
 
void ruby_deprecated_internal_feature (const char *func)
 
VALUE rb_warning_warn (VALUE mod, VALUE str)
 
void rb_compile_warn (const char *file, int line, const char *fmt,...)
 
void rb_compile_warning (const char *file, int line, const char *fmt,...)
 
void rb_warn (const char *fmt,...)
 
void rb_enc_warn (rb_encoding *enc, const char *fmt,...)
 
void rb_warning (const char *fmt,...)
 
VALUE rb_warning_string (const char *fmt,...)
 
int rb_bug_reporter_add (void(*func)(FILE *, void *), void *data)
 
 FUNC_MINIMIZED (static void bug_important_message(FILE *out, const char *const msg, size_t len))
 
 NORETURN (static void die(void))
 
void rb_bug (const char *fmt,...)
 
void rb_bug_context (const void *ctx, const char *fmt,...)
 
void rb_bug_errno (const char *mesg, int errno_arg)
 
void rb_async_bug_errno (const char *mesg, int errno_arg)
 
void rb_report_bug_valist (VALUE file, int line, const char *fmt, va_list args)
 
void rb_assert_failure (const char *file, int line, const char *name, const char *expr)
 
const char * rb_builtin_type_name (int t)
 
const char * rb_builtin_class_name (VALUE x)
 
 NORETURN (static void unexpected_type(VALUE, int, int))
 
void rb_check_type (VALUE x, int t)
 
void rb_unexpected_type (VALUE x, int t)
 
int rb_typeddata_inherited_p (const rb_data_type_t *child, const rb_data_type_t *parent)
 
int rb_typeddata_is_kind_of (VALUE obj, const rb_data_type_t *data_type)
 
void * rb_check_typeddata (VALUE obj, const rb_data_type_t *data_type)
 
VALUE rb_exc_new (VALUE etype, const char *ptr, long len)
 
VALUE rb_exc_new_cstr (VALUE etype, const char *s)
 
VALUE rb_exc_new_str (VALUE etype, VALUE str)
 
VALUE rb_get_backtrace (VALUE exc)
 
VALUE rb_check_backtrace (VALUE bt)
 
VALUE rb_exc_set_backtrace (VALUE exc, VALUE bt)
 
void rb_name_error (ID id, const char *fmt,...)
 
void rb_name_error_str (VALUE str, const char *fmt,...)
 
VALUE rb_name_err_mesg_new (VALUE mesg, VALUE recv, VALUE method)
 
VALUE rb_name_err_new (VALUE mesg, VALUE recv, VALUE method)
 
void rb_invalid_str (const char *str, const char *type)
 
VALUE rb_key_err_new (VALUE mesg, VALUE recv, VALUE key)
 
void Init_Exception (void)
 
void rb_enc_raise (rb_encoding *enc, VALUE exc, const char *fmt,...)
 
void rb_raise (VALUE exc, const char *fmt,...)
 
 NORETURN (static void raise_loaderror(VALUE path, VALUE mesg))
 
void rb_loaderror (const char *fmt,...)
 
void rb_loaderror_with_path (VALUE path, const char *fmt,...)
 
void rb_notimplement (void)
 
void rb_fatal (const char *fmt,...)
 
VALUE rb_syserr_new (int n, const char *mesg)
 
VALUE rb_syserr_new_str (int n, VALUE arg)
 
void rb_syserr_fail (int e, const char *mesg)
 
void rb_syserr_fail_str (int e, VALUE mesg)
 
void rb_sys_fail (const char *mesg)
 
void rb_sys_fail_str (VALUE mesg)
 
void rb_mod_sys_fail (VALUE mod, const char *mesg)
 
void rb_mod_sys_fail_str (VALUE mod, VALUE mesg)
 
void rb_mod_syserr_fail (VALUE mod, int e, const char *mesg)
 
void rb_mod_syserr_fail_str (VALUE mod, int e, VALUE mesg)
 
void rb_sys_warning (const char *fmt,...)
 
void rb_sys_enc_warning (rb_encoding *enc, const char *fmt,...)
 
void rb_syserr_enc_warning (int err, rb_encoding *enc, const char *fmt,...)
 
void rb_load_fail (VALUE path, const char *err)
 
void rb_error_frozen (const char *what)
 
void rb_error_frozen_object (VALUE frozen_obj)
 
void rb_check_frozen (VALUE obj)
 
void rb_error_untrusted (VALUE obj)
 
void rb_check_trusted (VALUE obj)
 
void rb_check_copyable (VALUE obj, VALUE orig)
 
void Init_syserr (void)
 

Variables

VALUE rb_eEAGAIN
 
VALUE rb_eEWOULDBLOCK
 
VALUE rb_eEINPROGRESS
 
VALUE rb_mWarning
 
VALUE rb_cWarningBuffer
 
const char ruby_description []
 
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_eKeyError
 
VALUE rb_eRangeError
 
VALUE rb_eNameError
 
VALUE rb_eEncodingError
 
VALUE rb_eEncCompatError
 
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
 
ID ruby_static_id_status
 

Macro Definition Documentation

◆ defined_error [1/2]

#define defined_error (   name,
  num 
)    if (err == (num)) return (name);

◆ defined_error [2/2]

#define defined_error (   name,
  num 
)    set_syserr((num), (name));

◆ FAKE_CSTR

#define FAKE_CSTR (   v,
  str 
)    rb_setup_fake_str((v), (str), rb_strlen_lit(str), usascii)

◆ undefined_error [1/2]

#define undefined_error (   name)

◆ undefined_error [2/2]

#define undefined_error (   name)    set_syserr(0, (name));