2 * Copyright (C) 1994-1999, Index Data
4 * Sebastian Hammer, Adam Dickmeiss
7 * Revision 1.3 1999-05-12 13:08:06 adam
8 * First version of ISAMS.
10 * Revision 1.2 1999/03/09 16:27:49 adam
11 * More work on SDRKit integration.
13 * Revision 1.1 1999/03/09 13:07:06 adam
14 * Work on dict_compact routine.
25 int dict_compact (BFiles bfs, const char *from_name, const char *to_name)
30 from = dict_open (bfs, from_name, 0, 0);
33 map = xmalloc ((from->head.last+1) * sizeof(*map));
34 for (i = 0; i <= (int) (from->head.last); i++)
36 to = dict_open (bfs, to_name, 0, 1);
40 map[1] = DICT_pagesize(from);
42 for (i = 1; i < (int) (from->head.last); i++)
45 logf (LOG_LOG, "map[%d] = %d", i, map[i]);
46 dict_bf_readp (from->dbf, i, &buf);
47 map[i+1] = map[i] + DICT_size(buf);
48 no_dir += DICT_nodir(buf);
50 logf (LOG_LOG, "map[%d] = %d", i, map[i]);
51 logf (LOG_LOG, "nodir = %d", no_dir);