Mercurial > hg > early-roguelike
comparison arogue7/rogue.h @ 279:d3968e9cb98d
Use C stdio functions for score files and save files.
Switching from Unix file descriptor operations to C standard FILE*
functions will reduce portability problems.
| author | John "Elwin" Edwards | 
|---|---|
| date | Fri, 15 Sep 2017 19:57:54 -0400 | 
| parents | 3d4252fa2ed3 | 
| children | 17005af49963 | 
   comparison
  equal
  deleted
  inserted
  replaced
| 278:c222f9d56776 | 279:d3968e9cb98d | 
|---|---|
| 1206 void dust_appear(void); | 1206 void dust_appear(void); | 
| 1207 void eat(void); | 1207 void eat(void); | 
| 1208 void eat_gold(struct object *obj); | 1208 void eat_gold(struct object *obj); | 
| 1209 int effect(struct thing *att, struct thing *def, struct object *weap, | 1209 int effect(struct thing *att, struct thing *def, struct object *weap, | 
| 1210 bool thrown, bool see_att, bool see_def); | 1210 bool thrown, bool see_att, bool see_def); | 
| 1211 int encread(char *start, unsigned int size, int inf); | 1211 int encread(char *start, unsigned int size, FILE *inf); | 
| 1212 int encwrite(char *start, unsigned int size, int outf); | 1212 int encwrite(char *start, unsigned int size, FILE *outf); | 
| 1213 void endmsg(void); | 1213 void endmsg(void); | 
| 1214 void explode(struct thing *tp); | 1214 void explode(struct thing *tp); | 
| 1215 void extinguish(void (*func)()); | 1215 void extinguish(void (*func)()); | 
| 1216 void fall(struct linked_list *item, bool pr); | 1216 void fall(struct linked_list *item, bool pr); | 
| 1217 coord *fallpos(coord *pos, bool be_clear, int range); | 1217 coord *fallpos(coord *pos, bool be_clear, int range); | 
| 1312 void quit(int sig); | 1312 void quit(int sig); | 
| 1313 void raise_level(void); | 1313 void raise_level(void); | 
| 1314 short randmonster(bool wander, bool no_unique); | 1314 short randmonster(bool wander, bool no_unique); | 
| 1315 void read_scroll(int which, int flag, bool is_scroll); | 1315 void read_scroll(int which, int flag, bool is_scroll); | 
| 1316 int readchar(void); | 1316 int readchar(void); | 
| 1317 void reopen_score(void); | |
| 1317 void res_charisma(int howmuch); | 1318 void res_charisma(int howmuch); | 
| 1318 void res_constitution(int howmuch); | 1319 void res_constitution(int howmuch); | 
| 1319 void res_dexterity(int howmuch); | 1320 void res_dexterity(int howmuch); | 
| 1320 void res_intelligence(int howmuch); | 1321 void res_intelligence(int howmuch); | 
| 1321 void res_strength(int howmuch); | 1322 void res_strength(int howmuch); | 
| 1333 int rnd_room(void); | 1334 int rnd_room(void); | 
| 1334 coord *rndmove(struct thing *who); | 1335 coord *rndmove(struct thing *who); | 
| 1335 int roll(int number, int sides); | 1336 int roll(int number, int sides); | 
| 1336 void rollwand(void); | 1337 void rollwand(void); | 
| 1337 struct room *roomin(coord *cp); | 1338 struct room *roomin(coord *cp); | 
| 1338 int rs_restore_file(int inf); | 1339 int rs_restore_file(FILE *inf); | 
| 1339 int rs_save_file(FILE *savef); | 1340 int rs_save_file(FILE *savef); | 
| 1340 int runners(int segments); | 1341 int runners(int segments); | 
| 1341 void runto(struct thing *runner, coord *spot); | 1342 void runto(struct thing *runner, coord *spot); | 
| 1342 bool save(int which, struct thing *who, int adj); | 1343 bool save(int which, struct thing *who, int adj); | 
| 1343 bool save_game(void); | 1344 bool save_game(void); | 
| 1417 int md_killchar(void); | 1418 int md_killchar(void); | 
| 1418 long md_memused(void); | 1419 long md_memused(void); | 
| 1419 int md_normaluser(void); | 1420 int md_normaluser(void); | 
| 1420 int md_rand(void); | 1421 int md_rand(void); | 
| 1421 unsigned int md_random_seed(void); | 1422 unsigned int md_random_seed(void); | 
| 1422 void md_reopen_score(void); | |
| 1423 int md_readchar(WINDOW *win); | 1423 int md_readchar(WINDOW *win); | 
| 1424 int md_shellescape(void); | 1424 int md_shellescape(void); | 
| 1425 int md_srand(int seed); | 1425 int md_srand(int seed); | 
| 1426 int md_unlink(char *file); | 1426 int md_unlink(char *file); | 
| 1427 int md_unlink_open_file(char *file, int inf); | 1427 int md_unlink_open_file(char *file, FILE *inf); | 
| 1428 | 1428 | 
| 1429 #ifdef CHECKTIME | 1429 #ifdef CHECKTIME | 
| 1430 int checkout(); | 1430 int checkout(); | 
| 1431 #endif | 1431 #endif | 
| 1432 | 1432 | 
| 1502 extern int chant_time; /* Number of chant points/exp level */ | 1502 extern int chant_time; /* Number of chant points/exp level */ | 
| 1503 extern int pray_time; /* Number of prayer points/exp level */ | 1503 extern int pray_time; /* Number of prayer points/exp level */ | 
| 1504 extern int spell_power; /* Spell power left at this level */ | 1504 extern int spell_power; /* Spell power left at this level */ | 
| 1505 extern int turns; /* Number of turns player has taken */ | 1505 extern int turns; /* Number of turns player has taken */ | 
| 1506 extern int quest_item; /* Item hero is looking for */ | 1506 extern int quest_item; /* Item hero is looking for */ | 
| 1507 extern int scorefd; /* File descriptor for score file */ | |
| 1508 extern int cur_relic[]; /* Current relics */ | 1507 extern int cur_relic[]; /* Current relics */ | 
| 1509 extern char take; /* Thing the rogue is taking */ | 1508 extern char take; /* Thing the rogue is taking */ | 
| 1510 extern char prbuf[]; /* Buffer for sprintfs */ | 1509 extern char prbuf[]; /* Buffer for sprintfs */ | 
| 1511 extern char outbuf[]; /* Output buffer for stdout */ | 1510 extern char outbuf[]; /* Output buffer for stdout */ | 
| 1512 extern char runch; /* Direction player is running */ | 1511 extern char runch; /* Direction player is running */ | 
| 1563 extern char *nothing; /* "nothing happens" msg */ | 1562 extern char *nothing; /* "nothing happens" msg */ | 
| 1564 extern char *spacemsg; | 1563 extern char *spacemsg; | 
| 1565 extern char *morestr; | 1564 extern char *morestr; | 
| 1566 extern char *retstr; | 1565 extern char *retstr; | 
| 1567 extern FILE *logfile; | 1566 extern FILE *logfile; | 
| 1567 extern FILE *scoreboard; /* Score file */ | |
| 1568 extern LEVTYPE levtype; | 1568 extern LEVTYPE levtype; | 
| 1569 extern void (*add_abil[NUMABILITIES])(); /* Functions to change abilities */ | 1569 extern void (*add_abil[NUMABILITIES])(); /* Functions to change abilities */ | 
| 1570 extern void (*res_abil[NUMABILITIES])(); /* Functions to change abilities */ | 1570 extern void (*res_abil[NUMABILITIES])(); /* Functions to change abilities */ | 
| 1571 extern int cNCOLORS, cNWOOD, cNMETAL, cNSTONES; | 1571 extern int cNCOLORS, cNWOOD, cNMETAL, cNSTONES; | 
| 1572 extern char *rainbow[], *stones[], *wood[], *metal[]; | 1572 extern char *rainbow[], *stones[], *wood[], *metal[]; | 
