diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2002-06-05 14:24:04 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2002-06-05 14:24:04 -0300 |
| commit | 5b8ee9fa8d9bc3d3ad41a1acd547b79bc3b669a7 (patch) | |
| tree | e9d62d00cd762b64e30ce2297319f91064d54d7e | |
| parent | 2cd6161060f3e9149e7a61a126bec76cd4f1b333 (diff) | |
| download | lua-5b8ee9fa8d9bc3d3ad41a1acd547b79bc3b669a7.tar.gz lua-5b8ee9fa8d9bc3d3ad41a1acd547b79bc3b669a7.tar.bz2 lua-5b8ee9fa8d9bc3d3ad41a1acd547b79bc3b669a7.zip | |
new names for standard libraries
| -rw-r--r-- | lbaselib.c | 4 | ||||
| -rw-r--r-- | ldblib.c | 4 | ||||
| -rw-r--r-- | liolib.c | 8 | ||||
| -rw-r--r-- | lmathlib.c | 4 | ||||
| -rw-r--r-- | lstrlib.c | 4 | ||||
| -rw-r--r-- | ltablib.c | 4 | ||||
| -rw-r--r-- | lualib.h | 14 |
7 files changed, 27 insertions, 15 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lbaselib.c,v 1.76 2002/06/03 20:11:41 roberto Exp roberto $ | 2 | ** $Id: lbaselib.c,v 1.77 2002/06/05 16:59:21 roberto Exp roberto $ |
| 3 | ** Basic library | 3 | ** Basic library |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -459,7 +459,7 @@ static const luaL_reg co_funcs[] = { | |||
| 459 | 459 | ||
| 460 | 460 | ||
| 461 | static void co_open (lua_State *L) { | 461 | static void co_open (lua_State *L) { |
| 462 | luaL_opennamedlib(L, "co", co_funcs, 0); | 462 | luaL_opennamedlib(L, LUA_COLIBNAME, co_funcs, 0); |
| 463 | /* create metatable for coroutines */ | 463 | /* create metatable for coroutines */ |
| 464 | lua_pushliteral(L, "Coroutine"); | 464 | lua_pushliteral(L, "Coroutine"); |
| 465 | lua_newtable(L); | 465 | lua_newtable(L); |
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: ldblib.c,v 1.53 2002/05/16 18:39:46 roberto Exp roberto $ | 2 | ** $Id: ldblib.c,v 1.54 2002/06/03 17:47:18 roberto Exp roberto $ |
| 3 | ** Interface from Lua to its debug API | 3 | ** Interface from Lua to its debug API |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -246,7 +246,7 @@ static const luaL_reg dblib[] = { | |||
| 246 | 246 | ||
| 247 | 247 | ||
| 248 | LUALIB_API int lua_dblibopen (lua_State *L) { | 248 | LUALIB_API int lua_dblibopen (lua_State *L) { |
| 249 | luaL_opennamedlib(L, "dbg", dblib, 0); | 249 | luaL_opennamedlib(L, LUA_DBLIBNAME, dblib, 0); |
| 250 | lua_register(L, "_ERRORMESSAGE", errorfb); | 250 | lua_register(L, "_ERRORMESSAGE", errorfb); |
| 251 | return 0; | 251 | return 0; |
| 252 | } | 252 | } |
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: liolib.c,v 2.5 2002/05/06 19:05:10 roberto Exp roberto $ | 2 | ** $Id: liolib.c,v 2.6 2002/06/05 16:59:37 roberto Exp roberto $ |
| 3 | ** Standard I/O (and system) library | 3 | ** Standard I/O (and system) library |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -594,12 +594,12 @@ static const luaL_reg syslib[] = { | |||
| 594 | 594 | ||
| 595 | LUALIB_API int lua_iolibopen (lua_State *L) { | 595 | LUALIB_API int lua_iolibopen (lua_State *L) { |
| 596 | createmeta(L); | 596 | createmeta(L); |
| 597 | luaL_opennamedlib(L, "os", syslib, 0); | 597 | luaL_opennamedlib(L, LUA_OSLIBNAME, syslib, 0); |
| 598 | lua_pushliteral(L, FILEHANDLE); /* S: FH */ | 598 | lua_pushliteral(L, FILEHANDLE); /* S: FH */ |
| 599 | lua_rawget(L, LUA_REGISTRYINDEX); /* S: mt */ | 599 | lua_rawget(L, LUA_REGISTRYINDEX); /* S: mt */ |
| 600 | lua_pushvalue(L, -1); /* S: mt mt */ | 600 | lua_pushvalue(L, -1); /* S: mt mt */ |
| 601 | luaL_opennamedlib(L, "io", iolib, 1); /* S: mt */ | 601 | luaL_opennamedlib(L, LUA_IOLIBNAME, iolib, 1); /* S: mt */ |
| 602 | lua_pushliteral(L, "io"); /* S: `io' mt */ | 602 | lua_pushliteral(L, LUA_IOLIBNAME); /* S: `io' mt */ |
| 603 | lua_gettable(L, LUA_GLOBALSINDEX); /* S: io mt */ | 603 | lua_gettable(L, LUA_GLOBALSINDEX); /* S: io mt */ |
| 604 | /* put predefined file handles into `io' table */ | 604 | /* put predefined file handles into `io' table */ |
| 605 | registerfile(L, stdin, "stdin", IO_INPUT); | 605 | registerfile(L, stdin, "stdin", IO_INPUT); |
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lmathlib.c,v 1.44 2002/05/02 17:12:27 roberto Exp roberto $ | 2 | ** $Id: lmathlib.c,v 1.45 2002/05/06 19:05:10 roberto Exp roberto $ |
| 3 | ** Standard mathematical library | 3 | ** Standard mathematical library |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -231,7 +231,7 @@ static const luaL_reg mathlib[] = { | |||
| 231 | ** Open math library | 231 | ** Open math library |
| 232 | */ | 232 | */ |
| 233 | LUALIB_API int lua_mathlibopen (lua_State *L) { | 233 | LUALIB_API int lua_mathlibopen (lua_State *L) { |
| 234 | lua_pushliteral(L, "math"); | 234 | lua_pushliteral(L, LUA_MATHLIBNAME); |
| 235 | lua_newtable(L); | 235 | lua_newtable(L); |
| 236 | luaL_openlib(L, mathlib, 0); | 236 | luaL_openlib(L, mathlib, 0); |
| 237 | lua_pushliteral(L, "pi"); | 237 | lua_pushliteral(L, "pi"); |
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lstrlib.c,v 1.81 2002/05/02 17:12:27 roberto Exp roberto $ | 2 | ** $Id: lstrlib.c,v 1.82 2002/05/06 19:05:10 roberto Exp roberto $ |
| 3 | ** Standard library for string operations and pattern-matching | 3 | ** Standard library for string operations and pattern-matching |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -726,7 +726,7 @@ static const luaL_reg strlib[] = { | |||
| 726 | ** Open string library | 726 | ** Open string library |
| 727 | */ | 727 | */ |
| 728 | LUALIB_API int lua_strlibopen (lua_State *L) { | 728 | LUALIB_API int lua_strlibopen (lua_State *L) { |
| 729 | luaL_opennamedlib(L, "str", strlib, 0); | 729 | luaL_opennamedlib(L, LUA_STRLIBNAME, strlib, 0); |
| 730 | return 0; | 730 | return 0; |
| 731 | } | 731 | } |
| 732 | 732 | ||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: ltablib.c,v 1.3 2002/05/02 17:12:27 roberto Exp roberto $ | 2 | ** $Id: ltablib.c,v 1.4 2002/06/05 16:59:21 roberto Exp roberto $ |
| 3 | ** Library for Table Manipulation | 3 | ** Library for Table Manipulation |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -226,7 +226,7 @@ static const luaL_reg tab_funcs[] = { | |||
| 226 | 226 | ||
| 227 | 227 | ||
| 228 | LUALIB_API int lua_tablibopen (lua_State *L) { | 228 | LUALIB_API int lua_tablibopen (lua_State *L) { |
| 229 | luaL_opennamedlib(L, "tab", tab_funcs, 0); | 229 | luaL_opennamedlib(L, LUA_TABLIBNAME, tab_funcs, 0); |
| 230 | return 0; | 230 | return 0; |
| 231 | } | 231 | } |
| 232 | 232 | ||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lualib.h,v 1.21 2001/03/26 14:31:49 roberto Exp roberto $ | 2 | ** $Id: lualib.h,v 1.22 2002/04/09 20:19:06 roberto Exp roberto $ |
| 3 | ** Lua standard libraries | 3 | ** Lua standard libraries |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -18,11 +18,23 @@ | |||
| 18 | 18 | ||
| 19 | #define LUA_ALERT "_ALERT" | 19 | #define LUA_ALERT "_ALERT" |
| 20 | 20 | ||
| 21 | #define LUA_COLIBNAME "coroutine" | ||
| 21 | LUALIB_API int lua_baselibopen (lua_State *L); | 22 | LUALIB_API int lua_baselibopen (lua_State *L); |
| 23 | |||
| 24 | #define LUA_TABLIBNAME "table" | ||
| 22 | LUALIB_API int lua_tablibopen (lua_State *L); | 25 | LUALIB_API int lua_tablibopen (lua_State *L); |
| 26 | |||
| 27 | #define LUA_IOLIBNAME "io" | ||
| 28 | #define LUA_OSLIBNAME "os" | ||
| 23 | LUALIB_API int lua_iolibopen (lua_State *L); | 29 | LUALIB_API int lua_iolibopen (lua_State *L); |
| 30 | |||
| 31 | #define LUA_STRLIBNAME "string" | ||
| 24 | LUALIB_API int lua_strlibopen (lua_State *L); | 32 | LUALIB_API int lua_strlibopen (lua_State *L); |
| 33 | |||
| 34 | #define LUA_MATHLIBNAME "math" | ||
| 25 | LUALIB_API int lua_mathlibopen (lua_State *L); | 35 | LUALIB_API int lua_mathlibopen (lua_State *L); |
| 36 | |||
| 37 | #define LUA_DBLIBNAME "debug" | ||
| 26 | LUALIB_API int lua_dblibopen (lua_State *L); | 38 | LUALIB_API int lua_dblibopen (lua_State *L); |
| 27 | 39 | ||
| 28 | 40 | ||
