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

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.

ssize_t(* vfs_handler::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.
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::rewinddir)(void *hnd)

Rewind a directory stream to the start.

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 *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.
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: