source: HelloMruby/tags/HelloMruby-V1.0.0/HelloTECS.rb

Last change on this file was 77, checked in by okuma-top, 8 years ago

HelloMruby 1st version

File size: 643 bytes
Line 
1# HelloTECS.rb
2# Buddy ƒZƒ‹‚ð mruby ‚©‚ç‘€ì‚·‚é
3
4# (1) ƒuƒŠƒbƒWƒZƒ‹‚ð buddyBridge ‚ÉŠ„‚è•t‚¯‚é
5print "[I create] buddyBridge.\n"
6buddyBridge = TECS::TsHello.new( "BuddyBridge" )
7
8# (2) CharPointer ‚𐶐¬ (’·‚³32‚Ì”z—ñ)
9len = 32
10buf = TECS::CharPointer.new( len )
11
12# (3) buf ‚ɃƒbƒZ[ƒW‚ðÝ’è
13buf.from_s "Hello TECS! (from mruby)"
14
15# (4) Buddy ‚Ì myMessage ‚ðŒÄo‚·
16buddyBridge.myMessage( buf )
17
18# (5) Buddy ‚Ì yourMessage ‚ðŒÄo‚·
19buddyBridge.yourMessage( buf, len )
20print "[I received] " + buf.to_s + "\n"
21 # buf ‚Í out ˆø”DBuddy ‚Őݒ肳‚ê‚Ä–ß‚é
22 # len ˆø”‚́Aç’·‚¾‚ªAbuf ‚ÌŽÀÛ‚Ì’·‚³‚æ‚è‘å‚«‚¢‚Æ—áŠO”­¶
Note: See TracBrowser for help on using the repository browser.