aboutsummaryrefslogtreecommitdiff
path: root/lua.h
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>1996-04-22 15:00:37 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>1996-04-22 15:00:37 -0300
commit0ef5cf22891c9d34a88ccc5d89eb0ed82b004471 (patch)
tree1a095acefa978d5a41f32ff7d0fef58a642aa66c /lua.h
parentfed9408ab51a4be5ff84450ad47d1e0cdaed97bc (diff)
downloadlua-0ef5cf22891c9d34a88ccc5d89eb0ed82b004471.tar.gz
lua-0ef5cf22891c9d34a88ccc5d89eb0ed82b004471.tar.bz2
lua-0ef5cf22891c9d34a88ccc5d89eb0ed82b004471.zip
lock mechanism seperseded by the REFERENCE mechanism.
Diffstat (limited to 'lua.h')
-rw-r--r--lua.h21
1 files changed, 15 insertions, 6 deletions
diff --git a/lua.h b/lua.h
index 32cfac31..5738a619 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.24 1996/03/19 22:28:37 roberto Exp roberto $ 5** $Id: lua.h,v 3.25 1996/03/21 21:30:29 roberto Exp roberto $
6*/ 6*/
7 7
8 8
@@ -80,17 +80,20 @@ lua_Object lua_getsubscript (void);
80 80
81int lua_type (lua_Object object); 81int lua_type (lua_Object object);
82 82
83int lua_lock (void); 83
84lua_Object lua_getlocked (int ref); 84typedef int lua_Reference;
85void lua_pushlocked (int ref); 85
86void lua_unlock (int ref); 86lua_Reference lua_ref (int lock);
87lua_Object lua_getref (lua_Reference ref);
88void lua_pushref (lua_Reference ref);
89void lua_unref (lua_Reference ref);
87 90
88lua_Object lua_createtable (void); 91lua_Object lua_createtable (void);
89 92
90 93
91/* some useful macros */ 94/* some useful macros */
92 95
93#define lua_lockobject(o) (lua_pushobject(o), lua_lock()) 96#define lua_refobject(o,l) (lua_pushobject(o), lua_ref(l))
94 97
95#define lua_register(n,f) (lua_pushcfunction(f), lua_storeglobal(n)) 98#define lua_register(n,f) (lua_pushcfunction(f), lua_storeglobal(n))
96 99
@@ -99,6 +102,12 @@ lua_Object lua_createtable (void);
99 102
100/* for compatibility with old versions. Avoid using these macros */ 103/* for compatibility with old versions. Avoid using these macros */
101 104
105#define lua_lockobject(o) lua_refobject(o,1)
106#define lua_lock() lua_ref(1)
107#define lua_getlocked lua_getref
108#define lua_pushlocked lua_pushref
109#define lua_unlock lua_unref
110
102#define lua_pushliteral(o) lua_pushstring(o) 111#define lua_pushliteral(o) lua_pushstring(o)
103 112
104#define lua_getindexed(o,n) (lua_pushobject(o), lua_pushnumber(n), lua_getsubscript()) 113#define lua_getindexed(o,n) (lua_pushobject(o), lua_pushnumber(n), lua_getsubscript())