… | |
… | |
31 | #include <cstdarg> |
31 | #include <cstdarg> |
32 | #include <sproto.h> |
32 | #include <sproto.h> |
33 | |
33 | |
34 | #include "cfperl.h" |
34 | #include "cfperl.h" |
35 | #include "shstr.h" |
35 | #include "shstr.h" |
|
|
36 | |
|
|
37 | #include <unistd.h> |
|
|
38 | #if _POSIX_MEMLOCK |
|
|
39 | # include <sys/mman.h> |
|
|
40 | #endif |
36 | |
41 | |
37 | #include <EXTERN.h> |
42 | #include <EXTERN.h> |
38 | #include <perl.h> |
43 | #include <perl.h> |
39 | #include <XSUB.h> |
44 | #include <XSUB.h> |
40 | |
45 | |
… | |
… | |
873 | |
878 | |
874 | ///////////////////////////////////////////////////////////////////////////// |
879 | ///////////////////////////////////////////////////////////////////////////// |
875 | |
880 | |
876 | struct EventAPI *watcher_base::GEventAPI; |
881 | struct EventAPI *watcher_base::GEventAPI; |
877 | struct CoroAPI *coroapi::GCoroAPI; |
882 | struct CoroAPI *coroapi::GCoroAPI; |
|
|
883 | |
|
|
884 | int coroapi::cede_counter; |
878 | |
885 | |
879 | static void iw_dispatch (pe_event *ev) |
886 | static void iw_dispatch (pe_event *ev) |
880 | { |
887 | { |
881 | iw *w = (iw *)ev->ext_data; |
888 | iw *w = (iw *)ev->ext_data; |
882 | w->call (*w); |
889 | w->call (*w); |
… | |
… | |
1288 | const_iv (P_BLOCKSVIEW) |
1295 | const_iv (P_BLOCKSVIEW) |
1289 | const_iv (P_PLAYER) |
1296 | const_iv (P_PLAYER) |
1290 | const_iv (P_NO_MAGIC) |
1297 | const_iv (P_NO_MAGIC) |
1291 | const_iv (P_IS_ALIVE) |
1298 | const_iv (P_IS_ALIVE) |
1292 | const_iv (P_NO_CLERIC) |
1299 | const_iv (P_NO_CLERIC) |
1293 | const_iv (P_NEED_UPDATE) |
|
|
1294 | const_iv (P_OUT_OF_MAP) |
1300 | const_iv (P_OUT_OF_MAP) |
1295 | const_iv (P_NEW_MAP) |
1301 | const_iv (P_NEW_MAP) |
|
|
1302 | const_iv (P_UPTODATE) |
1296 | |
1303 | |
1297 | const_iv (UP_OBJ_INSERT) |
1304 | const_iv (UP_OBJ_INSERT) |
1298 | const_iv (UP_OBJ_REMOVE) |
1305 | const_iv (UP_OBJ_REMOVE) |
1299 | const_iv (UP_OBJ_CHANGE) |
1306 | const_iv (UP_OBJ_CHANGE) |
1300 | const_iv (UP_OBJ_FACE) |
1307 | const_iv (UP_OBJ_FACE) |
… | |
… | |
1595 | case 5: RETVAL = settings.playerdir; break; |
1602 | case 5: RETVAL = settings.playerdir; break; |
1596 | case 6: RETVAL = settings.datadir ; break; |
1603 | case 6: RETVAL = settings.datadir ; break; |
1597 | } |
1604 | } |
1598 | OUTPUT: RETVAL |
1605 | OUTPUT: RETVAL |
1599 | |
1606 | |
|
|
1607 | void abort () |
|
|
1608 | |
1600 | void emergency_save () |
1609 | void emergency_save () |
1601 | |
1610 | |
1602 | void _exit (int status = 0) |
1611 | void _exit (int status = 0) |
|
|
1612 | |
|
|
1613 | #if _POSIX_MEMLOCK |
|
|
1614 | |
|
|
1615 | int mlockall (int flags = MCL_CURRENT | MCL_FUTURE) |
|
|
1616 | |
|
|
1617 | int munlockall () |
|
|
1618 | |
|
|
1619 | #endif |
1603 | |
1620 | |
1604 | int find_animation (char *text) |
1621 | int find_animation (char *text) |
1605 | PROTOTYPE: $ |
1622 | PROTOTYPE: $ |
1606 | |
1623 | |
1607 | int random_roll (int min, int max, object *op, int goodbad); |
1624 | int random_roll (int min, int max, object *op, int goodbad); |
… | |
… | |
1913 | RETVAL = op->contr; |
1930 | RETVAL = op->contr; |
1914 | OUTPUT: RETVAL |
1931 | OUTPUT: RETVAL |
1915 | |
1932 | |
1916 | void check_score (object *op) |
1933 | void check_score (object *op) |
1917 | |
1934 | |
1918 | void cf_player_message (object *obj, char *txt, int flags = NDI_ORANGE | NDI_UNIQUE) |
1935 | void message (object *op, char *txt, int flags = NDI_ORANGE | NDI_UNIQUE) |
|
|
1936 | CODE: |
|
|
1937 | new_draw_info (flags, 0, op, txt); |
1919 | |
1938 | |
1920 | object *cf_player_send_inventory (object *op) |
1939 | object *cf_player_send_inventory (object *op) |
1921 | |
1940 | |
1922 | char *cf_player_get_ip (object *op) |
1941 | char *cf_player_get_ip (object *op) |
1923 | ALIAS: ip = 0 |
1942 | ALIAS: ip = 0 |
… | |
… | |
2177 | case 4: RETVAL = newSVuv ( GET_MAP_MOVE_BLOCK (obj, x, y)); break; |
2196 | case 4: RETVAL = newSVuv ( GET_MAP_MOVE_BLOCK (obj, x, y)); break; |
2178 | case 5: RETVAL = newSVuv ( GET_MAP_MOVE_SLOW (obj, x, y)); break; |
2197 | case 5: RETVAL = newSVuv ( GET_MAP_MOVE_SLOW (obj, x, y)); break; |
2179 | case 6: RETVAL = newSVuv ( GET_MAP_MOVE_ON (obj, x, y)); break; |
2198 | case 6: RETVAL = newSVuv ( GET_MAP_MOVE_ON (obj, x, y)); break; |
2180 | case 7: RETVAL = newSVuv ( GET_MAP_MOVE_OFF (obj, x, y)); break; |
2199 | case 7: RETVAL = newSVuv ( GET_MAP_MOVE_OFF (obj, x, y)); break; |
2181 | } |
2200 | } |
2182 | OUTPUT: |
2201 | OUTPUT: RETVAL |
2183 | RETVAL |
|
|
2184 | |
2202 | |
2185 | void fix_walls (maptile *map, int x, int y) |
2203 | void fix_walls (maptile *map, int x, int y) |
2186 | |
2204 | |
2187 | void fix_walls_around (maptile *map, int x, int y) |
2205 | void fix_walls_around (maptile *map, int x, int y) |
|
|
2206 | |
|
|
2207 | const char * |
|
|
2208 | region_name (maptile *m) |
|
|
2209 | CODE: |
|
|
2210 | RETVAL = get_name_of_region_for_map (m); |
|
|
2211 | OUTPUT: RETVAL |
2188 | |
2212 | |
2189 | # worst xs function of my life |
2213 | # worst xs function of my life |
2190 | maptile * |
2214 | maptile * |
2191 | _create_random_map (\ |
2215 | _create_random_map (\ |
2192 | char *path,\ |
2216 | char *path,\ |
… | |
… | |
2236 | assign (rmp.monsterstyle , monsterstyle); |
2260 | assign (rmp.monsterstyle , monsterstyle); |
2237 | assign (rmp.treasurestyle , treasurestyle); |
2261 | assign (rmp.treasurestyle , treasurestyle); |
2238 | assign (rmp.layoutstyle , layoutstyle); |
2262 | assign (rmp.layoutstyle , layoutstyle); |
2239 | assign (rmp.doorstyle , doorstyle); |
2263 | assign (rmp.doorstyle , doorstyle); |
2240 | assign (rmp.decorstyle , decorstyle); |
2264 | assign (rmp.decorstyle , decorstyle); |
2241 | assign (rmp.origin_map , origin_map); |
|
|
2242 | assign (rmp.final_map , final_map); |
|
|
2243 | assign (rmp.exitstyle , exitstyle); |
2265 | assign (rmp.exitstyle , exitstyle); |
2244 | assign (rmp.this_map , this_map); |
|
|
2245 | assign (rmp.exit_on_final_map, exit_on_final_map); |
2266 | assign (rmp.exit_on_final_map, exit_on_final_map); |
2246 | |
2267 | |
|
|
2268 | rmp.origin_map = origin_map; |
|
|
2269 | rmp.final_map = final_map; |
|
|
2270 | rmp.this_map = this_map; |
2247 | rmp.Xsize = Xsize; |
2271 | rmp.Xsize = Xsize; |
2248 | rmp.Ysize = Ysize; |
2272 | rmp.Ysize = Ysize; |
2249 | rmp.expand2x = expand2x; |
2273 | rmp.expand2x = expand2x; |
2250 | rmp.layoutoptions1 = layoutoptions1; |
2274 | rmp.layoutoptions1 = layoutoptions1; |
2251 | rmp.layoutoptions2 = layoutoptions2; |
2275 | rmp.layoutoptions2 = layoutoptions2; |
… | |
… | |
2298 | |
2322 | |
2299 | INCLUDE: $PERL genacc partylist ../include/player.h | |
2323 | INCLUDE: $PERL genacc partylist ../include/player.h | |
2300 | |
2324 | |
2301 | MODULE = cf PACKAGE = cf::region |
2325 | MODULE = cf PACKAGE = cf::region |
2302 | |
2326 | |
2303 | region *first () |
2327 | region *first () |
2304 | PROTOTYPE: |
2328 | PROTOTYPE: |
2305 | CODE: |
2329 | CODE: |
2306 | RETVAL = first_region; |
2330 | RETVAL = first_region; |
|
|
2331 | OUTPUT: RETVAL |
|
|
2332 | |
|
|
2333 | region *find (char *name) |
|
|
2334 | PROTOTYPE: $ |
|
|
2335 | CODE: |
|
|
2336 | RETVAL = get_region_by_name (name); |
2307 | OUTPUT: RETVAL |
2337 | OUTPUT: RETVAL |
2308 | |
2338 | |
2309 | INCLUDE: $PERL genacc region ../include/map.h | |
2339 | INCLUDE: $PERL genacc region ../include/map.h | |
2310 | |
2340 | |
2311 | MODULE = cf PACKAGE = cf::living |
2341 | MODULE = cf PACKAGE = cf::living |