mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-19 17:38:26 +00:00
[Quest API] Use binding library for perl apis (#2216)
* Add perlbind library * Convert perl apis to perlbind
This commit is contained in:
+5
-42
@@ -20,17 +20,14 @@
|
||||
|
||||
#include "../common/global_define.h"
|
||||
#include "../common/eqemu_logsys.h"
|
||||
#include "embxs.h"
|
||||
#include "embperl.h"
|
||||
#include "masterentity.h"
|
||||
#include "command.h"
|
||||
#ifdef BOTS
|
||||
#include "bot_command.h"
|
||||
#endif
|
||||
|
||||
#include "embperl.h"
|
||||
#include "embxs.h"
|
||||
|
||||
|
||||
|
||||
const char *getItemName(unsigned itemid)
|
||||
{
|
||||
const EQ::ItemData* item = nullptr;
|
||||
@@ -42,43 +39,9 @@ const char *getItemName(unsigned itemid)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
XS(XS_qc_getItemName); /* prototype to pass -Wmissing-prototypes */
|
||||
XS(XS_qc_getItemName)
|
||||
{
|
||||
dXSARGS;
|
||||
if (items != 1)
|
||||
Perl_croak(aTHX_ "Usage: quest::getItemName(itemid)");
|
||||
{
|
||||
unsigned itemid = (unsigned)SvUV(ST(0));
|
||||
const char * RETVAL;
|
||||
dXSTARG;
|
||||
RETVAL = getItemName(itemid);
|
||||
sv_setpv(TARG, RETVAL); XSprePUSH; PUSHTARG;
|
||||
}
|
||||
XSRETURN(1);
|
||||
}
|
||||
|
||||
|
||||
EXTERN_C XS(boot_qc); /* prototype to pass -Wmissing-prototypes */
|
||||
EXTERN_C XS(boot_qc)
|
||||
{
|
||||
dXSARGS;
|
||||
char file[256];
|
||||
strncpy(file, __FILE__, 256);
|
||||
file[255] = '\0';
|
||||
|
||||
if(items != 1)
|
||||
LogError("boot_qc does not take any arguments");
|
||||
|
||||
char buf[128]; //shouldent have any function names longer than this.
|
||||
|
||||
//add the strcpy stuff to get rid of const warnings....
|
||||
|
||||
XS_VERSION_BOOTCHECK ;
|
||||
|
||||
newXS(strcpy(buf, "quest::getItemName"), XS_qc_getItemName, file);
|
||||
|
||||
XSRETURN_YES;
|
||||
const char* Perl__qc_getItemName(unsigned itemid)
|
||||
{
|
||||
return getItemName(itemid); // possible nullptr return
|
||||
}
|
||||
|
||||
#ifdef EMBPERL_IO_CAPTURE
|
||||
|
||||
Reference in New Issue
Block a user