diff options
Diffstat (limited to 'lua.c')
| -rw-r--r-- | lua.c | 14 |
1 files changed, 11 insertions, 3 deletions
| @@ -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; |
