pspsdk-1.0+beta2
pspiofilemgr_kernel.h
Go to the documentation of this file.
1 /*
2  * PSP Software Development Kit - http://www.pspdev.org
3  * -----------------------------------------------------------------------
4  * Licensed under the BSD license, see LICENSE in PSPSDK root for details.
5  *
6  * pspiofilemgr_kernel.h - Interface to the kernel mode library for IoFileMgr.
7  *
8  * Copyright (c) 2005 Marcus R. Brown <mrbrown@ocgnet.org>
9  * Copyright (c) 2005 James Forshaw <tyranid@gmail.com>
10  * Copyright (c) 2005 John Kelley <ps2dev@kelley.ca>
11  *
12  * $Id: pspiofilemgr_kernel.h 1939 2006-06-04 22:03:42Z tyranid $
13  */
14 
15 #ifndef PSPIOFILEMGR_KERNEL_H
16 #define PSPIOFILEMGR_KERNEL_H
17 
18 #include <psptypes.h>
19 #include <pspkerneltypes.h>
20 #include <pspiofilemgr.h>
21 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
32 
33 struct PspIoDrv;
34 
36 typedef struct PspIoDrvArg
37 {
39  struct PspIoDrv *drv;
41  void *arg;
42 } PspIoDrvArg;
43 
45 typedef struct PspIoDrvFileArg
46 {
56  void *arg;
58 
60 typedef struct PspIoDrvFuncs
61 {
62  int (*IoInit)(PspIoDrvArg* arg);
63  int (*IoExit)(PspIoDrvArg* arg);
64  int (*IoOpen)(PspIoDrvFileArg *arg, char *file, int flags, SceMode mode);
65  int (*IoClose)(PspIoDrvFileArg *arg);
66  int (*IoRead)(PspIoDrvFileArg *arg, char *data, int len);
67  int (*IoWrite)(PspIoDrvFileArg *arg, const char *data, int len);
68  SceOff (*IoLseek)(PspIoDrvFileArg *arg, SceOff ofs, int whence);
69  int (*IoIoctl)(PspIoDrvFileArg *arg, unsigned int cmd, void *indata, int inlen, void *outdata, int outlen);
70  int (*IoRemove)(PspIoDrvFileArg *arg, const char *name);
71  int (*IoMkdir)(PspIoDrvFileArg *arg, const char *name, SceMode mode);
72  int (*IoRmdir)(PspIoDrvFileArg *arg, const char *name);
73  int (*IoDopen)(PspIoDrvFileArg *arg, const char *dirname);
74  int (*IoDclose)(PspIoDrvFileArg *arg);
75  int (*IoDread)(PspIoDrvFileArg *arg, SceIoDirent *dir);
76  int (*IoGetstat)(PspIoDrvFileArg *arg, const char *file, SceIoStat *stat);
77  int (*IoChstat)(PspIoDrvFileArg *arg, const char *file, SceIoStat *stat, int bits);
78  int (*IoRename)(PspIoDrvFileArg *arg, const char *oldname, const char *newname);
79  int (*IoChdir)(PspIoDrvFileArg *arg, const char *dir);
80  int (*IoMount)(PspIoDrvFileArg *arg);
81  int (*IoUmount)(PspIoDrvFileArg *arg);
82  int (*IoDevctl)(PspIoDrvFileArg *arg, const char *devname, unsigned int cmd, void *indata, int inlen, void *outdata, int outlen);
83  int (*IoUnk21)(PspIoDrvFileArg *arg);
85 
86 typedef struct PspIoDrv
87 {
89  const char *name;
95  const char *name2;
98 } PspIoDrv;
99 
115 int sceIoAddDrv(PspIoDrv *drv);
116 
124 int sceIoDelDrv(const char *drv_name);
125 
136 int sceIoReopen(const char *file, int flags, SceMode mode, SceUID fd);
137 
148 int sceIoGetThreadCwd(SceUID uid, char *dir, int len);
149 
158 int sceIoChangeThreadCwd(SceUID uid, char *dir);
159 
162 #ifdef __cplusplus
163 }
164 #endif
165 
166 #endif /* PSPIOFILEMGR_KERNEL_H */