tree.h 949 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. /*
  2. ** tree.h
  3. ** TecCGraf - PUC-Rio
  4. ** $Id: tree.h,v 1.17 1997/05/14 18:38:29 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. union {
  15. struct {
  16. Word varindex; /* != NOT_USED if this is a symbol */
  17. Word constindex; /* != NOT_USED if this is a constant */
  18. } s;
  19. void *v; /* if this is a userdata, here is its value */
  20. } u;
  21. unsigned long hash; /* 0 if not initialized */
  22. int marked; /* for garbage collection; never collect (nor change) if > 1 */
  23. char str[1]; /* \0 byte already reserved */
  24. } TaggedString;
  25. TaggedString *lua_createstring (char *str);
  26. TaggedString *luaI_createudata (void *udata, int tag);
  27. TaggedString *luaI_strcollector (long *cont);
  28. void luaI_strfree (TaggedString *l);
  29. void luaI_strcallIM (TaggedString *l);
  30. #endif