From: Daniel Berger Date: 2005-02-02T02:15:53+09:00 Subject: Re: Accessing a struct created within a C extension ts wrote: > >>>>> "D" == Daniel Berger writes: > > D> class File > D> TStruct = Struct.new("TStruct",:bar,:baz) > D> end > > D> t = File::TStruct.new("hello","world") > > Probably I've not understood > > uln% cat a.c > #include > > void Init_a() > { > rb_const_set(rb_cFile, rb_intern("TStruct"), > rb_struct_define("TStruct","bar","baz",0)); > } > > uln% > > uln% ruby -ra -e 'p File::TStruct.new("hello","world")' > # > uln% > > > > Guy Decoux That's it. Thanks Guy. Dan.