From: Ryan Davis Date: 2008-05-05T15:57:38+09:00 Subject: Re: Need more help with Ruby and C On May 4, 2008, at 20:13 , Bryan Richardson wrote: > Hello all, > > So I have something like the following in my C file: > > static VALUE rb_cBar; > > static VALUE foo_new() { > VALUE new_foo; > ... ^^^ problem exists here. can't help any further. > return new_foo; > } > > static VALUE execute(VALUE foos) { > VALUE foo = rb_ary_entry(foos, 0); > printf("Foo Value: %i\n", rb_iv_get(foo, "@value"); > } > > void Init_bar() { > rb_cBar = rb_define_class("Bar", rb_cObject); > rb_define_method(rb_cBar, "new_foo", foo_new, 0); > rb_define_method(rb_cBar, "execute", execute, 1); > }