vitasdk
Documentation of the vitasdk
iofilemgr.h
Go to the documentation of this file.
1 
6 #ifndef _PSP2COMMON_KERNEL_IOFILEMGR_H_
7 #define _PSP2COMMON_KERNEL_IOFILEMGR_H_
8 
9 #include <vitasdk/build_utils.h>
10 #include <psp2common/types.h>
11 
12 #ifdef __cplusplus
13 extern "C" {
14 #endif
15 
16 
17 typedef struct SceIoDevInfo {
21  void *unk;
22 } SceIoDevInfo;
24 
25 
26 /* Note: Not all of these sceIoOpen() flags are not compatible with the
27  open() flags found in sys/unistd.h. */
28 typedef enum SceIoMode {
29  SCE_O_RDONLY = 0x0001,
30  SCE_O_WRONLY = 0x0002,
32  SCE_O_NBLOCK = 0x0004,
33  SCE_O_DIROPEN = 0x0008,
34  SCE_O_RDLOCK = 0x0010,
35  SCE_O_WRLOCK = 0x0020,
36  SCE_O_APPEND = 0x0100,
37  SCE_O_CREAT = 0x0200,
38  SCE_O_TRUNC = 0x0400,
39  SCE_O_EXCL = 0x0800,
40  SCE_O_SCAN = 0x1000,
41  SCE_O_RCOM = 0x2000,
42  SCE_O_NOBUF = 0x4000,
43  SCE_O_NOWAIT = 0x8000,
44  SCE_O_FDEXCL = 0x01000000,
45  SCE_O_PWLOCK = 0x02000000,
46  SCE_O_FGAMEDATA = 0x40000000
48 
49 typedef enum SceIoSeekMode {
54 
55 typedef enum SceIoDevType {
59  SCE_DEV_TYPE_FS = 0x10,
61  SCE_DEV_TYPE_MOUNTPT = 0x40
63 
64 
74 typedef enum SceIoAccessMode {
75  SCE_S_IXUSR = 000100,
76  SCE_S_IWUSR = 000200,
77  SCE_S_IRUSR = 000400,
78  SCE_S_IRWXU = 000700,
79 
80  SCE_S_IXGRP = 000000,
81  SCE_S_IWGRP = 000000,
82  SCE_S_IRGRP = 000000,
83  SCE_S_IRWXG = 000000,
84 
85  SCE_S_IXSYS = 000001,
86  SCE_S_IWSYS = 000002,
87  SCE_S_IRSYS = 000004,
88  SCE_S_IRWXS = 000007,
89 
90  SCE_DEPRECATED(SCE_S_IXOTH) = 000001,
91  SCE_DEPRECATED(SCE_S_IWOTH) = 000002,
92  SCE_DEPRECATED(SCE_S_IROTH) = 000004,
93  SCE_DEPRECATED(SCE_S_IRWXO) = 000007,
94 
95  SCE_DEPRECATED(SCE_S_ISVTX) = 000000,
96  SCE_DEPRECATED(SCE_S_ISGID) = 000000,
97  SCE_DEPRECATED(SCE_S_ISUID) = 000000,
98 
99  SCE_S_IFDIR = 0010000,
100  SCE_S_IFREG = 0020000,
101  SCE_S_IFLNK = 0040000,
102  SCE_S_IFMT = 0170000,
104 
105 // File mode checking macros
106 #define SCE_S_ISLNK(m) (((m) & SCE_S_IFMT) == SCE_S_IFLNK)
107 #define SCE_S_ISREG(m) (((m) & SCE_S_IFMT) == SCE_S_IFREG)
108 #define SCE_S_ISDIR(m) (((m) & SCE_S_IFMT) == SCE_S_IFDIR)
109 
111 typedef enum SceIoFileMode {
112  SCE_SO_IXOTH = 0x0001,
113  SCE_SO_IWOTH = 0x0002,
114  SCE_SO_IROTH = 0x0004,
115  SCE_SO_IFLNK = 0x0008,
116  SCE_SO_IFDIR = 0x0010,
117  SCE_SO_IFREG = 0x0020,
118  SCE_SO_IFMT = 0x0038,
119 } SceIoFileMode;
120 
121 // File mode checking macros
122 #define SCE_SO_ISLNK(m) (((m) & SCE_SO_IFMT) == SCE_SO_IFLNK)
123 #define SCE_SO_ISREG(m) (((m) & SCE_SO_IFMT) == SCE_SO_IFREG)
124 #define SCE_SO_ISDIR(m) (((m) & SCE_SO_IFMT) == SCE_SO_IFDIR)
125 
127 typedef struct SceIoStat {
129  unsigned int st_attr;
134  unsigned int st_private[6];
135 } SceIoStat;
137 
139 #define SCE_CST_MODE 0x0001
140 #define SCE_CST_SIZE 0x0004
141 #define SCE_CST_CT 0x0008
142 #define SCE_CST_AT 0x0010
143 #define SCE_CST_MT 0x0020
144 
145 
147 typedef struct SceIoDirent {
149  char d_name[256];
150  void *d_private;
151  int dummy;
152 } SceIoDirent;
154 
155 
156 #ifdef __cplusplus
157 }
158 #endif
159 
160 #endif /* _PSP2COMMON_KERNEL_IOFILEMGR_H_ */
VITASDK_BUILD_ASSERT_EQ(0x18, SceIoDevInfo)
SceOff max_size
Definition: iofilemgr.h:18
char d_name[256]
File name.
Definition: iofilemgr.h:149
SceIoStat d_stat
File status.
Definition: iofilemgr.h:148
void * d_private
Device-specific data.
Definition: iofilemgr.h:150
SceDateTime st_mtime
Last modification time.
Definition: iofilemgr.h:133
SceMode st_mode
One or more SceIoAccessMode.
Definition: iofilemgr.h:128
SceIoAccessMode
Access modes for st_mode in SceIoStat.
Definition: iofilemgr.h:74
SceIoSeekMode
Definition: iofilemgr.h:49
SceIoDevType
Definition: iofilemgr.h:55
SceOff st_size
Size of the file in bytes.
Definition: iofilemgr.h:130
SceIoMode
Definition: iofilemgr.h:28
SceSize cluster_size
Definition: iofilemgr.h:20
SceDateTime st_ctime
Creation time.
Definition: iofilemgr.h:131
SceDateTime st_atime
Last access time.
Definition: iofilemgr.h:132
void * unk
Definition: iofilemgr.h:21
int dummy
Dummy data.
Definition: iofilemgr.h:151
SceOff free_size
Definition: iofilemgr.h:19
SceIoFileMode
File modes, used for the st_attr parameter in SceIoStat.
Definition: iofilemgr.h:111
unsigned int st_attr
One or more SceIoFileMode.
Definition: iofilemgr.h:129
unsigned int st_private[6]
Device-specific data.
Definition: iofilemgr.h:134
@ SCE_S_IRSYS
System read permission.
Definition: iofilemgr.h:87
@ SCE_S_IWUSR
User write permission.
Definition: iofilemgr.h:76
@ SCE_S_IWOTH
Others write permission. Deprecated, use SCE_S_IXSYS.
Definition: iofilemgr.h:91
@ SCE_S_IXGRP
Group execute permission. Ignored and reset to 0 by system.
Definition: iofilemgr.h:80
@ SCE_S_IRWXU
User access rights mask.
Definition: iofilemgr.h:78
@ SCE_S_IFDIR
Directory.
Definition: iofilemgr.h:99
@ SCE_S_IXUSR
User execute permission.
Definition: iofilemgr.h:75
@ SCE_S_IRWXO
Others access rights mask. Deprecated, use SCE_S_IRWXS.
Definition: iofilemgr.h:93
@ SCE_S_IRGRP
Group read permission. Ignored and reset to 0 by system.
Definition: iofilemgr.h:82
@ SCE_S_IWSYS
System write permission.
Definition: iofilemgr.h:86
@ SCE_S_IFREG
Regular file.
Definition: iofilemgr.h:100
@ SCE_S_IRUSR
User read permission.
Definition: iofilemgr.h:77
@ SCE_S_ISVTX
Sticky. Deprecated.
Definition: iofilemgr.h:95
@ SCE_S_ISGID
Set GID. Deprecated.
Definition: iofilemgr.h:96
@ SCE_S_IXSYS
System execute permission.
Definition: iofilemgr.h:85
@ SCE_S_IFMT
Format bits mask.
Definition: iofilemgr.h:102
@ SCE_S_ISUID
Set UID. Deprecated.
Definition: iofilemgr.h:97
@ SCE_S_IRWXS
System access rights mask.
Definition: iofilemgr.h:88
@ SCE_S_IXOTH
Others execute permission. Deprecated, use SCE_S_IXSYS.
Definition: iofilemgr.h:90
@ SCE_S_IFLNK
Symbolic link.
Definition: iofilemgr.h:101
@ SCE_S_IRWXG
Group access rights mask. Ignored and reset to 0 by system.
Definition: iofilemgr.h:83
@ SCE_S_IROTH
Others read permission. Deprecated, use SCE_S_IXSYS.
Definition: iofilemgr.h:92
@ SCE_S_IWGRP
Group write permission. Ignored and reset to 0 by system.
Definition: iofilemgr.h:81
@ SCE_SEEK_CUR
Starts from current position.
Definition: iofilemgr.h:51
@ SCE_SEEK_END
Starts from the end of the file.
Definition: iofilemgr.h:52
@ SCE_SEEK_SET
Starts from the begin of the file.
Definition: iofilemgr.h:50
@ SCE_DEV_TYPE_NULL
Dummy device.
Definition: iofilemgr.h:56
@ SCE_DEV_TYPE_FS
File system device.
Definition: iofilemgr.h:59
@ SCE_DEV_TYPE_BLOCK
Block device.
Definition: iofilemgr.h:58
@ SCE_DEV_TYPE_CHAR
Character device.
Definition: iofilemgr.h:57
@ SCE_DEV_TYPE_MOUNTPT
Mount point.
Definition: iofilemgr.h:61
@ SCE_DEV_TYPE_ALIAS
Alias name.
Definition: iofilemgr.h:60
@ SCE_O_FGAMEDATA
Gamedata access.
Definition: iofilemgr.h:46
@ SCE_O_EXCL
Exclusive create.
Definition: iofilemgr.h:39
@ SCE_O_WRONLY
Write-only.
Definition: iofilemgr.h:30
@ SCE_O_NOBUF
Number device buffer.
Definition: iofilemgr.h:42
@ SCE_O_TRUNC
Truncate.
Definition: iofilemgr.h:38
@ SCE_O_RDWR
Read/Write.
Definition: iofilemgr.h:31
@ SCE_O_FDEXCL
Exclusive access.
Definition: iofilemgr.h:44
@ SCE_O_RDLOCK
Read locked (non-shared)
Definition: iofilemgr.h:34
@ SCE_O_SCAN
Scan type.
Definition: iofilemgr.h:40
@ SCE_O_RDONLY
Read-only.
Definition: iofilemgr.h:29
@ SCE_O_CREAT
Create.
Definition: iofilemgr.h:37
@ SCE_O_PWLOCK
Power control lock.
Definition: iofilemgr.h:45
@ SCE_O_APPEND
Append.
Definition: iofilemgr.h:36
@ SCE_O_NOWAIT
Asynchronous I/O.
Definition: iofilemgr.h:43
@ SCE_O_DIROPEN
Internal use for sceIoDopen.
Definition: iofilemgr.h:33
@ SCE_O_WRLOCK
Write locked (non-shared)
Definition: iofilemgr.h:35
@ SCE_O_NBLOCK
Non blocking.
Definition: iofilemgr.h:32
@ SCE_O_RCOM
Remote command entry.
Definition: iofilemgr.h:41
@ SCE_SO_IFDIR
Directory.
Definition: iofilemgr.h:116
@ SCE_SO_IWOTH
Hidden write permission.
Definition: iofilemgr.h:113
@ SCE_SO_IFMT
Format mask.
Definition: iofilemgr.h:118
@ SCE_SO_IFREG
Regular file.
Definition: iofilemgr.h:117
@ SCE_SO_IROTH
Hidden read permission.
Definition: iofilemgr.h:114
@ SCE_SO_IFLNK
Symbolic link.
Definition: iofilemgr.h:115
@ SCE_SO_IXOTH
Hidden execute permission.
Definition: iofilemgr.h:112
Definition: iofilemgr.h:17
Describes a single directory entry.
Definition: iofilemgr.h:147
Structure to hold the status information about a file.
Definition: iofilemgr.h:127
unsigned int SceSize
Definition: types.h:56
SceInt64 SceOff
Offset type.
Definition: types.h:88
int SceMode
Mode for I/O functions.
Definition: types.h:87
Definition: types.h:213