-#include <../index/index.h> /* for log_keydump. Debugging only */
-
-#ifndef RSET_DEBUG
-#define RSET_DEBUG 0
-#endif
-
-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 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);
+
+static RSFD r_open(RSET ct, int flag);
+static void r_close(RSFD rfd);
+static void r_delete(RSET ct);
+static int r_forward(RSFD rfd, void *buf, TERMID *term, const void *untilbuf);
+static void r_pos(RSFD rfd, double *current, double *total);
+static int r_read(RSFD rfd, void *buf, TERMID *term);
+static int r_read_filter(RSFD rfd, void *buf, TERMID *term);
+static int r_write(RSFD rfd, const void *buf);