/*
 * Faculty of Applied Science and Engineering, University of Toronto
 * CSC181: Introduction to Computer Programming, Fall 2000
 *
 * Assignment: 3
 * File: dictionary.h
 * Author: Ray Ortigas (rayo@dgp.toronto.edu)
 * Contains: Typedefs and function prototypes for Dictionary module.
 */

#include "bst.h"
#include "list.h"
#include "utility.h"

/*
 * Represents an English dictionary.
 */
struct dictionary {

	/* The entries of this dictionary, stored in a binary search tree. */
	BSTPtr entries;
};
typedef struct dictionary Dictionary;
typedef Dictionary* DictionaryPtr;

/* Returns an empty dictionary. */
DictionaryPtr dictionaryInit(void);

/* If no entry exists for word w in dictionary di, then an entry is
   added to di matching w to definition d. Otherwise, d is added to the
   list of definitions for w. */
void dictionaryPut
(DictionaryPtr di, const StringPtr w, const StringPtr d);

/* Returns the list of definitions for w if it has an entry in di, NULL
   otherwise. */
ListPtr dictionaryGetDefinitions
(DictionaryPtr di, const StringPtr w);
