PS2SDK
PS2 Homebrew Libraries
Loading...
Searching...
No Matches
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
26extern "C" {
27#endif
28
29int io_open(const char *name, int mode);
30int io_close(int fd);
31int io_read(int fd, void *ptr, size_t size);
32int io_write(int fd, void *ptr, size_t size);
33int io_lseek(int fd, int pos, int mode);
34int io_ioctl(int fd, unsigned long arg, void *param);
35int io_remove(const char *name);
36int io_mkdir(const char *path);
37int io_rmdir(const char *path);
38int io_dopen(const char *path, int mode);
39int io_dclose(int fd);
40int io_dread(int fd, io_dirent_t *buf);
41int io_getstat(const char *name, io_stat_t *stat);
42int io_chstat(const char *name, io_stat_t *stat, unsigned int statmask);
43int 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
65
66typedef 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;
74
75typedef struct _iop_io_device_ops {
76 int (*io_init)(iop_io_device_t *);
77 int (*io_deinit)(iop_io_device_t *);
78 int (*io_format)(iop_io_file_t *);
79 int (*io_open)(iop_io_file_t *, const char *, int);
80 int (*io_close)(iop_io_file_t *);
81 int (*io_read)(iop_io_file_t *, void *, int);
82 int (*io_write)(iop_io_file_t *, void *, int);
83 int (*io_lseek)(iop_io_file_t *, int, int);
84 int (*io_ioctl)(iop_io_file_t *, unsigned long, void *);
85 int (*io_remove)(iop_io_file_t *, const char *);
86 int (*io_mkdir)(iop_io_file_t *, const char *);
87 int (*io_rmdir)(iop_io_file_t *, const char *);
88 int (*io_dopen)(iop_io_file_t *, const char *);
89 int (*io_dclose)(iop_io_file_t *);
90 int (*io_dread)(iop_io_file_t *, io_dirent_t *);
91 int (*io_getstat)(iop_io_file_t *, const char *, io_stat_t *);
92 int (*io_chstat)(iop_io_file_t *, const char *, io_stat_t *, unsigned int);
94
95int io_AddDrv(iop_io_device_t *device);
96int io_DelDrv(const char *name);
97
98#define ioman_mod_IMPORTS_start DECLARE_IMPORT_TABLE(ioman, 1, 1)
99#define ioman_mod_IMPORTS_end END_IMPORT_TABLE
100
101#define I_io_open DECLARE_IMPORT(4, io_open)
102#define I_io_close DECLARE_IMPORT(5, io_close)
103#define I_io_read DECLARE_IMPORT(6, io_read)
104#define I_io_write DECLARE_IMPORT(7, io_write)
105#define I_io_lseek DECLARE_IMPORT(8, io_lseek)
106#define I_io_ioctl DECLARE_IMPORT(9, io_ioctl)
107#define I_io_remove DECLARE_IMPORT(10, io_remove)
108#define I_io_mkdir DECLARE_IMPORT(11, io_mkdir)
109#define I_io_rmdir DECLARE_IMPORT(12, io_rmdir)
110#define I_io_dopen DECLARE_IMPORT(13, io_dopen)
111#define I_io_dclose DECLARE_IMPORT(14, io_dclose)
112#define I_io_dread DECLARE_IMPORT(15, io_dread)
113#define I_io_getstat DECLARE_IMPORT(16, io_getstat)
114#define I_io_chstat DECLARE_IMPORT(17, io_chstat)
115#define I_io_format DECLARE_IMPORT(18, io_format)
116#define I_io_AddDrv DECLARE_IMPORT(20, io_AddDrv);
117#define I_io_DelDrv DECLARE_IMPORT(21, io_DelDrv);
118
119#ifdef __cplusplus
120}
121#endif
122
123#endif /* __IOMAN_MOD_H__ */
struct _iop_io_file iop_io_file_t
struct _iop_io_device * device
Definition ioman_mod.h:61
unsigned int version
Definition ioman_mod.h:70
void * privdata
Definition ioman_mod.h:63