PS2SDK
PS2 Homebrew Libraries
ioman_mod.h
Go to the documentation of this file.
1
/*
2
# _____ ___ ____ ___ ____
3
# ____| | ____| | | |____|
4
# | ___| |____ ___| ____| | \ PS2DEV Open Source Project.
5
#-----------------------------------------------------------------------
6
# Copyright (c) 2003 Marcus R. Brown <mrbrown@0xd6.org>
7
# Copyright (c) 2004 adresd <adresd_ps2dev@yahoo.com>
8
# Licenced under Academic Free License version 2.0
9
# Review ps2sdk README & LICENSE files for further details.
10
*/
11
17
#ifndef __IOMAN_MOD_H__
18
#define __IOMAN_MOD_H__
19
20
#include <types.h>
21
#include <
irx.h
>
22
#include <
io_common.h
>
23
#include <
iox_stat.h
>
24
25
#ifdef __cplusplus
26
extern
"C"
{
27
#endif
28
29
extern
int
io_open(
const
char
*name,
int
mode);
30
extern
int
io_close(
int
fd);
31
extern
int
io_read(
int
fd,
void
*ptr,
size_t
size);
32
extern
int
io_write(
int
fd,
void
*ptr,
size_t
size);
33
extern
int
io_lseek(
int
fd,
int
pos,
int
mode);
34
extern
int
io_ioctl(
int
fd,
unsigned
long
arg,
void
*param);
35
extern
int
io_remove(
const
char
*name);
36
extern
int
io_mkdir(
const
char
*path);
37
extern
int
io_rmdir(
const
char
*path);
38
extern
int
io_dopen(
const
char
*path,
int
mode);
39
extern
int
io_dclose(
int
fd);
40
extern
int
io_dread(
int
fd,
io_dirent_t
*buf);
41
extern
int
io_getstat(
const
char
*name,
io_stat_t
*stat);
42
extern
int
io_chstat(
const
char
*name,
io_stat_t
*stat,
unsigned
int
statmask);
43
extern
int
io_format(
const
char
*dev);
44
45
/* Device drivers. */
46
47
/* Device types. */
48
#define IOP_DT_CHAR 0x01
49
#define IOP_DT_CONS 0x02
50
#define IOP_DT_BLOCK 0x04
51
#define IOP_DT_RAW 0x08
52
#define IOP_DT_FS 0x10
53
55
typedef
struct
_iop_io_file
{
57
int
mode
;
59
int
unit
;
61
struct
_iop_io_device
*
device
;
63
void
*
privdata
;
64
}
iop_io_file_t
;
65
66
typedef
struct
_iop_io_device
{
67
const
char
*name;
68
unsigned
int
type;
70
unsigned
int
version
;
71
const
char
*desc;
72
struct
_iop_io_device_ops
*ops;
73
}
iop_io_device_t
;
74
75
#define IOMAN_RETURN_VALUE_IMPL(val) \
76
static inline int my_ioman_retval_##val##_int(void) {return -val;} \
77
static inline signed long long my_ioman_retval_##val##_s64(void) {return -val;}
78
#define IOMAN_RETURN_VALUE(val) ((void*)&my_ioman_retval_##val##_int)
79
#define IOMAN_RETURN_VALUE_S64(val) ((void*)&my_ioman_retval_##val##_s64)
80
81
typedef
struct
_iop_io_device_ops
{
82
int (*io_init)(
iop_io_device_t
*device);
83
int (*io_deinit)(
iop_io_device_t
*device);
84
int (*io_format)(
iop_io_file_t
*f);
85
int (*io_open)(
iop_io_file_t
*f,
const
char
*name,
int
flags);
86
int (*io_close)(
iop_io_file_t
*f);
87
int (*io_read)(
iop_io_file_t
*f,
void
*ptr,
int
size);
88
int (*io_write)(
iop_io_file_t
*f,
void
*ptr,
int
size);
89
int (*io_lseek)(
iop_io_file_t
*f,
int
offset,
int
mode);
90
int (*io_ioctl)(
iop_io_file_t
*f,
unsigned
long
cmd,
void
*param);
91
int (*io_remove)(
iop_io_file_t
*f,
const
char
*name);
92
int (*io_mkdir)(
iop_io_file_t
*f,
const
char
*path);
93
int (*io_rmdir)(
iop_io_file_t
*f,
const
char
*path);
94
int (*io_dopen)(
iop_io_file_t
*f,
const
char
*path);
95
int (*io_dclose)(
iop_io_file_t
*f);
96
int (*io_dread)(
iop_io_file_t
*f,
io_dirent_t
*buf);
97
int (*io_getstat)(
iop_io_file_t
*f,
const
char
*name,
io_stat_t
*stat_);
98
int (*io_chstat)(
iop_io_file_t
*f,
const
char
*name,
io_stat_t
*stat_,
unsigned
int
statmask);
99
}
iop_io_device_ops_t
;
100
101
extern
int
io_AddDrv(
iop_io_device_t
*device);
102
extern
int
io_DelDrv(
const
char
*name);
103
104
#define ioman_mod_IMPORTS_start DECLARE_IMPORT_TABLE(ioman, 1, 1)
105
#define ioman_mod_IMPORTS_end END_IMPORT_TABLE
106
107
#define I_io_open DECLARE_IMPORT(4, io_open)
108
#define I_io_close DECLARE_IMPORT(5, io_close)
109
#define I_io_read DECLARE_IMPORT(6, io_read)
110
#define I_io_write DECLARE_IMPORT(7, io_write)
111
#define I_io_lseek DECLARE_IMPORT(8, io_lseek)
112
#define I_io_ioctl DECLARE_IMPORT(9, io_ioctl)
113
#define I_io_remove DECLARE_IMPORT(10, io_remove)
114
#define I_io_mkdir DECLARE_IMPORT(11, io_mkdir)
115
#define I_io_rmdir DECLARE_IMPORT(12, io_rmdir)
116
#define I_io_dopen DECLARE_IMPORT(13, io_dopen)
117
#define I_io_dclose DECLARE_IMPORT(14, io_dclose)
118
#define I_io_dread DECLARE_IMPORT(15, io_dread)
119
#define I_io_getstat DECLARE_IMPORT(16, io_getstat)
120
#define I_io_chstat DECLARE_IMPORT(17, io_chstat)
121
#define I_io_format DECLARE_IMPORT(18, io_format)
122
#define I_io_AddDrv DECLARE_IMPORT(20, io_AddDrv);
123
#define I_io_DelDrv DECLARE_IMPORT(21, io_DelDrv);
124
125
#ifdef __cplusplus
126
}
127
#endif
128
129
#endif
/* __IOMAN_MOD_H__ */
io_common.h
_iop_io_device_ops
Definition:
ioman_mod.h:81
_iop_io_file
Definition:
ioman_mod.h:55
_iop_io_device::version
unsigned int version
Definition:
ioman_mod.h:70
irx.h
_iop_io_file::unit
int unit
Definition:
ioman_mod.h:59
_iop_io_file::device
struct _iop_io_device * device
Definition:
ioman_mod.h:61
_iop_io_file::privdata
void * privdata
Definition:
ioman_mod.h:63
io_stat_t
Definition:
io_common.h:47
iop_io_file_t
struct _iop_io_file iop_io_file_t
io_dirent_t
Definition:
io_common.h:58
_iop_io_device
Definition:
ioman_mod.h:66
_iop_io_file::mode
int mode
Definition:
ioman_mod.h:57
iox_stat.h
iop
system
ioman
include
ioman_mod.h
Generated on Sat May 16 2026 16:59:27 for PS2SDK by
1.8.17