--- deliantra/server/include/cfperl.h 2006/09/04 13:55:54 1.23 +++ deliantra/server/include/cfperl.h 2006/09/17 18:19:19 1.27 @@ -54,12 +54,12 @@ #define ARG_DOUBLE(v) DT_DOUBLE, static_cast (v) #define ARG_STRING(v) DT_STRING, static_cast (v) #define ARG_DATA(s,l) DT_DATA , static_cast (s), (l) -#define ARG_OBJECT(o) DT_OBJECT, (void *)static_cast (o) -#define ARG_MAP(o) DT_MAP , (void *)static_cast (o) -#define ARG_PLAYER(o) DT_PLAYER, (void *)static_cast (o) -#define ARG_ARCH(o) DT_ARCH , (void *)static_cast (o) -#define ARG_PARTY(o) DT_PARTY , (void *)static_cast (o) -#define ARG_REGION(o) DT_REGION, (void *)static_cast (o) +#define ARG_OBJECT(o) DT_OBJECT, (void *)static_cast (o) +#define ARG_MAP(o) DT_MAP , (void *)static_cast (o) +#define ARG_PLAYER(o) DT_PLAYER, (void *)static_cast (o) +#define ARG_ARCH(o) DT_ARCH , (void *)static_cast (o) +#define ARG_PARTY(o) DT_PARTY , (void *)static_cast (o) +#define ARG_REGION(o) DT_REGION, (void *)static_cast (o) // the ", ## __VA_ARGS" is, unfortunately, a gnu-cpp extension @@ -75,9 +75,11 @@ //TODO should index into @result #define RESULT(idx,type) cfperl_result_ ## type (idx) #define RESULT_INT(idx) RESULT(idx, INT) +#define RESULT_MAP(idx) RESULT(idx, MAP) bool cfperl_invoke (event_type event, ...); int cfperl_result_INT (int idx); +int cfperl_result_MAP (int idx); struct attachable_base { @@ -101,10 +103,22 @@ attachable_clear (); } + ~attachable_base () + { + clear (); + } + attachable_base (const attachable_base &src) : self (0), cb (0), attach (src.attach) { } + + attachable_base &operator = (const attachable_base &src) + { + clear (); + attach = src.attach; + return *this; + } }; // objects attachable from perl (or any other extension) should include or