このメモについて
mruby/include 以下のヘッダファイルに定義されている MRB_API 参照して整理したもの
重要な構造体や型
mruby.h
クラス定義
関数名 |
概要 |
mrb_define_class |
クラスを定義する |
mrb_define_module |
モジュールを定義する |
mrb_singleton_class |
モジュールを定義する |
mrb_include_module |
モジュールを Mix-in する(include) |
mrb_prepend_module |
モジュールを Mix-in する(prepend) |
mrb_define_method |
(グローバル)メソッドを定義する |
mrb_define_class_method |
クラスメソッドを定義する |
mrb_define_singleton_method |
クラスメソッドを定義する |
mrb_define_module_function |
モジュール関数の定義 |
mrb_define_const |
定数を定義する |
mrb_undef_method |
メソッドを未定義にする |
mrb_undef_class_method |
クラスメソッドを未定義にする |
オブジェクト生成
関数名 |
概要 |
mrb_obj_new |
オブジェクト初期化 |
mrb_class_new_instance |
オブジェクト初期化 |
mrb_instance_new |
インスタンス生成 |
mrb_class_new |
クラス生成 |
mrb_module_new |
モジュール生成 |
mrb_class_defined |
クラス定義 (上書き可) |
クラスインスペクション
関数名 |
概要 |
mrb_class_defined |
|
mrb_class_get |
|
mrb_class_get_under |
子クラスを返す |
mrb_module_get |
モジュールを返す |
mrb_module_get_under |
外部で定義されてるモジュールを返す |
mrb_notimplement_m |
未実装のモジュールを返す |
mrb_obj_dup |
オブジェクトの複製 |
mrb_check_to_integer |
|
mrb_obj_respond_to |
respond_to |
継承の定義
関数名 |
概要 |
mrb_define_class_under |
|
mrb_define_module_under |
|
仮想マシン操作系
関数名 |
概要 |
mrb_get_args |
引数を取得する |
mrb_funcall |
関数を呼び出す |
mrb_funcall_argv |
引数ありの関数 |
mrb_funcall_with_block |
ブロックありの関数 |
型
関数名 |
概要 |
mrb_intern_cstr |
NULL終端文字列をシンボルに変換 |
mrb_intern |
文字列をシンボルに変換 |
mrb_intern_static |
引数ありの関数 |
mrb_funcall_with_block |
ブロックありの関数 |
mruby/irep.h
バイトコード操作系
関数名 |
概要 |
mrb_add_irep |
|
mrb_load_irep |
バイトコードの読み込み |
mrb_load_irep_cxt |
コンテキスト付バイトコードの読み込み |