# include "data.h"

int center (int argc, char **argv) {
  
  double x, y;
  int zoom;
  int kapa, N;
  char *name;
  
  name = NULL;
  if ((N = get_argument (argc, argv, "-n"))) {
    remove_argument (N, &argc, argv);
    name = strcreate (argv[N]);
    remove_argument (N, &argc, argv);
  }
  if (!GetImage (NULL, &kapa, name)) return (FALSE);
  FREE (name);

  if ((argc != 3) && (argc != 4)) {
    gprint (GP_ERR, "USAGE: center x y [zoom]\n");
    return (FALSE);
  }

  x = atof (argv[1]);
  y = atof (argv[2]);
  zoom = 0;
  if (argc == 4) zoom = atof (argv[3]);

  KiiCenter (kapa, x, y, zoom);
  return (TRUE);
}
