lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

On Mon, Jul 27, 2009 at 2:17 AM, Phoenix Sol<> wrote:
>> Are you using the "pointer" type in both the callback's and the C
>> function's signatures?
> Yes, Fabio. You seem to imply that it should work; perhaps I have overlooked
> something.
> In my callback function, should type(my_pointer_arg) == 'userdata'?

Yep, it should be a light userdata, and is working for me. :-)
Remember that the first type you pass to alien.callback is the return
type, not the type of the first argument:

function foo(ud)
  -- do something with userdata ud
  return 0

foo_cb = alien.callback(foo, "int", "pointer")

> Currently, it is 'number'. I'm certain that it should be receiving a
> pointer.
> Thanks,
> Phoenix Sol

Fabio Mascarenhas