# pspiofilemgr_kernel.h

Go to the documentation of this file.

    00001 /*
    00002  * PSP Software Development Kit - http://www.pspdev.org
    00003  * -----------------------------------------------------------------------
    00004  * Licensed under the BSD license, see LICENSE in PSPSDK root for details.
    00005  *
    00006  * pspiofilemgr_kernel.h - Interface to the kernel mode library for IoFileMgr.
    00007  *
    00008  * Copyright (c) 2005 Marcus R. Brown <mrbrown@ocgnet.org>
    00009  * Copyright (c) 2005 James Forshaw <tyranid@gmail.com>
    00010  * Copyright (c) 2005 John Kelley <ps2dev@kelley.ca>
    00011  *
    00012  * $Id: pspiofilemgr_kernel.h 1095 2005-09-27 21:02:16Z jim $
    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         int (*IoLseek)(PspIoDrvFileArg *arg, u32 unk, long long 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, 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
    00140 #ifdef __cplusplus
    00141 }
    00142 #endif
    00143
    00144 #endif /* PSPIOFILEMGR_KERNEL_H */