diff options
| -rw-r--r-- | ltests.c | 8 | ||||
| -rw-r--r-- | ltests.h | 4 | ||||
| -rw-r--r-- | lua.c | 14 |
3 files changed, 14 insertions, 12 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: ltests.c,v 1.62 2001/02/02 15:13:05 roberto Exp roberto $ | 2 | ** $Id: ltests.c,v 1.63 2001/02/06 16:01:29 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 | */ |
| @@ -652,12 +652,6 @@ void luaB_opentests (lua_State *L) { | |||
| 652 | luaL_openl(L, tests_funcs); /* open functions inside new table */ | 652 | luaL_openl(L, tests_funcs); /* open functions inside new table */ |
| 653 | lua_setglobals(L); /* restore old table of globals */ | 653 | lua_setglobals(L); /* restore old table of globals */ |
| 654 | lua_setglobal(L, "T"); /* set new table as global T */ | 654 | lua_setglobal(L, "T"); /* set new table as global T */ |
| 655 | /* open other libraries */ | ||
| 656 | lua_baselibopen(L); | ||
| 657 | lua_iolibopen(L); | ||
| 658 | lua_strlibopen(L); | ||
| 659 | lua_mathlibopen(L); | ||
| 660 | lua_dblibopen(L); | ||
| 661 | } | 655 | } |
| 662 | 656 | ||
| 663 | #endif | 657 | #endif |
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: ltests.h,v 1.2 2001/02/05 19:08:01 roberto Exp roberto $ | 2 | ** $Id: ltests.h,v 1.3 2001/02/06 16:01:29 roberto Exp roberto $ |
| 3 | ** Internal Header for Debugging of the Lua Implementation | 3 | ** Internal Header for Debugging of the Lua Implementation |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -49,7 +49,7 @@ extern lua_State *lua_state; | |||
| 49 | 49 | ||
| 50 | void luaB_opentests (lua_State *L); | 50 | void luaB_opentests (lua_State *L); |
| 51 | 51 | ||
| 52 | #define LUA_USERINIT(L) luaB_opentests(L) | 52 | #define LUA_USERINIT(L) (luaB_opentests(L), openstdlibs(L)) |
| 53 | 53 | ||
| 54 | 54 | ||
| 55 | #endif | 55 | #endif |
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lua.c,v 1.57 2001/01/22 18:01:38 roberto Exp roberto $ | 2 | ** $Id: lua.c,v 1.58 2001/01/26 11:45:51 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 | */ |
| @@ -30,8 +30,7 @@ static int isatty (int x) { return x==0; } /* assume stdin is a tty */ | |||
| 30 | 30 | ||
| 31 | 31 | ||
| 32 | #ifndef LUA_USERINIT | 32 | #ifndef LUA_USERINIT |
| 33 | #define LUA_USERINIT(L) (lua_baselibopen(L), lua_iolibopen(L), \ | 33 | #define LUA_USERINIT(L) openstdlibs(L) |
| 34 | lua_strlibopen(L), lua_mathlibopen(L), lua_dblibopen(L)) | ||
| 35 | #endif | 34 | #endif |
| 36 | 35 | ||
| 37 | 36 | ||
| @@ -310,6 +309,15 @@ static void register_getargs (char *argv[]) { | |||
| 310 | } | 309 | } |
| 311 | 310 | ||
| 312 | 311 | ||
| 312 | static void openstdlibs (lua_State *l) { | ||
| 313 | lua_baselibopen(l); | ||
| 314 | lua_iolibopen(l); | ||
| 315 | lua_strlibopen(l); | ||
| 316 | lua_mathlibopen(l); | ||
| 317 | lua_dblibopen(l); | ||
| 318 | } | ||
| 319 | |||
| 320 | |||
| 313 | int main (int argc, char *argv[]) { | 321 | int main (int argc, char *argv[]) { |
| 314 | struct Options opt; | 322 | struct Options opt; |
| 315 | int status; | 323 | int status; |
