Commit d9152615 authored by KOBAYASHI Shuji's avatar KOBAYASHI Shuji

Refine document to mrb_get_args()` [ci skip]

parent 8c29b599
...@@ -836,15 +836,17 @@ MRB_API struct RClass * mrb_define_module_under(mrb_state *mrb, struct RClass *o ...@@ -836,15 +836,17 @@ MRB_API struct RClass * mrb_define_module_under(mrb_state *mrb, struct RClass *o
* | `S` | {String} | {mrb_value} | when `!` follows, the value may be `nil` | * | `S` | {String} | {mrb_value} | when `!` follows, the value may be `nil` |
* | `A` | {Array} | {mrb_value} | when `!` follows, the value may be `nil` | * | `A` | {Array} | {mrb_value} | when `!` follows, the value may be `nil` |
* | `H` | {Hash} | {mrb_value} | when `!` follows, the value may be `nil` | * | `H` | {Hash} | {mrb_value} | when `!` follows, the value may be `nil` |
* | `s` | {String} | char *, {mrb_int} | Receive two arguments; `s!` gives (`NULL`,`0`) for `nil` | * | `s` | {String} | char *, {mrb_int} | Receive two arguments; `s!` gives (`NULL`,`0`) for `nil` |
* | `z` | {String} | char * | `NULL` terminated string; `z!` gives `NULL` for `nil` | * | `z` | {String} | char * | `NULL` terminated string; `z!` gives `NULL` for `nil` |
* | `a` | {Array} | {mrb_value} *, {mrb_int} | Receive two arguments; `a!` gives (`NULL`,`0`) for `nil` | * | `a` | {Array} | {mrb_value} *, {mrb_int} | Receive two arguments; `a!` gives (`NULL`,`0`) for `nil` |
* | `f` | {Float} | {mrb_float} | | * | `f` | {Fixnum}/{Float} | {mrb_float} | |
* | `i` | {Integer} | {mrb_int} | | * | `i` | {Fixnum}/{Float} | {mrb_int} | |
* | `b` | boolean | {mrb_bool} | | * | `b` | boolean | {mrb_bool} | |
* | `n` | {Symbol} | {mrb_sym} | | * | `n` | {String}/{Symbol} | {mrb_sym} | |
* | `d` | data | void *, {mrb_data_type} const | 2nd argument will be used to check data type so it won't be modified; when `!` follows, the value may be `nil` |
* | `I` | inline struct | void * | |
* | `&` | block | {mrb_value} | &! raises exception if no block given. | * | `&` | block | {mrb_value} | &! raises exception if no block given. |
* | `*` | rest arguments | {mrb_value} *, {mrb_int} | Receive the rest of arguments as an array; *! avoid copy of the stack. | * | `*` | rest arguments | {mrb_value} *, {mrb_int} | Receive the rest of arguments as an array; `*!` avoid copy of the stack. |
* | | | optional | | After this spec following specs would be optional. | * | | | optional | | After this spec following specs would be optional. |
* | `?` | optional given | {mrb_bool} | `TRUE` if preceding argument is given. Used to check optional argument is given. | * | `?` | optional given | {mrb_bool} | `TRUE` if preceding argument is given. Used to check optional argument is given. |
* *
......
...@@ -573,20 +573,20 @@ mrb_get_argv(mrb_state *mrb) ...@@ -573,20 +573,20 @@ mrb_get_argv(mrb_state *mrb)
string mruby type C type note string mruby type C type note
---------------------------------------------------------------------------------------------- ----------------------------------------------------------------------------------------------
o: Object [mrb_value] o: Object [mrb_value]
C: class/module [mrb_value] C: Class/Module [mrb_value]
S: String [mrb_value] when ! follows, the value may be nil S: String [mrb_value] when ! follows, the value may be nil
A: Array [mrb_value] when ! follows, the value may be nil A: Array [mrb_value] when ! follows, the value may be nil
H: Hash [mrb_value] when ! follows, the value may be nil H: Hash [mrb_value] when ! follows, the value may be nil
s: String [char*,mrb_int] Receive two arguments; s! gives (NULL,0) for nil s: String [char*,mrb_int] Receive two arguments; s! gives (NULL,0) for nil
z: String [char*] NUL terminated string; z! gives NULL for nil z: String [char*] NUL terminated string; z! gives NULL for nil
a: Array [mrb_value*,mrb_int] Receive two arguments; a! gives (NULL,0) for nil a: Array [mrb_value*,mrb_int] Receive two arguments; a! gives (NULL,0) for nil
f: Float [mrb_float] f: Fixnum/Float [mrb_float]
i: Integer [mrb_int] i: Fixnum/Float [mrb_int]
b: Boolean [mrb_bool] b: boolean [mrb_bool]
n: Symbol [mrb_sym] n: String/Symbol [mrb_sym]
d: Data [void*,mrb_data_type const] 2nd argument will be used to check data type so it won't be modified d: data [void*,mrb_data_type const] 2nd argument will be used to check data type so it won't be modified; when ! follows, the value may be nil
I: Inline struct [void*] I: inline struct [void*]
&: Block [mrb_value] &! raises exception if no block given &: block [mrb_value] &! raises exception if no block given
*: rest argument [mrb_value*,mrb_int] The rest of the arguments as an array; *! avoid copy of the stack *: rest argument [mrb_value*,mrb_int] The rest of the arguments as an array; *! avoid copy of the stack
|: optional Following arguments are optional |: optional Following arguments are optional
?: optional given [mrb_bool] true if preceding argument (optional) is given ?: optional given [mrb_bool] true if preceding argument (optional) is given
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment