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
d1691268
Commit
d1691268
authored
Oct 15, 2015
by
Ralph Desir(Mav7)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated YARD docs on mruby.h
parent
2df9786f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
4 deletions
+43
-4
build_config.rb
build_config.rb
+3
-3
include/mruby.h
include/mruby.h
+40
-1
No files found.
build_config.rb
View file @
d1691268
...
...
@@ -21,7 +21,7 @@ MRuby::Build.new do |conf|
# include the default GEMs
conf
.
gembox
'default'
conf
.
gem
'/home/thamav/tests/mrbgem_test'
# C compiler settings
# conf.cc do |cc|
# cc.command = ENV['CC'] || 'gcc'
...
...
@@ -82,7 +82,7 @@ MRuby::Build.new do |conf|
# bintest
# conf.enable_bintest
end
=begin
MRuby::Build.new('host-debug') do |conf|
# load specific toolchain settings
...
...
@@ -117,7 +117,7 @@ MRuby::Build.new('test') do |conf|
conf.gembox 'default'
end
=end
# Define cross build settings
# MRuby::CrossBuild.new('32bit') do |conf|
# toolchain :gcc
...
...
include/mruby.h
View file @
d1691268
...
...
@@ -496,6 +496,21 @@ MRB_API void mrb_undef_class_method(mrb_state*, struct RClass*, const char*);
/**
* Initialize a new object instace of c class.
*
* // Example:
* #include <stdio.h>
* #include <mruby.h>
*
* void
* mrb_example_gem_init(mrb_state* mrb) {
* struct RClass *example_class;
*
* mrb_value *argv[1];
* mrb_value obj;
*
* example_class = mrb_define_class(mrb, "ExampleClass", mrb->object_class);* argv[0] = example_class;
* obj = mrb_obj_new(mrb, mrb->object_class, 1, argv); // => ExampleClass
* mrb_funcall(mrb, obj, "puts", 1, example_class);
* }
* @param mrb The current mruby state.
* @param c Reference to the class of the new object.
* @param argc Number of arguments in argv
...
...
@@ -504,7 +519,31 @@ MRB_API void mrb_undef_class_method(mrb_state*, struct RClass*, const char*);
*/
MRB_API
mrb_value
mrb_obj_new
(
mrb_state
*
mrb
,
struct
RClass
*
c
,
mrb_int
argc
,
const
mrb_value
*
argv
);
/** @see mrb_obj_new */
/**
* Initialize a new object instace of c class.
*
* // Example:
* #include <stdio.h>
* #include <mruby.h>
*
* void
* mrb_example_gem_init(mrb_state* mrb) {
* struct RClass *example_class;
*
* mrb_value *argv[1];
* mrb_value obj;
* mrb_value obj_inst;
*
* example_class = mrb_define_class(mrb, "ExampleClass", mrb->object_class);*
* argv[0] = example_class;
* obj = mrb_obj_new(mrb, mrb->object_class, 1, argv);
* obj_inst = mrb_class_new_instance(mrb, 0, argv, example_class); // => #<ExampleClass:0x89734f8>
* mrb_funcall(mrb, obj, "puts", 1, obj_inst);
* }
* @param mrb The current mruby state.
* @param argc Number of arguments in argv
* @param c Reference to the class of the new object.
*/
MRB_INLINE
mrb_value
mrb_class_new_instance
(
mrb_state
*
mrb
,
mrb_int
argc
,
const
mrb_value
*
argv
,
struct
RClass
*
c
)
{
return
mrb_obj_new
(
mrb
,
c
,
argc
,
argv
);
...
...
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