Files
ci-libretro-fceumm/src/file.h

39 lines
1001 B
C
Raw Normal View History

2014-03-30 22:50:28 +02:00
#ifndef _FCEU_FILE_H
#define _FCEU_FILE_H
2014-12-09 01:06:57 +01:00
#ifdef __LIBRETRO__
typedef struct {
2014-12-09 01:06:57 +01:00
uint8 *data;
uint32 size;
uint32 location;
} MEMWRAP;
#endif
typedef struct {
#ifdef __LIBRETRO__
MEMWRAP *fp;
#else
void *fp; // FILE* or ptr to ZIPWRAP
2014-12-09 01:06:57 +01:00
#endif
uint32 type; // 0=normal file, 1=gzip, 2=zip
} FCEUFILE;
#ifdef __LIBRETRO__
FCEUFILE *FCEU_fopen(const char *path, const char *ipsfn, char *mode, char *ext, uint8 *buffer, size_t bufsize);
#else
FCEUFILE *FCEU_fopen(const char *path, const char *ipsfn, char *mode, char *ext);
#endif
int FCEU_fclose(FCEUFILE*);
uint64 FCEU_fread(void *ptr, size_t size, size_t nmemb, FCEUFILE*);
uint64 FCEU_fwrite(void *ptr, size_t size, size_t nmemb, FCEUFILE*);
int FCEU_fseek(FCEUFILE*, long offset, int whence);
uint64 FCEU_ftell(FCEUFILE*);
void FCEU_rewind(FCEUFILE*);
int FCEU_read32le(uint32 *Bufo, FCEUFILE*);
int FCEU_read16le(uint16 *Bufo, FCEUFILE*);
int FCEU_fgetc(FCEUFILE*);
uint64 FCEU_fgetsize(FCEUFILE*);
int FCEU_fisarchive(FCEUFILE*);
2014-03-30 22:50:28 +02:00
#endif