diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2002-08-05 14:36:24 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2002-08-05 14:36:24 -0300 |
commit | 4e23699aa647fd9dc04933bf5582217ca594c8ce (patch) | |
tree | 03d4f407c2f8974a62837a7d71f417c833aedd99 /ldo.h | |
parent | 1c0ac3c0f53720c53dcfae13308b11b29dca38e4 (diff) | |
download | lua-4e23699aa647fd9dc04933bf5582217ca594c8ce.tar.gz lua-4e23699aa647fd9dc04933bf5582217ca594c8ce.tar.bz2 lua-4e23699aa647fd9dc04933bf5582217ca594c8ce.zip |
new implementation for error handling
Diffstat (limited to 'ldo.h')
-rw-r--r-- | ldo.h | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ldo.h,v 1.47 2002/06/18 17:10:43 roberto Exp roberto $ | 2 | ** $Id: ldo.h,v 1.48 2002/07/08 18:21:33 roberto Exp roberto $ |
3 | ** Stack and Call structure of Lua | 3 | ** Stack and Call structure of Lua |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -27,10 +27,14 @@ | |||
27 | #define savestack(L,p) ((char *)(p) - (char *)L->stack) | 27 | #define savestack(L,p) ((char *)(p) - (char *)L->stack) |
28 | #define restorestack(L,n) ((TObject *)((char *)L->stack + (n))) | 28 | #define restorestack(L,n) ((TObject *)((char *)L->stack + (n))) |
29 | 29 | ||
30 | #define saveci(L,p) ((char *)(p) - (char *)L->base_ci) | ||
31 | #define restoreci(L,n) ((CallInfo *)((char *)L->base_ci + (n))) | ||
32 | |||
30 | 33 | ||
31 | /* type of protected functions, to be ran by `runprotected' */ | 34 | /* type of protected functions, to be ran by `runprotected' */ |
32 | typedef void (*Pfunc) (lua_State *L, void *v); | 35 | typedef void (*Pfunc) (lua_State *L, void *ud); |
33 | 36 | ||
37 | void luaD_resetprotection (lua_State *L); | ||
34 | int luaD_protectedparser (lua_State *L, ZIO *z, int bin); | 38 | int luaD_protectedparser (lua_State *L, ZIO *z, int bin); |
35 | void luaD_callhook (lua_State *L, lua_Hookevent event, int line); | 39 | void luaD_callhook (lua_State *L, lua_Hookevent event, int line); |
36 | StkId luaD_precall (lua_State *L, StkId func); | 40 | StkId luaD_precall (lua_State *L, StkId func); |
@@ -42,8 +46,7 @@ void luaD_reallocstack (lua_State *L, int newsize); | |||
42 | void luaD_growstack (lua_State *L, int n); | 46 | void luaD_growstack (lua_State *L, int n); |
43 | 47 | ||
44 | void luaD_throw (lua_State *L, int errcode); | 48 | void luaD_throw (lua_State *L, int errcode); |
45 | int luaD_runprotected (lua_State *L, Pfunc f, TObject *ud); | 49 | int luaD_rawrunprotected (lua_State *L, Pfunc f, void *ud); |
46 | int luaD_isprotected (lua_State *L, CallInfo *ci); | ||
47 | 50 | ||
48 | 51 | ||
49 | #endif | 52 | #endif |