// Definitions for a dictionary typedef struct { char *word; int id; } WORD_ID; typedef struct { int nwords, nmax; WORD_ID *words; char **inverse; } DICTIONARY; DICTIONARY *NewDictionary( const int size ); int widcmp( const void *a, const void *b ); int UpdateDictionary( char *word, DICTIONARY *dict); int LookupDictionary( char *word, DICTIONARY *dict); char *InverseLookupDictionary( int id, DICTIONARY *dict ); int WriteBinaryDictionary( FILE *fp, DICTIONARY *d ); DICTIONARY *ReadBinaryDictionary( FILE *fp ); char *suffix( char *s, char sep ); char *prefix( char *s, char sep );