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

Comparing deliantra/server/plugins/cfperl/cfperl.xs (file contents):
Revision 1.23 by root, Fri Feb 17 19:36:36 2006 UTC vs.
Revision 1.26 by root, Sat Feb 25 23:36:58 2006 UTC

29#include <XSUB.h> 29#include <XSUB.h>
30 30
31#undef save_long // clashes with libproto.h 31#undef save_long // clashes with libproto.h
32 32
33#define PLUGIN_NAME "perl" 33#define PLUGIN_NAME "perl"
34#define PLUGIN_VERSION "cfperl 0.1" 34#define PLUGIN_VERSION "cfperl 0.2"
35 35
36#ifndef __CEXTRACT__ 36#ifndef __CEXTRACT__
37#include <plugin.h> 37#include <plugin.h>
38#endif 38#endif
39 39
192 va_list args; 192 va_list args;
193 va_start (args, type); 193 va_start (args, type);
194 194
195 switch (type) 195 switch (type)
196 { 196 {
197#if 0
198 case CFAPI_INT16:
199 sv = newSViv (*va_arg (args, sint16_t *));
200 break;
201#endif
202
197 case CFAPI_INT: 203 case CFAPI_INT:
198 sv = newSViv (*va_arg (args, int *)); 204 sv = newSViv (*va_arg (args, int *));
199 break; 205 break;
200 206
201 case CFAPI_LONG: 207 case CFAPI_LONG:
1197 int unused_type; 1203 int unused_type;
1198 object_set_property (&unused_type, obj, idx, (double)SvNV (newval)); 1204 object_set_property (&unused_type, obj, idx, (double)SvNV (newval));
1199 } 1205 }
1200 break; 1206 break;
1201 case CFAPI_STRING: 1207 case CFAPI_STRING:
1202 cf_object_set_string_property (obj, idx, SvPV_nolen (newval)); 1208 cf_object_set_string_property (obj, idx, SvOK (newval) ? SvPV_nolen (newval) : 0);
1209 break;
1210 case CFAPI_POBJECT:
1211 {
1212 int unused_type;
1213 object_set_property (&unused_type, obj, idx, (object *)SvPTR_ornull (newval, "cf::object"));
1214 }
1203 break; 1215 break;
1204 default: 1216 default:
1205 croak ("unhandled type '%d' in set_property '%d'", type, idx); 1217 croak ("unhandled type '%d' in set_property '%d'", type, idx);
1206 } 1218 }
1207 1219

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines