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)  

variable.h File Reference
#include "common.h"
Include dependency graph for variable.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  global_variable
 
struct  global_entry
 

Typedefs

typedef struct global_variable global_variable
 
typedef int() mrb_iv_foreach_func(mrb_state *, mrb_sym, mrb_value, void *)
 

Functions

mrb_value mrb_vm_special_get (mrb_state *, mrb_sym)
 
void mrb_vm_special_set (mrb_state *, mrb_sym, mrb_value)
 
mrb_value mrb_vm_cv_get (mrb_state *, mrb_sym)
 
void mrb_vm_cv_set (mrb_state *, mrb_sym, mrb_value)
 
mrb_value mrb_vm_const_get (mrb_state *, mrb_sym)
 
void mrb_vm_const_set (mrb_state *, mrb_sym, mrb_value)
 
size_t mrb_obj_iv_tbl_memsize (mrb_value)
 
mrb_value mrb_const_get (mrb_state *, mrb_value, mrb_sym)
 
void mrb_const_set (mrb_state *, mrb_value, mrb_sym, mrb_value)
 
mrb_bool mrb_const_defined (mrb_state *, mrb_value, mrb_sym)
 
void mrb_const_remove (mrb_state *, mrb_value, mrb_sym)
 
mrb_bool mrb_iv_name_sym_p (mrb_state *mrb, mrb_sym sym)
 
void mrb_iv_name_sym_check (mrb_state *mrb, mrb_sym sym)
 
mrb_value mrb_obj_iv_get (mrb_state *mrb, struct RObject *obj, mrb_sym sym)
 
void mrb_obj_iv_set (mrb_state *mrb, struct RObject *obj, mrb_sym sym, mrb_value v)
 
mrb_bool mrb_obj_iv_defined (mrb_state *mrb, struct RObject *obj, mrb_sym sym)
 
mrb_value mrb_iv_get (mrb_state *mrb, mrb_value obj, mrb_sym sym)
 
void mrb_iv_set (mrb_state *mrb, mrb_value obj, mrb_sym sym, mrb_value v)
 
mrb_bool mrb_iv_defined (mrb_state *, mrb_value, mrb_sym)
 
mrb_value mrb_iv_remove (mrb_state *mrb, mrb_value obj, mrb_sym sym)
 
void mrb_iv_copy (mrb_state *mrb, mrb_value dst, mrb_value src)
 
mrb_bool mrb_const_defined_at (mrb_state *mrb, mrb_value mod, mrb_sym id)
 
mrb_value mrb_gv_get (mrb_state *mrb, mrb_sym sym)
 
void mrb_gv_set (mrb_state *mrb, mrb_sym sym, mrb_value val)
 
void mrb_gv_remove (mrb_state *mrb, mrb_sym sym)
 
mrb_value mrb_cv_get (mrb_state *mrb, mrb_value mod, mrb_sym sym)
 
void mrb_mod_cv_set (mrb_state *mrb, struct RClass *c, mrb_sym sym, mrb_value v)
 
void mrb_cv_set (mrb_state *mrb, mrb_value mod, mrb_sym sym, mrb_value v)
 
mrb_bool mrb_cv_defined (mrb_state *mrb, mrb_value mod, mrb_sym sym)
 
mrb_value mrb_obj_iv_inspect (mrb_state *, struct RObject *)
 
void mrb_obj_iv_set_force (mrb_state *mrb, struct RObject *obj, mrb_sym sym, mrb_value v)
 
mrb_value mrb_mod_constants (mrb_state *mrb, mrb_value mod)
 
mrb_value mrb_f_global_variables (mrb_state *mrb, mrb_value self)
 
mrb_value mrb_obj_instance_variables (mrb_state *, mrb_value)
 
mrb_value mrb_mod_class_variables (mrb_state *, mrb_value)
 
mrb_value mrb_mod_cv_get (mrb_state *mrb, struct RClass *c, mrb_sym sym)
 
mrb_bool mrb_mod_cv_defined (mrb_state *mrb, struct RClass *c, mrb_sym sym)
 
mrb_bool mrb_ident_p (const char *s, mrb_int len)
 
void mrb_gc_mark_gv (mrb_state *)
 
void mrb_gc_free_gv (mrb_state *)
 
void mrb_gc_mark_iv (mrb_state *, struct RObject *)
 
size_t mrb_gc_mark_iv_size (mrb_state *, struct RObject *)
 
void mrb_gc_free_iv (mrb_state *, struct RObject *)
 
void mrb_iv_foreach (mrb_state *mrb, mrb_value obj, mrb_iv_foreach_func *func, void *p)
 

Detailed Description

  • mruby variables

See Copyright Notice in mruby.h

Definition in file variable.h.

Typedef Documentation

◆ global_variable

Functions to access mruby variables.

◆ mrb_iv_foreach_func

typedef int() mrb_iv_foreach_func(mrb_state *, mrb_sym, mrb_value, void *)

Definition at line 135 of file variable.h.

Function Documentation

◆ mrb_const_defined()

mrb_bool mrb_const_defined ( mrb_state mrb,
mrb_value  mod,
mrb_sym  id 
)

◆ mrb_const_defined_at()

◆ mrb_const_get()

◆ mrb_const_remove()

void mrb_const_remove ( mrb_state mrb,
mrb_value  mod,
mrb_sym  sym 
)

Definition at line 857 of file variable.c.

References mod(), mod_const_check(), mrb_iv_remove(), and sym.

Referenced by make_struct().

◆ mrb_const_set()

◆ mrb_cv_defined()

mrb_bool mrb_cv_defined ( mrb_state mrb,
mrb_value  mod,
mrb_sym  sym 
)

Definition at line 720 of file variable.c.

References mod(), mrb_class_ptr, mrb_mod_cv_defined(), and sym.

Referenced by mrb_mod_cvar_defined(), and mrb_mod_remove_cvar().

◆ mrb_cv_get()

mrb_value mrb_cv_get ( mrb_state mrb,
mrb_value  mod,
mrb_sym  sym 
)

Definition at line 651 of file variable.c.

References mod(), mrb_class_ptr, mrb_mod_cv_get(), and sym.

Referenced by mrb_addrinfo_getaddrinfo(), and mrb_mod_cvar_get().

◆ mrb_cv_set()

void mrb_cv_set ( mrb_state mrb,
mrb_value  mod,
mrb_sym  sym,
mrb_value  v 
)

Definition at line 702 of file variable.c.

References mod(), mrb_class_ptr, mrb_mod_cv_set(), sym, and v.

Referenced by mrb_addrinfo_getaddrinfo(), and mrb_mod_cvar_set().

◆ mrb_f_global_variables()

mrb_value mrb_f_global_variables ( mrb_state mrb,
mrb_value  self 
)

Definition at line 978 of file variable.c.

References mrb_state::globals, gv_i(), iv_foreach(), and mrb_ary_new().

Referenced by mrb_mruby_metaprog_gem_init().

◆ mrb_gc_free_gv()

void mrb_gc_free_gv ( mrb_state mrb)

Definition at line 255 of file variable.c.

References mrb_state::globals, and iv_free().

Referenced by mrb_close().

◆ mrb_gc_free_iv()

void mrb_gc_free_iv ( mrb_state mrb,
struct RObject obj 
)

Definition at line 274 of file variable.c.

References RObject::iv, and iv_free().

Referenced by obj_free().

◆ mrb_gc_mark_gv()

void mrb_gc_mark_gv ( mrb_state mrb)

Definition at line 249 of file variable.c.

References mrb_state::globals, and mark_tbl().

Referenced by final_marking_phase(), and root_scan_phase().

◆ mrb_gc_mark_iv()

void mrb_gc_mark_iv ( mrb_state mrb,
struct RObject obj 
)

Definition at line 262 of file variable.c.

References RObject::iv, and mark_tbl().

Referenced by gc_mark_children().

◆ mrb_gc_mark_iv_size()

size_t mrb_gc_mark_iv_size ( mrb_state mrb,
struct RObject obj 
)

Definition at line 268 of file variable.c.

References RObject::iv, and iv_size().

Referenced by gc_gray_counts().

◆ mrb_gv_get()

mrb_value mrb_gv_get ( mrb_state mrb,
mrb_sym  sym 
)

Get a global variable. Will return nil if the var does not exist

Example:

!!!ruby
# Ruby style
var = $value

!!!c
// C style
mrb_sym sym = mrb_intern_lit(mrb, "$value");
mrb_value var = mrb_gv_get(mrb, sym);
Parameters
mrbThe mruby state reference
symThe name of the global variable
Returns
The value of that global variable. May be nil

Definition at line 930 of file variable.c.

References mrb_state::globals, iv_get(), mrb_nil_value(), sym, and v.

Referenced by mrb_gc_register(), mrb_gc_unregister(), and mrb_vm_exec().

◆ mrb_gv_remove()

void mrb_gv_remove ( mrb_state mrb,
mrb_sym  sym 
)

Remove a global variable.

Example:

# Ruby style
$value = nil

// C style
mrb_sym sym = mrb_intern_lit(mrb, "$value");
mrb_gv_remove(mrb, sym);
Parameters
mrbThe mruby state reference
symThe name of the global variable

Definition at line 952 of file variable.c.

References mrb_state::globals, iv_del(), NULL, and sym.

◆ mrb_gv_set()

void mrb_gv_set ( mrb_state mrb,
mrb_sym  sym,
mrb_value  val 
)

Set a global variable

Example:

!!!ruby
# Ruby style
$value = "foo"

!!!c
// C style
mrb_sym sym = mrb_intern_lit(mrb, "$value");
mrb_gv_set(mrb, sym, mrb_str_new_lit("foo"));
Parameters
mrbThe mruby state reference
symThe name of the global variable
valThe value of the global variable

Definition at line 940 of file variable.c.

References mrb_state::globals, iv_new(), iv_put(), sym, t, and v.

Referenced by io_set_process_status(), main(), mrb_gc_register(), mrb_gc_unregister(), and mrb_vm_exec().

◆ mrb_ident_p()

mrb_bool mrb_ident_p ( const char *  s,
mrb_int  len 
)

Definition at line 1134 of file variable.c.

References FALSE, i, identchar, len, s, and TRUE.

Referenced by cv_name_p(), mrb_const_name_p(), and mrb_iv_name_sym_p().

◆ mrb_iv_copy()

void mrb_iv_copy ( mrb_state mrb,
mrb_value  dst,
mrb_value  src 
)

Definition at line 440 of file variable.c.

References d, dest, iv_copy(), iv_free(), mrb_obj_ptr, mrb_write_barrier(), s, and link_confs::src.

Referenced by init_copy(), and mrb_singleton_class_clone().

◆ mrb_iv_defined()

mrb_bool mrb_iv_defined ( mrb_state mrb,
mrb_value  obj,
mrb_sym  sym 
)

Definition at line 412 of file variable.c.

References FALSE, mrb_obj_iv_defined(), mrb_obj_ptr, obj_iv_p(), and sym.

Referenced by mrb_keep_backtrace(), and mrb_obj_ivar_defined().

◆ mrb_iv_foreach()

void mrb_iv_foreach ( mrb_state mrb,
mrb_value  obj,
mrb_iv_foreach_func func,
void p 
)

Definition at line 350 of file variable.c.

References func, iv, iv_foreach(), mrb_obj_ptr, obj_iv_p(), and p.

◆ mrb_iv_get()

◆ mrb_iv_name_sym_check()

void mrb_iv_name_sym_check ( mrb_state mrb,
mrb_sym  sym 
)

◆ mrb_iv_name_sym_p()

mrb_bool mrb_iv_name_sym_p ( mrb_state mrb,
mrb_sym  sym 
)

Definition at line 419 of file variable.c.

References FALSE, ISDIGIT, len, mrb_ident_p(), mrb_sym_name_len(), and s.

Referenced by mrb_iv_name_sym_check().

◆ mrb_iv_remove()

◆ mrb_iv_set()

◆ mrb_mod_class_variables()

mrb_value mrb_mod_class_variables ( mrb_state mrb,
mrb_value  mod 
)

Definition at line 598 of file variable.c.

References c, cv_i(), iv_foreach(), mod(), mrb_ary_new(), mrb_class_ptr, mrb_get_args(), and TRUE.

Referenced by mrb_mruby_metaprog_gem_init().

◆ mrb_mod_constants()

mrb_value mrb_mod_constants ( mrb_state mrb,
mrb_value  mod 
)

◆ mrb_mod_cv_defined()

mrb_bool mrb_mod_cv_defined ( mrb_state mrb,
struct RClass c,
mrb_sym  sym 
)

Definition at line 708 of file variable.c.

References c, FALSE, iv_get(), NULL, sym, and TRUE.

Referenced by mrb_cv_defined().

◆ mrb_mod_cv_get()

mrb_value mrb_mod_cv_get ( mrb_state mrb,
struct RClass c,
mrb_sym  sym 
)

◆ mrb_mod_cv_set()

◆ mrb_obj_instance_variables()

mrb_value mrb_obj_instance_variables ( mrb_state mrb,
mrb_value  self 
)

Definition at line 555 of file variable.c.

References iv, iv_foreach(), iv_i(), mrb_ary_new(), mrb_obj_ptr, and obj_iv_p().

Referenced by mrb_mruby_metaprog_gem_init().

◆ mrb_obj_iv_defined()

mrb_bool mrb_obj_iv_defined ( mrb_state mrb,
struct RObject obj,
mrb_sym  sym 
)

Definition at line 400 of file variable.c.

References FALSE, RObject::iv, iv_get(), NULL, sym, and t.

Referenced by mrb_class_name_class(), and mrb_iv_defined().

◆ mrb_obj_iv_get()

mrb_value mrb_obj_iv_get ( mrb_state mrb,
struct RObject obj,
mrb_sym  sym 
)

◆ mrb_obj_iv_inspect()

◆ mrb_obj_iv_set()

◆ mrb_obj_iv_set_force()

void mrb_obj_iv_set_force ( mrb_state mrb,
struct RObject obj,
mrb_sym  sym,
mrb_value  v 
)

◆ mrb_obj_iv_tbl_memsize()

size_t mrb_obj_iv_tbl_memsize ( mrb_value  obj)

Definition at line 1124 of file variable.c.

References mrb_obj_ptr, and NULL.

Referenced by mrb_hash_memsize(), and os_memsize_of_object().

◆ mrb_vm_const_get()

◆ mrb_vm_const_set()

void mrb_vm_const_set ( mrb_state mrb,
mrb_sym  sym,
mrb_value  v 
)

◆ mrb_vm_cv_get()

mrb_value mrb_vm_cv_get ( mrb_state mrb,
mrb_sym  sym 
)

◆ mrb_vm_cv_set()

void mrb_vm_cv_set ( mrb_state mrb,
mrb_sym  sym,
mrb_value  v 
)

◆ mrb_vm_special_get()

mrb_value mrb_vm_special_get ( mrb_state mrb,
mrb_sym  i 
)

Definition at line 282 of file variable.c.

References mrb_fixnum_value().

Referenced by mrb_vm_exec().

◆ mrb_vm_special_set()

void mrb_vm_special_set ( mrb_state mrb,
mrb_sym  i,
mrb_value  v 
)

Definition at line 288 of file variable.c.

Referenced by mrb_vm_exec().