-/* $Id: isamb.h,v 1.11 2004-08-04 08:35:23 adam Exp $
+/* $Id: isamb.h,v 1.12 2004-08-04 09:59:03 heikki Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004
Index Data Aps
int isamb_pp_forward (ISAMB_PP pp, void *buf, const void *untilbuf);
-void isamb_pp_pos (ISAMB_PP pp, int *current, int *total);
+void isamb_pp_pos (ISAMB_PP pp, zint *current, zint *total);
void isamb_pp_close (ISAMB_PP pp);
-/* $Id: rset.h,v 1.23 2004-08-03 14:54:41 heikki Exp $
+/* $Id: rset.h,v 1.24 2004-08-04 09:59:03 heikki Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002
Index Data Aps
int (*f_forward)(RSET ct, RSFD rfd, void *buf, int *term_index,
int (*cmpfunc)(const void *p1, const void *p2),
const void *untilbuf);
- void (*f_pos)(RSFD rfd, int *current, int *total);
- /* FIXME - Should be 64-bit ints !*/
+ void (*f_pos)(RSFD rfd, zint *current, zint *total);
/* returns -1,-1 if pos function not implemented for this type */
int (*f_read)(RSFD rfd, void *buf, int *term_index);
int (*f_write)(RSFD rfd, const void *buf);
int rset_default_forward(RSET ct, RSFD rfd, void *buf, int *term_index,
int (*cmpfunc)(const void *p1, const void *p2),
const void *untilbuf);
-void rset_default_pos(RSFD rfd, int *current, int *total);
+void rset_default_pos(RSFD rfd, zint *current, zint *total);
struct rset_term {
char *name;
-/* $Id: isamb.c,v 1.48 2004-08-04 08:35:24 adam Exp $
+/* $Id: isamb.c,v 1.49 2004-08-04 09:59:03 heikki Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004
Index Data Aps
}
static void isamb_pp_leaf_pos( ISAMB_PP pp,
- int *current, int *total, void *dummybuf )
+ zint *current, zint *total, void *dummybuf )
{
struct ISAMB_block *p = pp->block[pp->level];
const char *src=p->bytes;
if (src<=cur)
(*current)++;
}
- logf(LOG_DEBUG, "isamb_pp_leaf_pos: cur=%d tot=%d ofs=%d sz=%d lev=%d",
+ logf(LOG_DEBUG, "isamb_pp_leaf_pos: cur="ZINT_FORMAT" tot="ZINT_FORMAT
+ " ofs=%d sz=%d lev=%d",
*current, *total, p->offset, p->size, pp->level);
assert(src==end);
}
-static void isamb_pp_upper_pos( ISAMB_PP pp, int *current, int *total,
- int size, int level )
+static void isamb_pp_upper_pos( ISAMB_PP pp, zint *current, zint *total,
+ zint size, int level )
{ /* estimates total/current occurrences from here up, excl leaf */
struct ISAMB_block *p = pp->block[level];
const char *src=p->bytes;
assert(level>=0);
assert(!p->leaf);
logf(LOG_DEBUG,"isamb_pp_upper_pos at beginning l=%d "
- "cur=%d tot=%d ofs=%d sz=%d pos=" ZINT_FORMAT,
+ "cur="ZINT_FORMAT" tot="ZINT_FORMAT
+ " ofs=%d sz=%d pos=" ZINT_FORMAT,
level, *current, *total, p->offset, p->size, p->pos);
assert (p->offset <= p->size);
decode_ptr (&src, &child ); /* first child */
isamb_pp_upper_pos(pp, current, total, *total, level-1);
} /* upper_pos */
-void isamb_pp_pos( ISAMB_PP pp, int *current, int *total )
+void isamb_pp_pos( ISAMB_PP pp, zint *current, zint *total )
{ /* return an estimate of the current position and of the total number of */
/* occureences in the isam tree, based on the current leaf */
struct ISAMB_block *p = pp->block[pp->level];
isamb_pp_leaf_pos(pp,current, total, dummy);
if (pp->level>0)
isamb_pp_upper_pos(pp, current, total, *total, pp->level-1);
- /*
- logf(LOG_DEBUG,"isamb_pp_pos: C=%d T=%d =%6.2f%%",
- *current, *total, 100.0*(*current)/(*total));
- */
}
-/* $Id: rsbetween.c,v 1.15 2004-08-03 14:54:41 heikki Exp $
+/* $Id: rsbetween.c,v 1.16 2004-08-04 09:59:03 heikki Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002
Index Data Aps
#include <string.h>
#include <assert.h>
-#include <rsbetween.h>
#include <zebrautl.h>
+#include <rsbetween.h>
#define RSBETWEEN_DEBUG 0
-/* $Id: rsbool.c,v 1.32 2004-08-03 14:54:41 heikki Exp $
+/* $Id: rsbool.c,v 1.33 2004-08-04 09:59:03 heikki Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004
Index Data Aps
#include <string.h>
#include <assert.h>
-#include <rsbool.h>
#include <zebrautl.h>
+#include <rsbool.h>
#ifndef RSET_DEBUG
#define RSET_DEBUG 0
-/* $Id: rset.c,v 1.21 2004-08-03 14:54:41 heikki Exp $
+/* $Id: rset.c,v 1.22 2004-08-04 09:59:03 heikki Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004
Index Data Aps
return rs;
}
-void rset_default_pos (RSFD rfd, int *current, int *total)
+void rset_default_pos (RSFD rfd, zint *current, zint *total)
{ /* FIXME - This function should not be needed, only while */
/* coding the pos functions. */
assert(rfd);
-/* $Id: rsisamb.c,v 1.10 2004-08-03 14:54:41 heikki Exp $
+/* $Id: rsisamb.c,v 1.11 2004-08-04 09:59:03 heikki Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004
Index Data Aps
static int r_forward(RSET ct, RSFD rfd, void *buf, int *term_index,
int (*cmpfunc)(const void *p1, const void *p2),
const void *untilbuf);
-static void r_pos (RSFD rfd, int *current, int *total);
+static void r_pos (RSFD rfd, zint *current, zint *total);
static int r_read (RSFD rfd, void *buf, int *term_index);
static int r_write (RSFD rfd, const void *buf);
return i;
}
-static void r_pos (RSFD rfd, int *current, int *total)
+static void r_pos (RSFD rfd, zint *current, zint *total)
{
struct rset_pp_info *pinfo = (struct rset_pp_info *) rfd;
assert(rfd);
-/* $Id: rsisams.c,v 1.6 2004-08-03 14:54:41 heikki Exp $
+/* $Id: rsisams.c,v 1.7 2004-08-04 09:59:03 heikki Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002
Index Data Aps
#include <stdio.h>
#include <assert.h>
-#include <rsisams.h>
#include <zebrautl.h>
+#include <rsisams.h>
static void *r_create(RSET ct, const struct rset_control *sel, void *parms);
static RSFD r_open (RSET ct, int flag);
-/* $Id: rsnull.c,v 1.18 2004-08-03 14:54:41 heikki Exp $
+/* $Id: rsnull.c,v 1.19 2004-08-04 09:59:03 heikki Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002
Index Data Aps
#include <stdio.h>
#include <assert.h>
-#include <rsnull.h>
#include <zebrautl.h>
+#include <rsnull.h>
static void *r_create(RSET ct, const struct rset_control *sel, void *parms);
static RSFD r_open (RSET ct, int flag);
static void r_close (RSFD rfd);
static void r_delete (RSET ct);
static void r_rewind (RSFD rfd);
-static void r_pos (RSFD rfd, int *current, int *total);
+static void r_pos (RSFD rfd, zint *current, zint *total);
static int r_read (RSFD rfd, void *buf, int *term_index);
static int r_write (RSFD rfd, const void *buf);
logf (LOG_DEBUG, "rsnull_rewind");
}
-static void r_pos (RSFD rfd, int *current, int *total)
+static void r_pos (RSFD rfd, zint *current, zint *total)
{
assert(rfd);
assert(current);
-/* $Id: rsprox.c,v 1.5 2004-08-03 14:54:41 heikki Exp $
+/* $Id: rsprox.c,v 1.6 2004-08-04 09:59:03 heikki Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004
Index Data Aps
#include <string.h>
#include <assert.h>
-#include <rsprox.h>
#include <zebrautl.h>
+#include <rsprox.h>
#ifndef RSET_DEBUG
#define RSET_DEBUG 0