diff 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
line wrap: on
line diff
--- a/arogue7/rogue.h	Sun Sep 10 17:30:13 2017 -0400
+++ b/arogue7/rogue.h	Fri Sep 15 19:57:54 2017 -0400
@@ -1208,8 +1208,8 @@
 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 @@
 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 @@
 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 @@
 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 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 *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 */