Mercurial > hg > early-roguelike
diff arogue5/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 |
line wrap: on
line diff
--- a/arogue5/rogue.h Sun Sep 10 17:30:13 2017 -0400 +++ b/arogue5/rogue.h Fri Sep 15 19:57:54 2017 -0400 @@ -1009,7 +1009,7 @@ bool dropcheck(struct object *op); void dust_appear(void); void eat(void); -int encread(char *start, unsigned int size, int inf); +int encread(char *start, unsigned int size, FILE *inf); int encwrite(char *start, unsigned int size, FILE *outf); void endit(int sig); void endmsg(void); @@ -1097,6 +1097,7 @@ short randmonster(bool wander, bool no_unique); void read_scroll(int which, int flag, bool is_scroll); int readchar(void); +void reopen_score(void); void res_dexterity(int howmuch); void res_strength(void); bool restore(char *file, char **envp); @@ -1114,7 +1115,7 @@ int roll(int number, int sides); void rollwand(void); struct room *roomin(coord *cp); -int rs_restore_file(int inf); +int rs_restore_file(FILE *inf); int rs_save_file(FILE *savef); void runners(void); void runto(struct thing *runner, coord *spot); @@ -1191,7 +1192,6 @@ extern int md_normaluser(void); extern int md_getuid(void); extern long md_memused(void); -extern void md_reopen_score(void); extern int md_readchar(WINDOW *win); extern int md_shellescape(void); extern int md_srand(int seed); @@ -1266,7 +1266,6 @@ extern int spell_power; /* Spell power left at this level */ extern int turns; /* Number of turns player has taken */ extern int quest_item; /* Item hero is looking for */ -extern int scorefd; /* File descriptor for the scorefile */ extern int cur_relic[]; /* Current relics */ extern char take; /* Thing the rogue is taking */ extern char prbuf[]; /* Buffer for sprintfs */ @@ -1338,4 +1337,5 @@ extern char *metal[NMETAL]; extern char *wood[NWOOD]; extern coord ch_ret; +extern FILE *scoreboard; /* The scorefile */ extern FILE *logfile;