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.18 by root, Mon Aug 28 07:07:42 2006 UTC vs.
Revision 1.19 by root, Mon Aug 28 07:54:11 2006 UTC

59 59
60typedef double val64; 60typedef double val64;
61#define newSVval64 newSVnv 61#define newSVval64 newSVnv
62#define SvVAL64 SvNV 62#define SvVAL64 SvNV
63 63
64static f_plug_api gethook; 64static f_plug_api gethook = cfapi_get_hooks;
65static f_plug_api systemDirectory; 65static f_plug_api object_set_property = cfapi_object_set_property;
66static f_plug_api object_set_property; 66static f_plug_api map_get_map = cfapi_map_get_map;
67static f_plug_api map_get_map; 67static f_plug_api object_insert = cfapi_object_insert;
68static f_plug_api object_insert;
69 68
70/* this is a stupid way to do things, and awkward to use for plug-in authors */ 69/* this is a stupid way to do things, and awkward to use for plug-in authors */
71typedef struct 70typedef struct
72{ 71{
73 object* who; 72 object* who;
481 480
482///////////////////////////////////////////////////////////////////////////// 481/////////////////////////////////////////////////////////////////////////////
483 482
484extern "C" int cfperl_initPlugin (const char *iversion, f_plug_api gethooksptr) 483extern "C" int cfperl_initPlugin (const char *iversion, f_plug_api gethooksptr)
485{ 484{
486 gethook = gethooksptr;
487
488 return 0; 485 return 0;
489} 486}
490 487
491static CommArray_s rtn_cmd; 488static CommArray_s rtn_cmd;
492 489
571 568
572extern "C" int cfperl_postInitPlugin () 569extern "C" int cfperl_postInitPlugin ()
573{ 570{
574 int hooktype = 1; 571 int hooktype = 1;
575 int rtype = 0; 572 int rtype = 0;
576
577 systemDirectory = (void* (*)(int*, ...)) gethook (&rtype, hooktype, "cfapi_system_directory");
578 object_set_property = (void* (*)(int*, ...)) gethook (&rtype, hooktype, "cfapi_object_set_property");
579 map_get_map = (void* (*)(int*, ...)) gethook (&rtype, hooktype, "cfapi_map_get_map");
580 object_insert = (void* (*)(int*, ...)) gethook (&rtype, hooktype, "cfapi_object_insert");
581 573
582 cf_init_plugin (gethook); 574 cf_init_plugin (gethook);
583 575
584 return 0; 576 return 0;
585} 577}
1521 PROTOTYPE: $$ 1513 PROTOTYPE: $$
1522 1514
1523char *path_combine_and_normalize (char *base, char *path) 1515char *path_combine_and_normalize (char *base, char *path)
1524 PROTOTYPE: $$ 1516 PROTOTYPE: $$
1525 1517
1526char * 1518const char *
1527cf_get_maps_directory (char *path) 1519get_maps_directory (char *path)
1528 PROTOTYPE: $ 1520 PROTOTYPE: $
1529 ALIAS: maps_directory = 0 1521 ALIAS: maps_directory = 0
1522 CODE:
1523 RETVAL = create_pathname (path);
1524 OUTPUT: RETVAL
1530 1525
1531void 1526void
1532sub_generation_inc () 1527sub_generation_inc ()
1533 CODE: 1528 CODE:
1534 PL_sub_generation++; 1529 PL_sub_generation++;
1543 confdir = 3 1538 confdir = 3
1544 localdir = 4 1539 localdir = 4
1545 playerdir = 5 1540 playerdir = 5
1546 datadir = 6 1541 datadir = 6
1547 CODE: 1542 CODE:
1548{ 1543 switch (ix)
1549 int unused_type; 1544 {
1550 RETVAL = (char *)systemDirectory (&unused_type, ix); 1545 case 0: RETVAL = settings.mapdir ; break;
1551} 1546 case 1: RETVAL = settings.uniquedir; break;
1547 case 2: RETVAL = settings.tmpdir ; break;
1548 case 3: RETVAL = settings.confdir ; break;
1549 case 4: RETVAL = settings.localdir ; break;
1550 case 5: RETVAL = settings.playerdir; break;
1551 case 6: RETVAL = settings.datadir ; break;
1552 }
1552 OUTPUT: RETVAL 1553 OUTPUT: RETVAL
1553 1554
1554int 1555int
1555cf_find_animation (char *text) 1556cf_find_animation (char *text)
1556 PROTOTYPE: $ 1557 PROTOTYPE: $
2154cf_map_normalise (mapstruct *map, int x, int y) 2155cf_map_normalise (mapstruct *map, int x, int y)
2155 PPCODE: 2156 PPCODE:
2156{ 2157{
2157 mapstruct *nmap = 0; 2158 mapstruct *nmap = 0;
2158 I16 nx = 0, ny = 0; 2159 I16 nx = 0, ny = 0;
2159 int flags = cf_map_get_flags (map, &nmap, x, y, &nx, &ny); 2160 int flags = get_map_flags (map, &nmap, x, y, &nx, &ny);
2160 2161
2161 EXTEND (SP, 4); 2162 EXTEND (SP, 4);
2162 PUSHs (sv_2mortal (newSViv (flags))); 2163 PUSHs (sv_2mortal (newSViv (flags)));
2163 2164
2164 if (GIMME_V == G_ARRAY) 2165 if (GIMME_V == G_ARRAY)
2176{ 2177{
2177 object *o; 2178 object *o;
2178 mapstruct *nmap = 0; 2179 mapstruct *nmap = 0;
2179 I16 nx, ny; 2180 I16 nx, ny;
2180 2181
2181 cf_map_get_flags (map, &nmap, x, y, &nx, &ny); 2182 get_map_flags (map, &nmap, x, y, &nx, &ny);
2182 2183
2183 if (nmap) 2184 if (nmap)
2184 for (o = GET_MAP_OB (nmap, nx, ny); o; o = o->above) 2185 for (o = GET_MAP_OB (nmap, nx, ny); o; o = o->above)
2185 XPUSHs (sv_2mortal (newSVcfapi (CFAPI_POBJECT, o))); 2186 XPUSHs (sv_2mortal (newSVcfapi (CFAPI_POBJECT, o)));
2186} 2187}
2245 } 2246 }
2246 } 2247 }
2247} 2248}
2248 2249
2249 2250
2250MODULE = cf PACKAGE = cf::arch PREFIX = cf_archetype_ 2251MODULE = cf PACKAGE = cf::arch
2251 2252
2252archetype *cf_archetype_get_first() 2253archetype *first()
2253 PROTOTYPE: 2254 PROTOTYPE:
2254 ALIAS: first = 0 2255 CODE:
2256 RETVAL = first_archetype;
2257 OUTPUT: RETVAL
2255 2258
2256archetype *cf_archetype_get_next (archetype *arch) 2259archetype *next (archetype *arch)
2257 ALIAS: next = 0 2260 CODE:
2261 RETVAL = arch->next;
2262 OUTPUT: RETVAL
2258 2263
2259archetype *cf_archetype_get_head (archetype *arch) 2264archetype *head (archetype *arch)
2260 ALIAS: head = 0 2265 CODE:
2266 RETVAL = arch->head;
2267 OUTPUT: RETVAL
2261 2268
2262archetype *cf_archetype_get_more (archetype *arch) 2269archetype *more (archetype *arch)
2263 ALIAS: more = 0 2270 CODE:
2271 RETVAL = arch->more;
2272 OUTPUT: RETVAL
2264 2273
2265const char *cf_archetype_get_name (archetype *arch) 2274const char *name (archetype *arch)
2266 ALIAS: name = 0 2275 CODE:
2276 RETVAL = arch->name;
2277 OUTPUT: RETVAL
2267 2278
2268object *cf_archetype_get_clone (archetype *arch) 2279object *clone (archetype *arch)
2269 ALIAS: clone = 0 2280 CODE:
2281 RETVAL = &arch->clone;
2282 OUTPUT: RETVAL
2270 2283
2271MODULE = cf PACKAGE = cf::party PREFIX = cf_party_ 2284MODULE = cf PACKAGE = cf::party
2272 2285
2273partylist *cf_party_get_first () 2286partylist *first ()
2274 PROTOTYPE: 2287 PROTOTYPE:
2275 ALIAS: first = 0 2288 CODE:
2289 RETVAL = get_firstparty ();
2290 OUTPUT: RETVAL
2276 2291
2277partylist *cf_party_get_next (partylist *party) 2292partylist *next (partylist *party)
2278 ALIAS: next = 0 2293 CODE:
2294 RETVAL = party->next;
2295 OUTPUT: RETVAL
2279 2296
2280const char *cf_party_get_name (partylist *party) 2297const char *name (partylist *party)
2298 CODE:
2299 RETVAL = party->partyname;
2300 OUTPUT: RETVAL
2281 2301
2282const char *cf_party_get_password (partylist *party) 2302const char *password (partylist *party)
2283 ALIAS: password = 0 2303 CODE:
2304 RETVAL = party->passwd;
2305 OUTPUT: RETVAL
2284 2306
2285player *cf_party_get_first_player (partylist *party) 2307MODULE = cf PACKAGE = cf::region
2286 ALIAS: first_player = 0
2287 2308
2288player *cf_party_get_next_player (partylist *party, player *op) 2309region *first ()
2289 ALIAS: next_player = 0
2290
2291
2292MODULE = cf PACKAGE = cf::region PREFIX = cf_region_
2293
2294region *cf_region_get_first ()
2295 PROTOTYPE: 2310 PROTOTYPE:
2296 ALIAS: first = 0 2311 CODE:
2312 RETVAL = first_region;
2313 OUTPUT: RETVAL
2297 2314
2315region *next (region *reg)
2316 CODE:
2317 RETVAL = reg->next;
2318 OUTPUT: RETVAL
2319
2320const char *name (region *reg)
2321 CODE:
2322 RETVAL = reg->name;
2323 OUTPUT: RETVAL
2324
2325region *parent (region *reg)
2326 CODE:
2327 RETVAL = reg->parent;
2328 OUTPUT: RETVAL
2329
2298const char *cf_region_get_name (region *reg) 2330const char *longname (region *reg)
2299 ALIAS: name = 0 2331 CODE:
2332 RETVAL = reg->longname;
2333 OUTPUT: RETVAL
2300 2334
2301region *cf_region_get_next (region *reg) 2335const char *msg (region *reg)
2302 ALIAS: next = 0 2336 CODE:
2337 RETVAL = reg->msg;
2338 OUTPUT: RETVAL
2303 2339
2304region *cf_region_get_parent (region *reg) 2340MODULE = cf PACKAGE = cf::living
2305 ALIAS: parent = 0
2306
2307const char *cf_region_get_longname (region *reg)
2308 ALIAS: longname = 0
2309
2310const char *cf_region_get_message (region *reg)
2311 ALIAS: message = 0
2312
2313
2314MODULE = cf PACKAGE = cf::living PREFIX = cf_living_
2315 2341
2316val64 2342val64
2317exp (living *liv, val64 new_val = 0) 2343exp (living *liv, val64 new_val = 0)
2318 PROTOTYPE: $;$ 2344 PROTOTYPE: $;$
2319 ALIAS: 2345 ALIAS:

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines