# include "addstar.h"

int replace_match (Average *average, Measure *measure, Stars *star) {

  int i;

  /* search for entry and replace values M, dM, R, D */
  for (i = 0; i < average[0].Nmeasure; i++) {
    if (measure[i].photcode != star[0].code) continue;
    measure[i].dR = 3600.0*(average[0].R - star[0].R);
    measure[i].dD = 3600.0*(average[0].D - star[0].D);
    measure[i].M  = star[0].M;
    measure[i].dM = star[0].dM;
    star[0].found = average[0].measureOffset + i;
    return (TRUE);
  }
  return (FALSE);
}
