-/* $Id: isamb.h,v 1.9 2004-06-02 12:30:32 adam Exp $
+/* $Id: isamb.h,v 1.10 2004-08-03 14:54:41 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_close (ISAMB_PP pp);
int isamb_unlink (ISAMB b, ISAMC_P pos);
-/* $Id: rset.h,v 1.22 2004-08-03 12:15:44 heikki Exp $
+/* $Id: rset.h,v 1.23 2004-08-03 14:54:41 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);
-/* int (*f_count)(RSET ct); */ /* FIXME - remove this and add pos */
+ void (*f_pos)(RSFD rfd, int *current, int *total);
+ /* FIXME - Should be 64-bit ints !*/
+ /* 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);
struct rset_term {
char *name;
-/* $Id: isamb.c,v 1.46 2004-06-16 20:34:25 adam Exp $
+/* $Id: isamb.c,v 1.47 2004-08-03 14:54:41 heikki Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004
Index Data Aps
struct ISAMB_block **block;
};
-void isamb_pp_pos( ISAMB_PP pp, int *current, int *total );
- /* FIXME - this should be in a header file */
#if ISAMB_PTR_CODEC
static void encode_ptr (char **dst, unsigned pos)
-/* $Id: tstisamb.c,v 1.6 2004-06-03 00:24:12 adam Exp $
+/* $Id: tstisamb.c,v 1.7 2004-08-03 14:54:41 heikki Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004
Index Data Aps
struct read_info ri;
int i;
ISAMB_PP pp;
- char key_buf[10];
/* insert a number of entries */
ri.no = 0;
-/* $Id: rsbetween.c,v 1.14 2004-08-03 12:15:45 heikki Exp $
+/* $Id: rsbetween.c,v 1.15 2004-08-03 14:54:41 heikki Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002
Index Data Aps
static int r_forward_between(RSET ct, RSFD rfd, void *buf, int *term_index,
int (*cmpfunc)(const void *p1, const void *p2),
const void *untilbuf);
-/* static int r_count_between (RSET ct); */
static int r_read_between (RSFD rfd, void *buf, int *term_index);
static int r_write_between (RSFD rfd, const void *buf);
r_delete_between,
r_rewind_between,
r_forward_between, /* rset_default_forward, */
- /* r_count_between, */
+ rset_default_pos,
r_read_between,
r_write_between,
};
return rc;
}
-/*
-static int r_count_between (RSET ct)
-{
- return 0;
-}
-*/
-/* $Id: rsbool.c,v 1.31 2004-08-03 12:15:45 heikki Exp $
+/* $Id: rsbool.c,v 1.32 2004-08-03 14:54:41 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 int r_count (RSET ct); */
+/* static void r_pos (RSFD rfd, int *current, int *total); */
static int r_read_and (RSFD rfd, void *buf, int *term_index);
static int r_read_or (RSFD rfd, void *buf, int *term_index);
static int r_read_not (RSFD rfd, void *buf, int *term_index);
r_delete,
r_rewind,
r_forward, /* rset_default_forward, */
- /* r_count, */
+ rset_default_pos,
r_read_and,
r_write,
};
#else
rset_default_forward,
#endif
- /* r_count, */
+ rset_default_pos,
r_read_or,
r_write,
};
r_delete,
r_rewind,
r_forward,
- /* r_count, */
+ rset_default_pos,
r_read_not,
r_write,
};
return rc;
}
-/*
-static int r_count (RSET ct)
-{
- return 0;
-}
-*/
/*
1,1 1,3
-/* $Id: rset.c,v 1.20 2004-01-30 11:43:41 heikki Exp $
+/* $Id: rset.c,v 1.21 2004-08-03 14:54:41 heikki Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004
Index Data Aps
#include <stdio.h>
#include <string.h>
#include <zebrautl.h>
+#include <assert.h>
#include <rset.h>
#include <../index/index.h> /* for log_keydump. Debugging only */
return rs;
}
+void rset_default_pos (RSFD rfd, int *current, int *total)
+{ /* FIXME - This function should not be needed, only while */
+ /* coding the pos functions. */
+ assert(rfd);
+ assert(current);
+ assert(total);
+ *current=-1; /* signal that pos is not implemented */
+ *total=-1;
+} /* rset_default_pos */
+
int rset_default_forward(RSET ct, RSFD rfd, void *buf, int *term_index,
int (*cmpfunc)(const void *p1, const void *p2),
const void *untilbuf)
-/* $Id: rsisam.c,v 1.25 2004-08-03 12:15:45 heikki Exp $
+/* $Id: rsisam.c,v 1.26 2004-08-03 14:54:41 heikki Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002
Index Data Aps
static void r_close (RSFD rfd);
static void r_delete (RSET ct);
static void r_rewind (RSFD rfd);
-/* static int r_count (RSET ct); */
static int r_read (RSFD rfd, void *buf, int *term_index);
static int r_write (RSFD rfd, const void *buf);
r_delete,
r_rewind,
rset_default_forward,
- /* r_count, */
+ rset_default_pos,
r_read,
r_write,
};
-/* $Id: rsisamb.c,v 1.9 2004-08-03 12:15:45 heikki Exp $
+/* $Id: rsisamb.c,v 1.10 2004-08-03 14:54:41 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 int r_count (RSET ct);*/
+static void r_pos (RSFD rfd, int *current, int *total);
static int r_read (RSFD rfd, void *buf, int *term_index);
static int r_write (RSFD rfd, const void *buf);
r_delete,
r_rewind,
r_forward, /* rset_default_forward, */
- /* r_count, */
+ r_pos,
r_read,
r_write,
};
int (*cmpfunc)(const void *p1, const void *p2),
const void *untilbuf)
{
- int i; /*!*/
+ int i;
struct rset_pp_info *pinfo = (struct rset_pp_info *) rfd;
#if RSET_DEBUG
logf (LOG_DEBUG, "rset_rsisamb_forward starting '%s' (ct=%p rfd=%p)",
return i;
}
-/*
-static int r_count (RSET ct)
+static void r_pos (RSFD rfd, int *current, int *total)
{
- return 0;
+ struct rset_pp_info *pinfo = (struct rset_pp_info *) rfd;
+ assert(rfd);
+ isamb_pp_pos(pinfo->pt, current, total);
}
-*/
static int r_read (RSFD rfd, void *buf, int *term_index)
{
-/* $Id: rsisamc.c,v 1.15 2004-08-03 12:15:45 heikki Exp $
+/* $Id: rsisamc.c,v 1.16 2004-08-03 14:54:41 heikki Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004
Index Data Aps
static void r_close (RSFD rfd);
static void r_delete (RSET ct);
static void r_rewind (RSFD rfd);
-/* static int r_count (RSET ct); */
static int r_read (RSFD rfd, void *buf, int *term_index);
static int r_write (RSFD rfd, const void *buf);
r_delete,
r_rewind,
rset_default_forward,
- /*r_count, */
+ rset_default_pos,
r_read,
r_write,
};
logf (LOG_DEBUG, "rsisamc_rewind");
abort ();
}
-/*
-static int r_count (RSET ct)
-{
- return 0;
-}
-*/
static int r_read (RSFD rfd, void *buf, int *term_index)
{
-/* $Id: rsisamd.c,v 1.7 2004-08-03 12:15:45 heikki Exp $
+/* $Id: rsisamd.c,v 1.8 2004-08-03 14:54:41 heikki Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004
Index Data Aps
static void r_close (RSFD rfd);
static void r_delete (RSET ct);
static void r_rewind (RSFD rfd);
-/* static int r_count (RSET ct); */
static int r_read (RSFD rfd, void *buf, int *term_index);
static int r_write (RSFD rfd, const void *buf);
r_delete,
r_rewind,
rset_default_forward,
- /* r_count, */
+ rset_default_pos,
r_read,
r_write,
};
abort ();
}
-/*
-static int r_count (RSET ct)
-{
- return 0;
-}
-*/
static int r_read (RSFD rfd, void *buf, int *term_index)
{
-/* $Id: rsisams.c,v 1.5 2004-08-03 12:15:45 heikki Exp $
+/* $Id: rsisams.c,v 1.6 2004-08-03 14:54:41 heikki Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002
Index Data Aps
static void r_close (RSFD rfd);
static void r_delete (RSET ct);
static void r_rewind (RSFD rfd);
-/* static int r_count (RSET ct); */
static int r_read (RSFD rfd, void *buf, int *term_index);
static int r_write (RSFD rfd, const void *buf);
r_delete,
r_rewind,
rset_default_forward,
- /* r_count, */
+ rset_default_pos,
r_read,
r_write,
};
abort ();
}
-/*
-static int r_count (RSET ct)
-{
- return 0;
-}
-*/
static int r_read (RSFD rfd, void *buf, int *term_index)
{
-/* $Id: rsm_or.c,v 1.15 2004-08-03 12:15:45 heikki Exp $
+/* $Id: rsm_or.c,v 1.16 2004-08-03 14:54:41 heikki Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002
Index Data Aps
static void r_close (RSFD rfd);
static void r_delete (RSET ct);
static void r_rewind (RSFD rfd);
-/* static int r_count (RSET ct); */
static int r_read (RSFD rfd, void *buf, int *term_index);
static int r_write (RSFD rfd, const void *buf);
r_close,
r_delete,
r_rewind,
- rset_default_forward,
- /* r_count, */
+ rset_default_forward, /* FIXME */
+ rset_default_pos, /* FIXME */
r_read,
r_write,
};
{
}
-/*
-static int r_count (RSET ct)
-{
- return 0;
-}
-*/
static int r_read (RSFD rfd, void *buf, int *term_index)
{
-/* $Id: rsnull.c,v 1.17 2004-08-03 12:15:45 heikki Exp $
+/* $Id: rsnull.c,v 1.18 2004-08-03 14:54:41 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>
static void r_close (RSFD rfd);
static void r_delete (RSET ct);
static void r_rewind (RSFD rfd);
-/* static int r_count (RSET ct); */
+static void r_pos (RSFD rfd, int *current, int *total);
static int r_read (RSFD rfd, void *buf, int *term_index);
static int r_write (RSFD rfd, const void *buf);
r_delete,
r_rewind,
rset_default_forward,
- /* r_count, */
+ r_pos,
r_read,
r_write,
};
logf (LOG_DEBUG, "rsnull_rewind");
}
-/*
-static int r_count (RSET ct)
+static void r_pos (RSFD rfd, int *current, int *total)
{
- return 0;
+ assert(rfd);
+ assert(current);
+ assert(total);
+ *total=0;
+ *current=0;
}
-*/
static int r_read (RSFD rfd, void *buf, int *term_index)
{
-/* $Id: rsprox.c,v 1.4 2004-08-03 12:15:45 heikki Exp $
+/* $Id: rsprox.c,v 1.5 2004-08-03 14:54:41 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 int r_count (RSET ct); */
static int r_read (RSFD rfd, void *buf, int *term_index);
static int r_write (RSFD rfd, const void *buf);
r_delete,
r_rewind,
r_forward,
- /* r_count, */
+ rset_default_pos,
r_read,
r_write,
};
return 0;
}
-/*
-static int r_count (RSET ct)
-{
- return 0;
-}
-*/
static int r_read (RSFD rfd, void *buf, int *term_index)
{
-/* $Id: rstemp.c,v 1.37 2004-08-03 12:15:45 heikki Exp $
+/* $Id: rstemp.c,v 1.38 2004-08-03 14:54:41 heikki Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003
Index Data Aps
r_delete,
r_rewind,
rset_default_forward,
- /* r_count, */
+ rset_default_pos,
r_read,
r_write,
};