1
#ifndef MFILE_H_INCLUDED
2
#define MFILE_H_INCLUDED
13
#define CHUNK_SIZE 4096 /* must be a power of 2 */
16
char data[CHUNK_SIZE]; /* actual data */
17
struct s_chunk *next; /* pointer to the next chunk */
18
vsi_l_offset offset; /* offset from the beginning of the file */
24
struct s_chunk * head;
26
vsi_l_offset t_offset; /* total offset from the start of the "array" */
27
vsi_l_offset length; /* length of the "array" */
29
int ungetc; /* place to hold the ungetc character */
30
MFILEReceiver *receiver;
33
MFILE * MFILEOpen( const char * pszFilename );
34
vsi_l_offset MFILETell( MFILE * xfp );
35
void MFILERewind( MFILE * xfp );
36
void MFILEFlush( MFILE * xfp );
37
int MFILEEof( MFILE * xfp );
38
char *MFILEGets( char *pszBuffer, int nBufferSize, MFILE * mfp );
39
int MFILEGetc( MFILE * mfp );
40
int MFILEUngetc( int c, MFILE * mfp );
41
size_t MFILERead( void * pBuffer, size_t nSize, size_t nCount, MFILE * xfp );
42
size_t MFILEWrite( void * pBuffer, size_t nSize, size_t nCount, MFILE * xfp );
43
int MFILESeek( MFILE * xfp, vsi_l_offset nOffset, int nWhence );
44
int MFILEClose( MFILE * xfp );
46
#endif /* MFILE_H_INCLUDED */