aboutsummaryrefslogtreecommitdiff
path: root/tree.h
blob: 15b77b5f5977f62e0c7b76d350daa0cb3a45267e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/*
** tree.h
** TecCGraf - PUC-Rio
** $Id: tree.h,v 1.16 1997/03/19 19:41:10 roberto Exp roberto $
*/

#ifndef tree_h
#define tree_h

#include "types.h"

#define NOT_USED  0xFFFE


typedef struct TaggedString
{
  int tag;  /* if != LUA_T_STRING, this is a userdata */
  struct TaggedString *next;
  long size;
  Word varindex;  /* != NOT_USED  if this is a symbol */
  Word constindex;  /* != NOT_USED  if this is a constant */
  unsigned long hash;  /* 0 if not initialized */
  int marked;   /* for garbage collection; never collect (nor change) if > 1 */
  char str[1];   /* \0 byte already reserved; MAY BE NOT 0 TERMINATED!! */
} TaggedString;
 

TaggedString *lua_createstring (char *str);
TaggedString *luaI_createuserdata (char *buff, long size, int tag);
TaggedString *luaI_strcollector (long *cont);
void luaI_strfree (TaggedString *l);
void luaI_strcallIM (TaggedString *l);

#endif