0

Answered: What is proper ruby ffi code for this function:

void glutInit(int *argc, char ** argv);

attach_function :glutInit, [:pointer, :pointer], :void

Answered: How to handle array of C-strings? Like a pointer!

Still unanswered:How to change ARGV to match argument type?

If you know how to get "untouched" C argc and argv in Ruby script it would also helped (eg. python have special library for that, I'm not aware of anything similar for Ruby apart from ARGV).

przemo_li
  • 3,932
  • 4
  • 35
  • 60

1 Answers1

0

here someone has written about this: http://zegoggl.es/2009/05/ruby-ffi-recipes.html

you can use :varargs in your attach_function call, and when you call gluInit, you pass an array of type/value pairs.

user573335
  • 350
  • 1
  • 5
  • 18