Kintsugi OS 0.5.0
x86 Monolithic OS
Loading...
Searching...
No Matches
vfs.h File Reference
#include "../kklibc/ctypes.h"

Go to the source code of this file.

Classes

struct  vfs_stat_t
 
struct  vfs_dirent_t
 
struct  vfs_file_t
 
struct  vfs_ops_t
 

Macros

#define VFS_PATH_MAX   256
 
#define VFS_NAME_MAX   13
 

Enumerations

enum  {
  VFS_OK = 0 , VFS_ENOENT = -1 , VFS_EIO = -2 , VFS_EINVAL = -3 ,
  VFS_ENOSPC = -4 , VFS_EEXIST = -5 , VFS_ENOTDIR = -6 , VFS_EISDIR = -7 ,
  VFS_ENOTEMPTY = -8 , VFS_EROFS = -9 , VFS_ECORRUPT = -10 , VFS_ENOMEM = -11 ,
  VFS_EBUSY = -12
}
 

Functions

int vfs_open (const char *path, vfs_file_t *file)
 
int vfs_file_read (vfs_file_t *file, void *buffer, u32 capacity)
 
int vfs_file_write (vfs_file_t *file, const void *buffer, u32 size)
 
int vfs_seek (vfs_file_t *file, u32 offset)
 
void vfs_close (vfs_file_t *file)
 
void vfs_mount (const vfs_ops_t *ops)
 
int vfs_normalize (const char *path, char out[VFS_PATH_MAX])
 
const char * vfs_getcwd (void)
 
int vfs_chdir (const char *path)
 
int vfs_stat (const char *path, vfs_stat_t *stat)
 
int vfs_read (const char *path, u32 offset, void *buffer, u32 capacity)
 
int vfs_replace (const char *path, const void *data, u32 size)
 
int vfs_write (const char *path, u32 offset, const void *data, u32 size)
 
int vfs_append (const char *path, const void *data, u32 size)
 
int vfs_truncate (const char *path, u32 size)
 
int vfs_create (const char *path)
 
int vfs_mkdir (const char *path)
 
int vfs_unlink (const char *path)
 
int vfs_rmdir (const char *path)
 
int vfs_rename (const char *source, const char *destination)
 
int vfs_copy (const char *source, const char *destination)
 
int vfs_readdir (const char *path, u32 *cursor, vfs_dirent_t *entry)
 
const char * vfs_error (int error)
 

Macro Definition Documentation

◆ VFS_NAME_MAX

#define VFS_NAME_MAX   13

◆ VFS_PATH_MAX

#define VFS_PATH_MAX   256

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
VFS_OK 
VFS_ENOENT 
VFS_EIO 
VFS_EINVAL 
VFS_ENOSPC 
VFS_EEXIST 
VFS_ENOTDIR 
VFS_EISDIR 
VFS_ENOTEMPTY 
VFS_EROFS 
VFS_ECORRUPT 
VFS_ENOMEM 
VFS_EBUSY 

Function Documentation

◆ vfs_append()

int vfs_append ( const char *  path,
const void *  data,
u32  size 
)

◆ vfs_chdir()

int vfs_chdir ( const char *  path)

◆ vfs_close()

void vfs_close ( vfs_file_t *  file)

◆ vfs_copy()

int vfs_copy ( const char *  source,
const char *  destination 
)

◆ vfs_create()

int vfs_create ( const char *  path)

◆ vfs_error()

const char * vfs_error ( int  error)

◆ vfs_file_read()

int vfs_file_read ( vfs_file_t *  file,
void *  buffer,
u32  capacity 
)

◆ vfs_file_write()

int vfs_file_write ( vfs_file_t *  file,
const void *  buffer,
u32  size 
)

◆ vfs_getcwd()

const char * vfs_getcwd ( void  )

◆ vfs_mkdir()

int vfs_mkdir ( const char *  path)

◆ vfs_mount()

void vfs_mount ( const vfs_ops_t *  ops)

◆ vfs_normalize()

int vfs_normalize ( const char *  path,
char  out[VFS_PATH_MAX] 
)

◆ vfs_open()

int vfs_open ( const char *  path,
vfs_file_t *  file 
)

◆ vfs_read()

int vfs_read ( const char *  path,
u32  offset,
void *  buffer,
u32  capacity 
)

◆ vfs_readdir()

int vfs_readdir ( const char *  path,
u32 *  cursor,
vfs_dirent_t *  entry 
)

◆ vfs_rename()

int vfs_rename ( const char *  source,
const char *  destination 
)

◆ vfs_replace()

int vfs_replace ( const char *  path,
const void *  data,
u32  size 
)

◆ vfs_rmdir()

int vfs_rmdir ( const char *  path)

◆ vfs_seek()

int vfs_seek ( vfs_file_t *  file,
u32  offset 
)

◆ vfs_stat()

int vfs_stat ( const char *  path,
vfs_stat_t *  stat 
)

◆ vfs_truncate()

int vfs_truncate ( const char *  path,
u32  size 
)

◆ vfs_unlink()

int vfs_unlink ( const char *  path)

◆ vfs_write()

int vfs_write ( const char *  path,
u32  offset,
const void *  data,
u32  size 
)