diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2002-05-01 17:40:42 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2002-05-01 17:40:42 -0300 |
commit | b36b2a061c88be22e36900146cbcad39bab07f5d (patch) | |
tree | 1074b62795d484765eed582d0110f02bb268d95c /lua.h | |
parent | ab52fc6097569cf51bc0c55dd5b6b1329eefd970 (diff) | |
download | lua-b36b2a061c88be22e36900146cbcad39bab07f5d.tar.gz lua-b36b2a061c88be22e36900146cbcad39bab07f5d.tar.bz2 lua-b36b2a061c88be22e36900146cbcad39bab07f5d.zip |
new way to handle errors
Diffstat (limited to 'lua.h')
-rw-r--r-- | lua.h | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lua.h,v 1.127 2002/04/16 17:08:28 roberto Exp roberto $ | 2 | ** $Id: lua.h,v 1.128 2002/04/22 14:40:23 roberto Exp roberto $ |
3 | ** Lua - An Extensible Extension Language | 3 | ** Lua - An Extensible Extension Language |
4 | ** TeCGraf: Grupo de Tecnologia em Computacao Grafica, PUC-Rio, Brazil | 4 | ** TeCGraf: Grupo de Tecnologia em Computacao Grafica, PUC-Rio, Brazil |
5 | ** e-mail: info@lua.org | 5 | ** e-mail: info@lua.org |
@@ -198,7 +198,7 @@ LUA_API void lua_setgcthreshold (lua_State *L, int newthreshold); | |||
198 | ** miscellaneous functions | 198 | ** miscellaneous functions |
199 | */ | 199 | */ |
200 | 200 | ||
201 | LUA_API void lua_error (lua_State *L, const char *s); | 201 | LUA_API void lua_errorobj (lua_State *L); |
202 | 202 | ||
203 | LUA_API int lua_next (lua_State *L, int index); | 203 | LUA_API int lua_next (lua_State *L, int index); |
204 | LUA_API int lua_getn (lua_State *L, int index); | 204 | LUA_API int lua_getn (lua_State *L, int index); |
@@ -215,6 +215,8 @@ LUA_API void *lua_newuserdata (lua_State *L, size_t size); | |||
215 | ** =============================================================== | 215 | ** =============================================================== |
216 | */ | 216 | */ |
217 | 217 | ||
218 | #define lua_error(L,s) (lua_pushstring(L, s), lua_errorobj(L)) | ||
219 | |||
218 | #define lua_newpointerbox(L,u) \ | 220 | #define lua_newpointerbox(L,u) \ |
219 | (*(void **)(lua_newuserdata(L, sizeof(void *))) = (u)) | 221 | (*(void **)(lua_newuserdata(L, sizeof(void *))) = (u)) |
220 | 222 | ||