aboutsummaryrefslogtreecommitdiff
path: root/lua.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>1999-02-04 15:47:59 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>1999-02-04 15:47:59 -0200
commit568794956025183fc9a9b79e0c818a885e3d0aeb (patch)
tree02d1a74d7c9a16ca06e94ab4308694ad04f49012 /lua.c
parent19de5b22054f6da2c3e0eb3138cc7a1195aab4fd (diff)
downloadlua-568794956025183fc9a9b79e0c818a885e3d0aeb.tar.gz
lua-568794956025183fc9a9b79e0c818a885e3d0aeb.tar.bz2
lua-568794956025183fc9a9b79e0c818a885e3d0aeb.zip
"lua_debug", "lua_callhook" and "lua_linehook" must be inside "lua_state".
Diffstat (limited to 'lua.c')
-rw-r--r--lua.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/lua.c b/lua.c
index 6deb6b99..a7ba2a42 100644
--- a/lua.c
+++ b/lua.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lua.c,v 1.17 1999/01/08 16:47:44 roberto Exp roberto $ 2** $Id: lua.c,v 1.18 1999/01/26 11:50:58 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*/
@@ -43,18 +43,16 @@ static handler lreset (void) {
43 43
44 44
45static void lstop (void) { 45static void lstop (void) {
46 lua_linehook = old_linehook; 46 lua_setlinehook(old_linehook);
47 lua_callhook = old_callhook; 47 lua_setcallhook(old_callhook);
48 lreset(); 48 lreset();
49 lua_error("interrupted!"); 49 lua_error("interrupted!");
50} 50}
51 51
52 52
53static void laction (int i) { 53static void laction (int i) {
54 old_linehook = lua_linehook; 54 old_linehook = lua_setlinehook((lua_LHFunction)lstop);
55 old_callhook = lua_callhook; 55 old_callhook = lua_setcallhook((lua_CHFunction)lstop);
56 lua_linehook = (lua_LHFunction)lstop;
57 lua_callhook = (lua_CHFunction)lstop;
58} 56}
59 57
60 58
@@ -156,7 +154,7 @@ int main (int argc, char *argv[])
156 manual_input(0); 154 manual_input(0);
157 break; 155 break;
158 case 'd': 156 case 'd':
159 lua_debug = 1; 157 lua_setdebug(1);
160 break; 158 break;
161 case 'v': 159 case 'v':
162 printf("%s %s\n(written by %s)\n\n", 160 printf("%s %s\n(written by %s)\n\n",