Mercurial > hg > early-roguelike
comparison arogue7/mdport.c @ 203:aa8e1fc62926
Advanced Rogue 7: add and use more md_ functions.
md_fileno() and md_fdopen() are now included. I still hope to rewrite
everything to use FILE *'s.
author | John "Elwin" Edwards |
---|---|
date | Thu, 13 Aug 2015 07:38:57 -0400 |
parents | e69128d2e4c5 |
children | f9ef86cf22b2 |
comparison
equal
deleted
inserted
replaced
202:e69128d2e4c5 | 203:aa8e1fc62926 |
---|---|
170 #ifdef _WIN32 | 170 #ifdef _WIN32 |
171 chmod(file, 0600); | 171 chmod(file, 0600); |
172 return( _unlink(file) ); | 172 return( _unlink(file) ); |
173 #else | 173 #else |
174 return(unlink(file)); | 174 return(unlink(file)); |
175 #endif | |
176 } | |
177 | |
178 FILE * | |
179 md_fdopen(int fd, char *mode) | |
180 { | |
181 #ifdef _WIN32 | |
182 return( _fdopen(fd, mode) ); | |
183 #else | |
184 return( fdopen(fd, mode) ); | |
185 #endif | |
186 } | |
187 | |
188 int | |
189 md_fileno(FILE *fp) | |
190 { | |
191 #ifdef _WIN32 | |
192 return( _fileno(fp) ); | |
193 #else | |
194 return( fileno(fp) ); | |
175 #endif | 195 #endif |
176 } | 196 } |
177 | 197 |
178 int | 198 int |
179 md_creat(char *file, int mode) | 199 md_creat(char *file, int mode) |