ps2sdk  1.1
A collection of Open Source libraries used for developing applications on Sony's PlayStation 2® (PS2).
iox_stat.h
Go to the documentation of this file.
1 /*
2 # _____ ___ ____ ___ ____
3 # ____| | ____| | | |____|
4 # | ___| |____ ___| ____| | \ PS2DEV Open Source Project.
5 #-----------------------------------------------------------------------
6 # Copyright (c) 2003 Marcus R. Brown <mrbrown@0xd6.org>
7 # Licenced under Academic Free License version 2.0
8 # Review ps2sdk README & LICENSE files for further details.
9 */
10 
16 #ifndef __SYS_IOX_STAT_H__
17 #define __SYS_IOX_STAT_H__
18 
19 #include <sys/time.h>
20 
21 #ifdef _EE
22 #ifndef NEWLIB_PORT_AWARE
23 #error "Using fio/fileXio functions directly in the newlib port will lead to problems."
24 #error "Use posix function calls instead."
25 #endif
26 #endif
27 
28 // Flags for chstat 'statmask'
29 #define FIO_CST_MODE 0x0001
30 #define FIO_CST_ATTR 0x0002
31 #define FIO_CST_SIZE 0x0004
32 #define FIO_CST_CT 0x0008
33 #define FIO_CST_AT 0x0010
34 #define FIO_CST_MT 0x0020
35 #define FIO_CST_PRVT 0x0040
36 
37 // File mode flags
39 #define FIO_S_IFMT 0xF000
41 #define FIO_S_IFLNK 0x4000
43 #define FIO_S_IFREG 0x2000
45 #define FIO_S_IFDIR 0x1000
46 
47 // Access rights
49 #define FIO_S_ISUID 0x0800
51 #define FIO_S_ISGID 0x0400
53 #define FIO_S_ISVTX 0x0200
54 
56 #define FIO_S_IRWXU 0x01C0
58 #define FIO_S_IRUSR 0x0100
60 #define FIO_S_IWUSR 0x0080
62 #define FIO_S_IXUSR 0x0040
63 
65 #define FIO_S_IRWXG 0x0038
67 #define FIO_S_IRGRP 0x0020
69 #define FIO_S_IWGRP 0x0010
71 #define FIO_S_IXGRP 0x0008
72 
74 #define FIO_S_IRWXO 0x0007
76 #define FIO_S_IROTH 0x0004
78 #define FIO_S_IWOTH 0x0002
80 #define FIO_S_IXOTH 0x0001
81 
82 // File mode checking macros
83 #define FIO_S_ISLNK(m) (((m) & FIO_S_IFMT) == FIO_S_IFLNK)
84 #define FIO_S_ISREG(m) (((m) & FIO_S_IFMT) == FIO_S_IFREG)
85 #define FIO_S_ISDIR(m) (((m) & FIO_S_IFMT) == FIO_S_IFDIR)
86 
87 /* File attributes that are retrieved using the getstat and dread calls, and
88  set using chstat. */
89 
90 /* The following structures are only supported by iomanX. */
91 
92 typedef struct {
93  unsigned int mode;
94  unsigned int attr;
95  unsigned int size;
96  unsigned char ctime[8];
97  unsigned char atime[8];
98  unsigned char mtime[8];
99  unsigned int hisize;
101  unsigned int private_0;
102  unsigned int private_1;
103  unsigned int private_2;
104  unsigned int private_3;
105  unsigned int private_4;
107  unsigned int private_5;
108 } iox_stat_t;
109 
110 typedef struct {
112  char name[256];
113  unsigned int unknown;
114 } iox_dirent_t;
115 
116 /* The following defines are only supported by ioman. */
117 
118 // File mode flags (for mode in io_stat_t)
120 #define FIO_SO_IFMT 0x0038
122 #define FIO_SO_IFLNK 0x0008
124 #define FIO_SO_IFREG 0x0010
126 #define FIO_SO_IFDIR 0x0020
127 
129 #define FIO_SO_IROTH 0x0004
131 #define FIO_SO_IWOTH 0x0002
133 #define FIO_SO_IXOTH 0x0001
134 
135 // File mode checking macros
136 #define FIO_SO_ISLNK(m) (((m) & FIO_SO_IFMT) == FIO_SO_IFLNK)
137 #define FIO_SO_ISREG(m) (((m) & FIO_SO_IFMT) == FIO_SO_IFREG)
138 #define FIO_SO_ISDIR(m) (((m) & FIO_SO_IFMT) == FIO_SO_IFDIR)
139 
140 #endif /* __SYS_IOX_STAT_H__ */
unsigned int unknown
Definition: iox_stat.h:113
iox_stat_t stat
Definition: iox_stat.h:111
unsigned int private_0
Definition: iox_stat.h:101
unsigned int private_2
Definition: iox_stat.h:103
unsigned int attr
Definition: iox_stat.h:94
unsigned int private_1
Definition: iox_stat.h:102
unsigned int hisize
Definition: iox_stat.h:99
unsigned int private_5
Definition: iox_stat.h:107
unsigned int private_4
Definition: iox_stat.h:105
unsigned int size
Definition: iox_stat.h:95
unsigned int mode
Definition: iox_stat.h:93
unsigned int private_3
Definition: iox_stat.h:104