00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef PSPIOFILEMGR_KERNEL_H
00016 #define PSPIOFILEMGR_KERNEL_H
00017
00018 #include <psptypes.h>
00019 #include <pspkerneltypes.h>
00020 #include <pspiofilemgr.h>
00021
00026 #ifdef __cplusplus
00027 extern "C" {
00028 #endif
00029
00032
00033 struct PspIoDrv;
00034
00036 typedef struct PspIoDrvArg
00037 {
00039 struct PspIoDrv *drv;
00041 void *arg;
00042 } PspIoDrvArg;
00043
00045 typedef struct PspIoDrvFileArg
00046 {
00048 u32 unk1;
00050 u32 fs_num;
00052 PspIoDrvArg *drv;
00054 u32 unk2;
00056 void *arg;
00057 } PspIoDrvFileArg;
00058
00060 typedef struct PspIoDrvFuncs
00061 {
00062 int (*IoInit)(PspIoDrvArg* arg);
00063 int (*IoExit)(PspIoDrvArg* arg);
00064 int (*IoOpen)(PspIoDrvFileArg *arg, char *file, int flags, SceMode mode);
00065 int (*IoClose)(PspIoDrvFileArg *arg);
00066 int (*IoRead)(PspIoDrvFileArg *arg, char *data, int len);
00067 int (*IoWrite)(PspIoDrvFileArg *arg, const char *data, int len);
00068 SceOff (*IoLseek)(PspIoDrvFileArg *arg, SceOff ofs, int whence);
00069 int (*IoIoctl)(PspIoDrvFileArg *arg, unsigned int cmd, void *indata, int inlen, void *outdata, int outlen);
00070 int (*IoRemove)(PspIoDrvFileArg *arg, const char *name);
00071 int (*IoMkdir)(PspIoDrvFileArg *arg, const char *name, SceMode mode);
00072 int (*IoRmdir)(PspIoDrvFileArg *arg, const char *name);
00073 int (*IoDopen)(PspIoDrvFileArg *arg, const char *dirname);
00074 int (*IoDclose)(PspIoDrvFileArg *arg);
00075 int (*IoDread)(PspIoDrvFileArg *arg, SceIoDirent *dir);
00076 int (*IoGetstat)(PspIoDrvFileArg *arg, const char *file, SceIoStat *stat);
00077 int (*IoChstat)(PspIoDrvFileArg *arg, const char *file, SceIoStat *stat, int bits);
00078 int (*IoRename)(PspIoDrvFileArg *arg, const char *oldname, const char *newname);
00079 int (*IoChdir)(PspIoDrvFileArg *arg, const char *dir);
00080 int (*IoMount)(PspIoDrvFileArg *arg);
00081 int (*IoUmount)(PspIoDrvFileArg *arg);
00082 int (*IoDevctl)(PspIoDrvFileArg *arg, const char *devname, unsigned int cmd, void *indata, int inlen, void *outdata, int outlen);
00083 int (*IoUnk21)(PspIoDrvFileArg *arg);
00084 } PspIoDrvFuncs;
00085
00086 typedef struct PspIoDrv
00087 {
00089 const char *name;
00091 u32 dev_type;
00093 u32 unk2;
00095 const char *name2;
00097 PspIoDrvFuncs *funcs;
00098 } PspIoDrv;
00099
00115 int sceIoAddDrv(PspIoDrv *drv);
00116
00124 int sceIoDelDrv(const char *drv_name);
00125
00136 int sceIoReopen(const char *file, int flags, SceMode mode, SceUID fd);
00137
00148 int sceIoGetThreadCwd(SceUID uid, char *dir, int len);
00149
00158 int sceIoChangeThreadCwd(SceUID uid, char *dir);
00159
00162 #ifdef __cplusplus
00163 }
00164 #endif
00165
00166 #endif