--- deliantra/server/plugins/cfperl/cfperl.xs 2006/03/28 16:08:28 1.41 +++ deliantra/server/plugins/cfperl/cfperl.xs 2006/03/28 16:48:12 1.42 @@ -79,6 +79,13 @@ static HV *obj_cache; static PerlInterpreter *perl; +#define PUSHcfapi(type,ctype) PUSHs (sv_2mortal (newSVcfapi ((type), va_arg (args, ctype)))) +#define PUSH_OB PUSHcfapi(CFAPI_POBJECT, object *) +#define PUSH_PL PUSHcfapi(CFAPI_PPLAYER, player *) +#define PUSH_MAP PUSHcfapi(CFAPI_PMAP, mapstruct *) +#define PUSH_PV PUSHcfapi(CFAPI_STRING, const char *) +#define PUSH_IV PUSHcfapi(CFAPI_INT, int) + ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // garbage collect some perl objects, if possible @@ -298,6 +305,8 @@ PUSHMARK (SP); + EXTEND (SP, 10); + HV *hv = newHV (); #define hv_context(type,addr,expr) hv_store (hv, #expr, sizeof (#expr) - 1, newSVcfapi (type, addr context->expr), 0) hv_context (CFAPI_POBJECT, ,who); @@ -310,7 +319,7 @@ hv_context (CFAPI_STRING , ,options); hv_context (CFAPI_STRING , ,extension); - XPUSHs (sv_2mortal (newRV_noinc ((SV *)hv))); + PUSHs (sv_2mortal (newRV_noinc ((SV *)hv))); PUTBACK; int count = call_pv (func, G_SCALAR | G_EVAL); @@ -531,13 +540,6 @@ EXTEND (SP, 10); PUSHs (sv_2mortal (newSViv (event_code))); -#define PUSHcfapi(type,ctype) PUSHs (sv_2mortal (newSVcfapi ((type), va_arg (args, ctype)))) -#define PUSH_OB PUSHcfapi(CFAPI_POBJECT, object *) -#define PUSH_PL PUSHcfapi(CFAPI_PPLAYER, player *) -#define PUSH_MAP PUSHcfapi(CFAPI_PMAP, mapstruct *) -#define PUSH_PV PUSHcfapi(CFAPI_STRING, const char *) -#define PUSH_IV PUSHcfapi(CFAPI_INT, int) - switch (event_code) { case EVENT_CRASH: