| 268 | } |
| 269 | |
| 270 | IOHANDLE io_open(const char *filename, int flags) |
| 271 | { |
| 272 | if(flags == IOFLAG_READ) |
| 273 | { |
| 274 | #if defined(CONF_FAMILY_WINDOWS) |
| 275 | // check for filename case sensitive |
| 276 | WIN32_FIND_DATA finddata; |
| 277 | HANDLE handle; |
| 278 | int length; |
| 279 | |
| 280 | length = str_length(filename); |
| 281 | if(!filename || !length || filename[length-1] == '\\') |
| 282 | return 0x0; |
| 283 | handle = FindFirstFile(filename, &finddata); |
| 284 | if(handle == INVALID_HANDLE_VALUE) |
| 285 | return 0x0; |
| 286 | else if(str_comp(filename+length-str_length(finddata.cFileName), finddata.cFileName) != 0) |
| 287 | { |
| 288 | FindClose(handle); |
| 289 | return 0x0; |
| 290 | } |
| 291 | FindClose(handle); |
| 292 | #endif |
| 293 | return (IOHANDLE)fopen(filename, "rb"); |
| 294 | } |
| 295 | if(flags == IOFLAG_WRITE) |
| 296 | return (IOHANDLE)fopen(filename, "wb"); |
| 297 | return 0x0; |
| 298 | } |
| 299 | |
| 300 | unsigned io_read(IOHANDLE io, void *buffer, unsigned size) |
| 301 | { |
no test coverage detected