in reply to XS N' void (*f) (void)

Answering my own question ... I rather think that you cannot. I replaced my old C callback-set-function with this--it does exactly what I wanted in the first place:
static SV * fp = (SV*) NULL; void call_funky() { dSP; if(fp == (SV*) NULL) return; PUSHMARK(SP); perl_call_sv(fp, G_DISCARD); } MODULE = sometin PACKAGE = somethin void funky(f) SV * f CODE: if (fp == (SV*)NULL) fp = newSVsv(f); else SvSetSV(fp, f);

Replies are listed 'Best First'.
Re: Re: XS N' void (*f) (void)
by tye (Sage) on Dec 23, 2000 at 03:15 UTC

    A bit late for a reply, but...

    Very nice job on handling the call-back. You make it look so simple that I'm ashamed that I never got that far when I had this challenge. (: I guess it gets trickier if you have one call-back per object and need to pass the object in to the call-back function, which is what I was doing, but that still sounds doable based on what you did.

    Anyway, I was really replying to mention the FFI module that supports building call-backs at run time, usually for use with dynamic libraries. I haven't actually gotten to use it since I found out about it, but I've heard good things about it.

            - tye (but my friends call me "Tye")