Ruby 2.0.0p353(2013-11-22revision43784)

- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

Macros | Functions | Variables
class.c File Reference
`#include "ruby/ruby.h"`
`#include "ruby/st.h"`
`#include "method.h"`
`#include "constant.h"`
`#include "vm_core.h"`
`#include "internal.h"`
`#include <ctype.h>`
`#include <stdarg.h>`
Include dependency graph for class.c:

Go to the source code of this file.

## Macros
#define | METACLASS_OF(k) RBASIC(k)->klass
#define | META_CLASS_OF_CLASS_CLASS_P(k) (METACLASS_OF(k) == (k))
| whether k is a meta^(n)-class of Class class More...
#define | HAVE_METACLASS_P(k)
| whether k has a metaclass More...
#define | ENSURE_EIGENCLASS(klass) (HAVE_METACLASS_P(klass) ? METACLASS_OF(klass) : make_metaclass(klass))
| ensures klass belongs to its own eigenclass. More...
#define | VISI(x) ((x)&NOEX_MASK)
#define | VISI_CHECK(x, f) (VISI(x) == (f))
#define | SPECIAL_SINGLETON(x, c)

## Functions
static VALUE | class_alloc (VALUE flags, VALUE klass)
| Allocates a struct RClass for a new class. More...
VALUE | rb_class_boot (VALUE super)
| A utility function that wraps class_alloc. More...
void | rb_check_inheritable (VALUE super)
| Ensures a class can be derived from super. More...
VALUE | rb_class_new (VALUE super)
| Creates a new class. More...
static NODE * | rewrite_cref_stack (NODE *node, VALUE old_klass, VALUE new_klass)
static void | clone_method (VALUE klass, ID mid, const rb_method_entry_t *me)
static int | clone_method_i (st_data_t key, st_data_t value, st_data_t data)
static int | clone_const (ID key, const rb_const_entry_t *ce, st_table *tbl)
static int | clone_const_i (st_data_t key, st_data_t value, st_data_t data)
static void | class_init_copy_check (VALUE clone, VALUE orig)
VALUE | rb_mod_init_copy (VALUE clone, VALUE orig)
VALUE | rb_singleton_class_clone (VALUE obj)
VALUE | rb_singleton_class_clone_and_attach (VALUE obj, VALUE attach)
void | rb_singleton_class_attached (VALUE klass, VALUE obj)
| Attach a object to a singleton class. More...
static VALUE | make_metaclass (VALUE klass)
| Creates a metaclass of klass. More...
static VALUE | make_singleton_class (VALUE obj)
| Creates a singleton class for obj. More...
static VALUE | boot_defclass (const char *name, VALUE super)
void | Init_class_hierarchy (void)
VALUE | rb_make_metaclass (VALUE obj, VALUE unused)
VALUE | rb_define_class_id (ID id, VALUE super)
| Defines a new class. More...
VALUE | rb_class_inherited (VALUE super, VALUE klass)
| Calls Class::inherited. More...
VALUE | rb_define_class (const char *name, VALUE super)
| Defines a top-level class. More...
VALUE | rb_define_class_under (VALUE outer, const char *name, VALUE super)
| Defines a class under the namespace of outer. More...
VALUE | rb_define_class_id_under (VALUE outer, ID id, VALUE super)
| Defines a class under the namespace of outer. More...
VALUE | rb_module_new (void)
VALUE | rb_define_module_id (ID id)
VALUE | rb_define_module (const char *name)
VALUE | rb_define_module_under (VALUE outer, const char *name)
VALUE | rb_define_module_id_under (VALUE outer, ID id)
VALUE | rb_include_class_new (VALUE module, VALUE super)
static int | include_modules_at (const VALUE klass, VALUE c, VALUE module)
void | rb_include_module (VALUE klass, VALUE module)
static int | add_refined_method_entry_i (st_data_t key, st_data_t value, st_data_t data)
static int | move_refined_method (st_data_t key, st_data_t value, st_data_t data)
void | rb_prepend_module (VALUE klass, VALUE module)
VALUE | rb_mod_included_modules (VALUE mod)
VALUE | rb_mod_include_p (VALUE mod, VALUE mod2)
VALUE | rb_mod_ancestors (VALUE mod)
static int | ins_methods_push (ID name, long type, VALUE ary, long visi)
static int | ins_methods_i (st_data_t name, st_data_t type, st_data_t ary)
static int | ins_methods_prot_i (st_data_t name, st_data_t type, st_data_t ary)
static int | ins_methods_priv_i (st_data_t name, st_data_t type, st_data_t ary)
static int | ins_methods_pub_i (st_data_t name, st_data_t type, st_data_t ary)
static int | method_entry_i (st_data_t key, st_data_t value, st_data_t data)
static VALUE | class_instance_method_list (int argc, VALUE *argv, VALUE mod, int obj, int(*func)(st_data_t, st_data_t, st_data_t))
VALUE | rb_class_instance_methods (int argc, VALUE *argv, VALUE mod)
VALUE | rb_class_protected_instance_methods (int argc, VALUE *argv, VALUE mod)
VALUE | rb_class_private_instance_methods (int argc, VALUE *argv, VALUE mod)
VALUE | rb_class_public_instance_methods (int argc, VALUE *argv, VALUE mod)
VALUE | rb_obj_methods (int argc, VALUE *argv, VALUE obj)
VALUE | rb_obj_protected_methods (int argc, VALUE *argv, VALUE obj)
VALUE | rb_obj_private_methods (int argc, VALUE *argv, VALUE obj)
VALUE | rb_obj_public_methods (int argc, VALUE *argv, VALUE obj)
VALUE | rb_obj_singleton_methods (int argc, VALUE *argv, VALUE obj)
void | rb_define_method_id (VALUE klass, ID mid, VALUE(*func)(ANYARGS), int argc)
void | rb_define_method (VALUE klass, const char *name, VALUE(*func)(ANYARGS), int argc)
void | rb_define_protected_method (VALUE klass, const char *name, VALUE(*func)(ANYARGS), int argc)
void | rb_define_private_method (VALUE klass, const char *name, VALUE(*func)(ANYARGS), int argc)
void | rb_undef_method (VALUE klass, const char *name)
static VALUE | special_singleton_class_of (VALUE obj)
VALUE | rb_special_singleton_class (VALUE obj)
static VALUE | singleton_class_of (VALUE obj)
VALUE | rb_singleton_class (VALUE obj)
| Returns the singleton class of obj. More...
void | rb_define_singleton_method (VALUE obj, const char *name, VALUE(*func)(ANYARGS), int argc)
| Defines a singleton method for obj. More...
void | rb_define_module_function (VALUE module, const char *name, VALUE(*func)(ANYARGS), int argc)
| Defines a module function for module. More...
void | rb_define_global_function (const char *name, VALUE(*func)(ANYARGS), int argc)
| Defines a global function. More...
void | rb_define_alias (VALUE klass, const char *name1, const char *name2)
| Defines an alias of a method. More...
void | rb_define_attr (VALUE klass, const char *name, int read, int write)
| Defines (a) public accessor method(s) for an attribute. More...
int | rb_obj_basic_to_s_p (VALUE obj)
int | rb_scan_args (int argc, const VALUE *argv, const char *fmt,...)

## Variables
st_table * | rb_class_tbl
static ID | id_attached