#ifndef __WORDTABLE_H__
#define __WORDTABLE_H__

/*
 * wordtable.h
 *
 * Routines for maintaining an alphabetized table of words with frequency
 * counts.
 *
 * Written by R. Bjork - last revised 02/03/1993
 * Modified by J. Senning - 01/24/1998
 * Modified by J. Senning - 01/06/2000
 * 	- Only reformating changes.
 */

#define WORDLEN 20    /* Max length of a word - not including trailing null */

typedef char WORD[WORDLEN+1];

typedef struct node
{
    WORD word;
    int frequency;
    struct node *lchild, *rchild;
} node, *nodeptr;

nodeptr lookup( WORD );	/* Lookup a word in table - return a pointer to its
			   node if found, else NULL */
void insert( WORD );	/* Add a word to table (must not be already there). */
void printwords();	/* Print out contents of the table */

#endif /* __WORDTABLE_H__ */
