comparison srogue/global.c @ 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 78fa1d0e5d25
children 0250220d8cdd
comparison
equal deleted inserted replaced
278:c222f9d56776 279:d3968e9cb98d
52 int food_left = HUNGERTIME; /* Amount of food stomach */ 52 int food_left = HUNGERTIME; /* Amount of food stomach */
53 int group = NEWGROUP; /* Current group number */ 53 int group = NEWGROUP; /* Current group number */
54 int hungry_state = F_OKAY; /* How hungry is he */ 54 int hungry_state = F_OKAY; /* How hungry is he */
55 int foodlev = 1; /* how fast he eats food */ 55 int foodlev = 1; /* how fast he eats food */
56 int ringfood = 0; /* rings affect on food consumption */ 56 int ringfood = 0; /* rings affect on food consumption */
57 int scorefd = -1; /* Scoreboard file descriptor */
58 char take; /* Thing the rogue is taking */ 57 char take; /* Thing the rogue is taking */
59 char runch; /* Direction player is running */ 58 char runch; /* Direction player is running */
60 char curpurch[15]; /* name of item ready to buy */ 59 char curpurch[15]; /* name of item ready to buy */
61 60
62 char prbuf[LINLEN]; /* Buffer for sprintfs */ 61 char prbuf[LINLEN]; /* Buffer for sprintfs */
100 char wizstr[] = { "Wizards Password: " }; 99 char wizstr[] = { "Wizards Password: " };
101 char illegal[] = { "Illegal command '%s'." }; 100 char illegal[] = { "Illegal command '%s'." };
102 char callit[] = { "Call it: " }; 101 char callit[] = { "Call it: " };
103 char starlist[] = { " (* for a list)" }; 102 char starlist[] = { " (* for a list)" };
104 103
104 FILE *scoreboard = NULL; /* Scoreboard file */
105 FILE *logfile = NULL; 105 FILE *logfile = NULL;
106 106
107 struct coord oldpos; /* Pos before last look() call */ 107 struct coord oldpos; /* Pos before last look() call */
108 struct coord delta; /* Change indicated to get_dir() */ 108 struct coord delta; /* Change indicated to get_dir() */
109 struct coord stairs; /* where the stairs are put */ 109 struct coord stairs; /* where the stairs are put */