aboutsummaryrefslogtreecommitdiff
path: root/lua.h
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2002-05-01 17:48:12 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2002-05-01 17:48:12 -0300
commit751cd867d3e0338279fa6f3390c8b7ddc0108659 (patch)
tree726f6f3cd49109382b2c0d7ee6a1e0fea740afbd /lua.h
parentb36b2a061c88be22e36900146cbcad39bab07f5d (diff)
downloadlua-751cd867d3e0338279fa6f3390c8b7ddc0108659.tar.gz
lua-751cd867d3e0338279fa6f3390c8b7ddc0108659.tar.bz2
lua-751cd867d3e0338279fa6f3390c8b7ddc0108659.zip
new way to handle errors
Diffstat (limited to 'lua.h')
-rw-r--r--lua.h20
1 files changed, 11 insertions, 9 deletions
diff --git a/lua.h b/lua.h
index cb6cbaff..9ea98c11 100644
--- a/lua.h
+++ b/lua.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lua.h,v 1.128 2002/04/22 14:40:23 roberto Exp roberto $ 2** $Id: lua.h,v 1.129 2002/05/01 20:40:42 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
@@ -35,7 +35,7 @@
35#define lua_upvalueindex(i) (LUA_GLOBALSINDEX-(i)) 35#define lua_upvalueindex(i) (LUA_GLOBALSINDEX-(i))
36 36
37 37
38/* error codes for `lua_do*' and the like */ 38/* error codes for `lua_load*' and `lua_pcall' */
39#define LUA_ERRRUN 1 39#define LUA_ERRRUN 1
40#define LUA_ERRFILE 2 40#define LUA_ERRFILE 2
41#define LUA_ERRSYNTAX 3 41#define LUA_ERRSYNTAX 3
@@ -166,18 +166,13 @@ LUA_API void lua_setmetatable (lua_State *L, int objindex);
166 166
167 167
168/* 168/*
169** `load' and `do' functions (load and run Lua code) 169** `load' and `call' functions (load and run Lua code)
170*/ 170*/
171LUA_API int lua_call (lua_State *L, int nargs, int nresults);
172LUA_API void lua_rawcall (lua_State *L, int nargs, int nresults); 171LUA_API void lua_rawcall (lua_State *L, int nargs, int nresults);
173LUA_API int lua_pcall (lua_State *L, int nargs, int nresults, int errf); 172LUA_API int lua_pcall (lua_State *L, int nargs, int nresults, int errf);
174LUA_API int lua_loadfile (lua_State *L, const char *filename); 173LUA_API int lua_loadfile (lua_State *L, const char *filename);
175LUA_API int lua_loadbuffer (lua_State *L, const char *buff, size_t size, 174LUA_API int lua_loadbuffer (lua_State *L, const char *buff, size_t size,
176 const char *name); 175 const char *name);
177LUA_API int lua_dofile (lua_State *L, const char *filename);
178LUA_API int lua_dostring (lua_State *L, const char *str);
179LUA_API int lua_dobuffer (lua_State *L, const char *buff, size_t size,
180 const char *name);
181 176
182 177
183/* 178/*
@@ -243,10 +238,17 @@ LUA_API void *lua_newuserdata (lua_State *L, size_t size);
243 (sizeof(s)/sizeof(char))-1) 238 (sizeof(s)/sizeof(char))-1)
244 239
245 240
241
246/* 242/*
247** compatibility macros and functions 243** compatibility macros and functions
248*/ 244*/
249 245
246LUA_API int lua_call (lua_State *L, int nargs, int nresults);
247LUA_API int lua_dofile (lua_State *L, const char *filename);
248LUA_API int lua_dostring (lua_State *L, const char *str);
249LUA_API int lua_dobuffer (lua_State *L, const char *buff, size_t size,
250 const char *name);
251
250LUA_API int lua_pushupvalues (lua_State *L); 252LUA_API int lua_pushupvalues (lua_State *L);
251 253
252#define lua_getregistry(L) lua_pushvalue(L, LUA_REGISTRYINDEX) 254#define lua_getregistry(L) lua_pushvalue(L, LUA_REGISTRYINDEX)