diff options
-rw-r--r-- | Makefile | 4 | ||||
-rw-r--r-- | config | 4 | ||||
-rw-r--r-- | luafilesystem.def | 5 | ||||
-rw-r--r-- | src/lfs.c (renamed from luafilesystem.c) | 22 | ||||
-rw-r--r-- | src/lfs.h (renamed from luafilesystem.h) | 4 | ||||
-rw-r--r-- | t_lfs.lua | 8 | ||||
-rw-r--r-- | t_luafilesystem.lua | 8 | ||||
-rw-r--r-- | vc6/lfs.def | 5 |
8 files changed, 30 insertions, 30 deletions
@@ -1,6 +1,6 @@ | |||
1 | # $Id: Makefile,v 1.1 2004/07/27 14:15:24 tomas Exp $ | 1 | # $Id: Makefile,v 1.2 2004/07/29 14:26:33 tomas Exp $ |
2 | 2 | ||
3 | T= luafilesystem | 3 | T= lfs |
4 | 4 | ||
5 | include ./config | 5 | include ./config |
6 | 6 | ||
@@ -1,6 +1,7 @@ | |||
1 | # Installation directories | 1 | # Installation directories |
2 | # System's libraries directory (where Lua libraries are installed) | 2 | # System's libraries directory (where binary libraries are installed) |
3 | LIB_DIR= /usr/local/lib | 3 | LIB_DIR= /usr/local/lib |
4 | # System's lua directory (where Lua libraries are installed) | ||
4 | LUA_DIR= /usr/local/lua | 5 | LUA_DIR= /usr/local/lua |
5 | 6 | ||
6 | # OS dependent | 7 | # OS dependent |
@@ -10,7 +11,6 @@ LIB_OPTION= -dynamiclib #for MacOS X | |||
10 | #LIB_OPTION= -shared #for Linux | 11 | #LIB_OPTION= -shared #for Linux |
11 | 12 | ||
12 | # Compilation directives | 13 | # Compilation directives |
13 | # pre-compile and include mod2.lua into mod_lua.c | ||
14 | # On FreeBSD systems, the following line should be commented | 14 | # On FreeBSD systems, the following line should be commented |
15 | DLLIB= -ldl | 15 | DLLIB= -ldl |
16 | WARN= -O2 -Wall -fPIC -W -Waggregate-return -Wcast-align -Wmissing-prototypes -Wnested-externs -Wshadow -Wwrite-strings | 16 | WARN= -O2 -Wall -fPIC -W -Waggregate-return -Wcast-align -Wmissing-prototypes -Wnested-externs -Wshadow -Wwrite-strings |
diff --git a/luafilesystem.def b/luafilesystem.def deleted file mode 100644 index 4cf9ec1..0000000 --- a/luafilesystem.def +++ /dev/null | |||
@@ -1,5 +0,0 @@ | |||
1 | LIBRARY luafilesystem.dll | ||
2 | DESCRIPTION "LuaFilesystem" | ||
3 | VERSION 1.0 | ||
4 | EXPORTS | ||
5 | luaopen_luafilesystem | ||
diff --git a/luafilesystem.c b/src/lfs.c index 57167ea..d494dd3 100644 --- a/luafilesystem.c +++ b/src/lfs.c | |||
@@ -1,15 +1,15 @@ | |||
1 | /* | 1 | /* |
2 | ** File system manipulation library. | 2 | ** File system manipulation library. |
3 | ** This library offers these functions: | 3 | ** This library offers these functions: |
4 | ** luafilesystem.attributes (filepath [, attributename]) | 4 | ** lfs.attributes (filepath [, attributename]) |
5 | ** luafilesystem.chdir (path) | 5 | ** lfs.chdir (path) |
6 | ** luafilesystem.currentdir () | 6 | ** lfs.currentdir () |
7 | ** luafilesystem.dir (path) | 7 | ** lfs.dir (path) |
8 | ** luafilesystem.mkdir (path) | 8 | ** lfs.mkdir (path) |
9 | ** luafilesystem.lock (fh, mode) | 9 | ** lfs.lock (fh, mode) |
10 | ** luafilesystem.unlock (fh) | 10 | ** lfs.unlock (fh) |
11 | ** | 11 | ** |
12 | ** $Id: luafilesystem.c,v 1.1 2004/07/27 14:15:24 tomas Exp $ | 12 | ** $Id: lfs.c,v 1.1 2004/07/29 14:26:33 tomas Exp $ |
13 | */ | 13 | */ |
14 | 14 | ||
15 | #include <errno.h> | 15 | #include <errno.h> |
@@ -33,7 +33,7 @@ | |||
33 | #include <lauxlib.h> | 33 | #include <lauxlib.h> |
34 | #include <lualib.h> | 34 | #include <lualib.h> |
35 | 35 | ||
36 | #include "luafilesystem.h" | 36 | #include "lfs.h" |
37 | 37 | ||
38 | /* Define 'strerror' for systems that do not implement it */ | 38 | /* Define 'strerror' for systems that do not implement it */ |
39 | #ifdef NO_STRERROR | 39 | #ifdef NO_STRERROR |
@@ -344,8 +344,8 @@ static const struct luaL_reg fslib[] = { | |||
344 | {NULL, NULL}, | 344 | {NULL, NULL}, |
345 | }; | 345 | }; |
346 | 346 | ||
347 | int luaopen_luafilesystem (lua_State *L) { | 347 | int luaopen_lfs (lua_State *L) { |
348 | dir_create_meta (L); | 348 | dir_create_meta (L); |
349 | luaL_openlib (L, "luafilesystem", fslib, 0); | 349 | luaL_openlib (L, "lfs", fslib, 0); |
350 | return 1; | 350 | return 1; |
351 | } | 351 | } |
diff --git a/luafilesystem.h b/src/lfs.h index 6178dd7..67871f2 100644 --- a/luafilesystem.h +++ b/src/lfs.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* Define 'chdir' for systems that do not implement it */ | 1 | /* Define 'chdir' for systems that do not implement it */ |
2 | /* $Id: luafilesystem.h,v 1.1 2004/07/27 14:15:24 tomas Exp $ */ | 2 | /* $Id: lfs.h,v 1.1 2004/07/29 14:26:33 tomas Exp $ */ |
3 | #ifdef NO_CHDIR | 3 | #ifdef NO_CHDIR |
4 | #define chdir(p) (-1) | 4 | #define chdir(p) (-1) |
5 | #define chdir_error "Function 'chdir' not provided by system" | 5 | #define chdir_error "Function 'chdir' not provided by system" |
@@ -7,4 +7,4 @@ | |||
7 | #define chdir_error strerror(errno) | 7 | #define chdir_error strerror(errno) |
8 | #endif | 8 | #endif |
9 | 9 | ||
10 | int luaopen_filesystem (lua_State *L); | 10 | int luaopen_lfs (lua_State *L); |
diff --git a/t_lfs.lua b/t_lfs.lua new file mode 100644 index 0000000..b81950a --- /dev/null +++ b/t_lfs.lua | |||
@@ -0,0 +1,8 @@ | |||
1 | -- $Id: t_lfs.lua,v 1.1 2004/07/29 14:26:33 tomas Exp $ | ||
2 | if not lfs and loadlib then | ||
3 | local libname = "LIB_NAME" | ||
4 | local libopen = "luaopen_lfs" | ||
5 | local init, err1, err2 = loadlib (libname, libopen) | ||
6 | assert (init, (err1 or '')..(err2 or '')) | ||
7 | init () | ||
8 | end | ||
diff --git a/t_luafilesystem.lua b/t_luafilesystem.lua deleted file mode 100644 index eb12afb..0000000 --- a/t_luafilesystem.lua +++ /dev/null | |||
@@ -1,8 +0,0 @@ | |||
1 | -- $Id: t_luafilesystem.lua,v 1.1 2004/07/27 14:15:24 tomas Exp $ | ||
2 | if not luafilesystem and loadlib then | ||
3 | local libname = "LIB_NAME" | ||
4 | local libopen = "luaopen_luafilesystem" | ||
5 | local init, err1, err2 = loadlib (libname, libopen) | ||
6 | assert (init, (err1 or '')..(err2 or '')) | ||
7 | init () | ||
8 | end | ||
diff --git a/vc6/lfs.def b/vc6/lfs.def new file mode 100644 index 0000000..b2d5650 --- /dev/null +++ b/vc6/lfs.def | |||
@@ -0,0 +1,5 @@ | |||
1 | LIBRARY lfs.dll | ||
2 | DESCRIPTION "LuaFileSystem" | ||
3 | VERSION 1.0 | ||
4 | EXPORTS | ||
5 | luaopen_lfs | ||