Mercurial > hg > early-roguelike
comparison arogue5/save.c @ 218:56e748983fa8
Advanced Rogue 5: convert to ANSI function declarations.
This still leaves over a thousand lines of warning messages, mostly
related to the return types of daemons and fuses.
author | John "Elwin" Edwards |
---|---|
date | Sun, 07 Feb 2016 14:39:21 -0500 |
parents | efdbeec0816d |
children | 3d4252fa2ed3 |
comparison
equal
deleted
inserted
replaced
217:94a0d9dd5ce1 | 218:56e748983fa8 |
---|---|
21 #include <sys/types.h> | 21 #include <sys/types.h> |
22 #include <sys/stat.h> | 22 #include <sys/stat.h> |
23 #include <signal.h> | 23 #include <signal.h> |
24 #include "rogue.h" | 24 #include "rogue.h" |
25 | 25 |
26 bool save_file(FILE *savef); | |
27 | |
26 typedef struct stat STAT; | 28 typedef struct stat STAT; |
27 | 29 |
28 extern char version[], encstr[]; | 30 extern char version[], encstr[]; |
29 /* extern bool _endwin; */ | 31 /* extern bool _endwin; */ |
30 | 32 |
31 STAT sbuf; | 33 STAT sbuf; |
32 | 34 |
33 bool | 35 bool |
34 save_game() | 36 save_game(void) |
35 { | 37 { |
36 register FILE *savef; | 38 register FILE *savef; |
37 register int c; | 39 register int c; |
38 char buf[LINELEN]; | 40 char buf[LINELEN]; |
39 | 41 |
120 | 122 |
121 /* | 123 /* |
122 * write the saved game on the file | 124 * write the saved game on the file |
123 */ | 125 */ |
124 bool | 126 bool |
125 save_file(savef) | 127 save_file(FILE *savef) |
126 register FILE *savef; | |
127 { | 128 { |
128 int ret; | 129 int ret; |
129 int slines = LINES; | 130 int slines = LINES; |
130 int scols = COLS; | 131 int scols = COLS; |
131 | 132 |
145 fclose(savef); | 146 fclose(savef); |
146 | 147 |
147 return(ret); | 148 return(ret); |
148 } | 149 } |
149 | 150 |
150 restore(file, envp) | 151 bool |
151 register char *file; | 152 restore(char *file, char **envp) |
152 char **envp; | |
153 { | 153 { |
154 register int inf; | 154 register int inf; |
155 #ifndef _AIX | 155 #ifndef _AIX |
156 extern char **environ; | 156 extern char **environ; |
157 #endif | 157 #endif |
262 } | 262 } |
263 | 263 |
264 /* | 264 /* |
265 * perform an encrypted write | 265 * perform an encrypted write |
266 */ | 266 */ |
267 encwrite(start, size, outf) | 267 int |
268 register char *start; | 268 encwrite(char *start, unsigned int size, FILE *outf) |
269 register unsigned size; | |
270 register FILE *outf; | |
271 { | 269 { |
272 register char *ep; | 270 register char *ep; |
273 register num_written = 0; | 271 register int num_written = 0; |
274 | 272 |
275 ep = encstr; | 273 ep = encstr; |
276 | 274 |
277 while (size--) | 275 while (size--) |
278 { | 276 { |
286 } | 284 } |
287 | 285 |
288 /* | 286 /* |
289 * perform an encrypted read | 287 * perform an encrypted read |
290 */ | 288 */ |
291 encread(start, size, inf) | 289 int |
292 register char *start; | 290 encread(char *start, unsigned int size, int inf) |
293 register unsigned size; | |
294 register int inf; | |
295 { | 291 { |
296 register char *ep; | 292 register char *ep; |
297 register int read_size; | 293 register int read_size; |
298 | 294 |
299 if ((read_size = read(inf, start, size)) == -1 || read_size == 0) | 295 if ((read_size = read(inf, start, size)) == -1 || read_size == 0) |