超漢字上で、mrubyを使ってhello worldを表示させる。
Révision | d2a28c783b4560c2d7a86e78906ea55c92b404b1 (tree) |
---|---|
l'heure | 2014-07-19 21:17:43 |
Auteur | ornse01 <ornse01@user...> |
Commiter | ornse01 |
porting mruby-print to B-right/V.
@@ -1,5 +1,5 @@ | ||
1 | -MRuby::Gem::Specification.new('mruby-print') do |spec| | |
1 | +MRuby::Gem::Specification.new('mruby-brightv-print') do |spec| | |
2 | 2 | spec.license = 'MIT' |
3 | - spec.author = 'mruby developers' | |
4 | - spec.summary = 'standard print/puts/p' | |
3 | + spec.authors = ['mruby developers', 'ornse01'] | |
4 | + spec.summary = 'standard print/puts/p B-right/V port' | |
5 | 5 | end |
@@ -1,17 +1,15 @@ | ||
1 | 1 | #include "mruby.h" |
2 | 2 | #include "mruby/string.h" |
3 | -#include <stdio.h> | |
3 | +#include <bstdio.h> | |
4 | 4 | |
5 | 5 | static void |
6 | 6 | printstr(mrb_state *mrb, mrb_value obj) |
7 | 7 | { |
8 | 8 | char *s; |
9 | - mrb_int len; | |
10 | 9 | |
11 | 10 | if (mrb_string_p(obj)) { |
12 | 11 | s = RSTRING_PTR(obj); |
13 | - len = RSTRING_LEN(obj); | |
14 | - fwrite(s, len, 1, stdout); | |
12 | + printf("%s", s); | |
15 | 13 | } |
16 | 14 | } |
17 | 15 |
@@ -29,7 +27,7 @@ mrb_printstr(mrb_state *mrb, mrb_value self) | ||
29 | 27 | } |
30 | 28 | |
31 | 29 | void |
32 | -mrb_mruby_print_gem_init(mrb_state* mrb) | |
30 | +mrb_mruby_brightv_print_gem_init(mrb_state* mrb) | |
33 | 31 | { |
34 | 32 | struct RClass *krn; |
35 | 33 | krn = mrb->kernel_module; |
@@ -37,6 +35,6 @@ mrb_mruby_print_gem_init(mrb_state* mrb) | ||
37 | 35 | } |
38 | 36 | |
39 | 37 | void |
40 | -mrb_mruby_print_gem_final(mrb_state* mrb) | |
38 | +mrb_mruby_brightv_print_gem_final(mrb_state* mrb) | |
41 | 39 | { |
42 | 40 | } |