VSF Documented
esp_vfs_port.c File Reference
#include "../vsf_espidf_cfg.h"
#include <stdint.h>
#include <stddef.h>
#include <string.h>
#include <errno.h>
#include <dirent.h>
#include <sys/stat.h>
#include <sys/mount.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdio.h>
#include <pthread.h>
#include "component/fs/vsf_fs.h"
#include "shell/sys/linux/kernel/fs/vsf_linux_fs.h"
#include "esp_vfs.h"
#include "esp_vfs_ops.h"

Data Structures

struct  bridge_file_t
 
struct  bridge_fsinfo_t
 
struct  vfs_entry_t
 

Macros

#define __VSF_FS_CLASS_IMPLEMENT
 
#define __VSF_LINUX_FS_CLASS_INHERIT__
 
#define VFS_MAX_REGISTERED   VSF_ESPIDF_CFG_VFS_MAX_REGISTERED
 
#define VFS_MAX_FDS   16
 
#define VFS_SUBPATH_MAX   128
 

Enumerations

enum  bridge_op_t {
  BRIDGE_OP_LOOKUP ,
  BRIDGE_OP_READ ,
  BRIDGE_OP_WRITE ,
  BRIDGE_OP_CLOSE ,
  BRIDGE_OP_SETPOS
}
 

Functions

 dcl_vsf_peda_methods (dcl_vsf_peda_methods(static, __bridge_mount)
 
 __vsf_component_peda_public_entry (__bridge_noop)
 
 __vsf_component_peda_ifs_entry (__bridge_mount, vk_fs_mount)
 
 __vsf_component_peda_ifs_entry (__bridge_lookup, vk_file_lookup)
 
 __vsf_component_peda_ifs_entry (__bridge_read, vk_file_read)
 
 __vsf_component_peda_ifs_entry (__bridge_write, vk_file_write)
 
 __vsf_component_peda_ifs_entry (__bridge_close, vk_file_close)
 
 __vsf_component_peda_ifs_entry (__bridge_setpos, vk_file_setpos)
 
esp_err_t esp_vfs_register_fs (const char *base_path, const esp_vfs_fs_ops_t *vfs, int flags, void *ctx)
 
esp_err_t esp_vfs_unregister_fs (const char *base_path)
 
esp_err_t esp_vfs_register (const char *base_path, const esp_vfs_t *vfs, void *ctx)
 
esp_err_t esp_vfs_unregister (const char *base_path)
 
esp_err_t esp_vfs_register_fd_range (const esp_vfs_t *v, void *c, int min, int max)
 
esp_err_t esp_vfs_register_fs_with_id (const esp_vfs_fs_ops_t *v, int f, void *c, esp_vfs_id_t *id)
 
esp_err_t esp_vfs_unregister_fs_with_id (esp_vfs_id_t id)
 
esp_err_t esp_vfs_register_with_id (const esp_vfs_t *v, void *c, esp_vfs_id_t *id)
 
esp_err_t esp_vfs_unregister_with_id (esp_vfs_id_t id)
 
esp_err_t esp_vfs_register_fd (esp_vfs_id_t id, int *fd)
 
esp_err_t esp_vfs_register_fd_with_local_fd (esp_vfs_id_t id, int l, bool p, int *fd)
 
esp_err_t esp_vfs_unregister_fd (esp_vfs_id_t id, int fd)
 
ssize_t esp_vfs_write (struct _reent *r, int fd, const void *d, size_t s)
 
off_t esp_vfs_lseek (struct _reent *r, int fd, off_t s, int m)
 
ssize_t esp_vfs_read (struct _reent *r, int fd, void *d, size_t s)
 
int esp_vfs_open (struct _reent *r, const char *p, int f, int m)
 
int esp_vfs_close (struct _reent *r, int fd)
 
int esp_vfs_fstat (struct _reent *r, int fd, struct stat *st)
 
int esp_vfs_stat (struct _reent *r, const char *p, struct stat *st)
 
int esp_vfs_link (struct _reent *r, const char *a, const char *b)
 
int esp_vfs_unlink (struct _reent *r, const char *p)
 
int esp_vfs_rename (struct _reent *r, const char *a, const char *b)
 
int esp_vfs_utime (const char *p, const struct utimbuf *t)
 
int esp_vfs_fsync (int fd)
 
int esp_vfs_fcntl_r (struct _reent *r, int fd, int c, int a)
 
int esp_vfs_ioctl (int fd, int c,...)
 
int esp_vfs_truncate (const char *p, off_t l)
 
int esp_vfs_ftruncate (int fd, off_t l)
 
int esp_vfs_access (const char *p, int a)
 
int esp_vfs_rmdir (const char *n)
 
int esp_vfs_mkdir (const char *n, mode_t m)
 
DIResp_vfs_opendir (const char *n)
 
int esp_vfs_closedir (DIR *d)
 
int esp_vfs_readdir_r (DIR *d, struct dirent *e, struct dirent **o)
 
struct direntesp_vfs_readdir (DIR *d)
 
long esp_vfs_telldir (DIR *d)
 
void esp_vfs_seekdir (DIR *d, long l)
 
void esp_vfs_rewinddir (DIR *d)
 
int esp_vfs_select (int n, fd_set *r, fd_set *w, fd_set *e, struct timeval *t)
 
void esp_vfs_select_triggered (esp_vfs_select_sem_t s)
 
void esp_vfs_select_triggered_isr (esp_vfs_select_sem_t s, int *w)
 
ssize_t esp_vfs_pread (int fd, void *d, size_t s, off_t o)
 
ssize_t esp_vfs_pwrite (int fd, const void *s, size_t sz, off_t o)
 
void esp_vfs_dump_fds (FILE *f)
 
void esp_vfs_dump_registered_paths (FILE *f)
 

Macro Definition Documentation

◆ __VSF_FS_CLASS_IMPLEMENT

#define __VSF_FS_CLASS_IMPLEMENT

◆ __VSF_LINUX_FS_CLASS_INHERIT__

#define __VSF_LINUX_FS_CLASS_INHERIT__

◆ VFS_MAX_REGISTERED

#define VFS_MAX_REGISTERED   VSF_ESPIDF_CFG_VFS_MAX_REGISTERED

◆ VFS_MAX_FDS

#define VFS_MAX_FDS   16

◆ VFS_SUBPATH_MAX

#define VFS_SUBPATH_MAX   128

Enumeration Type Documentation

◆ bridge_op_t

Enumerator
BRIDGE_OP_LOOKUP 
BRIDGE_OP_READ 
BRIDGE_OP_WRITE 
BRIDGE_OP_CLOSE 
BRIDGE_OP_SETPOS 

Function Documentation

◆ dcl_vsf_peda_methods()

dcl_vsf_peda_methods ( dcl_vsf_peda_methods( static,
__bridge_mount  )

◆ __vsf_component_peda_public_entry()

__vsf_component_peda_public_entry ( __bridge_noop )

◆ __vsf_component_peda_ifs_entry() [1/6]

__vsf_component_peda_ifs_entry ( __bridge_mount ,
vk_fs_mount  )

◆ __vsf_component_peda_ifs_entry() [2/6]

__vsf_component_peda_ifs_entry ( __bridge_lookup ,
vk_file_lookup  )

◆ __vsf_component_peda_ifs_entry() [3/6]

__vsf_component_peda_ifs_entry ( __bridge_read ,
vk_file_read  )

◆ __vsf_component_peda_ifs_entry() [4/6]

__vsf_component_peda_ifs_entry ( __bridge_write ,
vk_file_write  )

◆ __vsf_component_peda_ifs_entry() [5/6]

__vsf_component_peda_ifs_entry ( __bridge_close ,
vk_file_close  )

◆ __vsf_component_peda_ifs_entry() [6/6]

__vsf_component_peda_ifs_entry ( __bridge_setpos ,
vk_file_setpos  )

◆ esp_vfs_register_fs()

esp_err_t esp_vfs_register_fs ( const char * base_path,
const esp_vfs_fs_ops_t * vfs,
int flags,
void * ctx )

◆ esp_vfs_unregister_fs()

esp_err_t esp_vfs_unregister_fs ( const char * base_path)

◆ esp_vfs_register()

esp_err_t esp_vfs_register ( const char * base_path,
const esp_vfs_t * vfs,
void * ctx )

◆ esp_vfs_unregister()

esp_err_t esp_vfs_unregister ( const char * base_path)

◆ esp_vfs_register_fd_range()

esp_err_t esp_vfs_register_fd_range ( const esp_vfs_t * v,
void * c,
int min,
int max )

◆ esp_vfs_register_fs_with_id()

esp_err_t esp_vfs_register_fs_with_id ( const esp_vfs_fs_ops_t * v,
int f,
void * c,
esp_vfs_id_t * id )

◆ esp_vfs_unregister_fs_with_id()

esp_err_t esp_vfs_unregister_fs_with_id ( esp_vfs_id_t id)

◆ esp_vfs_register_with_id()

esp_err_t esp_vfs_register_with_id ( const esp_vfs_t * v,
void * c,
esp_vfs_id_t * id )

◆ esp_vfs_unregister_with_id()

esp_err_t esp_vfs_unregister_with_id ( esp_vfs_id_t id)

◆ esp_vfs_register_fd()

esp_err_t esp_vfs_register_fd ( esp_vfs_id_t id,
int * fd )

◆ esp_vfs_register_fd_with_local_fd()

esp_err_t esp_vfs_register_fd_with_local_fd ( esp_vfs_id_t id,
int l,
bool p,
int * fd )

◆ esp_vfs_unregister_fd()

esp_err_t esp_vfs_unregister_fd ( esp_vfs_id_t id,
int fd )

◆ esp_vfs_write()

ssize_t esp_vfs_write ( struct _reent * r,
int fd,
const void * d,
size_t s )

◆ esp_vfs_lseek()

off_t esp_vfs_lseek ( struct _reent * r,
int fd,
off_t s,
int m )

◆ esp_vfs_read()

ssize_t esp_vfs_read ( struct _reent * r,
int fd,
void * d,
size_t s )

◆ esp_vfs_open()

int esp_vfs_open ( struct _reent * r,
const char * p,
int f,
int m )

◆ esp_vfs_close()

int esp_vfs_close ( struct _reent * r,
int fd )

◆ esp_vfs_fstat()

int esp_vfs_fstat ( struct _reent * r,
int fd,
struct stat * st )

◆ esp_vfs_stat()

int esp_vfs_stat ( struct _reent * r,
const char * p,
struct stat * st )

◆ esp_vfs_link()

int esp_vfs_link ( struct _reent * r,
const char * a,
const char * b )

◆ esp_vfs_unlink()

int esp_vfs_unlink ( struct _reent * r,
const char * p )

◆ esp_vfs_rename()

int esp_vfs_rename ( struct _reent * r,
const char * a,
const char * b )

◆ esp_vfs_utime()

int esp_vfs_utime ( const char * p,
const struct utimbuf * t )

◆ esp_vfs_fsync()

int esp_vfs_fsync ( int fd)

◆ esp_vfs_fcntl_r()

int esp_vfs_fcntl_r ( struct _reent * r,
int fd,
int c,
int a )

◆ esp_vfs_ioctl()

int esp_vfs_ioctl ( int fd,
int c,
... )

◆ esp_vfs_truncate()

int esp_vfs_truncate ( const char * p,
off_t l )

◆ esp_vfs_ftruncate()

int esp_vfs_ftruncate ( int fd,
off_t l )

◆ esp_vfs_access()

int esp_vfs_access ( const char * p,
int a )

◆ esp_vfs_rmdir()

int esp_vfs_rmdir ( const char * n)

◆ esp_vfs_mkdir()

int esp_vfs_mkdir ( const char * n,
mode_t m )

◆ esp_vfs_opendir()

DIR * esp_vfs_opendir ( const char * n)

◆ esp_vfs_closedir()

int esp_vfs_closedir ( DIR * d)

◆ esp_vfs_readdir_r()

int esp_vfs_readdir_r ( DIR * d,
struct dirent * e,
struct dirent ** o )

◆ esp_vfs_readdir()

struct dirent * esp_vfs_readdir ( DIR * d)

◆ esp_vfs_telldir()

long esp_vfs_telldir ( DIR * d)

◆ esp_vfs_seekdir()

void esp_vfs_seekdir ( DIR * d,
long l )

◆ esp_vfs_rewinddir()

void esp_vfs_rewinddir ( DIR * d)

◆ esp_vfs_select()

int esp_vfs_select ( int n,
fd_set * r,
fd_set * w,
fd_set * e,
struct timeval * t )

◆ esp_vfs_select_triggered()

void esp_vfs_select_triggered ( esp_vfs_select_sem_t s)

◆ esp_vfs_select_triggered_isr()

void esp_vfs_select_triggered_isr ( esp_vfs_select_sem_t s,
int * w )

◆ esp_vfs_pread()

ssize_t esp_vfs_pread ( int fd,
void * d,
size_t s,
off_t o )

◆ esp_vfs_pwrite()

ssize_t esp_vfs_pwrite ( int fd,
const void * s,
size_t sz,
off_t o )

◆ esp_vfs_dump_fds()

void esp_vfs_dump_fds ( FILE * f)

◆ esp_vfs_dump_registered_paths()

void esp_vfs_dump_registered_paths ( FILE * f)
Generated from commit: vsfteam/vsf@c8a7591