Subject:
[ruby-ffi] Re: How to declare (int *argc, char *argv)?
From:
przemo_li
Date:
8/21/11 2:02 PM
To:
ruby-ffi



On 21 Sie, 20:17, Matijs van Zuijlen <mat...@matijs.net> wrote:
> First, did you take a look athttps://github.com/remogatto/ffi-opengl?Perhaps
> you can fork it and go from there?

Thx! I quickly checked it and it seam to cover OpenGL 1.3 only, and
also with ffi-swing, but it will be worth even as just examples.
> > I've read that :pointer can be used as output array of strings.
> > (int * argc, char ** argv)
>
> > Can I use :int, as output int parameter?
> > [:int, :pointer]
>
> No, both parameters need to be pointers.

Yeah, I've figured it out :) (ps maybe there should be some exmaple
added to docs? they only describe complex objects, thats fooled me,
something with int* should do)

> For an example of processing ARGC and ARGV, see:
>
> https://github.com/mvz/ruby-gir-ffi/blob/master/examples/hard_coded.rb
>
> (Oh, and note that ARGV on ruby doesn't include the name of the executable, but
> C functions generally expect that it does).
> Matijs

Big thx!!