[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: can alien callbacks receive pointers (and then pass them to C functions)?
- From: Fabio Mascarenhas <mascarenhas@...>
- Date: Mon, 27 Jul 2009 13:11:15 -0300
On Mon, Jul 27, 2009 at 2:17 AM, Phoenix Sol<firstname.lastname@example.org> 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
> 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:
-- do something with userdata ud
foo_cb = alien.callback(foo, "int", "pointer")
> Currently, it is 'number'. I'm certain that it should be receiving a
> Phoenix Sol