KallistiOS git master
Independent SDK for the Sega Dreamcast
Loading...
Searching...
No Matches
vfs_handler_t Struct Reference

VFS handler interface. More...

#include <kos/fs.h>

Data Fields

nmmgr_handler_t nmmgr
 Name manager handler header.
 
int cache
 Allow VFS caching; 0=no, 1=yes.
 
void * privdata
 Pointer to private data for the handler.
 
void *(* open )(struct vfs_handler *vfs, const char *fn, int mode)
 Open a file on the given VFS; return a unique identifier.
 
int(* close )(void *hnd)
 Close a previously opened file.
 
ssize_t(* read )(void *hnd, void *buffer, size_t cnt)
 Read from a previously opened file.
 
ssize_t(* write )(void *hnd, const void *buffer, size_t cnt)
 Write to a previously opened file.
 
off_t(* seek )(void *hnd, off_t offset, int whence)
 Seek in a previously opened file.
 
off_t(* tell )(void *hnd)
 Return the current position in a previously opened file.
 
size_t(* total )(void *hnd)
 Return the total size of a previously opened file.
 
dirent_t *(* readdir )(void *hnd)
 Read the next directory entry in a directory opened with O_DIR.
 
int(* ioctl )(void *hnd, int cmd, va_list ap)
 Execute a device-specific call on a previously opened file.
 
int(* rename )(struct vfs_handler *vfs, const char *fn1, const char *fn2)
 Rename/move a file on the given VFS.
 
int(* unlink )(struct vfs_handler *vfs, const char *fn)
 Delete a file from the given VFS.
 
void *(* mmap )(void *fd)
 "Memory map" a previously opened file
 
int(* complete )(void *fd, ssize_t *rv)
 Perform an I/O completion (async I/O) for a previously opened file.
 
int(* stat )(struct vfs_handler *vfs, const char *path, struct stat *buf, int flag)
 Get status information on a file on the given VFS.
 
int(* mkdir )(struct vfs_handler *vfs, const char *fn)
 Make a directory on the given VFS.
 
int(* rmdir )(struct vfs_handler *vfs, const char *fn)
 Remove a directory from the given VFS.
 
int(* fcntl )(void *fd, int cmd, va_list ap)
 Manipulate file control flags on the given file.
 
short(* poll )(void *fd, short events)
 Check if an event is pending on the given file.
 
int(* link )(struct vfs_handler *vfs, const char *path1, const char *path2)
 Create a hard link.
 
int(* symlink )(struct vfs_handler *vfs, const char *path1, const char *path2)
 Create a symbolic link.
 
_off64_t(* seek64 )(void *hnd, _off64_t offset, int whence)
 Seek in a previously opened file (64-bit offsets)
 
_off64_t(* tell64 )(void *hnd)
 Return the current position in an opened file (64-bit offset)
 
uint64(* total64 )(void *hnd)
 Return the size of an opened file as a 64-bit integer.
 
ssize_t(* readlink )(struct vfs_handler *vfs, const char *path, char *buf, size_t bufsize)
 Read the value of a symbolic link.
 
int(* rewinddir )(void *hnd)
 Rewind a directory stream to the start.
 
int(* fstat )(void *hnd, struct stat *st)
 Get status information on an already opened file.
 

Detailed Description

VFS handler interface.

All VFS handlers must implement this interface.

Field Documentation

◆ cache

int vfs_handler_t::cache

Allow VFS caching; 0=no, 1=yes.

◆ close

int(* vfs_handler_t::close) (void *hnd)

Close a previously opened file.

◆ complete

int(* vfs_handler_t::complete) (void *fd, ssize_t *rv)

Perform an I/O completion (async I/O) for a previously opened file.

◆ fcntl

int(* vfs_handler_t::fcntl) (void *fd, int cmd, va_list ap)

Manipulate file control flags on the given file.

◆ fstat

int(* vfs_handler_t::fstat) (void *hnd, struct stat *st)

Get status information on an already opened file.

◆ ioctl

int(* vfs_handler_t::ioctl) (void *hnd, int cmd, va_list ap)

Execute a device-specific call on a previously opened file.

◆ link

int(* vfs_handler_t::link) (struct vfs_handler *vfs, const char *path1, const char *path2)

Create a hard link.

◆ mkdir

int(* vfs_handler_t::mkdir) (struct vfs_handler *vfs, const char *fn)

Make a directory on the given VFS.

◆ mmap

void *(* vfs_handler_t::mmap) (void *fd)

"Memory map" a previously opened file

◆ nmmgr

nmmgr_handler_t vfs_handler_t::nmmgr

Name manager handler header.

◆ open

void *(* vfs_handler_t::open) (struct vfs_handler *vfs, const char *fn, int mode)

Open a file on the given VFS; return a unique identifier.

◆ poll

short(* vfs_handler_t::poll) (void *fd, short events)

Check if an event is pending on the given file.

◆ privdata

void* vfs_handler_t::privdata

Pointer to private data for the handler.

◆ read

ssize_t(* vfs_handler_t::read) (void *hnd, void *buffer, size_t cnt)

Read from a previously opened file.

◆ readdir

dirent_t *(* vfs_handler_t::readdir) (void *hnd)

Read the next directory entry in a directory opened with O_DIR.

◆ readlink

ssize_t(* vfs_handler_t::readlink) (struct vfs_handler *vfs, const char *path, char *buf, size_t bufsize)

Read the value of a symbolic link.

Note
path will not be passed through realpath() before calling the filesystem-level function. It is also important to not call realpath() in any implementation of this function as it is possible that realpath() will call this function.

◆ rename

int(* vfs_handler_t::rename) (struct vfs_handler *vfs, const char *fn1, const char *fn2)

Rename/move a file on the given VFS.

◆ rewinddir

int(* vfs_handler_t::rewinddir) (void *hnd)

Rewind a directory stream to the start.

◆ rmdir

int(* vfs_handler_t::rmdir) (struct vfs_handler *vfs, const char *fn)

Remove a directory from the given VFS.

◆ seek

off_t(* vfs_handler_t::seek) (void *hnd, off_t offset, int whence)

Seek in a previously opened file.

◆ seek64

_off64_t(* vfs_handler_t::seek64) (void *hnd, _off64_t offset, int whence)

Seek in a previously opened file (64-bit offsets)

◆ stat

int(* vfs_handler_t::stat) (struct vfs_handler *vfs, const char *path, struct stat *buf, int flag)

Get status information on a file on the given VFS.

Note
path will not be passed through realpath() before calling the filesystem-level function. It is also important to not call realpath() in any implementation of this function as it is possible that realpath() will call this function.

◆ symlink

int(* vfs_handler_t::symlink) (struct vfs_handler *vfs, const char *path1, const char *path2)

Create a symbolic link.

◆ tell

off_t(* vfs_handler_t::tell) (void *hnd)

Return the current position in a previously opened file.

◆ tell64

_off64_t(* vfs_handler_t::tell64) (void *hnd)

Return the current position in an opened file (64-bit offset)

◆ total

size_t(* vfs_handler_t::total) (void *hnd)

Return the total size of a previously opened file.

◆ total64

uint64(* vfs_handler_t::total64) (void *hnd)

Return the size of an opened file as a 64-bit integer.

◆ unlink

int(* vfs_handler_t::unlink) (struct vfs_handler *vfs, const char *fn)

Delete a file from the given VFS.

◆ write

ssize_t(* vfs_handler_t::write) (void *hnd, const void *buffer, size_t cnt)

Write to a previously opened file.


The documentation for this struct was generated from the following file: