mmio.h File Reference

Memory-mapped I/O wrappers for files. More...

`#include <sphinxbase/sphinxbase_export.h>`

Go to the source code of this file.

## Typedefs

typedef struct mmio_file_s | mmio_file_t
| Abstract structure representing a memory-mapped file.

## Functions

SPHINXBASE_EXPORT mmio_file_t * | mmio_file_read (const char *filename)
| Memory-map a file for reading.
SPHINXBASE_EXPORT void * | mmio_file_ptr (mmio_file_t *mf)
| Get a pointer to the memory mapped for a file.
SPHINXBASE_EXPORT void | mmio_file_unmap (mmio_file_t *mf)
| Unmap a file, releasing memory associated with it.

## Detailed Description

Memory-mapped I/O wrappers for files.

Author
  David Huggins-Daines dhugg.nosp@m.ins@.nosp@m.cs.cm.nosp@m.u.ed.nosp@m.u

Definition in file mmio.h.

## Typedef Documentation

## mmio_file_t

typedef struct mmio_file_s mmio_file_t

Abstract structure representing a memory-mapped file.

Definition at line 59 of file mmio.h.

## Function Documentation

## mmio_file_ptr()

SPHINXBASE_EXPORT void * mmio_file_ptr | ( | mmio_file_t * | mf | ) |

Get a pointer to the memory mapped for a file.

Definition at line 252 of file mmio.c.

Referenced by logmath_read().

## mmio_file_read()

SPHINXBASE_EXPORT mmio_file_t * mmio_file_read | ( | const char * | filename | ) |

Memory-map a file for reading.

Returns
  a mmio_file_t * or NULL for failure.

Definition at line 207 of file mmio.c.

References ckd_calloc, E_ERROR_SYSTEM, and mmio_file_read().

Referenced by logmath_read(), and mmio_file_read().

## mmio_file_unmap()

SPHINXBASE_EXPORT void mmio_file_unmap | ( | mmio_file_t * | mf | ) |

Unmap a file, releasing memory associated with it.

Definition at line 241 of file mmio.c.

References ckd_free(), and E_ERROR_SYSTEM.

Referenced by logmath_free().