Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Globals

class.c File Reference

#include "ruby.h"
#include "rubysig.h"
#include "node.h"
#include "st.h"
#include <ctype.h>
#include <stdarg.h>

Go to the source code of this file.

Defines

#define VISI(x)   ((x)&NOEX_MASK)
#define VISI_CHECK(x, f)   (VISI(x) == (f))
#define SPECIAL_SINGLETON(x, c)
#define va_init_list(a, b)   va_start(a,b)

Functions

VALUE rb_class_boot (VALUE super)
VALUE rb_class_new (VALUE super)
int clone_method (ID mid, NODE *body, st_table *tbl)
VALUE rb_mod_init_copy (VALUE clone, VALUE orig)
VALUE rb_class_init_copy (VALUE clone, VALUE orig)
VALUE rb_singleton_class_clone (VALUE obj)
void rb_singleton_class_attached (VALUE klass, VALUE obj)
VALUE rb_make_metaclass (VALUE obj, VALUE super)
VALUE rb_define_class_id (ID id, VALUE super)
void rb_check_inheritable (VALUE super)
VALUE rb_class_inherited (VALUE super, VALUE klass)
VALUE rb_define_class (char *name, VALUE super) const
VALUE rb_define_class_under (VALUE outer, const char *name, VALUE super)
VALUE rb_module_new ()
VALUE rb_define_module_id (ID id)
VALUE rb_define_module (char *name) const
VALUE rb_define_module_under (VALUE outer, const char *name)
VALUE include_class_new (VALUE module, VALUE super)
void rb_include_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)
int ins_methods_push (ID name, long type, VALUE ary, long visi)
int ins_methods_i (ID name, long type, VALUE ary)
int ins_methods_prot_i (ID name, long type, VALUE ary)
int ins_methods_priv_i (ID name, long type, VALUE ary)
int ins_methods_pub_i (ID name, long type, VALUE ary)
int method_entry (ID key, NODE *body, st_table *list)
VALUE class_instance_method_list (int argc, VALUE *argv, VALUE mod, func)
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_singleton_methods (int argc, VALUE *argv, VALUE obj)
void rb_define_method_id (VALUE klass, ID name, func, int argc)
void rb_define_method (VALUE klass, const char *name, func, int argc)
void rb_define_protected_method (VALUE klass, const char *name, func, int argc)
void rb_define_private_method (VALUE klass, const char *name, func, int argc)
void rb_undef_method (VALUE klass, const char *name)
VALUE rb_singleton_class (VALUE obj)
void rb_define_singleton_method (VALUE obj, const char *name, func, int argc)
void rb_define_module_function (VALUE module, const char *name, func, int argc)
void rb_define_global_function (char *name, func, int argc) const
void rb_define_alias (VALUE klass, const char *name1, const char *name2)
void rb_define_attr (VALUE klass, const char *name, int read, int write)
int rb_scan_args (int argc, const VALUE *argv, const char *fmt,...)

Variables

st_tablerb_class_tbl


Define Documentation

#define SPECIAL_SINGLETON x,
 ) 
 

Value:

do {\
    if (obj == (x)) {\
        return c;\
    }\
} while (0)

Definition at line 850 of file class.c.

Referenced by rb_singleton_class().

#define va_init_list a,
 )     va_start(a,b)
 

Definition at line 941 of file class.c.

#define VISI  )     ((x)&NOEX_MASK)
 

Definition at line 522 of file class.c.

Referenced by method_entry().

#define VISI_CHECK x,
 )     (VISI(x) == (f))
 

Definition at line 523 of file class.c.

Referenced by rb_mod_private_method_defined(), rb_mod_protected_method_defined(), and rb_mod_public_method_defined().


Function Documentation

VALUE class_instance_method_list int  argc,
VALUE argv,
VALUE  mod,
func 
[static]
 

Definition at line 603 of file class.c.

References BUILTIN_TYPE, FL_SINGLETON, FL_TEST, ID, method_entry(), Qtrue, rb_ary_new(), rb_scan_args(), RCLASS, RTEST, st_data_t, st_foreach(), st_free_table(), st_init_numtable(), T_ICLASS, and VALUE.

Referenced by rb_class_instance_methods(), rb_class_private_instance_methods(), rb_class_protected_instance_methods(), and rb_class_public_instance_methods().

int clone_method ID  mid,
NODE body,
st_table tbl
[static]
 

Definition at line 52 of file class.c.

References ID, NEW_METHOD, NODE, ST_CONTINUE, st_data_t, and st_insert().

Referenced by rb_mod_init_copy(), and rb_singleton_class_clone().

VALUE include_class_new VALUE  module,
VALUE  super
[static]
 

Definition at line 343 of file class.c.

References BUILTIN_TYPE, NEWOBJ, OBJ_INFECT, OBJSETUP, rb_cClass, RBASIC, RCLASS, st_init_numtable(), T_ICLASS, TYPE, and VALUE.

Referenced by rb_include_module().

int ins_methods_i ID  name,
long  type,
VALUE  ary
[static]
 

Definition at line 550 of file class.c.

References ID, ins_methods_push(), name, and VALUE.

Referenced by rb_class_instance_methods(), and rb_obj_singleton_methods().

int ins_methods_priv_i ID  name,
long  type,
VALUE  ary
[static]
 

Definition at line 568 of file class.c.

References ID, ins_methods_push(), name, NOEX_PRIVATE, and VALUE.

Referenced by rb_class_private_instance_methods().

int ins_methods_prot_i ID  name,
long  type,
VALUE  ary
[static]
 

Definition at line 559 of file class.c.

References ID, ins_methods_push(), name, NOEX_PROTECTED, and VALUE.

Referenced by rb_class_protected_instance_methods().

int ins_methods_pub_i ID  name,
long  type,
VALUE  ary
[static]
 

Definition at line 577 of file class.c.

References ID, ins_methods_push(), name, NOEX_PUBLIC, and VALUE.

Referenced by rb_class_public_instance_methods().

int ins_methods_push ID  name,
long  type,
VALUE  ary,
long  visi
[static]
 

Definition at line 526 of file class.c.

References ID, name, NOEX_PRIVATE, NOEX_PROTECTED, NOEX_PUBLIC, rb_ary_push(), rb_id2name(), rb_str_new2(), ST_CONTINUE, and VALUE.

Referenced by ins_methods_i(), ins_methods_priv_i(), ins_methods_prot_i(), and ins_methods_pub_i().

int method_entry ID  key,
NODE body,
st_table list
[static]
 

Definition at line 586 of file class.c.

References ID, ID_ALLOCATOR, NODE, st_add_direct(), ST_CONTINUE, st_lookup(), and VISI.

Referenced by class_instance_method_list(), and rb_obj_singleton_methods().

VALUE rb_define_class char *  name,
VALUE  super
const
 

Definition at line 210 of file class.c.

References ID, name, rb_class_inherited(), rb_class_real(), rb_class_tbl, rb_cObject, rb_const_defined(), rb_const_get(), rb_const_set(), rb_define_class_id(), rb_eTypeError, rb_intern(), rb_name_class(), rb_name_error(), rb_raise(), rb_warn(), RCLASS, st_add_direct(), T_CLASS, TYPE, and VALUE.

void rb_define_global_function char *  name,
func  ,
int  argc
const
 

Definition at line 914 of file class.c.

References name, rb_define_module_function(), and rb_mKernel.

void rb_define_method VALUE  klass,
const char *  name,
func  ,
int  argc
 

Definition at line 809 of file class.c.

References ID, name, NEW_CFUNC, NOEX_PUBLIC, rb_add_method(), rb_intern(), and VALUE.

void rb_define_method_id VALUE  klass,
ID  name,
func  ,
int  argc
 

Definition at line 799 of file class.c.

References ID, name, NEW_CFUNC, NOEX_PUBLIC, rb_add_method(), and VALUE.

VALUE rb_define_module char *  name  )  const
 

Definition at line 299 of file class.c.

References ID, name, rb_class_tbl, rb_cObject, rb_const_defined(), rb_const_get(), rb_const_set(), rb_define_module_id(), rb_eTypeError, rb_intern(), rb_obj_classname(), rb_raise(), st_add_direct(), T_MODULE, TYPE, and VALUE.

void rb_define_module_function VALUE  module,
const char *  name,
func  ,
int  argc
 

Definition at line 903 of file class.c.

References name, rb_define_private_method(), rb_define_singleton_method(), and VALUE.

void rb_define_private_method VALUE  klass,
const char *  name,
func  ,
int  argc
 

Definition at line 833 of file class.c.

References name, NEW_CFUNC, NOEX_PRIVATE, rb_add_method(), rb_intern(), and VALUE.

void rb_define_protected_method VALUE  klass,
const char *  name,
func  ,
int  argc
 

Definition at line 823 of file class.c.

References name, NEW_CFUNC, NOEX_PROTECTED, rb_add_method(), rb_intern(), and VALUE.

void rb_define_singleton_method VALUE  obj,
const char *  name,
func  ,
int  argc
 

Definition at line 893 of file class.c.

References name, rb_define_method(), rb_singleton_class(), and VALUE.


Variable Documentation

st_table* rb_class_tbl
 

Definition at line 19 of file class.c.

Referenced by boot_defclass(), find_class_path(), garbage_collect(), Init_var_tables(), rb_define_class(), and rb_define_module().


Generated on Wed Jan 18 23:32:08 2006 for Ruby by doxygen 1.3.5