diff options
Diffstat (limited to 'lua.h')
-rw-r--r-- | lua.h | 25 |
1 files changed, 12 insertions, 13 deletions
@@ -1,9 +1,8 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lua.h,v 1.136 2002/06/03 20:11:07 roberto Exp roberto $ | 2 | ** $Id: lua.h,v 1.137 2002/06/05 12:34:19 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: Computer Graphics Technology Group, PUC-Rio, Brazil |
5 | ** e-mail: info@lua.org | 5 | ** http://www.lua.org mailto:info@lua.org |
6 | ** www: http://www.lua.org | ||
7 | ** See Copyright Notice at the end of this file | 6 | ** See Copyright Notice at the end of this file |
8 | */ | 7 | */ |
9 | 8 | ||
@@ -26,7 +25,7 @@ | |||
26 | 25 | ||
27 | 26 | ||
28 | 27 | ||
29 | /* option for multiple returns in `lua_call' */ | 28 | /* option for multiple returns in `lua_pcall' and `lua_rawcall' */ |
30 | #define LUA_MULTRET (-1) | 29 | #define LUA_MULTRET (-1) |
31 | 30 | ||
32 | 31 | ||
@@ -38,7 +37,7 @@ | |||
38 | #define lua_upvalueindex(i) (LUA_GLOBALSINDEX-(i)) | 37 | #define lua_upvalueindex(i) (LUA_GLOBALSINDEX-(i)) |
39 | 38 | ||
40 | 39 | ||
41 | /* error codes for `lua_load*' and `lua_pcall' */ | 40 | /* error codes for `lua_load' and `lua_pcall' */ |
42 | #define LUA_ERRRUN 1 | 41 | #define LUA_ERRRUN 1 |
43 | #define LUA_ERRFILE 2 | 42 | #define LUA_ERRFILE 2 |
44 | #define LUA_ERRSYNTAX 3 | 43 | #define LUA_ERRSYNTAX 3 |
@@ -52,9 +51,9 @@ typedef int (*lua_CFunction) (lua_State *L); | |||
52 | 51 | ||
53 | 52 | ||
54 | /* | 53 | /* |
55 | ** function for loading Lua code | 54 | ** functions that read blocks when loading Lua chunk |
56 | */ | 55 | */ |
57 | typedef const char * (*lua_Getblock) (void *ud, size_t *size); | 56 | typedef const char * (*lua_Chunkreader) (void *ud, size_t *size); |
58 | 57 | ||
59 | 58 | ||
60 | /* | 59 | /* |
@@ -84,7 +83,7 @@ typedef const char * (*lua_Getblock) (void *ud, size_t *size); | |||
84 | #endif | 83 | #endif |
85 | 84 | ||
86 | 85 | ||
87 | /* Lua numerical type */ | 86 | /* type of Numbers in Lua */ |
88 | #ifndef LUA_NUMBER | 87 | #ifndef LUA_NUMBER |
89 | #define LUA_NUMBER double | 88 | #define LUA_NUMBER double |
90 | #endif | 89 | #endif |
@@ -105,7 +104,7 @@ LUA_API void lua_close (lua_State *L); | |||
105 | LUA_API lua_State *lua_newthread (lua_State *L); | 104 | LUA_API lua_State *lua_newthread (lua_State *L); |
106 | LUA_API void lua_closethread (lua_State *L, lua_State *thread); | 105 | LUA_API void lua_closethread (lua_State *L, lua_State *thread); |
107 | 106 | ||
108 | LUA_API lua_CFunction lua_setpanicf (lua_State *L, lua_CFunction panicf); | 107 | LUA_API lua_CFunction lua_atpanic (lua_State *L, lua_CFunction panicf); |
109 | 108 | ||
110 | 109 | ||
111 | /* | 110 | /* |
@@ -181,7 +180,7 @@ LUA_API void lua_setmetatable (lua_State *L, int objindex); | |||
181 | */ | 180 | */ |
182 | LUA_API void lua_rawcall (lua_State *L, int nargs, int nresults); | 181 | LUA_API void lua_rawcall (lua_State *L, int nargs, int nresults); |
183 | LUA_API int lua_pcall (lua_State *L, int nargs, int nresults, int errf); | 182 | LUA_API int lua_pcall (lua_State *L, int nargs, int nresults, int errf); |
184 | LUA_API int lua_load (lua_State *L, lua_Getblock getblock, void *ud, | 183 | LUA_API int lua_load (lua_State *L, lua_Chunkreader reader, void *data, |
185 | const char *chunkname); | 184 | const char *chunkname); |
186 | 185 | ||
187 | 186 | ||
@@ -244,8 +243,8 @@ LUA_API void *lua_newuserdata (lua_State *L, size_t size); | |||
244 | #define lua_isnone(L,n) (lua_type(L,n) == LUA_TNONE) | 243 | #define lua_isnone(L,n) (lua_type(L,n) == LUA_TNONE) |
245 | #define lua_isnoneornil(L, n) (lua_type(L,n) <= 0) | 244 | #define lua_isnoneornil(L, n) (lua_type(L,n) <= 0) |
246 | 245 | ||
247 | #define lua_pushliteral(L, s) lua_pushlstring(L, "" s, \ | 246 | #define lua_pushliteral(L, s) \ |
248 | (sizeof(s)/sizeof(char))-1) | 247 | lua_pushlstring(L, "" s, (sizeof(s)/sizeof(char))-1) |
249 | 248 | ||
250 | 249 | ||
251 | 250 | ||