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.45 by root, Fri Sep 8 16:51:44 2006 UTC vs.
Revision 1.46 by root, Fri Sep 8 17:34:02 2006 UTC

189//TODO: 189//TODO:
190inline SV *to_sv (New_Face * v) { return to_sv (v->name); } 190inline SV *to_sv (New_Face * v) { return to_sv (v->name); }
191inline SV *to_sv (treasurelist * v) { return to_sv (v->name); } 191inline SV *to_sv (treasurelist * v) { return to_sv (v->name); }
192 192
193inline void sv_to (SV *sv, shstr &v) { v = SvPV_nolen (sv); } 193inline void sv_to (SV *sv, shstr &v) { v = SvPV_nolen (sv); }
194inline void sv_to (SV *sv, char * &v) { v = strdup (SvPV_nolen (sv)); } //TODO: verify that all simple pointers are strdup-managed 194inline void sv_to (SV *sv, char * &v) { free (v); v = strdup (SvPV_nolen (sv)); } //TODO: verify that all simple pointers are strdup-managed
195inline void sv_to (SV *sv, bool &v) { v = SvIV (sv); } 195inline void sv_to (SV *sv, bool &v) { v = SvIV (sv); }
196inline void sv_to (SV *sv, signed char &v) { v = SvIV (sv); } 196inline void sv_to (SV *sv, signed char &v) { v = SvIV (sv); }
197inline void sv_to (SV *sv, unsigned char &v) { v = SvIV (sv); } 197inline void sv_to (SV *sv, unsigned char &v) { v = SvIV (sv); }
198inline void sv_to (SV *sv, signed short &v) { v = SvIV (sv); } 198inline void sv_to (SV *sv, signed short &v) { v = SvIV (sv); }
199inline void sv_to (SV *sv, unsigned short &v) { v = SvIV (sv); } 199inline void sv_to (SV *sv, unsigned short &v) { v = SvIV (sv); }
1759 1759
1760INCLUDE: $PERL genacc object ../include/object.h | 1760INCLUDE: $PERL genacc object ../include/object.h |
1761 1761
1762# missing properties 1762# missing properties
1763 1763
1764void
1765set_attacktype (object *obj, U32 attacktype)
1766 CODE:
1767 obj->attacktype = attacktype;
1768
1769U32
1770get_attacktype (object *obj)
1771 ALIAS:
1772 attacktype = 0
1773 CODE:
1774 RETVAL = obj->attacktype;
1775 OUTPUT: RETVAL
1776
1777int flag (object *op, int flag, int value = 1) 1764int flag (object *op, int flag, int value = 1)
1778 PROTOTYPE: $$;$ 1765 PROTOTYPE: $$;$
1779 CODE: 1766 CODE:
1780 RETVAL = QUERY_FLAG (op, flag); 1767 RETVAL = QUERY_FLAG (op, flag);
1781 if (items >= 3) 1768 if (items >= 3)
2082 if (new_value >= 0) 2069 if (new_value >= 0)
2083 pl->listening = new_value; 2070 pl->listening = new_value;
2084 OUTPUT: 2071 OUTPUT:
2085 RETVAL 2072 RETVAL
2086 2073
2087void savebed (player *pl, char *map_path = 0, int x = -1, int y = -1) 2074void savebed (player *pl, SV *map_path = 0, SV *x = 0, SV *y = 0)
2088 PROTOTYPE: $;$$$ 2075 PROTOTYPE: $;$$$
2089 ALIAS:
2090 savebed = 0
2091 PPCODE: 2076 PPCODE:
2092 if (GIMME_V != G_VOID) 2077 if (GIMME_V != G_VOID)
2093 { 2078 {
2094 EXTEND (SP, 3); 2079 EXTEND (SP, 3);
2095 PUSHs (sv_2mortal (newSVpv (pl->savebed_map, 0))); 2080 PUSHs (sv_2mortal (newSVpv (pl->savebed_map, 0)));
2096 PUSHs (sv_2mortal (newSViv (pl->bed_x))); 2081 PUSHs (sv_2mortal (newSViv (pl->bed_x)));
2097 PUSHs (sv_2mortal (newSViv (pl->bed_y))); 2082 PUSHs (sv_2mortal (newSViv (pl->bed_y)));
2098 } 2083 }
2099 if (map_path) strcpy (pl->savebed_map, map_path); 2084 if (map_path) sv_to (map_path, pl->savebed_map);
2100 if (x >= 0) pl->bed_x = x; 2085 if (x) sv_to (x, pl->bed_x);
2101 if (y >= 0) pl->bed_y = y; 2086 if (y) sv_to (y, pl->bed_y);
2102 2087
2103void 2088void
2104list () 2089list ()
2105 PPCODE: 2090 PPCODE:
2106{ 2091{
2197int in_memory (mapstruct *map) 2182int in_memory (mapstruct *map)
2198 CODE: 2183 CODE:
2199 RETVAL = map->in_memory; 2184 RETVAL = map->in_memory;
2200 OUTPUT: 2185 OUTPUT:
2201 RETVAL 2186 RETVAL
2202
2203bool unique (mapstruct *map)
2204 CODE:
2205 RETVAL = map->unique;
2206 OUTPUT:
2207 RETVAL
2208
2209void set_unique (mapstruct *map, bool unique)
2210 CODE:
2211 map->unique = unique;
2212 2187
2213void 2188void
2214trigger (mapstruct *map, long connection, bool state = true) 2189trigger (mapstruct *map, long connection, bool state = true)
2215 CODE: 2190 CODE:
2216 activate_connection (map, connection, state); 2191 activate_connection (map, connection, state);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines