2 * Copyright (C) 1994-1999, Index Data
4 * Sebastian Hammer, Adam Dickmeiss
7 * Revision 1.1 1999-03-09 13:07:06 adam
8 * Work on dict_compact routine.
19 int dict_compact (BFiles bfs, const char *from_name, const char *to_name)
25 from = dict_open (bfs, from_name, 0, 0);
28 map = xmalloc ((from->head.last+1) * sizeof(*map));
29 for (i = 0; i <= from->head.last; i++)
31 to = dict_open (bfs, to_name, 0, 1);
35 map[1] = DICT_pagesize(from);
37 for (i = 1; i < from->head.last; i++)
40 logf (LOG_LOG, "map[%d] = %d", i, map[i]);
41 dict_bf_readp (from->dbf, i, &buf);
42 map[i+1] = map[i] + DICT_size(buf);
43 no_dir += DICT_nodir(buf);
45 logf (LOG_LOG, "map[%d] = %d", i, map[i]);
46 logf (LOG_LOG, "nodir = %d", no_dir);