summaryrefslogtreecommitdiff
path: root/teensy/import.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2014-07-02 13:45:00 +0100
committerDamien George <damien.p.george@gmail.com>2014-07-02 13:45:00 +0100
commitf83debc716029f87f62cdae751e88838db343eb8 (patch)
tree5f6bdb76cac3f59334431f62a3920f39ceca8b8b /teensy/import.c
parent5fc580475f5eba8248de86a4148090e63f777372 (diff)
parent7a37f647a5d953a47a6147cf8302e08f27537771 (diff)
Merge branch 'dhylands-teensy-new'
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 000000000..967de102a
--- /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;
+}