aboutsummaryrefslogtreecommitdiff
path: root/tree.h
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>1997-02-11 09:40:01 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>1997-02-11 09:40:01 -0200
commit205ee1ec84c0f0e9c2df923fdcfa29207e8e72b3 (patch)
tree1e2683e673e5fbf2230343df4faac3b252eee38c /tree.h
parentb48847c5fac055f0d6120029f6fe1a50c852a8ac (diff)
downloadlua-205ee1ec84c0f0e9c2df923fdcfa29207e8e72b3.tar.gz
lua-205ee1ec84c0f0e9c2df923fdcfa29207e8e72b3.tar.bz2
lua-205ee1ec84c0f0e9c2df923fdcfa29207e8e72b3.zip
userdata can handle arbitrary binary data;
user tag is stored with data;
Diffstat (limited to 'tree.h')
-rw-r--r--tree.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/tree.h b/tree.h
index ebdad6e0..4f2212b4 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.13 1996/02/14 13:35:51 roberto Exp roberto $ 4** $Id: tree.h,v 1.14 1996/02/26 17:07:49 roberto Exp roberto $
5*/ 5*/
6 6
7#ifndef tree_h 7#ifndef tree_h
@@ -14,15 +14,18 @@
14 14
15typedef struct TaggedString 15typedef struct TaggedString
16{ 16{
17 int tag; /* if != LUA_T_STRING, this is a userdata */
18 long size;
17 Word varindex; /* != NOT_USED if this is a symbol */ 19 Word varindex; /* != NOT_USED if this is a symbol */
18 Word constindex; /* != NOT_USED if this is a constant */ 20 Word constindex; /* != NOT_USED if this is a constant */
19 unsigned long hash; /* 0 if not initialized */ 21 unsigned long hash; /* 0 if not initialized */
20 int marked; /* for garbage collection; never collect (nor change) if > 1 */ 22 int marked; /* for garbage collection; never collect (nor change) if > 1 */
21 char str[1]; /* \0 byte already reserved */ 23 char str[1]; /* \0 byte already reserved; MAY BE NOT 0 TERMINATED!! */
22} TaggedString; 24} TaggedString;
23 25
24 26
25TaggedString *lua_createstring (char *str); 27TaggedString *lua_createstring (char *str);
28TaggedString *luaI_createuserdata (char *buff, long size, int tag);
26Long lua_strcollector (void); 29Long lua_strcollector (void);
27 30
28#endif 31#endif