diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1994-11-17 19:23:43 -0200 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1994-11-17 19:23:43 -0200 |
| commit | 1929ddcf49b948ed8082cd375f7f7bf0b8a15bee (patch) | |
| tree | 9578d04056107bea60dee410d3889d7745d8764d /lua.h | |
| parent | aa4cd37adfdeb84b8137d3fccdb28a49a3b6d9e5 (diff) | |
| download | lua-github-1929ddcf49b948ed8082cd375f7f7bf0b8a15bee.tar.gz | |
userdata can have different tags
Diffstat (limited to 'lua.h')
| -rw-r--r-- | lua.h | 21 |
1 files changed, 11 insertions, 10 deletions
@@ -2,7 +2,7 @@ ** LUA - Linguagem para Usuarios de Aplicacao ** Grupo de Tecnologia em Computacao Grafica ** TeCGraf - PUC-Rio -** $Id: lua.h,v 3.7 1994/11/13 16:17:04 roberto Exp $ +** $Id: lua.h,v 3.8 1994/11/17 16:41:42 roberto Exp roberto $ */ @@ -13,14 +13,13 @@ typedef enum { - LUA_T_MARK, - LUA_T_NIL, - LUA_T_NUMBER, - LUA_T_STRING, - LUA_T_ARRAY, - LUA_T_FUNCTION, - LUA_T_CFUNCTION, - LUA_T_USERDATA + LUA_T_NIL = -1, + LUA_T_NUMBER = -2, + LUA_T_STRING = -3, + LUA_T_ARRAY = -4, + LUA_T_FUNCTION = -5, + LUA_T_CFUNCTION= -6, + LUA_T_USERDATA = 0 } lua_Type; @@ -53,7 +52,7 @@ int lua_pushnil (void); int lua_pushnumber (float n); int lua_pushstring (char *s); int lua_pushcfunction (lua_CFunction fn); -int lua_pushuserdata (void *u); +int lua_pushusertag (void *u, int tag); int lua_pushobject (lua_Object object); lua_Object lua_getglobal (char *name); @@ -77,6 +76,8 @@ lua_Object lua_createTable (int initSize); #define lua_getindexed(o,n) (lua_pushobject(o), lua_pushnumber(n), lua_getsubscript()) #define lua_getfield(o,f) (lua_pushobject(o), lua_pushstring(f), lua_getsubscript()) +#define lua_pushuserdata(u) lua_pushusertag(u,LUA_USERDATA) + #define lua_isnil(_) (lua_type(_)==LUA_T_NIL) #define lua_isnumber(_) (lua_type(_)==LUA_T_NUMBER) #define lua_isstring(_) (lua_type(_)==LUA_T_STRING) |
