new way to handle errors

This commit is contained in:
Roberto Ierusalimschy 2002-05-01 17:40:42 -03:00
parent ab52fc6097
commit b36b2a061c
1 changed files with 4 additions and 2 deletions

6
lua.h
View File

@ -1,5 +1,5 @@
/*
** $Id: lua.h,v 1.127 2002/04/16 17:08:28 roberto Exp roberto $
** $Id: lua.h,v 1.128 2002/04/22 14:40:23 roberto Exp roberto $
** Lua - An Extensible Extension Language
** TeCGraf: Grupo de Tecnologia em Computacao Grafica, PUC-Rio, Brazil
** e-mail: info@lua.org
@ -198,7 +198,7 @@ LUA_API void lua_setgcthreshold (lua_State *L, int newthreshold);
** miscellaneous functions
*/
LUA_API void lua_error (lua_State *L, const char *s);
LUA_API void lua_errorobj (lua_State *L);
LUA_API int lua_next (lua_State *L, int index);
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);
** ===============================================================
*/
#define lua_error(L,s) (lua_pushstring(L, s), lua_errorobj(L))
#define lua_newpointerbox(L,u) \
(*(void **)(lua_newuserdata(L, sizeof(void *))) = (u))