blob: 19a732318f00689f10d8c51184fb3533d23f84d9 (
plain) (
tree)
|
|
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#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;
}
|