dictionary.h 482 B

12345678910111213141516171819202122
  1. #ifndef DICTIONARY_H
  2. #define DICTIONARY_H
  3. #include <stdlib.h>
  4. #define BIG_HASH_SIZE 20000
  5. #define SMALL_HASH_SIZE 100
  6. typedef struct d_node {
  7. char* key;
  8. struct d_node *next;
  9. }DNode;
  10. char * copystr (const char *);
  11. unsigned hash(const char *s);
  12. DNode * lookup (DNode ** dictionary, int hash_size, const char *key);
  13. DNode * insert (DNode ** dictionary, int hash_size, const char * key);
  14. void free_dictionary (DNode ** dictionary, int hash_size);
  15. #endif