aboutsummaryrefslogtreecommitdiff
path: root/lua.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2001-02-06 16:18:58 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2001-02-06 16:18:58 -0200
commit322b7b5fc55da0d166efc693cfe674220190b010 (patch)
tree1e01fd53e7a4aece6b7eb20445307e257511b5d1 /lua.c
parent1f917e709ca3fe41cf07fd4bf99a080883521394 (diff)
downloadlua-322b7b5fc55da0d166efc693cfe674220190b010.tar.gz
lua-322b7b5fc55da0d166efc693cfe674220190b010.tar.bz2
lua-322b7b5fc55da0d166efc693cfe674220190b010.zip
easier to add new initialization functions
Diffstat (limited to 'lua.c')
-rw-r--r--lua.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/lua.c b/lua.c
index a7b80e5f..bf87237b 100644
--- a/lua.c
+++ b/lua.c
@@ -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
312static 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
313int main (int argc, char *argv[]) { 321int main (int argc, char *argv[]) {
314 struct Options opt; 322 struct Options opt;
315 int status; 323 int status;