PS2SDK
PS2 Homebrew Libraries
Loading...
Searching...
No Matches
fakehost - host: to hdd driver

Functions

char * fd_name (char *buffer, const char *name)
 
int fd_save (int fd, iop_io_file_t *f)
 
int realfd (iop_io_file_t *f)
 
int dummy ()
 
int fd_initialize (iop_io_device_t *driver)
 
int fd_open (iop_io_file_t *f, const char *name, int mode)
 
int fd_close (iop_io_file_t *f)
 
int fd_read (iop_io_file_t *f, void *buffer, int size)
 
int fd_write (iop_io_file_t *fd, void *buffer, int size)
 
int fd_lseek (iop_io_file_t *fd, int offset, int whence)
 
int _start (int argc, char *argv[])
 
static void * naplinkRpcHandler (int cmd, void *buffer, int size)
 
static void napThread (void *arg)
 
int naplinkRpcInit (void)
 

Detailed Description

Function Documentation

◆ fd_name()

char * fd_name ( char *  buffer,
const char *  name 
)

#include <iop/fs/fakehost/src/fakehost.c>

Make a full pathname string, adding base on.

Parameters
bufferbuffer to hold result.
namename to add base to.
Returns
Pointer to buffer.

This function takes the name param and adds it to the basename for replacement, returning the destination full pathname.

Definition at line 75 of file fakehost.c.

Referenced by fd_open().

◆ fd_save()

int fd_save ( int  fd,
iop_io_file_t f 
)

#include <iop/fs/fakehost/src/fakehost.c>

Store filedescriptor and get client filedescriptor.

Parameters
fdfiledescriptor to store.
fio_file pointer to store fd in .
Returns
client filedescriptor.

Definition at line 89 of file fakehost.c.

References _iop_io_file::privdata, and _iop_io_file::unit.

Referenced by fd_open().

◆ realfd()

int realfd ( iop_io_file_t f)

#include <iop/fs/fakehost/src/fakehost.c>

Get real filedescriptor.

Parameters
fio_file pointer to get fd from.
Returns
real filedescriptor.

Definition at line 102 of file fakehost.c.

References _iop_io_file::privdata.

Referenced by fd_close(), fd_lseek(), fd_read(), and fd_write().

◆ dummy()

int dummy ( )

#include <iop/fs/fakehost/src/fakehost.c>

Dummy function, for where needed.

Definition at line 110 of file fakehost.c.

References EIO.

◆ fd_initialize()

int fd_initialize ( iop_io_device_t driver)

#include <iop/fs/fakehost/src/fakehost.c>

Initialise fs driver.

Parameters
driverio_device pointer to device
Returns
Status (0=successful).

Definition at line 122 of file fakehost.c.

◆ fd_open()

int fd_open ( iop_io_file_t f,
const char *  name,
int  mode 
)

#include <iop/fs/fakehost/src/fakehost.c>

Handle open request.

Parameters
fPointer to io_device structure.
namepathname.
modeopen mode.
Returns
Status (as for fileio open).

Definition at line 136 of file fakehost.c.

References fd_name(), fd_save(), and _iop_io_file::unit.

◆ fd_close()

int fd_close ( iop_io_file_t f)

#include <iop/fs/fakehost/src/fakehost.c>

Handle close request.

Parameters
fPointer to io_device structure.
Returns
Status (as for fileio close).

Definition at line 154 of file fakehost.c.

References realfd().

◆ fd_read()

int fd_read ( iop_io_file_t f,
void *  buffer,
int  size 
)

#include <iop/fs/fakehost/src/fakehost.c>

Handle read request.

Parameters
fPointer to io_device structure.
bufferPointer to read buffer.
sizeSize of buffer.
Returns
Status (as for fileio read).

Definition at line 167 of file fakehost.c.

References realfd().

◆ fd_write()

int fd_write ( iop_io_file_t fd,
void *  buffer,
int  size 
)

#include <iop/fs/fakehost/src/fakehost.c>

Handle write request.

Parameters
fPointer to io_device structure.
bufferPointer to read buffer.
sizeSize of buffer.
Returns
Status (as for fileio write).

Definition at line 180 of file fakehost.c.

References realfd().

◆ fd_lseek()

int fd_lseek ( iop_io_file_t fd,
int  offset,
int  whence 
)

#include <iop/fs/fakehost/src/fakehost.c>

Handle lseek request.

Parameters
fPointer to io_device structure.
offsetOffset for seek.
whenceBase for seek.
Returns
Status (as for fileio lseek).

Definition at line 193 of file fakehost.c.

References realfd().

◆ _start()

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

#include <iop/fs/fakehost/src/fakehost.c>

Entry point for IRX.

if argc != 2 , quit, as it needs parameter if argc == 2 , use arv[1] as basename.

Parameters
argcNumber of arguments.
argvPointer to array of arguments.
Returns
Module Status on Exit.

This initialises the fakehost driver, setting up the 'host:' fs driver basename redirection, and naplink compatible rpc hander.

return values: MODULE_RESIDENT_END if loaded and registered as library. MODULE_NO_RESIDENT_END if just exiting normally.

Definition at line 245 of file fakehost.c.

References naplinkRpcInit().

◆ naplinkRpcHandler()

static void * naplinkRpcHandler ( int  cmd,
void *  buffer,
int  size 
)
static

#include <iop/fs/fakehost/src/nprintf.c>

RPC handler function.

Parameters
cmdCommand.
bufferPointer to buffer.
sizeSize of buffer.

Definition at line 38 of file nprintf.c.

Referenced by napThread().

◆ napThread()

static void napThread ( void *  arg)
static

#include <iop/fs/fakehost/src/nprintf.c>

naplink compatbile RPC handler thread.

Parameters
argStartup parameters.

Definition at line 56 of file nprintf.c.

References naplinkRpcHandler().

Referenced by naplinkRpcInit().

◆ naplinkRpcInit()

int naplinkRpcInit ( void  )

#include <iop/fs/fakehost/src/nprintf.c>

Setup naplink compatible RPC handler.

Returns
Status.

return values: 0 on success. -1 on error.

Definition at line 80 of file nprintf.c.

References napThread().

Referenced by _start().