From: Logan Capaldo Date: 2007-04-12T12:36:07+09:00 Subject: Re: A C++ reference in a Ruby extension On Thu, Apr 12, 2007 at 10:07:52AM +0900, David Simas wrote: > > > I'm trying to write an extension to access some C++ libraries from > Ruby (1.8.4). One of the C++ functions uses a reference to pass > a value back to the caller as a side effect: > > ErrorHandle* DetectInvisibleWatermark(const char *inputfilename, > const char *wmfilename, > float horizOffset, > float vertOffset, > float lowPassFilterFactor, > float &modulationStrength, > const char *key, const char *seed, > const char *outfilename); > > (N.B.: "float &modulationStrength") Wrap it in a C function void foo(float* bar) { baz(*bar); } void baz(float& quux) { quux /= 1.5; } > > Any suggestions on how to handle this reference in an extension? > I don't have the C++ sources, just libraries and header files. > > Thanks, > > DGS > > >