-/* $Id: isamb.h,v 1.7 2004-06-01 12:32:18 heikki Exp $
- Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003
+/* $Id: isamb.h,v 1.8 2004-06-01 12:56:38 adam Exp $
+ Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004
Index Data Aps
This file is part of the Zebra server.
-/* $Id: isamc.h,v 1.11 2003-06-23 15:36:11 adam Exp $
- Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003
+/* $Id: isamc.h,v 1.12 2004-06-01 12:56:38 adam Exp $
+ Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004
Index Data Aps
This file is part of the Zebra server.
ISAMC_filecat filecat;
int (*compare_item)(const void *a, const void *b);
+ void (*log_item)(int logmask, const void *p, const char *txt);
#define ISAMC_DECODE 0
#define ISAMC_ENCODE 1
/* $Id$
- Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003
+ Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004
Index Data Aps
This file is part of the Zebra server.
02111-1307, USA.
*/
-
-
#ifndef ISAMD_H
#define ISAMD_H
ISAMD_filecat filecat;
int (*compare_item)(const void *a, const void *b);
+ void (*log_item)(int logmask, const void *p, const char *txt);
#define ISAMD_DECODE 0
#define ISAMD_ENCODE 1
-/* $Id: isams.h,v 1.4 2003-06-23 15:36:11 adam Exp $
- Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003
+/* $Id: isams.h,v 1.5 2004-06-01 12:56:38 adam Exp $
+ Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004
Index Data Aps
This file is part of the Zebra server.
typedef struct ISAMS_M_s {
int (*compare_item)(const void *a, const void *b);
+ void (*log_item)(int logmask, const void *p, const char *txt);
#define ISAMC_DECODE 0
#define ISAMC_ENCODE 1
-/* $Id: kcompare.c,v 1.43 2004-06-01 12:32:18 heikki Exp $
+/* $Id: kcompare.c,v 1.44 2004-06-01 12:56:38 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004
Index Data Aps
isams_getmethod (me);
me->compare_item = key_compare;
+ me->log_item = key_logdump_txt;
me->code_start = iscz1_code_start;
me->code_item = iscz1_code_item;
isc_getmethod (me);
me->compare_item = key_compare;
+ me->log_item = key_logdump_txt;
me->code_start = iscz1_code_start;
me->code_item = iscz1_code_item;
me = isamd_getmethod (me);
me->compare_item = key_compare;
+ me->log_item = key_logdump_txt;
me->code_start = iscz1_code_start;
me->code_item = iscz1_code_item;
-/* $Id: isamb.c,v 1.29 2004-06-01 12:32:19 heikki Exp $
+/* $Id: isamb.c,v 1.30 2004-06-01 12:56:38 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004
Index Data Aps
#include <yaz/log.h>
#include <isamb.h>
#include <assert.h>
-#include <../index/index.h> /* for log_keydump. Debugging only */
struct ISAMB_head {
int first_block;
if (!p)
return 0;
logf(LOG_DEBUG,"isamb_pp_forward starting [%p] p=%d",pp,p->pos);
- key_logdump_txt(LOG_DEBUG, untilbuf," until");
- key_logdump_txt(LOG_DEBUG, buf, " buf");
+
+ (*pp->isamb->method->log_item)(LOG_DEBUG, untilbuf, "until");
+ (*pp->isamb->method->log_item)(LOG_DEBUG, buf, "buf");
+
while (1)
{
while ( p->offset == p->size)
{
src = p->bytes + p->offset;
decode_ptr(&src, &item_len);
- key_logdump_txt(LOG_DEBUG, src, " isamb_pp_forward climb skipping old key");
+
+ (*pp->isamb->method->log_item)(LOG_DEBUG, src,
+ " isamb_pp_forward "
+ "climb skipping old key");
src += item_len;
decode_ptr(&src,&pos);
p->offset = src - (char*) p->bytes;
decode_ptr(&src, &item_len);
logf(LOG_DEBUG,"isamb_pp_forward (B) on a high node. ofs=%d sz=%d nxtpos=%d ",
p->offset,p->size,pos);
- key_logdump(LOG_DEBUG, src);
+
+
+ (*pp->isamb->method->log_item)(LOG_DEBUG, src, "");
if (untilbuf)
cmp=(*pp->isamb->method->compare_item)(untilbuf,src);
else
cmp=-2;
logf(LOG_DEBUG,"isamb_pp_forward on a leaf. cmp=%d",
cmp);
- key_logdump(LOG_DEBUG, buf);
+ (*pp->isamb->method->log_item)(LOG_DEBUG, buf, "");
+
if (cmp <2)
{
if (untilbuf)
- key_logdump_txt(LOG_DEBUG, buf,
- "isamb_pp_forward returning 1");
+ {
+ (*pp->isamb->method->log_item)(LOG_DEBUG, buf,
+ "isamb_pp_forward returning 1");
+ }
else
- key_logdump_txt(LOG_DEBUG, buf,
- "isamb_pp_read returning 1 (fwd)");
+ {
+ (*pp->isamb->method->log_item)(LOG_DEBUG, buf,
+ "isamb_pp_read returning 1 (fwd)");
+ }
pp->returned_numbers++;
return 1;
}
-/* $Id: isamc.c,v 1.23 2003-06-23 15:36:11 adam Exp $
+/* $Id: isamc.c,v 1.24 2004-06-01 12:56:39 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003
Index Data Aps
m->code_reset = NULL;
m->compare_item = NULL;
+ m->log_item = NULL;
m->debug = 1;
-/* $Id: isamd.c,v 1.26 2003-06-23 15:36:11 adam Exp $
+/* $Id: isamd.c,v 1.27 2004-06-01 12:56:39 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003
Index Data Aps
m->code_reset = NULL;
m->compare_item = NULL;
+ m->log_item = NULL;
m->debug = 0; /* default to no debug */
-/* $Id: isams.c,v 1.4 2003-06-23 15:36:12 adam Exp $
+/* $Id: isams.c,v 1.5 2004-06-01 12:56:39 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003
Index Data Aps
m->code_stop = NULL;
m->compare_item = NULL;
+ m->log_item = NULL;
m->debug = 1;
m->block_size = 128;