Sorry, essentially what I'm asking is if i can pass a pir method as a function pointer on a c call.

essentially what I'm looking to do is get into the message pump on windows, and I'm trying to keep all of the code within pir.

I'm trying to see how many hoops I need to do in order to write a gui setup using coroutines from pir alone.


chromatic wrote:
On Monday 07 January 2008 09:22:43 robby wrote:

With skimming across the past 400 or so messages on this list I'm not
exactly sure if this would be the correct list to post this, but I have
a quick question regarding NCI's and callbacks.

I've read http://www.parrotcode.org/docs/pdd/pdd16_native_call.htm and
nci.t and I haven't came up with the answer off hand, so I may be
missing something, or it may not be possible in pir.

I have a function I'm wanting to call that is long func(long, long,
long, callback)

and a callback with a sig (long, long, long, long).

While doing callbacks, do I *have* to create a wrapper in C in order to
use them? In the draft doc noted above it says

"However, many callback functions share a common signature, and parrot
provides some ready-made functions for this purpose that should serve
for most of the callback uses."

But I think I may be taking it out of context.

I'm trying to tap into the win32 procs and don't know if I can keep it
all in pir (which is the goal, because I'd rather port bytecode than c
code across platforms)

Am I reading the docs wrong, or is there no functionality to do what I'm
looking at?

As I understand it, the discussion of callbacks in the docs is about callbacks implemented in PIR. The callback you describe looks like a C function, in which case you should be able to get a pointer to it and pass it as a pointer.

Apologies if I misunderstood your question though.

-- c

Reply via email to