- void *buf; /* state data stored by subsystem */
- struct rset_control *(*f_create)(const struct rset_control *sel, void *parms);
- int (*f_open)(struct rset_control *ct, int wflag);
- void (*f_close)(struct rset_control *ct);
- void (*f_delete)(struct rset_control *ct);
- void (*f_rewind)(struct rset_control *ct);
- int (*f_count)(struct rset_control *ct);
- int (*f_read)(struct rset_control *ct, void *buf);
- int (*f_write)(struct rset_control *ct, const void *buf);
-} rset_control;
+/* RSET rs_something_create(const struct rset_control *sel, ...); */
+ void (*f_delete)(RSET ct);
+ RSFD (*f_open)(RSET ct, int wflag);
+ void (*f_close)(RSFD rfd);
+ int (*f_forward)(RSFD rfd, void *buf, TERMID *term, const void *untilbuf);
+ void (*f_pos)(RSFD rfd, double *current, double *total);
+ /* returns -1,-1 if pos function not implemented for this type */
+ int (*f_read)(RSFD rfd, void *buf, TERMID *term);
+ int (*f_write)(RSFD rfd, const void *buf);
+};
+
+/** rset_default_forward implements a generic forward with a read-loop */
+int rset_default_forward(RSFD rfd, void *buf, TERMID *term,
+ const void *untilbuf);
+
+/**
+ * key_control contains all there is to know about the keys stored in
+ * an isam, and therefore operated by the rsets. Other than this info,
+ * all we assume is that all keys are the same size, and they can be
+ * memcpy'd around
+ */
+struct key_control {
+ int key_size;
+ int scope; /* default for what level we operate (book/chapter/verse) on*/
+ /* usual sysno/seqno is 2 */
+ int (*cmp) (const void *p1, const void *p2);
+ void (*key_logdump_txt) (int logmask, const void *p, const char *txt);
+ zint (*getseq)(const void *p);
+ /* FIXME - Should not need a getseq, it won't make much sense with */
+ /* higher-order keys. Use a (generalized) cmp instead, or something */
+ /* FIXME - decode and encode, and lots of other stuff */
+};