+static void r_pos (RSFD rfd, double *current, double *total)
+{
+ struct rset_prox_info *info = ((struct rset_prox_rfd*)rfd)->info;
+ struct rset_prox_rfd *p = (struct rset_prox_rfd *) rfd;
+ int i;
+ double cur,tot=-1;
+ double scur=0,stot=0;
+ double r;
+
+ logf (LOG_DEBUG, "rsprox_pos");
+
+ for (i = 0; i < info->p.rset_no; i++)
+ {
+ rset_pos(info->p.rset[i], p->rfd[i], &cur, &tot);
+ if (tot>0) {
+ scur += cur;
+ stot += tot;
+ }
+ }
+ if (tot <0) { /* nothing found */
+ *current=-1;
+ *total=-1;
+ } else if (tot <1) { /* most likely tot==0 */
+ *current=0;
+ *total=0;
+ } else {
+ r=scur/stot;
+ *current=p->hits;
+ *total=*current/r ;
+ }
+ logf(LOG_DEBUG,"prox_pos: [%d] %0.1f/%0.1f= %0.4f ",
+ i,*current, *total, r);
+}