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.1 by root, Fri Feb 3 07:25:25 2006 UTC vs.
Revision 1.4 by root, Fri Feb 3 17:19:13 2006 UTC

281 char *propname; 281 char *propname;
282 int i; 282 int i;
283 va_start (args, type); 283 va_start (args, type);
284 propname = va_arg (args, char *); 284 propname = va_arg (args, char *);
285 //printf ("Property name: %s\n", propname); 285 //printf ("Property name: %s\n", propname);
286 286
287 if (!strcmp (propname, "command?")) 287 if (!strcmp (propname, "command?"))
288 { 288 {
289 if (!perl)
290 return NULL;
291
289 const char *cmdname = va_arg (args, const char *); 292 const char *cmdname = va_arg (args, const char *);
290 HV *hv = get_hv ("cf::COMMAND", 1); 293 HV *hv = get_hv ("cf::COMMAND", 1);
291 SV **svp = hv_fetch (hv, cmdname, strlen (cmdname) + 1, 0); 294 SV **svp = hv_fetch (hv, cmdname, strlen (cmdname) + 1, 0);
292 295
293 va_end (args); 296 va_end (args);
354 char *argv[] = { 357 char *argv[] = {
355 "", 358 "",
356 "-e" 359 "-e"
357 "BEGIN {" 360 "BEGIN {"
358 " cf->bootstrap;" 361 " cf->bootstrap;"
359 " unshift @INC, cf::get_maps_directory ('perl');" 362 " unshift @INC, cf::maps_directory ('perl');"
360 "}" 363 "}"
361 "" 364 ""
362 "use cf;" 365 "use cf;"
363 }; 366 };
364 367
994LOG (int level, char *msg) 997LOG (int level, char *msg)
995 C_ARGS: level, "%s", msg 998 C_ARGS: level, "%s", msg
996 999
997char * 1000char *
998cf_get_maps_directory (char *path) 1001cf_get_maps_directory (char *path)
1002 ALIAS: maps_directory = 0
1003
1004int
1005cf_find_animation (char *text)
999 1006
1000MODULE = cf PACKAGE = cf::object PREFIX = cf_object_ 1007MODULE = cf PACKAGE = cf::object PREFIX = cf_object_
1001 1008
1002PROTOTYPES: DISABLE 1009PROTOTYPES: DISABLE
1003 1010
1004SV * 1011SV *
1005cf_object_get_property (object *obj, int type, int idx) 1012get_property (object *obj, int type, int idx)
1006 CODE: 1013 CODE:
1007 RETVAL = newSVcfapi (type, cf_object_get_property (obj, idx)); 1014 RETVAL = newSVcfapi (type, cf_object_get_property (obj, idx));
1008 OUTPUT: 1015 OUTPUT:
1009 RETVAL 1016 RETVAL
1010 1017
1018SV *
1019set_property (object *obj, int type, int idx, SV *newval)
1020 CODE:
1021 switch (type)
1022 {
1023 case CFAPI_INT:
1024 cf_object_set_int_property (obj, idx, SvIV (newval));
1025 break;
1026 case CFAPI_LONG:
1027 cf_object_set_long_property (obj, idx, SvNV (newval));
1028 break;
1029 case CFAPI_STRING:
1030 cf_object_set_string_property (obj, idx, SvPV_nolen (newval));
1031 break;
1032 default:
1033 croak ("unhandled type '%d' in set_property '%d'", type, idx);
1034 }
1035
1011int cf_object_get_resistance (object *op, int rtype) 1036int cf_object_get_resistance (object *op, int rtype)
1037 ALIAS: resistance = 0
1012 1038
1013int cf_object_get_flag (object *op, int flag) 1039int cf_object_get_flag (object *op, int flag)
1014 ALIAS: flag = 0 1040 ALIAS: flag = 0
1015 1041
1016void cf_object_set_flag (object *op, int flag, int value) 1042void cf_object_set_flag (object *op, int flag, int value)
1046void cf_object_forget_spell (object *op, object *sp) 1072void cf_object_forget_spell (object *op, object *sp)
1047 1073
1048object *cf_object_check_for_spell (object *op, char *spellname) 1074object *cf_object_check_for_spell (object *op, char *spellname)
1049 1075
1050int cf_object_query_money (object *op) 1076int cf_object_query_money (object *op)
1077 ALIAS: money = 0
1051 1078
1052int cf_object_query_cost (object *op, object *who, int flags) 1079int cf_object_query_cost (object *op, object *who, int flags)
1080 ALIAS: cost = 0
1053 1081
1054void cf_object_activate_rune (object *op , object *victim) 1082void cf_object_activate_rune (object *op , object *victim)
1055 1083
1056int cf_object_check_trigger (object *op, object *cause) 1084int cf_object_check_trigger (object *op, object *cause)
1057 1085
1066void cf_object_speak (object *op, char *msg) 1094void cf_object_speak (object *op, char *msg)
1067 1095
1068object *cf_object_insert_object (object *op, object *container) 1096object *cf_object_insert_object (object *op, object *container)
1069 1097
1070const char *cf_object_get_msg (object *ob) 1098const char *cf_object_get_msg (object *ob)
1099 ALIAS: msg = 0
1071 1100
1072object *cf_object_insert_in_ob (object *ob, object *where) 1101object *cf_object_insert_in_ob (object *ob, object *where)
1073 1102
1074int cf_object_teleport (object *op, mapstruct *map, int x, int y) 1103int cf_object_teleport (object *op, mapstruct *map, int x, int y)
1075 1104
1076void cf_object_update (object *op, int flags) 1105void cf_object_update (object *op, int flags)
1077 1106
1078void cf_object_pickup (object *op, object *what) 1107void cf_object_pickup (object *op, object *what)
1079 1108
1080char *cf_object_get_key (object *op, char *keyname) 1109char *cf_object_get_key (object *op, char *keyname)
1110 ALIAS: key = 0
1081 1111
1082void cf_object_set_key (object *op, char *keyname, char *value) 1112void cf_object_set_key (object *op, char *keyname, char *value)
1083 1113
1084char * 1114char *
1085base_name (object *ob, int plural) 1115base_name (object *ob, int plural)
1089 RETVAL 1119 RETVAL
1090 1120
1091MODULE = cf PACKAGE = cf::object PREFIX = cf_object_ 1121MODULE = cf PACKAGE = cf::object PREFIX = cf_object_
1092 1122
1093object *cf_create_object () 1123object *cf_create_object ()
1124 ALIAS: new = 0
1094 1125
1095object *cf_create_object_by_name (const char *name) 1126object *cf_create_object_by_name (const char *name)
1127 ALIAS: new_from_name = 0
1096 1128
1097void cf_free_object (object *ob) 1129void cf_free_object (object *ob)
1098 1130
1099void cf_fix_object (object *pl) 1131void cf_fix_object (object *pl)
1100 1132
1111 1143
1112void cf_player_message (object *obj, char *txt, int flags = 0) 1144void cf_player_message (object *obj, char *txt, int flags = 0)
1113 1145
1114object *cf_player_send_inventory (object *op) 1146object *cf_player_send_inventory (object *op)
1115 1147
1148void cf_player_set_marked_item(object *op, object *ob)
1149
1150void cf_player_set_party(object *op, partylist *party)
1151
1116 1152
1117MODULE = cf PACKAGE = cf::object::map PREFIX = cf_ 1153MODULE = cf PACKAGE = cf::object::map PREFIX = cf_
1118
1119mapstruct *cf_map_get_map (char *name)
1120
1121mapstruct *cf_map_get_first ()
1122
1123object *cf_map_insert_object_there (mapstruct *where, object *op, object *originator, int flags)
1124
1125object *cf_map_insert_object (mapstruct *where, object* op, int x, int y)
1126
1127object* cf_map_present_arch_by_name (mapstruct *map, const char* str, int nx, int ny)
1128 C_ARGS: str, map, nx, ny
1129
1130#int cf_map_get_flags (mapstruct* map, mapstruct** nmap, I16 x, I16 y, I16 *nx, I16 *ny)
1131
1132 1154
1133MODULE = cf PACKAGE = cf::player PREFIX = cf_ 1155MODULE = cf PACKAGE = cf::player PREFIX = cf_
1134 1156
1135player *cf_player_find (char *name) 1157player *cf_player_find (char *name)
1136 1158
1144 CODE: 1166 CODE:
1145 RETVAL = newSVcfapi (type, cf_map_get_property (obj, idx)); 1167 RETVAL = newSVcfapi (type, cf_map_get_property (obj, idx));
1146 OUTPUT: 1168 OUTPUT:
1147 RETVAL 1169 RETVAL
1148 1170
1171SV *
1172set_property (mapstruct *obj, int type, int idx, SV *newval)
1173 CODE:
1174 switch (type)
1175 {
1176 case CFAPI_INT:
1177 cf_map_set_int_property (obj, idx, SvIV (newval));
1178 break;
1179 default:
1180 croak ("unhandled type '%d' in set_property '%d'", type, idx);
1181 }
1182
1183mapstruct *cf_map_get_map (char *name)
1184 ALIAS: map = 0
1185
1186mapstruct *cf_map_get_first ()
1187 ALIAS: first = 0
1188
1189object *cf_map_insert_object_there (mapstruct *where, object *op, object *originator, int flags)
1190
1191object *cf_map_insert_object (mapstruct *where, object* op, int x, int y)
1192
1193object* cf_map_present_arch_by_name (mapstruct *map, const char* str, int nx, int ny)
1194 C_ARGS: str, map, nx, ny
1195
1196#int cf_map_get_flags (mapstruct* map, mapstruct** nmap, I16 x, I16 y, I16 *nx, I16 *ny)
1197
1198
1149 1199
1150MODULE = cf PACKAGE = cf::arch PREFIX = cf_archetype_ 1200MODULE = cf PACKAGE = cf::arch PREFIX = cf_archetype_
1151 1201
1152archetype*cf_archetype_get_first() 1202archetype*cf_archetype_get_first()
1203 ALIAS: first = 0
1204
1205archetype *cf_archetype_get_next (archetype *arch)
1206 ALIAS: next = 0
1207
1208archetype *cf_archetype_get_head (archetype *arch)
1209 ALIAS: head = 0
1210
1211archetype *cf_archetype_get_more (archetype *arch)
1212 ALIAS: more = 0
1153 1213
1154const char *cf_archetype_get_name (archetype *arch) 1214const char *cf_archetype_get_name (archetype *arch)
1155 1215 ALIAS: name = 0
1156archetype *cf_archetype_get_next (archetype *arch)
1157
1158archetype *cf_archetype_get_more (archetype *arch)
1159
1160archetype *cf_archetype_get_head (archetype *arch)
1161 1216
1162MODULE = cf PACKAGE = cf::party PREFIX = cf_party_ 1217MODULE = cf PACKAGE = cf::party PREFIX = cf_party_
1163 1218
1164const char *cf_party_get_name (partylist *party) 1219const char *cf_party_get_name (partylist *party)
1165 1220

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines