diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2000-08-07 15:39:16 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2000-08-07 15:39:16 -0300 |
commit | 397905ef8694ec716a51acebc993bb625340d388 (patch) | |
tree | cbf37aa8278b53161f99f28a027ac703c227ec27 /lua.h | |
parent | 435f587ed05e2c4d542e1db9ae9e4efbb7e02305 (diff) | |
download | lua-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.h | 14 |
1 files changed, 11 insertions, 3 deletions
@@ -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 | |||
33 | typedef struct lua_State lua_State; | 41 | typedef struct lua_State lua_State; |
34 | 42 | ||
35 | typedef void (*lua_CFunction) (lua_State *L); | 43 | typedef void (*lua_CFunction) (lua_State *L); |
@@ -58,7 +66,7 @@ int lua_dostring (lua_State *L, const char *str); | |||
58 | int lua_dobuffer (lua_State *L, const char *buff, size_t size, | 66 | int lua_dobuffer (lua_State *L, const char *buff, size_t size, |
59 | const char *name); /* Out: returns */ | 67 | const char *name); /* Out: returns */ |
60 | int lua_callfunction (lua_State *L, lua_Object f); | 68 | int lua_callfunction (lua_State *L, lua_Object f); |
61 | /* In: parameters; Out: returns */ | 69 | /* In: arguments; Out: returns */ |
62 | 70 | ||
63 | void lua_beginblock (lua_State *L); | 71 | void lua_beginblock (lua_State *L); |
64 | void lua_endblock (lua_State *L); | 72 | void lua_endblock (lua_State *L); |
@@ -111,7 +119,7 @@ lua_Object lua_rawget (lua_State *L); /* In: table, index */ | |||
111 | int lua_tag (lua_State *L, lua_Object obj); | 119 | int lua_tag (lua_State *L, lua_Object obj); |
112 | 120 | ||
113 | int lua_next (lua_State *L, lua_Object o, int i); | 121 | int lua_next (lua_State *L, lua_Object o, int i); |
114 | /* Out: ref, value */ | 122 | /* Out: index, value */ |
115 | 123 | ||
116 | int lua_ref (lua_State *L, int lock); /* In: value */ | 124 | int lua_ref (lua_State *L, int lock); /* In: value */ |
117 | lua_Object lua_getref (lua_State *L, int ref); | 125 | lua_Object lua_getref (lua_State *L, int ref); |