KallistiOS  2.0.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
Data Fields
vfs_handler Struct Reference

VFS handler interface. More...

#include <kos/fs.h>

Data Fields

nmmgr_handler_t nmmgr
 Name manager handler header.
int cache
 Allow VFS cacheing; 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, void *data, size_t size)
 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 *fn, stat_t *rv)
 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.

Detailed Description

VFS handler interface.

All VFS handlers must implement this interface.


Field Documentation

int vfs_handler::cache

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

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

Close a previously opened file.

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

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

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

Manipulate file control flags on the given file.

int(* vfs_handler::ioctl)(void *hnd, void *data, size_t size)

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

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

Create a hard link.

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

Make a directory on the given VFS.

void*(* vfs_handler::mmap)(void *fd)

"Memory map" a previously opened file

nmmgr_handler_t vfs_handler::nmmgr

Name manager handler header.

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

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

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

Check if an event is pending on the given file.

void* vfs_handler::privdata

Pointer to private data for the handler.

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

Read from a previously opened file.

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

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

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

Rename/move a file on the given VFS.

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

Remove a directory from the given VFS.

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

Seek in a previously opened file.

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

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

int(* vfs_handler::stat)(struct vfs_handler *vfs, const char *fn, stat_t *rv)

Get status information on a file on the given VFS.

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

Create a symbolic link.

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

Return the current position in a previously opened file.

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

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

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

Return the total size of a previously opened file.

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

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

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

Delete a file from the given VFS.

ssize_t(* vfs_handler::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: