From: Jason Roelofs Date: 2009-06-15T22:43:17+09:00 Subject: Re: wrapping a C struct[] constant --00221532c420b38f19046c63218b Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit On Mon, Jun 15, 2009 at 5:13 AM, Martin DeMello wrote: > On Sat, Jun 13, 2009 at 2:52 AM, Joel VanderWerf > wrote: > > > > Cgenerator will work, and might be a good idea if the source (the list of > > values and strings) changes from time to time, and you would rather have > > your program regenerate the ruby extension (and data structure) > > automatically. > > > > Here's how it works, assuming your source files are flag.c and flag.h: > > Thanks, that looks great. I have to say, I'm a bit disappointed in the > state of ruby/C integration - another basic thing I missed is the > ability to define a typemap and then have a ruby class > serialised/deserialised to a C struct. (Is that what Cgenerator's > CShadow is all about?). Are these not common use cases? > > martin > > Could you give an example of how this would work? I'm having a hard time picturing how such a thing would be possible to have done automagically. There has to be something somewhere that defines how a Ruby class would map to said C struct. Jason --00221532c420b38f19046c63218b--