EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Development::Development (https://www.eqemulator.org/forums/forumdisplay.php?f=590)
-   -   Generating Perl Classes..howto? (https://www.eqemulator.org/forums/showthread.php?t=29620)

Harakiri23 09-21-2009 04:34 PM

Generating Perl Classes..howto?
 
Dear Devs,

the perl classes like perl_client.cpp seem to be auto generated from the client.cpp to map client c++ functions into perl. I figured as much that the perl toolset using xsubpp has created these files.

I got as far as creating my own perl mapper classes for custom c++ classes, however i seem only be able to create the header (function bodies) not the implementation.

I see that these classes were originally checked in by FatherMatt? - is there a howto to build these perl_*.cpp classes ? It looks like over the years you are advised to copy & paste new functions into these classes any manually create the perl code like

Quote:

XS(XS_Client_Duck); /* prototype to pass -Wmissing-prototypes */
XS(XS_Client_Duck)
{
dXSARGS;
if (items != 1)
Perl_croak(aTHX_ "Usage: Client::Duck(THIS)");
{
Client * THIS;

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 Client");
if(THIS == NULL)
Perl_croak(aTHX_ "THIS is NULL, avoiding crash.");

THIS->Duck();
}
XSRETURN_EMPTY;
}
is there a documented way to auto generate these classes including code?

Thank you

Harakiri23 09-23-2009 10:48 AM

NM - i educated myself once i found the Utils\perlxs dir


All times are GMT -4. The time now is 03:40 AM.

Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.