maug
Quick and dirty C mini-augmentation library.
Loading...
Searching...
No Matches
mfile.h File Reference
#include <sys/stat.h>
Include dependency graph for mfile.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

union  MFILE_HANDLE
 
struct  MFILE_CADDY
 

Macros

#define MAUG_PATH_MAX   256
 Maximum size allocated for asset paths.
 
#define MFILE_CADDY_TYPE_FILE   0x01
 A standard UNIX file.
 
#define MFILE_CADDY_TYPE_MEM_BUFFER   0x80
 An array of bytes in memory abstracted through this library.
 
#define MFILE_FLAG_READ_ONLY   0x01
 
#define MFILE_READ_FLAG_LSBF   0x01
 
#define MFILE_TRACE_LVL   0
 
#define mfile_check_lock(p_file)
 
#define mfile_default_case(p_file)
 
#define mfile_has_bytes(p_file)
 
#define mfile_get_sz(p_file)
 

Typedefs

typedef MERROR_RETVAL(* mfile_seek_t) (struct MFILE_CADDY *p_file, off_t pos)
 
typedef MERROR_RETVAL(* mfile_read_int_t) (struct MFILE_CADDY *p_file, uint8_t *buf, size_t buf_sz, uint8_t flags)
 
typedef MERROR_RETVAL(* mfile_read_line_t) (struct MFILE_CADDY *p_file, char *buf, off_t buf_sz, uint8_t flags)
 
typedef struct MFILE_CADDY mfile_t
 

Functions

MERROR_RETVAL mfile_lock_buffer (MAUG_MHANDLE, 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 char *filename, mfile_t *p_file)
 Open a file and read it into memory or memory-map it.
 
void mfile_close (mfile_t *p_file)
 Close a file opened with mfile_open_read().