# include "Ximage.h"
# define SCAN \
status = read (sock, buffer, 16); \
buffer[16] = 0; \
sscanf (buffer, "%*s %d", &Nbytes); \
status = read (sock, buffer, Nbytes); \
buffer[status] = 0;

int SetLimits () {
  
  int i, status, Nbytes;
  char buffer[128];
  double xmin, xmax, ymin, ymax;
  Layout *layout;

  layout = &section[TheSection];

  SCAN;
  sscanf (buffer, "%lf %lf %lf %lf", &xmin, &xmax, &ymin, &ymax);

  layout[0].axis[2].min = layout[0].axis[0].min = xmin;
  layout[0].axis[2].max = layout[0].axis[0].max = xmax;
  layout[0].axis[3].min = layout[0].axis[1].min = ymin; 
  layout[0].axis[3].max = layout[0].axis[1].max = ymax;
  
  for (i = 0; i < layout[0].Nobjects; i++) {
    layout[0].objects[i].x0 = xmin;
    layout[0].objects[i].x1 = xmax;
    layout[0].objects[i].y0 = ymin;
    layout[0].objects[i].y1 = ymax;
  }

  XClearWindow (graphic.display, graphic.window);
  Refresh (1);

  return (TRUE);
  
}
