diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1997-06-09 14:28:14 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1997-06-09 14:28:14 -0300 |
commit | dd22ea4da550c3a158e0f11b928c349336184f85 (patch) | |
tree | b73e2ae0498c4efa30dee04f710fb1a349f164ed /lua.h | |
parent | 5fdcfeb353d726a9bcd6d4db5dd0b62b9b8e4b02 (diff) | |
download | lua-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.h | 19 |
1 files changed, 11 insertions, 8 deletions
@@ -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 | |||
19 | typedef void (*lua_CFunction) (void); | 21 | typedef void (*lua_CFunction) (void); |
20 | typedef unsigned int lua_Object; | 22 | typedef unsigned int lua_Object; |
21 | 23 | ||
@@ -31,8 +33,6 @@ int lua_dofile (char *filename); /* Out: returns */ | |||
31 | int lua_dostring (char *string); /* Out: returns */ | 33 | int lua_dostring (char *string); /* Out: returns */ |
32 | int lua_callfunction (lua_Object f); | 34 | int lua_callfunction (lua_Object f); |
33 | /* In: parameters; Out: returns */ | 35 | /* In: parameters; Out: returns */ |
34 | int lua_call (char *funcname); | ||
35 | /* In: parameters; Out: returns */ | ||
36 | 36 | ||
37 | void lua_beginblock (void); | 37 | void lua_beginblock (void); |
38 | void lua_endblock (void); | 38 | void lua_endblock (void); |
@@ -52,17 +52,16 @@ int lua_isfunction (lua_Object object); | |||
52 | float lua_getnumber (lua_Object object); | 52 | float lua_getnumber (lua_Object object); |
53 | char *lua_getstring (lua_Object object); | 53 | char *lua_getstring (lua_Object object); |
54 | lua_CFunction lua_getcfunction (lua_Object object); | 54 | lua_CFunction lua_getcfunction (lua_Object object); |
55 | void *lua_getbindata (lua_Object object); | ||
56 | int lua_getbindatasize (lua_Object object); | ||
57 | 55 | ||
58 | void lua_pushnil (void); | 56 | void lua_pushnil (void); |
59 | void lua_pushnumber (float n); | 57 | void lua_pushnumber (float n); |
60 | void lua_pushstring (char *s); | 58 | void lua_pushstring (char *s); |
61 | void lua_pushcfunction (lua_CFunction fn); | 59 | void lua_pushcfunction (lua_CFunction fn); |
62 | void lua_pushbindata (void *buff, int size, int tag); | 60 | void lua_pushusertag (void *u, int tag); |
63 | void lua_pushusertag (void *u, int tag); | ||
64 | void lua_pushobject (lua_Object object); | 61 | void lua_pushobject (lua_Object object); |
65 | 62 | ||
63 | lua_Object lua_pop (void); | ||
64 | |||
66 | lua_Object lua_getglobal (char *name); | 65 | lua_Object lua_getglobal (char *name); |
67 | lua_Object lua_rawgetglobal (char *name); | 66 | lua_Object lua_rawgetglobal (char *name); |
68 | void lua_setglobal (char *name); /* In: value */ | 67 | void lua_setglobal (char *name); /* In: value */ |
@@ -82,6 +81,8 @@ void lua_unref (int ref); | |||
82 | 81 | ||
83 | lua_Object lua_createtable (void); | 82 | lua_Object lua_createtable (void); |
84 | 83 | ||
84 | lua_Object lua_getudata (void *u, int tag); | ||
85 | |||
85 | 86 | ||
86 | long lua_collectgarbage (long limit); | 87 | long 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 | ||