diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2004-05-31 16:41:52 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2004-05-31 16:41:52 -0300 |
| commit | 0dfd04eb60a7b9d54a6348ef4d9a3fa3963682aa (patch) | |
| tree | 7f2353754af0783c2713af728be68878f149b3ce /lua.h | |
| parent | 1e0aaf2156bb261787606b8cf00f812d75344ff2 (diff) | |
| download | lua-0dfd04eb60a7b9d54a6348ef4d9a3fa3963682aa.tar.gz lua-0dfd04eb60a7b9d54a6348ef4d9a3fa3963682aa.tar.bz2 lua-0dfd04eb60a7b9d54a6348ef4d9a3fa3963682aa.zip | |
`lua_strlen' upgraded to `lua_objsize' (which also works with userdata)
Diffstat (limited to 'lua.h')
| -rw-r--r-- | lua.h | 11 |
1 files changed, 4 insertions, 7 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lua.h,v 1.188 2004/03/24 13:55:46 roberto Exp roberto $ | 2 | ** $Id: lua.h,v 1.189 2004/04/30 20:13:38 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 |
| @@ -145,7 +145,7 @@ LUA_API lua_Number lua_tonumber (lua_State *L, int idx); | |||
| 145 | LUA_API lua_Integer lua_tointeger (lua_State *L, int idx); | 145 | LUA_API lua_Integer lua_tointeger (lua_State *L, int idx); |
| 146 | LUA_API int lua_toboolean (lua_State *L, int idx); | 146 | LUA_API int lua_toboolean (lua_State *L, int idx); |
| 147 | LUA_API const char *lua_tostring (lua_State *L, int idx); | 147 | LUA_API const char *lua_tostring (lua_State *L, int idx); |
| 148 | LUA_API size_t lua_strlen (lua_State *L, int idx); | 148 | LUA_API size_t lua_objsize (lua_State *L, int idx); |
| 149 | LUA_API lua_CFunction lua_tocfunction (lua_State *L, int idx); | 149 | LUA_API lua_CFunction lua_tocfunction (lua_State *L, int idx); |
| 150 | LUA_API void *lua_touserdata (lua_State *L, int idx); | 150 | LUA_API void *lua_touserdata (lua_State *L, int idx); |
| 151 | LUA_API lua_State *lua_tothread (lua_State *L, int idx); | 151 | LUA_API lua_State *lua_tothread (lua_State *L, int idx); |
| @@ -244,11 +244,6 @@ LUA_API lua_Alloc lua_getallocf (lua_State *L, void **ud); | |||
| 244 | ** =============================================================== | 244 | ** =============================================================== |
| 245 | */ | 245 | */ |
| 246 | 246 | ||
| 247 | #define lua_boxpointer(L,u) \ | ||
| 248 | (*(void **)(lua_newuserdata(L, sizeof(void *))) = (u)) | ||
| 249 | |||
| 250 | #define lua_unboxpointer(L,i) (*(void **)(lua_touserdata(L, i))) | ||
| 251 | |||
| 252 | #define lua_pop(L,n) lua_settop(L, -(n)-1) | 247 | #define lua_pop(L,n) lua_settop(L, -(n)-1) |
| 253 | 248 | ||
| 254 | #define lua_newtable(L) lua_createtable(L, 0, 0) | 249 | #define lua_newtable(L) lua_createtable(L, 0, 0) |
| @@ -257,6 +252,8 @@ LUA_API lua_Alloc lua_getallocf (lua_State *L, void **ud); | |||
| 257 | 252 | ||
| 258 | #define lua_pushcfunction(L,f) lua_pushcclosure(L, f, 0) | 253 | #define lua_pushcfunction(L,f) lua_pushcclosure(L, f, 0) |
| 259 | 254 | ||
| 255 | #define lua_strlen(L,i) lua_objsize(L,i) | ||
| 256 | |||
| 260 | #define lua_isfunction(L,n) (lua_type(L,n) == LUA_TFUNCTION) | 257 | #define lua_isfunction(L,n) (lua_type(L,n) == LUA_TFUNCTION) |
| 261 | #define lua_istable(L,n) (lua_type(L,n) == LUA_TTABLE) | 258 | #define lua_istable(L,n) (lua_type(L,n) == LUA_TTABLE) |
| 262 | #define lua_islightuserdata(L,n) (lua_type(L,n) == LUA_TLIGHTUSERDATA) | 259 | #define lua_islightuserdata(L,n) (lua_type(L,n) == LUA_TLIGHTUSERDATA) |
