aboutsummaryrefslogtreecommitdiff
path: root/lua.h
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>1997-06-09 14:28:14 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>1997-06-09 14:28:14 -0300
commitdd22ea4da550c3a158e0f11b928c349336184f85 (patch)
treeb73e2ae0498c4efa30dee04f710fb1a349f164ed /lua.h
parent5fdcfeb353d726a9bcd6d4db5dd0b62b9b8e4b02 (diff)
downloadlua-dd22ea4da550c3a158e0f11b928c349336184f85.tar.gz
lua-dd22ea4da550c3a158e0f11b928c349336184f85.tar.bz2
lua-dd22ea4da550c3a158e0f11b928c349336184f85.zip
new implementation for udata (again they are just void *);
new implementation for the API: most operations now do not disturb structures lua2C and C2lua.
Diffstat (limited to 'lua.h')
-rw-r--r--lua.h19
1 files changed, 11 insertions, 8 deletions
diff --git a/lua.h b/lua.h
index dd766e5b..d183832f 100644
--- a/lua.h
+++ b/lua.h
@@ -2,7 +2,7 @@
2** LUA - An Extensible Extension Language 2** LUA - An Extensible Extension Language
3** TeCGraf: Grupo de Tecnologia em Computacao Grafica, PUC-Rio, Brazil 3** TeCGraf: Grupo de Tecnologia em Computacao Grafica, PUC-Rio, Brazil
4** e-mail: lua@tecgraf.puc-rio.br 4** e-mail: lua@tecgraf.puc-rio.br
5** $Id: lua.h,v 4.4 1997/05/26 14:42:51 roberto Exp roberto $ 5** $Id: lua.h,v 4.5 1997/06/06 20:54:40 roberto Exp roberto $
6*/ 6*/
7 7
8 8
@@ -16,6 +16,8 @@
16 16
17#define LUA_NOOBJECT 0 17#define LUA_NOOBJECT 0
18 18
19#define LUA_ANYTAG (-1)
20
19typedef void (*lua_CFunction) (void); 21typedef void (*lua_CFunction) (void);
20typedef unsigned int lua_Object; 22typedef unsigned int lua_Object;
21 23
@@ -31,8 +33,6 @@ int lua_dofile (char *filename); /* Out: returns */
31int lua_dostring (char *string); /* Out: returns */ 33int lua_dostring (char *string); /* Out: returns */
32int lua_callfunction (lua_Object f); 34int lua_callfunction (lua_Object f);
33 /* In: parameters; Out: returns */ 35 /* In: parameters; Out: returns */
34int lua_call (char *funcname);
35 /* In: parameters; Out: returns */
36 36
37void lua_beginblock (void); 37void lua_beginblock (void);
38void lua_endblock (void); 38void lua_endblock (void);
@@ -52,17 +52,16 @@ int lua_isfunction (lua_Object object);
52float lua_getnumber (lua_Object object); 52float lua_getnumber (lua_Object object);
53char *lua_getstring (lua_Object object); 53char *lua_getstring (lua_Object object);
54lua_CFunction lua_getcfunction (lua_Object object); 54lua_CFunction lua_getcfunction (lua_Object object);
55void *lua_getbindata (lua_Object object);
56int lua_getbindatasize (lua_Object object);
57 55
58void lua_pushnil (void); 56void lua_pushnil (void);
59void lua_pushnumber (float n); 57void lua_pushnumber (float n);
60void lua_pushstring (char *s); 58void lua_pushstring (char *s);
61void lua_pushcfunction (lua_CFunction fn); 59void lua_pushcfunction (lua_CFunction fn);
62void lua_pushbindata (void *buff, int size, int tag); 60void lua_pushusertag (void *u, int tag);
63void lua_pushusertag (void *u, int tag);
64void lua_pushobject (lua_Object object); 61void lua_pushobject (lua_Object object);
65 62
63lua_Object lua_pop (void);
64
66lua_Object lua_getglobal (char *name); 65lua_Object lua_getglobal (char *name);
67lua_Object lua_rawgetglobal (char *name); 66lua_Object lua_rawgetglobal (char *name);
68void lua_setglobal (char *name); /* In: value */ 67void lua_setglobal (char *name); /* In: value */
@@ -82,6 +81,8 @@ void lua_unref (int ref);
82 81
83lua_Object lua_createtable (void); 82lua_Object lua_createtable (void);
84 83
84lua_Object lua_getudata (void *u, int tag);
85
85 86
86long lua_collectgarbage (long limit); 87long lua_collectgarbage (long limit);
87 88
@@ -89,7 +90,9 @@ long lua_collectgarbage (long limit);
89/* =============================================================== */ 90/* =============================================================== */
90/* some useful macros */ 91/* some useful macros */
91 92
92#define lua_pushref(ref) (lua_pushobject(lua_getref(ref))) 93#define lua_call(name) lua_callfunction(lua_getglobal(name))
94
95#define lua_pushref(ref) lua_pushobject(lua_getref(ref))
93 96
94#define lua_refobject(o,l) (lua_pushobject(o), lua_ref(l)) 97#define lua_refobject(o,l) (lua_pushobject(o), lua_ref(l))
95 98