Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef _MEMFS_H_
- #define _MEMFS_H_
- #define MEMFS_DISKHDR_MAGIC "MemFS"
- typedef struct {
- char magic[5];
- unsigned int listoffset;
- unsigned int dataoffset;
- } MEMFS_DISKHDR;
- typedef struct MEMFS_FILE_S {
- char name[32];
- unsigned int seekpos;
- unsigned int dataoffset;
- unsigned int datasize;
- struct MEMFS_FILE_S *next;
- } MEMFS_FILE;
- #define MEMFS_INVALID_FILE (0xFFFFFFFF)
- #define MEMFS_READ_FAIL (0xFFFFFFFE)
- #define MEMFS_WRITE_FAIL (0xFFFFFFFD)
- #define MEMFS_SEEK_FAIL (0xFFFFFFFC)
- #define MEMFS_SEEK_START (0xFFFFFFFB)
- #define MEMFS_SEEK_END (0xFFFFFFFA)
- MEMFS_FILE *memfs_open(MEMFS_DISKHDR *dh, char *fname);
- MEMFS_FILE *memfs_create(MEMFS_DISKHDR *dh, char *fname);
- unsigned int memfs_seek(MEMFS_DISKHDR *dh, MEMFS_FILE *f, unsigned int pos);
- unsigned int memfs_read(MEMFS_DISKHDR *dh, MEMFS_FILE *f, void *data, unsigned int max);
- unsigned int memfs_write(MEMFS_DISKHDR *dh, MEMFS_FILE *f, void *data, unsigned int len);
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement