commit 5b8ee9fa8d9bc3d3ad41a1acd547b79bc3b669a7
parent 2cd6161060f3e9149e7a61a126bec76cd4f1b333
Author: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
Date: Wed, 5 Jun 2002 14:23:42 -0300
new names for standard libraries
Diffstat:
7 files changed, 27 insertions(+), 15 deletions(-)
diff --git a/lbaselib.c b/lbaselib.c
@@ -1,5 +1,5 @@
/*
-** $Id: lbaselib.c,v 1.76 2002/06/03 20:11:41 roberto Exp roberto $
+** $Id: lbaselib.c,v 1.77 2002/06/05 16:59:21 roberto Exp roberto $
** Basic library
** See Copyright Notice in lua.h
*/
@@ -459,7 +459,7 @@ static const luaL_reg co_funcs[] = {
static void co_open (lua_State *L) {
- luaL_opennamedlib(L, "co", co_funcs, 0);
+ luaL_opennamedlib(L, LUA_COLIBNAME, co_funcs, 0);
/* create metatable for coroutines */
lua_pushliteral(L, "Coroutine");
lua_newtable(L);
diff --git a/ldblib.c b/ldblib.c
@@ -1,5 +1,5 @@
/*
-** $Id: ldblib.c,v 1.53 2002/05/16 18:39:46 roberto Exp roberto $
+** $Id: ldblib.c,v 1.54 2002/06/03 17:47:18 roberto Exp roberto $
** Interface from Lua to its debug API
** See Copyright Notice in lua.h
*/
@@ -246,7 +246,7 @@ static const luaL_reg dblib[] = {
LUALIB_API int lua_dblibopen (lua_State *L) {
- luaL_opennamedlib(L, "dbg", dblib, 0);
+ luaL_opennamedlib(L, LUA_DBLIBNAME, dblib, 0);
lua_register(L, "_ERRORMESSAGE", errorfb);
return 0;
}
diff --git a/liolib.c b/liolib.c
@@ -1,5 +1,5 @@
/*
-** $Id: liolib.c,v 2.5 2002/05/06 19:05:10 roberto Exp roberto $
+** $Id: liolib.c,v 2.6 2002/06/05 16:59:37 roberto Exp roberto $
** Standard I/O (and system) library
** See Copyright Notice in lua.h
*/
@@ -594,12 +594,12 @@ static const luaL_reg syslib[] = {
LUALIB_API int lua_iolibopen (lua_State *L) {
createmeta(L);
- luaL_opennamedlib(L, "os", syslib, 0);
+ luaL_opennamedlib(L, LUA_OSLIBNAME, syslib, 0);
lua_pushliteral(L, FILEHANDLE); /* S: FH */
lua_rawget(L, LUA_REGISTRYINDEX); /* S: mt */
lua_pushvalue(L, -1); /* S: mt mt */
- luaL_opennamedlib(L, "io", iolib, 1); /* S: mt */
- lua_pushliteral(L, "io"); /* S: `io' mt */
+ luaL_opennamedlib(L, LUA_IOLIBNAME, iolib, 1); /* S: mt */
+ lua_pushliteral(L, LUA_IOLIBNAME); /* S: `io' mt */
lua_gettable(L, LUA_GLOBALSINDEX); /* S: io mt */
/* put predefined file handles into `io' table */
registerfile(L, stdin, "stdin", IO_INPUT);
diff --git a/lmathlib.c b/lmathlib.c
@@ -1,5 +1,5 @@
/*
-** $Id: lmathlib.c,v 1.44 2002/05/02 17:12:27 roberto Exp roberto $
+** $Id: lmathlib.c,v 1.45 2002/05/06 19:05:10 roberto Exp roberto $
** Standard mathematical library
** See Copyright Notice in lua.h
*/
@@ -231,7 +231,7 @@ static const luaL_reg mathlib[] = {
** Open math library
*/
LUALIB_API int lua_mathlibopen (lua_State *L) {
- lua_pushliteral(L, "math");
+ lua_pushliteral(L, LUA_MATHLIBNAME);
lua_newtable(L);
luaL_openlib(L, mathlib, 0);
lua_pushliteral(L, "pi");
diff --git a/lstrlib.c b/lstrlib.c
@@ -1,5 +1,5 @@
/*
-** $Id: lstrlib.c,v 1.81 2002/05/02 17:12:27 roberto Exp roberto $
+** $Id: lstrlib.c,v 1.82 2002/05/06 19:05:10 roberto Exp roberto $
** Standard library for string operations and pattern-matching
** See Copyright Notice in lua.h
*/
@@ -726,7 +726,7 @@ static const luaL_reg strlib[] = {
** Open string library
*/
LUALIB_API int lua_strlibopen (lua_State *L) {
- luaL_opennamedlib(L, "str", strlib, 0);
+ luaL_opennamedlib(L, LUA_STRLIBNAME, strlib, 0);
return 0;
}
diff --git a/ltablib.c b/ltablib.c
@@ -1,5 +1,5 @@
/*
-** $Id: ltablib.c,v 1.3 2002/05/02 17:12:27 roberto Exp roberto $
+** $Id: ltablib.c,v 1.4 2002/06/05 16:59:21 roberto Exp roberto $
** Library for Table Manipulation
** See Copyright Notice in lua.h
*/
@@ -226,7 +226,7 @@ static const luaL_reg tab_funcs[] = {
LUALIB_API int lua_tablibopen (lua_State *L) {
- luaL_opennamedlib(L, "tab", tab_funcs, 0);
+ luaL_opennamedlib(L, LUA_TABLIBNAME, tab_funcs, 0);
return 0;
}
diff --git a/lualib.h b/lualib.h
@@ -1,5 +1,5 @@
/*
-** $Id: lualib.h,v 1.21 2001/03/26 14:31:49 roberto Exp roberto $
+** $Id: lualib.h,v 1.22 2002/04/09 20:19:06 roberto Exp roberto $
** Lua standard libraries
** See Copyright Notice in lua.h
*/
@@ -18,11 +18,23 @@
#define LUA_ALERT "_ALERT"
+#define LUA_COLIBNAME "coroutine"
LUALIB_API int lua_baselibopen (lua_State *L);
+
+#define LUA_TABLIBNAME "table"
LUALIB_API int lua_tablibopen (lua_State *L);
+
+#define LUA_IOLIBNAME "io"
+#define LUA_OSLIBNAME "os"
LUALIB_API int lua_iolibopen (lua_State *L);
+
+#define LUA_STRLIBNAME "string"
LUALIB_API int lua_strlibopen (lua_State *L);
+
+#define LUA_MATHLIBNAME "math"
LUALIB_API int lua_mathlibopen (lua_State *L);
+
+#define LUA_DBLIBNAME "debug"
LUALIB_API int lua_dblibopen (lua_State *L);