summaryrefslogtreecommitdiff
path: root/extmod/vfs.h
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2017-01-29 15:14:15 +1100
committerDamien George <damien.p.george@gmail.com>2017-01-30 12:18:35 +1100
commit6eafa544865a5d6dcb18f9161f7a18bd4fb6229f (patch)
tree0e6c9cc0dfd3ff1d211b8ff842a315d30a445182 /extmod/vfs.h
parentec3274324b0f7460f0276957184dc4b9f33a9bc7 (diff)
extmod/vfs: Expose lookup_path_raw as mp_vfs_lookup_path.
It can be useful for low-level lookup of paths by ports.
Diffstat (limited to 'extmod/vfs.h')
-rw-r--r--extmod/vfs.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/extmod/vfs.h b/extmod/vfs.h
index ac3ca6fc4..92e53b305 100644
--- a/extmod/vfs.h
+++ b/extmod/vfs.h
@@ -30,6 +30,11 @@
#include "py/lexer.h"
#include "py/obj.h"
+// return values of mp_vfs_lookup_path
+// ROOT is 0 so that the default current directory is the root directory
+#define MP_VFS_NONE ((mp_vfs_mount_t*)1)
+#define MP_VFS_ROOT ((mp_vfs_mount_t*)0)
+
typedef struct _mp_vfs_mount_t {
const char *str; // mount point with leading /
size_t len;
@@ -37,6 +42,7 @@ typedef struct _mp_vfs_mount_t {
struct _mp_vfs_mount_t *next;
} mp_vfs_mount_t;
+mp_vfs_mount_t *mp_vfs_lookup_path(const char *path, const char **path_out);
mp_import_stat_t mp_vfs_import_stat(const char *path);
mp_obj_t mp_vfs_mount(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args);
mp_obj_t mp_vfs_umount(mp_obj_t mnt_in);