PS2SDK
PS2 Homebrew Libraries
iomanX.c File Reference
#include <string.h>
#include <types.h>
#include <intrman.h>
#include <stdio.h>
#include <iomanX.h>
#include <errno.h>
#include <stdarg.h>
+ Include dependency graph for iomanX.c:

Go to the source code of this file.

Macros

#define index   strchr
 
#define Kprintf   printf
 
#define MAX_DEVICES   16
 
#define MAX_FILES   32
 
#define isnum(c)   ((c) >= '0' && (c) <= '9')
 
#define EUNSUP   48
 
#define HANDLE_RESULT_CLEAR_INFO   1
 
#define HANDLE_RESULT_CLEAR_INFO_ON_ERROR   2
 
#define HANDLE_RESULT_RETURN_ZERO   4
 
#define HANDLE_RESULT_RETURN_FD   8
 
#define IOMANX_ENTRYPOINT   iomanX_start
 
#define IOMANX_CLEANUP   shutdown
 

Functions

void iomanX_StdioInit (int mode)
 
static int open_tty_handles (const char *tty_name)
 
static int xx_stat (int op, const char *name, iox_stat_t *stat, unsigned int statmask)
 
static int xx_rename (int op, const char *oldname, const char *newname)
 
static int xx_dir (int op, const char *name, int mode)
 
static int _ioabort (const char *str1, const char *str2)
 
static iomanX_iop_file_tnew_iob (void)
 
static iomanX_iop_file_tget_iob (int fd)
 
static iomanX_iop_device_tlookup_dev (const char *name, int show_unkdev_msg)
 
static const char * parsefile (const char *path, iomanX_iop_device_t **p_device, int *p_unit)
 
static void ShowDrv (void)
 
static void register_tty (void)
 
 IOMANX_RETURN_VALUE_IMPL (0)
 
static void write_str_to_stdout (const char *in_str)
 
static int set_errno (int in_errno)
 
static void handle_result_pre (int in_result, iomanX_iop_file_t *f, int op)
 
static int handle_result (int in_result, iomanX_iop_file_t *f, int op)
 
static s64 handle_result64 (s64 in_result, iomanX_iop_file_t *f, int op)
 
int IOMANX_ENTRYPOINT (int ac, char **av)
 
int IOMANX_CLEANUP (int arg)
 
int iomanX_open (const char *name, int flags,...)
 
int iomanX_lseek (int fd, int offset, int mode)
 
s64 iomanX_lseek64 (int fd, s64 offset, int whence)
 
int iomanX_read (int fd, void *ptr, int size)
 
int iomanX_write (int fd, void *ptr, int size)
 
int iomanX_close (int fd)
 
int iomanX_ioctl (int fd, int cmd, void *param)
 
int iomanX_ioctl2 (int fd, int cmd, void *arg, unsigned int arglen, void *buf, unsigned int buflen)
 
int iomanX_dopen (const char *path)
 
int iomanX_dread (int fd, iox_dirent_t *buf)
 
int iomanX_remove (const char *name)
 
int iomanX_mkdir (const char *path, int mode)
 
int iomanX_rmdir (const char *path)
 
int iomanX_getstat (const char *name, iox_stat_t *stat)
 
int iomanX_chstat (const char *name, iox_stat_t *stat, unsigned int statmask)
 
int iomanX_format (const char *dev, const char *blockdev, void *arg, int arglen)
 
int iomanX_rename (const char *oldname, const char *newname)
 
int iomanX_symlink (const char *oldname, const char *newname)
 
int iomanX_chdir (const char *name)
 
int iomanX_sync (const char *dev, int flag)
 
int iomanX_mount (const char *fsname, const char *devname, int flag, void *arg, int arglen)
 
int iomanX_umount (const char *fsname)
 
int iomanX_devctl (const char *name, int cmd, void *arg, unsigned int arglen, void *buf, unsigned int buflen)
 
int iomanX_readlink (const char *path, char *buf, unsigned int buflen)
 
int iomanX_AddDrv (iomanX_iop_device_t *device)
 
int iomanX_DelDrv (const char *name)
 
unsigned int iomanX_GetDevType (int fd)
 

Variables

static int showdrvflag = 1
 
static iomanX_iop_device_ops_t dev_tty_dev_operations
 
static iomanX_iop_device_t dev_tty
 
static int adddeldrv_in_process
 
static iomanX_iop_file_t file_table [MAX_FILES]
 
static iomanX_iop_device_tdevice_table [MAX_DEVICES]
 

Detailed Description

Advanced I/O library.

Definition in file iomanX.c.

Function Documentation

◆ iomanX_format()

int iomanX_format ( const char *  dev,
const char *  blockdev,
void *  arg,
int  arglen 
)

This can take take more than one form.

Definition at line 708 of file iomanX.c.

Variable Documentation

◆ dev_tty_dev_operations

iomanX_iop_device_ops_t dev_tty_dev_operations
static
Initial value:
= {
IOMANX_RETURN_VALUE(0),
IOMANX_RETURN_VALUE(0),
IOMANX_RETURN_VALUE(0),
IOMANX_RETURN_VALUE(0),
IOMANX_RETURN_VALUE(0),
IOMANX_RETURN_VALUE(0),
IOMANX_RETURN_VALUE(0),
IOMANX_RETURN_VALUE(0),
IOMANX_RETURN_VALUE(0),
IOMANX_RETURN_VALUE(0),
IOMANX_RETURN_VALUE(0),
IOMANX_RETURN_VALUE(0),
IOMANX_RETURN_VALUE(0),
IOMANX_RETURN_VALUE(0),
IOMANX_RETURN_VALUE(0),
IOMANX_RETURN_VALUE(0),
IOMANX_RETURN_VALUE(0),
IOMANX_RETURN_VALUE(0),
IOMANX_RETURN_VALUE(0),
IOMANX_RETURN_VALUE(0),
IOMANX_RETURN_VALUE(0),
IOMANX_RETURN_VALUE(0),
IOMANX_RETURN_VALUE_S64(0),
IOMANX_RETURN_VALUE(0),
IOMANX_RETURN_VALUE(0),
IOMANX_RETURN_VALUE(0),
IOMANX_RETURN_VALUE(0),
}

Definition at line 83 of file iomanX.c.

◆ dev_tty

iomanX_iop_device_t dev_tty
static
Initial value:
= {
"tty",
IOP_DT_CHAR,
1,
"CONSOLE",
&dev_tty_dev_operations,
}

Definition at line 112 of file iomanX.c.