# include "external.h"
# include "shell.h"
# include "dvomath.h"
# include "convert.h"
# include "display.h"
# include "data.h"

# ifndef DVO2_H
# define DVO2_H

typedef struct {
  float r, d;
} SkyCoord;

typedef struct {
  float Rmin, Rmax;
  float Dmin, Dmax;
  int   childS, childE, parent;
  char  depth, child;
  char  object, image;
  char  name[24];
} SkyRegion; /* 48 bytes */ 

SkyRegion *SkyFindPoint (SkyRegion *db, SkyCoord c, int depth);
SkyRegion **SkyFindLevels (SkyRegion *db, SkyCoord c, int *Nregion);
SkyRegion **SkyFindArea (SkyRegion *db, SkyCoord c1, SkyCoord c2, int *nlist);
SkyRegion *SkyFindAreaDB (SkyRegion *db, SkyRegion *ref, SkyCoord c1, SkyCoord c2, int *Nregion);
SkyRegion *SkyBuildTable (SkyRegion *seed, int Nseed, int level, int depth);

SkyRegion *SkyMakeRegions (int Nlevels, int *nlist);
SkyRegion *SkyDivideRegions (SkyRegion *parents, int *N);
SkyRegion *SkyDivideBiggest (SkyRegion *list, int *nlist);
SkyRegion *SkyDivide (SkyRegion *in);

# endif
