This function should work one of two ways:
int read_location(double *x, double *y)
1 - Pass it a pointer to a structure, and fill it in.
2 - Pass it pointers to individual doubles, and fill those in.
You are doing half of each.
void foo( stuct bar *baz )
read into baz->x;
read into baz->y;
If doing the latter, you need to assign those values to your structure (or pass the structure's elements individually). That might be done like so:
void foo( double *bar, double *baz )
read into bar
read into baz
foo( &astruct.x, &astruct.y );
foo( &x, &y );
astruct.x = x;
astruct.y = y;