sdk-core v2026.11.05
PS2 SDK - core tier (build-critical EE/IOP modules)
Loading...
Searching...
No Matches
io_common.h
Go to the documentation of this file.
1/*
2# _____ ___ ____ ___ ____
3# ____| | ____| | | |____|
4# | ___| |____ ___| ____| | \ PS2DEV Open Source Project.
5#-----------------------------------------------------------------------
6# Copyright 2001-2004, ps2dev - http://www.ps2dev.org
7# Licenced under Academic Free License version 2.0
8# Review ps2sdk README & LICENSE files for further details.
9*/
10
16
17#ifndef __IO_COMMON_H__
18#define __IO_COMMON_H__
19
20#include <sys/fcntl.h>
21#include <sys/unistd.h>
22
23#ifdef _EE
24#ifndef NEWLIB_PORT_AWARE
25#error "Using fio/fileXio functions directly in the newlib port will lead to problems."
26#error "Use posix function calls instead."
27#endif
28#endif
29
30#define FIO_O_RDONLY 0x0001
31#define FIO_O_WRONLY 0x0002
32#define FIO_O_RDWR 0x0003
33#define FIO_O_DIROPEN 0x0008 // Internal use for dopen
34#define FIO_O_NBLOCK 0x0010
35#define FIO_O_APPEND 0x0100
36#define FIO_O_CREAT 0x0200
37#define FIO_O_TRUNC 0x0400
38#define FIO_O_EXCL 0x0800
39#define FIO_O_NOWAIT 0x8000
40
41#define FIO_MT_RDWR 0x00
42#define FIO_MT_RDONLY 0x01
43
44#define FIO_SEEK_SET 0
45#define FIO_SEEK_CUR 1
46#define FIO_SEEK_END 2
47
48typedef struct
49{
50 unsigned int mode;
51 unsigned int attr;
52 unsigned int size;
53 unsigned char ctime[8];
54 unsigned char atime[8];
55 unsigned char mtime[8];
56 unsigned int hisize;
57} io_stat_t;
58
59typedef struct
60{
61 io_stat_t stat;
62 char name[256];
63 void *privdata;
65
66#endif /* __IO_COMMON_H__ */