PS2SDK
PS2 Homebrew Libraries
Loading...
Searching...
No Matches
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
21typedef 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
32typedef struct
33{
34 char key[PFS_AENTRY_KEY_MAX];
35 char value[PFS_AENTRY_VALUE_MAX];
37
38typedef 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
47typedef struct {
48 u32 maxMount;
49 u32 maxOpen;
51
53// Global defines
54
55// mount flags
56#define PFS_MOUNT_BUSY 0x8000
57
59// Function declarations
60
61extern pfs_mount_t *pfsGetMountedUnit(s32 unit);
62extern void pfsClearMount(pfs_mount_t *pfsMount);
63
64#endif /* _PFS_H */