blob: 57b562ae0a2bb11b921c0f645964b38f422e50cc (
plain) (
tree)
|
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include "word.h"
#include "tree.h"
#define MAXWORD 100
#define DEFLEN 6
int main(int argc, char *argv[])
{
struct tnode *root;
char word[MAXWORD];
int bar;
bar = (--argc && (**++argv == '-')) ? atoi(argv[0]+1) : DEFLEN;
root = NULL;
while (getword(word, MAXWORD) != EOF)
if ((isalpha(word[0]) || (word[0] == '#' && isalpha(word[1]))) &&
strlen(word) > (size_t) bar)
root = naddtree(root, word, bar, NO);
ntreeprint(root);
treefree(root);
return 0;
}
|