/*********************************************** dictionary.h Started by Jeff Ondich on 5/8/97 Last modified 5/9/97 Interface for a simple dictionary data type. ***********************************************/ #ifndef DICTIONARY_H #define DICTIONARH_H /* This stuff is implementation-dependent. */ #define MAX_WORDS 100000 #define MAX_WORD_LENGTH 24 typedef char Word[MAX_WORD_LENGTH]; typedef struct { Word *entry; int nWords; } Dictionary; /* These are the implementation-independent prototypes. DO NOT CHANGE ANYTHING BELOW THIS POINT. */ enum { FALSE=0, TRUE }; typedef int boolean; /*************************************************** InitializeDictionary returns TRUE if d is non-NULL and initialization is successful, FALSE otherwise. ***************************************************/ boolean InitializeDictionary( Dictionary *d ); /*************************************************** AddToDictionary returns FALSE if d or newWord is NULL, if the dictionary is already full, or if adding to the dictionary fails. Otherwise, AddToDictionary adds newWord to the dictionary and returns TRUE. ***************************************************/ boolean AddToDictionary( Dictionary *d, char *newWord ); /*************************************************** IsInDictionary returns TRUE if d and searchWord are non-NULL and searchWord is in the dictionary. Otherwise, IsInDictionary returns FALSE. ***************************************************/ boolean IsInDictionary( Dictionary *d, char *searchWord ); /*************************************************** PrintDictionary prints out the dictionary in whatever form is appropriate for debugging. ***************************************************/ void PrintDictionary( FILE *f, Dictionary *d ); #endif