diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1998-02-12 17:23:32 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1998-02-12 17:23:32 -0200 |
commit | f380d627f8f018e029c889e809f1c0f9cc6fc2e5 (patch) | |
tree | 2c16130cf50294a88be303e5ca42e502ee0eee7d /lua.h | |
parent | aafa106d108581ab8b259bfde3bcf1166a17c3e9 (diff) | |
download | lua-f380d627f8f018e029c889e809f1c0f9cc6fc2e5.tar.gz lua-f380d627f8f018e029c889e809f1c0f9cc6fc2e5.tar.bz2 lua-f380d627f8f018e029c889e809f1c0f9cc6fc2e5.zip |
usefull macros also available as functions
Diffstat (limited to 'lua.h')
-rw-r--r-- | lua.h | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lua.h,v 1.13 1998/01/02 17:46:32 roberto Exp roberto $ | 2 | ** $Id: lua.h,v 1.14 1998/01/07 16:26:48 roberto Exp roberto $ |
3 | ** Lua - An Extensible Extension Language | 3 | ** Lua - An Extensible Extension Language |
4 | ** TeCGraf: Grupo de Tecnologia em Computacao Grafica, PUC-Rio, Brazil | 4 | ** TeCGraf: Grupo de Tecnologia em Computacao Grafica, PUC-Rio, Brazil |
5 | ** e-mail: lua@tecgraf.puc-rio.br | 5 | ** e-mail: lua@tecgraf.puc-rio.br |
@@ -126,20 +126,27 @@ long lua_collectgarbage (long limit); | |||
126 | 126 | ||
127 | 127 | ||
128 | /* =============================================================== */ | 128 | /* =============================================================== */ |
129 | /* some useful macros */ | 129 | /* some useful macros/derived functions */ |
130 | 130 | ||
131 | int (lua_call) (char *name); | ||
131 | #define lua_call(name) lua_callfunction(lua_getglobal(name)) | 132 | #define lua_call(name) lua_callfunction(lua_getglobal(name)) |
132 | 133 | ||
134 | void (lua_pushref) (int ref); | ||
133 | #define lua_pushref(ref) lua_pushobject(lua_getref(ref)) | 135 | #define lua_pushref(ref) lua_pushobject(lua_getref(ref)) |
134 | 136 | ||
137 | int (lua_refobject) (lua_Object o, int l); | ||
135 | #define lua_refobject(o,l) (lua_pushobject(o), lua_ref(l)) | 138 | #define lua_refobject(o,l) (lua_pushobject(o), lua_ref(l)) |
136 | 139 | ||
140 | void (lua_register) (char *n, lua_CFunction f); | ||
137 | #define lua_register(n,f) (lua_pushcfunction(f), lua_setglobal(n)) | 141 | #define lua_register(n,f) (lua_pushcfunction(f), lua_setglobal(n)) |
138 | 142 | ||
143 | void (lua_pushuserdata) (void *u); | ||
139 | #define lua_pushuserdata(u) lua_pushusertag(u, 0) | 144 | #define lua_pushuserdata(u) lua_pushusertag(u, 0) |
140 | 145 | ||
146 | void (lua_pushcfunction) (lua_CFunction f); | ||
141 | #define lua_pushcfunction(f) lua_pushCclosure(f, 0) | 147 | #define lua_pushcfunction(f) lua_pushCclosure(f, 0) |
142 | 148 | ||
149 | int (lua_clonetag) (int t); | ||
143 | #define lua_clonetag(t) lua_copytagmethods(lua_newtag(), (t)) | 150 | #define lua_clonetag(t) lua_copytagmethods(lua_newtag(), (t)) |
144 | 151 | ||
145 | 152 | ||