aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lbaselib.c4
-rw-r--r--ldblib.c4
-rw-r--r--liolib.c4
-rw-r--r--lmathlib.c4
-rw-r--r--lstrlib.c4
-rw-r--r--ltablib.c4
-rw-r--r--ltests.c14
-rw-r--r--lua.c16
-rw-r--r--lualib.h23
9 files changed, 43 insertions, 34 deletions
diff --git a/lbaselib.c b/lbaselib.c
index 12df27b3..c4192670 100644
--- a/lbaselib.c
+++ b/lbaselib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lbaselib.c,v 1.125 2003/03/06 19:36:16 roberto Exp roberto $ 2** $Id: lbaselib.c,v 1.126 2003/03/11 12:08:13 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*/
@@ -668,7 +668,7 @@ static void base_open (lua_State *L) {
668} 668}
669 669
670 670
671LUALIB_API int lua_baselibopen (lua_State *L) { 671LUALIB_API int luaopen_base (lua_State *L) {
672 base_open(L); 672 base_open(L);
673 luaL_openlib(L, LUA_COLIBNAME, co_funcs, 0); 673 luaL_openlib(L, LUA_COLIBNAME, co_funcs, 0);
674 lua_newtable(L); 674 lua_newtable(L);
diff --git a/ldblib.c b/ldblib.c
index 9bffa2c8..e5c48ca8 100644
--- a/ldblib.c
+++ b/ldblib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ldblib.c,v 1.77 2002/12/20 10:26:33 roberto Exp roberto $ 2** $Id: ldblib.c,v 1.78 2003/02/27 11:52:30 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*/
@@ -288,7 +288,7 @@ static const luaL_reg dblib[] = {
288}; 288};
289 289
290 290
291LUALIB_API int lua_dblibopen (lua_State *L) { 291LUALIB_API int luaopen_debug (lua_State *L) {
292 luaL_openlib(L, LUA_DBLIBNAME, dblib, 0); 292 luaL_openlib(L, LUA_DBLIBNAME, dblib, 0);
293 lua_pushliteral(L, "_TRACEBACK"); 293 lua_pushliteral(L, "_TRACEBACK");
294 lua_pushcfunction(L, errorfb); 294 lua_pushcfunction(L, errorfb);
diff --git a/liolib.c b/liolib.c
index 1181d7bd..cc232c9e 100644
--- a/liolib.c
+++ b/liolib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: liolib.c,v 2.33 2003/02/27 12:39:05 roberto Exp roberto $ 2** $Id: liolib.c,v 2.34 2003/03/06 19:36:44 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*/
@@ -749,7 +749,7 @@ static const luaL_reg syslib[] = {
749 749
750 750
751 751
752LUALIB_API int lua_iolibopen (lua_State *L) { 752LUALIB_API int luaopen_io (lua_State *L) {
753 createmeta(L); 753 createmeta(L);
754 luaL_openlib(L, LUA_OSLIBNAME, syslib, 0); 754 luaL_openlib(L, LUA_OSLIBNAME, syslib, 0);
755 lua_pushliteral(L, FILEHANDLE); 755 lua_pushliteral(L, FILEHANDLE);
diff --git a/lmathlib.c b/lmathlib.c
index 3a6420c4..b1a70959 100644
--- a/lmathlib.c
+++ b/lmathlib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lmathlib.c,v 1.53 2002/12/04 17:38:31 roberto Exp roberto $ 2** $Id: lmathlib.c,v 1.54 2002/12/20 10:26:33 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*/
@@ -233,7 +233,7 @@ static const luaL_reg mathlib[] = {
233/* 233/*
234** Open math library 234** Open math library
235*/ 235*/
236LUALIB_API int lua_mathlibopen (lua_State *L) { 236LUALIB_API int luaopen_math (lua_State *L) {
237 luaL_openlib(L, LUA_MATHLIBNAME, mathlib, 0); 237 luaL_openlib(L, LUA_MATHLIBNAME, mathlib, 0);
238 lua_pushliteral(L, "pi"); 238 lua_pushliteral(L, "pi");
239 lua_pushnumber(L, PI); 239 lua_pushnumber(L, PI);
diff --git a/lstrlib.c b/lstrlib.c
index d882a73d..677930a3 100644
--- a/lstrlib.c
+++ b/lstrlib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lstrlib.c,v 1.93 2002/12/20 10:26:33 roberto Exp roberto $ 2** $Id: lstrlib.c,v 1.94 2003/02/12 09:10:41 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*/
@@ -762,7 +762,7 @@ static const luaL_reg strlib[] = {
762/* 762/*
763** Open string library 763** Open string library
764*/ 764*/
765LUALIB_API int lua_strlibopen (lua_State *L) { 765LUALIB_API int luaopen_string (lua_State *L) {
766 luaL_openlib(L, LUA_STRLIBNAME, strlib, 0); 766 luaL_openlib(L, LUA_STRLIBNAME, strlib, 0);
767 return 1; 767 return 1;
768} 768}
diff --git a/ltablib.c b/ltablib.c
index c0e773aa..49475145 100644
--- a/ltablib.c
+++ b/ltablib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ltablib.c,v 1.18 2002/12/20 10:26:33 roberto Exp roberto $ 2** $Id: ltablib.c,v 1.19 2003/01/27 13:46:16 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*/
@@ -243,7 +243,7 @@ static const luaL_reg tab_funcs[] = {
243}; 243};
244 244
245 245
246LUALIB_API int lua_tablibopen (lua_State *L) { 246LUALIB_API int luaopen_table (lua_State *L) {
247 luaL_openlib(L, LUA_TABLIBNAME, tab_funcs, 0); 247 luaL_openlib(L, LUA_TABLIBNAME, tab_funcs, 0);
248 return 1; 248 return 1;
249} 249}
diff --git a/ltests.c b/ltests.c
index 85319943..95a43af0 100644
--- a/ltests.c
+++ b/ltests.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ltests.c,v 1.153 2003/02/18 16:02:56 roberto Exp roberto $ 2** $Id: ltests.c,v 1.154 2003/02/27 12:33:07 roberto Exp roberto $
3** Internal Module for Debugging of the Lua Implementation 3** Internal Module for Debugging of the Lua Implementation
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -460,12 +460,12 @@ static int newstate (lua_State *L) {
460 460
461static int loadlib (lua_State *L) { 461static int loadlib (lua_State *L) {
462 static const luaL_reg libs[] = { 462 static const luaL_reg libs[] = {
463 {"mathlibopen", lua_mathlibopen}, 463 {"mathlibopen", luaopen_math},
464 {"strlibopen", lua_strlibopen}, 464 {"strlibopen", luaopen_string},
465 {"iolibopen", lua_iolibopen}, 465 {"iolibopen", luaopen_io},
466 {"tablibopen", lua_tablibopen}, 466 {"tablibopen", luaopen_table},
467 {"dblibopen", lua_dblibopen}, 467 {"dblibopen", luaopen_debug},
468 {"baselibopen", lua_baselibopen}, 468 {"baselibopen", luaopen_base},
469 {NULL, NULL} 469 {NULL, NULL}
470 }; 470 };
471 lua_State *L1 = cast(lua_State *, 471 lua_State *L1 = cast(lua_State *,
diff --git a/lua.c b/lua.c
index 7a248bf8..9c1a9097 100644
--- a/lua.c
+++ b/lua.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lua.c,v 1.116 2003/01/29 13:23:45 roberto Exp roberto $ 2** $Id: lua.c,v 1.117 2003/03/07 13:21:31 roberto Exp roberto $
3** Lua stand-alone interpreter 3** Lua stand-alone interpreter
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -67,12 +67,12 @@ static const char *progname = PROGNAME;
67 67
68 68
69static const luaL_reg lualibs[] = { 69static const luaL_reg lualibs[] = {
70 {"baselib", lua_baselibopen}, 70 {"base", luaopen_base},
71 {"tablib", lua_tablibopen}, 71 {"table", luaopen_table},
72 {"iolib", lua_iolibopen}, 72 {"io", luaopen_io},
73 {"strlib", lua_strlibopen}, 73 {"string", luaopen_string},
74 {"mathlib", lua_mathlibopen}, 74 {"math", luaopen_math},
75 {"dblib", lua_dblibopen}, 75 {"debug", luaopen_debug},
76 /* add your libraries here */ 76 /* add your libraries here */
77 LUA_EXTRALIBS 77 LUA_EXTRALIBS
78 {NULL, NULL} 78 {NULL, NULL}
@@ -372,7 +372,7 @@ static int handle_argv (char *argv[], int *interactive) {
372 372
373static void openstdlibs (lua_State *l) { 373static void openstdlibs (lua_State *l) {
374 const luaL_reg *lib = lualibs; 374 const luaL_reg *lib = lualibs;
375 for (; lib->name; lib++) { 375 for (; lib->func; lib++) {
376 lib->func(l); /* open library */ 376 lib->func(l); /* open library */
377 lua_settop(l, 0); /* discard any results */ 377 lua_settop(l, 0); /* discard any results */
378 } 378 }
diff --git a/lualib.h b/lualib.h
index 1bb25c00..d393b66d 100644
--- a/lualib.h
+++ b/lualib.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lualib.h,v 1.24 2002/06/18 17:42:52 roberto Exp roberto $ 2** $Id: lualib.h,v 1.25 2002/07/09 18:49:13 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*/
@@ -17,23 +17,23 @@
17 17
18 18
19#define LUA_COLIBNAME "coroutine" 19#define LUA_COLIBNAME "coroutine"
20LUALIB_API int lua_baselibopen (lua_State *L); 20LUALIB_API int luaopen_base (lua_State *L);
21 21
22#define LUA_TABLIBNAME "table" 22#define LUA_TABLIBNAME "table"
23LUALIB_API int lua_tablibopen (lua_State *L); 23LUALIB_API int luaopen_table (lua_State *L);
24 24
25#define LUA_IOLIBNAME "io" 25#define LUA_IOLIBNAME "io"
26#define LUA_OSLIBNAME "os" 26#define LUA_OSLIBNAME "os"
27LUALIB_API int lua_iolibopen (lua_State *L); 27LUALIB_API int luaopen_io (lua_State *L);
28 28
29#define LUA_STRLIBNAME "string" 29#define LUA_STRLIBNAME "string"
30LUALIB_API int lua_strlibopen (lua_State *L); 30LUALIB_API int luaopen_string (lua_State *L);
31 31
32#define LUA_MATHLIBNAME "math" 32#define LUA_MATHLIBNAME "math"
33LUALIB_API int lua_mathlibopen (lua_State *L); 33LUALIB_API int luaopen_math (lua_State *L);
34 34
35#define LUA_DBLIBNAME "debug" 35#define LUA_DBLIBNAME "debug"
36LUALIB_API int lua_dblibopen (lua_State *L); 36LUALIB_API int luaopen_debug (lua_State *L);
37 37
38 38
39/* to help testing the libraries */ 39/* to help testing the libraries */
@@ -41,4 +41,13 @@ LUALIB_API int lua_dblibopen (lua_State *L);
41#define lua_assert(c) /* empty */ 41#define lua_assert(c) /* empty */
42#endif 42#endif
43 43
44
45/* compatibility code */
46#define lua_baselibopen luaopen_base
47#define lua_tablibopen luaopen_table
48#define lua_iolibopen luaopen_io
49#define lua_strlibopen luaopen_string
50#define lua_mathlibopen luaopen_math
51#define lua_dblibopen luaopen_debug
52
44#endif 53#endif