You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucy.apache.org by Marvin Humphrey <ma...@rectangular.com> on 2012/11/20 23:43:34 UTC

[lucy-dev] Clownfish::Host gone

Greets,

The Clownfish::Host layer, which provided the Host_callback() API, is now
gone, as discussed last spring:

    http://markmail.org/message/bdxdrcyxgbum627g

    > If that were _PERL, we would eliminate Host_callback() indirection layer
    > and flesh out the function body with raw XS:

    +1. I like that it removes a layer of indirection, and makes it clearer
    what the function does.

Here's how one old callback wrapper looked:

    void
    lucy_Query_set_boost_OVERRIDE(lucy_Query* self, float boost) {
        cfish_Host_callback(self, "set_boost", 1,
                            CFISH_ARG_F64("boost", boost));
    }

Here's how it looks now:

    void
    lucy_Query_set_boost_OVERRIDE(lucy_Query* self, float boost) {
        dSP;
        EXTEND(SP, 2);
        ENTER;
        SAVETMPS;
        PUSHMARK(SP);
        mPUSHs((SV*)Cfish_Obj_To_Host((cfish_Obj*)self));
        mPUSHn(boost);
        PUTBACK;
        S_finish_callback_void("set_boost");
    }

Marvin Humphrey