mirror of
https://github.com/micropython/micropython.git
synced 2026-01-06 20:20:14 +01:00
extmod/vfs: Introduce a C-level VFS protocol, with fast import_stat.
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.
This commit is contained in:
@@ -29,13 +29,10 @@
|
||||
#include "py/lexer.h"
|
||||
#include "py/obj.h"
|
||||
|
||||
struct _mp_obj_vfs_posix_t;
|
||||
|
||||
extern const mp_obj_type_t mp_type_vfs_posix;
|
||||
extern const mp_obj_type_t mp_type_vfs_posix_fileio;
|
||||
extern const mp_obj_type_t mp_type_vfs_posix_textio;
|
||||
|
||||
mp_import_stat_t mp_vfs_posix_import_stat(struct _mp_obj_vfs_posix_t *self, const char *path_in);
|
||||
mp_obj_t mp_vfs_posix_file_open(const mp_obj_type_t *type, mp_obj_t file_in, mp_obj_t mode_in);
|
||||
|
||||
#endif // MICROPY_INCLUDED_EXTMOD_VFS_POSIX_H
|
||||
|
||||
Reference in New Issue
Block a user