Index: /trunk/Ohana/src/opihi/Makefile
===================================================================
--- /trunk/Ohana/src/opihi/Makefile	(revision 4688)
+++ /trunk/Ohana/src/opihi/Makefile	(revision 4689)
@@ -18,5 +18,7 @@
 PROGRAM = mana dvo
 
-EXTRAS = dvo2 sched dimm pclient pcontrol
+EXTRAS = sched pclient pcontrol
+
+SKIP =  dimm
 
 all:
@@ -29,6 +31,13 @@
 	for i in $(PROGRAM); do make $$i.install || exit; done
 
+extra-install:
+	for i in $(EXTRAS); do make $$i.install || exit; done
+
 clean:
-	for i in $(PROGRAM) $(LIBS); do make $$i.clean || exit; done
+	for i in $(PROGRAM) $(EXTRAS) $(LIBS); do make $$i.clean || exit; done
+
+dist: clean
+	rm -f bin/*.*
+	rm -f lib/*.a
 
 #############################################################
Index: /trunk/Ohana/src/opihi/cmd.astro/biassub.c
===================================================================
--- /trunk/Ohana/src/opihi/cmd.astro/biassub.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/cmd.astro/biassub.c	(revision 4689)
@@ -9,4 +9,5 @@
   Buffer *buf;
 
+  xvec = yvec = NULL;
   NoVector = TRUE;
   if ((N = get_argument (argc, argv, "-v"))) {
Index: /trunk/Ohana/src/opihi/cmd.astro/drizzle.c
===================================================================
--- /trunk/Ohana/src/opihi/cmd.astro/drizzle.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/cmd.astro/drizzle.c	(revision 4689)
@@ -175,4 +175,5 @@
   double N, r, d;
 
+  Xin = Yin = 0;
   N = x = y = x2 = y2 = xy = X = Y = Xx = Xy = Yx = Yy = 0;
 
Index: /trunk/Ohana/src/opihi/cmd.astro/getvel.c
===================================================================
--- /trunk/Ohana/src/opihi/cmd.astro/getvel.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/cmd.astro/getvel.c	(revision 4689)
@@ -3,5 +3,5 @@
 int getvel (int argc, char **argv) {
   
-  int i, X, n, Ncurve;
+  int i, n, Ncurve;
   int nx, ny;
   double L, V, Vo, dV, Bo, dB;
@@ -45,5 +45,5 @@
   while (L >= 360) {L -= 360.0;}
   while (L < 0.0)  {L += 360.0;}
-  fprintf (stderr, "L: %f (%d)\n", L, X);
+  fprintf (stderr, "L: %f\n", L);
 
   cl = cos (L*RAD_DEG);
Index: /trunk/Ohana/src/opihi/cmd.astro/imfit-Sgauss.c
===================================================================
--- /trunk/Ohana/src/opihi/cmd.astro/imfit-Sgauss.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/cmd.astro/imfit-Sgauss.c	(revision 4689)
@@ -46,5 +46,5 @@
 
   float X, Y, px1, py1, px2, py2;
-  float z1, z2, r, q1, q2, f, f1, f2;
+  float z1, z2, r, q1, q2, f;
 
   X = x - par[0];
Index: /trunk/Ohana/src/opihi/cmd.astro/imfit.c
===================================================================
--- /trunk/Ohana/src/opihi/cmd.astro/imfit.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/cmd.astro/imfit.c	(revision 4689)
@@ -6,6 +6,5 @@
   int sx, sy, nx, ny, Nx, Ny;
   float chisq, ochisq, dchisq, Gain, RDnoise, SatThreshold;
-  float *x, *y, *z, *dz, *V, *parmin, *parmax;
-  char line[64];
+  float *x, *y, *z, *dz, *V;
   Buffer *buf;
 
@@ -123,4 +122,5 @@
   ochisq = mrq2dinit (x, y, z, dz, Npts, par, Npar, fitfunc, VERBOSE);
   dchisq = ochisq;
+  chisq  = ochisq;
   for (i = 0; (i < 25) && ((dchisq <= 0.0) || (dchisq > 0.01*(Npts - Npar))); i++) {
     chisq = mrq2dmin (x, y, z, dz, Npts, par, Npar, fitfunc, VERBOSE);
Index: /trunk/Ohana/src/opihi/cmd.astro/medianmap.c
===================================================================
--- /trunk/Ohana/src/opihi/cmd.astro/medianmap.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/cmd.astro/medianmap.c	(revision 4689)
@@ -11,4 +11,5 @@
   Buffer *in, *out;
 
+  IgnoreValue = 0;
   Ignore = FALSE;
   if ((N = get_argument (argc, argv, "-ignore"))) {
Index: /trunk/Ohana/src/opihi/cmd.astro/region.c
===================================================================
--- /trunk/Ohana/src/opihi/cmd.astro/region.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/cmd.astro/region.c	(revision 4689)
@@ -3,10 +3,9 @@
 int region (int argc, char **argv) {
   
-  char buffer[65], buffer2[35], string[256];
+  char buffer[65], string[256];
   double Ra, Dec, Radius;
   double dx, dy;
-  int status, N;
+  int N, Ngraph, Xgraph;
   Graphdata graphmode;
-  int Ngraph, Xgraph;
 
   Ngraph = 0;
Index: /trunk/Ohana/src/opihi/cmd.astro/spec.c
===================================================================
--- /trunk/Ohana/src/opihi/cmd.astro/spec.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/cmd.astro/spec.c	(revision 4689)
@@ -91,5 +91,5 @@
     }
     fsort (buffer, Nring);
-    for (Npts = sky = 0, i = 0.25*Nring; i < 0.75*Nring; i++, Npts += 1.0) {
+    for (Npts = sky = sky2 = 0, i = 0.25*Nring; i < 0.75*Nring; i++, Npts += 1.0) {
       sky += buffer[i];
       sky2 += buffer[i]*buffer[i];
Index: /trunk/Ohana/src/opihi/cmd.basic/init.c
===================================================================
--- /trunk/Ohana/src/opihi/cmd.basic/init.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/cmd.basic/init.c	(revision 4689)
@@ -30,5 +30,5 @@
 int strlen_func     PROTO((int, char **));
 int substr_func     PROTO((int, char **));
-int wait       	    PROTO((int, char **));
+int wait_func  	    PROTO((int, char **));
 int version    	    PROTO((int, char **));
 int which      	    PROTO((int, char **));
@@ -68,5 +68,5 @@
   {"substr",        substr_func,        "substring"},
   {"version",       version,            "list version information"},
-  {"wait",    	    wait,               "wait until return is typed"},
+  {"wait",    	    wait_func,          "wait until return is typed"},
   {"which",   	    which,              "show command *"}
 };
Index: /trunk/Ohana/src/opihi/cmd.basic/list.c
===================================================================
--- /trunk/Ohana/src/opihi/cmd.basic/list.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/cmd.basic/list.c	(revision 4689)
@@ -12,4 +12,5 @@
   FILE *f;
 
+  Cmd = NULL;
   RunCommand = FALSE;
   if ((N = get_argument (argc, argv, "-x"))) {
Index: /trunk/Ohana/src/opihi/cmd.basic/macro.c
===================================================================
--- /trunk/Ohana/src/opihi/cmd.basic/macro.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/cmd.basic/macro.c	(revision 4689)
@@ -25,5 +25,5 @@
   for (i = 0; i < N; i++) {
     if (!strcmp (in_macro[i].name, argv[1])) {
-      (*in_macro[i].func) (argc - 1, argv + 1);
+      status = (*in_macro[i].func) (argc - 1, argv + 1);
       return (status);
     }
Index: /trunk/Ohana/src/opihi/cmd.basic/run_if.c
===================================================================
--- /trunk/Ohana/src/opihi/cmd.basic/run_if.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/cmd.basic/run_if.c	(revision 4689)
@@ -6,5 +6,5 @@
   int ThisList, depth, done, status, BreakOnTrue;
   int logic;
-  char *input, *outline, *val;
+  char *input, *val;
   int nloop, size;
 
Index: /trunk/Ohana/src/opihi/cmd.basic/wait.c
===================================================================
--- /trunk/Ohana/src/opihi/cmd.basic/wait.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/cmd.basic/wait.c	(revision 4689)
@@ -1,5 +1,5 @@
 # include "basic.h"
 
-int wait (int argc, char **argv) {
+int wait_func (int argc, char **argv) {
 
   char buff[1024];
Index: /trunk/Ohana/src/opihi/cmd.data/accum.c
===================================================================
--- /trunk/Ohana/src/opihi/cmd.data/accum.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/cmd.data/accum.c	(revision 4689)
@@ -8,4 +8,5 @@
   Vector *val, *key, *out;
 
+  NV = NULL;
   Normalize = FALSE;
   if ((N = get_argument (argc, argv, "-norm"))) {
Index: /trunk/Ohana/src/opihi/cmd.data/box.c
===================================================================
--- /trunk/Ohana/src/opihi/cmd.data/box.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/cmd.data/box.c	(revision 4689)
@@ -4,7 +4,6 @@
   
   int i, N, Ngraph, Xgraph;
-  char buffer[65], buffer2[65];
+  char Ticks[16], Axis[16], Labels[16];
   Graphdata graphmode;
-  char Ticks[16], Axis[16], Labels[16];
   
   strcpy (Ticks, "2222");
Index: /trunk/Ohana/src/opihi/cmd.data/center.c
===================================================================
--- /trunk/Ohana/src/opihi/cmd.data/center.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/cmd.data/center.c	(revision 4689)
@@ -5,5 +5,4 @@
   double x, y;
   int zoom;
-  char buffer[512], buffer2[20];
   int Ximage, Nimage, N;
   
Index: /trunk/Ohana/src/opihi/cmd.data/clip.c
===================================================================
--- /trunk/Ohana/src/opihi/cmd.data/clip.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/cmd.data/clip.c	(revision 4689)
@@ -7,4 +7,6 @@
   float *in;
   Buffer *buf;
+
+  inf_val = nan_val = min = Vmin = max = Vmax = 0;
 
   DO_NAN = FALSE;
Index: /trunk/Ohana/src/opihi/cmd.data/dot.c
===================================================================
--- /trunk/Ohana/src/opihi/cmd.data/dot.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/cmd.data/dot.c	(revision 4689)
@@ -3,5 +3,5 @@
 int dot (int argc, char **argv) {
   
-  int N, Npts, Ngraph;
+  int N, Ngraph;
   Graphdata graphmode;
   float x, y;
Index: /trunk/Ohana/src/opihi/cmd.data/erase.c
===================================================================
--- /trunk/Ohana/src/opihi/cmd.data/erase.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/cmd.data/erase.c	(revision 4689)
@@ -4,5 +4,4 @@
   
   int i, n, N;
-  char buffer[128];
   int Ximage, Nimage;
   
Index: /trunk/Ohana/src/opihi/cmd.data/fft1d.c
===================================================================
--- /trunk/Ohana/src/opihi/cmd.data/fft1d.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/cmd.data/fft1d.c	(revision 4689)
@@ -12,10 +12,11 @@
   }
 
+  Iim = NULL;
   ZeroImaginary = TRUE;
-  if ((Ire = SelectVector (argv[1], OLDVECTOR, TRUE)) == NULL) return (FALSE);
   if (strcmp (argv[2], "0")) {
     ZeroImaginary = FALSE;
     if ((Iim = SelectVector (argv[2], OLDVECTOR, TRUE)) == NULL) return (FALSE);
   }    
+  if ((Ire = SelectVector (argv[1], OLDVECTOR, TRUE)) == NULL) return (FALSE);
   if ((Ore = SelectVector (argv[4], ANYVECTOR, TRUE)) == NULL) return (FALSE);
   if ((Oim = SelectVector (argv[5], ANYVECTOR, TRUE)) == NULL) return (FALSE);
Index: /trunk/Ohana/src/opihi/cmd.data/fft2d.c
===================================================================
--- /trunk/Ohana/src/opihi/cmd.data/fft2d.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/cmd.data/fft2d.c	(revision 4689)
@@ -20,5 +20,5 @@
 
   /* select input / output buffers */
-  if ((Ire = SelectBuffer (argv[1], OLDBUFFER, TRUE)) == NULL) return (FALSE);
+  Iim = NULL;
   ZeroImaginary = TRUE; /* Input(imaginary) may be 0, in which case we create a 0 filled image */
   if (!strcmp (argv[2], "0")) { 
@@ -27,4 +27,5 @@
     if ((Iim = SelectBuffer (argv[2], OLDBUFFER, TRUE)) == NULL) return (FALSE);
   }    
+  if ((Ire = SelectBuffer (argv[1], OLDBUFFER, TRUE)) == NULL) return (FALSE);
   if ((Ore = SelectBuffer (argv[4], ANYBUFFER, TRUE)) == NULL) return (FALSE);
   if ((Oim = SelectBuffer (argv[5], ANYBUFFER, TRUE)) == NULL) return (FALSE);
Index: /trunk/Ohana/src/opihi/cmd.data/fit.c
===================================================================
--- /trunk/Ohana/src/opihi/cmd.data/fit.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/cmd.data/fit.c	(revision 4689)
@@ -31,4 +31,6 @@
   }
 
+  dy = NULL;
+  dyvec = NULL;
   Weight = FALSE;
   if ((N = get_argument (argc, argv, "-dy"))) {
@@ -72,4 +74,7 @@
     ALLOCATE (b[i], double, 1);
   }
+
+  Nmask = 0;
+  sigma = 0.0;
 
   for (N = 0; N < ClipNiter; N++) {
Index: /trunk/Ohana/src/opihi/cmd.data/fit2d.c
===================================================================
--- /trunk/Ohana/src/opihi/cmd.data/fit2d.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/cmd.data/fit2d.c	(revision 4689)
@@ -37,4 +37,6 @@
   }
 
+  dz = NULL;
+  dzvec = NULL;
   Weight = FALSE;
   if ((N = get_argument (argc, argv, "-dz"))) {
@@ -227,5 +229,5 @@
       }	
     }
-    if (VERBOSE) fprintf (stderr, "pass: %d, Nmask: %d\n", N, Nmask, ClipNSigma);
+    if (VERBOSE) fprintf (stderr, "pass: %d, Nmask: %d\n", N, Nmask);
   }
 
Index: /trunk/Ohana/src/opihi/cmd.data/load.c
===================================================================
--- /trunk/Ohana/src/opihi/cmd.data/load.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/cmd.data/load.c	(revision 4689)
@@ -58,4 +58,5 @@
   SendGraphCommand (Ximage, 16, "OVER %9d ", n);
   
+  dx = dy = 0;
   for (n = 0; scan_line (f, line) != EOF;) {
     c = strchr (line, '#');
@@ -87,4 +88,8 @@
       ddec = dra;
     case 5:
+      x = ra;
+      y = dec;
+      dx = dra;
+      dy = ddec;
       if (ISCEL) {
 	if (!strcmp (type, "LINE")) {
@@ -106,10 +111,4 @@
 	  dx = (fabs(x1 - x) + fabs(y1 - y));
 	}
-      }
-      else {
-	x = ra;
-	y = dec;
-	dx = dra;
-	dy = ddec;
       }
     }
Index: /trunk/Ohana/src/opihi/cmd.data/peak.c
===================================================================
--- /trunk/Ohana/src/opihi/cmd.data/peak.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/cmd.data/peak.c	(revision 4689)
@@ -23,5 +23,7 @@
 
   imax = -1;
-  for (i = 0; i < vecx[0].Nelements-1; i++, X++, Y++) {
+  xmax = *X;
+  ymax = *Y;
+  for (i = 1; i < vecx[0].Nelements-1; i++, X++, Y++) {
     if ((*X >= start) && (*X <= end)) {
       if ((imax == -1) || (*Y > ymax)) {
Index: /trunk/Ohana/src/opihi/cmd.data/point.c
===================================================================
--- /trunk/Ohana/src/opihi/cmd.data/point.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/cmd.data/point.c	(revision 4689)
@@ -7,5 +7,4 @@
   double x, y, dx, dy, x1, y1;
   double dra, ddec, ra1, dec1, ra, dec;
-  char *line;
   Coords coords;
   Buffer *buf;
Index: /trunk/Ohana/src/opihi/cmd.data/radial.c
===================================================================
--- /trunk/Ohana/src/opihi/cmd.data/radial.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/cmd.data/radial.c	(revision 4689)
@@ -12,4 +12,5 @@
 
   Ignore = FALSE;
+  IgnoreValue = 0;
   if ((N = get_argument (argc, argv, "-ignore"))) {
     Ignore = TRUE;
Index: /trunk/Ohana/src/opihi/cmd.data/rd.c
===================================================================
--- /trunk/Ohana/src/opihi/cmd.data/rd.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/cmd.data/rd.c	(revision 4689)
@@ -68,4 +68,6 @@
   strcpy (buf[0].file, filename);
   free (filename);
+
+  status = FALSE;
 
   if (extend) {
Index: /trunk/Ohana/src/opihi/cmd.data/rebin.c
===================================================================
--- /trunk/Ohana/src/opihi/cmd.data/rebin.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/cmd.data/rebin.c	(revision 4689)
@@ -10,4 +10,5 @@
   Buffer *in, *out;
 
+  Vn = Npix = NULL;
   Normalize = FALSE;
   if ((N = get_argument (argc, argv, "-norm"))) {
Index: /trunk/Ohana/src/opihi/cmd.data/save.c
===================================================================
--- /trunk/Ohana/src/opihi/cmd.data/save.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/cmd.data/save.c	(revision 4689)
@@ -4,5 +4,4 @@
   
   int N, n, ISCEL;
-  char buffer[512], buffer2[512];
   int Ximage, Nimage;
   
Index: /trunk/Ohana/src/opihi/cmd.data/section.c
===================================================================
--- /trunk/Ohana/src/opihi/cmd.data/section.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/cmd.data/section.c	(revision 4689)
@@ -4,7 +4,6 @@
   
   int N, List;
-  char buffer[65], buffer2[65];
+  int Ngraph, Xgraph;
   Graphdata graphmode;
-  int Ngraph, Xgraph;
 
   List = FALSE;
Index: /trunk/Ohana/src/opihi/cmd.data/sort.c
===================================================================
--- /trunk/Ohana/src/opihi/cmd.data/sort.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/cmd.data/sort.c	(revision 4689)
@@ -16,4 +16,5 @@
   ALLOCATE (vec, Vector *, Nvec);
 
+  Nval = 0;
   /* find vectors and check sizes */
   for (i = 0; i < Nvec; i++) {
Index: /trunk/Ohana/src/opihi/cmd.data/stats.c
===================================================================
--- /trunk/Ohana/src/opihi/cmd.data/stats.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/cmd.data/stats.c	(revision 4689)
@@ -10,4 +10,5 @@
   Buffer *buf;
 
+  IgnoreValue = 0;
   Ignore = FALSE;
   if ((N = get_argument (argc, argv, "-ignore"))) {
@@ -64,5 +65,5 @@
   /* calculate mode, median */
   median = mode = 0.5*(max + min);
-  if (range != 0) {
+  if ((max - min) != 0) {
     range = 0xffff / (max - min);
     ALLOCATE (hist, int, 0x10000);
Index: /trunk/Ohana/src/opihi/cmd.data/textline.c
===================================================================
--- /trunk/Ohana/src/opihi/cmd.data/textline.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/cmd.data/textline.c	(revision 4689)
@@ -4,5 +4,5 @@
 
   int N, size, FracPositions;
-  char name[64], buffer[128];
+  char name[64];
   double x, y, angle;
   int Ngraph, Xgraph;
Index: /trunk/Ohana/src/opihi/cmd.data/tv.c
===================================================================
--- /trunk/Ohana/src/opihi/cmd.data/tv.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/cmd.data/tv.c	(revision 4689)
@@ -3,6 +3,6 @@
 int tv (int argc, char **argv) {
   
-  int N, j, status, Npix, Ncolors, size, ISLOG, NNcol;
-  char buffer[1024], buffer2[100];
+  int N, j, Npix, Ncolors, size, ISLOG, NNcol;
+  char buffer[1024];
   double a1, a2, max, min, zero, range;
   float *in;
Index: /trunk/Ohana/src/opihi/cmd.data/tvcontour.c
===================================================================
--- /trunk/Ohana/src/opihi/cmd.data/tvcontour.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/cmd.data/tvcontour.c	(revision 4689)
@@ -69,5 +69,5 @@
   float *v00, *v01, *v10, *v11;
   float *Vout, *Vin, *matrix;
-  char *buffer, line[17];
+  char *buffer;
   int Ximage, Nimage, N;
   Buffer *buf;
Index: /trunk/Ohana/src/opihi/cmd.data/tvgrid.c
===================================================================
--- /trunk/Ohana/src/opihi/cmd.data/tvgrid.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/cmd.data/tvgrid.c	(revision 4689)
@@ -9,5 +9,5 @@
   double x0, y0, x1, y1;
   double dDEC, fDEC, dRA, fRA;
-  char buffer[1024], format[16];
+  char format[16];
   Coords coords;
   int Ximage, Nimage, N;
@@ -83,4 +83,5 @@
   NY = buf[0].header.Naxis[1];
 
+  x0 = y0 = 0;
   dRA = MAX (fabs(ra1 - ra0) / 100.0, 0.1);
   connect = FALSE;
Index: /trunk/Ohana/src/opihi/cmd.data/vbin.c
===================================================================
--- /trunk/Ohana/src/opihi/cmd.data/vbin.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/cmd.data/vbin.c	(revision 4689)
@@ -11,4 +11,6 @@
   Buffer *in, *out;
 
+  Npix = NULL;
+  Vn = NULL;
   Normalize = FALSE;
   if ((N = get_argument (argc, argv, "-norm"))) {
Index: /trunk/Ohana/src/opihi/cmd.data/vclip.c
===================================================================
--- /trunk/Ohana/src/opihi/cmd.data/vclip.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/cmd.data/vclip.c	(revision 4689)
@@ -7,4 +7,6 @@
   float *in;
   Vector *vec;
+
+  inf_val = nan_val = min = Vmin = max = Vmax = 0;
 
   DO_NAN = FALSE;
Index: /trunk/Ohana/src/opihi/cmd.data/vstat.c
===================================================================
--- /trunk/Ohana/src/opihi/cmd.data/vstat.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/cmd.data/vstat.c	(revision 4689)
@@ -12,4 +12,5 @@
   Vector *vec;
 
+  IgnoreValue = 0;
   Ignore = FALSE;
   if ((N = get_argument (argc, argv, "-ignore"))) {
Index: /trunk/Ohana/src/opihi/cmd.data/wd.c
===================================================================
--- /trunk/Ohana/src/opihi/cmd.data/wd.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/cmd.data/wd.c	(revision 4689)
@@ -17,5 +17,6 @@
   }
 
-  newZero  = FALSE;
+  outZero = 0;
+  newZero = FALSE;
   if ((N = get_argument (argc, argv, "-bzero"))) {
     remove_argument (N, &argc, argv);
@@ -25,4 +26,5 @@
   }
 
+  outScale = 1;
   newScale = FALSE;
   if ((N = get_argument (argc, argv, "-bscale"))) {
@@ -33,4 +35,5 @@
   }
 
+  outBitpix = 16;
   newBitpix = FALSE;
   if ((N = get_argument (argc, argv, "-bitpix"))) {
@@ -41,4 +44,5 @@
   }
 
+  outUnsign = FALSE;
   newUnsign = FALSE;
   if ((N = get_argument (argc, argv, "-unsign"))) {
Index: /trunk/Ohana/src/opihi/dimm/Makefile
===================================================================
--- /trunk/Ohana/src/opihi/dimm/Makefile	(revision 4688)
+++ /trunk/Ohana/src/opihi/dimm/Makefile	(revision 4689)
@@ -7,5 +7,4 @@
 LIB     =       $(HOME)/lib
 INC     =       $(HOME)/include
-HELP    =       $(HOME)/help
 SDIR    =       $(HOME)/dimm
 #
@@ -14,4 +13,5 @@
 DESTINC =       $(LINC)
 DESTMAN =       $(LMAN)
+DESTHLP =       $(LHLP)/dimm
 #  
 INCS    =       -I$(INC) -I$(LINC) -I$(XINC)
@@ -20,5 +20,5 @@
 LIBS2   =       -lbasiccmd -ldatacmd -lastrocmd -lshell -ldata -lsbig
 LIBS    =       $(LIBS2) $(LIBS1) 
-CFLAGS  =       $(INCS)
+CFLAGS  =       $(INCS) -DHELPDIR_DEFAULT=$(DESTHLP)
 CCFLAGS =       $(LIBS) 
 
@@ -65,5 +65,7 @@
 $(BIN)/dimm.$(ARCH) : $(dimm) $(libs)
 
-install: $(DESTBIN)/dimm
+install: $(DESTBIN)/dimm help
+
+help: cmd.basic.help cmd.data.help cmd.astro.help dimm.help
 
 # utilities #################################################
@@ -95,4 +97,15 @@
 	cp $^ $@
 
+clean:
+	rm -f $(BIN)/*.$(ARCH)
+	rm -f $(LIB)/*.$(ARCH).a
+	rm -f `find . -name "*.o"`
+	rm -f `find . -name "*~"`
+	rm -f `find . -name "#*"`
+
+dist: clean
+	rm -f $(BIN)/*
+	rm -f $(LIB)/*
+
 lib%.clean:
 	rm -f $(LIB)/lib$*.$(ARCH).a
@@ -107,12 +120,7 @@
 	$(CC) $(CFLAGS) -c $*.c -o $@
 
-clean:
-	rm -f $(BIN)/*.$(ARCH)
-	rm -f $(LIB)/*.$(ARCH).a
-	rm -f `find . -name "*.o"`
-	rm -f `find . -name "*~"`
-	rm -f `find . -name "#*"`
-
-dist: clean
-	rm -f $(BIN)/*
-	rm -f $(LIB)/*
+%.help:
+	@if [ ! -d $(DESTHLP) ]; then mkdir -p $(DESTHLP); fi
+	rm -f $(HOME)/$*/help/*~
+	rm -f $(HOME)/$*/help/#*
+	cp $(HOME)/$*/help/* $(DESTHLP)/
Index: /trunk/Ohana/src/opihi/dimm/dimm.c
===================================================================
--- /trunk/Ohana/src/opihi/dimm/dimm.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/dimm/dimm.c	(revision 4689)
@@ -7,19 +7,7 @@
 # define opihi_rcfile ".dimmrc"
 
-void InitBasic ();
-void InitData ();
-void InitAstro ();
-void InitDIMM ();
-
-void welcome () {
-  fprintf (stderr, "\n");
-  fprintf (stderr, "Welcome to %s - %s\n\n", opihi_name, opihi_description);
-}
-
 /* program-dependent initialization */
 void initialize (int argc, char **argv) {
   
-  FILE *f;
-
   auto_break = TRUE;
 
@@ -42,7 +30,7 @@
   InitBasic ();
   InitData ();
+  InitOutfile ();
   InitAstro ();
   InitDIMM ();
-  InitOutfile ();
 
   rl_readline_name = opihi_name;
@@ -52,19 +40,18 @@
   set_str_variable ("PROMPT", opihi_prompt);
   set_str_variable ("RCFILE", opihi_rcfile);
+# ifdef HELPDIR_DEFAULT
+  set_str_variable ("HELPDIR", MACRO_NAME(HELPDIR_DEFAULT));
+# endif
 
-  /* here we open the history file for append.  it this fails, we
-     won't be able to write to it, warn the user.  otherwise, this
-     creates the file readline will write to, if it did not exist */  
-
-  /* check history file */
-  /* rewrite with fstat or stat */
-  f = fopen (opihi_history, "a");
-  if (f == NULL) /* no current history file here */
-    fprintf (stderr, "can't save history.\n");
-  else
-    fclose (f);
-  
-  stifle_history (200);
-  read_history (opihi_history);
+  { /* check history file permission */
+    FILE *f;
+    f = fopen (opihi_history, "a");
+    if (f == NULL) /* no current history file here */
+      fprintf (stderr, "can't save history.\n");
+    else
+      fclose (f);
+    stifle_history (200);
+    read_history (opihi_history);
+  }
 
   signal (SIGINT, SIG_IGN);
@@ -72,7 +59,12 @@
 }
 
+/* standard welcome message */
+void welcome () {
+  fprintf (stderr, "\n");
+  fprintf (stderr, "Welcome to %s - %s\n\n", opihi_name, opihi_description);
+}
+
 /* add program-dependent exit functions here */
 void cleanup () {
-  /* -libdisplay */
   QuitImage ();
   QuitGraph ();
Index: /trunk/Ohana/src/opihi/dvo/ImageOps.c
===================================================================
--- /trunk/Ohana/src/opihi/dvo/ImageOps.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/dvo/ImageOps.c	(revision 4689)
@@ -11,4 +11,5 @@
   double r, d, X, Y, x[4], y[4], Rmin, Rmax, Rmid;
 
+  Rmin = Rmax = Rmid = 0;
   if (RegionSelect) {
     Rmin = graph[0].coords.crval1 - 182.0;
Index: /trunk/Ohana/src/opihi/dvo/Makefile
===================================================================
--- /trunk/Ohana/src/opihi/dvo/Makefile	(revision 4688)
+++ /trunk/Ohana/src/opihi/dvo/Makefile	(revision 4689)
@@ -7,5 +7,4 @@
 LIB     =       $(HOME)/lib
 INC     =       $(HOME)/include
-HELP    =       $(HOME)/help
 SDIR    =       $(HOME)/dvo
 #
@@ -14,4 +13,5 @@
 DESTINC =       $(LINC)
 DESTMAN =       $(LMAN)
+DESTHLP =       $(LHLP)/dvo
 #  
 INCS    =       -I$(INC) -I$(LINC) -I$(XINC)
@@ -20,5 +20,5 @@
 LIBS2   =       -lbasiccmd -ldatacmd -lastrocmd -lshell -ldata 
 LIBS    =       $(LIBS2) $(LIBS1) 
-CFLAGS  =       $(INCS)
+CFLAGS  =       $(INCS) -DHELPDIR_DEFAULT=$(DESTHLP)
 CCFLAGS =       $(LIBS) 
 
@@ -100,5 +100,7 @@
 $(BIN)/dvo.$(ARCH) : $(dvo) $(libs)
 
-install: $(DESTBIN)/dvo
+install: $(DESTBIN)/dvo help
+
+help: cmd.basic.help cmd.data.help cmd.astro.help dvo.help
 
 # utilities #################################################
@@ -153,5 +155,9 @@
 	$(CC) $(CFLAGS) -c $*.c -o $@
 
-
+%.help:
+	@if [ ! -d $(DESTHLP) ]; then mkdir -p $(DESTHLP); fi
+	rm -f $(HOME)/$*/help/*~
+	rm -f $(HOME)/$*/help/#*
+	cp $(HOME)/$*/help/* $(DESTHLP)/
 
 ## -*- makefile -*- 
Index: /trunk/Ohana/src/opihi/dvo/avextract.c
===================================================================
--- /trunk/Ohana/src/opihi/dvo/avextract.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/dvo/avextract.c	(revision 4689)
@@ -4,5 +4,5 @@
   
   int i, j, m, N, NPTS, param;
-  int Ngraph, Nsec, Nregions, mode;
+  int Nsec, Nregions, mode;
   char filename[256], catdir[256], *RegionName, *RegionList, *p;
 
Index: /trunk/Ohana/src/opihi/dvo/badimages.c
===================================================================
--- /trunk/Ohana/src/opihi/dvo/badimages.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/dvo/badimages.c	(revision 4689)
@@ -24,5 +24,7 @@
   }
   
+  Cross = FALSE;
   First = FALSE;
+  nominal = 1;
   if (!strcmp (argv[1], "-image")) {
     First = TRUE;
@@ -31,5 +33,4 @@
     entry = atof(argv[1]);
     nominal = atof(argv[2]);
-    Cross = FALSE;
     if (!strcasecmp (argv[1], "x")) {
       Cross = TRUE;
Index: /trunk/Ohana/src/opihi/dvo/calextract.c
===================================================================
--- /trunk/Ohana/src/opihi/dvo/calextract.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/dvo/calextract.c	(revision 4689)
@@ -8,5 +8,5 @@
   int Nsec, NSTAR;
   char filename[256], catdir[256], *RegionName, *RegionList;
-  double Radius, M1, M2, dM2, color;
+  double M1, M2, dM2, color;
 
   Catalog catalog;
@@ -22,4 +22,5 @@
   RegionName = NULL;
   RegionList = NULL;
+  vec = NULL;
 
   /* load photcode information */
@@ -87,4 +88,5 @@
       /* find data for filter 2 (PHOT_REF) */
       M2 = NO_MAG;
+      dM2 = NO_MAG;
       for (j = 0; j < catalog.average[i].Nm; j++) {
 	if (catalog.measure[m+j].source != code[1][0].code) continue;
Index: /trunk/Ohana/src/opihi/dvo/calmextract.c
===================================================================
--- /trunk/Ohana/src/opihi/dvo/calmextract.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/dvo/calmextract.c	(revision 4689)
@@ -9,5 +9,5 @@
   int NSTAR, Nstar, Nsec, Nregions;
   char filename[256], catdir[256], *RegionName, *RegionList;
-  double *M1, M2, dM2, color, Radius;
+  double *M1, M2, dM2, color;
 
   Catalog catalog;
@@ -23,4 +23,5 @@
   RegionName = NULL;
   RegionList = NULL;
+  vec = NULL;
 
   /* load photcode information */
@@ -100,4 +101,5 @@
       /* find data for filter 2 (REF) */
       M2 = NO_MAG;
+      dM2 = NO_MAG;
       for (j = 0; j < catalog.average[i].Nm; j++) {
 	if (catalog.measure[m+j].source != code[1][0].code) continue;
Index: /trunk/Ohana/src/opihi/dvo/catalog.c
===================================================================
--- /trunk/Ohana/src/opihi/dvo/catalog.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/dvo/catalog.c	(revision 4689)
@@ -76,5 +76,5 @@
   current_epoch = 2000.0;
   epoch = 2000.0;
-  if (N = get_argument (argc, argv, "-e")) {
+  if ((N = get_argument (argc, argv, "-e"))) {
     remove_argument (N, &argc, argv);
     epoch  = atof(argv[N]);
@@ -82,6 +82,7 @@
   }
 
+  IDchoice = 0;
   IDclip = FALSE;
-  if (N = get_argument (argc, argv, "-ID")) {
+  if ((N = get_argument (argc, argv, "-ID"))) {
     remove_argument (N, &argc, argv);
     IDchoice  = atof(argv[N]);
@@ -91,10 +92,10 @@
 
   LimExclude = FALSE;
-  if (N = get_argument (argc, argv, "-x")) {
+  if ((N = get_argument (argc, argv, "-x"))) {
     remove_argument (N, &argc, argv);
     LimExclude = TRUE;
   }
 
-  if (Nm = get_argument (argc, argv, "-m")) {
+  if ((Nm = get_argument (argc, argv, "-m"))) {
     remove_argument (Nm, &argc, argv);
     Mr  = 1000*atof(argv[Nm]);
@@ -105,5 +106,5 @@
   }
 
-  if (Nn = get_argument (argc, argv, "+n")) {
+  if ((Nn = get_argument (argc, argv, "+n"))) {
     remove_argument (Nn, &argc, argv);
     Nz  = atof(argv[Nn]);
@@ -113,5 +114,5 @@
   }
 
-  if (Nn = get_argument (argc, argv, "-n")) {
+  if ((Nn = get_argument (argc, argv, "-n"))) {
     remove_argument (Nn, &argc, argv);
     Nz  = atof(argv[Nn]);
@@ -122,14 +123,15 @@
 
   InRegion = FALSE;
-  if (N = get_argument (argc, argv, "-all")) {
+  if ((N = get_argument (argc, argv, "-all"))) {
     remove_argument (N, &argc, argv);
     InRegion = TRUE;
   }
 
+  Bytes_Star = 0;
   ASCII = FALSE;
   DVO = TRUE;
   GSC = FALSE;
   FIXED = FALSE;
-  if (N = get_argument (argc, argv, "-g")) {
+  if ((N = get_argument (argc, argv, "-g"))) {
     remove_argument (N, &argc, argv);
     GSC = TRUE;
@@ -138,5 +140,5 @@
   }
 
-  if (N = get_argument (argc, argv, "-a")) {
+  if ((N = get_argument (argc, argv, "-a"))) {
     remove_argument (N, &argc, argv);
     ASCII = TRUE;
@@ -149,5 +151,5 @@
     Am = atof(argv[N]);
     remove_argument (N, &argc, argv);
-    if (N = get_argument (argc, argv, "-f")) {
+    if ((N = get_argument (argc, argv, "-f"))) {
       remove_argument (N, &argc, argv);
       FIXED = TRUE;
Index: /trunk/Ohana/src/opihi/dvo/ccd.c
===================================================================
--- /trunk/Ohana/src/opihi/dvo/ccd.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/dvo/ccd.c	(revision 4689)
@@ -4,9 +4,8 @@
   
   char filename[256], catdir[256], *RegionName, *RegionList;
-  double Radius;
   double *M1, *M2;
   int i, m, k, Npts, NPTS, N;
   int N1, N2, i1, i2, mode[4];
-  int Ngraph, Nsec, Nregions, KeepNulls;
+  int Nsec, Nregions, KeepNulls;
 
   Catalog catalog;
@@ -35,5 +34,5 @@
 
   KeepNulls = FALSE;
-  if (N = get_argument (argc, argv, "-nulls")) {
+  if ((N = get_argument (argc, argv, "-nulls"))) {
     KeepNulls = TRUE;
     remove_argument (N, &argc, argv);
Index: /trunk/Ohana/src/opihi/dvo/cmd.c
===================================================================
--- /trunk/Ohana/src/opihi/dvo/cmd.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/dvo/cmd.c	(revision 4689)
@@ -4,11 +4,10 @@
   
   char filename[256], catdir[256], *RegionName, *RegionList;
-  double Radius, *M1, *M3;
+  double *M1, *M3;
   int i, j, m, i1, i3, N1, N3, N;
   int Npts, NPTS, mode[3];
-  int Ngraph, Nsec, Nregions, KeepNulls;
+  int Nsec, Nregions, KeepNulls;
 
   Catalog catalog;
-  Graphdata graphsky;
   RegionFile *regions;
   PhotCode *code[3];
@@ -35,5 +34,5 @@
 
   KeepNulls = FALSE;
-  if (N = get_argument (argc, argv, "-nulls")) {
+  if ((N = get_argument (argc, argv, "-nulls"))) {
     KeepNulls = TRUE;
     remove_argument (N, &argc, argv);
Index: /trunk/Ohana/src/opihi/dvo/cmpload.c
===================================================================
--- /trunk/Ohana/src/opihi/dvo/cmpload.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/dvo/cmpload.c	(revision 4689)
@@ -17,5 +17,5 @@
   
   Nimage = -1;
-  if (N = get_argument (argc, argv, "-n")) {
+  if ((N = get_argument (argc, argv, "-n"))) {
     remove_argument (N, &argc, argv);
     Nimage = atof (argv[N]);
@@ -25,5 +25,5 @@
 
   Type = 0;
-  if (N = get_argument (argc, argv, "-t")) {
+  if ((N = get_argument (argc, argv, "-t"))) {
     remove_argument (N, &argc, argv);
     Type = atof (argv[N]);
Index: /trunk/Ohana/src/opihi/dvo/cmpread.c
===================================================================
--- /trunk/Ohana/src/opihi/dvo/cmpread.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/dvo/cmpread.c	(revision 4689)
@@ -23,4 +23,10 @@
     return (FALSE);
   }
+
+  R = D = V = NULL;
+  file = NULL;
+  name = NULL;
+  Nfield = Nra = Ndec = 0;
+  RAnDEC = FALSE;
 
   if (argc == 4) {
Index: /trunk/Ohana/src/opihi/dvo/ddmags.c
===================================================================
--- /trunk/Ohana/src/opihi/dvo/ddmags.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/dvo/ddmags.c	(revision 4689)
@@ -4,9 +4,8 @@
   
   char filename[256], catdir[256], *RegionName, *RegionList;
-  double Radius;
   double *M1, *M2;
   int i, m, k, N, Npts, NPTS;
   int N1, N2, i1, i2, mode[4];
-  int Ngraph, Nsec, Nregions, KeepNulls;
+  int Nsec, Nregions, KeepNulls;
 
   Catalog catalog;
@@ -35,5 +34,5 @@
 
   KeepNulls = FALSE;
-  if (N = get_argument (argc, argv, "-nulls")) {
+  if ((N = get_argument (argc, argv, "-nulls"))) {
     KeepNulls = TRUE;
     remove_argument (N, &argc, argv);
Index: /trunk/Ohana/src/opihi/dvo/detrend.c
===================================================================
--- /trunk/Ohana/src/opihi/dvo/detrend.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/dvo/detrend.c	(revision 4689)
@@ -4,5 +4,5 @@
 enum {ZERO, DTIME, SKY, BIAS, FWHM, AIRM, TIME, TEMP};
 
-detrend (int argc, char **argv) {
+int detrend (int argc, char **argv) {
  
   FILE *f;
@@ -25,5 +25,5 @@
 
   TimeSelect = FALSE;
-  if (N = get_argument (argc, argv, "-time")) {
+  if ((N = get_argument (argc, argv, "-time"))) {
     remove_argument (N, &argc, argv);
     if (!str_to_time (argv[N], &tzero)) { 
@@ -43,5 +43,5 @@
     TimeSelect = TRUE;
   }
-  if (N = get_argument (argc, argv, "-trange")) {
+  if ((N = get_argument (argc, argv, "-trange"))) {
     remove_argument (N, &argc, argv);
     if (!str_to_time (argv[N], &tzero)) { 
@@ -63,6 +63,7 @@
   }
  
+  Type = 0;
   TypeSelect = FALSE;
-  if (N = get_argument (argc, argv, "-type")) {
+  if ((N = get_argument (argc, argv, "-type"))) {
     remove_argument (N, &argc, argv);
     Type = get_image_type (argv[N]);
@@ -75,6 +76,7 @@
   }
 
+  CCD = 0;
   CCDSelect = FALSE;
-  if (N = get_argument (argc, argv, "-ccd")) {
+  if ((N = get_argument (argc, argv, "-ccd"))) {
     remove_argument (N, &argc, argv);
     CCD = atoi (argv[N]);
@@ -83,6 +85,7 @@
   }
  
+  Filter = NULL;
   FilterSelect = FALSE;
-  if (N = get_argument (argc, argv, "-filter")) {
+  if ((N = get_argument (argc, argv, "-filter"))) {
     remove_argument (N, &argc, argv);
     Filter = strcreate (argv[N]);
@@ -149,5 +152,5 @@
 
   GetTimeFormat (&TimeReference, &TimeFormat);
-  fprintf (stderr, "%d %d\n", TimeReference, TimeFormat);
+  fprintf (stderr, "%ld %d\n", TimeReference, TimeFormat);
 
   /* get data */
Index: /trunk/Ohana/src/opihi/dvo/dmagaves.c
===================================================================
--- /trunk/Ohana/src/opihi/dvo/dmagaves.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/dvo/dmagaves.c	(revision 4689)
@@ -4,8 +4,8 @@
   
   char filename[256], catdir[256], *RegionName, *RegionList;
-  double Radius, *M1, M2;
-  int i, j, k, m, N1, N;
+  double *M1, M2;
+  int i, j, k, m, N1;
   int Npts, NPTS, param, mode[3];
-  int Ngraph, Nsec, Nregions;
+  int Nsec, Nregions;
 
   Catalog catalog;
Index: /trunk/Ohana/src/opihi/dvo/dmagmeas.c
===================================================================
--- /trunk/Ohana/src/opihi/dvo/dmagmeas.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/dvo/dmagmeas.c	(revision 4689)
@@ -4,8 +4,8 @@
   
   char filename[256], catdir[256], *RegionName, *RegionList;
-  double Radius, *M1, *M3;
-  int i, j, k, m, i1, i3, N1, N3, N;
+  double *M1, *M3;
+  int i, j, m, i1, i3, N1, N3, N;
   int Npts, NPTS, param, mode[3];
-  int Ngraph, Nsec, Nregions, KeepNulls;
+  int Nsec, Nregions, KeepNulls;
 
   Catalog catalog;
@@ -35,5 +35,5 @@
 
   KeepNulls = FALSE;
-  if (N = get_argument (argc, argv, "-nulls")) {
+  if ((N = get_argument (argc, argv, "-nulls"))) {
     KeepNulls = TRUE;
     remove_argument (N, &argc, argv);
Index: /trunk/Ohana/src/opihi/dvo/dmags.c
===================================================================
--- /trunk/Ohana/src/opihi/dvo/dmags.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/dvo/dmags.c	(revision 4689)
@@ -4,5 +4,5 @@
   
   char filename[256], catdir[256], *RegionName, *RegionList;
-  double Radius, *M1, *M3;
+  double *M1, *M3;
   int i, j, m, i1, i3, N1, N3, N;
   int Npts, NPTS, mode[3];
@@ -34,5 +34,5 @@
 
   KeepNulls = FALSE;
-  if (N = get_argument (argc, argv, "-nulls")) {
+  if ((N = get_argument (argc, argv, "-nulls"))) {
     KeepNulls = TRUE;
     remove_argument (N, &argc, argv);
Index: /trunk/Ohana/src/opihi/dvo/dmt.c
===================================================================
--- /trunk/Ohana/src/opihi/dvo/dmt.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/dvo/dmt.c	(revision 4689)
@@ -20,6 +20,7 @@
   if (!InitPhotcodes ()) return (FALSE);
 
+  vec1 = vec2 = vec3 = vec4 = vec5 = NULL;
   SaveVectors = FALSE;
-  if (N = get_argument (argc, argv, "-vect")) {
+  if ((N = get_argument (argc, argv, "-vect"))) {
     remove_argument (N, &argc, argv);
     if ((vec1 = SelectVector ("dmtdmt", ANYVECTOR, TRUE)) == NULL) return (FALSE);
Index: /trunk/Ohana/src/opihi/dvo/dvo.c
===================================================================
--- /trunk/Ohana/src/opihi/dvo/dvo.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/dvo/dvo.c	(revision 4689)
@@ -1,3 +1,3 @@
-# include "opihi.h"
+# include "dvo1.h"
 
 # define opihi_name "DVO"
@@ -7,19 +7,7 @@
 # define opihi_rcfile ".dvorc"
 
-void InitBasic ();
-void InitData ();
-void InitAstro ();
-void InitDVO ();
-
-void welcome () {
-  fprintf (stderr, "\n");
-  fprintf (stderr, "Welcome to %s - %s\n\n", opihi_name, opihi_description);
-}
-
 /* program-dependent initialization */
 void initialize (int argc, char **argv) {
   
-  FILE *f;
-
   auto_break = TRUE;
 
@@ -42,7 +30,7 @@
   InitBasic ();
   InitData ();
+  InitOutfile ();
   InitAstro ();
   InitDVO ();
-  InitOutfile ();
 
   rl_readline_name = opihi_name;
@@ -52,19 +40,18 @@
   set_str_variable ("PROMPT", opihi_prompt);
   set_str_variable ("RCFILE", opihi_rcfile);
+# ifdef HELPDIR_DEFAULT
+  set_str_variable ("HELPDIR", MACRO_NAME(HELPDIR_DEFAULT));
+# endif
 
-  /* here we open the history file for append.  it this fails, we
-     won't be able to write to it, warn the user.  otherwise, this
-     creates the file readline will write to, if it did not exist */  
-
-  /* check history file */
-  /* rewrite with fstat or stat */
-  f = fopen (opihi_history, "a");
-  if (f == NULL) /* no current history file here */
-    fprintf (stderr, "can't save history.\n");
-  else
-    fclose (f);
-  
-  stifle_history (200);
-  read_history (opihi_history);
+  { /* check history file permission */
+    FILE *f;
+    f = fopen (opihi_history, "a");
+    if (f == NULL) /* no current history file here */
+      fprintf (stderr, "can't save history.\n");
+    else
+      fclose (f);
+    stifle_history (200);
+    read_history (opihi_history);
+  }
 
   signal (SIGINT, SIG_IGN);
@@ -72,7 +59,12 @@
 }
 
+/* standard welcome message */
+void welcome () {
+  fprintf (stderr, "\n");
+  fprintf (stderr, "Welcome to %s - %s\n\n", opihi_name, opihi_description);
+}
+
 /* add program-dependent exit functions here */
 void cleanup () {
-  /* -libdisplay */
   QuitImage ();
   QuitGraph ();
Index: /trunk/Ohana/src/opihi/dvo/elixir.c
===================================================================
--- /trunk/Ohana/src/opihi/dvo/elixir.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/dvo/elixir.c	(revision 4689)
@@ -1,3 +1,6 @@
 # include "dvo1.h"
+
+int WriteMsg (char *fifo, char *message);
+int ReadMsg (char *fifo, char **message);
 
 int elixir (int argc, char **argv) {
@@ -9,17 +12,17 @@
 
   sprintf (cmd, "STATUS");
-  if (N = get_argument (argc, argv, "-time")) {
+  if ((N = get_argument (argc, argv, "-time"))) {
     remove_argument (N, &argc, argv);
     sprintf (cmd, "TIMES");
   }
-  if (N = get_argument (argc, argv, "-live")) {
+  if ((N = get_argument (argc, argv, "-live"))) {
     remove_argument (N, &argc, argv);
     sprintf (cmd, "ALIVE");
   }
-  if (N = get_argument (argc, argv, "-stop")) {
+  if ((N = get_argument (argc, argv, "-stop"))) {
     remove_argument (N, &argc, argv);
     sprintf (cmd, "STOP");
   }
-  if (N = get_argument (argc, argv, "-kill")) {
+  if ((N = get_argument (argc, argv, "-kill"))) {
     remove_argument (N, &argc, argv);
     sprintf (cmd, "ABORT");
Index: /trunk/Ohana/src/opihi/dvo/find_regions.c
===================================================================
--- /trunk/Ohana/src/opihi/dvo/find_regions.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/dvo/find_regions.c	(revision 4689)
@@ -154,2 +154,3 @@
   
 }
+
Index: /trunk/Ohana/src/opihi/dvo/fitcolors.c
===================================================================
--- /trunk/Ohana/src/opihi/dvo/fitcolors.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/dvo/fitcolors.c	(revision 4689)
@@ -10,11 +10,10 @@
 int fitcolors (int argc, char **argv) {
   
-  int *list, Nlist, Ncode;
+  int *list, Nlist;
   int i, k, m, NP1, NP2, NP, Np, Npts, NPTS;
   int N1, N2, i1, i2, mode[4];
-  int Nsec, Nregions, Ncatalog, status;
+  int Nsec, Nregions, status;
   char catdir[256], filename[256], *RegionName, *RegionList;
   char *cmd, *outcmd, *camera;
-  double Radius;
   double *M1, *M2;
   float *out;
@@ -200,5 +199,6 @@
   DeleteVector (xvec);
   DeleteVector (yvec);
-  free_catalog (catalog, Ncatalog);
+  free_catalog (catalog, Nregions);
+  return (FALSE);
 }
 
Index: /trunk/Ohana/src/opihi/dvo/gimages.c
===================================================================
--- /trunk/Ohana/src/opihi/dvo/gimages.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/dvo/gimages.c	(revision 4689)
@@ -18,5 +18,5 @@
 
   TimeSelect = FALSE;
-  if (N = get_argument (argc, argv, "-time")) {
+  if ((N = get_argument (argc, argv, "-time"))) {
     remove_argument (N, &argc, argv);
     if (!str_to_time (argv[N], &tzero)) { 
@@ -32,5 +32,5 @@
     TimeSelect = TRUE;
   }
-  if (N = get_argument (argc, argv, "-tref")) {
+  if ((N = get_argument (argc, argv, "-tref"))) {
     remove_argument (N, &argc, argv);
     TimeSelect = TRUE;
@@ -47,6 +47,7 @@
   }
 
+  code = NULL;
   PhotCodeSelect = FALSE;
-  if (N = get_argument (argc, argv, "-photcode")) {
+  if ((N = get_argument (argc, argv, "-photcode"))) {
     remove_argument (N, &argc, argv);
     if ((code = GetPhotcodebyName (argv[N])) == NULL) {
@@ -59,5 +60,5 @@
 
   PixelCoords = FALSE;
-  if (N = get_argument (argc, argv, "-pix")) {
+  if ((N = get_argument (argc, argv, "-pix"))) {
     remove_argument (N, &argc, argv);
     PixelCoords = TRUE;
Index: /trunk/Ohana/src/opihi/dvo/gstar.c
===================================================================
--- /trunk/Ohana/src/opihi/dvo/gstar.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/dvo/gstar.c	(revision 4689)
@@ -7,5 +7,5 @@
   char filename[128], catdir[256], *date;
   double Ra, Dec, Radius, Radius2, r, dec0, dec1;
-  double t, Mcat, Mrel;
+  double Mcat, Mrel;
   float *RA, *DEC;
   int i, j, k, m, N, *N1, Nregions, Nsec, NPTS;
@@ -21,6 +21,8 @@
   Nsec = GetPhotcodeNsecfilt ();
 
+  NPTS = 0;
+  vec1 = vec2 = vec3 = vec4 = NULL;
   SaveVectors = FALSE;
-  if (N = get_argument (argc, argv, "-save")) {
+  if ((N = get_argument (argc, argv, "-save"))) {
     remove_argument (N, &argc, argv);
     SaveVectors = TRUE;
@@ -32,5 +34,5 @@
 
   GetMeasures = FALSE;
-  if (N = get_argument (argc, argv, "-m")) {
+  if ((N = get_argument (argc, argv, "-m"))) {
     GetMeasures = TRUE;
     remove_argument (N, &argc, argv);
@@ -170,5 +172,5 @@
 	  if (SaveVectors) {
 	    vec1[0].elements[N] = Mcat;
-	    vec2[0].elements[N] = t;
+	    vec2[0].elements[N] = catalog.measure[m].t;
 	    vec3[0].elements[N] = 0.001*catalog.measure[m].airmass;
 	    vec4[0].elements[N] = catalog.measure[m].source;
Index: /trunk/Ohana/src/opihi/dvo/images.c
===================================================================
--- /trunk/Ohana/src/opihi/dvo/images.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/dvo/images.c	(revision 4689)
@@ -17,5 +17,5 @@
 
   ByName = FALSE;
-  if (N = get_argument (argc, argv, "-name")) {
+  if ((N = get_argument (argc, argv, "-name"))) {
     remove_argument (N, &argc, argv);
     strcpy (name, argv[N]);
@@ -25,5 +25,5 @@
 
   TimeSelect = FALSE;
-  if (N = get_argument (argc, argv, "-time")) {
+  if ((N = get_argument (argc, argv, "-time"))) {
     remove_argument (N, &argc, argv);
     if (!str_to_time (argv[N], &tzero)) { 
@@ -43,5 +43,5 @@
     TimeSelect = TRUE;
   }
-  if (N = get_argument (argc, argv, "-trange")) {
+  if ((N = get_argument (argc, argv, "-trange"))) {
     remove_argument (N, &argc, argv);
     if (!str_to_time (argv[N], &tzero)) { 
Index: /trunk/Ohana/src/opihi/dvo/imdata.c
===================================================================
--- /trunk/Ohana/src/opihi/dvo/imdata.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/dvo/imdata.c	(revision 4689)
@@ -16,6 +16,7 @@
   Vector *vec;
 
+  start = stop = 0;
   TimeSelect = FALSE;
-  if (N = get_argument (argc, argv, "-time")) {
+  if ((N = get_argument (argc, argv, "-time"))) {
     remove_argument (N, &argc, argv);
     if (!str_to_time (argv[N], &tzero)) { 
Index: /trunk/Ohana/src/opihi/dvo/imextract.c
===================================================================
--- /trunk/Ohana/src/opihi/dvo/imextract.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/dvo/imextract.c	(revision 4689)
@@ -21,5 +21,5 @@
   /* check for time-based selection */
   TimeSelect = FALSE;
-  if (N = get_argument (argc, argv, "-time")) {
+  if ((N = get_argument (argc, argv, "-time"))) {
     remove_argument (N, &argc, argv);
     if (!str_to_time (argv[N], &tzero)) { 
@@ -38,5 +38,5 @@
   /* check for region-based selection */
   RegionSelect = FALSE;
-  if (N = get_argument (argc, argv, "-region")) {
+  if ((N = get_argument (argc, argv, "-region"))) {
     remove_argument (N, &argc, argv);
     RegionSelect = TRUE;
@@ -44,6 +44,7 @@
 
   /* check for region-based selection */
+  FlagValue = 0;
   FlagSelect = FALSE;
-  if (N = get_argument (argc, argv, "-flag")) {
+  if ((N = get_argument (argc, argv, "-flag"))) {
     remove_argument (N, &argc, argv);
     FlagValue = atoi (argv[N]);
@@ -55,5 +56,5 @@
   code = NULL;
   PhotcodeSelect = FALSE;
-  if (N = get_argument (argc, argv, "-photcode")) {
+  if ((N = get_argument (argc, argv, "-photcode"))) {
     PhotcodeSelect = TRUE;
     remove_argument (N, &argc, argv);
Index: /trunk/Ohana/src/opihi/dvo/imlist.c
===================================================================
--- /trunk/Ohana/src/opihi/dvo/imlist.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/dvo/imlist.c	(revision 4689)
@@ -17,5 +17,5 @@
 
   TimeSelect = FALSE;
-  if (N = get_argument (argc, argv, "-time")) {
+  if ((N = get_argument (argc, argv, "-time"))) {
     remove_argument (N, &argc, argv);
     if (!str_to_time (argv[N], &tzero)) { 
@@ -34,11 +34,12 @@
 
   RegionSelect = FALSE;
-  if (N = get_argument (argc, argv, "-region")) {
+  if ((N = get_argument (argc, argv, "-region"))) {
     remove_argument (N, &argc, argv);
     RegionSelect = TRUE;
   }
 
+  PhotcodeValue = NULL;
   PhotcodeSelect = FALSE;
-  if (N = get_argument (argc, argv, "-photcode")) {
+  if ((N = get_argument (argc, argv, "-photcode"))) {
     PhotcodeSelect = TRUE;
     remove_argument (N, &argc, argv);
@@ -51,6 +52,7 @@
   }
 
+  name = NULL;
   NameSelect = FALSE;
-  if (N = get_argument (argc, argv, "-name")) {
+  if ((N = get_argument (argc, argv, "-name"))) {
     remove_argument (N, &argc, argv);
     name = strcreate (argv[N]);
Index: /trunk/Ohana/src/opihi/dvo/imphot.c
===================================================================
--- /trunk/Ohana/src/opihi/dvo/imphot.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/dvo/imphot.c	(revision 4689)
@@ -14,5 +14,5 @@
 
   GreyScale = FALSE;
-  if (N = get_argument (argc, argv, "-g")) {
+  if ((N = get_argument (argc, argv, "-g"))) {
     remove_argument (N, &argc, argv);
     strcpy (bufname, argv[N]);
@@ -26,4 +26,5 @@
   }
 
+  buf = NULL;
   if (GreyScale) {
     if ((buf = SelectBuffer (bufname, ANYBUFFER, TRUE)) == NULL) return (FALSE);
Index: /trunk/Ohana/src/opihi/dvo/imrough.c
===================================================================
--- /trunk/Ohana/src/opihi/dvo/imrough.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/dvo/imrough.c	(revision 4689)
@@ -6,5 +6,5 @@
 static char valuename[NVALUE][32] = {"none", "exptime", "ccd", "sky", "bias", "filter", "fwhm", "airmass", "time", "temp0", "temp1", "temp2", "temp3", "telfocus", "xprobe", "yprobe", "zprobe", "ra", "dec", "dettemp", "rotangle", "regtime"};
 
-imrough (int argc, char **argv) {
+int imrough (int argc, char **argv) {
  
   int i, N, Nimage, TimeSelect;
@@ -21,5 +21,5 @@
 
   TimeSelect = FALSE;
-  if (N = get_argument (argc, argv, "-time")) {
+  if ((N = get_argument (argc, argv, "-time"))) {
     remove_argument (N, &argc, argv);
     if (!str_to_time (argv[N], &tzero)) { 
@@ -39,5 +39,5 @@
     TimeSelect = TRUE;
   }
-  if (N = get_argument (argc, argv, "-trange")) {
+  if ((N = get_argument (argc, argv, "-trange"))) {
     remove_argument (N, &argc, argv);
     if (!str_to_time (argv[N], &tzero)) { 
@@ -61,5 +61,5 @@
   type = T_UNDEF;
   TypeSelect = FALSE;
-  if (N = get_argument (argc, argv, "-type")) {
+  if ((N = get_argument (argc, argv, "-type"))) {
     TypeSelect = TRUE;
     remove_argument (N, &argc, argv);
@@ -74,5 +74,5 @@
   mode = M_NONE;
   ModeSelect = FALSE;
-  if (N = get_argument (argc, argv, "-mode")) {
+  if ((N = get_argument (argc, argv, "-mode"))) {
     ModeSelect = TRUE;
     remove_argument (N, &argc, argv);
@@ -85,6 +85,7 @@
   }
 
+  CCD = 0;
   CCDSelect = FALSE;
-  if (N = get_argument (argc, argv, "-ccd")) {
+  if ((N = get_argument (argc, argv, "-ccd"))) {
     remove_argument (N, &argc, argv);
     CCD = atoi (argv[N]);
@@ -93,6 +94,7 @@
   }
  
+  Filter = NULL;
   FilterSelect = FALSE;
-  if (N = get_argument (argc, argv, "-filter")) {
+  if ((N = get_argument (argc, argv, "-filter"))) {
     remove_argument (N, &argc, argv);
     Filter = strcreate (argv[N]);
Index: /trunk/Ohana/src/opihi/dvo/imsearch.c
===================================================================
--- /trunk/Ohana/src/opihi/dvo/imsearch.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/dvo/imsearch.c	(revision 4689)
@@ -1,5 +1,5 @@
 # include "dvo1.h"
 
-imsearch (int argc, char **argv) {
+int imsearch (int argc, char **argv) {
  
   char DataBase[256], name[64];
@@ -17,5 +17,5 @@
 
   SaveNames = FALSE;
-  if (N = get_argument (argc, argv, "-save")) {
+  if ((N = get_argument (argc, argv, "-save"))) {
     remove_argument (N, &argc, argv);
     SaveNames = TRUE;
@@ -23,5 +23,5 @@
  
   TimeSelect = FALSE;
-  if (N = get_argument (argc, argv, "-time")) {
+  if ((N = get_argument (argc, argv, "-time"))) {
     remove_argument (N, &argc, argv);
     if (!str_to_time (argv[N], &tzero)) { 
@@ -38,6 +38,7 @@
   }
  
+  Type = 0;
   TypeSelect = FALSE;
-  if (N = get_argument (argc, argv, "-type")) {
+  if ((N = get_argument (argc, argv, "-type"))) {
     remove_argument (N, &argc, argv);
     Type = get_image_type (argv[N]);
@@ -50,6 +51,7 @@
   }
  
+  Mode = 0;
   ModeSelect = FALSE;
-  if (N = get_argument (argc, argv, "-mode")) {
+  if ((N = get_argument (argc, argv, "-mode"))) {
     remove_argument (N, &argc, argv);
     Mode = get_image_mode (argv[N]);
@@ -62,6 +64,7 @@
   }
  
+  CCD = 0;
   CCDSelect = FALSE;
-  if (N = get_argument (argc, argv, "-ccd")) {
+  if ((N = get_argument (argc, argv, "-ccd"))) {
     remove_argument (N, &argc, argv);
     CCD = atoi (argv[N]);
@@ -70,6 +73,7 @@
   }
  
+  Filter = NULL;
   FilterSelect = FALSE;
-  if (N = get_argument (argc, argv, "-filter")) {
+  if ((N = get_argument (argc, argv, "-filter"))) {
     remove_argument (N, &argc, argv);
     Filter = strcreate (argv[N]);
Index: /trunk/Ohana/src/opihi/dvo/imstats.c
===================================================================
--- /trunk/Ohana/src/opihi/dvo/imstats.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/dvo/imstats.c	(revision 4689)
@@ -11,5 +11,5 @@
 
   Ngraph = -1;
-  if (N = get_argument (argc, argv, "-n")) {
+  if ((N = get_argument (argc, argv, "-n"))) {
     remove_argument (N, &argc, argv);
     Ngraph = atof (argv[N]);
@@ -19,5 +19,5 @@
 
   Mcal = TRUE;
-  if (N = get_argument (argc, argv, "-dM")) {
+  if ((N = get_argument (argc, argv, "-dM"))) {
     remove_argument (N, &argc, argv);
     Mcal = FALSE;
@@ -25,5 +25,5 @@
 
   AutoLimits = FALSE;
-  if (N = get_argument (argc, argv, "-l")) {
+  if ((N = get_argument (argc, argv, "-l"))) {
     remove_argument (N, &argc, argv);
     AutoLimits = TRUE;
Index: /trunk/Ohana/src/opihi/dvo/lcat.c
===================================================================
--- /trunk/Ohana/src/opihi/dvo/lcat.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/dvo/lcat.c	(revision 4689)
@@ -18,5 +18,5 @@
 
   ShowAll = FALSE;
-  if (N = get_argument (argc, argv, "-all")) {
+  if ((N = get_argument (argc, argv, "-all"))) {
     remove_argument (N, &argc, argv);
     ShowAll = TRUE;
Index: /trunk/Ohana/src/opihi/dvo/lcurve.c
===================================================================
--- /trunk/Ohana/src/opihi/dvo/lcurve.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/dvo/lcurve.c	(revision 4689)
@@ -21,5 +21,5 @@
 
   Ngraph = -1;
-  if (N = get_argument (argc, argv, "-n")) {
+  if ((N = get_argument (argc, argv, "-n"))) {
     remove_argument (N, &argc, argv);
     Ngraph = atof (argv[N]);
@@ -29,11 +29,12 @@
 
   AutoLimits = FALSE;
-  if (N = get_argument (argc, argv, "-l")) {
+  if ((N = get_argument (argc, argv, "-l"))) {
     remove_argument (N, &argc, argv);
     AutoLimits = TRUE;
   }
 
+  xvec = yvec = NULL;
   SaveVectors = FALSE;
-  if (N = get_argument (argc, argv, "-v")) {
+  if ((N = get_argument (argc, argv, "-v"))) {
     remove_argument (N, &argc, argv);
     SaveVectors = TRUE;
@@ -45,5 +46,5 @@
 
   AbsPhot = FALSE;
-  if (N = get_argument (argc, argv, "-abs")) {
+  if ((N = get_argument (argc, argv, "-abs"))) {
     remove_argument (N, &argc, argv);
     AbsPhot = TRUE;
@@ -51,5 +52,5 @@
 
   GalMag = FALSE;
-  if (N = get_argument (argc, argv, "-gal")) {
+  if ((N = get_argument (argc, argv, "-gal"))) {
     fprintf (stderr, "galaxy magnitudes currently disabled\n");
     return (FALSE);
@@ -57,5 +58,5 @@
 
   ErrorBars = FALSE;
-  if (N = get_argument (argc, argv, "-d")) {
+  if ((N = get_argument (argc, argv, "-d"))) {
     remove_argument (N, &argc, argv);
     ErrorBars = TRUE;
Index: /trunk/Ohana/src/opihi/dvo/lightcurve.c
===================================================================
--- /trunk/Ohana/src/opihi/dvo/lightcurve.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/dvo/lightcurve.c	(revision 4689)
@@ -28,4 +28,5 @@
   }
 
+  code = NULL;
   PhotCodeSelect = FALSE;
   if ((N = get_argument (argc, argv, "-photcode"))) {
Index: /trunk/Ohana/src/opihi/dvo/mextract.c
===================================================================
--- /trunk/Ohana/src/opihi/dvo/mextract.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/dvo/mextract.c	(revision 4689)
@@ -6,5 +6,5 @@
   int param, mode, Nregions, Nsec;
   char filename[128], catdir[256], *RegionName, *RegionList, *p;
-  double Radius, *M1;
+  double *M1;
 
   PhotCode *code;
Index: /trunk/Ohana/src/opihi/dvo/pcat.c
===================================================================
--- /trunk/Ohana/src/opihi/dvo/pcat.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/dvo/pcat.c	(revision 4689)
@@ -17,5 +17,5 @@
 
   ShowAll = FALSE;
-  if (N = get_argument (argc, argv, "-all")) {
+  if ((N = get_argument (argc, argv, "-all"))) {
     remove_argument (N, &argc, argv);
     ShowAll = TRUE;
Index: /trunk/Ohana/src/opihi/dvo/photometry.c
===================================================================
--- /trunk/Ohana/src/opihi/dvo/photometry.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/dvo/photometry.c	(revision 4689)
@@ -329,5 +329,5 @@
   double trange;
 
-  if (N = get_argument (*argc, argv, "-phothelp")) {
+  if ((N = get_argument (*argc, argv, "-phothelp"))) {
     fprintf (stderr, "optional photometry selection criteria:\n");
     fprintf (stderr, " -magrange min max\n");
@@ -346,5 +346,5 @@
   /* select based on measured mag (MEASURE ONLY) */
   MagSelect = FALSE;
-  if (N = get_argument (*argc, argv, "-magrange")) {
+  if ((N = get_argument (*argc, argv, "-magrange"))) {
     MagSelect = TRUE;
     remove_argument (N, argc, argv);
@@ -357,5 +357,5 @@
   /* select based on instrument mag (MEASURE ONLY) */
   iMagSelect = FALSE;
-  if (N = get_argument (*argc, argv, "-imaglim")) {
+  if ((N = get_argument (*argc, argv, "-imaglim"))) {
     iMagSelect = TRUE;
     remove_argument (N, argc, argv);
@@ -366,5 +366,5 @@
   /* select on value of flag (MEASURE ONLY) */
   FlagSelect = FALSE;
-  if (N = get_argument (*argc, argv, "-flag")) {
+  if ((N = get_argument (*argc, argv, "-flag"))) {
     FlagSelect = TRUE;
     remove_argument (N, argc, argv);
@@ -375,5 +375,5 @@
   /* select on value of Chisq (AVERAGE ONLY) */
   for (i = 0; i < 4; i++) ApplySelections[i] = TRUE;
-  if (N = get_argument (*argc, argv, "-apply")) {
+  if ((N = get_argument (*argc, argv, "-apply"))) {
     remove_argument (N, argc, argv);
     if (strlen(argv[N]) != Nparams) {
@@ -393,5 +393,5 @@
   /* select on value of photcode */
   PhotcodeSelect = FALSE;
-  if (N = get_argument (*argc, argv, "-photcode")) {
+  if ((N = get_argument (*argc, argv, "-photcode"))) {
     PhotcodeSelect = TRUE;
     remove_argument (N, argc, argv);
@@ -406,5 +406,5 @@
   /* selection on basis of time range (MEASURE only) */
   TimeSelect = FALSE;
-  if (N = get_argument (*argc, argv, "-time")) {
+  if ((N = get_argument (*argc, argv, "-time"))) {
     remove_argument (N, argc, argv);
     if (!str_to_time (argv[N], &tzero)) { 
@@ -430,5 +430,5 @@
   /* select by error (on measure or average) */
   ErrSelect = FALSE;
-  if (N = get_argument (*argc, argv, "-errorlim")) {
+  if ((N = get_argument (*argc, argv, "-errorlim"))) {
     remove_argument (N, argc, argv);
     ErrValue = 1000*atof (argv[N]);
@@ -439,5 +439,5 @@
   /* select on value of Chisq (AVERAGE ONLY) */
   ChiSelect = FALSE;
-  if (N = get_argument (*argc, argv, "-chisq")) {
+  if ((N = get_argument (*argc, argv, "-chisq"))) {
     ChiSelect = TRUE;
     remove_argument (N, argc, argv);
@@ -448,5 +448,5 @@
   /* select on measurement type: 1,2,3 (AVERAGE ONLY) */
   TypeSelect = FALSE;
-  if (N = get_argument (*argc, argv, "-type")) {
+  if ((N = get_argument (*argc, argv, "-type"))) {
     remove_argument (N, argc, argv);
     TypeValue = atoi (argv[N]);
@@ -457,5 +457,5 @@
   /* select on measurement type: 1,2,3 (AVERAGE ONLY) */
   TypefracType = 0;
-  if (N = get_argument (*argc, argv, "-usetype")) {
+  if ((N = get_argument (*argc, argv, "-usetype"))) {
     remove_argument (N, argc, argv);
     TypefracType = atoi (argv[N]);
@@ -465,5 +465,5 @@
   /* select on measurement type: 1,2,3 (AVERAGE ONLY) */
   TypefracSelect = FALSE;
-  if (N = get_argument (*argc, argv, "-typefrac")) {
+  if ((N = get_argument (*argc, argv, "-typefrac"))) {
     remove_argument (N, argc, argv);
     TypefracType  = atoi (argv[N]);
@@ -479,5 +479,5 @@
   /* select by number of measurements (AVERAGE ONLY) */
   NphotSelect = FALSE;
-  if (N = get_argument (*argc, argv, "-nphot")) {
+  if ((N = get_argument (*argc, argv, "-nphot"))) {
     remove_argument (N, argc, argv);
     NphotValue = abs (atoi (argv[N]));
@@ -491,5 +491,5 @@
   /* select by number of measurements (AVERAGE ONLY) */
   NcodeSelect = FALSE;
-  if (N = get_argument (*argc, argv, "-ncode")) {
+  if ((N = get_argument (*argc, argv, "-ncode"))) {
     remove_argument (N, argc, argv);
     NcodeValue = abs (atoi (argv[N]));
@@ -503,5 +503,5 @@
   /* -fwhm value frac (AVERAGE ONLY) */
   FWHMSelect = FALSE;
-  if (N = get_argument (*argc, argv, "-fwhm")) {
+  if ((N = get_argument (*argc, argv, "-fwhm"))) {
     remove_argument (N, argc, argv);
     FWHMvalue = abs (atof (argv[N]));
@@ -522,8 +522,6 @@
 double *ExtractMeasures (PhotCode *code, int mode, Average *average, SecFilt *secfilt, Measure *measure, int *nlist, int param) {
 
-  int i, k, m, Nlist, NLIST, np, found, Nm;
-  time_t t;
-  double ra, dec, x, y, value, M, fwhm;
-  double *list;
+  int i, Nlist, NLIST;
+  double M, *list;
   
   *nlist = 0; 
@@ -552,5 +550,5 @@
 double ExtractAverages (PhotCode *code, int mode, Average *average, SecFilt *secfilt, Measure *measure, int param) {
 
-  int i, k, Nm;
+  int i;
   double value;
 
@@ -937,5 +935,5 @@
 
   int i, j, Np0, Np1, Nlist, NLIST;
-  double *list, M1, M2, value, NoMag;
+  double *list, M1, M2, NoMag;
   
   *nlist = 0; 
@@ -1008,8 +1006,6 @@
 double *ExtractMeasuresByDMag (PhotCode **code, int *mode, int use_first, Average *average, SecFilt *secfilt, Measure *measure, int *nlist, int param) {
 
-  int i, j, k, n, Nlist, NLIST;
-  time_t t;
-  int np, found;
-  double *list, M1, M2, value;
+  int i, j, n, Nlist, NLIST;
+  double *list, M1, M2;
   
   *nlist = 0; 
@@ -1050,5 +1046,4 @@
 double GetMeasure (int param, Average *average, Measure *measure, double mag) {
 
-  int m;
   double ra, dec, x, y;
   double value;
Index: /trunk/Ohana/src/opihi/dvo/pmeasure.c
===================================================================
--- /trunk/Ohana/src/opihi/dvo/pmeasure.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/dvo/pmeasure.c	(revision 4689)
@@ -31,11 +31,12 @@
 
   PhotcodeClip = -1;
-  if (N = get_argument (argc, argv, "-p")) {
+  if ((N = get_argument (argc, argv, "-p"))) {
     remove_argument (N, &argc, argv);
     PhotcodeClip = GetPhotcodeCodebyName (argv[N]);
     remove_argument (N, &argc, argv);
   }
+  IDchoice = 0;
   IDclip = FALSE;
-  if (N = get_argument (argc, argv, "-ID")) {
+  if ((N = get_argument (argc, argv, "-ID"))) {
     remove_argument (N, &argc, argv);
     IDchoice  = atoi(argv[N]);
@@ -43,6 +44,7 @@
     IDclip = TRUE;
   }
+  FlagChoice = 0;
   FlagClip = FALSE;
-  if (N = get_argument (argc, argv, "-flag")) {
+  if ((N = get_argument (argc, argv, "-flag"))) {
     remove_argument (N, &argc, argv);
     FlagChoice  = atoi(argv[N]);
@@ -52,10 +54,10 @@
 
   LimExclude = FALSE;
-  if (N = get_argument (argc, argv, "-x")) {
+  if ((N = get_argument (argc, argv, "-x"))) {
     remove_argument (N, &argc, argv);
     LimExclude = TRUE;
   }
 
-  if (N = get_argument (argc, argv, "-m")) {
+  if ((N = get_argument (argc, argv, "-m"))) {
     remove_argument (N, &argc, argv);
     Mr  = atof(argv[N]);
@@ -67,5 +69,5 @@
 
   InRegion = FALSE;
-  if (N = get_argument (argc, argv, "-all")) {
+  if ((N = get_argument (argc, argv, "-all"))) {
     remove_argument (N, &argc, argv);
     InRegion = TRUE;
Index: /trunk/Ohana/src/opihi/dvo/procks.c
===================================================================
--- /trunk/Ohana/src/opihi/dvo/procks.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/dvo/procks.c	(revision 4689)
@@ -35,5 +35,5 @@
   Rmax = graphmode.coords.crval1 + 182.0;
 
-  if (N = get_argument (argc, argv, "-m")) {
+  if ((N = get_argument (argc, argv, "-m"))) {
     remove_argument (N, &argc, argv);
     Mr  = 1000*atof(argv[N]);
@@ -44,6 +44,7 @@
   }
 
+  S0 = S1 = 0;
   SpeedClip = FALSE;
-  if (N = get_argument (argc, argv, "-speed")) {
+  if ((N = get_argument (argc, argv, "-speed"))) {
     SpeedClip = TRUE;
     remove_argument (N, &argc, argv);
@@ -55,5 +56,5 @@
 
   Reload = FALSE;
-  if (N = get_argument (argc, argv, "-reload")) {
+  if ((N = get_argument (argc, argv, "-reload"))) {
     Reload = TRUE;
     remove_argument (N, &argc, argv);
Index: /trunk/Ohana/src/opihi/dvo/region_list.c
===================================================================
--- /trunk/Ohana/src/opihi/dvo/region_list.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/dvo/region_list.c	(revision 4689)
@@ -15,5 +15,5 @@
   /* check for Region selection */
   *RegionName = NULL;
-  if (N = get_argument (*argc, argv, "-cpt")) {
+  if ((N = get_argument (*argc, argv, "-cpt"))) {
     remove_argument (N, argc, argv);
     *RegionName = strcreate (argv[N]);
@@ -23,5 +23,5 @@
   /* check for Region list */
   *RegionList = NULL;
-  if (N = get_argument (*argc, argv, "-cptlist")) {
+  if ((N = get_argument (*argc, argv, "-cptlist"))) {
     remove_argument (N, argc, argv);
     *RegionList = strcreate (argv[N]);
Index: /trunk/Ohana/src/opihi/dvo/simage.c
===================================================================
--- /trunk/Ohana/src/opihi/dvo/simage.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/dvo/simage.c	(revision 4689)
@@ -21,5 +21,5 @@
   zero = 17.0;
   range = -5.0;
-  if (N = get_argument (argc, argv, "-m")) {
+  if ((N = get_argument (argc, argv, "-m"))) {
     remove_argument (N, &argc, argv);
     range = atof(argv[N]);
Index: /trunk/Ohana/src/opihi/include/astro.h
===================================================================
--- /trunk/Ohana/src/opihi/include/astro.h	(revision 4688)
+++ /trunk/Ohana/src/opihi/include/astro.h	(revision 4689)
@@ -9,5 +9,5 @@
 # define ASTRO_H
 
-/* why is nothing in here? */
+void InitAstro ();
 
 # endif
Index: /trunk/Ohana/src/opihi/include/basic.h
===================================================================
--- /trunk/Ohana/src/opihi/include/basic.h	(revision 4688)
+++ /trunk/Ohana/src/opihi/include/basic.h	(revision 4689)
@@ -4,2 +4,3 @@
 
 void cleanup ();
+void InitBasic ();
Index: /trunk/Ohana/src/opihi/include/data.h
===================================================================
--- /trunk/Ohana/src/opihi/include/data.h	(revision 4688)
+++ /trunk/Ohana/src/opihi/include/data.h	(revision 4689)
@@ -7,4 +7,6 @@
 # ifndef DATA_H
 # define DATA_H
+
+void InitData ();
 
 /* in misc/queues.c */
Index: /trunk/Ohana/src/opihi/include/dimm.h
===================================================================
--- /trunk/Ohana/src/opihi/include/dimm.h	(revision 4688)
+++ /trunk/Ohana/src/opihi/include/dimm.h	(revision 4689)
@@ -5,4 +5,6 @@
 # include "display.h"
 # include "sbig.h"
+
+void InitDIMM ();
 
 /* telescope.c */
Index: /trunk/Ohana/src/opihi/include/dvo1.h
===================================================================
--- /trunk/Ohana/src/opihi/include/dvo1.h	(revision 4688)
+++ /trunk/Ohana/src/opihi/include/dvo1.h	(revision 4689)
@@ -1,4 +1,5 @@
-# include "opihi.h"
 # include "data.h"
+# include "basic.h"
+# include "astro.h"
 
 # ifndef DVO1_H
@@ -68,3 +69,13 @@
 RegionFile   *SelectRegions         PROTO((char *RegionName, char *RegionList, int *nregions));
 
+void InitDVO ();
+
+void FreeImageSelection ();
+Image *MatchImage (unsigned int time, short int source);
+int GetRegionSelection ();
+int SetRegionSelection (int *argc, char **argv, char **RegionName, char **RegionList);
+void sort_image_subset (Image *image, int *subset, int N);
+int match_image_subset (Image *image, int *subset, int Nsubset, unsigned int T, short int S);
+int GetTimeSelection (time_t *tz, time_t *te);
+
 # endif
Index: /trunk/Ohana/src/opihi/include/external.h
===================================================================
--- /trunk/Ohana/src/opihi/include/external.h	(revision 4688)
+++ /trunk/Ohana/src/opihi/include/external.h	(revision 4689)
@@ -4,4 +4,5 @@
 # include <fcntl.h>
 # include <sys/types.h>
+# include <sys/wait.h>
 # include <sys/socket.h>
 # include <sys/un.h>
Index: /trunk/Ohana/src/opihi/include/hstgsc.h
===================================================================
--- /trunk/Ohana/src/opihi/include/hstgsc.h	(revision 4688)
+++ /trunk/Ohana/src/opihi/include/hstgsc.h	(revision 4689)
@@ -4,13 +4,17 @@
 				0.0, -7.5, -15.0, -22.5, -30.0, -37.5, -45.0, 
 				-52.5, -60.0, -67.5, -75.0, -82.5, -90.0};
+static char *Dec2Sections[] = {"n0000", "n0730", "n1500", "n2230", "n3000", "n3730", "n4500", 
+			       "n5230", "n6000", "n6730", "n7500", "n8230", "weirdness", 
+			       "s0000", "s0730", "s1500", "s2230", "s3000", "s3730", "s4500", 
+			       "s5230", "s6000", "s6730", "s7500", "s8230", "weirdness"};
+
+static int NDecLines[] = {593, 584, 551, 530, 522, 465, 406, 362, 280, 198, 123, 24, 
+			  0, 597, 578, 574, 577, 534, 499, 442, 376, 294, 212, 144, 48};
+
+/** older data layout concepts 
 static char *DecSections[] = {"N0000", "N0730", "N1500", "N2230", "N3000", "N3730", "N4500", 
 			      "N5230", "N6000", "N6730", "N7500", "N8230", "weirdness", 
 			      "S0000", "S0730", "S1500", "S2230", "S3000", "S3730", "S4500", 
 			      "S5230", "S6000", "S6730", "S7500", "S8230", "weirdness"};
-
-static char *Dec2Sections[] = {"n0000", "n0730", "n1500", "n2230", "n3000", "n3730", "n4500", 
-			       "n5230", "n6000", "n6730", "n7500", "n8230", "weirdness", 
-			       "s0000", "s0730", "s1500", "s2230", "s3000", "s3730", "s4500", 
-			       "s5230", "s6000", "s6730", "s7500", "s8230", "weirdness"};
 
 static char *disk[] = {"disk 1", "disk 1", "disk 1", "disk 1", "disk 1", "disk 1", "disk 1", 
@@ -21,4 +25,3 @@
 static int NBigRASections [] = {48, 47, 45, 43, 40, 36, 32, 28, 21, 15, 9, 3, 3, 48, 47, 45, 43, 40, 36, 32, 28, 21, 15, 9, 3, 3};
 
-static int NDecLines[] = {593, 584, 551, 530, 522, 465, 406, 362, 280, 198, 123, 24, 
-			  0, 597, 578, 574, 577, 534, 499, 442, 376, 294, 212, 144, 48};
+**/
Index: /trunk/Ohana/src/opihi/include/imfit.h
===================================================================
--- /trunk/Ohana/src/opihi/include/imfit.h	(revision 4688)
+++ /trunk/Ohana/src/opihi/include/imfit.h	(revision 4689)
@@ -9,2 +9,12 @@
 float (*fitfunc)(float, float, float *, int, float *);
 void (*imfit_cleanup)();
+
+void fgauss_setup (char *name);
+void pgauss_setup (char *name);
+void sgauss_setup (char *name);
+void qgauss_setup (char *name);
+void Pgauss_setup (char *name);
+void Sgauss_setup (char *name);
+void Qgauss_setup (char *name);
+void qfgauss_setup (char *name);
+void qrgauss_setup (char *name);
Index: /trunk/Ohana/src/opihi/include/mana.h
===================================================================
--- /trunk/Ohana/src/opihi/include/mana.h	(revision 4688)
+++ /trunk/Ohana/src/opihi/include/mana.h	(revision 4689)
@@ -1,6 +1,9 @@
 # include "data.h"
+# include "basic.h"
+# include "astro.h"
 
 # ifndef MANA_H
 
+void InitMana ();
 int *findrowpeaks (float *row, int Nrow, float threshold, int *npeaks);
 
Index: /trunk/Ohana/src/opihi/include/pclient.h
===================================================================
--- /trunk/Ohana/src/opihi/include/pclient.h	(revision 4688)
+++ /trunk/Ohana/src/opihi/include/pclient.h	(revision 4689)
@@ -1,5 +1,4 @@
-# include "opihi.h"
-# include <sys/types.h>
-# include <sys/wait.h>
+# include "data.h"
+# include "basic.h"
 
 /** pclient global data **/
@@ -71,3 +70,6 @@
 void CheckChildStatus ();
 
+void InitPclient ();
+void gotsignal (int signum);
+
 # define DTIME(A,B) ((A.tv_sec - B.tv_sec) + 1e-6*(A.tv_usec - B.tv_usec))
Index: /trunk/Ohana/src/opihi/include/pcontrol.h
===================================================================
--- /trunk/Ohana/src/opihi/include/pcontrol.h	(revision 4688)
+++ /trunk/Ohana/src/opihi/include/pcontrol.h	(revision 4689)
@@ -1,5 +1,4 @@
-# include "opihi.h"
-# include <sys/types.h>
-# include <sys/wait.h>
+# include "data.h"
+# include "basic.h"
 
 typedef struct timeval Ptime;
@@ -105,7 +104,5 @@
 } Stack;
 
-/* these should be loaded from ConfigInit or from opihi variables */
-static char *CONNECT;  /* connection method (ssh, rsh, etc) */
-static char *PCLIENT;  /* shell on remote host (eg, pclient) */
+/* XXX if this is hard-wired, we can't change shell name in StartHost */
 # define PCLIENT_PROMPT "pclient:"
 
@@ -118,4 +115,6 @@
 int  FlushIOBuffer (IOBuffer *buffer);
 void FreeIOBuffer (IOBuffer *buffer);
+
+void InitPcontrol ();
 
 void *GetStack (Stack *stack, int where);
@@ -155,5 +154,4 @@
 int rconnect (char *command, char *hostname, char *shell, int *stdio);
 int CheckHost (Host *host);
-char *memstr (char *m1, char *m2, int n);
 Stack *GetJobStack (int StackID);
 int PutJob (Job *job, int StackID, int where);
@@ -168,2 +166,13 @@
 Host *UnlinkJobAndHost (Job *job);
 void LinkJobAndHost (Job *job, Host *host);
+int StopHost (Host *host);
+
+int PrintJobStack (int Nstack);
+int PrintHostStack (int Nstack);
+void InitJobStacks ();
+void InitHostStacks ();
+void DownHost (Host *host);
+void OffHost (Host *host);
+int DownHosts ();
+int VerboseMode ();
+int StartJob (Job *job);
Index: /trunk/Ohana/src/opihi/include/scheduler.h
===================================================================
--- /trunk/Ohana/src/opihi/include/scheduler.h	(revision 4688)
+++ /trunk/Ohana/src/opihi/include/scheduler.h	(revision 4689)
@@ -1,5 +1,4 @@
-# include "opihi.h"
-# include <sys/types.h>
-# include <sys/wait.h>
+# include "data.h"
+# include "basic.h"
 
 typedef enum {
@@ -111,4 +110,6 @@
 /* scheduler prototypes */
 
+void InitSched ();
+
 char *memstr (char *m1, char *m2, int n);
 
@@ -157,3 +158,15 @@
 int CheckLocalJobStatus (Job *job);
 void InitTaskTimers ();
-Function *FindControllerCommand (char *cmd);
+CommandF *FindControllerCommand (char *cmd);
+int QuitController ();
+int VerboseMode ();
+int KillLocalJob (Job *job);
+int CheckControllerOutput ();
+int PrintControllerOutput ();
+
+int InitIOBuffer (IOBuffer *buffer, int Nalloc);
+int FlushIOBuffer (IOBuffer *buffer);
+int ReadtoIOBuffer (IOBuffer *buffer, int fd);
+void FreeIOBuffer (IOBuffer *buffer);
+int KillControllerJob (Job *job);
+int CheckControllerStatus ();
Index: /trunk/Ohana/src/opihi/include/shell.h
===================================================================
--- /trunk/Ohana/src/opihi/include/shell.h	(revision 4688)
+++ /trunk/Ohana/src/opihi/include/shell.h	(revision 4689)
@@ -1,3 +1,4 @@
 /*** shell.h ***/
+# include "external.h"
 
 # ifndef SHELL_H
@@ -8,8 +9,13 @@
 # define ISNUM(c) (isdigit(c) || (c == '-') || (c == '.'))
 
+# define MACRO_STRING(s) #s
+# define MACRO_NAME(s) MACRO_STRING(s)
+
+typedef int CommandF ();
+
 /*** typedef structs used by shell functions ***/
 typedef struct {			/* basic opihi command structure */
   char     *name;
-  Function *func;    
+  CommandF *func;    
   char     *help;
 } Command;
@@ -67,4 +73,7 @@
 char         *GetMacroName              PROTO((void));
 int           GetMacroDepth             PROTO((void));
+void          ListMacro                 PROTO((Macro *macro));
+void          ListMacros                PROTO(());
+void          FreeMacro                 PROTO((Macro *macro));
 
 int           exec_loop                 PROTO((Macro *loop));
@@ -104,3 +113,5 @@
 int 	      macro_write  		PROTO((int, char **));
 
+char *memstr (char *m1, char *m2, int n);
+
 # endif
Index: /trunk/Ohana/src/opihi/lib.data/PlotVectors.c
===================================================================
--- /trunk/Ohana/src/opihi/lib.data/PlotVectors.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/lib.data/PlotVectors.c	(revision 4689)
@@ -4,6 +4,4 @@
 
 int PrepPlotting (int Npts, Graphdata *graphmode) {
-
-  char buffer[128], buffer2[128];
 
   if (!GetGraph (NULL, &Xgraph, NULL)) return (FALSE);
Index: /trunk/Ohana/src/opihi/lib.data/convert.c
===================================================================
--- /trunk/Ohana/src/opihi/lib.data/convert.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/lib.data/convert.c	(revision 4689)
@@ -311,4 +311,5 @@
   p1 = line;
   tmp = strtod (p1, &p2);
+  mode = TIME_DATE;
   if (p2 == p1 + strlen (p1) - 1) {
     if (*p2 == 'j') {
@@ -330,6 +331,4 @@
       mode = TIME_SECONDS;
     }
-  } else { 
-    mode = TIME_DATE;
   }
   return (mode);
Index: /trunk/Ohana/src/opihi/lib.data/graphtools.c
===================================================================
--- /trunk/Ohana/src/opihi/lib.data/graphtools.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/lib.data/graphtools.c	(revision 4689)
@@ -43,6 +43,4 @@
 void ApplyLimits (int Xgraph, Graphdata *graphmode, int apply) { 
 
-  char buffer[128], buffer2[65];
-
   if (!apply) return;
 
Index: /trunk/Ohana/src/opihi/lib.data/mrq2dmin.c
===================================================================
--- /trunk/Ohana/src/opihi/lib.data/mrq2dmin.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/lib.data/mrq2dmin.c	(revision 4689)
@@ -64,6 +64,6 @@
 		float (funcs)(float, float, float *, int, float *)) {
 
-  int k, j, i;
-  float ydiff, wt, chisq;
+  int i;
+  float ydiff, chisq;
 
   chisq = 0.0;
Index: /trunk/Ohana/src/opihi/lib.data/open_graph.c
===================================================================
--- /trunk/Ohana/src/opihi/lib.data/open_graph.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/lib.data/open_graph.c	(revision 4689)
@@ -245,6 +245,4 @@
 int SendLabel (char *string, int Xgraph, int mode) {
 
-  char buffer[64];
-
   SendGraphCommand (Xgraph, 4, "LABL");
   SendGraphCommand (Xgraph, 16, "%6d %6d", strlen (string), mode);
@@ -257,5 +255,5 @@
 
   int Nbyte, status;
-  char *string, tmp;
+  char tmp;
   va_list argp;  
 
@@ -286,6 +284,5 @@
 int SendGraphCommandV (int device, int length, char *format, va_list argp) {
 
-  int Nbyte;
-  char *string, tmp[4];
+  char *string;
 
   /* I allocated and zero 1 extra byte */
Index: /trunk/Ohana/src/opihi/lib.data/svdcmp.c
===================================================================
--- /trunk/Ohana/src/opihi/lib.data/svdcmp.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/lib.data/svdcmp.c	(revision 4689)
@@ -21,4 +21,5 @@
   if (Ny < Nx) return (0);
 
+  l = nm = 0;
   ALLOCATE (rv1, float, Nx);
   for (i = 0; i < Nx; i++) {
Index: /trunk/Ohana/src/opihi/lib.shell/Makefile
===================================================================
--- /trunk/Ohana/src/opihi/lib.shell/Makefile	(revision 4688)
+++ /trunk/Ohana/src/opihi/lib.shell/Makefile	(revision 4689)
@@ -40,4 +40,5 @@
 $(SDIR)/macro_read.$(ARCH).o            \
 $(SDIR)/macro_write.$(ARCH).o		\
+$(SDIR)/memstr.$(ARCH).o                \
 $(SDIR)/multicommand.$(ARCH).o          \
 $(SDIR)/parse.$(ARCH).o                 \
Index: /trunk/Ohana/src/opihi/lib.shell/check_stack.c
===================================================================
--- /trunk/Ohana/src/opihi/lib.shell/check_stack.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/lib.shell/check_stack.c	(revision 4689)
@@ -3,9 +3,8 @@
 int check_stack (StackVar *stack, int Nstack, int validsize) {
 
-  double tmp;
   int i, Nx, Ny, Nv, size;
   char *c;
 
-  Nv = Nx = -1;
+  Nv = Nx = Ny = -1;
 
   for (i = 0; i < Nstack; i++) {
Index: /trunk/Ohana/src/opihi/lib.shell/dvomath.c
===================================================================
--- /trunk/Ohana/src/opihi/lib.shell/dvomath.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/lib.shell/dvomath.c	(revision 4689)
@@ -12,4 +12,6 @@
   Vector *vec;
 
+  buf = NULL;
+  vec = NULL;
   ALLOCATE (outname, char, 256);
 
Index: /trunk/Ohana/src/opihi/lib.shell/evaluate_stack.c
===================================================================
--- /trunk/Ohana/src/opihi/lib.shell/evaluate_stack.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/lib.shell/evaluate_stack.c	(revision 4689)
@@ -17,4 +17,5 @@
   Nout = Nvar = 0;
 
+  status = TRUE;
   init_stack (&tmp_stack);
 
Index: /trunk/Ohana/src/opihi/lib.shell/memstr.c
===================================================================
--- /trunk/Ohana/src/opihi/lib.shell/memstr.c	(revision 4689)
+++ /trunk/Ohana/src/opihi/lib.shell/memstr.c	(revision 4689)
@@ -0,0 +1,13 @@
+# include "shell.h"
+
+/* returns pointer to start of m2 in m1, or NULL if failure */ 
+char *memstr (char *m1, char *m2, int n) {
+
+  int i, N;
+
+  N = strlen (m2);
+  for (i = 0; (i < n - N + 1) && memcmp (m1, m2, N); i++, m1++);
+  if (memcmp (m1, m2, N)) return (NULL);
+  return (m1);
+
+}
Index: /trunk/Ohana/src/opihi/lib.shell/multicommand.c
===================================================================
--- /trunk/Ohana/src/opihi/lib.shell/multicommand.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/lib.shell/multicommand.c	(revision 4689)
@@ -11,4 +11,5 @@
   p = line; 
   done = FALSE;
+  status = TRUE;
   while (!done) {
     q = strchr (p, ';');
Index: /trunk/Ohana/src/opihi/lib.shell/opihi.c
===================================================================
--- /trunk/Ohana/src/opihi/lib.shell/opihi.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/lib.shell/opihi.c	(revision 4689)
@@ -4,6 +4,6 @@
 int main (int argc, char **argv) {
 
-  int i, Nbad, Nlist, status;
-  char **list, *line, *outline, *prompt, *history;
+  int Nbad, status;
+  char *line, *prompt, *history;
   pid_t ppid;
 
Index: /trunk/Ohana/src/opihi/lib.shell/startup.c
===================================================================
--- /trunk/Ohana/src/opihi/lib.shell/startup.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/lib.shell/startup.c	(revision 4689)
@@ -35,9 +35,4 @@
   }
   
-  /* keep these? 
-     set_int_variable ("UNSIGN", 0);
-     FT_UNSIGN_MODE = FALSE;
-  */
-
   {
     
@@ -57,19 +52,8 @@
     set_str_variable ("KAPA", "kapa");
 
-# if 0    
-    help = getenv ("MANA-HELP");
-    if (help == (char *) NULL) {
-      /* try in exec path */
-      ALLOCATE (help, char, 1024);
-      execdir = findexec (argc, argv);
-      if (execdir == (char *) NULL) {
-	fprintf (stderr, "error with executable name: can't resolve path\n");
-	execdir = strcreate (".");
-      }
-      execname = filebasename (argv[0]);
-      sprintf (help, "%s/%s.hlp", execdir, execname);
-    }
-    set_str_variable ("HELPDIR", help);
-# endif
+  /* keep these? 
+     set_int_variable ("UNSIGN", 0);
+     FT_UNSIGN_MODE = FALSE;
+  */
 
     if (!ConfigInit (&argc, argv)) {
Index: /trunk/Ohana/src/opihi/mana/Makefile
===================================================================
--- /trunk/Ohana/src/opihi/mana/Makefile	(revision 4688)
+++ /trunk/Ohana/src/opihi/mana/Makefile	(revision 4689)
@@ -7,5 +7,4 @@
 LIB     =       $(HOME)/lib
 INC     =       $(HOME)/include
-HELP    =       $(HOME)/help
 SDIR    =       $(HOME)/mana
 #
@@ -14,4 +13,5 @@
 DESTINC =       $(LINC)
 DESTMAN =       $(LMAN)
+DESTHLP =       $(LHLP)/mana
 #  
 INCS    =       -I$(INC) -I$(LINC) -I$(XINC)
@@ -20,5 +20,5 @@
 LIBS2   =       -lbasiccmd -ldatacmd -lastrocmd -lshell -ldata 
 LIBS    =       $(LIBS2) $(LIBS1) 
-CFLAGS  =       $(INCS)
+CFLAGS  =       $(INCS) -DHELPDIR_DEFAULT=$(DESTHLP)
 CCFLAGS =       $(LIBS) 
 
@@ -52,12 +52,7 @@
 $(BIN)/mana.$(ARCH) : $(mana) $(libs)
 
-install: $(DESTBIN)/mana
+install: $(DESTBIN)/mana help
 
-# these need to have a better home
-# $(SDIR)/demux.$(ARCH).o		  	\
-# $(SDIR)/elixir.$(ARCH).o	  	\
-# $(SDIR)/adc.$(ARCH).o             	\
-# $(SDIR)/focus.$(ARCH).o		  	\
-# $(SDIR)/simsignal.$(ARCH).o	  	\
+help: cmd.basic.help cmd.data.help cmd.astro.help mana.help
 
 # utilities #################################################
@@ -112,28 +107,7 @@
 	$(CC) $(CFLAGS) -c $*.c -o $@
 
-
-
-## -*- makefile -*- 
-# deprecated functions: verify & delete
-#$(SDIR)/abszero.$(ARCH).o \
-#$(SDIR)/cals.$(ARCH).o \
-#$(SDIR)/dumpmags.$(ARCH).o \
-#$(SDIR)/extract.$(ARCH).o \
-#$(SDIR)/gtypes.$(ARCH).o \
-#$(SDIR)/photresid.$(ARCH).o \
-#$(SDIR)/resid.$(ARCH).o \
-#$(SDIR)/zeropts.$(ARCH).o
-#$(SDIR)/objload.$(ARCH).o \ - make sure we have vect to tv
-#$(SDIR)/ccdextract.$(ARCH).o \
-#$(SDIR)/cmdextract.$(ARCH).o \
-#$(SDIR)/dmagextract.$(ARCH).o \
-#$(SDIR)/ddmagextract.$(ARCH).o \
-
-# future functions, not fully implemented
-#$(SDIR)/detrend.$(ARCH).o \
-#$(SDIR)/getxtra.$(ARCH).o \
-#$(SDIR)/addxtra.$(ARCH).o \
-
-# functions that need to be updated
-#$(SDIR)/gregions.$(ARCH).o \
-
+%.help:
+	@if [ ! -d $(DESTHLP) ]; then mkdir -p $(DESTHLP); fi
+	rm -f $(HOME)/$*/help/*~
+	rm -f $(HOME)/$*/help/#*
+	cp $(HOME)/$*/help/* $(DESTHLP)/
Index: /trunk/Ohana/src/opihi/mana/fitcontour.c
===================================================================
--- /trunk/Ohana/src/opihi/mana/fitcontour.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/mana/fitcontour.c	(revision 4689)
@@ -6,5 +6,5 @@
   int i;
   double **C, **B;
-  float cs1, sn1, cs, sn, x, y, r, xo, yo, t;
+  float cs1, sn1, cs, sn, x, y, r, xo, yo;
   float dR, Rmin, Rmaj, Theta, Rx, Ry, Rxy, R1, R2, R3;
   Vector *vecx, *vecy;
Index: /trunk/Ohana/src/opihi/mana/mana.c
===================================================================
--- /trunk/Ohana/src/opihi/mana/mana.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/mana/mana.c	(revision 4689)
@@ -1,3 +1,3 @@
-# include "opihi.h"
+# include "mana.h"
 
 # define opihi_name "MANA"
@@ -7,19 +7,7 @@
 # define opihi_rcfile ".manarc"
 
-void InitBasic ();
-void InitData ();
-void InitAstro ();
-void InitMana ();
-
-void welcome () {
-  fprintf (stderr, "\n");
-  fprintf (stderr, "Welcome to %s - %s\n\n", opihi_name, opihi_description);
-}
-
 /* program-dependent initialization */
 void initialize (int argc, char **argv) {
   
-  FILE *f;
-
   auto_break = TRUE;
 
@@ -42,6 +30,6 @@
   InitBasic ();
   InitData ();
+  InitOutfile ();
   InitAstro ();
-  InitOutfile ();
   InitMana ();
 
@@ -52,19 +40,18 @@
   set_str_variable ("PROMPT", opihi_prompt);
   set_str_variable ("RCFILE", opihi_rcfile);
+# ifdef HELPDIR_DEFAULT
+  set_str_variable ("HELPDIR", MACRO_NAME(HELPDIR_DEFAULT));
+# endif
 
-  /* here we open the history file for append.  it this fails, we
-     won't be able to write to it, warn the user.  otherwise, this
-     creates the file readline will write to, if it did not exist */  
-
-  /* check history file */
-  /* rewrite with fstat or stat */
-  f = fopen (opihi_history, "a");
-  if (f == NULL) /* no current history file here */
-    fprintf (stderr, "can't save history.\n");
-  else
-    fclose (f);
-  
-  stifle_history (200);
-  read_history (opihi_history);
+  { /* check history file permission */
+    FILE *f;
+    f = fopen (opihi_history, "a");
+    if (f == NULL) /* no current history file here */
+      fprintf (stderr, "can't save history.\n");
+    else
+      fclose (f);
+    stifle_history (200);
+    read_history (opihi_history);
+  }
 
   signal (SIGINT, SIG_IGN);
@@ -72,7 +59,12 @@
 }
 
+/* standard welcome message */
+void welcome () {
+  fprintf (stderr, "\n");
+  fprintf (stderr, "Welcome to %s - %s\n\n", opihi_name, opihi_description);
+}
+
 /* add program-dependent exit functions here */
 void cleanup () {
-  /* -libdisplay */
   QuitImage ();
   QuitGraph ();
Index: /trunk/Ohana/src/opihi/mana/starcontour.c
===================================================================
--- /trunk/Ohana/src/opihi/mana/starcontour.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/mana/starcontour.c	(revision 4689)
@@ -30,4 +30,5 @@
 
   /* find transition below (limit range?) */
+  xmin = xmax = 0;
   xs = xp;
   for (y = yp; (y >= 0) && (v[xs + y*Nx] > zo); y--) {
Index: /trunk/Ohana/src/opihi/pantasks/CheckJobs.c
===================================================================
--- /trunk/Ohana/src/opihi/pantasks/CheckJobs.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/pantasks/CheckJobs.c	(revision 4689)
@@ -4,8 +4,6 @@
 
   Job *job;
-  Task *task;
   Macro *macro;
-  int i, found, status;
-  int Ntest;
+  int i, status;
 
   /** test all jobs: ready to test?  finished? **/
Index: /trunk/Ohana/src/opihi/pantasks/CheckSystem.c
===================================================================
--- /trunk/Ohana/src/opihi/pantasks/CheckSystem.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/pantasks/CheckSystem.c	(revision 4689)
@@ -6,4 +6,4 @@
   CheckJobs ();
   CheckControllerOutput ();
-
+  return (TRUE);
 }
Index: /trunk/Ohana/src/opihi/pantasks/CheckTasks.c
===================================================================
--- /trunk/Ohana/src/opihi/pantasks/CheckTasks.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/pantasks/CheckTasks.c	(revision 4689)
@@ -5,7 +5,5 @@
   Job *job;
   Task *task;
-  Macro *macro;
-  int i, found, status;
-  int Ntest;
+  int status;
 
   /** test all tasks: ready to test? ready to run? **/
Index: /trunk/Ohana/src/opihi/pantasks/ControllerOps.c
===================================================================
--- /trunk/Ohana/src/opihi/pantasks/ControllerOps.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/pantasks/ControllerOps.c	(revision 4689)
@@ -20,4 +20,5 @@
     GetJobOutput ("stderr", job[0].pid, &job[0].stderr, job[0].stderr_size);
   }  
+  return (TRUE);
 }
 
@@ -157,5 +158,5 @@
   /* construct the controller command portion */
   if (!strcmp (job[0].task[0].host, "NONE")) {
-    sprintf (cmd, "job", cmd);
+    sprintf (cmd, "job");
   } else {
     if (job[0].task[0].host_required) {
@@ -391,4 +392,6 @@
   IOBuffer buffer;
 
+  if (!CheckControllerStatus()) return (TRUE);
+
   sprintf (cmd, "kill %d", job[0].pid);
   InitIOBuffer (&buffer, 0x100);
@@ -400,3 +403,17 @@
 }
 
+int QuitController () {
+
+  int status;
+  char cmd[128];
+  IOBuffer buffer;
+
+  if (!CheckControllerStatus()) return (TRUE);
+
+  sprintf (cmd, "quit");
+  InitIOBuffer (&buffer, 0x100);
+  status = ControllerCommand (cmd, CONTROLLER_PROMPT, &buffer);
+  return (TRUE);
+}
+
 /* memstr returns a view, not an allocated string : don't free */
Index: /trunk/Ohana/src/opihi/pantasks/IOBufferOps.c
===================================================================
--- /trunk/Ohana/src/opihi/pantasks/IOBufferOps.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/pantasks/IOBufferOps.c	(revision 4689)
@@ -59,4 +59,5 @@
     }
   }
+  return (Nread);
 }
 
Index: /trunk/Ohana/src/opihi/pantasks/JobIDOps.c
===================================================================
--- /trunk/Ohana/src/opihi/pantasks/JobIDOps.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/pantasks/JobIDOps.c	(revision 4689)
@@ -38,3 +38,4 @@
 
   JobIDList[JobID] = FALSE;
+  return (TRUE);
 }
Index: /trunk/Ohana/src/opihi/pantasks/JobOps.c
===================================================================
--- /trunk/Ohana/src/opihi/pantasks/JobOps.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/pantasks/JobOps.c	(revision 4689)
@@ -56,5 +56,5 @@
 
   for (i = 0; i < Njobs; i++) {
-    fprintf (stderr, "%d: %-15s %5d %20s (%x)\n", Njobs, jobs[i][0].task[0].name, jobs[i][0].JobID, jobs[i][0].argv[0], jobs[i][0].argv);
+    fprintf (stderr, "%d: %-15s %5d %20s (%lx)\n", Njobs, jobs[i][0].task[0].name, jobs[i][0].JobID, jobs[i][0].argv[0], (long) jobs[i][0].argv);
   }
   return;
Index: /trunk/Ohana/src/opihi/pantasks/LocalJob.c
===================================================================
--- /trunk/Ohana/src/opihi/pantasks/LocalJob.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/pantasks/LocalJob.c	(revision 4689)
@@ -152,5 +152,5 @@
       }
   }
-  return;
+  return (FALSE);
 }
 
Index: /trunk/Ohana/src/opihi/pantasks/Makefile
===================================================================
--- /trunk/Ohana/src/opihi/pantasks/Makefile	(revision 4688)
+++ /trunk/Ohana/src/opihi/pantasks/Makefile	(revision 4689)
@@ -7,5 +7,4 @@
 LIB     =       $(HOME)/lib
 INC     =       $(HOME)/include
-HELP    =       $(HOME)/help
 SDIR    =       $(HOME)/sched
 #
@@ -38,6 +37,5 @@
 $(SDIR)/JobIDOps.$(ARCH).o \
 $(SDIR)/TaskOps.$(ARCH).o \
-$(SDIR)/IOBufferOps.$(ARCH).o \
-$(SDIR)/memstr.$(ARCH).o
+$(SDIR)/IOBufferOps.$(ARCH).o
 
 cmds = \
@@ -50,4 +48,5 @@
 $(SDIR)/controller.$(ARCH).o \
 $(SDIR)/controller_host.$(ARCH).o \
+$(SDIR)/controller_exit.$(ARCH).o \
 $(SDIR)/controller_check.$(ARCH).o \
 $(SDIR)/controller_status.$(ARCH).o \
@@ -107,10 +106,4 @@
 	cp $^ $@
 
-%.help:
-	@if [ ! -d $(DESTHLP) ]; then mkdir -p $(DESTHLP); fi
-	rm -f $(HOME)/$*/help/*~
-	rm -f $(HOME)/$*/help/#*
-	cp $(HOME)/$*/help/* $(DESTHLP)/
-
 clean:
 	rm -f $(BIN)/*.$(ARCH)
@@ -136,28 +129,7 @@
 	$(CC) $(CFLAGS) -c $*.c -o $@
 
-
-
-## -*- makefile -*- 
-# deprecated functions: verify & delete
-#$(SDIR)/abszero.$(ARCH).o \
-#$(SDIR)/cals.$(ARCH).o \
-#$(SDIR)/dumpmags.$(ARCH).o \
-#$(SDIR)/extract.$(ARCH).o \
-#$(SDIR)/gtypes.$(ARCH).o \
-#$(SDIR)/photresid.$(ARCH).o \
-#$(SDIR)/resid.$(ARCH).o \
-#$(SDIR)/zeropts.$(ARCH).o
-#$(SDIR)/objload.$(ARCH).o \ - make sure we have vect to tv
-#$(SDIR)/ccdextract.$(ARCH).o \
-#$(SDIR)/cmdextract.$(ARCH).o \
-#$(SDIR)/dmagextract.$(ARCH).o \
-#$(SDIR)/ddmagextract.$(ARCH).o \
-
-# future functions, not fully implemented
-#$(SDIR)/detrend.$(ARCH).o \
-#$(SDIR)/getxtra.$(ARCH).o \
-#$(SDIR)/addxtra.$(ARCH).o \
-
-# functions that need to be updated
-#$(SDIR)/gregions.$(ARCH).o \
-
+%.help:
+	@if [ ! -d $(DESTHLP) ]; then mkdir -p $(DESTHLP); fi
+	rm -f $(HOME)/$*/help/*~
+	rm -f $(HOME)/$*/help/#*
+	cp $(HOME)/$*/help/* $(DESTHLP)/
Index: /trunk/Ohana/src/opihi/pantasks/controller.c
===================================================================
--- /trunk/Ohana/src/opihi/pantasks/controller.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/pantasks/controller.c	(revision 4689)
@@ -2,4 +2,5 @@
 
 int controller_host    PROTO((int, char **));
+int controller_exit    PROTO((int, char **));
 int controller_status  PROTO((int, char **));
 int controller_check   PROTO((int, char **));
@@ -7,4 +8,5 @@
 
 static Command controller_cmds[] = {
+  {"exit",   controller_exit,   "shutdown controller"},
   {"host",   controller_host,   "define host for controller"},
   {"check",  controller_check,  "check controller host/job"},
@@ -16,5 +18,5 @@
 
   int status;
-  Function *func;
+  CommandF *func;
 
   if (argc < 2) {
@@ -33,5 +35,5 @@
 }
 
-Function *FindControllerCommand (char *cmd) {
+CommandF *FindControllerCommand (char *cmd) {
 
   int i, N;
Index: /trunk/Ohana/src/opihi/pantasks/controller_exit.c
===================================================================
--- /trunk/Ohana/src/opihi/pantasks/controller_exit.c	(revision 4689)
+++ /trunk/Ohana/src/opihi/pantasks/controller_exit.c	(revision 4689)
@@ -0,0 +1,14 @@
+# include "scheduler.h"
+
+int controller_exit (int argc, char **argv) {
+
+  if (argc != 2) {
+    fprintf (stderr, "USAGE: controller exit TRUE\n");
+    return (FALSE);
+  }
+
+  if (strcasecmp (argv[1], "TRUE")) return (FALSE);
+
+  QuitController ();
+  return (TRUE);
+}
Index: /trunk/Ohana/src/opihi/pantasks/controller_output.c
===================================================================
--- /trunk/Ohana/src/opihi/pantasks/controller_output.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/pantasks/controller_output.c	(revision 4689)
@@ -2,8 +2,4 @@
 
 int controller_output (int argc, char **argv) {
-
-  int status;
-  char command[1024];
-  IOBuffer buffer;
 
   if (argc != 1) {
Index: /trunk/Ohana/src/opihi/pantasks/delete.c
===================================================================
--- /trunk/Ohana/src/opihi/pantasks/delete.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/pantasks/delete.c	(revision 4689)
@@ -3,6 +3,5 @@
 int delete_job (int argc, char **argv) {
 
-  Job *job;
-  int JobID, N;
+  int JobID;
 
   if (argc < 2) {
Index: /trunk/Ohana/src/opihi/pantasks/kill.c
===================================================================
--- /trunk/Ohana/src/opihi/pantasks/kill.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/pantasks/kill.c	(revision 4689)
@@ -4,5 +4,5 @@
 
   Job *job;
-  int JobID, N;
+  int JobID;
 
   if (argc < 2) {
Index: unk/Ohana/src/opihi/pantasks/memstr.c
===================================================================
--- /trunk/Ohana/src/opihi/pantasks/memstr.c	(revision 4688)
+++ 	(revision )
@@ -1,13 +1,0 @@
-# include "pcontrol.h"
-
-/* returns pointer to start of m2 in m1, or NULL if failure */ 
-char *memstr (char *m1, char *m2, int n) {
-
-  int i, N;
-
-  N = strlen (m2);
-  for (i = 0; (i < n - N + 1) && memcmp (m1, m2, N); i++, m1++);
-  if (memcmp (m1, m2, N)) return (NULL);
-  return (m1);
-
-}
Index: /trunk/Ohana/src/opihi/pantasks/scheduler.c
===================================================================
--- /trunk/Ohana/src/opihi/pantasks/scheduler.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/pantasks/scheduler.c	(revision 4689)
@@ -7,18 +7,7 @@
 # define opihi_rcfile ".schedrc"
 
-void InitBasic ();
-void InitData ();
-void InitSched ();
-
-void welcome () {
-  fprintf (stderr, "\n");
-  fprintf (stderr, "Welcome to %s - %s\n\n", opihi_name, opihi_description);
-}
-
 /* program-dependent initialization */
 void initialize (int argc, char **argv) {
   
-  FILE *f;
-
   auto_break = TRUE;
 
@@ -55,24 +44,18 @@
   set_str_variable ("PROMPT", opihi_prompt);
   set_str_variable ("RCFILE", opihi_rcfile);
-# define xstr(s) str(s)
-# define str(s) #s
 # ifdef HELPDIR_DEFAULT
-  set_str_variable ("HELPDIR", xstr(HELPDIR_DEFAULT));
+  set_str_variable ("HELPDIR", MACRO_NAME(HELPDIR_DEFAULT));
 # endif
 
-  /* here we open the history file for append.  it this fails, we
-     won't be able to write to it, warn the user.  otherwise, this
-     creates the file readline will write to, if it did not exist */  
-
-  /* check history file */
-  /* rewrite with fstat or stat */
-  f = fopen (opihi_history, "a");
-  if (f == NULL) /* no current history file here */
-    fprintf (stderr, "can't save history.\n");
-  else
-    fclose (f);
-  
-  stifle_history (200);
-  read_history (opihi_history);
+  { /* check history file permission */
+    FILE *f;
+    f = fopen (opihi_history, "a");
+    if (f == NULL) /* no current history file here */
+      fprintf (stderr, "can't save history.\n");
+    else
+      fclose (f);
+    stifle_history (200);
+    read_history (opihi_history);
+  }
 
   signal (SIGINT, SIG_IGN);
@@ -80,9 +63,15 @@
 }
 
+/* standard welcome message */
+void welcome () {
+  fprintf (stderr, "\n");
+  fprintf (stderr, "Welcome to %s - %s\n\n", opihi_name, opihi_description);
+}
+
 /* add program-dependent exit functions here */
 void cleanup () {
-  /* -libdisplay
   QuitImage ();
-  QuitGraph (); */
+  QuitGraph ();
+  QuitController ();
   return;
 }
Index: /trunk/Ohana/src/opihi/pantasks/status.c
===================================================================
--- /trunk/Ohana/src/opihi/pantasks/status.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/pantasks/status.c	(revision 4689)
@@ -10,5 +10,5 @@
   ListTasks (FALSE);
   ListJobs ();
-
+  return (TRUE);
 }
 
Index: /trunk/Ohana/src/opihi/pantasks/task.c
===================================================================
--- /trunk/Ohana/src/opihi/pantasks/task.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/pantasks/task.c	(revision 4689)
@@ -9,8 +9,7 @@
   int ThisList, status;
   char *input, *outline;
-  Macro *macro;
   Task *task;
 
-  if (N = get_argument (argc, argv, "-list")) {
+  if ((N = get_argument (argc, argv, "-list"))) {
     remove_argument (N, &argc, argv);
     ListTasks (FALSE);
@@ -18,5 +17,5 @@
   }
 
-  if (N = get_argument (argc, argv, "-longlist")) {
+  if ((N = get_argument (argc, argv, "-longlist"))) {
     remove_argument (N, &argc, argv);
     ListTasks (TRUE);
@@ -24,5 +23,5 @@
   }
 
-  if (N = get_argument (argc, argv, "-show")) {
+  if ((N = get_argument (argc, argv, "-show"))) {
     remove_argument (N, &argc, argv);
     ShowTask (argv[N]);
Index: /trunk/Ohana/src/opihi/pantasks/task_host.c
===================================================================
--- /trunk/Ohana/src/opihi/pantasks/task_host.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/pantasks/task_host.c	(revision 4689)
@@ -5,8 +5,7 @@
   int N, RequiredHost;
   Task *task;
-  char *taskname;
 
   RequiredHost = FALSE;
-  if (N = get_argument (argc, argv, "-required")) {
+  if ((N = get_argument (argc, argv, "-required"))) {
     remove_argument (N, &argc, argv);
     RequiredHost = TRUE;
Index: /trunk/Ohana/src/opihi/pantasks/task_macros.c
===================================================================
--- /trunk/Ohana/src/opihi/pantasks/task_macros.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/pantasks/task_macros.c	(revision 4689)
@@ -27,4 +27,6 @@
     return (FALSE);
   }
+
+  macro = NULL;
 
   /*** identify which Macro in Task this particular macro goes with ***/ 
Index: /trunk/Ohana/src/opihi/pantasks/task_periods.c
===================================================================
--- /trunk/Ohana/src/opihi/pantasks/task_periods.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/pantasks/task_periods.c	(revision 4689)
@@ -7,6 +7,7 @@
   Task *task;
 
+  PollValue = 0;
   Poll = FALSE;
-  if (N = get_argument (argc, argv, "-poll")) {
+  if ((N = get_argument (argc, argv, "-poll"))) {
     Poll = TRUE;
     remove_argument (N, &argc, argv);
@@ -15,6 +16,7 @@
   }
 
+  ExecValue = 0;
   Exec = FALSE;
-  if (N = get_argument (argc, argv, "-exec")) {
+  if ((N = get_argument (argc, argv, "-exec"))) {
     Exec = TRUE;
     remove_argument (N, &argc, argv);
@@ -23,6 +25,7 @@
   }
 
+  TimeoutValue = 0;
   Timeout = FALSE;
-  if (N = get_argument (argc, argv, "-timeout")) {
+  if ((N = get_argument (argc, argv, "-timeout"))) {
     Timeout = TRUE;
     remove_argument (N, &argc, argv);
@@ -49,10 +52,2 @@
   return (TRUE);
 }
-
-
-/** 
-    careful with this: the command is supposed to be realized 
-    for the Job, not the Task (at execution)
-    the code is right, but who calls it when needs to be clarified.
- **/
-
Index: /trunk/Ohana/src/opihi/pantasks/task_trange.c
===================================================================
--- /trunk/Ohana/src/opihi/pantasks/task_trange.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/pantasks/task_trange.c	(revision 4689)
@@ -3,5 +3,5 @@
 int task_trange (int argc, char **argv) {
 
-  int N, RequiredHost;
+  int N;
   Task *task;
   TimeRange range;
@@ -16,5 +16,5 @@
      keep = false means the time range defines an invalid range */
   range.keep = TRUE;
-  if (N = get_argument (argc, argv, "-exclude")) {
+  if ((N = get_argument (argc, argv, "-exclude"))) {
     remove_argument (N, &argc, argv);
     range.keep = FALSE;
Index: /trunk/Ohana/src/opihi/pclient/ChildOps.c
===================================================================
--- /trunk/Ohana/src/opihi/pclient/ChildOps.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/pclient/ChildOps.c	(revision 4689)
@@ -72,5 +72,5 @@
       break;
   }
-
+  return (TRUE);
 }
 
Index: /trunk/Ohana/src/opihi/pclient/IOBufferOps.c
===================================================================
--- /trunk/Ohana/src/opihi/pclient/IOBufferOps.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/pclient/IOBufferOps.c	(revision 4689)
@@ -57,4 +57,5 @@
     }
   }
+  return (Nread);
 }
 
Index: /trunk/Ohana/src/opihi/pclient/Makefile
===================================================================
--- /trunk/Ohana/src/opihi/pclient/Makefile	(revision 4688)
+++ /trunk/Ohana/src/opihi/pclient/Makefile	(revision 4689)
@@ -7,5 +7,4 @@
 LIB     =       $(HOME)/lib
 INC     =       $(HOME)/include
-HELP    =       $(HOME)/help
 SDIR    =       $(HOME)/pclient
 #
@@ -14,9 +13,10 @@
 DESTINC =       $(LINC)
 DESTMAN =       $(LMAN)
+DESTHLP =       $(LHLP)/pclient
 #  
 INCS    =       -I$(INC) -I$(LINC) -I$(XINC)
 LFLAGS  =       -L$(LLIB) -L$(LIB)
 LIBS1   =       -lFITS -lsocket -lnsl -lreadline -ltermcap -lohana -lm
-LIBS2   =       -lbasiccmd -lshell -ldata
+LIBS2   =       -lbasiccmd -ldatacmd -lshell -ldata
 LIBS    =       $(LIBS2) $(LIBS1) 
 CFLAGS  =       $(INCS)
@@ -42,4 +42,5 @@
 libs = \
 $(DESTLIB)/libbasiccmd.a \
+$(DESTLIB)/libdatacmd.a \
 $(DESTLIB)/libshell.a \
 $(DESTLIB)/libdata.a
@@ -52,5 +53,7 @@
 $(BIN)/pclient.$(ARCH) : $(pclient) $(libs)
 
-install: $(DESTBIN)/pclient
+install: $(DESTBIN)/pclient help
+
+help: cmd.basic.help pclient.help
 
 # utilities #################################################
@@ -104,2 +107,8 @@
 %.$(ARCH).o : %.c
 	$(CC) $(CFLAGS) -c $*.c -o $@
+
+%.help:
+	@if [ ! -d $(DESTHLP) ]; then mkdir -p $(DESTHLP); fi
+	rm -f $(HOME)/$*/help/*~
+	rm -f $(HOME)/$*/help/#*
+	cp $(HOME)/$*/help/* $(DESTHLP)/
Index: /trunk/Ohana/src/opihi/pclient/pclient.c
===================================================================
--- /trunk/Ohana/src/opihi/pclient/pclient.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/pclient/pclient.c	(revision 4689)
@@ -7,22 +7,7 @@
 # define opihi_rcfile ".pcontrolrc"
 
-void InitPclient ();
-void InitBasic ();
-
-void welcome () {
-  fprintf (stderr, "\n");
-  fprintf (stderr, "Welcome to %s - %s\n\n", opihi_name, opihi_description);
-}
-
-void gotsignal (int signum) {
-  fprintf (stderr, "got signal : %d\n", signum);
-  return;
-}
-
 /* program-dependent initialization */
 void initialize (int argc, char **argv) {
   
-  FILE *f;
-
   auto_break = TRUE;
 
@@ -44,4 +29,5 @@
   /* load the commands used by this implementation */
   InitBasic ();
+  InitData ();
   InitOutfile ();
   InitPclient ();
@@ -55,4 +41,7 @@
   set_str_variable ("PROMPT", opihi_prompt);
   set_str_variable ("RCFILE", opihi_rcfile);
+# ifdef HELPDIR_DEFAULT
+  set_str_variable ("HELPDIR", MACRO_NAME(HELPDIR_DEFAULT));
+# endif
 
   /* ignore the history file.  to change this, see, eg, mana.c */
@@ -64,6 +53,18 @@
 }
 
+/* standard welcome message */
+void welcome () {
+  fprintf (stderr, "\n");
+  fprintf (stderr, "Welcome to %s - %s\n\n", opihi_name, opihi_description);
+}
+
 /* add program-dependent exit functions here */
 void cleanup () {
   return;
 }
+
+void gotsignal (int signum) {
+  fprintf (stderr, "got signal : %d\n", signum);
+  return;
+}
+
Index: /trunk/Ohana/src/opihi/pclient/reset.c
===================================================================
--- /trunk/Ohana/src/opihi/pclient/reset.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/pclient/reset.c	(revision 4689)
@@ -37,5 +37,5 @@
 
     /* total failure, don't reset */
-    fprintf (stderr, "child process %d is hung, cannot reset\n");
+    fprintf (stderr, "child process %d is hung, cannot reset\n", ChildPID);
     fprintf (stdout, "STATUS 0\n");
     return (FALSE);
Index: /trunk/Ohana/src/opihi/pcontrol/CheckBusyJob.c
===================================================================
--- /trunk/Ohana/src/opihi/pcontrol/CheckBusyJob.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/pcontrol/CheckBusyJob.c	(revision 4689)
@@ -2,6 +2,5 @@
 
 int CheckBusyJob (Job *job) {
-  
-  int      i;
+
   int      status;
   int      outstate;
Index: /trunk/Ohana/src/opihi/pcontrol/CheckHost.c
===================================================================
--- /trunk/Ohana/src/opihi/pcontrol/CheckHost.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/pcontrol/CheckHost.c	(revision 4689)
@@ -3,5 +3,5 @@
 int CheckHost (Host *host) {
   
-  int i, N, status;
+  int N, status;
   IOBuffer buffer;
   Job *job;
Index: /trunk/Ohana/src/opihi/pcontrol/CheckIdleHost.c
===================================================================
--- /trunk/Ohana/src/opihi/pcontrol/CheckIdleHost.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/pcontrol/CheckIdleHost.c	(revision 4689)
@@ -45,4 +45,5 @@
     return (TRUE);
   }
+  return (TRUE);
 }
 
Index: /trunk/Ohana/src/opihi/pcontrol/CheckSystem.c
===================================================================
--- /trunk/Ohana/src/opihi/pcontrol/CheckSystem.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/pcontrol/CheckSystem.c	(revision 4689)
@@ -12,5 +12,5 @@
   CheckLiveHosts();
 
-  /* status (0, NULL); */
+  return (TRUE);
 }
 
@@ -28,4 +28,5 @@
     CheckBusyJob (job);
   }
+  return (TRUE);
 }
 
@@ -43,4 +44,5 @@
     CheckDoneJob (job);
   }
+  return (TRUE);
 }
 
@@ -58,4 +60,5 @@
     CheckDoneHost (host);
   }
+  return (TRUE);
 }
 
@@ -82,4 +85,5 @@
     CheckHost (host);
   }
+  return (TRUE);
 }
 
@@ -97,4 +101,5 @@
     StartHost (host);
   }
+  return (TRUE);
 }
 
@@ -107,5 +112,5 @@
   /* check if there are any pending jobs, otherwise skip step */
   stack = GetJobStack (PCONTROL_JOB_PENDING);
-  if (!stack[0].Nobject) return;
+  if (!stack[0].Nobject) return (TRUE);
 
   stack = GetHostStack (PCONTROL_HOST_IDLE);
@@ -116,3 +121,4 @@
     CheckIdleHost (host);
   }
+  return (TRUE);
 }
Index: /trunk/Ohana/src/opihi/pcontrol/IOBufferOps.c
===================================================================
--- /trunk/Ohana/src/opihi/pcontrol/IOBufferOps.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/pcontrol/IOBufferOps.c	(revision 4689)
@@ -59,4 +59,5 @@
     }
   }
+  return (Nread);
 }
 
Index: /trunk/Ohana/src/opihi/pcontrol/JobOps.c
===================================================================
--- /trunk/Ohana/src/opihi/pcontrol/JobOps.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/pcontrol/JobOps.c	(revision 4689)
@@ -183,5 +183,4 @@
 Host *UnlinkJobAndHost (Job *job) {
 
-  int N;
   Host *host;
 
@@ -205,5 +204,4 @@
 
 void LinkJobAndHost (Job *job, Host *host) {
-  int N;
 
   job[0].host = (struct Host *) host;
Index: /trunk/Ohana/src/opihi/pcontrol/Makefile
===================================================================
--- /trunk/Ohana/src/opihi/pcontrol/Makefile	(revision 4688)
+++ /trunk/Ohana/src/opihi/pcontrol/Makefile	(revision 4689)
@@ -7,5 +7,4 @@
 LIB     =       $(HOME)/lib
 INC     =       $(HOME)/include
-HELP    =       $(HOME)/help
 SDIR    =       $(HOME)/pcontrol
 #
@@ -14,11 +13,12 @@
 DESTINC =       $(LINC)
 DESTMAN =       $(LMAN)
+DESTHLP =       $(LHLP)/pcontrol
 #  
 INCS    =       -I$(INC) -I$(LINC) -I$(XINC)
 LFLAGS  =       -L$(LLIB) -L$(LIB)
 LIBS1   =       -lFITS -lsocket -lnsl -lreadline -ltermcap -lohana -lm
-LIBS2   =       -lbasiccmd -lshell -ldata
+LIBS2   =       -lbasiccmd -ldatacmd -lshell -ldata
 LIBS    =       $(LIBS2) $(LIBS1) 
-CFLAGS  =       $(INCS) -Werror
+CFLAGS  =       $(INCS) -DHELPDIR_DEFAULT=$(DESTHLP)
 CCFLAGS =       $(LIBS) 
 
@@ -30,5 +30,4 @@
 $(SDIR)/pcontrol.$(ARCH).o \
 $(SDIR)/rconnect.$(ARCH).o \
-$(SDIR)/memstr.$(ARCH).o \
 $(SDIR)/CheckBusyJob.$(ARCH).o \
 $(SDIR)/CheckDoneHost.$(ARCH).o \
@@ -63,4 +62,5 @@
 libs = \
 $(DESTLIB)/libbasiccmd.a \
+$(DESTLIB)/libdatamd.a \
 $(DESTLIB)/libshell.a \
 $(DESTLIB)/libdata.a
@@ -73,5 +73,7 @@
 $(BIN)/pcontrol.$(ARCH) : $(pcontrol) $(libs)
 
-install: $(DESTBIN)/pcontrol
+install: $(DESTBIN)/pcontrol help
+
+help: cmd.basic.help cmd.data.help pcontrol.help
 
 # utilities #################################################
@@ -125,2 +127,8 @@
 %.$(ARCH).o : %.c
 	$(CC) $(CFLAGS) -c $*.c -o $@
+
+%.help:
+	@if [ ! -d $(DESTHLP) ]; then mkdir -p $(DESTHLP); fi
+	rm -f $(HOME)/$*/help/*~
+	rm -f $(HOME)/$*/help/#*
+	cp $(HOME)/$*/help/* $(DESTHLP)/
Index: /trunk/Ohana/src/opihi/pcontrol/StartHost.c
===================================================================
--- /trunk/Ohana/src/opihi/pcontrol/StartHost.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/pcontrol/StartHost.c	(revision 4689)
@@ -9,4 +9,5 @@
   /* pid = rconnect (CONNECT, host[0].hostname, PCLIENT, stdio); */
 
+  /* perhaps change the name of these config variables... */
   if (VarConfig ("COMMAND", "%s", command) == NULL) strcpy (command, "ssh");
   if (VarConfig ("SHELL", "%s", shell)     == NULL) strcpy (shell, "pclient");
Index: /trunk/Ohana/src/opihi/pcontrol/StopHosts.c
===================================================================
--- /trunk/Ohana/src/opihi/pcontrol/StopHosts.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/pcontrol/StopHosts.c	(revision 4689)
@@ -24,4 +24,5 @@
     DownHost (host);
   }
+  return (TRUE);
 }
 
@@ -31,5 +32,4 @@
   int       waitstatus;
   int       status;
-  char     *p;
   IOBuffer  buffer;
 
Index: /trunk/Ohana/src/opihi/pcontrol/check.c
===================================================================
--- /trunk/Ohana/src/opihi/pcontrol/check.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/pcontrol/check.c	(revision 4689)
@@ -1,3 +1,4 @@
 # include "pcontrol.h"
+
 char jobstate[6][32] = {"PENDING", "BUSY", "EXIT", "CRASH", "HUNG", "DONE"};
 char hoststate[5][32] = {"IDLE", "BUSY", "DOWN", "DONE", "OFF"};
@@ -7,5 +8,5 @@
   Job *job;
   Host *host;
-  int JobID, HostID, N;
+  int JobID, HostID;
 
   if (argc != 3) {
Index: /trunk/Ohana/src/opihi/pcontrol/delete.c
===================================================================
--- /trunk/Ohana/src/opihi/pcontrol/delete.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/pcontrol/delete.c	(revision 4689)
@@ -4,5 +4,5 @@
 
   Job *job;
-  int JobID, N;
+  int JobID;
 
   if (argc < 2) {
Index: /trunk/Ohana/src/opihi/pcontrol/host.c
===================================================================
--- /trunk/Ohana/src/opihi/pcontrol/host.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/pcontrol/host.c	(revision 4689)
@@ -149,5 +149,5 @@
 
   HostID = AddHost (argv[1]);
-  fprintf (stdout, "HostID: %d\n", HostID);
+  fprintf (stdout, "HostID: %d\n", (int) HostID);
   return (TRUE);
 }
Index: /trunk/Ohana/src/opihi/pcontrol/init.c
===================================================================
--- /trunk/Ohana/src/opihi/pcontrol/init.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/pcontrol/init.c	(revision 4689)
@@ -1,3 +1,3 @@
-# include "opihi.h"
+# include "pcontrol.h"
 
 int kill_pc     PROTO((int, char **));
Index: /trunk/Ohana/src/opihi/pcontrol/job.c
===================================================================
--- /trunk/Ohana/src/opihi/pcontrol/job.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/pcontrol/job.c	(revision 4689)
@@ -48,5 +48,5 @@
 
   JobID = AddJob (Host, Mode, Timeout, targc, targv);
-  fprintf (stdout, "JobID: %d\n", JobID);
+  fprintf (stdout, "JobID: %d\n", (int) JobID);
   return (TRUE);
 }
Index: /trunk/Ohana/src/opihi/pcontrol/kill.c
===================================================================
--- /trunk/Ohana/src/opihi/pcontrol/kill.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/pcontrol/kill.c	(revision 4689)
@@ -4,5 +4,5 @@
 
   Job *job;
-  int JobID, N;
+  int JobID;
 
   if (argc < 2) {
Index: unk/Ohana/src/opihi/pcontrol/memstr.c
===================================================================
--- /trunk/Ohana/src/opihi/pcontrol/memstr.c	(revision 4688)
+++ 	(revision )
@@ -1,13 +1,0 @@
-# include "pcontrol.h"
-
-/* returns pointer to start of m2 in m1, or NULL if failure */ 
-char *memstr (char *m1, char *m2, int n) {
-
-  int i, N;
-
-  N = strlen (m2);
-  for (i = 0; (i < n - N + 1) && memcmp (m1, m2, N); i++, m1++);
-  if (memcmp (m1, m2, N)) return (NULL);
-  return (m1);
-
-}
Index: /trunk/Ohana/src/opihi/pcontrol/pcontrol.c
===================================================================
--- /trunk/Ohana/src/opihi/pcontrol/pcontrol.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/pcontrol/pcontrol.c	(revision 4689)
@@ -7,17 +7,7 @@
 # define opihi_rcfile ".pcontrolrc"
 
-void InitPcontrol ();
-void InitBasic ();
-
-void welcome () {
-  fprintf (stderr, "\n");
-  fprintf (stderr, "Welcome to %s - %s\n\n", opihi_name, opihi_description);
-}
-
 /* program-dependent initialization */
 void initialize (int argc, char **argv) {
   
-  FILE *f;
-
   auto_break = TRUE;
 
@@ -39,4 +29,5 @@
   /* load the commands used by this implementation */
   InitBasic ();
+  InitData ();
   InitOutfile ();
   InitPcontrol ();
@@ -50,8 +41,17 @@
   set_str_variable ("PROMPT", opihi_prompt);
   set_str_variable ("RCFILE", opihi_rcfile);
+# ifdef HELPDIR_DEFAULT
+  set_str_variable ("HELPDIR", MACRO_NAME(HELPDIR_DEFAULT));
+# endif
 
   /* ignore the history file.  to change this, see, eg, mana.c */
   signal (SIGINT, SIG_IGN);
   return;
+}
+
+/* standard welcome message */
+void welcome () {
+  fprintf (stderr, "\n");
+  fprintf (stderr, "Welcome to %s - %s\n\n", opihi_name, opihi_description);
 }
 
Index: /trunk/Ohana/src/opihi/pcontrol/rconnect.c
===================================================================
--- /trunk/Ohana/src/opihi/pcontrol/rconnect.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/pcontrol/rconnect.c	(revision 4689)
@@ -1,3 +1,4 @@
 # include "pcontrol.h"
+
 # define CONNECT_TIMEOUT 300
 
Index: /trunk/Ohana/src/opihi/pcontrol/status.c
===================================================================
--- /trunk/Ohana/src/opihi/pcontrol/status.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/pcontrol/status.c	(revision 4689)
@@ -1,11 +1,8 @@
 # include "pcontrol.h"
+
 char jobname[6][32] = {"PENDING", "BUSY", "EXIT", "CRASH", "HUNG", "DONE"};
 char hostname[5][32] = {"IDLE", "BUSY", "DOWN", "DONE", "OFF"};
 
 int status (int argc, char **argv) {
-
-  int i, Nobject;
-  Stack *stack;
-  Job   *job;
 
   PrintJobStack (PCONTROL_JOB_PENDING);
@@ -20,7 +17,8 @@
   PrintHostStack (PCONTROL_HOST_BUSY);
   PrintHostStack (PCONTROL_HOST_DONE);
+  return (TRUE);
 }
 
-PrintJobStack (int Nstack) {
+int PrintJobStack (int Nstack) {
 
   int i, j, Nobject;
@@ -41,9 +39,10 @@
     fprintf (stdout, "\n");
   }
+  return (TRUE);
 }
 
-PrintHostStack (int Nstack) {
+int PrintHostStack (int Nstack) {
 
-  int i, j, Nobject;
+  int i, Nobject;
   Stack *stack;
   Host *host;
@@ -59,4 +58,5 @@
     fprintf (stdout, "\n");
   }
+  return (TRUE);
 }
 
Index: /trunk/Ohana/src/opihi/pcontrol/stdout.c
===================================================================
--- /trunk/Ohana/src/opihi/pcontrol/stdout.c	(revision 4688)
+++ /trunk/Ohana/src/opihi/pcontrol/stdout.c	(revision 4689)
@@ -3,5 +3,5 @@
 int stdout_pc (int argc, char **argv) {
 
-  int N, JobID, stack;
+  int JobID;
   Job *job;
   IOBuffer *buffer;
@@ -34,5 +34,5 @@
 int stderr_pc (int argc, char **argv) {
 
-  int N, JobID;
+  int JobID;
   Job *job;
   IOBuffer *buffer;
