1994-07-19 14:24:17 -07:00
|
|
|
/*
|
|
|
|
** tree.h
|
|
|
|
** TecCGraf - PUC-Rio
|
1997-06-09 10:28:14 -07:00
|
|
|
** $Id: tree.h,v 1.17 1997/05/14 18:38:29 roberto Exp roberto $
|
1994-07-19 14:24:17 -07:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef tree_h
|
|
|
|
#define tree_h
|
|
|
|
|
1994-12-20 13:20:36 -08:00
|
|
|
#include "types.h"
|
1994-07-19 14:24:17 -07:00
|
|
|
|
1994-11-23 06:32:00 -08:00
|
|
|
#define NOT_USED 0xFFFE
|
1994-07-19 14:24:17 -07:00
|
|
|
|
|
|
|
|
1994-11-23 06:32:00 -08:00
|
|
|
typedef struct TaggedString
|
|
|
|
{
|
1997-02-11 03:40:01 -08:00
|
|
|
int tag; /* if != LUA_T_STRING, this is a userdata */
|
1997-05-14 11:38:29 -07:00
|
|
|
struct TaggedString *next;
|
1997-06-09 10:28:14 -07:00
|
|
|
union {
|
|
|
|
struct {
|
|
|
|
Word varindex; /* != NOT_USED if this is a symbol */
|
|
|
|
Word constindex; /* != NOT_USED if this is a constant */
|
|
|
|
} s;
|
|
|
|
void *v; /* if this is a userdata, here is its value */
|
|
|
|
} u;
|
1994-11-25 11:27:03 -08:00
|
|
|
unsigned long hash; /* 0 if not initialized */
|
1996-02-14 05:35:51 -08:00
|
|
|
int marked; /* for garbage collection; never collect (nor change) if > 1 */
|
1997-06-09 10:28:14 -07:00
|
|
|
char str[1]; /* \0 byte already reserved */
|
1994-11-23 06:32:00 -08:00
|
|
|
} TaggedString;
|
1994-11-14 13:40:14 -08:00
|
|
|
|
|
|
|
|
1994-11-23 06:32:00 -08:00
|
|
|
TaggedString *lua_createstring (char *str);
|
1997-06-09 10:28:14 -07:00
|
|
|
TaggedString *luaI_createudata (void *udata, int tag);
|
1997-05-14 11:38:29 -07:00
|
|
|
TaggedString *luaI_strcollector (long *cont);
|
|
|
|
void luaI_strfree (TaggedString *l);
|
|
|
|
void luaI_strcallIM (TaggedString *l);
|
1994-07-19 14:24:17 -07:00
|
|
|
|
|
|
|
#endif
|