Daniel Berger wrote:

> I tried this but I'm still having trouble. Part of the problem may be
> that I'm not sure how to declare char[] struct members. The docs
> indicate there's a :char_array type, but FFI doesn't seem to like it.

Yeah, the docs on the Kenai wiki are pretty out of date at the moment. 
We'll fix them when we'll finish the migration on github. Basically, you 
can declare array types in this way:

  [type, num]

where type can be:

* a native type like :char, :int, :short, ...
* a subclass of FFI::Struct

and num is the number of the elements of the array.

I made some changes on your script and I pasted a working version here:

http://gist.github.com/164777

Keep in mind that the script is working on my system (Ubuntu 32bit) but 
might not work on yours. Indeed, as you can see looking at the C header 
file "/usr/include/bits/utmpx.h", there are a bunch of precompiler 
conditional branches that made structs definitions platform-dependent.

Regards,
Andrea

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