tree.h 773 B

12345678910111213141516171819202122232425262728293031
  1. /*
  2. ** tree.h
  3. ** TecCGraf - PUC-Rio
  4. ** $Id: tree.h,v 1.14 1996/02/26 17:07:49 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. long size;
  14. Word varindex; /* != NOT_USED if this is a symbol */
  15. Word constindex; /* != NOT_USED if this is a constant */
  16. unsigned long hash; /* 0 if not initialized */
  17. int marked; /* for garbage collection; never collect (nor change) if > 1 */
  18. char str[1]; /* \0 byte already reserved; MAY BE NOT 0 TERMINATED!! */
  19. } TaggedString;
  20. TaggedString *lua_createstring (char *str);
  21. TaggedString *luaI_createuserdata (char *buff, long size, int tag);
  22. Long lua_strcollector (void);
  23. #endif