mirror of
https://github.com/dborth/snes9xgx.git
synced 2024-12-27 11:41:49 +01:00
35 lines
1.0 KiB
C
35 lines
1.0 KiB
C
/****************************************************************************
|
|
* Snes9x 1.51 Nintendo Wii/Gamecube Port
|
|
*
|
|
* Tantric October 2008
|
|
*
|
|
* memfile.h
|
|
*
|
|
* Memory-based replacement for standard C file functions
|
|
* This allows standard file calls to be replaced by memory based ones
|
|
* With little modification required to the code
|
|
***************************************************************************/
|
|
|
|
#ifndef _MEMFILE_H_
|
|
#define _MEMFILE_H_
|
|
|
|
typedef struct MFile {
|
|
char *buffer; // pointer to buffer memory
|
|
long int offset; // current position indicator in buffer
|
|
long int size; // total file (buffer) size
|
|
} MFILE;
|
|
|
|
#define MSEEK_SET 0
|
|
#define MSEEK_CUR 1
|
|
#define MSEEK_END 2
|
|
#define MEOF (-1)
|
|
|
|
MFILE * memfopen(char * buffer, int size);
|
|
int memfclose(MFILE * src);
|
|
int memfseek ( MFILE * m, long int offset, int origin );
|
|
long int memftell (MFILE * stream);
|
|
size_t memfread(void * dst, size_t size, size_t count, MFILE * src);
|
|
int memfgetc(MFILE * src);
|
|
|
|
#endif
|