Project

General

Profile

Bug #12228 » doc_extension_errors.patch

stomar (Marcus Stollsteimer), 03/29/2016 01:39 PM

View differences:

doc/extension.ja.rdoc (Arbeitskopie)
エンコーディングがUTF-8のRubyの文字列を生成する.
rb_usascii_str_new_literal(const char *ptr) ::
rb_utf8_str_new_literal(const char *ptr) ::
Cのリテラル文字列からエンコーディングがUTF-8のRubyの文字列を生成する.
......
に以下のマクロを使っています.
#define GetDBM(obj, dbmp) do {\
TypedData_Get_Struct(obj, struct dbmdata, &dbm_type, dbmp);\
TypedData_Get_Struct((obj), struct dbmdata, &dbm_type, (dbmp));\
if ((dbmp) == 0) closed_dbm();\
if ((dbmp)->di_dbm == 0) closed_dbm();\
} while (0)
......
parse.y :: 字句解析器と構文定義
parse.c :: 自動生成
keywords :: 予約語
defs/keywords :: 予約語
lex.c :: 自動生成
== Rubyの評価器 (通称YARV)
......
vm_insnhelper.c
vm_method.c
opt_insns_unif.def : 命令融合
opt_operand.def : 最適化のための定義
defs/opt_insns_unif.def : 命令融合
defs/opt_operand.def : 最適化のための定義
-> insn*.inc : 自動生成
-> opt*.inc : 自動生成
-> vm.inc : 自動生成
-> insn*.inc : 自動生成
-> opt*.inc : 自動生成
-> vm.inc : 自動生成
== 正規表現エンジン (鬼車)
doc/extension.rdoc (Arbeitskopie)
TypedData_Wrap_Struct() returns a created Ruby object as a VALUE.
The klass argument is the class for the object.
data_type is a pointer to a const ruby_data_type_t which describes
data_type is a pointer to a const rb_data_type_t which describes
how Ruby should manage the struct.
It is recommended that klass derives from a special class called
Data (rb_cData) but not from Object or other ordinal classes.
If it doesn't, you have to call rb_undef_alloc_func(klass).
ruby_data_type_t is defined like this. Let's take a look at each
rb_data_type_t is defined like this. Let's take a look at each
member of the struct.
struct rb_data_type_struct {
......
following macro:
#define GetDBM(obj, dbmp) do {\
TypedData_Get_Struct(obj, struct dbmdata, &dbm_type, dbmp);\
TypedData_Get_Struct((obj), struct dbmdata, &dbm_type, (dbmp));\
if ((dbmp) == 0) closed_dbm();\
if (dbmp->di_dbm == 0) closed_dbm();\
if ((dbmp)->di_dbm == 0) closed_dbm();\
} while (0)
This sort of complicated macro does the retrieving and close checking
......
Defines a read-only global variable. Works just like
rb_define_variable(), except the defined variable is read-only.
void rb_define_virtual_variable(const char *name, VALUE (*getter)(), VALUE (*setter)()) ::
void rb_define_virtual_variable(const char *name, VALUE (*getter)(), void (*setter)()) ::
Defines a virtual variable, whose behavior is defined by a pair of C
functions. The getter function is called when the variable is
......
The getter function must return the value for the access.
void rb_define_hooked_variable(const char *name, VALUE *var, VALUE (*getter)(), VALUE (*setter)()) ::
void rb_define_hooked_variable(const char *name, VALUE *var, VALUE (*getter)(), void (*setter)()) ::
Defines hooked variable. It's a virtual variable with a C variable.
The getter is called as
......
Defines a global constant. This is just the same as
rb_define_const(cKernal, name, val)
rb_define_const(rb_cObject, name, val)
== Method Definition
......
Returns the name of the class.
int rb_respond_to(VALUE object, ID id) ::
int rb_respond_to(VALUE obj, ID id) ::
Returns true if the object responds to the message specified by id.
......
whereas yielded values can be gotten via argc/argv of the third/fourth
arguments.
\[OBSOLETE] VALUE rb_iterate(VALUE (*func1)(), void *arg1, VALUE (*func2)(), void *arg2) ::
\[OBSOLETE] VALUE rb_iterate(VALUE (*func1)(), VALUE arg1, VALUE (*func2)(), VALUE arg2) ::
Calls the function func1, supplying func2 as the block. func1 will be
called with the argument arg1. func2 receives the value from yield as
    (1-1/1)