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
8060478b
Commit
8060478b
authored
Feb 21, 2014
by
take_cheeze
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add 'd' format specifier to get data pointer directly from mrb_get_args
parent
d345134f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
0 deletions
+15
-0
src/class.c
src/class.c
+15
-0
No files found.
src/class.c
View file @
8060478b
...
@@ -14,6 +14,7 @@
...
@@ -14,6 +14,7 @@
#include "mruby/string.h"
#include "mruby/string.h"
#include "mruby/variable.h"
#include "mruby/variable.h"
#include "mruby/error.h"
#include "mruby/error.h"
#include "mruby/data.h"
KHASH_DEFINE
(
mt
,
mrb_sym
,
struct
RProc
*
,
1
,
kh_int_hash_func
,
kh_int_hash_equal
)
KHASH_DEFINE
(
mt
,
mrb_sym
,
struct
RProc
*
,
1
,
kh_int_hash_func
,
kh_int_hash_equal
)
...
@@ -406,6 +407,7 @@ to_hash(mrb_state *mrb, mrb_value val)
...
@@ -406,6 +407,7 @@ to_hash(mrb_state *mrb, mrb_value val)
i: Integer [mrb_int]
i: Integer [mrb_int]
b: Boolean [mrb_bool]
b: Boolean [mrb_bool]
n: Symbol [mrb_sym]
n: 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
&: Block [mrb_value]
&: Block [mrb_value]
*: rest argument [mrb_value*,int] Receive the rest of the arguments as an array.
*: rest argument [mrb_value*,int] Receive the rest of the arguments as an array.
|: optional Next argument of '|' and later are optional.
|: optional Next argument of '|' and later are optional.
...
@@ -658,6 +660,19 @@ mrb_get_args(mrb_state *mrb, const char *format, ...)
...
@@ -658,6 +660,19 @@ mrb_get_args(mrb_state *mrb, const char *format, ...)
}
}
}
}
break
;
break
;
case
'd'
:
{
void
**
datap
;
struct
mrb_data_type
const
*
type
;
datap
=
va_arg
(
ap
,
void
**
);
type
=
va_arg
(
ap
,
struct
mrb_data_type
const
*
);
if
(
i
<
argc
)
{
*
datap
=
mrb_data_get_ptr
(
mrb
,
*
sp
++
,
type
);
++
i
;
}
}
break
;
case
'&'
:
case
'&'
:
{
{
...
...
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