sdk-core v2026.11.05
PS2 SDK - core tier (build-critical EE/IOP modules)
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
18#ifndef __FILEIO_H__
19#define __FILEIO_H__
20
21#include <io_common.h>
22
23#ifndef NEWLIB_PORT_AWARE
24#error "Using fio/fileXio functions directly in the newlib port will lead to problems."
25#error "Use posix function calls instead."
26#endif
27
28#define FIO_WAIT 0
29#define FIO_NOWAIT 1
30
31#define FIO_COMPLETE 1
32#define FIO_INCOMPLETE 0
33
34#define EOF (-1)
35
36#ifdef __cplusplus
37extern "C" {
38#endif
39
40extern int fioInit(void);
41extern void fioExit(void);
42extern int fioOpen(const char *fname, int mode);
43extern int fioClose(int fd);
44extern int fioRead(int fd, void *buff, int buff_size);
45extern int fioWrite(int fd, const void *buff, int buff_size);
46extern int fioLseek(int fd, int offset, int whence);
47extern int fioMkdir(const char *dirname);
48extern int fioPutc(int fd, int c);
49extern int fioGetc(int fd);
50extern int fioGets(int fd, char *buff, int n);
51extern void fioSetBlockMode(int blocking);
52extern int fioSync(int mode, int *retVal);
53extern int fioIoctl(int fd, int request, void *data);
54extern int fioDopen(const char *name);
55extern int fioDclose(int fd);
56extern int fioDread(int fd, io_dirent_t *buf); // Warning! (*)
57extern int fioGetstat(const char *name, io_stat_t *buf); // Warning! (*)
58extern int fioChstat(const char *name, io_stat_t *buf, unsigned int cbit);
59extern int fioRemove(const char *name); // Warning! (**)
60extern int fioFormat(const char *name);
61extern int fioRmdir(const char *dirname);
62
63/* * Function is unstable; does not suspend interrupts prior to performing DMA transfers on the IOP side.
64 ** Function is broken; falls through to the next case (mkdir) upon completion.
65
66 Patches are available to fix these issues. Otherwise, please use fileXio instead. */
67
68#ifdef __cplusplus
69}
70#endif
71
72#endif /* __FILEIO_H__ */