Imported from ../lua-3.0.tar.gz.
[lua.git] / src / tree.h
blob22b81ae874c8c384e84743138da31b071376002b
1 /*
2 ** tree.h
3 ** TecCGraf - PUC-Rio
4 ** $Id: tree.h,v 1.18 1997/06/09 17:28:14 roberto Exp $
5 */
7 #ifndef tree_h
8 #define tree_h
10 #include "types.h"
12 #define NOT_USED 0xFFFE
15 typedef struct TaggedString
17 int tag; /* if != LUA_T_STRING, this is a userdata */
18 struct TaggedString *next;
19 union {
20 struct {
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;
26 unsigned long hash; /* 0 if not initialized */
27 int marked; /* for garbage collection; never collect (nor change) if > 1 */
28 char str[1]; /* \0 byte already reserved */
29 } TaggedString;
32 TaggedString *lua_createstring (char *str);
33 TaggedString *luaI_createudata (void *udata, int tag);
34 TaggedString *luaI_strcollector (long *cont);
35 void luaI_strfree (TaggedString *l);
36 void luaI_strcallIM (TaggedString *l);
38 #endif