Memory-mapped files

Constants

Error codes

VALUES

#define MME_OK  0
#define MME_INVALID_FLAG    -1
#define MME_OPEN_ERROR  -2
#define MME_MMAP_ERROR  -3

MMF_MAP_ALL


Offset value to map entire file into memory

#define MMF_MAP_ALL -1

Memory mapping protection flags

VALUES

#define MMFL_RDONLY 
#define MMFL_WRONLY 
#define MMFL_RDWR   

Functions

mmf_open

publicplat


Initialize mmap_file_t structure and open file

ARGUMENTS

RETURN VALUES
MME_OK if file was successfully opened or MME_OPEN_ERROR

LIBEXPORT PLATAPI int mmf_open(mmap_file_t* mmf, const char* filename, int mmfl)

mmf_close

publicplat


Close memory-mapped file

ARGUMENTS

LIBEXPORT PLATAPI void mmf_close(mmap_file_t* mmf)

mmf_create

publicplat


Create new mapping from file

ARGUMENTS

RETURN VALUES
MME_OK if mapping was successfully mapped, or MME_MMAP_ERROR/MME_INVALID_FLAG

LIBEXPORT PLATAPI int mmf_create(mmap_file_t* mmf, long long offset, size_t length, void** mapping_ptr)

mmf_destroy

publicplat


Unmap file area

ARGUMENTS

LIBEXPORT PLATAPI void mmf_destroy(mmap_file_t* mmf, void* mapping)