diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2002-04-22 11:40:50 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2002-04-22 11:40:50 -0300 |
commit | ee4859b3e3db6c1a3223669d15538b3852ca4791 (patch) | |
tree | a9a9532c03f0a9bc58599e34457cb618aa5f11f2 /ldo.h | |
parent | f388ee4a822b3d8027ed7c28aa21e9406e4a11eb (diff) | |
download | lua-ee4859b3e3db6c1a3223669d15538b3852ca4791.tar.gz lua-ee4859b3e3db6c1a3223669d15538b3852ca4791.tar.bz2 lua-ee4859b3e3db6c1a3223669d15538b3852ca4791.zip |
new way to handle errors (temporary version)
Diffstat (limited to 'ldo.h')
-rw-r--r-- | ldo.h | 14 |
1 files changed, 10 insertions, 4 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ldo.h,v 1.41 2002/03/20 12:52:32 roberto Exp roberto $ | 2 | ** $Id: ldo.h,v 1.42 2002/03/25 17:47:14 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 | */ |
@@ -10,6 +10,7 @@ | |||
10 | 10 | ||
11 | #include "lobject.h" | 11 | #include "lobject.h" |
12 | #include "lstate.h" | 12 | #include "lstate.h" |
13 | #include "lzio.h" | ||
13 | 14 | ||
14 | 15 | ||
15 | /* | 16 | /* |
@@ -27,17 +28,22 @@ | |||
27 | #define restorestack(L,n) ((TObject *)((char *)L->stack + (n))) | 28 | #define restorestack(L,n) ((TObject *)((char *)L->stack + (n))) |
28 | 29 | ||
29 | 30 | ||
31 | /* type of protected functions, to be ran by `runprotected' */ | ||
32 | typedef void (*Pfunc) (lua_State *L, void *v); | ||
33 | |||
34 | int luaD_protectedparser (lua_State *L, ZIO *z, int bin); | ||
30 | void luaD_lineHook (lua_State *L, int line); | 35 | void luaD_lineHook (lua_State *L, int line); |
31 | StkId luaD_precall (lua_State *L, StkId func); | 36 | StkId luaD_precall (lua_State *L, StkId func); |
32 | void luaD_call (lua_State *L, StkId func, int nResults); | 37 | void luaD_call (lua_State *L, StkId func, int nResults); |
38 | int luaD_pcall (lua_State *L, int nargs, int nresults, const TObject *err); | ||
33 | void luaD_poscall (lua_State *L, int wanted, StkId firstResult); | 39 | void luaD_poscall (lua_State *L, int wanted, StkId firstResult); |
34 | void luaD_reallocCI (lua_State *L, int newsize); | 40 | void luaD_reallocCI (lua_State *L, int newsize); |
35 | void luaD_reallocstack (lua_State *L, int newsize); | 41 | void luaD_reallocstack (lua_State *L, int newsize); |
36 | void luaD_growstack (lua_State *L, int n); | 42 | void luaD_growstack (lua_State *L, int n); |
37 | 43 | ||
38 | void luaD_error (lua_State *L, const char *s); | 44 | void luaD_error (lua_State *L, const char *s, int errcode); |
39 | void luaD_breakrun (lua_State *L, int errcode); | 45 | void luaD_runerror (lua_State *L, const char *s); |
40 | int luaD_runprotected (lua_State *L, void (*f)(lua_State *, void *), void *ud); | 46 | int luaD_runprotected (lua_State *L, Pfunc f, const TObject *err, void *ud); |
41 | 47 | ||
42 | 48 | ||
43 | #endif | 49 | #endif |