-/* $Id: dcompact.c,v 1.8 2002-08-02 19:26:55 adam Exp $
- Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002
- Index Data Aps
+/* $Id: dcompact.c,v 1.13 2005-01-15 19:38:21 adam Exp $
+ Copyright (C) 1995-2005
+ Index Data ApS
This file is part of the Zebra server.
#include <string.h>
#include <stdio.h>
-#include <yaz/log.h>
-#include <dict.h>
+#include "dict-p.h"
static void dict_copy_page(Dict dict, char *to_p, char *from_p, int *map)
{
int no_dir = 0;
Dict dict_from, dict_to;
int *map, i;
- dict_from = dict_open (bfs, from_name, 0, 0, 0);
+ dict_from = dict_open (bfs, from_name, 0, 0, 0, 4096);
if (!dict_from)
return -1;
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);
+ dict_to = dict_open (bfs, to_name, 0, 1, 1, 4096);
if (!dict_to)
return -1;
map[0] = 0;
void *buf;
int size;
#if 0
- logf (LOG_LOG, "map[%d] = %d", i, map[i]);
+ yaz_log (YLOG_LOG, "map[%d] = %d", i, map[i]);
#endif
dict_bf_readp (dict_from->dbf, i, &buf);
size = ((DICT_size(buf)+sizeof(short)-1)/sizeof(short) +
no_dir += DICT_nodir(buf);
}
#if 0
- logf (LOG_LOG, "map[%d] = %d", i, map[i]);
- logf (LOG_LOG, "nodir = %d", no_dir);
+ yaz_log (YLOG_LOG, "map[%d] = %d", i, map[i]);
+ yaz_log (YLOG_LOG, "nodir = %d", no_dir);
#endif
dict_to->head.root = map[1];
dict_to->head.last = map[i];
void *old_p, *new_p;
dict_bf_readp (dict_from->dbf, i, &old_p);
- logf (LOG_LOG, "dict_bf_newp no=%d size=%d", map[i],
+ yaz_log (YLOG_LOG, "dict_bf_newp no=%d size=%d", map[i],
map[i+1] - map[i]);
dict_bf_newp (dict_to->dbf, map[i], &new_p, map[i+1] - map[i]);