Fixed filtered %, and msg on sort.
#include <stdio.h>
#include "dictre.h"
extern int nwords;
extern int ndefs;
int main(int argn, char **argv)
{
char tmpname[500];
FILE *i, *d;
if (argn < 4)
{
fprintf(stderr, "usage: %s <dict_basename> "
"<dict_basename_out> <filter>\n",
argv[0]);
return 1;
}
strcpy(tmpname, argv[1]);
strcat(tmpname, ".index");
i = fopen(tmpname, "r");
if(i == NULL)
{
fprintf(stderr, "File: %s ", tmpname);
perror("- cannot open file.");
exit(-1);
}
strcpy(tmpname, argv[1]);
strcat(tmpname, ".dict");
d = fopen(tmpname, "r");
if(d == NULL)
{
fprintf(stderr, "File: %s ", tmpname);
perror("- cannot open file.");
exit(-1);
}
load_init();
load_dictionary(i, d);
fclose(i);
fclose(d);
sort_words();
if (0)
print_words();
filter_all(argv[3]);
write_dictionary(argv[2]);
return 0;
}