MCPcopy Create free account
hub / github.com/Meridian59/Meridian59 / MappedFileRead

Function MappedFileRead

roomedit/source/dibutil.cpp:349–357  ·  view source on GitHub ↗

/ * MappedFileRead: Copy num bytes from the memory-mapped file to buf. * Increments the file pointer. * Returns num on success, or -1 on failure. */

Source from the content-addressed store, hash-verified

347 * Returns num on success, or -1 on failure.
348 */
349int 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/***************************************************************************/
359Bool MappedFileClose(file_node *f)
360{

Callers 4

DibOpenFileFunction · 0.70
DibOpenFileSimpleFunction · 0.70
DibReadHeaderFunction · 0.70
DibReadBitsFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected