Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Feb 16th, 2013  |  syntax: None  |  size: 1.01 KB  |  views: 29  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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