--- deliantra/server/include/cfperl.h 2009/01/08 19:23:44 1.105 +++ deliantra/server/include/cfperl.h 2009/10/12 04:02:17 1.107 @@ -85,10 +85,13 @@ if (SvTRUE (ERRSV)) \ LOG (llevError, "runtime error in %s: %s", __func__, SvPVutf8_nolen (ERRSV)); +inline int call_pvsv (const char *ob, I32 flags) { return call_pv (ob, flags); } +inline int call_pvsv (SV *ob, I32 flags) { return call_sv (ob, flags); } + #define CALL_BEGIN(args) dSP; ENTER; SAVETMPS; PUSHMARK (SP); EXTEND (SP, args) #define CALL_ARG_SV(sv) PUSHs (sv_2mortal (sv)) // separate because no refcount inc #define CALL_ARG(expr) PUSHs (sv_2mortal (to_sv (expr))) -#define CALL_CALL(name, flags) PUTBACK; int count = call_pv (name, (flags) | G_EVAL); SPAGAIN; +#define CALL_CALL(name, flags) PUTBACK; int count = call_pvsv (name, (flags) | G_EVAL); SPAGAIN; #define CALL_END PUTBACK; CHECK_ERROR; FREETMPS; LEAVE ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -103,6 +106,10 @@ int cfperl_can_merge (object *ob1, object *ob2); void cfperl_mapscript_activate (object *ob, int state, object *activator, object *originator = 0); +bool is_match_expr (const char *expr); +/* applies the match expression and returns true if it matches */ +bool match (const char *expr, object *ob, object *self = 0, object *source = 0, object *originator = 0); + ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// #if IVSIZE >= 8