PS2SDK
PS2 Homebrew Libraries
Loading...
Searching...
No Matches
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
36extern "C" {
37#endif
38
39int fioInit(void);
40void fioExit(void);
41int fioOpen(const char *fname, int mode);
42int fioClose(int fd);
43int fioRead(int fd, void *buff, int buff_size);
44int fioWrite(int fd, const void *buff, int buff_size);
45int fioLseek(int fd, int offset, int whence);
46int fioMkdir(const char *dirname);
47int fioPutc(int fd, int c);
48int fioGetc(int fd);
49int fioGets(int fd, char *buff, int n);
50void fioSetBlockMode(int blocking);
51int fioSync(int mode, int *retVal);
52int fioIoctl(int fd, int request, void *data);
53int fioDopen(const char *name);
54int fioDclose(int fd);
55int fioDread(int fd, io_dirent_t *buf); // Warning! (*)
56int fioGetstat(const char *name, io_stat_t *buf); // Warning! (*)
57int fioChstat(const char *name, io_stat_t *buf, unsigned int cbit);
58int fioRemove(const char *name); // Warning! (**)
59int fioFormat(const char *name);
60int 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__ */