View Single Post
  #2  
Old 08-08-2014, 03:11 AM
Kingly_Krab
Administrator
 
Join Date: May 2013
Location: United States
Posts: 1,603
Default

Try this:
Code:
$client->SendWebLink("url");
Here it is in perl_client.cpp:
Code:
XS(XS_Client_SendWebLink); /* prototype to pass -Wmissing-prototypes */
XS(XS_Client_SendWebLink)
{
    dXSARGS;
    if (items < 1 || items > 2)
        Perl_croak(aTHX_ "Usage: Client::SendWebLink(THIS, website)");
    {
        Client *    THIS;
        char *        website = nullptr;

        if (sv_derived_from(ST(0), "Client")) {
            IV tmp = SvIV((SV*)SvRV(ST(0)));
            THIS = INT2PTR(Client *,tmp);
        }
        else
            Perl_croak(aTHX_ "THIS is not of type Mob");
        if(THIS == nullptr)
            Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");

        if (items > 1)    {    website = (char *)SvPV_nolen(ST(1));    }

        THIS->SendWebLink(website);
    }
    XSRETURN_EMPTY;
}
Reply With Quote