#include <stdlib.h>

void getxynum(char *fname, int *xsize, int *ysize)
{

  FILE    *fp;
  char    cxsize[5],cysize[5];
  int     xx,yy;
  char    str1[400];

  if(NULL==(fp=fopen(fname,"rb"))){
    printf("\n [%s] can not be opened \n",fname);
    exit(1);
  }
  fgets(str1, sizeof(str1), fp);
  fclose(fp);

  cxsize[0] = str1[266];
  cxsize[1] = str1[267];
  cxsize[2] = str1[268];
  cxsize[3] = str1[269];
  cxsize[4] = '\0';

  cysize[0] = str1[346];
  cysize[1] = str1[347];
  cysize[2] = str1[348];
  cysize[3] = str1[349];
  cysize[4] = '\0';

  xx = atoi(cxsize);
  yy = atoi(cysize);

  *xsize = xx;
  *ysize = yy;

}
