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

@ -100,8 +100,6 @@ int quiet = 0; /* Number of quiet turns */
int food_left; /* Amount of food in hero's stomach */
int group = 2; /* Current group number */
int hungry_state = 0; /* How hungry is he */
int fd; /* File descriptor for score file */
int lfd; /* File descriptor for log file */
int a_chances[MAXARMORS] = { /* Chance for each armor type */
20,
35,
@ -136,6 +134,9 @@ THING *lvl_obj = NULL; /* List of objects on this level */
THING *mlist = NULL; /* List of monsters on the level */
THING *_monst[MAXLINES*MAXCOLS]; /* Pointers for monsters at each spot */
FILE *score_file = NULL; /* Scoreboard */
FILE *log_file = NULL; /* Log file */
WINDOW *hw; /* Used as a scratch window */
#define INIT_STATS { 16, 0, 1, 10, 12, "1d4", 12 }