tree.h 894 B

12345678910111213141516171819202122232425262728293031323334
  1. /*
  2. ** tree.h
  3. ** TecCGraf - PUC-Rio
  4. ** $Id: tree.h,v 1.16 1997/03/19 19:41:10 roberto Exp roberto $
  5. */
  6. #ifndef tree_h
  7. #define tree_h
  8. #include "types.h"
  9. #define NOT_USED 0xFFFE
  10. typedef struct TaggedString
  11. {
  12. int tag; /* if != LUA_T_STRING, this is a userdata */
  13. struct TaggedString *next;
  14. long size;
  15. Word varindex; /* != NOT_USED if this is a symbol */
  16. Word constindex; /* != NOT_USED if this is a constant */
  17. unsigned long hash; /* 0 if not initialized */
  18. int marked; /* for garbage collection; never collect (nor change) if > 1 */
  19. char str[1]; /* \0 byte already reserved; MAY BE NOT 0 TERMINATED!! */
  20. } TaggedString;
  21. TaggedString *lua_createstring (char *str);
  22. TaggedString *luaI_createuserdata (char *buff, long size, int tag);
  23. TaggedString *luaI_strcollector (long *cont);
  24. void luaI_strfree (TaggedString *l);
  25. void luaI_strcallIM (TaggedString *l);
  26. #endif