Subject:
[ruby-ffi] unsigned char *
From:
Jeffrey Jones
Date:
2/6/12 3:15 AM
To:
ruby-ffi

Hello all,

I am in the early stages of investigating ruby FFI for use with a
particular third party library.

This library makes use of a few functions with the following
signature.

struct * function (unsigned char*, unsigned int)

These functions are basically used for reading data in from various
places (fread for example) so it is the data itself and the data size.

Looking at all the various documentation and examples and code, I
cannot actually see what I need to do in ruby to match the signature.

module Foo
  attach_function :function, [:uchar, :uint], :pointer
end

Doesn't work because it isn't expecting a single char but a char*.

Does anyone know what I need to do? (If it is even possible?)

Cheers

Jeff