Index: trunk/Ohana/src/opihi/dvo/skyregion.c
===================================================================
--- trunk/Ohana/src/opihi/dvo/skyregion.c	(revision 31635)
+++ trunk/Ohana/src/opihi/dvo/skyregion.c	(revision 33662)
@@ -1,21 +1,31 @@
 # include "dvoshell.h"
-
-#ifdef NO_MOVED_TO_DVO
-static double RAs = 0.0;
-static double RAe = 0.0;
-static double DECs = 0.0;
-static double DECe = 0.0;
-#endif
 
 // define the sky region for which extractions are limited
 int skyregion (int argc, char **argv) {
   
+  int N;
+
+  // dvo_client should have 2 standard arguments: -hostID and -hostdir
+  int SaveRegion = FALSE;
+  if ((N = get_argument (argc, argv, "-save"))) {
+    remove_argument (N, &argc, argv);
+    SaveRegion = TRUE;
+  }
+
   if (argc == 1) {
-    double RAs, RAe, DECs, DECe;
-    get_skyregion(&RAs, &RAe, &DECs, &DECe);
+    double Rmin, Rmax, Dmin, Dmax;
+    get_skyregion(&Rmin, &Rmax, &Dmin, &Dmax);
 
-    gprint (GP_ERR, "current skyregion: %f - %f : %f - %f\n", RAs, RAe, DECs, DECe);
-    gprint (GP_ERR, "USAGE:  skyregion (min RA) (max RA) (min DEC) (max DEC)\n");
-    return (FALSE);
+    if (SaveRegion) {
+      set_variable ("Rmin", Rmin);
+      set_variable ("Rmax", Rmax);
+      set_variable ("Dmin", Dmin);
+      set_variable ("Dmax", Dmax);
+      return TRUE;
+    } else {
+      gprint (GP_ERR, "current skyregion: %f - %f : %f - %f\n", Rmin, Rmax, Dmin, Dmax);
+      gprint (GP_ERR, "USAGE:  skyregion (min RA) (max RA) (min DEC) (max DEC)\n");
+      return FALSE;
+    }
   }
 
@@ -29,25 +39,4 @@
   return (TRUE);
 }
-#ifdef NOT_MOVED_TO_LIBDVO
-int get_skyregion (double *Rs, double *Re, double *Ds, double *De) {
-
-  *Rs = RAs;
-  *Re = RAe;
-  *Ds = DECs;
-  *De = DECe;
-
-  return TRUE;
-}
-
-int set_skyregion (double Rs, double Re, double Ds, double De) {
-
-  RAs  = Rs;
-  RAe  = Re;
-  DECs = Ds;
-  DECe = De;
-
-  return TRUE;
-}
-#endif
 
 /* find region which overlaps c at given depth (-1 : populated ) */
@@ -107,4 +96,6 @@
   ALLOCATE (new[0].regions,  SkyRegion *, 1);
   ALLOCATE (new[0].filename,  char *, 1);
+  new[0].Nregions = 0;
+  new[0].ownElements = FALSE; // this list is only holding a view to the elements
 
   // output list
