Ruby  3.1.0dev(2021-09-10revisionb76ad15ed0da636161de0243c547ee1e6fc95681)
Data Structures | Macros | Enumerations | Functions | Variables
error.c File Reference

(b76ad15ed0da636161de0243c547ee1e6fc95681)

#include "ruby/internal/config.h"
#include <errno.h>
#include <stdarg.h>
#include <stdio.h>
#include "internal.h"
#include "internal/error.h"
#include "internal/eval.h"
#include "internal/hash.h"
#include "internal/io.h"
#include "internal/load.h"
#include "internal/object.h"
#include "internal/symbol.h"
#include "internal/thread.h"
#include "internal/variable.h"
#include "ruby/encoding.h"
#include "ruby/st.h"
#include "ruby_assert.h"
#include "vm_core.h"
#include "builtin.h"
#include "known_errors.inc"
#include "warning.rbinc"
Include dependency graph for error.c:

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_cause   ruby_static_id_cause
 
#define id_bt   idBt
 
#define id_bt_locations   idBt_locations
 
#define id_mesg   idMesg
 
#define id_name   idName
 
#define INIT_KW(n)   kw[kw_##n] = rb_intern_const(#n)
 
#define frozen_err_receiver   name_err_receiver
 
#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)
 
rb_warning_category_t rb_warning_category_from_name (VALUE category)
 
void rb_warning_category_update (unsigned int mask, unsigned int bits)
 
bool rb_warning_category_enabled_p (rb_warning_category_t category)
 
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_category_compile_warn (rb_warning_category_t category, const char *file, int line, const char *fmt,...)
 
void rb_warn (const char *fmt,...)
 
void rb_category_warn (rb_warning_category_t category, const char *fmt,...)
 
void rb_enc_warn (rb_encoding *enc, const char *fmt,...)
 
void rb_warning (const char *fmt,...)
 
void rb_category_warning (rb_warning_category_t category, const char *fmt,...)
 
VALUE rb_warning_string (const char *fmt,...)
 
void rb_warn_deprecated (const char *fmt, const char *suggest,...)
 
void rb_warn_deprecated_to_remove (const char *removal, const char *fmt, const char *suggest,...)
 
VALUE rb_ec_backtrace_location_ary (const rb_execution_context_t *ec, long lev, long n, bool skip_internal)
 
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))
 
void rb_bug_without_die (const char *fmt, va_list args)
 
void rb_bug (const char *fmt,...)
 
void rb_bug_for_fatal_signal (ruby_sighandler_t default_sighandler, int sig, 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)
 
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)
 
int rb_typeddata_is_instance_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)
 
void rb_error_write (VALUE errinfo, VALUE emesg, VALUE errat, VALUE str, VALUE highlight, VALUE reverse)
 
VALUE rb_get_message (VALUE exc)
 
VALUE rb_get_backtrace (VALUE exc)
 
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_new (VALUE mesg, VALUE recv, VALUE method)
 
VALUE rb_nomethod_err_new (VALUE mesg, VALUE recv, VALUE method, VALUE args, int priv)
 
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_vraise (VALUE exc, const char *fmt, va_list ap)
 
void rb_raise (VALUE exc, const char *fmt,...)
 
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_frozen_error_raise (VALUE frozen_obj, const char *fmt,...)
 
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

long rb_backtrace_length_limit = -1
 
VALUE rb_eEAGAIN
 
VALUE rb_eEWOULDBLOCK
 
VALUE rb_eEINPROGRESS
 
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_eFrozenError
 
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_eNoMatchingPatternError
 
VALUE rb_eNoMatchingPatternKeyError
 
VALUE rb_eScriptError
 
VALUE rb_eSyntaxError
 
VALUE rb_eLoadError
 
VALUE rb_eSystemCallError
 
VALUE rb_mErrno
 
ID ruby_static_id_cause
 

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)

◆ INIT_KW

#define INIT_KW (   n)    kw[kw_##n] = rb_intern_const(#n)

◆ undefined_error [1/2]

#define undefined_error (   name)

◆ undefined_error [2/2]

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

Variable Documentation

◆ enum2id

st_table * enum2id

Definition at line 81 of file error.c.

◆ id2enum

st_table* id2enum

Definition at line 81 of file error.c.