aboutsummaryrefslogtreecommitdiff
path: root/lua.h
diff options
context:
space:
mode:
Diffstat (limited to 'lua.h')
-rw-r--r--lua.h35
1 files changed, 9 insertions, 26 deletions
diff --git a/lua.h b/lua.h
index 459f87c0..e656134e 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.32 1996/11/20 13:49:32 roberto Exp roberto $ 5** $Id: lua.h,v 3.33 1997/02/11 11:40:01 roberto Exp roberto $
6*/ 6*/
7 7
8 8
@@ -14,25 +14,6 @@
14#define LUA_AUTHORS "W. Celes, R. Ierusalimschy & L. H. de Figueiredo" 14#define LUA_AUTHORS "W. Celes, R. Ierusalimschy & L. H. de Figueiredo"
15 15
16 16
17/* Private Part */
18
19typedef enum
20{
21 LUA_T_NIL = -1,
22 LUA_T_NUMBER = -2,
23 LUA_T_STRING = -3,
24 LUA_T_ARRAY = -4,
25 LUA_T_FUNCTION = -5,
26 LUA_T_CFUNCTION= -6,
27 LUA_T_MARK = -7,
28 LUA_T_CMARK = -8,
29 LUA_T_LINE = -9,
30 LUA_T_USERDATA = 0
31} lua_Type;
32
33
34/* Public Part */
35
36#define LUA_NOOBJECT 0 17#define LUA_NOOBJECT 0
37 18
38typedef void (*lua_CFunction) (void); 19typedef void (*lua_CFunction) (void);
@@ -52,10 +33,10 @@ void lua_endblock (void);
52lua_Object lua_getparam (int number); 33lua_Object lua_getparam (int number);
53#define lua_getresult(_) lua_getparam(_) 34#define lua_getresult(_) lua_getparam(_)
54 35
55#define lua_isnil(_) (lua_type(_)==LUA_T_NIL) 36int lua_isnil (lua_Object object);
56#define lua_istable(_) (lua_type(_)==LUA_T_ARRAY) 37int lua_istable (lua_Object object);
57#define lua_isuserdata(_) (lua_type(_)>=LUA_T_USERDATA) 38int lua_isuserdata (lua_Object object);
58#define lua_iscfunction(_) (lua_type(_)==LUA_T_CFUNCTION) 39int lua_iscfunction (lua_Object object);
59int lua_isnumber (lua_Object object); 40int lua_isnumber (lua_Object object);
60int lua_isstring (lua_Object object); 41int lua_isstring (lua_Object object);
61int lua_isfunction (lua_Object object); 42int lua_isfunction (lua_Object object);
@@ -65,7 +46,6 @@ char *lua_getstring (lua_Object object);
65lua_CFunction lua_getcfunction (lua_Object object); 46lua_CFunction lua_getcfunction (lua_Object object);
66void *lua_getbinarydata (lua_Object object); 47void *lua_getbinarydata (lua_Object object);
67int lua_getbindatasize (lua_Object object); 48int lua_getbindatasize (lua_Object object);
68void *lua_getuserdata (lua_Object object);
69 49
70void lua_pushnil (void); 50void lua_pushnil (void);
71void lua_pushnumber (float n); 51void lua_pushnumber (float n);
@@ -98,11 +78,14 @@ lua_Object lua_createtable (void);
98 78
99#define lua_register(n,f) (lua_pushcfunction(f), lua_storeglobal(n)) 79#define lua_register(n,f) (lua_pushcfunction(f), lua_storeglobal(n))
100 80
101#define lua_pushuserdata(u) lua_pushusertag(u, LUA_T_USERDATA) 81#define lua_pushuserdata(u) lua_pushusertag(u, 0)
82
102 83
103 84
104/* for compatibility with old versions. Avoid using these macros */ 85/* for compatibility with old versions. Avoid using these macros */
105 86
87#define lua_getuserdata(o) (*(void **)lua_getbinarydata(o))
88
106#define lua_lockobject(o) lua_refobject(o,1) 89#define lua_lockobject(o) lua_refobject(o,1)
107#define lua_lock() lua_ref(1) 90#define lua_lock() lua_ref(1)
108#define lua_getlocked lua_getref 91#define lua_getlocked lua_getref