CTS-SAT-1-OBC-Firmware
Loading...
Searching...
No Matches
lfs.h File Reference
#include "lfs_util.h"
Include dependency graph for lfs.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  lfs_config
 
struct  lfs_info
 
struct  lfs_fsinfo
 
struct  lfs_attr
 
struct  lfs_file_config
 
struct  lfs_cache
 internal littlefs data structures /// More...
 
struct  lfs_mdir
 
struct  lfs_dir
 
struct  lfs_file
 
struct  lfs_file::lfs_ctz
 
struct  lfs_superblock
 
struct  lfs_gstate
 
struct  lfs
 
struct  lfs::lfs_mlist
 
struct  lfs::lfs_lookahead
 

Macros

#define LFS_VERSION   0x0002000a
 Version info ///.
 
#define LFS_VERSION_MAJOR   (0xffff & (LFS_VERSION >> 16))
 
#define LFS_VERSION_MINOR   (0xffff & (LFS_VERSION >> 0))
 
#define LFS_DISK_VERSION   0x00020001
 
#define LFS_DISK_VERSION_MAJOR   (0xffff & (LFS_DISK_VERSION >> 16))
 
#define LFS_DISK_VERSION_MINOR   (0xffff & (LFS_DISK_VERSION >> 0))
 
#define LFS_NAME_MAX   255
 
#define LFS_FILE_MAX   2147483647
 
#define LFS_ATTR_MAX   1022
 

Typedefs

typedef uint32_t lfs_size_t
 Definitions ///.
 
typedef uint32_t lfs_off_t
 
typedef int32_t lfs_ssize_t
 
typedef int32_t lfs_soff_t
 
typedef uint32_t lfs_block_t
 
typedef struct lfs_cache lfs_cache_t
 internal littlefs data structures ///
 
typedef struct lfs_mdir lfs_mdir_t
 
typedef struct lfs_dir lfs_dir_t
 
typedef struct lfs_file lfs_file_t
 
typedef struct lfs_superblock lfs_superblock_t
 
typedef struct lfs_gstate lfs_gstate_t
 
typedef struct lfs lfs_t
 

Enumerations

enum  lfs_error {
  LFS_ERR_OK = 0 , LFS_ERR_IO = -5 , LFS_ERR_CORRUPT = -84 , LFS_ERR_NOENT = -2 ,
  LFS_ERR_EXIST = -17 , LFS_ERR_NOTDIR = -20 , LFS_ERR_ISDIR = -21 , LFS_ERR_NOTEMPTY = -39 ,
  LFS_ERR_BADF = -9 , LFS_ERR_FBIG = -27 , LFS_ERR_INVAL = -22 , LFS_ERR_NOSPC = -28 ,
  LFS_ERR_NOMEM = -12 , LFS_ERR_NOATTR = -61 , LFS_ERR_NAMETOOLONG = -36
}
 
enum  lfs_type {
  LFS_TYPE_REG = 0x001 , LFS_TYPE_DIR = 0x002 , LFS_TYPE_SPLICE = 0x400 , LFS_TYPE_NAME = 0x000 ,
  LFS_TYPE_STRUCT = 0x200 , LFS_TYPE_USERATTR = 0x300 , LFS_TYPE_FROM = 0x100 , LFS_TYPE_TAIL = 0x600 ,
  LFS_TYPE_GLOBALS = 0x700 , LFS_TYPE_CRC = 0x500 , LFS_TYPE_CREATE = 0x401 , LFS_TYPE_DELETE = 0x4ff ,
  LFS_TYPE_SUPERBLOCK = 0x0ff , LFS_TYPE_DIRSTRUCT = 0x200 , LFS_TYPE_CTZSTRUCT = 0x202 , LFS_TYPE_INLINESTRUCT = 0x201 ,
  LFS_TYPE_SOFTTAIL = 0x600 , LFS_TYPE_HARDTAIL = 0x601 , LFS_TYPE_MOVESTATE = 0x7ff , LFS_TYPE_CCRC = 0x500 ,
  LFS_TYPE_FCRC = 0x5ff , LFS_FROM_NOOP = 0x000 , LFS_FROM_MOVE = 0x101 , LFS_FROM_USERATTRS = 0x102
}
 
enum  lfs_open_flags {
  LFS_O_RDONLY = 1 , LFS_O_WRONLY = 2 , LFS_O_RDWR = 3 , LFS_O_CREAT = 0x0100 ,
  LFS_O_EXCL = 0x0200 , LFS_O_TRUNC = 0x0400 , LFS_O_APPEND = 0x0800 , LFS_F_DIRTY = 0x010000 ,
  LFS_F_WRITING = 0x020000 , LFS_F_READING = 0x040000 , LFS_F_ERRED = 0x080000 , LFS_F_INLINE = 0x100000
}
 
enum  lfs_whence_flags { LFS_SEEK_SET = 0 , LFS_SEEK_CUR = 1 , LFS_SEEK_END = 2 }
 

Functions

int lfs_format (lfs_t *lfs, const struct lfs_config *config)
 Filesystem functions ///.
 
int lfs_mount (lfs_t *lfs, const struct lfs_config *config)
 
int lfs_unmount (lfs_t *lfs)
 
int lfs_remove (lfs_t *lfs, const char *path)
 General operations ///.
 
int lfs_rename (lfs_t *lfs, const char *oldpath, const char *newpath)
 
int lfs_stat (lfs_t *lfs, const char *path, struct lfs_info *info)
 
lfs_ssize_t lfs_getattr (lfs_t *lfs, const char *path, uint8_t type, void *buffer, lfs_size_t size)
 
int lfs_setattr (lfs_t *lfs, const char *path, uint8_t type, const void *buffer, lfs_size_t size)
 
int lfs_removeattr (lfs_t *lfs, const char *path, uint8_t type)
 
int lfs_file_opencfg (lfs_t *lfs, lfs_file_t *file, const char *path, int flags, const struct lfs_file_config *config)
 File operations ///.
 
int lfs_file_close (lfs_t *lfs, lfs_file_t *file)
 
int lfs_file_sync (lfs_t *lfs, lfs_file_t *file)
 
lfs_ssize_t lfs_file_read (lfs_t *lfs, lfs_file_t *file, void *buffer, lfs_size_t size)
 
lfs_ssize_t lfs_file_write (lfs_t *lfs, lfs_file_t *file, const void *buffer, lfs_size_t size)
 
lfs_soff_t lfs_file_seek (lfs_t *lfs, lfs_file_t *file, lfs_soff_t off, int whence)
 
int lfs_file_truncate (lfs_t *lfs, lfs_file_t *file, lfs_off_t size)
 
lfs_soff_t lfs_file_tell (lfs_t *lfs, lfs_file_t *file)
 
int lfs_file_rewind (lfs_t *lfs, lfs_file_t *file)
 
lfs_soff_t lfs_file_size (lfs_t *lfs, lfs_file_t *file)
 
int lfs_mkdir (lfs_t *lfs, const char *path)
 Directory operations ///.
 
int lfs_dir_open (lfs_t *lfs, lfs_dir_t *dir, const char *path)
 
int lfs_dir_close (lfs_t *lfs, lfs_dir_t *dir)
 
int lfs_dir_read (lfs_t *lfs, lfs_dir_t *dir, struct lfs_info *info)
 
int lfs_dir_seek (lfs_t *lfs, lfs_dir_t *dir, lfs_off_t off)
 
lfs_soff_t lfs_dir_tell (lfs_t *lfs, lfs_dir_t *dir)
 
int lfs_dir_rewind (lfs_t *lfs, lfs_dir_t *dir)
 
int lfs_fs_stat (lfs_t *lfs, struct lfs_fsinfo *fsinfo)
 Filesystem-level filesystem operations.
 
lfs_ssize_t lfs_fs_size (lfs_t *lfs)
 
int lfs_fs_traverse (lfs_t *lfs, int(*cb)(void *, lfs_block_t), void *data)
 
int lfs_fs_mkconsistent (lfs_t *lfs)
 
int lfs_fs_gc (lfs_t *lfs)
 
int lfs_fs_grow (lfs_t *lfs, lfs_size_t block_count)
 

Macro Definition Documentation

◆ LFS_ATTR_MAX

#define LFS_ATTR_MAX   1022

◆ LFS_DISK_VERSION

#define LFS_DISK_VERSION   0x00020001

◆ LFS_DISK_VERSION_MAJOR

#define LFS_DISK_VERSION_MAJOR   (0xffff & (LFS_DISK_VERSION >> 16))

◆ LFS_DISK_VERSION_MINOR

#define LFS_DISK_VERSION_MINOR   (0xffff & (LFS_DISK_VERSION >> 0))

◆ LFS_FILE_MAX

#define LFS_FILE_MAX   2147483647

◆ LFS_NAME_MAX

#define LFS_NAME_MAX   255

◆ LFS_VERSION

#define LFS_VERSION   0x0002000a

Version info ///.

◆ LFS_VERSION_MAJOR

#define LFS_VERSION_MAJOR   (0xffff & (LFS_VERSION >> 16))

◆ LFS_VERSION_MINOR

#define LFS_VERSION_MINOR   (0xffff & (LFS_VERSION >> 0))

Typedef Documentation

◆ lfs_block_t

typedef uint32_t lfs_block_t

◆ lfs_cache_t

typedef struct lfs_cache lfs_cache_t

internal littlefs data structures ///

◆ lfs_dir_t

typedef struct lfs_dir lfs_dir_t

◆ lfs_file_t

typedef struct lfs_file lfs_file_t

◆ lfs_gstate_t

typedef struct lfs_gstate lfs_gstate_t

◆ lfs_mdir_t

typedef struct lfs_mdir lfs_mdir_t

◆ lfs_off_t

typedef uint32_t lfs_off_t

◆ lfs_size_t

typedef uint32_t lfs_size_t

Definitions ///.

◆ lfs_soff_t

typedef int32_t lfs_soff_t

◆ lfs_ssize_t

typedef int32_t lfs_ssize_t

◆ lfs_superblock_t

◆ lfs_t

typedef struct lfs lfs_t

Enumeration Type Documentation

◆ lfs_error

enum lfs_error
Enumerator
LFS_ERR_OK 
LFS_ERR_IO 
LFS_ERR_CORRUPT 
LFS_ERR_NOENT 
LFS_ERR_EXIST 
LFS_ERR_NOTDIR 
LFS_ERR_ISDIR 
LFS_ERR_NOTEMPTY 
LFS_ERR_BADF 
LFS_ERR_FBIG 
LFS_ERR_INVAL 
LFS_ERR_NOSPC 
LFS_ERR_NOMEM 
LFS_ERR_NOATTR 
LFS_ERR_NAMETOOLONG 

◆ lfs_open_flags

Enumerator
LFS_O_RDONLY 
LFS_O_WRONLY 
LFS_O_RDWR 
LFS_O_CREAT 
LFS_O_EXCL 
LFS_O_TRUNC 
LFS_O_APPEND 
LFS_F_DIRTY 
LFS_F_WRITING 
LFS_F_READING 
LFS_F_ERRED 
LFS_F_INLINE 

◆ lfs_type

enum lfs_type
Enumerator
LFS_TYPE_REG 
LFS_TYPE_DIR 
LFS_TYPE_SPLICE 
LFS_TYPE_NAME 
LFS_TYPE_STRUCT 
LFS_TYPE_USERATTR 
LFS_TYPE_FROM 
LFS_TYPE_TAIL 
LFS_TYPE_GLOBALS 
LFS_TYPE_CRC 
LFS_TYPE_CREATE 
LFS_TYPE_DELETE 
LFS_TYPE_SUPERBLOCK 
LFS_TYPE_DIRSTRUCT 
LFS_TYPE_CTZSTRUCT 
LFS_TYPE_INLINESTRUCT 
LFS_TYPE_SOFTTAIL 
LFS_TYPE_HARDTAIL 
LFS_TYPE_MOVESTATE 
LFS_TYPE_CCRC 
LFS_TYPE_FCRC 
LFS_FROM_NOOP 
LFS_FROM_MOVE 
LFS_FROM_USERATTRS 

◆ lfs_whence_flags

Enumerator
LFS_SEEK_SET 
LFS_SEEK_CUR 
LFS_SEEK_END 

Function Documentation

◆ lfs_dir_close()

int lfs_dir_close ( lfs_t * lfs,
lfs_dir_t * dir )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ lfs_dir_open()

int lfs_dir_open ( lfs_t * lfs,
lfs_dir_t * dir,
const char * path )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ lfs_dir_read()

int lfs_dir_read ( lfs_t * lfs,
lfs_dir_t * dir,
struct lfs_info * info )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ lfs_dir_rewind()

int lfs_dir_rewind ( lfs_t * lfs,
lfs_dir_t * dir )
Here is the call graph for this function:

◆ lfs_dir_seek()

int lfs_dir_seek ( lfs_t * lfs,
lfs_dir_t * dir,
lfs_off_t off )
Here is the call graph for this function:

◆ lfs_dir_tell()

lfs_soff_t lfs_dir_tell ( lfs_t * lfs,
lfs_dir_t * dir )
Here is the call graph for this function:

◆ lfs_file_close()

int lfs_file_close ( lfs_t * lfs,
lfs_file_t * file )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ lfs_file_opencfg()

int lfs_file_opencfg ( lfs_t * lfs,
lfs_file_t * file,
const char * path,
int flags,
const struct lfs_file_config * config )

File operations ///.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ lfs_file_read()

lfs_ssize_t lfs_file_read ( lfs_t * lfs,
lfs_file_t * file,
void * buffer,
lfs_size_t size )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ lfs_file_rewind()

int lfs_file_rewind ( lfs_t * lfs,
lfs_file_t * file )
Here is the call graph for this function:

◆ lfs_file_seek()

lfs_soff_t lfs_file_seek ( lfs_t * lfs,
lfs_file_t * file,
lfs_soff_t off,
int whence )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ lfs_file_size()

lfs_soff_t lfs_file_size ( lfs_t * lfs,
lfs_file_t * file )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ lfs_file_sync()

int lfs_file_sync ( lfs_t * lfs,
lfs_file_t * file )
Here is the call graph for this function:

◆ lfs_file_tell()

lfs_soff_t lfs_file_tell ( lfs_t * lfs,
lfs_file_t * file )
Here is the call graph for this function:

◆ lfs_file_truncate()

int lfs_file_truncate ( lfs_t * lfs,
lfs_file_t * file,
lfs_off_t size )
Here is the call graph for this function:

◆ lfs_file_write()

lfs_ssize_t lfs_file_write ( lfs_t * lfs,
lfs_file_t * file,
const void * buffer,
lfs_size_t size )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ lfs_format()

int lfs_format ( lfs_t * lfs,
const struct lfs_config * config )

Filesystem functions ///.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ lfs_fs_gc()

int lfs_fs_gc ( lfs_t * lfs)
Here is the call graph for this function:

◆ lfs_fs_grow()

int lfs_fs_grow ( lfs_t * lfs,
lfs_size_t block_count )
Here is the call graph for this function:

◆ lfs_fs_mkconsistent()

int lfs_fs_mkconsistent ( lfs_t * lfs)
Here is the call graph for this function:

◆ lfs_fs_size()

lfs_ssize_t lfs_fs_size ( lfs_t * lfs)
Here is the call graph for this function:

◆ lfs_fs_stat()

int lfs_fs_stat ( lfs_t * lfs,
struct lfs_fsinfo * fsinfo )

Filesystem-level filesystem operations.

Here is the call graph for this function:

◆ lfs_fs_traverse()

int lfs_fs_traverse ( lfs_t * lfs,
int(* cb )(void *, lfs_block_t),
void * data )
Here is the call graph for this function:

◆ lfs_getattr()

lfs_ssize_t lfs_getattr ( lfs_t * lfs,
const char * path,
uint8_t type,
void * buffer,
lfs_size_t size )
Here is the call graph for this function:

◆ lfs_mkdir()

int lfs_mkdir ( lfs_t * lfs,
const char * path )

Directory operations ///.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ lfs_mount()

int lfs_mount ( lfs_t * lfs,
const struct lfs_config * config )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ lfs_remove()

int lfs_remove ( lfs_t * lfs,
const char * path )

General operations ///.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ lfs_removeattr()

int lfs_removeattr ( lfs_t * lfs,
const char * path,
uint8_t type )
Here is the call graph for this function:

◆ lfs_rename()

int lfs_rename ( lfs_t * lfs,
const char * oldpath,
const char * newpath )
Here is the call graph for this function:

◆ lfs_setattr()

int lfs_setattr ( lfs_t * lfs,
const char * path,
uint8_t type,
const void * buffer,
lfs_size_t size )
Here is the call graph for this function:

◆ lfs_stat()

int lfs_stat ( lfs_t * lfs,
const char * path,
struct lfs_info * info )
Here is the call graph for this function:

◆ lfs_unmount()

int lfs_unmount ( lfs_t * lfs)
Here is the call graph for this function:
Here is the caller graph for this function: