PS2SDK
PS2 Homebrew Libraries
fileio.h
Go to the documentation of this file.
1 /*
2 # _____ ___ ____ ___ ____
3 # ____| | ____| | | |____|
4 # | ___| |____ ___| ____| | \ PS2DEV Open Source Project.
5 #-----------------------------------------------------------------------
6 # (C)2001, Gustavo Scotti (gustavo@scotti.com)
7 # (c) 2003 Marcus R. Brown (mrbrown@0xd6.org)
8 # Licenced under Academic Free License version 2.0
9 # Review ps2sdk README & LICENSE files for further details.
10 */
11 
17 #ifndef __FILEIO_H__
18 #define __FILEIO_H__
19 
20 #include <io_common.h>
21 
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 
27 #define FIO_WAIT 0
28 #define FIO_NOWAIT 1
29 
30 #define FIO_COMPLETE 1
31 #define FIO_INCOMPLETE 0
32 
33 #define EOF (-1)
34 
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38 
39 extern int fioInit(void);
40 extern void fioExit(void);
41 extern int fioOpen(const char *fname, int mode);
42 extern int fioClose(int fd);
43 extern int fioRead(int fd, void *buff, int buff_size);
44 extern int fioWrite(int fd, const void *buff, int buff_size);
45 extern int fioLseek(int fd, int offset, int whence);
46 extern int fioMkdir(const char *dirname);
47 extern int fioPutc(int fd, int c);
48 extern int fioGetc(int fd);
49 extern int fioGets(int fd, char *buff, int n);
50 extern void fioSetBlockMode(int blocking);
51 extern int fioSync(int mode, int *retVal);
52 extern int fioIoctl(int fd, int request, void *data);
53 extern int fioDopen(const char *name);
54 extern int fioDclose(int fd);
55 extern int fioDread(int fd, io_dirent_t *buf); // Warning! (*)
56 extern int fioGetstat(const char *name, io_stat_t *buf); // Warning! (*)
57 extern int fioChstat(const char *name, io_stat_t *buf, unsigned int cbit);
58 extern int fioRemove(const char *name); // Warning! (**)
59 extern int fioFormat(const char *name);
60 extern int fioRmdir(const char *dirname);
61 
62 /* * Function is unstable; does not suspend interrupts prior to performing DMA transfers on the IOP side.
63  ** Function is broken; falls through to the next case (mkdir) upon completion.
64 
65  Patches are available to fix these issues. Otherwise, please use fileXio instead. */
66 
67 #ifdef __cplusplus
68 }
69 #endif
70 
71 #endif /* __FILEIO_H__ */
io_common.h
request
Definition: thread.c:17
io_stat_t
Definition: io_common.h:47
io_dirent_t
Definition: io_common.h:58