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.
This commit is contained in:
John "Elwin" Edwards 2017-09-15 19:57:54 -04:00
parent f8d1f422c8
commit c661fd79d4
33 changed files with 426 additions and 439 deletions

View file

@ -1208,8 +1208,8 @@ void eat(void);
void eat_gold(struct object *obj);
int effect(struct thing *att, struct thing *def, struct object *weap,
bool thrown, bool see_att, bool see_def);
int encread(char *start, unsigned int size, int inf);
int encwrite(char *start, unsigned int size, int outf);
int encread(char *start, unsigned int size, FILE *inf);
int encwrite(char *start, unsigned int size, FILE *outf);
void endmsg(void);
void explode(struct thing *tp);
void extinguish(void (*func)());
@ -1314,6 +1314,7 @@ void raise_level(void);
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_charisma(int howmuch);
void res_constitution(int howmuch);
void res_dexterity(int howmuch);
@ -1335,7 +1336,7 @@ coord *rndmove(struct thing *who);
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);
int runners(int segments);
void runto(struct thing *runner, coord *spot);
@ -1419,12 +1420,11 @@ long md_memused(void);
int md_normaluser(void);
int md_rand(void);
unsigned int md_random_seed(void);
void md_reopen_score(void);
int md_readchar(WINDOW *win);
int md_shellescape(void);
int md_srand(int seed);
int md_unlink(char *file);
int md_unlink_open_file(char *file, int inf);
int md_unlink_open_file(char *file, FILE *inf);
#ifdef CHECKTIME
int checkout();
@ -1504,7 +1504,6 @@ extern int pray_time; /* Number of prayer points/exp level */
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 score file */
extern int cur_relic[]; /* Current relics */
extern char take; /* Thing the rogue is taking */
extern char prbuf[]; /* Buffer for sprintfs */
@ -1565,6 +1564,7 @@ extern char *spacemsg;
extern char *morestr;
extern char *retstr;
extern FILE *logfile;
extern FILE *scoreboard; /* Score file */
extern LEVTYPE levtype;
extern void (*add_abil[NUMABILITIES])(); /* Functions to change abilities */
extern void (*res_abil[NUMABILITIES])(); /* Functions to change abilities */