Groonga 3.0.9 Source Code Document
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Macros | Functions
class.c File Reference
#include "mruby.h"
#include <stdarg.h>
#include <ctype.h>
#include "mruby/array.h"
#include "mruby/class.h"
#include "mruby/numeric.h"
#include "mruby/proc.h"
#include "mruby/string.h"
#include "mruby/variable.h"
#include "error.h"
Include dependency graph for class.c:

Go to the source code of this file.

Macros

#define make_metaclass(mrb, c)   prepare_singleton_class((mrb), (struct RBasic*)(c))

Functions

void mrb_gc_mark_mt (mrb_state *mrb, struct RClass *c)
size_t mrb_gc_mark_mt_size (mrb_state *mrb, struct RClass *c)
void mrb_gc_free_mt (mrb_state *mrb, struct RClass *c)
void mrb_name_class (mrb_state *mrb, struct RClass *c, mrb_sym name)
struct RClassmrb_define_module_id (mrb_state *mrb, mrb_sym name)
struct RClassmrb_define_module (mrb_state *mrb, const char *name)
struct RClassmrb_class_outer_module (mrb_state *mrb, struct RClass *c)
struct RClassmrb_vm_define_module (mrb_state *mrb, mrb_value outer, mrb_sym id)
struct RClassmrb_define_class_id (mrb_state *mrb, mrb_sym name, struct RClass *super)
struct RClassmrb_define_class (mrb_state *mrb, const char *name, struct RClass *super)
struct RClassmrb_vm_define_class (mrb_state *mrb, mrb_value outer, mrb_value super, mrb_sym id)
mrb_bool mrb_class_defined (mrb_state *mrb, const char *name)
struct RClassmrb_class_get (mrb_state *mrb, const char *name)
struct RClassmrb_class_get_under (mrb_state *mrb, struct RClass *outer, const char *name)
struct RClassmrb_define_class_under (mrb_state *mrb, struct RClass *outer, const char *name, struct RClass *super)
struct RClassmrb_define_module_under (mrb_state *mrb, struct RClass *outer, const char *name)
void mrb_define_method_raw (mrb_state *mrb, struct RClass *c, mrb_sym mid, struct RProc *p)
void mrb_define_method_id (mrb_state *mrb, struct RClass *c, mrb_sym mid, mrb_func_t func, mrb_aspec aspec)
void mrb_define_method (mrb_state *mrb, struct RClass *c, const char *name, mrb_func_t func, mrb_aspec aspec)
void mrb_define_method_vm (mrb_state *mrb, struct RClass *c, mrb_sym name, mrb_value body)
int mrb_get_args (mrb_state *mrb, const char *format,...)
void mrb_include_module (mrb_state *mrb, struct RClass *c, struct RClass *m)
mrb_value class_instance_method_list (mrb_state *, mrb_bool, struct RClass *, int)
mrb_value mrb_yield_internal (mrb_state *mrb, mrb_value b, int argc, mrb_value *argv, mrb_value self, struct RClass *c)
mrb_value mrb_mod_module_eval (mrb_state *mrb, mrb_value mod)
mrb_value mrb_mod_dummy_visibility (mrb_state *mrb, mrb_value mod)
mrb_value mrb_singleton_class (mrb_state *mrb, mrb_value v)
void mrb_define_singleton_method (mrb_state *mrb, struct RObject *o, const char *name, mrb_func_t func, mrb_aspec aspec)
void mrb_define_class_method (mrb_state *mrb, struct RClass *c, const char *name, mrb_func_t func, mrb_aspec aspec)
void mrb_define_module_function (mrb_state *mrb, struct RClass *c, const char *name, mrb_func_t func, mrb_aspec aspec)
struct RProcmrb_method_search_vm (mrb_state *mrb, struct RClass **cp, mrb_sym mid)
struct RProcmrb_method_search (mrb_state *mrb, struct RClass *c, mrb_sym mid)
mrb_value mrb_instance_new (mrb_state *mrb, mrb_value cv)
mrb_value mrb_obj_new (mrb_state *mrb, struct RClass *c, int argc, mrb_value *argv)
mrb_value mrb_class_superclass (mrb_state *mrb, mrb_value klass)
mrb_bool mrb_obj_respond_to (struct RClass *c, mrb_sym mid)
mrb_bool mrb_respond_to (mrb_state *mrb, mrb_value obj, mrb_sym mid)
mrb_value mrb_class_path (mrb_state *mrb, struct RClass *c)
struct RClassmrb_class_real (struct RClass *cl)
const char * mrb_class_name (mrb_state *mrb, struct RClass *c)
const char * mrb_obj_classname (mrb_state *mrb, mrb_value obj)
void mrb_check_inheritable (mrb_state *mrb, struct RClass *super)
struct RClassmrb_class_new (mrb_state *mrb, struct RClass *super)
struct RClassmrb_module_new (mrb_state *mrb)
struct RClassmrb_obj_class (mrb_state *mrb, mrb_value obj)
void mrb_alias_method (mrb_state *mrb, struct RClass *c, mrb_sym a, mrb_sym b)
void mrb_define_alias (mrb_state *mrb, struct RClass *klass, const char *name1, const char *name2)
mrb_value mrb_mod_alias (mrb_state *mrb, mrb_value mod)
void mrb_undef_method (mrb_state *mrb, struct RClass *c, const char *name)
void mrb_undef_class_method (mrb_state *mrb, struct RClass *c, const char *name)
mrb_value mrb_mod_undef (mrb_state *mrb, mrb_value mod)
mrb_value mrb_mod_remove_cvar (mrb_state *mrb, mrb_value mod)
mrb_value mrb_mod_remove_method (mrb_state *mrb, mrb_value mod)
mrb_value mrb_mod_const_defined (mrb_state *mrb, mrb_value mod)
mrb_value mrb_mod_const_get (mrb_state *mrb, mrb_value mod)
mrb_value mrb_mod_const_set (mrb_state *mrb, mrb_value mod)
mrb_value mrb_mod_remove_const (mrb_state *mrb, mrb_value mod)
void mrb_init_class (mrb_state *mrb)

Macro Definition Documentation

#define make_metaclass (   mrb,
 
)    prepare_singleton_class((mrb), (struct RBasic*)(c))

Definition at line 59 of file class.c.

Function Documentation

mrb_value class_instance_method_list ( mrb_state ,
mrb_bool  ,
struct RClass ,
int   
)

Definition at line 739 of file kernel.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void mrb_alias_method ( mrb_state mrb,
struct RClass c,
mrb_sym  a,
mrb_sym  b 
)

Definition at line 1326 of file class.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void mrb_check_inheritable ( mrb_state mrb,
struct RClass super 
)

Ensures a class can be derived from super.

Parameters
supera reference to an object.
Exceptions
TypeErrorif super is not a Class or super is a singleton class.

Definition at line 1257 of file class.c.

Here is the call graph for this function:

Here is the caller graph for this function:

mrb_bool mrb_class_defined ( mrb_state mrb,
const char *  name 
)

Definition at line 207 of file class.c.

Here is the call graph for this function:

Here is the caller graph for this function:

struct RClass* mrb_class_get ( mrb_state mrb,
const char *  name 
)
read

Definition at line 228 of file class.c.

Here is the call graph for this function:

Here is the caller graph for this function:

struct RClass* mrb_class_get_under ( mrb_state mrb,
struct RClass outer,
const char *  name 
)
read

Definition at line 234 of file class.c.

Here is the call graph for this function:

Here is the caller graph for this function:

const char* mrb_class_name ( mrb_state mrb,
struct RClass c 
)

Definition at line 1233 of file class.c.

Here is the call graph for this function:

Here is the caller graph for this function:

struct RClass* mrb_class_new ( mrb_state mrb,
struct RClass super 
)
read

Creates a new class.

Parameters
supera class from which the new class derives.
Exceptions
TypeErrorsuper is not inheritable.
TypeErrorsuper is the Class class.

Definition at line 1277 of file class.c.

Here is the call graph for this function:

Here is the caller graph for this function:

struct RClass* mrb_class_outer_module ( mrb_state mrb,
struct RClass c 
)
read

Definition at line 123 of file class.c.

Here is the call graph for this function:

Here is the caller graph for this function:

mrb_value mrb_class_path ( mrb_state mrb,
struct RClass c 
)

Definition at line 1194 of file class.c.

Here is the call graph for this function:

Here is the caller graph for this function:

struct RClass* mrb_class_real ( struct RClass cl)
read

Definition at line 1224 of file class.c.

Here is the caller graph for this function:

mrb_value mrb_class_superclass ( mrb_state mrb,
mrb_value  klass 
)

Definition at line 1079 of file class.c.

Here is the caller graph for this function:

void mrb_define_alias ( mrb_state mrb,
struct RClass klass,
const char *  name1,
const char *  name2 
)

Defines an alias of a method.

Parameters
klassthe class which the original method belongs to
name1a new name for the method
name2the original name of the method

Definition at line 1340 of file class.c.

Here is the call graph for this function:

Here is the caller graph for this function:

struct RClass* mrb_define_class ( mrb_state mrb,
const char *  name,
struct RClass super 
)
read

Definition at line 162 of file class.c.

Here is the call graph for this function:

Here is the caller graph for this function:

struct RClass* mrb_define_class_id ( mrb_state mrb,
mrb_sym  name,
struct RClass super 
)
read

Definition at line 150 of file class.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void mrb_define_class_method ( mrb_state mrb,
struct RClass c,
const char *  name,
mrb_func_t  func,
mrb_aspec  aspec 
)

Definition at line 959 of file class.c.

Here is the call graph for this function:

Here is the caller graph for this function:

struct RClass* mrb_define_class_under ( mrb_state mrb,
struct RClass outer,
const char *  name,
struct RClass super 
)
read

Defines a class under the namespace of outer.

Parameters
outera class which contains the new class.
idname of the new class
supera class from which the new class will derive. NULL means Object class.
Returns
the created class
Exceptions
TypeErrorif the constant name name is already taken but the constant is not a Class.
NameErrorif the class is already defined but the class can not be reopened because its superclass is not super.
Postcondition
top-level constant named name refers the returned class.
Note
if a class named name is already defined and its superclass is super, the function just returns the defined class.

Definition at line 256 of file class.c.

Here is the call graph for this function:

void mrb_define_method ( mrb_state mrb,
struct RClass c,
const char *  name,
mrb_func_t  func,
mrb_aspec  aspec 
)

Definition at line 320 of file class.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void mrb_define_method_id ( mrb_state mrb,
struct RClass c,
mrb_sym  mid,
mrb_func_t  func,
mrb_aspec  aspec 
)

Definition at line 308 of file class.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void mrb_define_method_raw ( mrb_state mrb,
struct RClass c,
mrb_sym  mid,
struct RProc p 
)

Definition at line 294 of file class.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void mrb_define_method_vm ( mrb_state mrb,
struct RClass c,
mrb_sym  name,
mrb_value  body 
)

Definition at line 326 of file class.c.

Here is the call graph for this function:

Here is the caller graph for this function:

struct RClass* mrb_define_module ( mrb_state mrb,
const char *  name 
)
read

Definition at line 108 of file class.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void mrb_define_module_function ( mrb_state mrb,
struct RClass c,
const char *  name,
mrb_func_t  func,
mrb_aspec  aspec 
)

Definition at line 965 of file class.c.

Here is the call graph for this function:

Here is the caller graph for this function:

struct RClass* mrb_define_module_id ( mrb_state mrb,
mrb_sym  name 
)
read

Definition at line 96 of file class.c.

Here is the call graph for this function:

Here is the caller graph for this function:

struct RClass* mrb_define_module_under ( mrb_state mrb,
struct RClass outer,
const char *  name 
)
read

Definition at line 278 of file class.c.

Here is the call graph for this function:

void mrb_define_singleton_method ( mrb_state mrb,
struct RObject o,
const char *  name,
mrb_func_t  func,
mrb_aspec  aspec 
)

Definition at line 952 of file class.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void mrb_gc_free_mt ( mrb_state mrb,
struct RClass c 
)

Definition at line 47 of file class.c.

void mrb_gc_mark_mt ( mrb_state mrb,
struct RClass c 
)

Definition at line 21 of file class.c.

Here is the call graph for this function:

size_t mrb_gc_mark_mt_size ( mrb_state mrb,
struct RClass c 
)

Definition at line 38 of file class.c.

Here is the call graph for this function:

int mrb_get_args ( mrb_state mrb,
const char *  format,
  ... 
)

Definition at line 398 of file class.c.

Here is the call graph for this function:

void mrb_include_module ( mrb_state mrb,
struct RClass c,
struct RClass m 
)

Definition at line 695 of file class.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void mrb_init_class ( mrb_state mrb)

Definition at line 1856 of file class.c.

Here is the call graph for this function:

Here is the caller graph for this function:

mrb_value mrb_instance_new ( mrb_state mrb,
mrb_value  cv 
)

Definition at line 1040 of file class.c.

Here is the call graph for this function:

Here is the caller graph for this function:

struct RProc* mrb_method_search ( mrb_state mrb,
struct RClass c,
mrb_sym  mid 
)
read

Definition at line 996 of file class.c.

Here is the call graph for this function:

Here is the caller graph for this function:

struct RProc* mrb_method_search_vm ( mrb_state mrb,
struct RClass **  cp,
mrb_sym  mid 
)
read

Definition at line 972 of file class.c.

Here is the call graph for this function:

Here is the caller graph for this function:

mrb_value mrb_mod_alias ( mrb_state mrb,
mrb_value  mod 
)

Definition at line 1411 of file class.c.

Here is the call graph for this function:

Here is the caller graph for this function:

mrb_value mrb_mod_const_defined ( mrb_state mrb,
mrb_value  mod 
)

Definition at line 1774 of file class.c.

Here is the call graph for this function:

Here is the caller graph for this function:

mrb_value mrb_mod_const_get ( mrb_state mrb,
mrb_value  mod 
)

Definition at line 1800 of file class.c.

Here is the call graph for this function:

Here is the caller graph for this function:

mrb_value mrb_mod_const_set ( mrb_state mrb,
mrb_value  mod 
)

Definition at line 1810 of file class.c.

Here is the call graph for this function:

Here is the caller graph for this function:

mrb_value mrb_mod_dummy_visibility ( mrb_state mrb,
mrb_value  mod 
)

Definition at line 919 of file class.c.

Here is the caller graph for this function:

mrb_value mrb_mod_module_eval ( mrb_state mrb,
mrb_value  mod 
)

Definition at line 906 of file class.c.

Here is the call graph for this function:

Here is the caller graph for this function:

mrb_value mrb_mod_remove_const ( mrb_state mrb,
mrb_value  mod 
)

Definition at line 1822 of file class.c.

Here is the call graph for this function:

Here is the caller graph for this function:

mrb_value mrb_mod_remove_cvar ( mrb_state mrb,
mrb_value  mod 
)

Definition at line 1639 of file class.c.

Here is the call graph for this function:

Here is the caller graph for this function:

mrb_value mrb_mod_remove_method ( mrb_state mrb,
mrb_value  mod 
)

Definition at line 1740 of file class.c.

Here is the call graph for this function:

Here is the caller graph for this function:

mrb_value mrb_mod_undef ( mrb_state mrb,
mrb_value  mod 
)

Definition at line 1448 of file class.c.

Here is the call graph for this function:

Here is the caller graph for this function:

struct RClass* mrb_module_new ( mrb_state mrb)
read

Creates a new module.

Definition at line 1297 of file class.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void mrb_name_class ( mrb_state mrb,
struct RClass c,
mrb_sym  name 
)

Definition at line 53 of file class.c.

Here is the call graph for this function:

Here is the caller graph for this function:

struct RClass* mrb_obj_class ( mrb_state mrb,
mrb_value  obj 
)
read

Definition at line 1320 of file class.c.

Here is the call graph for this function:

Here is the caller graph for this function:

const char* mrb_obj_classname ( mrb_state mrb,
mrb_value  obj 
)

Definition at line 1245 of file class.c.

Here is the call graph for this function:

Here is the caller graph for this function:

mrb_value mrb_obj_new ( mrb_state mrb,
struct RClass c,
int  argc,
mrb_value argv 
)

Definition at line 1054 of file class.c.

Here is the call graph for this function:

Here is the caller graph for this function:

mrb_bool mrb_obj_respond_to ( struct RClass c,
mrb_sym  mid 
)

Definition at line 1164 of file class.c.

Here is the call graph for this function:

Here is the caller graph for this function:

mrb_bool mrb_respond_to ( mrb_state mrb,
mrb_value  obj,
mrb_sym  mid 
)

Definition at line 1188 of file class.c.

Here is the call graph for this function:

Here is the caller graph for this function:

mrb_value mrb_singleton_class ( mrb_state mrb,
mrb_value  v 
)

Definition at line 925 of file class.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void mrb_undef_class_method ( mrb_state mrb,
struct RClass c,
const char *  name 
)

Definition at line 1442 of file class.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void mrb_undef_method ( mrb_state mrb,
struct RClass c,
const char *  name 
)

Definition at line 1436 of file class.c.

Here is the call graph for this function:

Here is the caller graph for this function:

struct RClass* mrb_vm_define_class ( mrb_state mrb,
mrb_value  outer,
mrb_value  super,
mrb_sym  id 
)
read

Definition at line 168 of file class.c.

Here is the call graph for this function:

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

Definition at line 133 of file class.c.

Here is the call graph for this function:

mrb_value mrb_yield_internal ( mrb_state mrb,
mrb_value  b,
int  argc,
mrb_value argv,
mrb_value  self,
struct RClass c 
)

Definition at line 413 of file vm.c.