Suggestion from "mgh".
[open-ps2-loader.git] / modules / ps2fs / pfs_fio.h
blob698869cf822e69a9e03eaf62ec784f027db28372
1 /*
2 # _____ ___ ____ ___ ____
3 # ____| | ____| | | |____|
4 # | ___| |____ ___| ____| | \ PS2DEV Open Source Project.
5 #-----------------------------------------------------------------------
6 # Copyright 2001-2004, ps2dev - http://www.ps2dev.org
7 # Licenced under Academic Free License version 2.0
8 # Review ps2sdk README & LICENSE files for further details.
10 # $Id: pfs_fio.h 577 2004-09-14 14:41:46Z pixel $
13 #ifndef _PFS_FIO_H
14 #define _PFS_FIO_H
16 #define FDIRO (0x0008) /* internal use for dopen */
18 ///////////////////////////////////////////////////////////////////////////////
19 // Function declerations
21 int checkForLastError(pfs_mount_t *pfsMount, int rv);
22 int checkFileSlot(pfs_file_slot_t *fileSlot);
23 void fioStatFiller(pfs_cache_t *clink, iox_stat_t *stat);
24 int mountDevice(block_device *blockDev, int fd, int unit, int flag);
25 void _sync();
26 void inodeFill(pfs_cache_t *ci, pfs_blockinfo *bi, u16 mode, u16 uid, u16 gid);
27 pfs_mount_t *fioGetMountedUnit(int unit);
28 void closeFileSlot(pfs_file_slot_t *fileSlot);
29 pfs_cache_t *createNewFile(pfs_cache_t *clink, u16 mode, u16 uid, u16 gid, int *result);
30 void bitmapFreeBlockSegment(pfs_mount_t *pfsMount, pfs_blockinfo *bi);
31 int searchFreeZone(pfs_mount_t *pfsMount, pfs_blockinfo *bi, u32 max_count);
32 u32 syncBlockPos(pfs_blockpos_t *blockpos, u64 position);
33 pfs_blockinfo* getCurrentBlock(pfs_blockpos_t *blockpos);
35 ///////////////////////////////////////////////////////////////////////////////
36 // Functions which hook into IOMAN
38 int pfsInit(iop_device_t *f);
39 int pfsDeinit(iop_device_t *f);
40 int pfsFormat(iop_file_t *, const char *dev, const char *blockdev, void *arg, size_t arglen);
41 int pfsOpen(iop_file_t *f, const char *name, int flags, int mode);
42 int pfsClose(iop_file_t *f);
43 int pfsRead(iop_file_t *f, void *buf, int size);
44 int pfsWrite(iop_file_t *f, void *buf, int size);
45 int pfsLseek(iop_file_t *f, unsigned long pos, int whence);
46 int pfsRemove(iop_file_t *f, const char *name);
47 int pfsMkdir(iop_file_t *f, const char *path, int mode);
48 int pfsRmdir(iop_file_t *f, const char *path);
49 int pfsDopen(iop_file_t *f, const char *name);
50 int pfsDclose(iop_file_t *f);
51 int pfsDread(iop_file_t *f, iox_dirent_t *buf);
52 int pfsGetstat(iop_file_t *f, const char *name, iox_stat_t *stat);
53 int pfsChstat(iop_file_t *f, const char *name, iox_stat_t *stat, unsigned int statmask);
54 int pfsRename(iop_file_t *f, const char *old, const char *new);
55 int pfsChdir(iop_file_t *f, const char *name);
56 int pfsSync(iop_file_t *f, const char *dev, int flag);
57 int pfsMount(iop_file_t *f, const char *fsname, const char *devname, int flag, void *arg, size_t arglen);
58 int pfsUmount(iop_file_t *f, const char *fsname);
59 s64 pfsLseek64(iop_file_t *f, s64 offset, int whence);
60 int pfsSymlink(iop_file_t *f, const char *old, const char *new);
61 int pfsReadlink(iop_file_t *f, const char *path, char *buf, int buflen);
63 int pfsUnsupported();
65 #endif /* _PFS_FIO_H */