PSP2SDK  dirty-f9e4f2d
The free SDK for PSP2
include/psp2/io/stat.h
Go to the documentation of this file.
00001 
00012 #ifndef _PSP2_IO_STAT_H_
00013 #define _PSP2_IO_STAT_H_
00014 
00015 #include <psp2/types.h>
00016 
00017 #ifdef __cplusplus
00018 extern "C" {
00019 #endif
00020 
00022 enum {
00024     PSP2_S_IFMT     = 0xF000,
00026     PSP2_S_IFLNK        = 0x4000,
00028     PSP2_S_IFDIR        = 0x1000,
00030     PSP2_S_IFREG        = 0x2000,
00031 
00033     PSP2_S_ISUID        = 0x0800,
00035     PSP2_S_ISGID        = 0x0400,
00037     PSP2_S_ISVTX        = 0x0200,
00038 
00040     PSP2_S_IRWXU        = 0x01C0,
00042     PSP2_S_IRUSR        = 0x0100,
00044     PSP2_S_IWUSR        = 0x0080,
00046     PSP2_S_IXUSR        = 0x0040,
00047 
00049     PSP2_S_IRWXG        = 0x0038,
00051     PSP2_S_IRGRP        = 0x0020,
00053     PSP2_S_IWGRP        = 0x0010,
00055     PSP2_S_IXGRP        = 0x0008,
00056 
00058     PSP2_S_IRWXO        = 0x0007,
00060     PSP2_S_IROTH        = 0x0004,
00062     PSP2_S_IWOTH        = 0x0002,
00064     PSP2_S_IXOTH        = 0x0001,
00065 };
00066 
00067 // File mode checking macros
00068 #define PSP2_S_ISLNK(m) (((m) & PSP2_S_IFMT) == PSP2_S_IFLNK)
00069 #define PSP2_S_ISREG(m) (((m) & PSP2_S_IFMT) == PSP2_S_IFREG)
00070 #define PSP2_S_ISDIR(m) (((m) & PSP2_S_IFMT) == PSP2_S_IFDIR)
00071 
00073 enum {
00075     PSP2_SO_IFMT             = 0x0038,               // Format mask
00077     PSP2_SO_IFLNK            = 0x0008,               // Symbolic link
00079     PSP2_SO_IFDIR            = 0x0010,               // Directory
00081     PSP2_SO_IFREG            = 0x0020,               // Regular file
00082 
00084     PSP2_SO_IROTH            = 0x0004,               // read
00086     PSP2_SO_IWOTH            = 0x0002,               // write
00088     PSP2_SO_IXOTH            = 0x0001,               // execute
00089 };
00090 
00091 // File mode checking macros
00092 #define PSP2_SO_ISLNK(m)    (((m) & PSP2_SO_IFMT) == PSP2_SO_IFLNK)
00093 #define PSP2_SO_ISREG(m)    (((m) & PSP2_SO_IFMT) == PSP2_SO_IFREG)
00094 #define PSP2_SO_ISDIR(m)    (((m) & PSP2_SO_IFMT) == PSP2_SO_IFDIR)
00095 
00097 typedef struct SceIoStat {
00098     SceMode st_mode;
00099     unsigned int    st_attr;
00101     SceOff  st_size;
00103     SceDateTime st_ctime;
00105     SceDateTime st_atime;
00107     SceDateTime st_mtime;
00109     unsigned int    st_private[6];
00110 } SceIoStat;
00111 
00119 int sceIoMkdir(const char *dir, SceMode mode);
00120 
00127 int sceIoRmdir(const char *path);
00128 
00135 int sceIoChdir(const char *path);
00136 
00145 int sceIoGetstat(const char *file, SceIoStat *stat);
00146 
00156 int sceIoChstat(const char *file, SceIoStat *stat, int bits);
00157 
00158 #ifdef __cplusplus
00159 }
00160 #endif
00161 
00162 #endif /* _PSP2_IO_STAT_H_ */
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines