maug
Quick and dirty C mini-augmentation library.
Loading...
Searching...
No Matches
RetroFile API

Abstraction layer for dealing with files on retro systems. More...

Collaboration diagram for RetroFile API:

Topics

 RetroFile Types
 Types of files/data stores that mfile can abstract from.
 RetroFile Byte Order
 Flags controlling byte order for read operations.
 RetroFlat Assets API
 Functions and macros for handling graphical asset files.
 Maug Memory File API
 Maug True File API
 Maug Virtual File API

Files

file  mfile.h

Data Structures

struct  MFILE_CADDY

Macros

#define MAUG_PATH_SZ_MAX   40
 Maximum size allocated for asset paths.
#define MFILE_FLAG_READ_ONLY   0x01
 Flag for MFILE_CADDY::flags indicating this file is read-only.
#define MFILE_FLAG_HANDLE_LOCKED   0x02
 Flag for MFILE_CADDY::flags indicating subsequent internal unlocks should unlock the handle back to its buffer. Should only be set internally!
#define MFILE_READ_FLAG_LSBF   0x01
 Flag for mfile_read_int_t() indicating integer should always be read least significant byte first.
#define MFILE_READ_FLAG_MSBF   0x01
 Flag for mfile_read_int_t() indicating integer should always be read most significant byte first.
#define MFILE_ASSIGN_FLAG_TRIM_EXT   0x01
#define MFILE_READ_TRACE_LVL   0
#define MFILE_WRITE_TRACE_LVL   0
#define MFILE_SEEK_TRACE_LVL   0
#define MFILE_CONTENTS_TRACE_LVL   0
#define mfile_get_sz(p_file)

Typedefs

typedef struct MFILE_CADDY mfile_t

Functions

MERROR_RETVAL mfile_plt_init (void)
MERROR_RETVAL mfile_lock_buffer (MAUG_MHANDLE, void *ptr, off_t, mfile_t *p_file)
 Lock a buffer and assign it to an mfile_t to read/write.
MERROR_RETVAL mfile_open_read (const maug_path filename, mfile_t *p_file)
 Open a file and read it into memory or memory-map it.
MERROR_RETVAL mfile_open_write (const maug_path filename, mfile_t *p_file)
void mfile_close (mfile_t *p_file)
 Close a file opened with mfile_open_read().

Detailed Description

Abstraction layer for dealing with files on retro systems.

Macro Definition Documentation

◆ mfile_get_sz

#define mfile_get_sz ( p_file)
Value:
((p_file)->sz)

Function Documentation

◆ mfile_open_read()

MERROR_RETVAL mfile_open_read ( const maug_path filename,
mfile_t * p_file )

Open a file and read it into memory or memory-map it.

Parameters
filenameNULL-terminated path to file to open.