Mat Schaffer wrote:
> On Feb 27, 2007, at 6:24 PM, Tea Figuric wrote:
> 
> I'm assuming you've read README.ext already?
> http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/RUBY/README.EXT?
> view=markup
> 
> Have you investigated using the inline library?  It might make more
> sense if you just need a few functions.
> http://www.zenspider.com/ZSS/Products/RubyInline/
> 
> Using C from Ruby is a bit more complex than just regular ruby
> programming, but hopefully those links can get you started.
> -Mat

Thank you for your response Mat, I will look into the links.

The library should be used by different scripting languages and 
languages, so it should be as generic as possible.


In the meantime, I ran into a different problem, and I am having 
problems finding an answer to it.

Since my C/C++ functions return only int, I have a function to which I 
pass a *buffer (as char*), and befferLength (as int), where the buffer 
should be populated inside of the function, and I have access to the 
value from the outside. something like int (or void) GetValue(char 
*buffer, int bufferLength);

How do I pass a char* from ruby? is there something to convert from 
string to char * without having to change my C lib?

Thanks again for your help!

-- 
Posted via http://www.ruby-forum.com/.