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

Comparing deliantra/server/server/cfperl.xs (file contents):
Revision 1.15 by root, Sun Aug 27 13:04:43 2006 UTC vs.
Revision 1.39 by elmex, Fri Sep 1 17:16:47 2006 UTC

21 * You should have received a copy of the GNU General Public License 21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software 22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 23 * Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
24*/ 24*/
25 25
26#include <EXTERN.h>
27#include <perl.h>
28#include <XSUB.h>
29
30#undef save_long // clashes with libproto.h
31
32#define PLUGIN_NAME "perl" 26#define PLUGIN_NAME "perl"
33#define PLUGIN_VERSION "cfperl 0.5" 27#define PLUGIN_VERSION "cfperl 0.5"
34
35#ifndef __CEXTRACT__
36#include <plugin.h>
37#endif
38
39#undef MODULEAPI
40#ifdef WIN32
41#else
42#define MODULEAPI
43#endif
44 28
45#include <plugin_common.h> 29#include <plugin_common.h>
46#include <sounds.h> 30#include <sounds.h>
47#include <cstdarg> 31#include <cstdarg>
48#include <sproto.h> 32#include <sproto.h>
49 33
50#include "cfperl.h" 34#include "cfperl.h"
51#include "shstr.h" 35#include "shstr.h"
52 36
37#include <EXTERN.h>
38#include <perl.h>
39#include <XSUB.h>
40
53#include "perlxsi.c" 41#include "perlxsi.c"
54 42
55extern sint64 *levels; // the experience table 43extern sint64 *levels; // the experience table
56 44
57typedef object object_ornull; 45typedef object object_ornull;
59 47
60typedef double val64; 48typedef double val64;
61#define newSVval64 newSVnv 49#define newSVval64 newSVnv
62#define SvVAL64 SvNV 50#define SvVAL64 SvNV
63 51
64static f_plug_api gethook; 52static f_plug_api gethook = cfapi_get_hooks;
65static f_plug_api systemDirectory; 53static f_plug_api object_set_property = cfapi_object_set_property;
66static f_plug_api object_set_property; 54static f_plug_api object_insert = cfapi_object_insert;
67static f_plug_api map_get_map; 55
68static f_plug_api object_insert; 56static bool perl_booted;
69 57
70/* this is a stupid way to do things, and awkward to use for plug-in authors */ 58/* this is a stupid way to do things, and awkward to use for plug-in authors */
71typedef struct 59typedef struct
72{ 60{
73 object* who; 61 object* who;
108 96
109 sv_magic ((SV *)hv, 0, PERL_MAGIC_ext, (char *)ptr, 0); 97 sv_magic ((SV *)hv, 0, PERL_MAGIC_ext, (char *)ptr, 0);
110 return sv_bless (newRV_noinc ((SV *)hv), gv_stashpv (klass, 1)); 98 return sv_bless (newRV_noinc ((SV *)hv), gv_stashpv (klass, 1));
111} 99}
112 100
113template<class extendable> 101template<class attachable>
114SV * 102SV *
115newSVextendable (extendable *obj, const char *klass) 103newSVattachable (attachable *obj, const char *klass)
116{ 104{
117 if (!obj) 105 if (!obj)
118 return &PL_sv_undef; 106 return &PL_sv_undef;
119 107
120 if (!obj->self) 108 if (!obj->self)
121 obj->self = newSVptr (obj, klass); 109 obj->self = newSVptr (obj, klass);
122 110
123 return newSVsv (static_cast<SV *>(obj->self)); 111 return newSVsv (obj->self);
124} 112}
125 113
126static void 114static void
127SVptr_cache_set (void *ptr, SV *sv) 115SVptr_cache_set (void *ptr, SV *sv)
128{ 116{
227 break; 215 break;
228 216
229 case DT_OBJECT: 217 case DT_OBJECT:
230 { 218 {
231 object *obj = va_arg (ap, object *); 219 object *obj = va_arg (ap, object *);
232 sv = newSVextendable (obj, obj && obj->type == PLAYER ? "cf::object::player::wrap" : "cf::object::wrap"); 220 sv = newSVattachable (obj, obj && obj->type == PLAYER ? "cf::object::player::wrap" : "cf::object::wrap");
233 } 221 }
234 break; 222 break;
235 223
236 case DT_MAP: 224 case DT_MAP:
237 // va_arg (object *) when void * is passed is an XSI extension 225 // va_arg (object *) when void * is passed is an XSI extension
238 sv = newSVextendable (va_arg (ap, mapstruct *), "cf::map::wrap"); 226 sv = newSVattachable (va_arg (ap, mapstruct *), "cf::map::wrap");
239 break; 227 break;
240 228
241 case DT_PLAYER: 229 case DT_PLAYER:
242 sv = newSVextendable (va_arg (ap, player *), "cf::player::wrap"); 230 sv = newSVattachable (va_arg (ap, player *), "cf::player::wrap");
243 break; 231 break;
244 232
245 case DT_ARCH: 233 case DT_ARCH:
246 sv = newSVptr (va_arg (ap, archetype *), "cf::arch::wrap"); 234 sv = newSVptr (va_arg (ap, archetype *), "cf::arch::wrap");
247 break; 235 break;
304} 292}
305 293
306////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 294//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
307 295
308SV * 296SV *
309registry_of (extendable_base *ext) 297registry_of (attachable_base *ext)
310{ 298{
311 if (!ext->cb) 299 if (!ext->cb)
312 ext->cb = newAV (); 300 ext->cb = newAV ();
313 301
314 return newRV_inc ((SV *)ext->cb); 302 return newRV_inc ((SV *)ext->cb);
315} 303}
316 304
317void extendable_base::clear () 305void attachable_base::clear ()
318{ 306{
319 //if (self) fprintf (stderr, "free_ob_self %p %s (%p,%p)\n", this, ((object *)this)->name, self, cb);//D 307 if (self)
308 {
309 if (cb)
310 if (SvROK (*av_fetch (cb, EVENT_OBJECT_DESTROY, 1)))
311 INVOKE_OBJECT (DESTROY, static_cast<object *>(this));
312 else if (SvROK (*av_fetch (cb, EVENT_MAP_DESTROY, 1)))
313 INVOKE_MAP (DESTROY, static_cast<mapstruct *>(this));
320 314
315 // disconnect Perl from C, to avoid crashes
316 sv_unmagic (SvRV ((SV *)self), PERL_MAGIC_ext);
317
318 // clear the perl hash, might or might not be a good idea
319 hv_clear ((HV *)SvRV ((SV *)self));
320
321 if (self) SvREFCNT_dec (self); 321 SvREFCNT_dec (self);
322 self = 0;
323 }
324
325 if (cb)
326 {
322 if (cb) SvREFCNT_dec (cb); 327 SvREFCNT_dec (cb);
328 cb = 0;
329 }
323 330
331 if (attach)
332 {
324 if (attach) free_string (attach); 333 free_string (attach);
325
326 self = 0;
327 cb = 0;
328 attach = 0; 334 attach = 0;
335 }
329} 336}
330 337
331void extendable_base::optimise () 338void attachable_base::optimise ()
332{ 339{
333 if (!self) 340 if (!self)
334 return; 341 return;
335 342
336 HV *hv = (HV *)SvRV ((SV *)self); 343 HV *hv = (HV *)SvRV ((SV *)self);
342 SvREFCNT_dec ((SV *)self); 349 SvREFCNT_dec ((SV *)self);
343 self = 0; 350 self = 0;
344 } 351 }
345} 352}
346 353
347void 354void attachable_base::instantiate (data_type type, void *obj)
348object::instantiate_ ()
349{ 355{
350 dSP; 356 dSP;
351 ENTER; 357 ENTER;
352 SAVETMPS; 358 SAVETMPS;
353 PUSHMARK (SP); 359 PUSHMARK (SP);
354 EXTEND (SP, 2); 360 EXTEND (SP, 2);
355 PUSHs (sv_2mortal (newSVdt (DT_OBJECT, static_cast<object *>(this)))); 361 PUSHs (sv_2mortal (newSVdt (type, obj)));
356 PUSHs (sv_2mortal (newSVpv (attach, 0))); 362 PUSHs (sv_2mortal (newSVpv (attach, 0)));
363
364 free_string (attach);
365 attach = 0;
366
357 PUTBACK; 367 PUTBACK;
358 call_pv ("cf::instantiate", G_DISCARD | G_VOID | G_EVAL); 368 call_pv ("cf::instantiate", G_DISCARD | G_VOID | G_EVAL);
359 FREETMPS; 369 FREETMPS;
360 LEAVE; 370 LEAVE;
371
372 switch (type)
373 {
374 case DT_OBJECT: INVOKE_OBJECT (INSTANTIATE, obj); break;
375 case DT_MAP: INVOKE_MAP (INSTANTIATE, obj); break;
376 }
361} 377}
362 378
363///////////////////////////////////////////////////////////////////////////// 379/////////////////////////////////////////////////////////////////////////////
364 380
365object_freezer::object_freezer (const char *filename)
366: filename (filename)
367{
368 av = (AV *)newAV ();
369 idx = 0;
370 av_extend ((AV *)av, 1024);
371}
372
373object_freezer::~object_freezer ()
374{
375 dSP;
376 ENTER;
377 SAVETMPS;
378 PUSHMARK (SP);
379 XPUSHs (sv_2mortal (newSVpv (filename, 0)));
380 XPUSHs (sv_2mortal (newRV_noinc ((SV *)av)));
381 PUTBACK;
382 call_pv ("cf::object_freezer_save", G_VOID | G_DISCARD | G_EVAL);
383 FREETMPS;
384 LEAVE;
385}
386
387void object_freezer::put (extendable_base *ext)
388{
389 ext->optimise ();
390
391 if (ext->self)
392 av_store ((AV *)av, idx, SvREFCNT_inc ((SV *)ext->self));
393
394 ++idx;
395}
396
397object_thawer::object_thawer (const char *filename)
398{
399 av = 0;
400 idx = 0;
401
402 if (!filename)
403 return;
404
405 dSP;
406 ENTER;
407 SAVETMPS;
408 PUSHMARK (SP);
409 XPUSHs (sv_2mortal (newSVpv (filename, 0)));
410 PUTBACK;
411
412 if (0 < call_pv ("cf::object_thawer_load", G_SCALAR | G_EVAL))
413 {
414 SPAGAIN;
415 SV *sv = POPs;
416 if (SvROK (sv))
417 av = SvREFCNT_inc (SvRV (sv));
418 }
419
420 FREETMPS;
421 LEAVE;
422}
423
424void reattach (data_type type, void *obj) 381void reattach (data_type type, void *obj)
425{ 382{
383 //TODO only do this when the object has _attachment's
384
426 dSP; 385 dSP;
427 ENTER; 386 ENTER;
428 SAVETMPS; 387 SAVETMPS;
429 PUSHMARK (SP); 388 PUSHMARK (SP);
430 XPUSHs (sv_2mortal (newSVdt (type, obj))); 389 XPUSHs (sv_2mortal (newSVdt (type, obj)));
440 case DT_MAP: INVOKE_MAP (REATTACH, obj); break; 399 case DT_MAP: INVOKE_MAP (REATTACH, obj); break;
441 } 400 }
442} 401}
443 402
444template<class subclass> 403template<class subclass>
445void reattach (extendable<subclass> *obj) 404void reattach (attachable<subclass> *obj)
446{ 405{
447 obj->optimise (); 406 obj->optimise ();
448 407
449 if (obj->self) 408 if (obj->self)
450 reattach (subclass::get_dt (), (subclass *)obj); 409 reattach ((data_type) cftype<subclass>::dt, (subclass *)obj);
451} 410}
452 411
412#include "kw_hash.h"
413
414object_freezer::object_freezer ()
415: dynbuf (128 * 1024, 64 * 1024)
416{
417 av = newAV ();
418}
419
420object_freezer::~object_freezer ()
421{
422 SvREFCNT_dec (av);
423}
424
425void object_freezer::put (attachable_base *ext)
426{
427 ext->optimise ();
428
429 if (ext->self)
430 {
431 int idx = AvFILLp ((AV *)av) + 1;
432 av_store (av, idx, SvREFCNT_inc (ext->self));
433
434 add ((void *)"oid ", 4);
435 add ((sint32)idx);
436 add ('\n');
437 }
438}
439
440bool object_freezer::save (const char *filename)
441{
442 dSP;
443 ENTER;
444 SAVETMPS;
445 PUSHMARK (SP);
446 EXTEND (SP, 3);
447 PUSHs (sv_2mortal (newSVpv (filename, 0)));
448 PUSHs (sv_2mortal (newRV_noinc (newSVpvn ((char *)linearise (), size ()))));
449 PUSHs (sv_2mortal (newRV_inc ((SV *)av)));
450 PUTBACK;
451 call_pv ("cf::object_freezer_save", G_VOID | G_DISCARD | G_EVAL);
452 FREETMPS;
453 LEAVE;
454}
455
456int fprintf (object_freezer &freezer, const char *format, ...)
457{
458 va_list ap;
459
460 va_start (ap, format);
461
462 int len = vsnprintf ((char *)freezer.force (1024), 1024, format, ap);
463
464 if (len >= 0)
465 freezer.alloc (len);
466
467 va_end (ap);
468}
469
470int fputs (const char *s, object_freezer &freezer)
471{
472 freezer.add (s);
473}
474
475object_thawer::object_thawer (const char *filename)
476{
477 av = 0;
478 fp = 0;
479
480 if (!filename)
481 return;
482
483 fp = fopen (filename, "r");
484 if (!fp)
485 {
486 LOG (llevError, "object_thawer: unable to open '%s': %s.\n", filename, strerror (errno));
487 return;
488 }
489
490 if (perl_booted)
491 {
492 dSP;
493 ENTER;
494 SAVETMPS;
495 PUSHMARK (SP);
496 XPUSHs (sv_2mortal (newSVpv (filename, 0)));
497 PUTBACK;
498
499 if (0 < call_pv ("cf::object_thawer_load", G_SCALAR | G_EVAL))
500 {
501 SPAGAIN;
502 SV *sv = POPs;
503 if (SvROK (sv))
504 av = (AV *)SvREFCNT_inc (SvRV (sv));
505 }
506
507 FREETMPS;
508 LEAVE;
509 }
510}
511
453void object_thawer::get (data_type type, void *obj, extendable_base *ext) 512void object_thawer::get (data_type type, void *obj, attachable_base *ext, int oid)
454{ 513{
455 if (!av) 514 if (!av || oid < 0) // this is actually an error of sorts
456 return; 515 return;
457 516
458 // we have to "re-instantiate"/reattach to an object, so nuke ext->attach 517 // we have to "re-instantiate"/reattach to an object, so nuke ext->attach
459 ext->clear (); 518 ext->clear ();
460 519
461 SV **svp = av_fetch ((AV *)av, idx, 0); 520 SV **svp = av_fetch ((AV *)av, oid, 0);
462 521
463 ++idx;
464
465 if (!svp)
466 return;
467
468 if (SvROK (*svp)) 522 if (!svp || !SvROK (*svp))
469 { 523 {
470 ext->self = SvREFCNT_inc (*svp); 524 printf ("trying to thaw duplicate or never-issued oid %d, ignoring.\n", oid);
471 sv_magic (SvRV ((SV *)ext->self), 0, PERL_MAGIC_ext, (char *)obj, 0); 525 return;
472
473 reattach (type, obj);
474 } 526 }
527
528 ext->self = *svp; *svp = &PL_sv_undef;
529 sv_magic (SvRV (ext->self), 0, PERL_MAGIC_ext, (char *)obj, 0);
530
531 reattach (type, obj);
475} 532}
476 533
477object_thawer::~object_thawer () 534object_thawer::~object_thawer ()
478{ 535{
479 if (av) 536 if (fp) fclose (fp);
480 SvREFCNT_dec ((SV *)av); 537 if (av) SvREFCNT_dec ((AV *)av);
481} 538}
482 539
540token object_thawer::get_token ()
541{
542#if 0
543 for (;;)
544 {
545 if (!fgets (line, sizeof (line), fp))
546 return token (KW_eof);
547
548 unsigned char *p = (unsigned char *)line;
549
550 while (*p > ' ')
551 p++;
552
553 int len = p - (unsigned char *)line;
554
555 while ((*p - 1) < ' ')
556 p++;
557
558 if (*p)
559 {
560 char *v = p;
561
562 while (*p && *p != '\n')
563 p++;
564
565 *p = 0;
566
567 return token (k, v);
568 }
569 else
570 return token (k);
571 }
572#endif
573}
574
483///////////////////////////////////////////////////////////////////////////// 575/////////////////////////////////////////////////////////////////////////////
484 576
485extern "C" int cfperl_initPlugin (const char *iversion, f_plug_api gethooksptr) 577extern "C" int cfperl_initPlugin (const char *iversion, f_plug_api gethooksptr)
486{ 578{
487 gethook = gethooksptr;
488 printf (PLUGIN_VERSION " init\n");
489
490 return 0; 579 return 0;
491} 580}
492 581
493static CommArray_s rtn_cmd; 582static CommArray_s rtn_cmd;
494 583
574extern "C" int cfperl_postInitPlugin () 663extern "C" int cfperl_postInitPlugin ()
575{ 664{
576 int hooktype = 1; 665 int hooktype = 1;
577 int rtype = 0; 666 int rtype = 0;
578 667
579 printf (PLUGIN_VERSION " post init\n");
580
581 systemDirectory = (void* (*)(int*, ...)) gethook (&rtype, hooktype, "cfapi_system_directory");
582 object_set_property = (void* (*)(int*, ...)) gethook (&rtype, hooktype, "cfapi_object_set_property");
583 map_get_map = (void* (*)(int*, ...)) gethook (&rtype, hooktype, "cfapi_map_get_map");
584 object_insert = (void* (*)(int*, ...)) gethook (&rtype, hooktype, "cfapi_object_insert");
585
586 cf_init_plugin (gethook); 668 cf_init_plugin (gethook);
587 669
588 return 0; 670 return 0;
589} 671}
590 672
594} 676}
595 677
596void 678void
597cfperl_init () 679cfperl_init ()
598{ 680{
681 PERL_SYS_INIT3 (&settings.argc, &settings.argv, 0);
682 perl = perl_alloc ();
683 perl_construct (perl);
684
685 PL_exit_flags |= PERL_EXIT_DESTRUCT_END;
686
599 char *argv[] = { 687 char *argv[] = {
600 "", 688 "",
601 "-e" 689 "-e"
602 "BEGIN {"
603 " cf->bootstrap;" 690 "cf->bootstrap;"
604 " unshift @INC, cf::datadir ();" 691 "unshift @INC, cf::datadir ();"
605 "}"
606 ""
607 "use cf;"
608 }; 692 };
609
610 perl = perl_alloc ();
611 perl_construct (perl);
612
613 PL_exit_flags |= PERL_EXIT_DESTRUCT_END;
614 693
615 if (perl_parse (perl, xs_init, 2, argv, (char **)NULL) || perl_run (perl)) 694 if (perl_parse (perl, xs_init, 2, argv, (char **)NULL) || perl_run (perl))
616 { 695 {
617 printf ("unable to initialize perl-interpreter, aborting.\n"); 696 printf ("unable to initialize perl-interpreter, aborting.\n");
618
619 exit (EXIT_FAILURE); 697 exit (EXIT_FAILURE);
620 //perl_destruct (perl);
621 //perl_free (perl);
622 //perl = 0;
623 //return;
624 } 698 }
625 699
626 obj_cache = newHV (); 700 obj_cache = newHV ();
701}
702
703void cfperl_boot ()
704{
705 perl_booted = true;
706
707 eval_pv ("require cf", 1);
627} 708}
628 709
629void cfperl_main () 710void cfperl_main ()
630{ 711{
631 dSP; 712 dSP;
638static event_klass klass_of[NUM_EVENT_TYPES] = { 719static event_klass klass_of[NUM_EVENT_TYPES] = {
639# define def(type,name) KLASS_ ## type, 720# define def(type,name) KLASS_ ## type,
640# include "eventinc.h" 721# include "eventinc.h"
641# undef def 722# undef def
642}; 723};
724
725#define KLASS_OF(event) (((unsigned int)event) < NUM_EVENT_TYPES ? klass_of [event] : KLASS_NONE)
643 726
644static void 727static void
645gather_callbacks (AV *&callbacks, AV *registry, event_type event) 728gather_callbacks (AV *&callbacks, AV *registry, event_type event)
646{ 729{
647 // event must be in array 730 // event must be in array
690 // 2a. per-type callback 773 // 2a. per-type callback
691 // 4. global callbacks 774 // 4. global callbacks
692 775
693 gather_callbacks (callbacks, cb_global, event); 776 gather_callbacks (callbacks, cb_global, event);
694 777
695 switch (klass_of [event]) 778 switch (KLASS_OF (event))
696 { 779 {
697 case KLASS_GLOBAL: 780 case KLASS_GLOBAL:
698 break; 781 break;
699 782
700 case KLASS_OBJECT: 783 case KLASS_OBJECT:
701 dt = (data_type) va_arg (ap, int); 784 dt = (data_type) va_arg (ap, int);
702 assert (("first argument must be of type object", dt == DT_OBJECT)); 785 assert (("first argument must be of type object", dt == DT_OBJECT));
703 op = va_arg (ap, object *); 786 op = va_arg (ap, object *);
704 787
705 if (op->cb) 788 if (op->cb)
706 gather_callbacks (callbacks, (AV *)op->cb, event); 789 gather_callbacks (callbacks, op->cb, event);
707 790
708 if (op->type) 791 if (op->type)
709 { 792 {
710 if (op->subtype && op->type + op->subtype * NUM_SUBTYPES <= AvFILLp (cb_type)) 793 if (op->subtype && op->type + op->subtype * NUM_SUBTYPES <= AvFILLp (cb_type))
711 { 794 {
732 dt = (data_type) va_arg (ap, int); 815 dt = (data_type) va_arg (ap, int);
733 assert (("first argument must be of type player", dt == DT_PLAYER)); 816 assert (("first argument must be of type player", dt == DT_PLAYER));
734 pl = va_arg (ap, player *); 817 pl = va_arg (ap, player *);
735 818
736 if (pl->cb) 819 if (pl->cb)
737 gather_callbacks (callbacks, (AV *)pl->cb, event); 820 gather_callbacks (callbacks, pl->cb, event);
738 821
739 gather_callbacks (callbacks, cb_player, event); 822 gather_callbacks (callbacks, cb_player, event);
740 break; 823 break;
741 824
742 case KLASS_MAP: 825 case KLASS_MAP:
743 dt = (data_type) va_arg (ap, int); 826 dt = (data_type) va_arg (ap, int);
744 assert (("first argument must be of type object", dt == DT_MAP)); 827 assert (("first argument must be of type object", dt == DT_MAP));
745 map = va_arg (ap, mapstruct *); 828 map = va_arg (ap, mapstruct *);
746 829
747 if (map->cb) 830 if (map->cb)
748 gather_callbacks (callbacks, (AV *)map->cb, event); 831 gather_callbacks (callbacks, map->cb, event);
749 832
750 gather_callbacks (callbacks, cb_map, event); 833 gather_callbacks (callbacks, cb_map, event);
751 break; 834 break;
752 835
753 default: 836 default:
766 EXTEND (SP, 3); 849 EXTEND (SP, 3);
767 850
768 PUSHs (sv_2mortal (newSViv (event))); // only used for debugging nowadays 851 PUSHs (sv_2mortal (newSViv (event))); // only used for debugging nowadays
769 PUSHs (sv_2mortal (newRV_noinc ((SV *)callbacks))); 852 PUSHs (sv_2mortal (newRV_noinc ((SV *)callbacks)));
770 853
771 switch (klass_of [event]) 854 switch (KLASS_OF (event))
772 { 855 {
773 case KLASS_OBJECT: PUSHs (sv_2mortal (newSVdt (DT_OBJECT, op))); break; 856 case KLASS_OBJECT: PUSHs (sv_2mortal (newSVdt (DT_OBJECT, op))); break;
774 case KLASS_PLAYER: PUSHs (sv_2mortal (newSVdt (DT_PLAYER, pl))); break; 857 case KLASS_PLAYER: PUSHs (sv_2mortal (newSVdt (DT_PLAYER, pl))); break;
775 case KLASS_MAP: PUSHs (sv_2mortal (newSVdt (DT_MAP, map))); break; 858 case KLASS_MAP: PUSHs (sv_2mortal (newSVdt (DT_MAP, map))); break;
776 } 859 }
1205 1288
1206 const_iv (SK_EXP_ADD_SKILL) 1289 const_iv (SK_EXP_ADD_SKILL)
1207 const_iv (SK_EXP_TOTAL) 1290 const_iv (SK_EXP_TOTAL)
1208 const_iv (SK_EXP_NONE) 1291 const_iv (SK_EXP_NONE)
1209 const_iv (SK_SUBTRACT_SKILL_EXP) 1292 const_iv (SK_SUBTRACT_SKILL_EXP)
1293 const_iv (SK_EXP_SKILL_ONLY)
1210 1294
1211 const_iv (SK_LOCKPICKING) 1295 const_iv (SK_LOCKPICKING)
1212 const_iv (SK_HIDING) 1296 const_iv (SK_HIDING)
1213 const_iv (SK_SMITHERY) 1297 const_iv (SK_SMITHERY)
1214 const_iv (SK_BOWYER) 1298 const_iv (SK_BOWYER)
1373 prop (CFAPI_INT, MAP_PROP_WINDDIR) 1457 prop (CFAPI_INT, MAP_PROP_WINDDIR)
1374 prop (CFAPI_INT, MAP_PROP_SKY) 1458 prop (CFAPI_INT, MAP_PROP_SKY)
1375 prop (CFAPI_INT, MAP_PROP_WPARTX) 1459 prop (CFAPI_INT, MAP_PROP_WPARTX)
1376 prop (CFAPI_INT, MAP_PROP_WPARTY) 1460 prop (CFAPI_INT, MAP_PROP_WPARTY)
1377 prop (CFAPI_STRING, MAP_PROP_MESSAGE) 1461 prop (CFAPI_STRING, MAP_PROP_MESSAGE)
1378 prop (CFAPI_PMAP, MAP_PROP_NEXT)
1379 prop (CFAPI_PREGION, MAP_PROP_REGION) 1462 prop (CFAPI_PREGION, MAP_PROP_REGION)
1380 prop (CFAPI_POBJECT, OBJECT_PROP_OB_ABOVE)
1381 prop (CFAPI_POBJECT, OBJECT_PROP_OB_BELOW)
1382 prop (CFAPI_POBJECT, OBJECT_PROP_NEXT_ACTIVE_OB) 1463 prop (CFAPI_POBJECT, OBJECT_PROP_NEXT_ACTIVE_OB)
1383 prop (CFAPI_POBJECT, OBJECT_PROP_PREV_ACTIVE_OB) 1464 prop (CFAPI_POBJECT, OBJECT_PROP_PREV_ACTIVE_OB)
1384 prop (CFAPI_POBJECT, OBJECT_PROP_INVENTORY) 1465 prop (CFAPI_POBJECT, OBJECT_PROP_INVENTORY)
1385 prop (CFAPI_POBJECT, OBJECT_PROP_ENVIRONMENT) 1466 prop (CFAPI_POBJECT, OBJECT_PROP_ENVIRONMENT)
1386 prop (CFAPI_POBJECT, OBJECT_PROP_HEAD)
1387 prop (CFAPI_POBJECT, OBJECT_PROP_CONTAINER) 1467 prop (CFAPI_POBJECT, OBJECT_PROP_CONTAINER)
1388 prop (CFAPI_PMAP, OBJECT_PROP_MAP) 1468 prop (CFAPI_PMAP, OBJECT_PROP_MAP)
1389 prop (CFAPI_INT, OBJECT_PROP_COUNT) 1469 prop (CFAPI_INT, OBJECT_PROP_COUNT)
1390 prop (CFAPI_INT, OBJECT_PROP_REFCOUNT) 1470 prop (CFAPI_INT, OBJECT_PROP_REFCOUNT)
1391 prop (CFAPI_STRING, OBJECT_PROP_NAME) 1471 prop (CFAPI_STRING, OBJECT_PROP_NAME)
1523 PROTOTYPE: $$ 1603 PROTOTYPE: $$
1524 1604
1525char *path_combine_and_normalize (char *base, char *path) 1605char *path_combine_and_normalize (char *base, char *path)
1526 PROTOTYPE: $$ 1606 PROTOTYPE: $$
1527 1607
1528char * 1608const char *
1529cf_get_maps_directory (char *path) 1609get_maps_directory (char *path)
1530 PROTOTYPE: $ 1610 PROTOTYPE: $
1531 ALIAS: maps_directory = 0 1611 ALIAS: maps_directory = 0
1612 CODE:
1613 RETVAL = create_pathname (path);
1614 OUTPUT: RETVAL
1532 1615
1533void 1616void
1534sub_generation_inc () 1617sub_generation_inc ()
1535 CODE: 1618 CODE:
1536 PL_sub_generation++; 1619 PL_sub_generation++;
1545 confdir = 3 1628 confdir = 3
1546 localdir = 4 1629 localdir = 4
1547 playerdir = 5 1630 playerdir = 5
1548 datadir = 6 1631 datadir = 6
1549 CODE: 1632 CODE:
1550{ 1633 switch (ix)
1551 int unused_type; 1634 {
1552 RETVAL = (char *)systemDirectory (&unused_type, ix); 1635 case 0: RETVAL = settings.mapdir ; break;
1553} 1636 case 1: RETVAL = settings.uniquedir; break;
1637 case 2: RETVAL = settings.tmpdir ; break;
1638 case 3: RETVAL = settings.confdir ; break;
1639 case 4: RETVAL = settings.localdir ; break;
1640 case 5: RETVAL = settings.playerdir; break;
1641 case 6: RETVAL = settings.datadir ; break;
1642 }
1554 OUTPUT: RETVAL 1643 OUTPUT: RETVAL
1555 1644
1556int 1645int
1557cf_find_animation (char *text) 1646cf_find_animation (char *text)
1558 PROTOTYPE: $ 1647 PROTOTYPE: $
1559 1648
1560int random_roll(int min, int max, object *op, int goodbad); 1649int random_roll(int min, int max, object *op, int goodbad);
1561 1650
1562const char *cost_string_from_value(uint64 cost, int approx = 0) 1651const char *cost_string_from_value(uint64 cost, int approx = 0)
1563 1652
1564int invoke (int event, SV *arg1, ...) 1653int invoke (int event, ...)
1565 CODE: 1654 CODE:
1566{ 1655 if (KLASS_OF (event) != KLASS_GLOBAL) croak ("event class must be GLOBAL");
1567 // parse first arg and call invoke_object etc as seen fit 1656 AV *av = (AV *)sv_2mortal ((SV *)newAV ());
1568 //TODO 1657 for (int i = 1; i < items; i++) av_push (av, SvREFCNT_inc (ST (i)));
1569 //cfperl_invoke (event, 1658 RETVAL = INVOKE_((event_type)event, ARG_AV (av));
1570} 1659 OUTPUT: RETVAL
1571 1660
1572int 1661int
1573exp_to_level (val64 exp) 1662exp_to_level (val64 exp)
1574 CODE: 1663 CODE:
1575{ 1664{
1606 RETVAL = newSVpv (resist_plus[atnr], 0); 1695 RETVAL = newSVpv (resist_plus[atnr], 0);
1607 else 1696 else
1608 XSRETURN_UNDEF; 1697 XSRETURN_UNDEF;
1609 OUTPUT: RETVAL 1698 OUTPUT: RETVAL
1610 1699
1700int
1701_valid (SV *obj)
1702 CODE:
1703 RETVAL = SvROK (obj) && mg_find (SvRV (obj), PERL_MAGIC_ext);
1704 OUTPUT:
1705 RETVAL
1706
1611MODULE = cf PACKAGE = cf::object PREFIX = cf_object_ 1707MODULE = cf PACKAGE = cf::object PREFIX = cf_object_
1708
1709int invoke (object *op, int event, ...)
1710 CODE:
1711 if (KLASS_OF (event) != KLASS_OBJECT) croak ("event class must be OBJECT");
1712 AV *av = (AV *)sv_2mortal ((SV *)newAV ());
1713 for (int i = 2; i < items; i++) av_push (av, SvREFCNT_inc (ST (i)));
1714 RETVAL = INVOKE_((event_type)event, ARG_OBJECT (op), ARG_AV (av));
1715 OUTPUT: RETVAL
1716
1717SV *registry (object *op)
1718 CODE:
1719 RETVAL = registry_of (op);
1720 OUTPUT:
1721 RETVAL
1722
1723object *head (object *op)
1724 PROTOTYPE: $
1725 ALIAS:
1726 more = 1
1727 above = 2
1728 below = 3
1729 CODE:
1730 switch (ix)
1731 {
1732 case 0: RETVAL = op->head ? op->head : op; break; // DOH!
1733 case 1: RETVAL = op->more; break;
1734 case 2: RETVAL = op->above; break;
1735 case 3: RETVAL = op->below; break;
1736 }
1737 OUTPUT:
1738 RETVAL
1612 1739
1613SV * 1740SV *
1614get_property (object *obj, int type, int idx) 1741get_property (object *obj, int type, int idx)
1615 CODE: 1742 CODE:
1616 RETVAL = newSVcfapi (type, cf_object_get_property (obj, idx)); 1743 RETVAL = newSVcfapi (type, cf_object_get_property (obj, idx));
1695 1822
1696int need_identify (const object *obj); 1823int need_identify (const object *obj);
1697 1824
1698int apply_shop_mat (object *shop_mat, object *op); 1825int apply_shop_mat (object *shop_mat, object *op);
1699 1826
1700void cf_object_move (object *op, int dir, object *originator = op) 1827int move (object *op, int dir, object *originator = op)
1828 CODE:
1829 RETVAL = move_ob (op, dir, originator);
1830 OUTPUT:
1831 RETVAL
1701 1832
1702void cf_object_apply (object *op, object *author, int flags = 0) 1833void cf_object_apply (object *op, object *author, int flags = 0)
1703 1834
1704void cf_object_apply_below (object *op) 1835void cf_object_apply_below (object *op)
1705 1836
1746int cf_object_out_of_map (object *op, int x, int y) 1877int cf_object_out_of_map (object *op, int x, int y)
1747 1878
1748void cf_object_drop (object *op, object *author) 1879void cf_object_drop (object *op, object *author)
1749 1880
1750void cf_object_take (object *op, object *author) 1881void cf_object_take (object *op, object *author)
1751
1752void cf_object_say (object *op, char *msg)
1753
1754void cf_object_speak (object *op, char *msg)
1755 1882
1756object *cf_object_insert_object (object *op, object *container) 1883object *cf_object_insert_object (object *op, object *container)
1757 1884
1758const char *cf_object_get_msg (object *ob) 1885const char *cf_object_get_msg (object *ob)
1759 ALIAS: msg = 0 1886 ALIAS: msg = 0
1813 CODE: 1940 CODE:
1814{ 1941{
1815 int unused_type; 1942 int unused_type;
1816 RETVAL = (object *)object_insert (&unused_type, ob, 0, where, orig, flag, x, y); 1943 RETVAL = (object *)object_insert (&unused_type, ob, 0, where, orig, flag, x, y);
1817} 1944}
1818
1819SV *registry (object *op)
1820 CODE:
1821 RETVAL = registry_of (op);
1822 OUTPUT:
1823 RETVAL
1824 1945
1825# syntatic sugar for easier use in event callbacks. 1946# syntatic sugar for easier use in event callbacks.
1826const char *options (object *op) 1947const char *options (object *op)
1827 CODE: 1948 CODE:
1828 RETVAL = op->name; 1949 RETVAL = op->name;
1901 2022
1902void kill_player (object *op) 2023void kill_player (object *op)
1903 2024
1904MODULE = cf PACKAGE = cf::player PREFIX = cf_player_ 2025MODULE = cf PACKAGE = cf::player PREFIX = cf_player_
1905 2026
2027int invoke (player *pl, int event, ...)
2028 CODE:
2029 if (KLASS_OF (event) != KLASS_PLAYER) croak ("event class must be PLAYER");
2030 AV *av = (AV *)sv_2mortal ((SV *)newAV ());
2031 for (int i = 2; i < items; i++) av_push (av, SvREFCNT_inc (ST (i)));
2032 RETVAL = INVOKE_((event_type)event, ARG_PLAYER (pl), ARG_AV (av));
2033 OUTPUT: RETVAL
2034
1906SV *registry (player *pl) 2035SV *registry (player *pl)
1907 CODE: 2036 CODE:
1908 RETVAL = registry_of (pl); 2037 RETVAL = registry_of (pl);
1909 OUTPUT: 2038 OUTPUT:
1910 RETVAL 2039 RETVAL
2034 OUTPUT: RETVAL 2163 OUTPUT: RETVAL
2035 2164
2036 2165
2037MODULE = cf PACKAGE = cf::map PREFIX = cf_map_ 2166MODULE = cf PACKAGE = cf::map PREFIX = cf_map_
2038 2167
2168mapstruct *first ()
2169 PROTOTYPE:
2170 CODE:
2171 RETVAL = first_map;
2172 OUTPUT: RETVAL
2173
2174mapstruct *next (mapstruct *map)
2175 PROTOTYPE:
2176 CODE:
2177 RETVAL = map->next;
2178 OUTPUT: RETVAL
2179
2180int invoke (mapstruct *map, int event, ...)
2181 CODE:
2182 if (KLASS_OF (event) != KLASS_MAP) croak ("event class must be MAP");
2183 AV *av = (AV *)sv_2mortal ((SV *)newAV ());
2184 for (int i = 2; i < items; i++) av_push (av, SvREFCNT_inc (ST (i)));
2185 RETVAL = INVOKE_((event_type)event, ARG_MAP (map), ARG_AV (av));
2186 OUTPUT: RETVAL
2187
2039SV *registry (mapstruct *map) 2188SV *registry (mapstruct *map)
2040 CODE: 2189 CODE:
2041 RETVAL = registry_of (map); 2190 RETVAL = registry_of (map);
2042 OUTPUT: 2191 OUTPUT:
2043 RETVAL 2192 RETVAL
2062 2211
2063mapstruct *new (int width, int height) 2212mapstruct *new (int width, int height)
2064 PROTOTYPE: 2213 PROTOTYPE:
2065 CODE: 2214 CODE:
2066{ 2215{
2067 int unused_type; 2216 RETVAL = get_empty_map (width, height);
2068 RETVAL = (mapstruct*) map_get_map (&unused_type, 0, width, height);
2069} 2217}
2070 OUTPUT: 2218 OUTPUT:
2071 RETVAL 2219 RETVAL
2072 2220
2073void delete_map (mapstruct *map) 2221void delete_map (mapstruct *map)
2088 XSRETURN_UNDEF; 2236 XSRETURN_UNDEF;
2089 RETVAL = map->tile_path [dir]; 2237 RETVAL = map->tile_path [dir];
2090 OUTPUT: 2238 OUTPUT:
2091 RETVAL 2239 RETVAL
2092 2240
2093mapstruct *cf_map_get_map (char *name) 2241mapstruct *ready_map_name (char *name, int flags = 0)
2094 PROTOTYPE: $ 2242 PROTOTYPE: $;$
2095 ALIAS: map = 0 2243 ALIAS:
2244 find = 0
2245 get_map = 1
2096 2246
2097mapstruct *has_been_loaded (char *name) 2247mapstruct *has_been_loaded (char *name)
2098 PROTOTYPE: $ 2248 PROTOTYPE: $
2099
2100mapstruct *cf_map_get_first ()
2101 PROTOTYPE:
2102 ALIAS: first = 0
2103 2249
2104# whoever "designed" the plug-in api should have wasted 2250# whoever "designed" the plug-in api should have wasted
2105# his/her time with staying away from the project - would have 2251# his/her time with staying away from the project - would have
2106# saved others a lot of time, without doubt. 2252# saved others a lot of time, without doubt.
2107void set_path (mapstruct *where, char *path) 2253void set_path (mapstruct *where, char *path)
2122 2268
2123void set_unique (mapstruct *map, bool unique) 2269void set_unique (mapstruct *map, bool unique)
2124 CODE: 2270 CODE:
2125 map->unique = unique; 2271 map->unique = unique;
2126 2272
2273void
2274trigger (mapstruct *map, long connection, bool state = true)
2275 CODE:
2276 activate_connection (map, connection, state);
2277
2278void
2279get_connection (mapstruct *map, long connection)
2280 PPCODE:
2281 oblinkpt *obp = get_connection_links (map, connection);
2282 if (obp)
2283 for (objectlink *ol = obp->link; ol; ol = ol->next)
2284 XPUSHs (sv_2mortal (newSVcfapi (CFAPI_POBJECT, ol->ob)));
2285
2127object *cf_map_insert_object_there (mapstruct *where, object *op, object *originator, int flags) 2286object *cf_map_insert_object_there (mapstruct *where, object *op, object *originator, int flags)
2128 2287
2129object *cf_map_insert_object (mapstruct *where, object* op, int x, int y) 2288object *cf_map_insert_object (mapstruct *where, object* op, int x, int y)
2130 2289
2131object* cf_map_present_arch_by_name (mapstruct *map, const char* str, int nx, int ny) 2290object* cf_map_present_arch_by_name (mapstruct *map, const char* str, int nx, int ny)
2135cf_map_normalise (mapstruct *map, int x, int y) 2294cf_map_normalise (mapstruct *map, int x, int y)
2136 PPCODE: 2295 PPCODE:
2137{ 2296{
2138 mapstruct *nmap = 0; 2297 mapstruct *nmap = 0;
2139 I16 nx = 0, ny = 0; 2298 I16 nx = 0, ny = 0;
2140 int flags = cf_map_get_flags (map, &nmap, x, y, &nx, &ny); 2299 int flags = get_map_flags (map, &nmap, x, y, &nx, &ny);
2141 2300
2142 EXTEND (SP, 4); 2301 EXTEND (SP, 4);
2143 PUSHs (sv_2mortal (newSViv (flags))); 2302 PUSHs (sv_2mortal (newSViv (flags)));
2144 2303
2145 if (GIMME_V == G_ARRAY) 2304 if (GIMME_V == G_ARRAY)
2157{ 2316{
2158 object *o; 2317 object *o;
2159 mapstruct *nmap = 0; 2318 mapstruct *nmap = 0;
2160 I16 nx, ny; 2319 I16 nx, ny;
2161 2320
2162 cf_map_get_flags (map, &nmap, x, y, &nx, &ny); 2321 get_map_flags (map, &nmap, x, y, &nx, &ny);
2163 2322
2164 if (nmap) 2323 if (nmap)
2165 for (o = GET_MAP_OB (nmap, nx, ny); o; o = o->above) 2324 for (o = GET_MAP_OB (nmap, nx, ny); o; o = o->above)
2166 XPUSHs (sv_2mortal (newSVcfapi (CFAPI_POBJECT, o))); 2325 XPUSHs (sv_2mortal (newSVcfapi (CFAPI_POBJECT, o)));
2167} 2326}
2192 case 7: RETVAL = newSVuv ( GET_MAP_MOVE_OFF (obj, x, y)); break; 2351 case 7: RETVAL = newSVuv ( GET_MAP_MOVE_OFF (obj, x, y)); break;
2193 } 2352 }
2194 OUTPUT: 2353 OUTPUT:
2195 RETVAL 2354 RETVAL
2196 2355
2197# "deserialise" perl map data into the map # TODO# compatibility cruft, remove
2198void
2199_set_obs (mapstruct *map, SV *sv)
2200 CODE:
2201{
2202 object *o;
2203 AV *av;
2204 int x, y;
2205 AV *obs = (AV *)SvRV (sv);
2206 2356
2207 for (y = 0; y < MAP_HEIGHT (map); y++) 2357MODULE = cf PACKAGE = cf::arch
2208 for (x = 0; x < MAP_WIDTH (map); x++)
2209 {
2210 sv = *av_fetch (obs, x + y * MAP_HEIGHT (map), 1);
2211 2358
2212 if (!SvROK (sv)) 2359archetype *find (const char *name)
2213 continue; 2360 CODE:
2361 RETVAL = find_archetype (name);
2362 OUTPUT:
2363 RETVAL
2214 2364
2215 av = (AV *)SvRV (sv); 2365archetype *first()
2216
2217 for (o = GET_MAP_OB (map, x, y); o; o = o->above)
2218 {
2219 sv = av_shift (av);
2220
2221 if (SvROK (sv))
2222 {
2223 sv_magic ((SV *)SvRV (sv), 0, PERL_MAGIC_ext, (char *)o, 0);
2224 SVptr_cache_set (o, sv);
2225 }
2226 }
2227 }
2228}
2229
2230
2231MODULE = cf PACKAGE = cf::arch PREFIX = cf_archetype_
2232
2233archetype *cf_archetype_get_first()
2234 PROTOTYPE: 2366 PROTOTYPE:
2235 ALIAS: first = 0 2367 CODE:
2368 RETVAL = first_archetype;
2369 OUTPUT: RETVAL
2236 2370
2237archetype *cf_archetype_get_next (archetype *arch) 2371archetype *next (archetype *arch)
2238 ALIAS: next = 0 2372 CODE:
2373 RETVAL = arch->next;
2374 OUTPUT: RETVAL
2239 2375
2240archetype *cf_archetype_get_head (archetype *arch) 2376archetype *head (archetype *arch)
2241 ALIAS: head = 0 2377 CODE:
2378 RETVAL = arch->head;
2379 OUTPUT: RETVAL
2242 2380
2243archetype *cf_archetype_get_more (archetype *arch) 2381archetype *more (archetype *arch)
2244 ALIAS: more = 0 2382 CODE:
2383 RETVAL = arch->more;
2384 OUTPUT: RETVAL
2245 2385
2246const char *cf_archetype_get_name (archetype *arch) 2386const char *name (archetype *arch)
2247 ALIAS: name = 0 2387 CODE:
2388 RETVAL = arch->name;
2389 OUTPUT: RETVAL
2248 2390
2249object *cf_archetype_get_clone (archetype *arch) 2391object *clone (archetype *arch)
2250 ALIAS: clone = 0 2392 CODE:
2393 RETVAL = &arch->clone;
2394 OUTPUT: RETVAL
2251 2395
2252MODULE = cf PACKAGE = cf::party PREFIX = cf_party_ 2396MODULE = cf PACKAGE = cf::party
2253 2397
2254partylist *cf_party_get_first () 2398partylist *first ()
2255 PROTOTYPE: 2399 PROTOTYPE:
2256 ALIAS: first = 0 2400 CODE:
2401 RETVAL = get_firstparty ();
2402 OUTPUT: RETVAL
2257 2403
2258partylist *cf_party_get_next (partylist *party) 2404partylist *next (partylist *party)
2259 ALIAS: next = 0 2405 CODE:
2406 RETVAL = party->next;
2407 OUTPUT: RETVAL
2260 2408
2261const char *cf_party_get_name (partylist *party) 2409const char *name (partylist *party)
2410 CODE:
2411 RETVAL = party->partyname;
2412 OUTPUT: RETVAL
2262 2413
2263const char *cf_party_get_password (partylist *party) 2414const char *password (partylist *party)
2264 ALIAS: password = 0 2415 CODE:
2416 RETVAL = party->passwd;
2417 OUTPUT: RETVAL
2265 2418
2266player *cf_party_get_first_player (partylist *party) 2419MODULE = cf PACKAGE = cf::region
2267 ALIAS: first_player = 0
2268 2420
2269player *cf_party_get_next_player (partylist *party, player *op) 2421region *first ()
2270 ALIAS: next_player = 0
2271
2272
2273MODULE = cf PACKAGE = cf::region PREFIX = cf_region_
2274
2275region *cf_region_get_first ()
2276 PROTOTYPE: 2422 PROTOTYPE:
2277 ALIAS: first = 0 2423 CODE:
2424 RETVAL = first_region;
2425 OUTPUT: RETVAL
2278 2426
2427region *next (region *reg)
2428 CODE:
2429 RETVAL = reg->next;
2430 OUTPUT: RETVAL
2431
2432const char *name (region *reg)
2433 CODE:
2434 RETVAL = reg->name;
2435 OUTPUT: RETVAL
2436
2437region *parent (region *reg)
2438 CODE:
2439 RETVAL = reg->parent;
2440 OUTPUT: RETVAL
2441
2279const char *cf_region_get_name (region *reg) 2442const char *longname (region *reg)
2280 ALIAS: name = 0 2443 CODE:
2444 RETVAL = reg->longname;
2445 OUTPUT: RETVAL
2281 2446
2282region *cf_region_get_next (region *reg) 2447const char *msg (region *reg)
2283 ALIAS: next = 0 2448 CODE:
2449 RETVAL = reg->msg;
2450 OUTPUT: RETVAL
2284 2451
2285region *cf_region_get_parent (region *reg) 2452MODULE = cf PACKAGE = cf::living
2286 ALIAS: parent = 0
2287
2288const char *cf_region_get_longname (region *reg)
2289 ALIAS: longname = 0
2290
2291const char *cf_region_get_message (region *reg)
2292 ALIAS: message = 0
2293
2294
2295MODULE = cf PACKAGE = cf::living PREFIX = cf_living_
2296 2453
2297val64 2454val64
2298exp (living *liv, val64 new_val = 0) 2455exp (living *liv, val64 new_val = 0)
2299 PROTOTYPE: $;$ 2456 PROTOTYPE: $;$
2300 ALIAS: 2457 ALIAS:

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines