#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <malloc.h>

int
ReadInputData( char *infile, int *numpnts, float **x_pnts, float **y_pnts )
{
        int             err_status;
        int             n;
        float           x, y;
        FILE            *fp;

  err_status = 0;

  if ( (fp = fopen(infile, "r")) == NULL)
  {
     err_status = 1;
  }
  else
  {
     fscanf(fp, "%d", &n);
	 fprintf(stderr,"read %d\n",n);

     *x_pnts = (float *)calloc(n, sizeof(float));
     *y_pnts = (float *)calloc(n, sizeof(float));

     *numpnts = n;


     for (n=0; n < *numpnts; n++)
     {
        fscanf( fp, "%f, %f", &x, &y );

        (*x_pnts)[n] = x;
        (*y_pnts)[n] = y;
     } 
  }


  return (err_status);   

}
