… | |
… | |
21 | * The authors can be reached via e-mail to <support@deliantra.net> |
21 | * The authors can be reached via e-mail to <support@deliantra.net> |
22 | */ |
22 | */ |
23 | |
23 | |
24 | #include "autoconf.h" |
24 | #include "autoconf.h" |
25 | |
25 | |
26 | #define PLUGIN_NAME "perl" |
|
|
27 | #define PLUGIN_VERSION "cfperl 0.5" |
|
|
28 | |
|
|
29 | #if HAVE_EXECINFO_H |
26 | #if HAVE_EXECINFO_H |
30 | # include <execinfo.h> |
27 | # include <execinfo.h> |
31 | #endif |
28 | #endif |
32 | |
29 | |
33 | #include <cstdarg> |
30 | #include <cstdarg> |
|
|
31 | #include <typeinfo> |
34 | |
32 | |
35 | #include "global.h" |
33 | #include "global.h" |
36 | #include "loader.h" |
34 | #include "loader.h" |
37 | #include "../random_maps/random_map.h" |
35 | #include "../random_maps/random_map.h" |
38 | #include "evthread.h" |
36 | #include "evthread.h" |
… | |
… | |
45 | |
43 | |
46 | #if HAVE_MALLOC_H |
44 | #if HAVE_MALLOC_H |
47 | # include <malloc.h> |
45 | # include <malloc.h> |
48 | #endif |
46 | #endif |
49 | |
47 | |
|
|
48 | #if !__GLIBC__ |
|
|
49 | # define malloc_trim(pad) -1 |
|
|
50 | #endif |
|
|
51 | |
50 | #include <EXTERN.h> |
52 | #include <EXTERN.h> |
51 | #include <perl.h> |
53 | #include <perl.h> |
52 | #include <XSUB.h> |
54 | #include <XSUB.h> |
53 | |
55 | |
54 | #include "CoroAPI.h" |
56 | #include "CoroAPI.h" |
… | |
… | |
58 | |
60 | |
59 | typedef object_thawer &object_thawer_ref; |
61 | typedef object_thawer &object_thawer_ref; |
60 | typedef object_freezer &object_freezer_ref; |
62 | typedef object_freezer &object_freezer_ref; |
61 | |
63 | |
62 | typedef std::string std__string; |
64 | typedef std::string std__string; |
63 | |
|
|
64 | #if IVSIZE >= 8 |
|
|
65 | typedef IV val64; |
|
|
66 | # define newSVval64 newSViv |
|
|
67 | # define SvVAL64 SvIV |
|
|
68 | #else |
|
|
69 | typedef double val64; |
|
|
70 | # define newSVval64 newSVnv |
|
|
71 | # define SvVAL64 SvNV |
|
|
72 | #endif |
|
|
73 | |
65 | |
74 | static PerlInterpreter *perl; |
66 | static PerlInterpreter *perl; |
75 | |
67 | |
76 | tstamp NOW, runtime; |
68 | tstamp NOW, runtime; |
77 | |
69 | |
… | |
… | |
89 | *stash_cf, |
81 | *stash_cf, |
90 | *stash_cf_object_wrap, |
82 | *stash_cf_object_wrap, |
91 | *stash_cf_object_player_wrap, |
83 | *stash_cf_object_player_wrap, |
92 | *stash_cf_player_wrap, |
84 | *stash_cf_player_wrap, |
93 | *stash_cf_map_wrap, |
85 | *stash_cf_map_wrap, |
|
|
86 | *stash_cf_mapspace_wrap, |
94 | *stash_cf_client_wrap, |
87 | *stash_cf_client_wrap, |
95 | *stash_cf_arch_wrap, |
88 | *stash_cf_arch_wrap, |
96 | *stash_cf_party_wrap, |
89 | *stash_cf_party_wrap, |
97 | *stash_cf_region_wrap, |
90 | *stash_cf_region_wrap, |
98 | *stash_cf_living_wrap; |
91 | *stash_cf_living_wrap; |
… | |
… | |
437 | inline SV *to_sv (maptile * v) { return newSVattachable (v, stash_cf_map_wrap); } |
430 | inline SV *to_sv (maptile * v) { return newSVattachable (v, stash_cf_map_wrap); } |
438 | inline SV *to_sv (archetype * v) { return newSVattachable (v, stash_cf_arch_wrap); } |
431 | inline SV *to_sv (archetype * v) { return newSVattachable (v, stash_cf_arch_wrap); } |
439 | inline SV *to_sv (region * v) { return newSVattachable (v, stash_cf_region_wrap); } |
432 | inline SV *to_sv (region * v) { return newSVattachable (v, stash_cf_region_wrap); } |
440 | inline SV *to_sv (partylist * v) { return newSVptr (v, stash_cf_party_wrap); } |
433 | inline SV *to_sv (partylist * v) { return newSVptr (v, stash_cf_party_wrap); } |
441 | inline SV *to_sv (living * v) { return newSVptr (v, stash_cf_living_wrap); } |
434 | inline SV *to_sv (living * v) { return newSVptr (v, stash_cf_living_wrap); } |
|
|
435 | inline SV *to_sv (mapspace * v) { return newSVptr (v, stash_cf_mapspace_wrap); } |
442 | |
436 | |
443 | inline SV *to_sv (object & v) { return to_sv (&v); } |
437 | inline SV *to_sv (object & v) { return to_sv (&v); } |
444 | inline SV *to_sv (living & v) { return to_sv (&v); } |
438 | inline SV *to_sv (living & v) { return to_sv (&v); } |
445 | |
439 | |
446 | inline SV *to_sv (const std::string & v) { return newSVpvn (v.data (), v.size ()); } |
440 | inline SV *to_sv (const std::string & v) { return newSVpvn (v.data (), v.size ()); } |
447 | inline SV *to_sv (const treasurelist *v) { return to_sv (v->name); } |
441 | inline SV *to_sv (const treasurelist *v) { return to_sv (v->name); } |
448 | |
442 | |
449 | inline SV *to_sv (UUID v) |
443 | inline SV *to_sv (UUID v) { return newSVpv (v.c_str (), 0); } |
450 | { |
|
|
451 | char buf[128]; |
|
|
452 | snprintf (buf, 128, "<1.%" PRIx64 ">", v.seq); |
|
|
453 | return newSVpv (buf, 0); |
|
|
454 | } |
|
|
455 | |
444 | |
456 | inline void sv_to (SV *sv, shstr &v) { v = SvOK (sv) ? SvPVutf8_nolen (sv) : 0; } |
445 | inline void sv_to (SV *sv, shstr &v) { v = SvOK (sv) ? SvPVutf8_nolen (sv) : 0; } |
457 | inline void sv_to (SV *sv, char * &v) { free (v); v = SvOK (sv) ? strdup (SvPV_nolen (sv)) : 0; } |
446 | inline void sv_to (SV *sv, char * &v) { free (v); v = SvOK (sv) ? strdup (SvPV_nolen (sv)) : 0; } |
458 | inline void sv_to (SV *sv, bool &v) { v = SvIV (sv); } |
447 | inline void sv_to (SV *sv, bool &v) { v = SvIV (sv); } |
459 | inline void sv_to (SV *sv, signed char &v) { v = SvIV (sv); } |
448 | inline void sv_to (SV *sv, signed char &v) { v = SvIV (sv); } |
… | |
… | |
475 | inline void sv_to (SV *sv, maptile * &v) { v = (maptile *)(attachable *)SvPTR_ornull (sv, "cf::map"); } |
464 | inline void sv_to (SV *sv, maptile * &v) { v = (maptile *)(attachable *)SvPTR_ornull (sv, "cf::map"); } |
476 | inline void sv_to (SV *sv, region * &v) { v = (region *)(attachable *)SvPTR_ornull (sv, "cf::region"); } |
465 | inline void sv_to (SV *sv, region * &v) { v = (region *)(attachable *)SvPTR_ornull (sv, "cf::region"); } |
477 | inline void sv_to (SV *sv, attachable * &v) { v = (attachable *)SvPTR_ornull (sv, "cf::attachable"); } |
466 | inline void sv_to (SV *sv, attachable * &v) { v = (attachable *)SvPTR_ornull (sv, "cf::attachable"); } |
478 | inline void sv_to (SV *sv, partylist * &v) { v = (partylist *)SvPTR_ornull (sv, "cf::party"); } |
467 | inline void sv_to (SV *sv, partylist * &v) { v = (partylist *)SvPTR_ornull (sv, "cf::party"); } |
479 | inline void sv_to (SV *sv, living * &v) { v = (living *)SvPTR_ornull (sv, "cf::living"); } |
468 | inline void sv_to (SV *sv, living * &v) { v = (living *)SvPTR_ornull (sv, "cf::living"); } |
|
|
469 | inline void sv_to (SV *sv, mapspace * &v) { v = (mapspace *)SvPTR_ornull (sv, "cf::mapspace"); } |
480 | inline void sv_to (SV *sv, object_freezer * &v) { v = (object_freezer *)SvPTR_ornull (sv, "cf::object::freezer"); } |
470 | inline void sv_to (SV *sv, object_freezer * &v) { v = (object_freezer *)SvPTR_ornull (sv, "cf::object::freezer"); } |
481 | inline void sv_to (SV *sv, object_thawer * &v) { v = (object_thawer *)SvPTR_ornull (sv, "cf::object::thawer" ); } |
471 | inline void sv_to (SV *sv, object_thawer * &v) { v = (object_thawer *)SvPTR_ornull (sv, "cf::object::thawer" ); } |
482 | |
472 | |
483 | //inline void sv_to (SV *sv, faceinfo * &v) { v = &faces [face_find (SvPV_nolen (sv), 0)]; } |
473 | //inline void sv_to (SV *sv, faceinfo * &v) { v = &faces [face_find (SvPV_nolen (sv), 0)]; } |
484 | inline void sv_to (SV *sv, treasurelist * &v) { v = treasurelist::find (SvPV_nolen (sv)); } |
474 | inline void sv_to (SV *sv, treasurelist * &v) { v = treasurelist::find (SvPV_nolen (sv)); } |
… | |
… | |
501 | v.assign (data, len); |
491 | v.assign (data, len); |
502 | } |
492 | } |
503 | |
493 | |
504 | inline void sv_to (SV *sv, UUID &v) |
494 | inline void sv_to (SV *sv, UUID &v) |
505 | { |
495 | { |
506 | unsigned int version; |
496 | if (!v.parse (SvPV_nolen (sv))) |
507 | |
|
|
508 | if (2 != sscanf (SvPV_nolen (sv), "<%d.%" SCNx64 ">", &version, &v.seq) || 1 != version) |
|
|
509 | croak ("unparsable uuid: %s", SvPV_nolen (sv)); |
497 | croak ("unparsable uuid: %s", SvPV_nolen (sv)); |
510 | } |
498 | } |
511 | |
499 | |
512 | inline void sv_to (SV *sv, object::flags_t::reference v) { v = SvTRUE (sv); } |
500 | inline void sv_to (SV *sv, object::flags_t::reference v) { v = SvTRUE (sv); } |
513 | |
501 | |
… | |
… | |
957 | CALL_CALL ("ext::books::make_book", G_VOID); |
945 | CALL_CALL ("ext::books::make_book", G_VOID); |
958 | CALL_END; |
946 | CALL_END; |
959 | } |
947 | } |
960 | |
948 | |
961 | void |
949 | void |
|
|
950 | cfperl_expand_cfpod (player *pl, std::string &msg) |
|
|
951 | { |
|
|
952 | CALL_BEGIN (2); |
|
|
953 | CALL_ARG (pl); |
|
|
954 | CALL_ARG_SV (newSVpvn_utf8 (msg.data (), msg.size ())); |
|
|
955 | CALL_CALL ("cf::player::expand_cfpod", G_SCALAR); |
|
|
956 | |
|
|
957 | if (count) |
|
|
958 | { |
|
|
959 | STRLEN len; |
|
|
960 | char *data = SvPVutf8 (TOPs, len); |
|
|
961 | msg.assign (data, len); |
|
|
962 | } |
|
|
963 | |
|
|
964 | CALL_END; |
|
|
965 | } |
|
|
966 | |
|
|
967 | void |
962 | cfperl_send_msg (client *ns, int color, const char *type, const char *msg) |
968 | cfperl_send_msg (client *ns, int color, const char *type, const char *msg) |
963 | { |
969 | { |
964 | CALL_BEGIN (4); |
970 | CALL_BEGIN (4); |
965 | CALL_ARG (ns); |
971 | CALL_ARG (ns); |
966 | CALL_ARG (type); |
972 | CALL_ARG (type); |
… | |
… | |
990 | { |
996 | { |
991 | CALL_BEGIN (1); |
997 | CALL_BEGIN (1); |
992 | CALL_ARG (name); |
998 | CALL_ARG (name); |
993 | CALL_CALL ("cf::player::find", G_SCALAR); |
999 | CALL_CALL ("cf::player::find", G_SCALAR); |
994 | |
1000 | |
995 | player *retval; |
1001 | player *retval = 0; |
996 | |
|
|
997 | if (count) |
|
|
998 | sv_to (POPs, retval); |
1002 | if (count) sv_to (POPs, retval); |
999 | else |
1003 | |
1000 | retval = 0; |
1004 | CALL_END; |
|
|
1005 | |
|
|
1006 | return retval; |
|
|
1007 | } |
|
|
1008 | |
|
|
1009 | maptile * |
|
|
1010 | find_style (const char *dirname, const char *stylename, int difficulty) |
|
|
1011 | { |
|
|
1012 | CALL_BEGIN (3); |
|
|
1013 | CALL_ARG (dirname); |
|
|
1014 | CALL_ARG (stylename); |
|
|
1015 | CALL_ARG (difficulty); |
|
|
1016 | CALL_CALL ("ext::map_random::find_style", G_SCALAR); |
|
|
1017 | |
|
|
1018 | maptile *retval = 0; |
|
|
1019 | if (count) sv_to (POPs, retval); |
1001 | |
1020 | |
1002 | CALL_END; |
1021 | CALL_END; |
1003 | |
1022 | |
1004 | return retval; |
1023 | return retval; |
1005 | } |
1024 | } |
… | |
… | |
1010 | CALL_BEGIN (2); |
1029 | CALL_BEGIN (2); |
1011 | CALL_ARG (path); |
1030 | CALL_ARG (path); |
1012 | CALL_ARG (origin); |
1031 | CALL_ARG (origin); |
1013 | CALL_CALL ("cf::map::find_sync", G_SCALAR); |
1032 | CALL_CALL ("cf::map::find_sync", G_SCALAR); |
1014 | |
1033 | |
1015 | maptile *retval; |
1034 | maptile *retval = 0; |
1016 | |
|
|
1017 | if (count) |
|
|
1018 | sv_to (POPs, retval); |
1035 | if (count) sv_to (POPs, retval); |
1019 | else |
|
|
1020 | retval = 0; |
|
|
1021 | |
1036 | |
1022 | CALL_END; |
1037 | CALL_END; |
1023 | |
1038 | |
1024 | return retval; |
1039 | return retval; |
1025 | } |
1040 | } |
… | |
… | |
1031 | CALL_ARG (path); |
1046 | CALL_ARG (path); |
1032 | CALL_ARG (origin); |
1047 | CALL_ARG (origin); |
1033 | CALL_ARG (load); |
1048 | CALL_ARG (load); |
1034 | CALL_CALL ("cf::map::find_async", G_SCALAR); |
1049 | CALL_CALL ("cf::map::find_async", G_SCALAR); |
1035 | |
1050 | |
1036 | maptile *retval; |
1051 | maptile *retval = 0; |
1037 | |
|
|
1038 | if (count) |
|
|
1039 | sv_to (POPs, retval); |
1052 | if (count) sv_to (POPs, retval); |
1040 | else |
|
|
1041 | retval = 0; |
|
|
1042 | |
1053 | |
1043 | CALL_END; |
1054 | CALL_END; |
1044 | |
1055 | |
1045 | return retval; |
1056 | return retval; |
1046 | } |
1057 | } |
… | |
… | |
1071 | |
1082 | |
1072 | CALL_BEGIN (2); |
1083 | CALL_BEGIN (2); |
1073 | CALL_ARG (this); |
1084 | CALL_ARG (this); |
1074 | CALL_ARG (exit); |
1085 | CALL_ARG (exit); |
1075 | CALL_CALL ("cf::object::player::enter_exit", G_VOID); |
1086 | CALL_CALL ("cf::object::player::enter_exit", G_VOID); |
|
|
1087 | CALL_END; |
|
|
1088 | } |
|
|
1089 | |
|
|
1090 | void |
|
|
1091 | object::player_goto (const char *path, int x, int y) |
|
|
1092 | { |
|
|
1093 | if (type != PLAYER) |
|
|
1094 | return; |
|
|
1095 | |
|
|
1096 | CALL_BEGIN (4); |
|
|
1097 | CALL_ARG (this); |
|
|
1098 | CALL_ARG (path); |
|
|
1099 | CALL_ARG (x); |
|
|
1100 | CALL_ARG (y); |
|
|
1101 | CALL_CALL ("cf::object::player::goto", G_VOID); |
1076 | CALL_END; |
1102 | CALL_END; |
1077 | } |
1103 | } |
1078 | |
1104 | |
1079 | const char * |
1105 | const char * |
1080 | object::ref () const |
1106 | object::ref () const |
… | |
… | |
1167 | |
1193 | |
1168 | stash_cf_object_wrap = gv_stashpv ("cf::object::wrap", 1); |
1194 | stash_cf_object_wrap = gv_stashpv ("cf::object::wrap", 1); |
1169 | stash_cf_object_player_wrap = gv_stashpv ("cf::object::player::wrap", 1); |
1195 | stash_cf_object_player_wrap = gv_stashpv ("cf::object::player::wrap", 1); |
1170 | stash_cf_player_wrap = gv_stashpv ("cf::player::wrap", 1); |
1196 | stash_cf_player_wrap = gv_stashpv ("cf::player::wrap", 1); |
1171 | stash_cf_map_wrap = gv_stashpv ("cf::map::wrap" , 1); |
1197 | stash_cf_map_wrap = gv_stashpv ("cf::map::wrap" , 1); |
|
|
1198 | stash_cf_mapspace_wrap = gv_stashpv ("cf::mapspace::wrap" , 1); |
1172 | stash_cf_client_wrap = gv_stashpv ("cf::client::wrap", 1); |
1199 | stash_cf_client_wrap = gv_stashpv ("cf::client::wrap", 1); |
1173 | stash_cf_arch_wrap = gv_stashpv ("cf::arch::wrap" , 1); |
1200 | stash_cf_arch_wrap = gv_stashpv ("cf::arch::wrap" , 1); |
1174 | stash_cf_party_wrap = gv_stashpv ("cf::party::wrap" , 1); |
1201 | stash_cf_party_wrap = gv_stashpv ("cf::party::wrap" , 1); |
1175 | stash_cf_region_wrap = gv_stashpv ("cf::region::wrap", 1); |
1202 | stash_cf_region_wrap = gv_stashpv ("cf::region::wrap", 1); |
1176 | stash_cf_living_wrap = gv_stashpv ("cf::living::wrap", 1); |
1203 | stash_cf_living_wrap = gv_stashpv ("cf::living::wrap", 1); |
… | |
… | |
1369 | const_iv (F_CURSED) const_iv (F_DAMNED) const_iv (F_OPEN) const_iv (F_NOPICK) |
1396 | const_iv (F_CURSED) const_iv (F_DAMNED) const_iv (F_OPEN) const_iv (F_NOPICK) |
1370 | const_iv (F_LOCKED) |
1397 | const_iv (F_LOCKED) |
1371 | |
1398 | |
1372 | const_iv (F_BUY) const_iv (F_SHOP) const_iv (F_SELL) |
1399 | const_iv (F_BUY) const_iv (F_SHOP) const_iv (F_SELL) |
1373 | |
1400 | |
1374 | const_iv (P_BLOCKSVIEW) const_iv (P_PLAYER) const_iv (P_NO_MAGIC) const_iv (P_IS_ALIVE) |
1401 | const_iv (P_BLOCKSVIEW) const_iv (P_NO_MAGIC) const_iv (P_IS_ALIVE) |
1375 | const_iv (P_NO_CLERIC) const_iv (P_OUT_OF_MAP) const_iv (P_NEW_MAP) const_iv (P_UPTODATE) |
1402 | const_iv (P_NO_CLERIC) const_iv (P_OUT_OF_MAP) const_iv (P_NEW_MAP) const_iv (P_UPTODATE) |
1376 | |
1403 | |
1377 | const_iv (UP_OBJ_INSERT) const_iv (UP_OBJ_REMOVE) const_iv (UP_OBJ_CHANGE) const_iv (UP_OBJ_FACE) |
1404 | const_iv (UP_OBJ_INSERT) const_iv (UP_OBJ_REMOVE) const_iv (UP_OBJ_CHANGE) const_iv (UP_OBJ_FACE) |
1378 | |
1405 | |
1379 | const_iv (INS_NO_MERGE) const_iv (INS_ABOVE_FLOOR_ONLY) const_iv (INS_NO_WALK_ON) |
1406 | const_iv (INS_NO_MERGE) const_iv (INS_ABOVE_FLOOR_ONLY) const_iv (INS_NO_WALK_ON) |
… | |
… | |
1419 | const_iv (ATNR_PARALYZE) const_iv (ATNR_TURN_UNDEAD) const_iv (ATNR_FEAR) const_iv (ATNR_CANCELLATION) |
1446 | const_iv (ATNR_PARALYZE) const_iv (ATNR_TURN_UNDEAD) const_iv (ATNR_FEAR) const_iv (ATNR_CANCELLATION) |
1420 | const_iv (ATNR_DEPLETE) const_iv (ATNR_DEATH) const_iv (ATNR_CHAOS) const_iv (ATNR_COUNTERSPELL) |
1447 | const_iv (ATNR_DEPLETE) const_iv (ATNR_DEATH) const_iv (ATNR_CHAOS) const_iv (ATNR_COUNTERSPELL) |
1421 | const_iv (ATNR_GODPOWER) const_iv (ATNR_HOLYWORD) const_iv (ATNR_BLIND) const_iv (ATNR_INTERNAL) |
1448 | const_iv (ATNR_GODPOWER) const_iv (ATNR_HOLYWORD) const_iv (ATNR_BLIND) const_iv (ATNR_INTERNAL) |
1422 | const_iv (ATNR_LIFE_STEALING) const_iv (ATNR_DISEASE) |
1449 | const_iv (ATNR_LIFE_STEALING) const_iv (ATNR_DISEASE) |
1423 | |
1450 | |
1424 | const_iv (MAP_IN_MEMORY) const_iv (MAP_SWAPPED) const_iv (MAP_LOADING) const_iv (MAP_SAVING) |
1451 | const_iv (MAP_ACTIVE) const_iv (MAP_SWAPPED) const_iv (MAP_LOADING) const_iv (MAP_SAVING) |
|
|
1452 | const_iv (MAP_INACTIVE) |
1425 | |
1453 | |
1426 | const_iv (KLASS_ATTACHABLE) const_iv (KLASS_GLOBAL) const_iv (KLASS_OBJECT) |
1454 | const_iv (KLASS_ATTACHABLE) const_iv (KLASS_GLOBAL) const_iv (KLASS_OBJECT) |
1427 | const_iv (KLASS_CLIENT) const_iv (KLASS_PLAYER) const_iv (KLASS_MAP) |
1455 | const_iv (KLASS_CLIENT) const_iv (KLASS_PLAYER) const_iv (KLASS_MAP) |
1428 | |
1456 | |
1429 | const_iv (VERSION_CS) const_iv (VERSION_SC) |
1457 | const_iv (VERSION_CS) const_iv (VERSION_SC) |
… | |
… | |
1444 | |
1472 | |
1445 | const_iv (SYMMETRY_RANDOM) const_iv (SYMMETRY_NONE) const_iv (SYMMETRY_X) |
1473 | const_iv (SYMMETRY_RANDOM) const_iv (SYMMETRY_NONE) const_iv (SYMMETRY_X) |
1446 | const_iv (SYMMETRY_Y) const_iv (SYMMETRY_XY) |
1474 | const_iv (SYMMETRY_Y) const_iv (SYMMETRY_XY) |
1447 | |
1475 | |
1448 | const_iv (GT_ENVIRONMENT) const_iv (GT_INVISIBLE) const_iv (GT_STARTEQUIP) |
1476 | const_iv (GT_ENVIRONMENT) const_iv (GT_INVISIBLE) const_iv (GT_STARTEQUIP) |
1449 | const_iv (GT_APPLY) const_iv (GT_ONLY_GOOD) const_iv (GT_UPDATE_INV) |
1477 | const_iv (GT_APPLY) const_iv (GT_ONLY_GOOD) const_iv (GT_MINIMAL) |
1450 | const_iv (GT_MINIMAL) |
|
|
1451 | |
1478 | |
1452 | const_iv (FT_FACE) const_iv (FT_MUSIC) const_iv (FT_SOUND) |
1479 | const_iv (FT_FACE) const_iv (FT_MUSIC) const_iv (FT_SOUND) |
1453 | const_iv (FT_RSRC) const_iv (FT_NUM) |
1480 | const_iv (FT_RSRC) const_iv (FT_NUM) |
1454 | }; |
1481 | }; |
1455 | |
1482 | |
… | |
… | |
1477 | av_store (av, eiv->iv, newRV_noinc ((SV *)event)); |
1504 | av_store (av, eiv->iv, newRV_noinc ((SV *)event)); |
1478 | newCONSTSUB (stash_cf, (char *)eiv->name, newSViv (eiv->iv)); |
1505 | newCONSTSUB (stash_cf, (char *)eiv->name, newSViv (eiv->iv)); |
1479 | } |
1506 | } |
1480 | } |
1507 | } |
1481 | |
1508 | |
|
|
1509 | void _gv_clear (SV *gv) |
|
|
1510 | CODE: |
|
|
1511 | assert (SvTYPE (gv) == SVt_PVGV); |
|
|
1512 | # define f(sv) { SV *sv_ = (SV *)(sv); sv = 0; SvREFCNT_dec (sv_); } |
|
|
1513 | f (GvGP (gv)->gp_form); |
|
|
1514 | f (GvGP (gv)->gp_io); |
|
|
1515 | f (GvGP (gv)->gp_sv); |
|
|
1516 | f (GvGP (gv)->gp_av); |
|
|
1517 | f (GvGP (gv)->gp_hv); |
|
|
1518 | f (GvGP (gv)->gp_cv); |
|
|
1519 | GvCVGEN (gv) = 0; |
|
|
1520 | GvMULTI_off (gv); |
|
|
1521 | # undef f |
|
|
1522 | |
|
|
1523 | |
1482 | void _connect_to_perl () |
1524 | void _connect_to_perl () |
1483 | |
1525 | |
1484 | void _recalc_want () |
1526 | void _recalc_want () |
1485 | |
1527 | |
1486 | void _global_reattach () |
1528 | void _global_reattach () |
… | |
… | |
1534 | } |
1576 | } |
1535 | |
1577 | |
1536 | SvCUR_set (data_sv, dst - SvPVX (data_sv)); |
1578 | SvCUR_set (data_sv, dst - SvPVX (data_sv)); |
1537 | } |
1579 | } |
1538 | |
1580 | |
1539 | void evthread_start () |
1581 | void evthread_start (int aiofd) |
1540 | |
1582 | |
1541 | void cede_to_tick () |
1583 | void cede_to_tick () |
1542 | CODE: |
1584 | CODE: |
1543 | coroapi::cede_to_tick (); |
1585 | coroapi::cede_to_tick (); |
1544 | |
1586 | |
… | |
… | |
1586 | NV floor (NV x) |
1628 | NV floor (NV x) |
1587 | |
1629 | |
1588 | NV ceil (NV x) |
1630 | NV ceil (NV x) |
1589 | |
1631 | |
1590 | NV rndm (...) |
1632 | NV rndm (...) |
|
|
1633 | ALIAS: |
|
|
1634 | rmg_rndm = 1 |
1591 | CODE: |
1635 | CODE: |
|
|
1636 | { |
|
|
1637 | rand_gen &gen = ix ? rmg_rndm : rndm; |
1592 | switch (items) |
1638 | switch (items) |
1593 | { |
1639 | { |
1594 | case 0: RETVAL = rndm (); break; |
1640 | case 0: RETVAL = gen (); break; |
1595 | case 1: RETVAL = rndm (SvUV (ST (0))); break; |
1641 | case 1: RETVAL = gen (SvUV (ST (0))); break; |
1596 | case 2: RETVAL = rndm (SvIV (ST (0)), SvIV (ST (1))); break; |
1642 | case 2: RETVAL = gen (SvIV (ST (0)), SvIV (ST (1))); break; |
1597 | default: croak ("cf::rndm requires none, one or two parameters."); break; |
1643 | default: croak ("cf::rndm requires none, one or two parameters."); break; |
1598 | } |
1644 | } |
|
|
1645 | } |
1599 | OUTPUT: |
1646 | OUTPUT: |
1600 | RETVAL |
1647 | RETVAL |
1601 | |
1648 | |
1602 | NV clamp (NV value, NV min_value, NV max_value) |
1649 | NV clamp (NV value, NV min_value, NV max_value) |
1603 | CODE: |
1650 | CODE: |
… | |
… | |
1628 | octet_string path_combine (octet_string base, octet_string path) |
1675 | octet_string path_combine (octet_string base, octet_string path) |
1629 | PROTOTYPE: $$ |
1676 | PROTOTYPE: $$ |
1630 | |
1677 | |
1631 | octet_string path_combine_and_normalize (octet_string base, octet_string path) |
1678 | octet_string path_combine_and_normalize (octet_string base, octet_string path) |
1632 | PROTOTYPE: $$ |
1679 | PROTOTYPE: $$ |
1633 | |
|
|
1634 | void |
|
|
1635 | mallinfo () |
|
|
1636 | PPCODE: |
|
|
1637 | { |
|
|
1638 | #if __GLIBC__ |
|
|
1639 | struct mallinfo mai = mallinfo (); |
|
|
1640 | EXTEND (SP, 10*2); |
|
|
1641 | PUSHs (sv_2mortal (newSVpv ("arena" , 0))); PUSHs (sv_2mortal (newSViv (mai.arena))); |
|
|
1642 | PUSHs (sv_2mortal (newSVpv ("ordblks" , 0))); PUSHs (sv_2mortal (newSViv (mai.ordblks))); |
|
|
1643 | PUSHs (sv_2mortal (newSVpv ("smblks" , 0))); PUSHs (sv_2mortal (newSViv (mai.smblks))); |
|
|
1644 | PUSHs (sv_2mortal (newSVpv ("hblks" , 0))); PUSHs (sv_2mortal (newSViv (mai.hblks))); |
|
|
1645 | PUSHs (sv_2mortal (newSVpv ("hblkhd" , 0))); PUSHs (sv_2mortal (newSViv (mai.hblkhd))); |
|
|
1646 | PUSHs (sv_2mortal (newSVpv ("usmblks" , 0))); PUSHs (sv_2mortal (newSViv (mai.usmblks))); |
|
|
1647 | PUSHs (sv_2mortal (newSVpv ("fsmblks" , 0))); PUSHs (sv_2mortal (newSViv (mai.fsmblks))); |
|
|
1648 | PUSHs (sv_2mortal (newSVpv ("uordblks", 0))); PUSHs (sv_2mortal (newSViv (mai.uordblks))); |
|
|
1649 | PUSHs (sv_2mortal (newSVpv ("fordblks", 0))); PUSHs (sv_2mortal (newSViv (mai.fordblks))); |
|
|
1650 | PUSHs (sv_2mortal (newSVpv ("keepcost", 0))); PUSHs (sv_2mortal (newSViv (mai.keepcost))); |
|
|
1651 | #endif |
|
|
1652 | EXTEND (SP, 2*2); |
|
|
1653 | PUSHs (sv_2mortal (newSVpv ("slice_alloc", 0))); PUSHs (sv_2mortal (newSVuv (slice_alloc))); |
|
|
1654 | PUSHs (sv_2mortal (newSVpv ("shstr_alloc", 0))); PUSHs (sv_2mortal (newSVuv (shstr_alloc))); |
|
|
1655 | } |
|
|
1656 | |
1680 | |
1657 | void |
1681 | void |
1658 | sub_generation_inc () |
1682 | sub_generation_inc () |
1659 | CODE: |
1683 | CODE: |
1660 | PL_sub_generation++; |
1684 | PL_sub_generation++; |
… | |
… | |
1697 | |
1721 | |
1698 | #if _POSIX_MEMLOCK |
1722 | #if _POSIX_MEMLOCK |
1699 | |
1723 | |
1700 | int mlockall (int flags = MCL_CURRENT | MCL_FUTURE) |
1724 | int mlockall (int flags = MCL_CURRENT | MCL_FUTURE) |
1701 | INIT: |
1725 | INIT: |
|
|
1726 | #if __GLIBC__ |
1702 | mallopt (M_PERTURB, 0xaa); // bug-workaround for linux glibc+mlockall+calloc |
1727 | mallopt (M_PERTURB, 0xee); // bug-workaround for linux glibc+mlockall+calloc |
|
|
1728 | #endif |
1703 | |
1729 | |
1704 | int munlockall () |
1730 | int munlockall () |
1705 | |
1731 | |
1706 | #endif |
1732 | #endif |
|
|
1733 | |
|
|
1734 | int |
|
|
1735 | malloc_trim (IV pad = 0) |
|
|
1736 | |
|
|
1737 | void |
|
|
1738 | mallinfo () |
|
|
1739 | PPCODE: |
|
|
1740 | { |
|
|
1741 | #if __GLIBC__ |
|
|
1742 | struct mallinfo mai = mallinfo (); |
|
|
1743 | EXTEND (SP, 10*2); |
|
|
1744 | PUSHs (sv_2mortal (newSVpv ("arena" , 0))); PUSHs (sv_2mortal (newSViv (mai.arena))); |
|
|
1745 | PUSHs (sv_2mortal (newSVpv ("ordblks" , 0))); PUSHs (sv_2mortal (newSViv (mai.ordblks))); |
|
|
1746 | PUSHs (sv_2mortal (newSVpv ("smblks" , 0))); PUSHs (sv_2mortal (newSViv (mai.smblks))); |
|
|
1747 | PUSHs (sv_2mortal (newSVpv ("hblks" , 0))); PUSHs (sv_2mortal (newSViv (mai.hblks))); |
|
|
1748 | PUSHs (sv_2mortal (newSVpv ("hblkhd" , 0))); PUSHs (sv_2mortal (newSViv (mai.hblkhd))); |
|
|
1749 | PUSHs (sv_2mortal (newSVpv ("usmblks" , 0))); PUSHs (sv_2mortal (newSViv (mai.usmblks))); |
|
|
1750 | PUSHs (sv_2mortal (newSVpv ("fsmblks" , 0))); PUSHs (sv_2mortal (newSViv (mai.fsmblks))); |
|
|
1751 | PUSHs (sv_2mortal (newSVpv ("uordblks", 0))); PUSHs (sv_2mortal (newSViv (mai.uordblks))); |
|
|
1752 | PUSHs (sv_2mortal (newSVpv ("fordblks", 0))); PUSHs (sv_2mortal (newSViv (mai.fordblks))); |
|
|
1753 | PUSHs (sv_2mortal (newSVpv ("keepcost", 0))); PUSHs (sv_2mortal (newSViv (mai.keepcost))); |
|
|
1754 | #endif |
|
|
1755 | EXTEND (SP, 2*2); |
|
|
1756 | PUSHs (sv_2mortal (newSVpv ("slice_alloc", 0))); PUSHs (sv_2mortal (newSVuv (slice_alloc))); |
|
|
1757 | PUSHs (sv_2mortal (newSVpv ("shstr_alloc", 0))); PUSHs (sv_2mortal (newSVuv (shstr_alloc))); |
|
|
1758 | PUSHs (sv_2mortal (newSVpv ("objects" , 0))); PUSHs (sv_2mortal (newSVuv (objects.size () * sizeof (object)))); |
|
|
1759 | } |
1707 | |
1760 | |
1708 | int find_animation (utf8_string text) |
1761 | int find_animation (utf8_string text) |
1709 | PROTOTYPE: $ |
1762 | PROTOTYPE: $ |
1710 | |
1763 | |
1711 | int random_roll (int min, int max, object *op, int goodbad); |
1764 | int random_roll (int min, int max, object *op, int goodbad); |
… | |
… | |
1749 | RETVAL = newSVpv (resist_plus[atnr], 0); |
1802 | RETVAL = newSVpv (resist_plus[atnr], 0); |
1750 | else |
1803 | else |
1751 | XSRETURN_UNDEF; |
1804 | XSRETURN_UNDEF; |
1752 | OUTPUT: RETVAL |
1805 | OUTPUT: RETVAL |
1753 | |
1806 | |
|
|
1807 | UUID |
|
|
1808 | uuid_cur () |
|
|
1809 | CODE: |
|
|
1810 | RETVAL = UUID::cur; |
|
|
1811 | OUTPUT: |
|
|
1812 | RETVAL |
|
|
1813 | |
|
|
1814 | UUID |
|
|
1815 | uuid_gen () |
|
|
1816 | CODE: |
|
|
1817 | RETVAL = UUID::gen (); |
|
|
1818 | OUTPUT: |
|
|
1819 | RETVAL |
|
|
1820 | |
|
|
1821 | val64 |
|
|
1822 | uuid_seq (UUID uuid) |
|
|
1823 | CODE: |
|
|
1824 | RETVAL = uuid.seq; |
|
|
1825 | OUTPUT: |
|
|
1826 | RETVAL |
|
|
1827 | |
|
|
1828 | UUID |
|
|
1829 | uuid_str (val64 seq) |
|
|
1830 | CODE: |
|
|
1831 | RETVAL.seq = seq; |
|
|
1832 | OUTPUT: |
|
|
1833 | RETVAL |
|
|
1834 | |
|
|
1835 | void |
|
|
1836 | coin_names () |
|
|
1837 | PPCODE: |
|
|
1838 | EXTEND (SP, NUM_COINS); |
|
|
1839 | for (int i = 0; i < NUM_COINS; ++i) |
|
|
1840 | PUSHs (sv_2mortal (newSVpv (coins [i], 0))); |
|
|
1841 | |
|
|
1842 | void |
|
|
1843 | coin_archetypes () |
|
|
1844 | PPCODE: |
|
|
1845 | EXTEND (SP, NUM_COINS); |
|
|
1846 | for (int i = 0; i < NUM_COINS; ++i) |
|
|
1847 | PUSHs (sv_2mortal (to_sv (archetype::find (coins [i])))); |
|
|
1848 | |
1754 | bool |
1849 | bool |
1755 | load_resource_file (octet_string filename) |
1850 | load_resource_file_ (octet_string filename) |
|
|
1851 | |
|
|
1852 | void |
|
|
1853 | fix_weight () |
1756 | |
1854 | |
1757 | MODULE = cf PACKAGE = cf::attachable |
1855 | MODULE = cf PACKAGE = cf::attachable |
1758 | |
1856 | |
1759 | int |
1857 | int |
1760 | valid (SV *obj) |
1858 | valid (SV *obj) |
… | |
… | |
1824 | object *actives (U32 index) |
1922 | object *actives (U32 index) |
1825 | CODE: |
1923 | CODE: |
1826 | RETVAL = index < actives.size () ? actives [index] : 0; |
1924 | RETVAL = index < actives.size () ? actives [index] : 0; |
1827 | OUTPUT: RETVAL |
1925 | OUTPUT: RETVAL |
1828 | |
1926 | |
|
|
1927 | int mortals_size () |
|
|
1928 | CODE: |
|
|
1929 | RETVAL = attachable::mortals.size (); |
|
|
1930 | OUTPUT: RETVAL |
|
|
1931 | |
1829 | const char *slot_use_name (U32 slot) |
1932 | const char *slot_use_name (U32 slot) |
1830 | ALIAS: |
1933 | ALIAS: |
1831 | slot_nonuse_name = 1 |
1934 | slot_nonuse_name = 1 |
1832 | CODE: |
1935 | CODE: |
1833 | { |
1936 | { |
… | |
… | |
1911 | void apply_below (object *op) |
2014 | void apply_below (object *op) |
1912 | CODE: |
2015 | CODE: |
1913 | player_apply_below (op); |
2016 | player_apply_below (op); |
1914 | |
2017 | |
1915 | int cast_heal (object *op, object *caster, object *spell, int dir = 0) |
2018 | int cast_heal (object *op, object *caster, object *spell, int dir = 0) |
1916 | |
|
|
1917 | #//TODO |
|
|
1918 | object *clone_ (object *op, int recursive = 0) |
|
|
1919 | CODE: |
|
|
1920 | if (recursive) |
|
|
1921 | RETVAL = object_create_clone (op); |
|
|
1922 | else |
|
|
1923 | { |
|
|
1924 | RETVAL = object::create (); |
|
|
1925 | op->copy_to (RETVAL); |
|
|
1926 | } |
|
|
1927 | OUTPUT: RETVAL |
|
|
1928 | |
2019 | |
1929 | int pay_item (object *op, object *buyer) |
2020 | int pay_item (object *op, object *buyer) |
1930 | CODE: |
2021 | CODE: |
1931 | RETVAL = pay_for_item (op, buyer); |
2022 | RETVAL = pay_for_item (op, buyer); |
1932 | OUTPUT: RETVAL |
2023 | OUTPUT: RETVAL |
… | |
… | |
2010 | CODE: |
2101 | CODE: |
2011 | { |
2102 | { |
2012 | RETVAL = insert_ob_in_map_at (ob, where, orig, flag, x, y); |
2103 | RETVAL = insert_ob_in_map_at (ob, where, orig, flag, x, y); |
2013 | } |
2104 | } |
2014 | |
2105 | |
2015 | const_utf8_string get_ob_key_value (object *op, utf8_string key) |
2106 | shstr |
|
|
2107 | object::kv_get (shstr key) |
2016 | |
2108 | |
2017 | bool set_ob_key_value (object *op, utf8_string key, utf8_string value = 0, int add_key = 1) |
2109 | void |
|
|
2110 | object::kv_del (shstr key) |
|
|
2111 | |
|
|
2112 | void |
|
|
2113 | object::kv_set (shstr key, shstr value) |
2018 | |
2114 | |
2019 | object *get_nearest_player (object *ob) |
2115 | object *get_nearest_player (object *ob) |
2020 | ALIAS: nearest_player = 0 |
2116 | ALIAS: nearest_player = 0 |
2021 | PREINIT: |
2117 | PREINIT: |
2022 | extern object *get_nearest_player (object *); |
2118 | extern object *get_nearest_player (object *); |
… | |
… | |
2024 | void rangevector (object *ob, object *other, int flags = 0) |
2120 | void rangevector (object *ob, object *other, int flags = 0) |
2025 | PROTOTYPE: $$;$ |
2121 | PROTOTYPE: $$;$ |
2026 | PPCODE: |
2122 | PPCODE: |
2027 | { |
2123 | { |
2028 | rv_vector rv; |
2124 | rv_vector rv; |
|
|
2125 | |
|
|
2126 | PUTBACK; |
2029 | get_rangevector (ob, other, &rv, flags); |
2127 | get_rangevector (ob, other, &rv, flags); |
|
|
2128 | SPAGAIN; |
|
|
2129 | |
2030 | EXTEND (SP, 5); |
2130 | EXTEND (SP, 5); |
2031 | PUSHs (newSVuv (rv.distance)); |
2131 | PUSHs (newSVuv (rv.distance)); |
2032 | PUSHs (newSViv (rv.distance_x)); |
2132 | PUSHs (newSViv (rv.distance_x)); |
2033 | PUSHs (newSViv (rv.distance_y)); |
2133 | PUSHs (newSViv (rv.distance_y)); |
2034 | PUSHs (newSViv (rv.direction)); |
2134 | PUSHs (newSViv (rv.direction)); |
… | |
… | |
2044 | base_name (object *op, int plural = op->nrof > 1) |
2144 | base_name (object *op, int plural = op->nrof > 1) |
2045 | CODE: |
2145 | CODE: |
2046 | RETVAL = query_base_name (op, plural); |
2146 | RETVAL = query_base_name (op, plural); |
2047 | OUTPUT: RETVAL |
2147 | OUTPUT: RETVAL |
2048 | |
2148 | |
2049 | object *decrease_ob_nr (object *op, unsigned long i) |
|
|
2050 | |
|
|
2051 | # return the tail of an object, excluding itself |
2149 | # return the tail of an object, excluding itself |
2052 | void |
2150 | void |
2053 | tail (object *op) |
2151 | tail (object *op) |
2054 | PPCODE: |
2152 | PPCODE: |
2055 | while ((op = op->more)) |
2153 | while ((op = op->more)) |
… | |
… | |
2127 | if (len > MAXSOCKBUF) |
2225 | if (len > MAXSOCKBUF) |
2128 | pl->failmsg ("[packet too long for client]"); |
2226 | pl->failmsg ("[packet too long for client]"); |
2129 | else if (pl->ns) |
2227 | else if (pl->ns) |
2130 | pl->ns->send_packet (buf, len); |
2228 | pl->ns->send_packet (buf, len); |
2131 | } |
2229 | } |
2132 | |
|
|
2133 | int |
|
|
2134 | listening (player *pl, int new_value = -1) |
|
|
2135 | CODE: |
|
|
2136 | RETVAL = pl->listening; |
|
|
2137 | if (new_value >= 0) |
|
|
2138 | pl->listening = new_value; |
|
|
2139 | OUTPUT: |
|
|
2140 | RETVAL |
|
|
2141 | |
2230 | |
2142 | void savebed (player *pl, SV *map_path = 0, SV *x = 0, SV *y = 0) |
2231 | void savebed (player *pl, SV *map_path = 0, SV *x = 0, SV *y = 0) |
2143 | PROTOTYPE: $;$$$ |
2232 | PROTOTYPE: $;$$$ |
2144 | PPCODE: |
2233 | PPCODE: |
2145 | if (GIMME_V != G_VOID) |
2234 | if (GIMME_V != G_VOID) |
… | |
… | |
2343 | get_map_flags (maptile *map, int x, int y) |
2432 | get_map_flags (maptile *map, int x, int y) |
2344 | PPCODE: |
2433 | PPCODE: |
2345 | { |
2434 | { |
2346 | maptile *nmap = 0; |
2435 | maptile *nmap = 0; |
2347 | I16 nx = 0, ny = 0; |
2436 | I16 nx = 0, ny = 0; |
|
|
2437 | |
|
|
2438 | PUTBACK; |
2348 | int flags = get_map_flags (map, &nmap, x, y, &nx, &ny); |
2439 | int flags = get_map_flags (map, &nmap, x, y, &nx, &ny); |
|
|
2440 | SPAGAIN; |
2349 | |
2441 | |
2350 | EXTEND (SP, 4); |
2442 | EXTEND (SP, 4); |
2351 | PUSHs (sv_2mortal (newSViv (flags))); |
2443 | PUSHs (sv_2mortal (newSViv (flags))); |
2352 | |
2444 | |
2353 | if (GIMME_V == G_ARRAY) |
2445 | if (GIMME_V == G_ARRAY) |
… | |
… | |
2356 | PUSHs (sv_2mortal (newSViv (nx))); |
2448 | PUSHs (sv_2mortal (newSViv (nx))); |
2357 | PUSHs (sv_2mortal (newSViv (ny))); |
2449 | PUSHs (sv_2mortal (newSViv (ny))); |
2358 | } |
2450 | } |
2359 | } |
2451 | } |
2360 | |
2452 | |
|
|
2453 | mapspace * |
|
|
2454 | ms (maptile *map, unsigned int x, unsigned int y) |
|
|
2455 | PROTOTYPE: $$$ |
|
|
2456 | CODE: |
|
|
2457 | { |
|
|
2458 | maptile *nmap = 0; |
|
|
2459 | I16 nx, ny; |
|
|
2460 | |
|
|
2461 | PUTBACK; |
|
|
2462 | get_map_flags (map, &nmap, x, y, &nx, &ny); |
|
|
2463 | SPAGAIN; |
|
|
2464 | |
|
|
2465 | if (!nmap) |
|
|
2466 | XSRETURN_UNDEF; |
|
|
2467 | |
|
|
2468 | RETVAL = &nmap->at (nx, ny); |
|
|
2469 | } |
|
|
2470 | OUTPUT: |
|
|
2471 | RETVAL |
|
|
2472 | |
2361 | void |
2473 | void |
2362 | at (maptile *map, unsigned int x, unsigned int y) |
2474 | at (maptile *map, unsigned int x, unsigned int y) |
2363 | PROTOTYPE: $$$ |
2475 | PROTOTYPE: $$$ |
2364 | PPCODE: |
2476 | PPCODE: |
2365 | { |
2477 | { |
2366 | object *o; |
|
|
2367 | maptile *nmap = 0; |
2478 | maptile *nmap = 0; |
2368 | I16 nx, ny; |
2479 | I16 nx, ny; |
2369 | |
2480 | |
|
|
2481 | PUTBACK; |
2370 | get_map_flags (map, &nmap, x, y, &nx, &ny); |
2482 | get_map_flags (map, &nmap, x, y, &nx, &ny); |
|
|
2483 | SPAGAIN; |
2371 | |
2484 | |
2372 | if (nmap) |
2485 | if (nmap) |
2373 | for (o = GET_MAP_OB (nmap, nx, ny); o; o = o->above) |
2486 | for (object *o = nmap->at (nx, ny).bot; o; o = o->above) |
2374 | XPUSHs (sv_2mortal (to_sv (o))); |
2487 | XPUSHs (sv_2mortal (to_sv (o))); |
2375 | } |
2488 | } |
2376 | |
2489 | |
2377 | SV * |
2490 | SV * |
2378 | bot_at (maptile *obj, unsigned int x, unsigned int y) |
2491 | bot_at (maptile *obj, unsigned int x, unsigned int y) |
… | |
… | |
2491 | RETVAL = self->generate_random_map (&rmp); |
2604 | RETVAL = self->generate_random_map (&rmp); |
2492 | } |
2605 | } |
2493 | OUTPUT: |
2606 | OUTPUT: |
2494 | RETVAL |
2607 | RETVAL |
2495 | |
2608 | |
|
|
2609 | MODULE = cf PACKAGE = cf::mapspace |
|
|
2610 | |
|
|
2611 | INCLUDE: $PERL $srcdir/genacc mapspace ../include/map.h | |
|
|
2612 | |
2496 | MODULE = cf PACKAGE = cf::arch |
2613 | MODULE = cf PACKAGE = cf::arch |
2497 | |
2614 | |
2498 | int archetypes_size () |
2615 | int archetypes_size () |
2499 | CODE: |
2616 | CODE: |
2500 | RETVAL = archetypes.size (); |
2617 | RETVAL = archetypes.size (); |