diff options
author | kazu <kazu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-12-06 15:33:49 +0000 |
---|---|---|
committer | kazu <kazu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-12-06 15:33:49 +0000 |
commit | adef6efcdeacbfcc0d0d5721f4abf053f03f0d29 (patch) | |
tree | fe03b547fb2a9a8adc159cf4cf369564082b87f5 /doc | |
parent | 0f0c388a0e74cc1d86d23ec8801009a49a91101c (diff) |
untabify [ci skip]
based on the patch by W <wolf@wolfsden.cz>
[Fix GH-1497]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57006 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'doc')
-rw-r--r-- | doc/extension.ja.rdoc | 12 | ||||
-rw-r--r-- | doc/extension.rdoc | 16 |
2 files changed, 14 insertions, 14 deletions
diff --git a/doc/extension.ja.rdoc b/doc/extension.ja.rdoc index 4f471f1696..686eb7157c 100644 --- a/doc/extension.ja.rdoc +++ b/doc/extension.ja.rdoc @@ -423,9 +423,9 @@ argcが-1の時は引数を配列に入れて渡されます.argcが-2の時 private/protectedなメソッドを定義するふたつの関数があります. void rb_define_private_method(VALUE klass, const char *name, - VALUE (*func)(), int argc) + VALUE (*func)(), int argc) void rb_define_protected_method(VALUE klass, const char *name, - VALUE (*func)(), int argc) + VALUE (*func)(), int argc) privateメソッドとは関数形式でしか呼び出すことの出来ないメソッ ドです. @@ -446,7 +446,7 @@ privateメソッドでもあるものです.例をあげるとMathモジュー 通りです. void rb_define_module_function(VALUE module, const char *name, - VALUE (*func)(), int argc) + VALUE (*func)(), int argc) 関数的メソッド(Kernelモジュールのprivate method)を定義するた めの関数は以下の通りです. @@ -642,7 +642,7 @@ CとRubyで大域変数を使って情報を共有できます.共有できる 値の参照や設定はhookで行う必要があります. void rb_define_hooked_variable(const char *name, VALUE *var, - VALUE (*getter)(), void (*setter)()) + VALUE (*getter)(), void (*setter)()) この関数はCの関数によってhookのつけられた大域変数を定義しま す.変数が参照された時には関数getterが,変数に値がセットされ @@ -662,7 +662,7 @@ getterとsetterの仕様は次の通りです. されます. void rb_define_virtual_variable(const char *name, - VALUE (*getter)(), void (*setter)()) + VALUE (*getter)(), void (*setter)()) この関数によって定義されたRubyの大域変数が参照された時には getterが,変数に値がセットされた時にはsetterが呼ばれます. @@ -923,7 +923,7 @@ fdbm_delete()はこのようになっています. /* ... */ if (rb_scan_args(argc, argv, "11", &file, &vmode) == 1) { - mode = 0666; /* default value */ + mode = 0666; /* default value */ } /* ... */ diff --git a/doc/extension.rdoc b/doc/extension.rdoc index ba6319afc6..44cfc15d49 100644 --- a/doc/extension.rdoc +++ b/doc/extension.rdoc @@ -361,10 +361,10 @@ To define nested classes or modules, use the functions below: To define methods or singleton methods, use these functions: void rb_define_method(VALUE klass, const char *name, - VALUE (*func)(), int argc) + VALUE (*func)(), int argc) void rb_define_singleton_method(VALUE object, const char *name, - VALUE (*func)(), int argc) + VALUE (*func)(), int argc) The `argc' represents the number of the arguments to the C function, which must be less than 17. But I doubt you'll need that many. @@ -396,9 +396,9 @@ as the name of method to be defined. See also ID or Symbol below. There are two functions to define private/protected methods: void rb_define_private_method(VALUE klass, const char *name, - VALUE (*func)(), int argc) + VALUE (*func)(), int argc) void rb_define_protected_method(VALUE klass, const char *name, - VALUE (*func)(), int argc) + VALUE (*func)(), int argc) At last, rb_define_module_function defines a module function, which are private AND singleton methods of the module. @@ -415,7 +415,7 @@ or To define module functions, use: void rb_define_module_function(VALUE module, const char *name, - VALUE (*func)(), int argc) + VALUE (*func)(), int argc) In addition, function-like methods, which are private methods defined in the Kernel module, can be defined using: @@ -596,7 +596,7 @@ You can define hooked variables. The accessor functions (getter and setter) are called on access to the hooked variables. void rb_define_hooked_variable(const char *name, VALUE *var, - VALUE (*getter)(), void (*setter)()) + VALUE (*getter)(), void (*setter)()) If you need to supply either setter or getter, just supply 0 for the hook you don't need. If both hooks are 0, rb_define_hooked_variable() @@ -611,7 +611,7 @@ Also you can define a Ruby global variable without a corresponding C variable. The value of the variable will be set/get only by hooks. void rb_define_virtual_variable(const char *name, - VALUE (*getter)(), void (*setter)()) + VALUE (*getter)(), void (*setter)()) The prototypes of the getter and setter functions are as follows: @@ -853,7 +853,7 @@ arguments like this: { /* ... */ if (rb_scan_args(argc, argv, "11", &file, &vmode) == 1) { - mode = 0666; /* default value */ + mode = 0666; /* default value */ } /* ... */ } |