+RSET rset_dup (RSET rs);
+
+
+#define RSETF_READ 0
+#define RSETF_WRITE 1
+/* RSFD rset_open(RSET rs, int wflag); */
+#define rset_open(rs, wflag) (*(rs)->control->f_open)((rs), (wflag))
+
+/* void rset_close(RSFD rfd); */
+#define rset_close(rfd) (*(rfd)->rset->control->f_close)(rfd)
+
+/* int rset_forward(RSFD rfd, void *buf, TERMID term, void *untilbuf); */
+#define rset_forward(rfd, buf, term, untilbuf) \
+ (*(rfd)->rset->control->f_forward)((rfd),(buf),(term),(untilbuf))
+
+/* void rset_getterms(RSET ct, TERMID *terms, int maxterms, int *curterm); */
+#define rset_getterms(ct, terms, maxterms, curterm) \
+ (*(ct)->control->f_getterms)((ct),(terms),(maxterms),(curterm))
+
+/* int rset_pos(RSFD fd, double *current, double *total); */
+#define rset_pos(rfd,cur,tot) \
+ (*(rfd)->rset->control->f_pos)((rfd),(cur),(tot))
+
+/* int rset_read(RSFD rfd, void *buf, TERMID term); */
+#define rset_read(rfd, buf, term) \
+ (*(rfd)->rset->control->f_read)((rfd), (buf), (term))
+
+/* int rset_write(RSFD rfd, const void *buf); */
+#define rset_write(rfd, buf) (*(rfd)->rset->control->f_write)((rfd), (buf))
+
+/* int rset_type (RSET) */
+#define rset_type(rs) ((rs)->control->desc)
+
+/** rset_count counts or estimates the keys in it*/
+zint rset_count(RSET rs);
+
+RSET rstemp_create(NMEM nmem, struct rset_key_control *kcontrol,
+ int scope, const char *temp_path, TERMID term);
+
+RSET rsnull_create(NMEM nmem, struct rset_key_control *kcontrol);
+
+RSET rsbool_create_and(NMEM nmem, struct rset_key_control *kcontrol,
+ int scope, RSET rset_l, RSET rset_r);
+
+RSET rsbool_create_or(NMEM nmem, struct rset_key_control *kcontrol,
+ int scope, RSET rset_l, RSET rset_r);
+
+RSET rsbool_create_not(NMEM nmem, struct rset_key_control *kcontrol,
+ int scope, RSET rset_l, RSET rset_r);
+
+RSET rsbetween_create(NMEM nmem, struct rset_key_control *kcontrol,
+ int scope, RSET rset_l, RSET rset_m, RSET rset_r,
+ RSET rset_attr);
+
+RSET rsmulti_or_create(NMEM nmem, struct rset_key_control *kcontrol,
+ int scope, int no_rsets, RSET* rsets);
+
+RSET rsmulti_and_create(NMEM nmem, struct rset_key_control *kcontrol,
+ int scope, int no_rsets, RSET* rsets);
+
+RSET rsprox_create(NMEM nmem, struct rset_key_control *kcontrol,
+ int scope, int rset_no, RSET *rset,
+ int ordered, int exclusion, int relation, int distance);
+
+RSET rsisamb_create(NMEM nmem, struct rset_key_control *kcontrol,
+ int scope, ISAMB is, ISAM_P pos, TERMID term);