hash.h 528 B

12345678910111213141516171819202122232425262728293031323334
  1. /*
  2. ** hash.h
  3. ** hash manager for lua
  4. ** Luiz Henrique de Figueiredo - 17 Aug 90
  5. ** $Id: $
  6. */
  7. #ifndef hash_h
  8. #define hash_h
  9. typedef struct node
  10. {
  11. Object ref;
  12. Object val;
  13. struct node *next;
  14. } Node;
  15. typedef struct Hash
  16. {
  17. char mark;
  18. unsigned int nhash;
  19. Node **list;
  20. } Hash;
  21. #define markarray(t) ((t)->mark)
  22. Hash *lua_hashcreate (unsigned int nhash);
  23. void lua_hashdelete (Hash *h);
  24. Object *lua_hashdefine (Hash *t, Object *ref);
  25. void lua_hashmark (Hash *h);
  26. void lua_next (void);
  27. #endif