Last change
on this file since 286 was 279, checked in by coas-nagasima, 7 years ago |
ファイルを追加、更新。
|
-
Property svn:eol-style
set to
native
-
Property svn:keywords
set to
Id
-
Property svn:mime-type
set to
text/x-csrc
|
File size:
471 bytes
|
Rev | Line | |
---|
[279] | 1 | #include <mruby.h>
|
---|
| 2 | #include <stdio.h>
|
---|
| 3 |
|
---|
| 4 | static mrb_value
|
---|
| 5 | mrb_c_method(mrb_state *mrb, mrb_value self)
|
---|
| 6 | {
|
---|
| 7 | puts("A C Extension");
|
---|
| 8 | return self;
|
---|
| 9 | }
|
---|
| 10 |
|
---|
| 11 | void
|
---|
| 12 | mrb_c_and_ruby_extension_example_gem_init(mrb_state* mrb) {
|
---|
| 13 | struct RClass *class_cextension = mrb_define_module(mrb, "CRubyExtension");
|
---|
| 14 | mrb_define_class_method(mrb, class_cextension, "c_method", mrb_c_method, MRB_ARGS_NONE());
|
---|
| 15 | }
|
---|
| 16 |
|
---|
| 17 | void
|
---|
| 18 | mrb_c_and_ruby_extension_example_gem_final(mrb_state* mrb) {
|
---|
| 19 | /* finalizer */
|
---|
| 20 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.