Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mruby
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
mruby
Commits
510e53d8
Commit
510e53d8
authored
Jul 13, 2015
by
jbreeden
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add ! documentation to mruby.h.md
parent
53a81da0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
9 deletions
+11
-9
doc/api/mruby.h.md
doc/api/mruby.h.md
+11
-9
No files found.
doc/api/mruby.h.md
View file @
510e53d8
...
...
@@ -43,20 +43,22 @@ Deletes `mrb_state`.
int mrb_get_args(mrb_state *mrb, const char *format, ...);
```
Retrieve arguments from
`mrb_state`
.
When applicable, implicit conversions (such as
`to_str`
,
`to_ary`
,
`to_hash`
) are be applied to received arguments.
Use it inside a function pointed by
`mrb_func_t`
.
It returns
number of function
retrieved.
`format`
is a list of following format specifier:
It returns
the number of arguments
retrieved.
`format`
is a list of following format specifier
s
:
char|mruby type|retrieve types|note
:---:|----------|--------------|---
`o`
|
`Object`
|
`mrb_value`
|Could be used to retrieve any type of argument
`C`
|
`Class`
/
`Module`
|
`mrb_value`
|
`S`
|
`String`
|
`mrb_value`
|
`A`
|
`Array`
|
`mrb_value`
|
`H`
|
`Hash`
|
`mrb_value`
|
`s`
|
`String`
|
`char*`
,
`mrb_int`
|
`z`
|
`String`
|
`char*`
|
`a`
|
`Array`
|
`mrb_value*`
,
`mrb_int`
|
`S`
|
`String`
|
`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
`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
`a`
|
`Array`
|
`mrb_value*`
,
`mrb_int`
|
Receive two arguments; a! gives (NULL,0) for nil
`f`
|
`Float`
|
`mrb_float`
|
`i`
|
`Integer`
|
`mrb_int`
|
`b`
|boolean|
`mrb_bool`
|
...
...
@@ -118,7 +120,7 @@ mrb_value example_method(mrb_state* mrb, mrb_value self){
void mrb_example_gem_init(mrb_state* mrb) {
struct RClass *example_class;
example_class = mrb_define_class(mrb, "Example_Class", mrb->object_class);
mrb_define_method(mrb, example_class, "example_method", example_method, MRB_ARGS_NONE());
mrb_define_method(mrb, example_class, "example_method", example_method, MRB_ARGS_NONE());
}
void mrb_example_gem_final(mrb_state* mrb) {
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment