/*
 * Faculty of Applied Science and Engineering, University of Toronto
 * CSC181: Introduction to Computer Programming, Fall 2000
 *
 * Assignment: 3
 * File: dictionary.c
 * Author: Ray Ortigas (rayo@dgp.toronto.edu)
 * Contains: Function definitions for Dictionary module.
 */

#include <stdio.h>
#include <stdlib.h>
#include "dictionary.h"

/* Returns an empty dictionary. */
DictionaryPtr dictionaryInit(void) {
	DictionaryPtr result = malloc(sizeof(Dictionary));
	result->entries = bstInit(stringCompare);
	return result;
}

/* 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) {

	/* FIXME */
}

/* Returns the list of definitions for w if it has an entry in di, NULL
   otherwise. */
ListPtr dictionaryGetDefinitions
(DictionaryPtr di, const StringPtr w) {
	ListPtr result;

	/* FIXME
	 *
	 * Note: Just before this function returns, 'result' should contain
	 * the value to be returned by this function, as described in the
	 * function comment above.
	 */

	return result;
}
