aboutsummaryrefslogtreecommitdiff
path: root/extmod/vfs.h
AgeCommit message (Collapse)Author
2020-03-11extmod/vfs: Factor out vfs mount-and-chdir helper from stm32.Damien George
2020-02-28all: Reformat C and Python source code with tools/codeformat.py.Damien George
This is run with uncrustify 0.70.1, and black 19.10b0.
2019-10-29extmod/vfs: Add MP_BLOCKDEV_IOCTL_BLOCK_ERASE constant.Damien George
2019-10-29extmod/vfs: Rename BP_IOCTL_xxx constants to MP_BLOCKDEV_IOCTL_xxx.Damien George
Also rename SEC_COUNT to BLOCK_COUNT and SEC_SIZE to BLOCK_SIZE.
2019-10-29extmod/vfs_blockdev: Add extended read/write methods.Damien George
This commit adds helper functions to call readblocks/writeblocks with a fourth argument, the byte offset within a block. Although the mp_vfs_blockdev_t struct has grown here by 2 machine words, in all current uses of this struct within this repository it still fits within the same number of GC blocks.
2019-10-29extmod/vfs_blockdev: Factor out block device interface code.Damien George
2019-10-29extmod: Factor out block-device struct to make independent of fatfs.Damien George
2018-06-06extmod/vfs: Introduce a C-level VFS protocol, with fast import_stat.Damien George
Following other C-level protocols, this VFS protocol is added to help abstract away implementation details of the underlying VFS in an efficient way. As a starting point, the import_stat function is put into this protocol so that the VFS sub-system does not need to know about every VFS implementation in order to do an efficient stat for importing files. In the future it might be worth adding other functions to this protocol.
2017-07-18all: Unify header guard usage.Alexander Steffen
The code conventions suggest using header guards, but do not define how those should look like and instead point to existing files. However, not all existing files follow the same scheme, sometimes omitting header guards altogether, sometimes using non-standard names, making it easy to accidentally pick a "wrong" example. This commit ensures that all header files of the MicroPython project (that were not simply copied from somewhere else) follow the same pattern, that was already present in the majority of files, especially in the py folder. The rules are as follows. Naming convention: * start with the words MICROPY_INCLUDED * contain the full path to the file * replace special characters with _ In addition, there are no empty lines before #ifndef, between #ifndef and one empty line before #endif. #endif is followed by a comment containing the name of the guard macro. py/grammar.h cannot use header guards by design, since it has to be included multiple times in a single C file. Several other files also do not need header guards as they are only used internally and guaranteed to be included only once: * MICROPY_MPHALPORT_H * mpconfigboard.h * mpconfigport.h * mpthreadport.h * pin_defs_*.h * qstrdefs*.h
2017-05-10extmod/vfs: Implement mp_vfs_ilistdir().Damien George
uos.ilistdir() is the core function, returning an iterator that yields 3-tuples. uos.listdir() is implemented in terms of ilistdir().
2017-01-30extmod: Merge old fsusermount.h header into vfs.h and vfs_fat.h.Damien George
vfs.h is for generic VFS declarations, and vfs_fat.h is for VfsFat specific things.
2017-01-30extmod/vfs: Expose lookup_path_raw as mp_vfs_lookup_path.Damien George
It can be useful for low-level lookup of paths by ports.
2017-01-27extmod/vfs: Expose mp_vfs_mount_t type.Damien George
It should only be used for low-level things and with caution, for example putting mounted VFS data in ROM or the static data section.
2017-01-27extmod: Add generic VFS sub-system.Damien George
This provides mp_vfs_XXX functions (eg mount, open, listdir) which are agnostic to the underlying filesystem type, and just require an object with the relevant filesystem-like methods (eg .mount, .open, .listidr) which can then be mounted. These mp_vfs_XXX functions would typically be used by a port to implement the "uos" module, and mp_vfs_open would be the builtin open function. This feature is controlled by MICROPY_VFS, disabled by default.