aboutsummaryrefslogtreecommitdiff
path: root/lua.h
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2000-08-07 15:39:16 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2000-08-07 15:39:16 -0300
commit397905ef8694ec716a51acebc993bb625340d388 (patch)
treecbf37aa8278b53161f99f28a027ac703c227ec27 /lua.h
parent435f587ed05e2c4d542e1db9ae9e4efbb7e02305 (diff)
downloadlua-397905ef8694ec716a51acebc993bb625340d388.tar.gz
lua-397905ef8694ec716a51acebc993bb625340d388.tar.bz2
lua-397905ef8694ec716a51acebc993bb625340d388.zip
(much) better handling of memory alloction errors
Diffstat (limited to 'lua.h')
-rw-r--r--lua.h14
1 files changed, 11 insertions, 3 deletions
diff --git a/lua.h b/lua.h
index b6bd9305..f5d2e0ce 100644
--- a/lua.h
+++ b/lua.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lua.h,v 1.54 2000/05/26 19:17:57 roberto Exp roberto $ 2** $Id: lua.h,v 1.55 2000/06/30 19:17:08 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: lua@tecgraf.puc-rio.br 5** e-mail: lua@tecgraf.puc-rio.br
@@ -30,6 +30,14 @@
30 30
31#define LUA_ANYTAG (-1) 31#define LUA_ANYTAG (-1)
32 32
33
34/* error code for lua_do* */
35#define LUA_ERRFILE 2
36#define LUA_ERRSYNTAX 3
37#define LUA_ERRRUN 1
38#define LUA_ERRMEM 4
39
40
33typedef struct lua_State lua_State; 41typedef struct lua_State lua_State;
34 42
35typedef void (*lua_CFunction) (lua_State *L); 43typedef void (*lua_CFunction) (lua_State *L);
@@ -58,7 +66,7 @@ int lua_dostring (lua_State *L, const char *str);
58int lua_dobuffer (lua_State *L, const char *buff, size_t size, 66int lua_dobuffer (lua_State *L, const char *buff, size_t size,
59 const char *name); /* Out: returns */ 67 const char *name); /* Out: returns */
60int lua_callfunction (lua_State *L, lua_Object f); 68int lua_callfunction (lua_State *L, lua_Object f);
61 /* In: parameters; Out: returns */ 69 /* In: arguments; Out: returns */
62 70
63void lua_beginblock (lua_State *L); 71void lua_beginblock (lua_State *L);
64void lua_endblock (lua_State *L); 72void lua_endblock (lua_State *L);
@@ -111,7 +119,7 @@ lua_Object lua_rawget (lua_State *L); /* In: table, index */
111int lua_tag (lua_State *L, lua_Object obj); 119int lua_tag (lua_State *L, lua_Object obj);
112 120
113int lua_next (lua_State *L, lua_Object o, int i); 121int lua_next (lua_State *L, lua_Object o, int i);
114 /* Out: ref, value */ 122 /* Out: index, value */
115 123
116int lua_ref (lua_State *L, int lock); /* In: value */ 124int lua_ref (lua_State *L, int lock); /* In: value */
117lua_Object lua_getref (lua_State *L, int ref); 125lua_Object lua_getref (lua_State *L, int ref);