w32tex
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)  

object.c File Reference
#include <mruby.h>
#include <mruby/class.h>
#include <mruby/numeric.h>
#include <mruby/string.h>
#include <mruby/presym.h>
Include dependency graph for object.c:

Go to the source code of this file.

Classes

struct  types
 

Functions

mrb_bool mrb_obj_eq (mrb_state *mrb, mrb_value v1, mrb_value v2)
 
mrb_bool mrb_obj_equal (mrb_state *mrb, mrb_value v1, mrb_value v2)
 
mrb_bool mrb_equal (mrb_state *mrb, mrb_value obj1, mrb_value obj2)
 
static mrb_value mrb_true (mrb_state *mrb, mrb_value obj)
 
static mrb_value nil_to_s (mrb_state *mrb, mrb_value obj)
 
static mrb_value nil_inspect (mrb_state *mrb, mrb_value obj)
 
static mrb_value true_and (mrb_state *mrb, mrb_value obj)
 
static mrb_value true_xor (mrb_state *mrb, mrb_value obj)
 
static mrb_value true_to_s (mrb_state *mrb, mrb_value obj)
 
static mrb_value true_or (mrb_state *mrb, mrb_value obj)
 
static mrb_value false_and (mrb_state *mrb, mrb_value obj)
 
static mrb_value false_xor (mrb_state *mrb, mrb_value obj)
 
static mrb_value false_or (mrb_state *mrb, mrb_value obj)
 
static mrb_value false_to_s (mrb_state *mrb, mrb_value obj)
 
void mrb_init_object (mrb_state *mrb)
 
static const char * type_name (enum mrb_vtype t)
 
static mrb_value convert_type (mrb_state *mrb, mrb_value val, const char *tname, mrb_sym method, mrb_bool raise)
 
mrb_value mrb_type_convert (mrb_state *mrb, mrb_value val, enum mrb_vtype type, mrb_sym method)
 
mrb_value mrb_type_convert_check (mrb_state *mrb, mrb_value val, enum mrb_vtype type, mrb_sym method)
 
void mrb_check_type (mrb_state *mrb, mrb_value x, enum mrb_vtype t)
 
mrb_value mrb_any_to_s (mrb_state *mrb, mrb_value obj)
 
mrb_bool mrb_obj_is_kind_of (mrb_state *mrb, mrb_value obj, struct RClass *c)
 
mrb_value mrb_to_int (mrb_state *mrb, mrb_value val)
 
mrb_value mrb_convert_to_integer (mrb_state *mrb, mrb_value val, mrb_int base)
 
mrb_value mrb_Integer (mrb_state *mrb, mrb_value val)
 
mrb_value mrb_Float (mrb_state *mrb, mrb_value val)
 
mrb_value mrb_to_str (mrb_state *mrb, mrb_value val)
 
mrb_value mrb_string_type (mrb_state *mrb, mrb_value str)
 
mrb_value mrb_ensure_string_type (mrb_state *mrb, mrb_value str)
 
mrb_value mrb_check_string_type (mrb_state *mrb, mrb_value str)
 
mrb_value mrb_ensure_array_type (mrb_state *mrb, mrb_value ary)
 
mrb_value mrb_check_array_type (mrb_state *mrb, mrb_value ary)
 
mrb_value mrb_ensure_hash_type (mrb_state *mrb, mrb_value hash)
 
mrb_value mrb_check_hash_type (mrb_state *mrb, mrb_value hash)
 
mrb_value mrb_inspect (mrb_state *mrb, mrb_value obj)
 
mrb_bool mrb_eql (mrb_state *mrb, mrb_value obj1, mrb_value obj2)
 

Variables

static const struct types builtin_types []
 

Function Documentation

◆ convert_type()

static mrb_value convert_type ( mrb_state mrb,
mrb_value  val,
const char *  tname,
mrb_sym  method,
mrb_bool  raise 
)
static

◆ false_and()

static mrb_value false_and ( mrb_state mrb,
mrb_value  obj 
)
static

Definition at line 220 of file object.c.

References mrb_false_value().

Referenced by mrb_init_object().

◆ false_or()

static mrb_value false_or ( mrb_state mrb,
mrb_value  obj 
)
static

Definition at line 259 of file object.c.

References mrb_bool_value(), and mrb_get_args().

Referenced by mrb_init_object().

◆ false_to_s()

static mrb_value false_to_s ( mrb_state mrb,
mrb_value  obj 
)
static

Definition at line 276 of file object.c.

References mrb_str_new_lit_frozen, mrb_str_ptr, RSTR_SET_ASCII_FLAG, and str.

Referenced by mrb_init_object().

◆ false_xor()

static mrb_value false_xor ( mrb_state mrb,
mrb_value  obj 
)
static

Definition at line 239 of file object.c.

References mrb_bool_value(), and mrb_get_args().

Referenced by mrb_init_object().

◆ mrb_any_to_s()

◆ mrb_check_array_type()

mrb_value mrb_check_array_type ( mrb_state mrb,
mrb_value  ary 
)

Definition at line 632 of file object.c.

References mrb_array_p, and mrb_nil_value().

Referenced by join_ary(), and mrb_ary_assoc().

◆ mrb_check_hash_type()

mrb_value mrb_check_hash_type ( mrb_state mrb,
mrb_value  hash 
)

Definition at line 648 of file object.c.

References hash, mrb_hash_p, and mrb_nil_value().

Referenced by get_hash().

◆ mrb_check_string_type()

mrb_value mrb_check_string_type ( mrb_state mrb,
mrb_value  str 
)

Definition at line 616 of file object.c.

References mrb_nil_value(), mrb_string_p, and str.

Referenced by join_ary(), mrb_convert_to_integer(), and mrb_str_format().

◆ mrb_check_type()

◆ mrb_convert_to_integer()

◆ mrb_ensure_array_type()

mrb_value mrb_ensure_array_type ( mrb_state mrb,
mrb_value  ary 
)

Definition at line 623 of file object.c.

References E_TYPE_ERROR, mrb_array_p, and mrb_raisef().

Referenced by mrb_ary_splat(), and mrb_obj_ceqq().

◆ mrb_ensure_hash_type()

mrb_value mrb_ensure_hash_type ( mrb_state mrb,
mrb_value  hash 
)

Definition at line 639 of file object.c.

References E_TYPE_ERROR, hash, mrb_hash_p, and mrb_raisef().

Referenced by mrb_f_hash(), mrb_hash_merge(), and mrb_vm_exec().

◆ mrb_ensure_string_type()

mrb_value mrb_ensure_string_type ( mrb_state mrb,
mrb_value  str 
)

Returns a Ruby string type.

Parameters
mrbThe current mruby state.
strRuby string.
Returns
[mrb_value] A Ruby string.

Definition at line 607 of file object.c.

References E_TYPE_ERROR, mrb_raisef(), mrb_string_p, and str.

Referenced by mrb_file_s_unlink(), mrb_mod_const_get(), mrb_str_concat_m(), mrb_str_end_with(), mrb_str_start_with(), mrb_string_type(), and mrb_to_str().

◆ mrb_eql()

mrb_bool mrb_eql ( mrb_state mrb,
mrb_value  obj1,
mrb_value  obj2 
)

Definition at line 661 of file object.c.

Referenced by mrb_struct_eql(), obj_eql(), and range_eql().

◆ mrb_equal()

◆ mrb_Float()

◆ mrb_init_object()

◆ mrb_inspect()

mrb_value mrb_inspect ( mrb_state mrb,
mrb_value  obj 
)

◆ mrb_Integer()

mrb_value mrb_Integer ( mrb_state mrb,
mrb_value  val 
)

Definition at line 565 of file object.c.

References mrb_convert_to_integer().

Referenced by mrb_str_format().

◆ mrb_obj_eq()

mrb_bool mrb_obj_eq ( mrb_state mrb,
mrb_value  v1,
mrb_value  v2 
)

◆ mrb_obj_equal()

◆ mrb_obj_is_kind_of()

◆ mrb_string_type()

Definition at line 601 of file object.c.

References mrb_ensure_string_type(), and str.

◆ mrb_to_int()

◆ mrb_to_str()

◆ mrb_true()

static mrb_value mrb_true ( mrb_state mrb,
mrb_value  obj 
)
static

Definition at line 82 of file object.c.

References mrb_true_value().

Referenced by mrb_init_object().

◆ mrb_type_convert()

mrb_value mrb_type_convert ( mrb_state mrb,
mrb_value  val,
enum mrb_vtype  type,
mrb_sym  method 
)

◆ mrb_type_convert_check()

mrb_value mrb_type_convert_check ( mrb_state mrb,
mrb_value  val,
enum mrb_vtype  type,
mrb_sym  method 
)

Definition at line 389 of file object.c.

References convert_type(), FALSE, mrb_nil_p, mrb_nil_value(), MRB_TT_DATA, MRB_TT_ISTRUCT, mrb_type(), type, type_name(), v, and val.

Referenced by mrb_f_array().

◆ nil_inspect()

static mrb_value nil_inspect ( mrb_state mrb,
mrb_value  obj 
)
static

Definition at line 104 of file object.c.

References mrb_str_new_lit_frozen, mrb_str_ptr, RSTR_SET_ASCII_FLAG, and str.

Referenced by mrb_init_object().

◆ nil_to_s()

static mrb_value nil_to_s ( mrb_state mrb,
mrb_value  obj 
)
static

Definition at line 96 of file object.c.

References mrb_str_new_frozen, mrb_str_ptr, NULL, RSTR_SET_ASCII_FLAG, and str.

Referenced by mrb_init_object().

◆ true_and()

static mrb_value true_and ( mrb_state mrb,
mrb_value  obj 
)
static

Document-class: TrueClass

The global value true is the only instance of class TrueClass and represents a logically true value in boolean expressions. The class provides operators allowing true to be used in logical expressions.

Definition at line 130 of file object.c.

References mrb_bool_value(), and mrb_get_args().

Referenced by mrb_init_object().

◆ true_or()

static mrb_value true_or ( mrb_state mrb,
mrb_value  obj 
)
static

Definition at line 192 of file object.c.

References mrb_true_value().

Referenced by mrb_init_object().

◆ true_to_s()

static mrb_value true_to_s ( mrb_state mrb,
mrb_value  obj 
)
static

Definition at line 167 of file object.c.

References mrb_str_new_lit_frozen, mrb_str_ptr, RSTR_SET_ASCII_FLAG, and str.

Referenced by mrb_init_object().

◆ true_xor()

static mrb_value true_xor ( mrb_state mrb,
mrb_value  obj 
)
static

Definition at line 150 of file object.c.

References mrb_bool_value(), and mrb_get_args().

Referenced by mrb_init_object().

◆ type_name()

static const char* type_name ( enum mrb_vtype  t)
static

Definition at line 348 of file object.c.

References builtin_types, MRB_TT_MAXDEFINE, NULL, and type.

Referenced by mrb_check_type(), mrb_type_convert(), and mrb_type_convert_check().

Variable Documentation

◆ builtin_types

const struct types builtin_types[]
static
Initial value:
= {
{MRB_TT_FALSE, "false"},
{MRB_TT_TRUE, "true"},
{MRB_TT_INTEGER,"Integer"},
{MRB_TT_SYMBOL, "Symbol"},
{MRB_TT_MODULE, "Module"},
{MRB_TT_OBJECT, "Object"},
{MRB_TT_CLASS, "Class"},
{MRB_TT_ICLASS, "iClass"},
{MRB_TT_SCLASS, "SClass"},
{MRB_TT_PROC, "Proc"},
{MRB_TT_FLOAT, "Float"},
{MRB_TT_ARRAY, "Array"},
{MRB_TT_HASH, "Hash"},
{MRB_TT_STRING, "String"},
{MRB_TT_RANGE, "Range"},
{MRB_TT_DATA, "Data"},
}
@ MRB_TT_DATA
Definition: value.h:128
@ MRB_TT_TRUE
Definition: value.h:109
@ MRB_TT_SCLASS
Definition: value.h:120
@ MRB_TT_CLASS
Definition: value.h:117
@ MRB_TT_OBJECT
Definition: value.h:116
@ MRB_TT_STRING
Definition: value.h:124
@ MRB_TT_RANGE
Definition: value.h:125
@ MRB_TT_FALSE
Definition: value.h:108
@ MRB_TT_MODULE
Definition: value.h:118
@ MRB_TT_HASH
Definition: value.h:123
@ MRB_TT_SYMBOL
Definition: value.h:112
@ MRB_TT_ICLASS
Definition: value.h:119
@ MRB_TT_ARRAY
Definition: value.h:122
@ MRB_TT_FLOAT
Definition: value.h:110
@ MRB_TT_PROC
Definition: value.h:121
@ MRB_TT_MAXDEFINE
Definition: value.h:132
@ MRB_TT_INTEGER
Definition: value.h:111

Referenced by type_name().