PS2SDK
PS2 Homebrew Libraries
Loading...
Searching...
No Matches
ioman.c File Reference
#include "types.h"
#include "ioman_mod.h"
#include <string.h>
#include "stdarg.h"
#include "intrman.h"
#include "errno.h"
+ Include dependency graph for ioman.c:

Go to the source code of this file.

Macros

#define index   strchr
 
#define MODNAME   "ioman"
 
#define MAX_DEVICES   16
 
#define MAX_FILES   16
 
#define isnum(c)   ((c) >= '0' && (c) <= '9')
 

Functions

static int tty_noop ()
 
static int add_tty_device (void)
 
static int open_tty_handles (void)
 
static int setup_tty_device (int should_not_add_tty_device)
 
static int print_abort_error_io (const char *str1, const char *str2)
 
int _start (int argc, char *argv[])
 
int io_AddDrv (iop_io_device_t *device)
 
int io_DelDrv (const char *name)
 
static void print_known_devices (void)
 
static char * find_iop_device (const char *dev, int *unit, iop_io_device_t **device)
 
iop_io_file_tget_file (int fd)
 
iop_io_file_tget_new_file (void)
 
int io_open (const char *name, int mode)
 
int io_close (int fd)
 
int io_read (int fd, void *ptr, size_t size)
 
int io_write (int fd, void *ptr, size_t size)
 
int io_lseek (int fd, int offset, int whence)
 
int io_ioctl (int fd, unsigned long arg, void *param)
 
int io_remove (const char *name)
 
static int path_common (const char *name, int arg, int code)
 
int io_mkdir (const char *name)
 
int io_rmdir (const char *name)
 
int io_dopen (const char *name, int mode)
 
int io_dclose (int fd)
 
int io_dread (int fd, io_dirent_t *io_dirent)
 
int io_getstat (const char *name, io_stat_t *stat)
 
int io_chstat (const char *name, io_stat_t *stat, unsigned int mask)
 
int io_format (const char *dev)
 

Variables

static iop_io_device_tdev_list [MAX_DEVICES]
 
iop_io_file_t file_table [MAX_FILES]
 
static int should_print_known_devices = 1
 
iop_io_device_ops_t tty_dev_operations
 
iop_io_device_t tty_device
 

Detailed Description

Standard file manager library.

Definition in file ioman.c.

Macro Definition Documentation

◆ index

#define index   strchr

Definition at line 27 of file ioman.c.

◆ MODNAME

#define MODNAME   "ioman"

Definition at line 32 of file ioman.c.

◆ MAX_DEVICES

#define MAX_DEVICES   16

Definition at line 39 of file ioman.c.

◆ MAX_FILES

#define MAX_FILES   16

Definition at line 40 of file ioman.c.

◆ isnum

#define isnum (   c)    ((c) >= '0' && (c) <= '9')

Definition at line 47 of file ioman.c.

Function Documentation

◆ tty_noop()

static int tty_noop ( void  )
static

Definition at line 53 of file ioman.c.

◆ add_tty_device()

static int add_tty_device ( void  )
static

Definition at line 86 of file ioman.c.

◆ open_tty_handles()

static int open_tty_handles ( void  )
static

Definition at line 91 of file ioman.c.

◆ setup_tty_device()

static int setup_tty_device ( int  should_not_add_tty_device)
static

Definition at line 105 of file ioman.c.

◆ print_abort_error_io()

static int print_abort_error_io ( const char *  str1,
const char *  str2 
)
static

Definition at line 118 of file ioman.c.

◆ _start()

int _start ( int  argc,
char *  argv[] 
)

Definition at line 135 of file ioman.c.

◆ io_AddDrv()

int io_AddDrv ( iop_io_device_t device)

Definition at line 155 of file ioman.c.

◆ io_DelDrv()

int io_DelDrv ( const char *  name)

Definition at line 187 of file ioman.c.

◆ print_known_devices()

static void print_known_devices ( void  )
static

Definition at line 202 of file ioman.c.

◆ find_iop_device()

static char * find_iop_device ( const char *  dev,
int *  unit,
iop_io_device_t **  device 
)
static

Definition at line 222 of file ioman.c.

◆ get_file()

iop_io_file_t * get_file ( int  fd)

Definition at line 271 of file ioman.c.

◆ get_new_file()

iop_io_file_t * get_new_file ( void  )

Definition at line 282 of file ioman.c.

◆ io_open()

int io_open ( const char *  name,
int  mode 
)

Definition at line 313 of file ioman.c.

◆ io_close()

int io_close ( int  fd)

Definition at line 344 of file ioman.c.

◆ io_read()

int io_read ( int  fd,
void *  ptr,
size_t  size 
)

Definition at line 361 of file ioman.c.

◆ io_write()

int io_write ( int  fd,
void *  ptr,
size_t  size 
)

Definition at line 371 of file ioman.c.

◆ io_lseek()

int io_lseek ( int  fd,
int  offset,
int  whence 
)

Definition at line 381 of file ioman.c.

◆ io_ioctl()

int io_ioctl ( int  fd,
unsigned long  arg,
void *  param 
)

Definition at line 400 of file ioman.c.

◆ io_remove()

int io_remove ( const char *  name)

Definition at line 410 of file ioman.c.

◆ path_common()

static int path_common ( const char *  name,
int  arg,
int  code 
)
static

Definition at line 438 of file ioman.c.

◆ io_mkdir()

int io_mkdir ( const char *  name)

Definition at line 474 of file ioman.c.

◆ io_rmdir()

int io_rmdir ( const char *  name)

Definition at line 479 of file ioman.c.

◆ io_dopen()

int io_dopen ( const char *  name,
int  mode 
)

Definition at line 484 of file ioman.c.

◆ io_dclose()

int io_dclose ( int  fd)

Definition at line 513 of file ioman.c.

◆ io_dread()

int io_dread ( int  fd,
io_dirent_t io_dirent 
)

Definition at line 530 of file ioman.c.

◆ io_getstat()

int io_getstat ( const char *  name,
io_stat_t stat 
)

Definition at line 545 of file ioman.c.

◆ io_chstat()

int io_chstat ( const char *  name,
io_stat_t stat,
unsigned int  mask 
)

Definition at line 570 of file ioman.c.

◆ io_format()

int io_format ( const char *  dev)

Definition at line 595 of file ioman.c.

Variable Documentation

◆ dev_list

iop_io_device_t* dev_list[MAX_DEVICES]
static

Definition at line 42 of file ioman.c.

◆ file_table

iop_io_file_t file_table[MAX_FILES]

Definition at line 43 of file ioman.c.

◆ should_print_known_devices

int should_print_known_devices = 1
static

Definition at line 45 of file ioman.c.

◆ tty_dev_operations

iop_io_device_ops_t tty_dev_operations
Initial value:
= {
&tty_noop,
&tty_noop,
&tty_noop,
&tty_noop,
&tty_noop,
&tty_noop,
&tty_noop,
&tty_noop,
&tty_noop,
&tty_noop,
&tty_noop,
&tty_noop,
&tty_noop,
&tty_noop,
&tty_noop,
&tty_noop,
&tty_noop,
}

Definition at line 58 of file ioman.c.

◆ tty_device

iop_io_device_t tty_device
Initial value:
= {
"tty",
IOP_DT_CHAR,
1,
"CONSOLE",
&tty_dev_operations,
}

Definition at line 78 of file ioman.c.