Advertisement
Guest User

Untitled

a guest
Feb 16th, 2013
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. /****************************************************************************
  2. * dictionary.h
  3. *
  4. * Computer Science 50
  5. * Problem Set 5
  6. *
  7. * Declares a dictionary's functionality.
  8. ***************************************************************************/
  9.  
  10. #ifndef DICTIONARY_H
  11. #define DICTIONARY_H
  12.  
  13. #include <stdbool.h>
  14.  
  15. // maximum length for a word
  16. // (e.g., pneumonoultramicroscopicsilicovolcanoconiosis)
  17. #define LENGTH 45
  18. #define LLLength 27
  19.  
  20. typedef struct dict_node{
  21. char word[LENGTH];
  22. struct dict_node *next;
  23. } dict_node;
  24.  
  25. /**
  26. * Returns true if word is in dictionary else false.
  27. */
  28. bool check(const char* word);
  29.  
  30. /**
  31. * Loads dictionary into memory. Returns true if successful else false.
  32. */
  33. bool load(const char* dictionary);
  34.  
  35. /**
  36. * Returns number of words in dictionary if loaded else 0 if not yet loaded.
  37. */
  38. unsigned int size(void);
  39.  
  40. /**
  41. * Unloads dictionary from memory. Returns true if successful else false.
  42. */
  43. bool unload(void);
  44.  
  45. #endif // DICTIONARY_H
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement