aboutsummaryrefslogtreecommitdiff
path: root/tree.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 /tree.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 'tree.h')
-rw-r--r--tree.h16
1 files changed, 10 insertions, 6 deletions
diff --git a/tree.h b/tree.h
index 15b77b5f..0b501918 100644
--- a/tree.h
+++ b/tree.h
@@ -1,7 +1,7 @@
1/* 1/*
2** tree.h 2** tree.h
3** TecCGraf - PUC-Rio 3** TecCGraf - PUC-Rio
4** $Id: tree.h,v 1.16 1997/03/19 19:41:10 roberto Exp roberto $ 4** $Id: tree.h,v 1.17 1997/05/14 18:38:29 roberto Exp roberto $
5*/ 5*/
6 6
7#ifndef tree_h 7#ifndef tree_h
@@ -16,17 +16,21 @@ typedef struct TaggedString
16{ 16{
17 int tag; /* if != LUA_T_STRING, this is a userdata */ 17 int tag; /* if != LUA_T_STRING, this is a userdata */
18 struct TaggedString *next; 18 struct TaggedString *next;
19 long size; 19 union {
20 Word varindex; /* != NOT_USED if this is a symbol */ 20 struct {
21 Word constindex; /* != NOT_USED if this is a constant */ 21 Word varindex; /* != NOT_USED if this is a symbol */
22 Word constindex; /* != NOT_USED if this is a constant */
23 } s;
24 void *v; /* if this is a userdata, here is its value */
25 } u;
22 unsigned long hash; /* 0 if not initialized */ 26 unsigned long hash; /* 0 if not initialized */
23 int marked; /* for garbage collection; never collect (nor change) if > 1 */ 27 int marked; /* for garbage collection; never collect (nor change) if > 1 */
24 char str[1]; /* \0 byte already reserved; MAY BE NOT 0 TERMINATED!! */ 28 char str[1]; /* \0 byte already reserved */
25} TaggedString; 29} TaggedString;
26 30
27 31
28TaggedString *lua_createstring (char *str); 32TaggedString *lua_createstring (char *str);
29TaggedString *luaI_createuserdata (char *buff, long size, int tag); 33TaggedString *luaI_createudata (void *udata, int tag);
30TaggedString *luaI_strcollector (long *cont); 34TaggedString *luaI_strcollector (long *cont);
31void luaI_strfree (TaggedString *l); 35void luaI_strfree (TaggedString *l);
32void luaI_strcallIM (TaggedString *l); 36void luaI_strcallIM (TaggedString *l);