About: TeX Live provides a comprehensive TeX system including all the major TeX-related programs, macro packages, and fonts that are free software. Windows sources.
  Fossies Dox: w32tex-src.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

value.h File Reference
#include "common.h"
#include <inttypes.h>
#include <mruby/object.h>
#include "boxing_no.h"
Include dependency graph for value.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.


#define MRB_INT_BIT   32
#define MRB_INT_MIN   INT32_MIN
#define MRB_INT_MAX   INT32_MAX
#define MRB_PRIo   PRIo32
#define MRB_PRId   PRId32
#define MRB_PRIx   PRIx32
#define MRB_ENDIAN_LOHI(a, b)   b a
#define mrb_immediate_p(o)   (mrb_type(o) < MRB_TT_FREE)
#define mrb_integer_p(o)   (mrb_type(o) == MRB_TT_INTEGER)
#define mrb_fixnum_p(o)   mrb_integer_p(o)
#define mrb_symbol_p(o)   (mrb_type(o) == MRB_TT_SYMBOL)
#define mrb_undef_p(o)   (mrb_type(o) == MRB_TT_UNDEF)
#define mrb_nil_p(o)   (mrb_type(o) == MRB_TT_FALSE && !mrb_fixnum(o))
#define mrb_false_p(o)   (mrb_type(o) == MRB_TT_FALSE && !!mrb_fixnum(o))
#define mrb_true_p(o)   (mrb_type(o) == MRB_TT_TRUE)
#define mrb_float_p(o)   (mrb_type(o) == MRB_TT_FLOAT)
#define mrb_array_p(o)   (mrb_type(o) == MRB_TT_ARRAY)
#define mrb_string_p(o)   (mrb_type(o) == MRB_TT_STRING)
#define mrb_hash_p(o)   (mrb_type(o) == MRB_TT_HASH)
#define mrb_cptr_p(o)   (mrb_type(o) == MRB_TT_CPTR)
#define mrb_exception_p(o)   (mrb_type(o) == MRB_TT_EXCEPTION)
#define mrb_free_p(o)   (mrb_type(o) == MRB_TT_FREE)
#define mrb_object_p(o)   (mrb_type(o) == MRB_TT_OBJECT)
#define mrb_class_p(o)   (mrb_type(o) == MRB_TT_CLASS)
#define mrb_module_p(o)   (mrb_type(o) == MRB_TT_MODULE)
#define mrb_iclass_p(o)   (mrb_type(o) == MRB_TT_ICLASS)
#define mrb_sclass_p(o)   (mrb_type(o) == MRB_TT_SCLASS)
#define mrb_proc_p(o)   (mrb_type(o) == MRB_TT_PROC)
#define mrb_range_p(o)   (mrb_type(o) == MRB_TT_RANGE)
#define mrb_env_p(o)   (mrb_type(o) == MRB_TT_ENV)
#define mrb_data_p(o)   (mrb_type(o) == MRB_TT_DATA)
#define mrb_fiber_p(o)   (mrb_type(o) == MRB_TT_FIBER)
#define mrb_istruct_p(o)   (mrb_type(o) == MRB_TT_ISTRUCT)
#define mrb_break_p(o)   (mrb_type(o) == MRB_TT_BREAK)
#define mrb_bool(o)   (mrb_type(o) != MRB_TT_FALSE)
#define mrb_test(o)   mrb_bool(o)
#define mrb_ro_data_p(p)   FALSE


typedef uint32_t mrb_sym
typedef uint8_t mrb_bool
typedef int32_t mrb_int
typedef uint32_t mrb_uint
typedef double mrb_float
typedef mrb_int mrb_ssize


enum  mrb_vtype {


double mrb_float_read (const char *, char **)
static mrb_value mrb_float_value (struct mrb_state *mrb, mrb_float f)
static mrb_value mrb_cptr_value (struct mrb_state *mrb, void *p)
static mrb_value mrb_int_value (struct mrb_state *mrb, mrb_int i)
static mrb_value mrb_fixnum_value (mrb_int i)
static mrb_value mrb_symbol_value (mrb_sym i)
static mrb_value mrb_obj_value (void *p)
static mrb_value mrb_nil_value (void)
static mrb_value mrb_false_value (void)
static mrb_value mrb_true_value (void)
static mrb_value mrb_bool_value (mrb_bool boolean)
static mrb_value mrb_undef_value (void)

Detailed Description

  • mruby value definitions

See Copyright Notice in mruby.h

Definition in file value.h.

Macro Definition Documentation

◆ mrb_array_p

#define mrb_array_p (   o)    (mrb_type(o) == MRB_TT_ARRAY)

Definition at line 209 of file value.h.

◆ mrb_bool

#define mrb_bool (   o)    (mrb_type(o) != MRB_TT_FALSE)

Definition at line 263 of file value.h.

◆ mrb_break_p

#define mrb_break_p (   o)    (mrb_type(o) == MRB_TT_BREAK)

Definition at line 260 of file value.h.

◆ mrb_class_p

#define mrb_class_p (   o)    (mrb_type(o) == MRB_TT_CLASS)

Definition at line 230 of file value.h.

◆ mrb_cptr_p

#define mrb_cptr_p (   o)    (mrb_type(o) == MRB_TT_CPTR)

Definition at line 218 of file value.h.

◆ mrb_data_p

#define mrb_data_p (   o)    (mrb_type(o) == MRB_TT_DATA)

Definition at line 251 of file value.h.


#define MRB_ENDIAN_LOHI (   a,
)    b a

Definition at line 77 of file value.h.

◆ mrb_env_p

#define mrb_env_p (   o)    (mrb_type(o) == MRB_TT_ENV)

Definition at line 248 of file value.h.

◆ mrb_exception_p

#define mrb_exception_p (   o)    (mrb_type(o) == MRB_TT_EXCEPTION)

Definition at line 221 of file value.h.

◆ mrb_false_p

#define mrb_false_p (   o)    (mrb_type(o) == MRB_TT_FALSE && !!mrb_fixnum(o))

Definition at line 198 of file value.h.

◆ mrb_fiber_p

#define mrb_fiber_p (   o)    (mrb_type(o) == MRB_TT_FIBER)

Definition at line 254 of file value.h.

◆ mrb_fixnum_p

#define mrb_fixnum_p (   o)    mrb_integer_p(o)

Definition at line 186 of file value.h.

◆ mrb_float_p

#define mrb_float_p (   o)    (mrb_type(o) == MRB_TT_FLOAT)

Definition at line 205 of file value.h.

◆ mrb_free_p

#define mrb_free_p (   o)    (mrb_type(o) == MRB_TT_FREE)

Definition at line 224 of file value.h.

◆ mrb_hash_p

#define mrb_hash_p (   o)    (mrb_type(o) == MRB_TT_HASH)

Definition at line 215 of file value.h.

◆ mrb_iclass_p

#define mrb_iclass_p (   o)    (mrb_type(o) == MRB_TT_ICLASS)

Definition at line 236 of file value.h.

◆ mrb_immediate_p

#define mrb_immediate_p (   o)    (mrb_type(o) < MRB_TT_FREE)

Definition at line 180 of file value.h.


#define MRB_INT_BIT   32

Definition at line 66 of file value.h.


#define MRB_INT_MAX   INT32_MAX

Definition at line 68 of file value.h.


#define MRB_INT_MIN   INT32_MIN

Definition at line 67 of file value.h.

◆ mrb_integer_p

#define mrb_integer_p (   o)    (mrb_type(o) == MRB_TT_INTEGER)

Definition at line 183 of file value.h.

◆ mrb_istruct_p

#define mrb_istruct_p (   o)    (mrb_type(o) == MRB_TT_ISTRUCT)

Definition at line 257 of file value.h.

◆ mrb_module_p

#define mrb_module_p (   o)    (mrb_type(o) == MRB_TT_MODULE)

Definition at line 233 of file value.h.

◆ mrb_nil_p

#define mrb_nil_p (   o)    (mrb_type(o) == MRB_TT_FALSE && !mrb_fixnum(o))

Definition at line 195 of file value.h.

◆ mrb_object_p

#define mrb_object_p (   o)    (mrb_type(o) == MRB_TT_OBJECT)

Definition at line 227 of file value.h.


#define MRB_PRId   PRId32

Definition at line 70 of file value.h.


#define MRB_PRIo   PRIo32

Definition at line 69 of file value.h.


#define MRB_PRIx   PRIx32

Definition at line 71 of file value.h.

◆ mrb_proc_p

#define mrb_proc_p (   o)    (mrb_type(o) == MRB_TT_PROC)

Definition at line 242 of file value.h.

◆ mrb_range_p

#define mrb_range_p (   o)    (mrb_type(o) == MRB_TT_RANGE)

Definition at line 245 of file value.h.

◆ mrb_ro_data_p

#define mrb_ro_data_p (   p)    FALSE

Definition at line 395 of file value.h.

◆ mrb_sclass_p

#define mrb_sclass_p (   o)    (mrb_type(o) == MRB_TT_SCLASS)

Definition at line 239 of file value.h.



Definition at line 176 of file value.h.

◆ mrb_string_p

#define mrb_string_p (   o)    (mrb_type(o) == MRB_TT_STRING)

Definition at line 212 of file value.h.

◆ mrb_symbol_p

#define mrb_symbol_p (   o)    (mrb_type(o) == MRB_TT_SYMBOL)

Definition at line 189 of file value.h.

◆ mrb_test

#define mrb_test (   o)    mrb_bool(o)

Definition at line 265 of file value.h.

◆ mrb_true_p

#define mrb_true_p (   o)    (mrb_type(o) == MRB_TT_TRUE)

Definition at line 201 of file value.h.



Definition at line 136 of file value.h.

◆ mrb_undef_p

#define mrb_undef_p (   o)    (mrb_type(o) == MRB_TT_UNDEF)

Definition at line 192 of file value.h.

Typedef Documentation

◆ mrb_bool

typedef uint8_t mrb_bool

Definition at line 34 of file value.h.

◆ mrb_float

typedef double mrb_float

Definition at line 85 of file value.h.

◆ mrb_int

typedef int32_t mrb_int

Definition at line 64 of file value.h.

◆ mrb_ssize

typedef mrb_int mrb_ssize

Definition at line 175 of file value.h.

◆ mrb_sym

typedef uint32_t mrb_sym

Definition at line 23 of file value.h.

◆ mrb_uint

typedef uint32_t mrb_uint

Definition at line 65 of file value.h.

Enumeration Type Documentation

◆ mrb_vtype

enum mrb_vtype

Definition at line 107 of file value.h.

Function Documentation

◆ mrb_bool_value()

◆ mrb_cptr_value()

static mrb_value mrb_cptr_value ( struct mrb_state mrb,
void p 

Definition at line 283 of file value.h.

References p, SET_CPTR_VALUE, v, and void.

Referenced by mrb_addrinfo_getaddrinfo().

◆ mrb_false_value()

◆ mrb_fixnum_value()

static mrb_value mrb_fixnum_value ( mrb_int  i)

Definition at line 301 of file value.h.

References i, SET_FIXNUM_VALUE, and v.

Referenced by fixnum_mul(), flo_infinite_p(), flo_shift(), gc_interval_ratio_get(), gc_step_ratio_get(), get_opt(), int64_value(), int_mod(), int_pow(), int_quo(), io_set_process_status(), make_struct_define_accessors(), math_frexp(), method_arity(), mrb_addrinfo_getaddrinfo(), mrb_ary_cmp(), mrb_ary_index_m(), mrb_ary_rindex_m(), mrb_ary_shuffle_bang(), mrb_ary_size(), mrb_basicsocket_getpeereid(), mrb_basicsocket_getsockopt(), mrb_basicsocket_send(), mrb_basicsocket_setsockopt(), mrb_basicsocket_shutdown(), mrb_f_caller(), mrb_f_sleep(), mrb_f_usleep(), mrb_file_flock(), mrb_file_s_chmod(), mrb_file_s_rename(), mrb_file_s_symlink(), mrb_file_s_umask(), mrb_file_s_unlink(), mrb_file_truncate(), mrb_init_file(), mrb_init_version(), mrb_io_fileno_m(), mrb_io_pid(), mrb_io_s_sysclose(), mrb_io_s_sysopen(), mrb_mruby_kpathsea_gem_init(), mrb_mruby_numeric_ext_gem_init(), mrb_proc_inspect(), mrb_proc_source_location(), mrb_ptexenc_fromDVI(), mrb_ptexenc_fromEUC(), mrb_ptexenc_fromJIS(), mrb_ptexenc_fromKUTEN(), mrb_ptexenc_fromSJIS(), mrb_ptexenc_fromUCS(), mrb_ptexenc_toDVI(), mrb_ptexenc_toJIS(), mrb_ptexenc_toUCS(), mrb_ptexenc_UCStoUTF8(), mrb_socket_accept(), mrb_socket_accept2(), mrb_socket_sockaddr_family(), mrb_socket_socket(), mrb_socket_socketpair(), mrb_str_bytes(), mrb_str_bytesize(), mrb_str_cmp_m(), mrb_str_count(), mrb_str_getbyte(), mrb_str_hash_m(), mrb_str_index_m(), mrb_str_len_to_inum(), mrb_str_ord(), mrb_str_rindex(), mrb_str_setbyte(), mrb_str_size(), mrb_struct_len(), mrb_sym_length(), mrb_sys_fail(), mrb_time_at_m(), mrb_time_cmp(), mrb_time_day(), mrb_time_hour(), mrb_time_mday(), mrb_time_min(), mrb_time_mon(), mrb_time_sec(), mrb_time_usec(), mrb_time_wday(), mrb_time_yday(), mrb_time_year(), mrb_vformat(), mrb_vm_exec(), mrb_vm_special_get(), mrb_word_boxing_int_value(), nil_to_i(), num_cmp(), os_count_objects(), os_each_object(), os_memsize_of(), os_memsize_of_all(), range_size(), rational_m(), rshift(), sa2addrlist(), str_replace_partial(), sym_cmp(), unpack_c(), unpack_s(), and unpack_utf8().

◆ mrb_float_read()

double mrb_float_read ( const char *  string,
char **  endPtr 

Definition at line 2982 of file string.c.

References c, d, errno, exp(), FALSE, ISDIGIT, ISSPACE, maxExponent, NULL, p, powersOf10, sign, string, and TRUE.

Referenced by codegen(), mrb_str_len_to_dbl(), and parser_yylex().

◆ mrb_float_value()

◆ mrb_int_value()

◆ mrb_nil_value()

static mrb_value mrb_nil_value ( void  )

Get a nil mrb_value object.

nil mrb_value object reference.

Definition at line 332 of file value.h.

References SET_NIL_VALUE, and v.

Referenced by ary_fill_with_nil(), convert_type(), eval_under(), exec_irep(), f_eval(), f_instance_eval(), fiber_result(), flo_infinite_p(), gc_interval_ratio_set(), gc_start(), gc_step_ratio_set(), get_opt(), hash_default(), load_file(), load_irep(), mark_context_stack(), method_source_location(), method_super_method(), method_unbind(), mod_attr_define(), mrb_addrinfo_getaddrinfo(), mrb_ary_aget(), mrb_ary_assoc(), mrb_ary_cmp(), mrb_ary_delete_at(), mrb_ary_entry(), mrb_ary_first(), mrb_ary_index_m(), mrb_ary_join_m(), mrb_ary_last(), mrb_ary_pop(), mrb_ary_rassoc(), mrb_ary_ref(), mrb_ary_rindex_m(), mrb_ary_sample(), mrb_ary_shift(), mrb_ary_shuffle_bang(), mrb_ary_slice_bang(), mrb_ary_svalue(), mrb_basicsocket_getpeereid(), mrb_basicsocket_send(), mrb_basicsocket_setnonblock(), mrb_bob_init(), mrb_check_array_type(), mrb_check_hash_type(), mrb_check_intern(), mrb_check_intern_cstr(), mrb_check_intern_str(), mrb_check_string_type(), mrb_class_find_path(), mrb_class_superclass(), mrb_core_init_abort(), mrb_f_caller(), mrb_f_method(), mrb_f_nil(), mrb_f_raise(), mrb_f_sprintf(), mrb_file__gethome(), mrb_file_s_readlink(), mrb_filetest_s_size_p(), mrb_funcall_argv(), mrb_gc_unregister(), mrb_get_args(), mrb_get_values_at(), mrb_gv_get(), mrb_hash_default(), mrb_hash_default_proc(), mrb_hash_delete_key(), mrb_hash_init(), mrb_hash_new_capa(), mrb_hash_shift(), mrb_init_file(), mrb_int_chr(), mrb_io_check_readable(), mrb_io_close(), mrb_io_close_write(), mrb_io_initialize(), mrb_io_pid(), mrb_io_s_pipe(), mrb_io_s_popen(), mrb_io_s_popen_args(), mrb_io_s_select(), mrb_io_s_sysopen(), mrb_io_sysread(), mrb_ipsocket_pton(), mrb_iv_get(), mrb_kernel_method(), mrb_kpse_init_prog(), mrb_kpse_maketex_option(), mrb_kpse_reset_program_name(), mrb_kpse_set_program_enabled(), mrb_kpse_set_program_name(), mrb_kpse_xputenv(), mrb_kpse_xputenv_int(), mrb_load_detect_file_cxt(), mrb_load_exec(), mrb_make_exception(), mrb_mod_const_missing(), mrb_mod_cv_get(), mrb_mod_remove_cvar(), mrb_mod_s_constants(), mrb_mod_undef(), mrb_module_instance_method(), mrb_mruby_socket_gem_init(), mrb_notimplement_m(), mrb_num_minus(), mrb_num_mul(), mrb_num_plus(), mrb_obj_iv_get(), mrb_obj_missing(), mrb_pack_pack(), mrb_print(), mrb_proc_parameters(), mrb_proc_source_location(), mrb_protect(), mrb_ptexenc_enable_UPTEX(), mrb_puts(), mrb_socket_bind(), mrb_socket_connect(), mrb_socket_listen(), mrb_socket_sockaddr_un(), mrb_socket_socketpair(), mrb_str_aref(), mrb_str_byteslice(), mrb_str_capitalize_bang(), mrb_str_chomp_bang(), mrb_str_chop_bang(), mrb_str_cmp_m(), mrb_str_count(), mrb_str_del_prefix_bang(), mrb_str_del_suffix_bang(), mrb_str_delete_bang(), mrb_str_downcase_bang(), mrb_str_getbyte(), mrb_str_index_m(), mrb_str_rindex(), mrb_str_split_m(), mrb_str_squeeze(), mrb_str_squeeze_bang(), mrb_str_swapcase_bang(), mrb_str_tr_bang(), mrb_str_tr_s_bang(), mrb_str_upcase_bang(), mrb_struct_initialize_withArg(), mrb_struct_ref(), mrb_struct_s_def(), mrb_time_cmp(), mrb_time_zone(), mrb_type_convert_check(), mrb_vm_exec(), mrb_yield_cont(), mrb_yield_with_class(), num_cmp(), pack_unpack(), range_size(), sa2addrlist(), str_substr(), struct_aref_sym(), struct_ivar_get(), and sym_cmp().

◆ mrb_obj_value()

static mrb_value mrb_obj_value ( void p)

Definition at line 317 of file value.h.

References mrb_assert, mrb_ptr, mrb_type(), p, SET_OBJ_VALUE, and v.

Referenced by ary_subseq(), assign_class_name(), class_from_sym(), complex_new(), const_get(), copy_class(), define_class(), define_module(), exec_irep(), fiber_current(), gc_protect(), io_set_process_status(), load_irep(), main(), make_struct(), method_super_method(), method_unbind(), module_from_sym(), mrb_ary_new_capa(), mrb_ary_new_from_values(), mrb_ary_plus(), mrb_ary_reverse(), mrb_ary_splat(), mrb_ary_times(), mrb_assoc_new(), mrb_basicsocket_getsockopt(), mrb_class_defined(), mrb_class_defined_id(), mrb_class_defined_under(), mrb_class_defined_under_id(), mrb_class_inherited(), mrb_class_name_class(), mrb_class_new_class(), mrb_class_superclass(), mrb_core_init_protect(), mrb_debug_eval(), mrb_exc_get_id(), mrb_exc_inspect(), mrb_f_raise(), mrb_frozen_error(), mrb_funcall_with_block(), mrb_hash_dup(), mrb_hash_new(), mrb_hash_new_capa(), mrb_init_class(), mrb_init_numeric(), mrb_instance_alloc(), mrb_io_s_for_fd(), mrb_io_s_pipe(), mrb_io_s_popen_args(), mrb_kernel_method(), mrb_load_exec(), mrb_mod_ancestors(), mrb_mod_included_modules(), mrb_mod_s_nesting(), mrb_module_instance_method(), mrb_mruby_random_gem_init(), mrb_obj_class_m(), mrb_obj_clone(), mrb_obj_dup(), mrb_obj_iv_inspect(), mrb_obj_new(), mrb_proc_s_new(), mrb_protect(), mrb_ptr_to_str(), mrb_raise_nomemory(), mrb_rescue_exceptions(), mrb_show_copyright(), mrb_show_version(), mrb_singleton_class(), mrb_singleton_class_clone(), mrb_str_byte_subseq(), mrb_str_init(), mrb_str_new(), mrb_str_new_capa(), mrb_str_new_cstr(), mrb_str_new_empty(), mrb_str_new_static(), mrb_str_plus(), mrb_str_times(), mrb_struct_members(), mrb_sys_fail(), mrb_tcpsocket_allocate(), mrb_time_wrap(), mrb_top_self(), mrb_undef_class_method(), mrb_undef_class_method_id(), mrb_vformat(), mrb_vm_exec(), mrb_yield_with_class(), num_members(), obj_is_kind_of_checked(), os_each_object_cb(), os_memsize_of_all_cb(), p(), packed_backtrace(), prepare_singleton_class(), print_backtrace(), proc_lambda(), random_default(), rational_new(), setup_class(), stack_extend_alloc(), str_replace(), struct_ivar_get(), struct_s_members(), tr_parse_pattern(), and unbound_method_bind().

◆ mrb_symbol_value()

◆ mrb_true_value()

◆ mrb_undef_value()