diff options
Diffstat (limited to 'lua.h')
-rw-r--r-- | lua.h | 14 |
1 files changed, 9 insertions, 5 deletions
@@ -2,7 +2,7 @@ | |||
2 | ** LUA - Linguagem para Usuarios de Aplicacao | 2 | ** LUA - Linguagem para Usuarios de Aplicacao |
3 | ** Grupo de Tecnologia em Computacao Grafica | 3 | ** Grupo de Tecnologia em Computacao Grafica |
4 | ** TeCGraf - PUC-Rio | 4 | ** TeCGraf - PUC-Rio |
5 | ** $Id: lua.h,v 3.10 1994/11/17 21:27:30 roberto Exp roberto $ | 5 | ** $Id: lua.h,v 3.11 1994/11/18 19:46:21 roberto Stab roberto $ |
6 | */ | 6 | */ |
7 | 7 | ||
8 | 8 | ||
@@ -51,6 +51,7 @@ void *lua_getuserdata (lua_Object object); | |||
51 | int lua_pushnil (void); | 51 | int lua_pushnil (void); |
52 | int lua_pushnumber (float n); | 52 | int lua_pushnumber (float n); |
53 | int lua_pushstring (char *s); | 53 | int lua_pushstring (char *s); |
54 | int lua_pushliteral (char *s); | ||
54 | int lua_pushcfunction (lua_CFunction fn); | 55 | int lua_pushcfunction (lua_CFunction fn); |
55 | int lua_pushusertag (void *u, int tag); | 56 | int lua_pushusertag (void *u, int tag); |
56 | int lua_pushobject (lua_Object object); | 57 | int lua_pushobject (lua_Object object); |
@@ -70,15 +71,12 @@ void lua_unlock (int ref); | |||
70 | lua_Object lua_createtable (int initSize); | 71 | lua_Object lua_createtable (int initSize); |
71 | 72 | ||
72 | 73 | ||
73 | /* for lua 1.1 */ | 74 | /* some useful macros */ |
74 | 75 | ||
75 | #define lua_lockobject(o) (lua_pushobject(o), lua_lock()) | 76 | #define lua_lockobject(o) (lua_pushobject(o), lua_lock()) |
76 | 77 | ||
77 | #define lua_register(n,f) (lua_pushcfunction(f), lua_storeglobal(n)) | 78 | #define lua_register(n,f) (lua_pushcfunction(f), lua_storeglobal(n)) |
78 | 79 | ||
79 | #define lua_getindexed(o,n) (lua_pushobject(o), lua_pushnumber(n), lua_getsubscript()) | ||
80 | #define lua_getfield(o,f) (lua_pushobject(o), lua_pushstring(f), lua_getsubscript()) | ||
81 | |||
82 | #define lua_pushuserdata(u) lua_pushusertag(u, LUA_T_USERDATA) | 80 | #define lua_pushuserdata(u) lua_pushusertag(u, LUA_T_USERDATA) |
83 | 81 | ||
84 | #define lua_isnil(_) (lua_type(_)==LUA_T_NIL) | 82 | #define lua_isnil(_) (lua_type(_)==LUA_T_NIL) |
@@ -89,4 +87,10 @@ lua_Object lua_createtable (int initSize); | |||
89 | #define lua_iscfunction(_) (lua_type(_)==LUA_T_CFUNCTION) | 87 | #define lua_iscfunction(_) (lua_type(_)==LUA_T_CFUNCTION) |
90 | #define lua_isuserdata(_) (lua_type(_)>=LUA_T_USERDATA) | 88 | #define lua_isuserdata(_) (lua_type(_)>=LUA_T_USERDATA) |
91 | 89 | ||
90 | |||
91 | /* for lua 1.1 compatibility. Avoid using these macros */ | ||
92 | |||
93 | #define lua_getindexed(o,n) (lua_pushobject(o), lua_pushnumber(n), lua_getsubscript()) | ||
94 | #define lua_getfield(o,f) (lua_pushobject(o), lua_pushstring(f), lua_getsubscript()) | ||
95 | |||
92 | #endif | 96 | #endif |