-static int r_read_and (RSFD rfd, void *buf)
-{ /* Has to return all hits where each item points to the */
- /* same sysno (scope), in order. Keep an extra key (hitkey) */
- /* as long as all records do not point to hitkey, forward */
- /* them, and update hitkey to be the highest seen so far. */
- /* (if any item eof's, mark eof, and return 0 thereafter) */
- /* Once a hit has been found, scan all items for the smallest */
- /* value. Mark all as being in the tail. Read next from that */
- /* item, and if not in the same record, clear its tail bit */
- struct rset_multiandor_rfd *p=rfd->priv;
- const struct key_control *kctrl=rfd->rset->keycontrol;
- struct rset_multiandor_info *info=rfd->rset->priv;
- int i, mintail;
- int cmp;
+/** \brief reads one item key from an 'and' set
+ \param rfd set handle
+ \param buf resulting item buffer
+ \param term resulting term
+ \retval 0 EOF
+ \retval 1 item could be read
+
+ Has to return all hits where each item points to the
+ same sysno (scope), in order. Keep an extra key (hitkey)
+ as long as all records do not point to hitkey, forward
+ them, and update hitkey to be the highest seen so far.
+ (if any item eof's, mark eof, and return 0 thereafter)
+ Once a hit has been found, scan all items for the smallest
+ value. Mark all as being in the tail. Read next from that
+ item, and if not in the same record, clear its tail bit
+*/
+static int r_read_and (RSFD rfd, void *buf, TERMID *term)
+{ struct rfd_private *p = rfd->priv;
+ RSET ct = rfd->rset;
+ const struct rset_key_control *kctrl = ct->keycontrol;
+ int i;