ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/plugins/cfperl/cfperl.xs
(Generate patch)

Comparing deliantra/server/plugins/cfperl/cfperl.xs (file contents):
Revision 1.41 by root, Tue Mar 28 16:08:28 2006 UTC vs.
Revision 1.42 by root, Tue Mar 28 16:48:12 2006 UTC

77} CFPContext; 77} CFPContext;
78 78
79static HV *obj_cache; 79static HV *obj_cache;
80static PerlInterpreter *perl; 80static PerlInterpreter *perl;
81 81
82#define PUSHcfapi(type,ctype) PUSHs (sv_2mortal (newSVcfapi ((type), va_arg (args, ctype))))
83#define PUSH_OB PUSHcfapi(CFAPI_POBJECT, object *)
84#define PUSH_PL PUSHcfapi(CFAPI_PPLAYER, player *)
85#define PUSH_MAP PUSHcfapi(CFAPI_PMAP, mapstruct *)
86#define PUSH_PV PUSHcfapi(CFAPI_STRING, const char *)
87#define PUSH_IV PUSHcfapi(CFAPI_INT, int)
88
82////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 89//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
83 90
84// garbage collect some perl objects, if possible 91// garbage collect some perl objects, if possible
85// all objects no longer referenced and empty are 92// all objects no longer referenced and empty are
86// eligible for destruction. 93// eligible for destruction.
296 ENTER; 303 ENTER;
297 SAVETMPS; 304 SAVETMPS;
298 305
299 PUSHMARK (SP); 306 PUSHMARK (SP);
300 307
308 EXTEND (SP, 10);
309
301 HV *hv = newHV (); 310 HV *hv = newHV ();
302#define hv_context(type,addr,expr) hv_store (hv, #expr, sizeof (#expr) - 1, newSVcfapi (type, addr context->expr), 0) 311#define hv_context(type,addr,expr) hv_store (hv, #expr, sizeof (#expr) - 1, newSVcfapi (type, addr context->expr), 0)
303 hv_context (CFAPI_POBJECT, ,who); 312 hv_context (CFAPI_POBJECT, ,who);
304 hv_context (CFAPI_POBJECT, ,activator); 313 hv_context (CFAPI_POBJECT, ,activator);
305 hv_context (CFAPI_POBJECT, ,third); 314 hv_context (CFAPI_POBJECT, ,third);
308 hv_context (CFAPI_INT ,&,fix); 317 hv_context (CFAPI_INT ,&,fix);
309 hv_context (CFAPI_INT ,&,event_code); 318 hv_context (CFAPI_INT ,&,event_code);
310 hv_context (CFAPI_STRING , ,options); 319 hv_context (CFAPI_STRING , ,options);
311 hv_context (CFAPI_STRING , ,extension); 320 hv_context (CFAPI_STRING , ,extension);
312 321
313 XPUSHs (sv_2mortal (newRV_noinc ((SV *)hv))); 322 PUSHs (sv_2mortal (newRV_noinc ((SV *)hv)));
314 323
315 PUTBACK; 324 PUTBACK;
316 int count = call_pv (func, G_SCALAR | G_EVAL); 325 int count = call_pv (func, G_SCALAR | G_EVAL);
317 SPAGAIN; 326 SPAGAIN;
318 327
528 537
529 PUSHMARK (SP); 538 PUSHMARK (SP);
530 539
531 EXTEND (SP, 10); 540 EXTEND (SP, 10);
532 PUSHs (sv_2mortal (newSViv (event_code))); 541 PUSHs (sv_2mortal (newSViv (event_code)));
533
534#define PUSHcfapi(type,ctype) PUSHs (sv_2mortal (newSVcfapi ((type), va_arg (args, ctype))))
535#define PUSH_OB PUSHcfapi(CFAPI_POBJECT, object *)
536#define PUSH_PL PUSHcfapi(CFAPI_PPLAYER, player *)
537#define PUSH_MAP PUSHcfapi(CFAPI_PMAP, mapstruct *)
538#define PUSH_PV PUSHcfapi(CFAPI_STRING, const char *)
539#define PUSH_IV PUSHcfapi(CFAPI_INT, int)
540 542
541 switch (event_code) 543 switch (event_code)
542 { 544 {
543 case EVENT_CRASH: 545 case EVENT_CRASH:
544 break; 546 break;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines