aboutsummaryrefslogtreecommitdiff
path: root/lua.h
diff options
context:
space:
mode:
Diffstat (limited to 'lua.h')
-rw-r--r--lua.h14
1 files changed, 9 insertions, 5 deletions
diff --git a/lua.h b/lua.h
index 221060eb..6fe7aca0 100644
--- a/lua.h
+++ b/lua.h
@@ -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);
51int lua_pushnil (void); 51int lua_pushnil (void);
52int lua_pushnumber (float n); 52int lua_pushnumber (float n);
53int lua_pushstring (char *s); 53int lua_pushstring (char *s);
54int lua_pushliteral (char *s);
54int lua_pushcfunction (lua_CFunction fn); 55int lua_pushcfunction (lua_CFunction fn);
55int lua_pushusertag (void *u, int tag); 56int lua_pushusertag (void *u, int tag);
56int lua_pushobject (lua_Object object); 57int lua_pushobject (lua_Object object);
@@ -70,15 +71,12 @@ void lua_unlock (int ref);
70lua_Object lua_createtable (int initSize); 71lua_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