-#if 0
-void rset_default_pos (RSFD rfd, double *current, double *total)
-{ /* This should never really be needed, but it is still used in */
- /* those rsets that we don't really plan to use, like isam-s */
- assert(rfd);
- assert(current);
- assert(total);
- *current=-1; /* signal that pos is not implemented */
- *total=-1;
-} /* rset_default_pos */
-#endif
-
-int rset_default_forward(RSFD rfd, void *buf,
- int (*cmpfunc)(const void *p1, const void *p2),
- const void *untilbuf)
+/**
+ \brief Estimates hit count for result set.
+ \param rs Result Set.
+
+ rset_count uses rset_pos to get the total and returns that.
+ This is ok for rsisamb/c/s, and for some other rsets, but in case of
+ booleans etc it will give bad estimate, as nothing has been read
+ from that rset
+*/
+zint rset_count(RSET rs)
+{
+ double cur, tot;
+ RSFD rfd = rset_open(rs, 0);
+ rset_pos(rfd, &cur, &tot);
+ rset_close(rfd);
+ return (zint) tot;
+}
+
+/**
+ \brief is a getterms function for those that don't have any
+ \param ct result set handle
+ \param terms array of terms (0..maxterms-1)
+ \param maxterms length of terms array
+ \param curterm current size of terms array
+
+ If there is a term associated with rset the term is appeneded; otherwise
+ the terms array is untouched but curterm is incremented anyway.
+*/
+void rset_get_one_term(RSET ct, TERMID *terms, int maxterms, int *curterm)
+{
+ if (ct->term)
+ {
+ if (*curterm < maxterms)
+ terms[*curterm] = ct->term;
+ (*curterm)++;
+ }
+}
+
+/**
+ \brief Creates a TERMID entry.
+ \param name Term/Name buffer with given length
+ \param length of term
+ \param flags for term
+ \param type Term Type, Z_Term_general, Z_Term_characterString,..
+ \param nmem memory for term.
+ \param ol ord list
+*/
+TERMID rset_term_create(const char *name, int length, const char *flags,
+ int type, NMEM nmem, struct ord_list *ol)
+