summaryrefslogtreecommitdiffstatshomepage
path: root/teensy/import.c
diff options
context:
space:
mode:
Diffstat (limited to 'teensy/import.c')
-rw-r--r--teensy/import.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/teensy/import.c b/teensy/import.c
new file mode 100644
index 0000000000..967de102ac
--- /dev/null
+++ b/teensy/import.c
@@ -0,0 +1,22 @@
+#include <stdio.h>
+#include <stdint.h>
+
+#include "misc.h"
+#include "mpconfig.h"
+#include "qstr.h"
+#include "lexer.h"
+
+#include "memzip.h"
+
+mp_import_stat_t mp_import_stat(const char *path) {
+ MEMZIP_FILE_INFO info;
+
+ if (memzip_stat(path, &info) != MZ_OK) {
+ return MP_IMPORT_STAT_NO_EXIST;
+ }
+
+ if (info.is_dir) {
+ return MP_IMPORT_STAT_DIR;
+ }
+ return MP_IMPORT_STAT_FILE;
+}