PS2SDK
PS2 Homebrew Libraries
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
40 
41 #define FIO_S_IFLNK 0x4000
42 
43 #define FIO_S_IFREG 0x2000
44 
45 #define FIO_S_IFDIR 0x1000
46 
47 // Access rights
49 #define FIO_S_ISUID 0x0800
50 
51 #define FIO_S_ISGID 0x0400
52 
53 #define FIO_S_ISVTX 0x0200
54 
56 #define FIO_S_IRWXU 0x01C0
57 
58 #define FIO_S_IRUSR 0x0100
59 
60 #define FIO_S_IWUSR 0x0080
61 
62 #define FIO_S_IXUSR 0x0040
63 
65 #define FIO_S_IRWXG 0x0038
66 
67 #define FIO_S_IRGRP 0x0020
68 
69 #define FIO_S_IWGRP 0x0010
70 
71 #define FIO_S_IXGRP 0x0008
72 
74 #define FIO_S_IRWXO 0x0007
75 
76 #define FIO_S_IROTH 0x0004
77 
78 #define FIO_S_IWOTH 0x0002
79 
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 {
94  unsigned int mode;
95  unsigned int attr;
96  unsigned int size;
97  unsigned char ctime[8];
98  unsigned char atime[8];
99  unsigned char mtime[8];
100  unsigned int hisize;
102  unsigned int private_0;
103  unsigned int private_1;
104  unsigned int private_2;
105  unsigned int private_3;
106  unsigned int private_4;
108  unsigned int private_5;
110 
111 typedef struct
112 {
113  iox_stat_t stat;
114  char name[256];
115  void *privdata;
117 
118 /* The following defines are only supported by ioman. */
119 
120 // File mode flags (for mode in io_stat_t)
122 #define FIO_SO_IFMT 0x0038
123 
124 #define FIO_SO_IFLNK 0x0008
125 
126 #define FIO_SO_IFREG 0x0010
127 
128 #define FIO_SO_IFDIR 0x0020
129 
131 #define FIO_SO_IROTH 0x0004
132 
133 #define FIO_SO_IWOTH 0x0002
134 
135 #define FIO_SO_IXOTH 0x0001
136 
137 // File mode checking macros
138 #define FIO_SO_ISLNK(m) (((m)&FIO_SO_IFMT) == FIO_SO_IFLNK)
139 #define FIO_SO_ISREG(m) (((m)&FIO_SO_IFMT) == FIO_SO_IFREG)
140 #define FIO_SO_ISDIR(m) (((m)&FIO_SO_IFMT) == FIO_SO_IFDIR)
141 
142 #endif /* __SYS_IOX_STAT_H__ */
iox_stat_t
Definition: iox_stat.h:92
__attribute__
typedef __attribute__
Definition: tlbfunc.c:60
time.h
iox_dirent_t
Definition: iox_stat.h:111
iox_stat_t::private_0
unsigned int private_0
Definition: iox_stat.h:102
__attribute__
Definition: gif_registers.h:38
iox_stat_t::private_5
unsigned int private_5
Definition: iox_stat.h:108