diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1999-02-04 15:47:59 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1999-02-04 15:47:59 -0200 |
commit | 568794956025183fc9a9b79e0c818a885e3d0aeb (patch) | |
tree | 02d1a74d7c9a16ca06e94ab4308694ad04f49012 /lua.c | |
parent | 19de5b22054f6da2c3e0eb3138cc7a1195aab4fd (diff) | |
download | lua-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.c | 14 |
1 files changed, 6 insertions, 8 deletions
@@ -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 | ||
45 | static void lstop (void) { | 45 | static 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 | ||
53 | static void laction (int i) { | 53 | static 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", |