/ * MappedFileRead: Copy num bytes from the memory-mapped file to buf. * Increments the file pointer. * Returns num on success, or -1 on failure. */
| 347 | * Returns num on success, or -1 on failure. |
| 348 | */ |
| 349 | int MappedFileRead(file_node *f, void *buf, int num) |
| 350 | { |
| 351 | if ((f->ptr - f->mem) + num > f->length || f->ptr < f->mem || num <= 0) |
| 352 | return -1; |
| 353 | |
| 354 | memcpy(buf, f->ptr, num); |
| 355 | f->ptr += num; |
| 356 | return num; |
| 357 | } |
| 358 | /***************************************************************************/ |
| 359 | Bool MappedFileClose(file_node *f) |
| 360 | { |
no outgoing calls
no test coverage detected