From: Martin DeMello Date: 2009-06-15T18:13:54+09:00 Subject: Re: wrapping a C struct[] constant 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