2 * Copyright (C) 1994-1999, Index Data
4 * Sebastian Hammer, Adam Dickmeiss
7 * Revision 1.2 1999-03-09 16:27:49 adam
8 * More work on SDRKit integration.
10 * Revision 1.1 1999/03/09 13:07:06 adam
11 * Work on dict_compact routine.
22 int dict_compact (BFiles bfs, const char *from_name, const char *to_name)
28 from = dict_open (bfs, from_name, 0, 0);
31 map = xmalloc ((from->head.last+1) * sizeof(*map));
32 for (i = 0; i <= (int) (from->head.last); i++)
34 to = dict_open (bfs, to_name, 0, 1);
38 map[1] = DICT_pagesize(from);
40 for (i = 1; i < (int) (from->head.last); i++)
43 logf (LOG_LOG, "map[%d] = %d", i, map[i]);
44 dict_bf_readp (from->dbf, i, &buf);
45 map[i+1] = map[i] + DICT_size(buf);
46 no_dir += DICT_nodir(buf);
48 logf (LOG_LOG, "map[%d] = %d", i, map[i]);
49 logf (LOG_LOG, "nodir = %d", no_dir);