#include #include #include #include "word.h" #include "hash.h" #include "def.h" #define MAXWORD 100 #define HASHSIZE 100 struct nlist *hashtab[HASHSIZE]; int main(void) { char word[MAXWORD]; struct nlist *np, *temp; while (getword(word, MAXWORD) != EOF) { if (!strcmp(word, "#")) { getdef(hashtab, HASHSIZE); } else if (!isalpha(word[0])) { printf("%s", word); } else if ((np = lookup(hashtab, HASHSIZE, word)) == NULL) { printf("%s", word); } else { ungetword(np->defn); } } hashfree(hashtab, HASHSIZE); return 0; }