diff --git a/Makefile b/Makefile index 7e0e577..f811a90 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ -# $Id: Makefile,v 1.1 2004/07/27 14:15:24 tomas Exp $ +# $Id: Makefile,v 1.2 2004/07/29 14:26:33 tomas Exp $ -T= luafilesystem +T= lfs include ./config diff --git a/config b/config index 9cd88bc..38eb0ed 100644 --- a/config +++ b/config @@ -1,6 +1,7 @@ # Installation directories -# System's libraries directory (where Lua libraries are installed) +# System's libraries directory (where binary libraries are installed) LIB_DIR= /usr/local/lib +# System's lua directory (where Lua libraries are installed) LUA_DIR= /usr/local/lua # OS dependent @@ -10,7 +11,6 @@ LIB_OPTION= -dynamiclib #for MacOS X #LIB_OPTION= -shared #for Linux # Compilation directives -# pre-compile and include mod2.lua into mod_lua.c # On FreeBSD systems, the following line should be commented DLLIB= -ldl 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 @@ -LIBRARY luafilesystem.dll -DESCRIPTION "LuaFilesystem" -VERSION 1.0 -EXPORTS -luaopen_luafilesystem diff --git a/luafilesystem.c b/src/lfs.c similarity index 94% rename from luafilesystem.c rename to src/lfs.c index 57167ea..d494dd3 100644 --- a/luafilesystem.c +++ b/src/lfs.c @@ -1,15 +1,15 @@ /* ** File system manipulation library. ** This library offers these functions: -** luafilesystem.attributes (filepath [, attributename]) -** luafilesystem.chdir (path) -** luafilesystem.currentdir () -** luafilesystem.dir (path) -** luafilesystem.mkdir (path) -** luafilesystem.lock (fh, mode) -** luafilesystem.unlock (fh) +** lfs.attributes (filepath [, attributename]) +** lfs.chdir (path) +** lfs.currentdir () +** lfs.dir (path) +** lfs.mkdir (path) +** lfs.lock (fh, mode) +** lfs.unlock (fh) ** -** $Id: luafilesystem.c,v 1.1 2004/07/27 14:15:24 tomas Exp $ +** $Id: lfs.c,v 1.1 2004/07/29 14:26:33 tomas Exp $ */ #include @@ -33,7 +33,7 @@ #include #include -#include "luafilesystem.h" +#include "lfs.h" /* Define 'strerror' for systems that do not implement it */ #ifdef NO_STRERROR @@ -344,8 +344,8 @@ static const struct luaL_reg fslib[] = { {NULL, NULL}, }; -int luaopen_luafilesystem (lua_State *L) { +int luaopen_lfs (lua_State *L) { dir_create_meta (L); - luaL_openlib (L, "luafilesystem", fslib, 0); + luaL_openlib (L, "lfs", fslib, 0); return 1; } diff --git a/luafilesystem.h b/src/lfs.h similarity index 66% rename from luafilesystem.h rename to src/lfs.h index 6178dd7..67871f2 100644 --- a/luafilesystem.h +++ b/src/lfs.h @@ -1,5 +1,5 @@ /* Define 'chdir' for systems that do not implement it */ -/* $Id: luafilesystem.h,v 1.1 2004/07/27 14:15:24 tomas Exp $ */ +/* $Id: lfs.h,v 1.1 2004/07/29 14:26:33 tomas Exp $ */ #ifdef NO_CHDIR #define chdir(p) (-1) #define chdir_error "Function 'chdir' not provided by system" @@ -7,4 +7,4 @@ #define chdir_error strerror(errno) #endif -int luaopen_filesystem (lua_State *L); +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 @@ +-- $Id: t_lfs.lua,v 1.1 2004/07/29 14:26:33 tomas Exp $ +if not lfs and loadlib then + local libname = "LIB_NAME" + local libopen = "luaopen_lfs" + local init, err1, err2 = loadlib (libname, libopen) + assert (init, (err1 or '')..(err2 or '')) + init () +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 @@ --- $Id: t_luafilesystem.lua,v 1.1 2004/07/27 14:15:24 tomas Exp $ -if not luafilesystem and loadlib then - local libname = "LIB_NAME" - local libopen = "luaopen_luafilesystem" - local init, err1, err2 = loadlib (libname, libopen) - assert (init, (err1 or '')..(err2 or '')) - init () -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 @@ +LIBRARY lfs.dll +DESCRIPTION "LuaFileSystem" +VERSION 1.0 +EXPORTS +luaopen_lfs