* Sebastian Hammer, Adam Dickmeiss
*
* $Log: dcompact.c,v $
- * Revision 1.4 1999-05-15 14:36:37 adam
+ * Revision 1.7 1999-11-30 13:48:03 adam
+ * Improved installation. Updated for inclusion of YAZ header files.
+ *
+ * Revision 1.6 1999/09/07 08:13:08 adam
+ * Removed log messages.
+ *
+ * Revision 1.5 1999/05/26 07:49:12 adam
+ * C++ compilation.
+ *
+ * Revision 1.4 1999/05/15 14:36:37 adam
* Updated dictionary. Implemented "compression" of dictionary.
*
* Revision 1.3 1999/05/12 13:08:06 adam
#include <string.h>
#include <stdio.h>
-#include <log.h>
+#include <yaz/log.h>
#include <dict.h>
static void dict_copy_page(Dict dict, char *to_p, char *from_p, int *map)
dict_from = dict_open (bfs, from_name, 0, 0, 0);
if (!dict_from)
return -1;
- map = xmalloc ((dict_from->head.last+1) * sizeof(*map));
+ map = (int *) xmalloc ((dict_from->head.last+1) * sizeof(*map));
for (i = 0; i <= (int) (dict_from->head.last); i++)
map[i] = -1;
dict_to = dict_open (bfs, to_name, 0, 1, 1);
map[i+1] = map[i] + size;
no_dir += DICT_nodir(buf);
}
+#if 0
logf (LOG_LOG, "map[%d] = %d", i, map[i]);
logf (LOG_LOG, "nodir = %d", no_dir);
+#endif
dict_to->head.root = map[1];
dict_to->head.last = map[i];
for (i = 1; i< (int) (dict_from->head.last); i++)
DICT_backptr(new_p) = map[i-1];
DICT_bsize(new_p) = map[i+1] - map[i];
- dict_copy_page(dict_from, new_p, old_p, map);
+ dict_copy_page(dict_from, (char*) new_p, (char*) old_p, map);
}
dict_close (dict_from);
dict_close (dict_to);