diff options
Diffstat (limited to 'lua.h')
| -rw-r--r-- | lua.h | 14 |
1 files changed, 8 insertions, 6 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lua.h,v 1.139 2002/06/13 13:39:55 roberto Exp roberto $ | 2 | ** $Id: lua.h,v 1.140 2002/06/13 13:44:50 roberto Exp roberto $ |
| 3 | ** Lua - An Extensible Extension Language | 3 | ** Lua - An Extensible Extension Language |
| 4 | ** Tecgraf: Computer Graphics Technology Group, PUC-Rio, Brazil | 4 | ** Tecgraf: Computer Graphics Technology Group, PUC-Rio, Brazil |
| 5 | ** http://www.lua.org mailto:info@lua.org | 5 | ** http://www.lua.org mailto:info@lua.org |
| @@ -29,6 +29,9 @@ | |||
| 29 | #define LUA_MULTRET (-1) | 29 | #define LUA_MULTRET (-1) |
| 30 | 30 | ||
| 31 | 31 | ||
| 32 | /* index for a traceback function in the registry */ | ||
| 33 | #define LUA_TRACEBACK "_TRACEBACK" | ||
| 34 | |||
| 32 | /* | 35 | /* |
| 33 | ** pseudo-indices | 36 | ** pseudo-indices |
| 34 | */ | 37 | */ |
| @@ -43,6 +46,7 @@ | |||
| 43 | #define LUA_ERRSYNTAX 3 | 46 | #define LUA_ERRSYNTAX 3 |
| 44 | #define LUA_ERRMEM 4 | 47 | #define LUA_ERRMEM 4 |
| 45 | #define LUA_ERRERR 5 | 48 | #define LUA_ERRERR 5 |
| 49 | #define LUA_ERRTHROW 6 | ||
| 46 | 50 | ||
| 47 | 51 | ||
| 48 | typedef struct lua_State lua_State; | 52 | typedef struct lua_State lua_State; |
| @@ -180,7 +184,7 @@ LUA_API void lua_setmetatable (lua_State *L, int objindex); | |||
| 180 | ** `load' and `call' functions (load and run Lua code) | 184 | ** `load' and `call' functions (load and run Lua code) |
| 181 | */ | 185 | */ |
| 182 | LUA_API void lua_upcall (lua_State *L, int nargs, int nresults); | 186 | LUA_API void lua_upcall (lua_State *L, int nargs, int nresults); |
| 183 | LUA_API int lua_pcall (lua_State *L, int nargs, int nresults, int errf); | 187 | LUA_API int lua_pcall (lua_State *L, int nargs, int nresults); |
| 184 | LUA_API int lua_load (lua_State *L, lua_Chunkreader reader, void *data, | 188 | LUA_API int lua_load (lua_State *L, lua_Chunkreader reader, void *data, |
| 185 | const char *chunkname); | 189 | const char *chunkname); |
| 186 | 190 | ||
| @@ -203,7 +207,7 @@ LUA_API void lua_setgcthreshold (lua_State *L, int newthreshold); | |||
| 203 | ** miscellaneous functions | 207 | ** miscellaneous functions |
| 204 | */ | 208 | */ |
| 205 | 209 | ||
| 206 | LUA_API int lua_errorobj (lua_State *L); | 210 | LUA_API int lua_error (lua_State *L); |
| 207 | 211 | ||
| 208 | LUA_API int lua_next (lua_State *L, int index); | 212 | LUA_API int lua_next (lua_State *L, int index); |
| 209 | LUA_API int lua_getn (lua_State *L, int index); | 213 | LUA_API int lua_getn (lua_State *L, int index); |
| @@ -220,8 +224,6 @@ LUA_API void *lua_newuserdata (lua_State *L, size_t size); | |||
| 220 | ** =============================================================== | 224 | ** =============================================================== |
| 221 | */ | 225 | */ |
| 222 | 226 | ||
| 223 | #define lua_error(L,s) (lua_pushstring(L, s), lua_errorobj(L)) | ||
| 224 | |||
| 225 | #define lua_newpointerbox(L,u) \ | 227 | #define lua_newpointerbox(L,u) \ |
| 226 | (*(void **)(lua_newuserdata(L, sizeof(void *))) = (u)) | 228 | (*(void **)(lua_newuserdata(L, sizeof(void *))) = (u)) |
| 227 | 229 | ||
| @@ -275,7 +277,7 @@ LUA_API int lua_pushupvalues (lua_State *L); | |||
| 275 | #define LUA_REFNIL (-1) | 277 | #define LUA_REFNIL (-1) |
| 276 | 278 | ||
| 277 | #define lua_ref(L,lock) ((lock) ? luaL_ref(L, LUA_REGISTRYINDEX) : \ | 279 | #define lua_ref(L,lock) ((lock) ? luaL_ref(L, LUA_REGISTRYINDEX) : \ |
| 278 | (lua_error(L, "unlocked references are obsolete"), 0)) | 280 | (lua_pushstring(L, "unlocked references are obsolete"), lua_error(L), 0)) |
| 279 | 281 | ||
| 280 | #define lua_unref(L,ref) luaL_unref(L, LUA_REGISTRYINDEX, (ref)) | 282 | #define lua_unref(L,ref) luaL_unref(L, LUA_REGISTRYINDEX, (ref)) |
| 281 | 283 | ||
