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