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)  

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

Go to the source code of this file.

Classes

struct  RClass
 

Macros

#define mrb_class_ptr(v)   ((struct RClass*)(mrb_ptr(v)))
 
#define MRB_FL_CLASS_IS_PREPENDED   (1 << 19)
 
#define MRB_FL_CLASS_IS_ORIGIN   (1 << 18)
 
#define MRB_CLASS_ORIGIN(c)
 
#define MRB_FL_CLASS_IS_INHERITED   (1 << 17)
 
#define MRB_INSTANCE_TT_MASK   (0xFF)
 
#define MRB_SET_INSTANCE_TT(c, tt)   ((c)->flags = (((c)->flags & ~MRB_INSTANCE_TT_MASK) | (char)(tt)))
 
#define MRB_INSTANCE_TT(c)   (enum mrb_vtype)((c)->flags & MRB_INSTANCE_TT_MASK)
 

Typedefs

typedef int() mrb_mt_foreach_func(mrb_state *, mrb_sym, mrb_method_t, void *)
 

Functions

static struct RClassmrb_class (mrb_state *mrb, mrb_value v)
 
struct RClassmrb_vm_define_class (mrb_state *, mrb_value, mrb_value, mrb_sym)
 
struct RClassmrb_vm_define_module (mrb_state *, mrb_value, mrb_sym)
 
void mrb_define_method_raw (mrb_state *, struct RClass *, mrb_sym, mrb_method_t)
 
void mrb_alias_method (mrb_state *, struct RClass *c, mrb_sym a, mrb_sym b)
 
void mrb_remove_method (mrb_state *mrb, struct RClass *c, mrb_sym sym)
 
mrb_method_t mrb_method_search_vm (mrb_state *, struct RClass **, mrb_sym)
 
mrb_method_t mrb_method_search (mrb_state *, struct RClass *, mrb_sym)
 
struct RClassmrb_class_real (struct RClass *cl)
 
mrb_value mrb_instance_new (mrb_state *mrb, mrb_value cv)
 
void mrb_class_name_class (mrb_state *, struct RClass *, struct RClass *, mrb_sym)
 
mrb_bool mrb_const_name_p (mrb_state *, const char *, mrb_int)
 
mrb_value mrb_class_find_path (mrb_state *, struct RClass *)
 
mrb_value mrb_mod_to_s (mrb_state *, mrb_value)
 
void mrb_gc_mark_mt (mrb_state *, struct RClass *)
 
size_t mrb_gc_mark_mt_size (mrb_state *, struct RClass *)
 
void mrb_gc_free_mt (mrb_state *, struct RClass *)
 
void mrb_mc_clear_by_class (mrb_state *mrb, struct RClass *c)
 
void mrb_mt_foreach (mrb_state *, struct RClass *, mrb_mt_foreach_func *, void *)
 

Detailed Description

  • Class class

See Copyright Notice in mruby.h

Definition in file class.h.

Macro Definition Documentation

◆ MRB_CLASS_ORIGIN

#define MRB_CLASS_ORIGIN (   c)
Value:
do {\
(c) = (c)->super;\
while (!((c)->flags & MRB_FL_CLASS_IS_ORIGIN)) {\
(c) = (c)->super;\
}\
}\
} while (0)
#define MRB_FL_CLASS_IS_PREPENDED
Definition: class.h:61
#define MRB_FL_CLASS_IS_ORIGIN
Definition: class.h:62
#define c(n)
Definition: gpos-common.c:150
#define flags

Definition at line 63 of file class.h.

◆ mrb_class_ptr

#define mrb_class_ptr (   v)    ((struct RClass*)(mrb_ptr(v)))

Definition at line 24 of file class.h.

◆ MRB_FL_CLASS_IS_INHERITED

#define MRB_FL_CLASS_IS_INHERITED   (1 << 17)

Definition at line 71 of file class.h.

◆ MRB_FL_CLASS_IS_ORIGIN

#define MRB_FL_CLASS_IS_ORIGIN   (1 << 18)

Definition at line 62 of file class.h.

◆ MRB_FL_CLASS_IS_PREPENDED

#define MRB_FL_CLASS_IS_PREPENDED   (1 << 19)

Definition at line 61 of file class.h.

◆ MRB_INSTANCE_TT

#define MRB_INSTANCE_TT (   c)    (enum mrb_vtype)((c)->flags & MRB_INSTANCE_TT_MASK)

Definition at line 74 of file class.h.

◆ MRB_INSTANCE_TT_MASK

#define MRB_INSTANCE_TT_MASK   (0xFF)

Definition at line 72 of file class.h.

◆ MRB_SET_INSTANCE_TT

#define MRB_SET_INSTANCE_TT (   c,
  tt 
)    ((c)->flags = (((c)->flags & ~MRB_INSTANCE_TT_MASK) | (char)(tt)))

Definition at line 73 of file class.h.

Typedef Documentation

◆ mrb_mt_foreach_func

typedef int() mrb_mt_foreach_func(mrb_state *, mrb_sym, mrb_method_t, void *)

Definition at line 103 of file class.h.

Function Documentation

◆ mrb_alias_method()

◆ mrb_class()

◆ mrb_class_find_path()

◆ mrb_class_name_class()

◆ mrb_class_real()

struct RClass* mrb_class_real ( struct RClass cl)

◆ mrb_const_name_p()

mrb_bool mrb_const_name_p ( mrb_state mrb,
const char *  name,
mrb_int  len 
)

Definition at line 324 of file class.c.

References ISUPPER, len, mrb_ident_p(), and name.

Referenced by check_const_name_sym(), and make_struct().

◆ mrb_define_method_raw()

◆ mrb_gc_free_mt()

void mrb_gc_free_mt ( mrb_state mrb,
struct RClass c 
)

Definition at line 288 of file class.c.

References c, and mt_free().

Referenced by obj_free().

◆ mrb_gc_mark_mt()

void mrb_gc_mark_mt ( mrb_state mrb,
struct RClass c 
)

Definition at line 258 of file class.c.

References c, i, mrb_gc_mark(), NULL, p, and slot.

Referenced by gc_mark_children().

◆ mrb_gc_mark_mt_size()

size_t mrb_gc_mark_mt_size ( mrb_state mrb,
struct RClass c 
)

Definition at line 279 of file class.c.

References c, and h.

Referenced by gc_gray_counts(), and os_memsize_of_object().

◆ mrb_instance_new()

mrb_value mrb_instance_new ( mrb_state mrb,
mrb_value  cv 
)

◆ mrb_mc_clear_by_class()

void mrb_mc_clear_by_class ( mrb_state mrb,
struct RClass c 
)

◆ mrb_method_search()

mrb_method_t mrb_method_search ( mrb_state mrb,
struct RClass c,
mrb_sym  mid 
)

Definition at line 1778 of file class.c.

References c, m, mrb_method_search_vm(), MRB_METHOD_UNDEF_P, and mrb_name_error().

Referenced by mrb_alias_method(), and mrb_mod_module_function().

◆ mrb_method_search_vm()

◆ mrb_mod_to_s()

◆ mrb_mt_foreach()

void mrb_mt_foreach ( mrb_state mrb,
struct RClass c,
mrb_mt_foreach_func fn,
void p 
)

Definition at line 225 of file class.c.

References c, fc-lang::fn, i, m, MRB_METHOD_FROM_FUNC, MRB_METHOD_FROM_PROC, MRB_METHOD_NOARG_SET, NULL, p, and slot.

Referenced by method_entry_loop().

◆ mrb_remove_method()

void mrb_remove_method ( mrb_state mrb,
struct RClass c,
mrb_sym  sym 
)

Definition at line 2314 of file class.c.

References c, h, MRB_CLASS_ORIGIN, mrb_name_error(), and mt_del().

Referenced by mrb_mod_remove_method().

◆ mrb_vm_define_class()

◆ mrb_vm_define_module()

struct RClass* mrb_vm_define_module ( mrb_state mrb,
mrb_value  outer,
mrb_sym  id 
)