about summary refs log tree commit diff stats
path: root/src/lfs.h
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2022-01-29 12:11:21 -0800
committerKartik K. Agaram <vc@akkartik.com>2022-01-29 12:39:53 -0800
commit24f0781d2bd96ac333337ccb2168fb26b601db7a (patch)
tree0d4bf969f30bf1575900ac7b0f06c6acb9859831 /src/lfs.h
parent90fc24ed041736d6cdebc74e5fd2e260e3803c3b (diff)
downloadteliva-24f0781d2bd96ac333337ccb2168fb26b601db7a.tar.gz
new library: luafilesystem (lfs)
https://github.com/keplerproject/luafilesystem

The new commander.tlv app demonstrates it working.
Diffstat (limited to 'src/lfs.h')
-rw-r--r--src/lfs.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/lfs.h b/src/lfs.h
new file mode 100644
index 0000000..13b60a9
--- /dev/null
+++ b/src/lfs.h
@@ -0,0 +1,35 @@
+/*
+** LuaFileSystem
+** Copyright Kepler Project 2003 - 2020
+** (http://keplerproject.github.io/luafilesystem)
+*/
+
+/* Define 'chdir' for systems that do not implement it */
+#ifdef NO_CHDIR
+#define chdir(p)	(-1)
+#define chdir_error	"Function 'chdir' not provided by system"
+#else
+#define chdir_error	strerror(errno)
+#endif
+
+#ifdef _WIN32
+#define chdir(p) (_chdir(p))
+#define getcwd(d, s) (_getcwd(d, s))
+#define rmdir(p) (_rmdir(p))
+#define LFS_EXPORT __declspec (dllexport)
+#ifndef fileno
+#define fileno(f) (_fileno(f))
+#endif
+#else
+#define LFS_EXPORT
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+  LFS_EXPORT int luaopen_lfs(lua_State * L);
+
+#ifdef __cplusplus
+}
+#endif