PS2SDK
PS2 Homebrew Libraries
pfs.h
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.
9 */
10 
11 #ifndef _PFS_H
12 #define _PFS_H
13 
14 #ifndef min
15 #define min(a, b) ((a) < (b) ? (a) : (b))
16 #endif
17 
19 // Global types
20 
21 typedef struct
22 {
23  u16 dirty; // Whether the buffer is dirty or not.
24  u16 sub; // Sub/main partition
25  u32 sector; // Sector
26  u8 buffer[512]; // used for reading mis-aligned/remainder data
28 
29 #define PFS_AENTRY_KEY_MAX 256
30 #define PFS_AENTRY_VALUE_MAX 256
31 
32 typedef struct
33 {
34  char key[PFS_AENTRY_KEY_MAX];
35  char value[PFS_AENTRY_VALUE_MAX];
37 
38 typedef struct {
39  iomanX_iop_file_t *fd; //
40  pfs_cache_t *clink; //
41  u32 aentryOffset; // used for read offset
42  u64 position; //
43  pfs_blockpos_t block_pos; // current position into file
44  pfs_unaligned_io_t unaligned; // Contains unaligned data (data can only be read from the HDD in units of 512)
46 
47 typedef struct {
48  u32 maxMount;
49  u32 maxOpen;
50 } pfs_config_t;
51 
53 // Global defines
54 
55 // mount flags
56 #define PFS_MOUNT_BUSY 0x8000
57 
59 // Function declarations
60 
61 extern pfs_mount_t *pfsGetMountedUnit(s32 unit);
62 extern void pfsClearMount(pfs_mount_t *pfsMount);
63 
64 #endif /* _PFS_H */
pfs_cache_s
Definition: libpfs.h:195
_iomanX_iop_file
Definition: iomanX.h:70
pfs_unaligned_io_t
Definition: pfs.h:21
pfs_ioctl2attr_t
Definition: pfs.h:32
pfs_file_slot_t
Definition: pfs.h:38
pfs_blockpos_t
Definition: libpfs.h:213
pfs_mount_t
Definition: libpfs.h:178
pfs_config_t
Definition: pfs.h:47