comparison arogue7/rogue.h @ 219:f9ef86cf22b2

Advanced Rogue 7: convert to ANSI-style function declarations. Almost 1500 lines of compiler warnings remain, and the GCC developers are already working on a new version with even more warnings turned on by default.
author John "Elwin" Edwards
date Fri, 19 Feb 2016 21:02:28 -0500
parents aa8e1fc62926
children b67b99f6c92b
comparison
equal deleted inserted replaced
218:56e748983fa8 219:f9ef86cf22b2
1119 void *varg; 1119 void *varg;
1120 } d_; 1120 } d_;
1121 int d_time; 1121 int d_time;
1122 } ; 1122 } ;
1123 1123
1124 struct linked_list *find_mons(), *find_obj(), *get_item(), *new_item(), 1124 void _attach(struct linked_list **list, struct linked_list *item);
1125 *new_thing(), *wake_monster(), *get_hurl(), 1125 void _detach(struct linked_list **list, struct linked_list *item);
1126 *spec_item(), *creat_item(), *wield_weap(); 1126 void _o_free_list(struct linked_list **ptr);
1127 struct room *roomin(); 1127 void _r_free_list(struct linked_list **ptr);
1128 struct trap *trap_at(); 1128 void _t_free_list(struct linked_list **ptr);
1129 1129 int ac_compute(bool ignoremetal);
1130 /* char *malloc(), *getenv(), *tr_name(), *new(), *sprintf(), */ 1130 void activity(void);
1131 char *getenv(), *tr_name(), *new(), 1131 void add_charisma(int change);
1132 *vowelstr(), *inv_name(), *strcpy(), *strcat(); 1132 void add_constitution(int change);
1133 char *num(), *ring_num(), *misc_num(), *blesscurse(), *p_kind(), 1133 void add_dexterity(int change);
1134 *typ_name(), *prname(), *monster_name(), *weap_name(), *misc_name(); 1134 void add_haste(bool blessed);
1135 coord *rndmove(), *can_shoot(), *fallpos(), *doorway(), get_coordinates(); 1135 void add_intelligence(int change);
1136 short randmonster(), id_monst(), movement(); 1136 bool add_pack(struct linked_list *item, bool silent,
1137 void quit(int), auto_save(int), bugkill(int), endit(int), tstp(int), 1137 struct linked_list **packret);
1138 byebye(int); 1138 void add_slow(void);
1139 int nohaste(), spell_recovery(), 1139 void add_strength(int change);
1140 doctor(), runners(), swander(), unconfuse(), unsee(), fumble(), 1140 void add_wisdom(int change);
1141 unclrhead(), unphase(), noslow(), rollwand(), stomach(), sight(), 1141 void addmsg(char *fmt, ...);
1142 unstink(), suffocate(), cure_disease(), shoot_bolt(), changeclass(), 1142 void affect(void);
1143 appear(), dust_appear(), unchoke(), alchemy(), trap_look(), strangle(), 1143 void aggravate(bool do_uniques, bool do_good);
1144 ring_teleport(), ring_search(), grab(), dsrpt_player(), quill_charge(), 1144 void alchemy(struct object *obj);
1145 make_sell_pack(), unskill(), findmindex(), nobolt(), nofire(), nocold(), 1145 void appear(void);
1146 usage_time(), eat_gold(), chant_recovery(), prayer_recovery(), 1146 bool attack(struct thing *mp, struct object *weapon, bool thrown);
1147 dsrpt_monster(); 1147 void auto_save(int sig);
1148 bool blue_light(), can_blink(), creat_mons(), add_pack(), 1148 char be_trapped(struct thing *th, coord *tc);
1149 straight_shot(), maze_view(), lit_room(), getdelta(), save_file(), 1149 bool blue_light(bool blessed, bool cursed);
1150 save_game(), m_use_it(), m_use_pack(), get_dir(), need_dir(); 1150 void bugkill(int sig);
1151 long lseek(), check_level(); 1151 void buy_it(void);
1152 void genmonsters(), 1152 void byebye(int sig);
1153 add_intelligence(), add_strength(), add_wisdom(), add_dexterity(), 1153 bool can_blink(struct thing *tp);
1154 add_constitution(), add_charisma(), res_intelligence(), res_strength(int), 1154 coord *can_shoot(coord *er, coord *ee);
1155 res_wisdom(), res_dexterity(), res_constitution(), res_charisma(); 1155 bool cansee(int y, int x);
1156 1156 void carry_obj(struct thing *mp, int chance);
1157 void writelog(unsigned long amount, int flags, short monst); 1157 void cast(void);
1158 void changeclass(int newclass);
1159 void chant(void);
1160 void chant_recovery(void);
1161 void chase(struct thing *tp, coord *ee, struct room *rer, struct room *ree,
1162 bool flee);
1163 long check_level(void);
1164 void check_residue(struct thing *tp);
1165 void chg_str(int amt);
1166 void cloak_charge(struct object *obj);
1167 void command(void);
1168 void confus_player(void);
1169 int const_bonus(void);
1170 void corr_move(int dy, int dx);
1171 struct linked_list *creat_item(void);
1172 bool creat_mons(struct thing *person, short monster, bool report);
1173 void create_obj(bool prompt, int which_item, int which_type);
1174 void cur_null(struct object *op);
1175 void cure_disease(void);
1176 void dbotline(WINDOW *scr, char *message);
1177 void death(short monst);
1178 void del_pack(struct linked_list *item);
1179 void destroy_item(struct linked_list *item);
1180 int dex_compute(void);
1181 int dext_plus(int dexterity);
1182 int dext_prot(int dexterity);
1183 bool diag_ok(coord *sp, coord *ep, struct thing *flgptr);
1184 void dip_it(void);
1185 void do_chase(struct thing *th);
1186 void do_daemons(int flag);
1187 void do_fuses(int flag);
1188 void do_maze(void);
1189 void do_motion(struct object *obj, int ydelta, int xdelta, struct thing *tp);
1190 void do_move(int dy, int dx);
1191 void do_passages(void);
1192 void do_post(bool startup);
1193 void do_rooms(void);
1194 void do_run(char ch);
1195 void do_terrain(int basey, int basex, int deltay, int deltax, bool fresh);
1196 void do_zap(struct thing *zapper, struct object *obj, coord *direction,
1197 int which, int flags);
1198 void doctor(struct thing *tp);
1199 coord *doorway(struct room *rp, coord *door);
1200 void draw_room(struct room *rp);
1201 int dress_units(struct linked_list *item);
1202 bool drop(struct linked_list *item);
1203 bool dropcheck(struct object *op);
1204 void dsrpt_monster(struct thing *tp, bool always, bool see_him);
1205 void dsrpt_player(void);
1206 void dust_appear(void);
1207 void eat(void);
1208 void eat_gold(struct object *obj);
1209 int effect(struct thing *att, struct thing *def, struct object *weap,
1210 bool thrown, bool see_att, bool see_def);
1211 int encread(char *start, unsigned int size, int inf);
1212 int encwrite(char *start, unsigned int size, int outf);
1213 void endmsg(void);
1214 void explode(struct thing *tp);
1215 void extinguish(int (*func)());
1216 void fall(struct linked_list *item, bool pr);
1217 coord *fallpos(coord *pos, bool be_clear, int range);
1218 void fatal(char *s);
1219 bool fight(coord *mp, struct object *weap, bool thrown);
1220 struct linked_list *find_mons(int y, int x);
1221 struct linked_list *find_obj(int y, int x);
1222 struct delayed_action *find_slot(int (*func)());
1223 int findmindex(char *name);
1224 void fix_stick(struct object *cur);
1225 void fumble(void);
1226 void fuse(int (*func)(), int arg, int time, int type);
1227 void genmonsters(int least, bool treas);
1228 coord get_coordinates(void);
1229 bool get_dir(coord *direction);
1230 struct linked_list *get_hurl(struct thing *tp);
1231 struct linked_list *get_item(struct linked_list *list, char *purpose, int type,
1232 bool askfirst, bool showcost);
1233 int get_str(char *opt, WINDOW *win);
1234 int get_worth(struct object *obj);
1235 int getdeath(void);
1236 bool getdelta(char match, int *dy, int *dx);
1237 int grab(int y, int x);
1238 void gsense(void);
1239 bool hit_monster(int y, int x, struct object *obj, struct thing *tp);
1240 int hitweight(void);
1241 short id_monst(char monster);
1242 void idenpack(void);
1243 void init_colors(void);
1244 void init_foods(void);
1245 void init_materials(void);
1246 void init_misc(void);
1247 void init_names(void);
1248 void init_player(void);
1249 void init_stones(void);
1250 void init_terrain(void);
1251 void init_things(void);
1252 void init_weapon(struct object *weap, char type);
1253 char *inv_name(struct object *obj, bool drop);
1254 bool inventory(struct linked_list *list, int type);
1255 bool is_current(struct object *obj);
1256 bool is_magic(struct object *obj);
1257 bool isatrap(char ch);
1258 int itemweight(struct object *wh);
1259 void kill_daemon(int (*func)());
1260 void killed(struct linked_list *item, bool pr, bool points, bool treasure);
1261 void lake_check(coord *place);
1262 void land(void);
1263 void lengthen(int (*func)(), int xtime);
1264 void light(coord *cp);
1265 bool lit_room(struct room *rp);
1266 void look(bool wakeup, bool runend);
1267 void lower_level(short who);
1268 void m_use_relic(struct thing *monster);
1269 void m_use_wand(struct thing *monster);
1270 void make_sell_pack(struct thing *tp);
1271 short makemonster(bool showall, char *label, char *action) ;
1272 bool maze_view(int y, int x);
1273 char *misc_name(struct object *obj);
1274 void missile(int ydelta, int xdelta, struct linked_list *item,
1275 struct thing *tp);
1276 char *monster_name(struct thing *tp);
1277 bool move_hero(int why);
1278 short movement(struct thing *tp);
1279 void msg(char *fmt, ...);
1280 void nameitem(struct linked_list *item, bool mark);
1281 bool need_dir(int type, int which);
1282 unsigned long netread(int *error, int size, FILE *stream);
1283 int netwrite(unsigned long value, int size, FILE *stream);
1284 char *new(int size);
1285 struct linked_list *new_item(int size);
1286 void new_level(LEVTYPE ltype);
1287 void new_monster(struct linked_list *item, short type, coord *cp,
1288 bool max_monster);
1289 struct linked_list *new_thing(int thing_type, bool allow_curse);
1290 void nobolt(void);
1291 void nocold(void);
1292 void nofire(void);
1293 void nohaste(void);
1294 void noslow(void);
1295 char *num(int n1, int n2);
1296 void o_discard(struct linked_list *item);
1297 void option(void);
1298 void over_win(WINDOW *oldwin, WINDOW *newin, int maxy, int maxx, int cursory,
1299 int cursorx, char redraw);
1300 char pack_char(struct linked_list *list, struct object *obj);
1301 void parse_opts(char *str);
1302 bool passwd(void);
1303 void picky_inven(void);
1304 bool player_zap(int which, int flag);
1305 void playit(void);
1306 void pray(void);
1307 void prayer_recovery(void);
1308 bool price_it(void);
1309 char *prname(char *who, bool upper);
1310 void quaff(int which, int kind, int flags, bool is_potion);
1311 void quill_charge(void);
1312 void quit(int sig);
1313 void raise_level(void);
1314 short randmonster(bool wander, bool no_unique);
1315 void read_scroll(int which, int flag, bool is_scroll);
1316 int readchar(void);
1317 void res_charisma(int howmuch);
1318 void res_constitution(int howmuch);
1319 void res_dexterity(int howmuch);
1320 void res_intelligence(int howmuch);
1321 void res_strength(int howmuch);
1322 void res_wisdom(int howmuch);
1323 bool restore(char *file, char *envp[]);
1324 void restscr(WINDOW *scr);
1325 int ring_eat(int hand);
1326 char *ring_num(struct object *obj);
1327 int ring_value(int type);
1328 void ring_on(struct linked_list *item);
1329 void ring_search(void);
1330 void ring_teleport(void);
1331 int rnd(int range);
1332 void rnd_pos(struct room *rp, coord *cp);
1333 int rnd_room(void);
1334 coord *rndmove(struct thing *who);
1335 int roll(int number, int sides);
1336 void rollwand(void);
1337 struct room *roomin(coord *cp);
1338 int rs_restore_file(int inf);
1339 int rs_save_file(FILE *savef);
1340 int runners(int segments);
1341 void runto(struct thing *runner, coord *spot);
1342 bool save(int which, struct thing *who, int adj);
1343 bool save_game(void);
1344 void score(unsigned long amount, int flags, short monst);
1345 void search(bool is_thief, bool door_chime);
1346 char secretdoor(int y, int x);
1347 void sell(struct thing *tp);
1348 void sell_it(void);
1349 void set_trap(struct thing *tp, int y, int x);
1350 void setup(void);
1351 void shoot_bolt(struct thing *shooter, coord start, coord dir,
1352 bool get_points, short reason, char *name, int damage);
1353 bool shoot_ok(char ch);
1354 char show(int y, int x);
1355 void sight(void);
1356 bool skirmish(struct thing *attacker, coord *mp, struct object *weap,
1357 bool thrown);
1358 struct linked_list *spec_item(int type, int which, int hit, int damage);
1359 void spell_recovery(void);
1360 void start_daemon(int (*func)(), int arg, int type);
1361 void status(bool display);
1362 void steal(void);
1363 bool step_ok(int y, int x, int can_on_monst, struct thing *flgptr);
1364 void stomach(void);
1365 int str_compute(void);
1366 int str_plus(short str);
1367 void strangle(void);
1368 void strucpy(char *s1, char *s2, int len);
1369 void suffocate(void);
1370 void swander(void);
1371 bool swing(short class, int at_lvl, int op_arm, int wplus);
1372 void take_off(void);
1373 int teleport(void);
1374 void total_winner(void);
1375 int totalenc(struct thing *tp);
1376 char *tr_name(char ch);
1377 struct trap *trap_at(int y, int x);
1378 void trap_look(void);
1379 void updpack(int getmax, struct thing *tp);
1380 void unclrhead(void);
1381 void unchoke(void);
1382 void unconfuse(void);
1383 void undance(void);
1384 void unphase(void);
1385 void unsee(void);
1386 void unskill(void);
1387 void unstink(void);
1388 int usage_time(struct linked_list *item);
1389 void use_mm(int which);
1390 char *vowelstr(char *str);
1391 void wait_for(char ch);
1392 struct linked_list *wake_monster(int y, int x);
1393 void wake_room(struct room *rp);
1394 void wanderer(void);
1395 void waste_time(void);
1396 int weap_move(struct thing *wielder, struct object *weap);
1397 char *weap_name(struct object *obj);
1398 void wear(void);
1399 void wghtchk(void);
1400 void whatis(struct linked_list *what);
1401 void wield(void);
1402 struct linked_list *wield_weap(struct object *thrown, struct thing *mp);
1403 void writelog(unsigned long amount, int flags, short monst);
1404
1405 char *md_crypt(char *key, char *salt);
1406 int md_erasechar(void);
1407 FILE *md_fdopen(int fd, char *mode);
1408 int md_fileno(FILE *fp);
1409 void md_flushinp(void);
1410 char *md_gethomedir(void);
1411 char *md_gethostname(void);
1412 char *md_getpass(char *prompt);
1413 char *md_getroguedir(void);
1414 int md_getuid(void);
1415 char *md_getusername(void);
1416 void md_init(void);
1417 int md_killchar(void);
1418 long md_memused(void);
1419 int md_normaluser(void);
1420 int md_rand(void);
1421 void md_reopen_score(void);
1422 int md_readchar(WINDOW *win);
1423 int md_shellescape(void);
1424 int md_srand(int seed);
1425 int md_unlink(char *file);
1426 int md_unlink_open_file(char *file, int inf);
1158 1427
1159 #ifdef CHECKTIME 1428 #ifdef CHECKTIME
1160 int checkout(); 1429 int checkout();
1161 #endif 1430 #endif
1162 1431
1432 #ifdef PC7300
1433 void endhardwin(void);
1434 #endif
1163 1435
1164 /* 1436 /*
1165 * Now all the global variables 1437 * Now all the global variables
1166 */ 1438 */
1167 1439
1295 extern LEVTYPE levtype; 1567 extern LEVTYPE levtype;
1296 extern void (*add_abil[NUMABILITIES])(); /* Functions to change abilities */ 1568 extern void (*add_abil[NUMABILITIES])(); /* Functions to change abilities */
1297 extern void (*res_abil[NUMABILITIES])(); /* Functions to change abilities */ 1569 extern void (*res_abil[NUMABILITIES])(); /* Functions to change abilities */
1298 extern int cNCOLORS, cNWOOD, cNMETAL, cNSTONES;