7 * Use this to start making an index for a new dictionary.
8 * Get the dictionary-specific nextoff and printentry(_,'h')
9 * commands working, add a record to the dicts[] array below,
10 * and run this program to get a list of offset,headword
15 Biobuf *bout = &boutbuf;
21 Dict *dict; /* current dictionary */
26 main(int argc, char **argv)
33 Binit(&boutbuf, 1, OWRITE);
40 for(i=0; dicts[i].name; i++)
41 if(strcmp(p, dicts[i].name)==0) {
47 err("unknown dictionary: %s", p);
56 bdict = Bopen(dict->path, OREAD);
57 ae = Bseek(bdict, 0, 2);
59 err("can't open dictionary %s", dict->path);
62 for(a = 0; a < ae; a = (*dict->nextoff)(a+1)) {
65 Bprint(bout, "%ld\t", a);
66 linelen = 4; /* only has to be approx right */
67 (*dict->printentry)(e, 'h');
77 static int anslen = 0;
79 e = (*dict->nextoff)(b+1);
82 dtop = Bseek(bdict, 0L, 2);
86 err("couldn't seek to entry");
94 ans.start = realloc(ans.start, n);
102 n = Bread(bdict, ans.start, n);
103 ans.end = ans.start + n;