summaryrefslogtreecommitdiff
path: root/teensy/import.c
diff options
context:
space:
mode:
authorDave Hylands <dhylands@gmail.com>2014-06-15 22:33:14 -0700
committerDave Hylands <dhylands@gmail.com>2014-06-15 22:48:05 -0700
commit4f1b7fec9f103c92de40875e9a06b7decc4923f4 (patch)
treed9e0f1b0e7dd290a728c065960500ecf30967997 /teensy/import.c
parent2547928148aefcf163953057979e14f46bef1170 (diff)
Updated teensy to build.
Refactored some stmhal files which are shared with teensy.
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;
+}