Index: /trunk/Ohana/src/opihi/doc/Change.log
===================================================================
--- /trunk/Ohana/src/opihi/doc/Change.log	(revision 2824)
+++ /trunk/Ohana/src/opihi/doc/Change.log	(revision 2824)
@@ -0,0 +1,25 @@
+
+2004.12.10:
+
+  fixed problem in lib.data/PlotVectors.c and lib.data/graphtools.c
+  that broke plotting for data with very large or small exponents (|x|
+  < 1e-12, |x| > 1e12).  also fixed cmd.data/vstats.c with same
+  problem.
+	
+2004.12.23
+
+  Moved typename/modename funcs to libohana.  this was motivated by
+  imregister, which would not compile cleanly using the old method.
+
+  Added library dependencies to the makefiles. previously, mana (etc)
+  would not re-build if the library was modified.
+
+  Fixed incorrect exit on non-tty.  this kept perl scripts with the
+  call "|mana" from running.
+
+  Fixed dvomath for strings.  since we moved to dvomath everywhere,
+  this broke complex string conditionals: (($a == hi) && ($b == lo)).
+  I added string types to the math functions, and tests to see if the
+  stack has strings which cannot be resolved as a vector or matrix.  
+
+
Index: /trunk/Ohana/src/opihi/dvo/elixir.c
===================================================================
--- /trunk/Ohana/src/opihi/dvo/elixir.c	(revision 2824)
+++ /trunk/Ohana/src/opihi/dvo/elixir.c	(revision 2824)
@@ -0,0 +1,162 @@
+# include "dimm.h"
+
+int elixir (int argc, char **argv) {
+  
+  char message[256], cmd[256], ElixirBase[256];
+  char fifo[256], fifodir[256], msgfile[256];
+  char *answer;
+  int N;
+
+  sprintf (cmd, "STATUS");
+  if (N = get_argument (argc, argv, "-time")) {
+    remove_argument (N, &argc, argv);
+    sprintf (cmd, "TIMES");
+  }
+  if (N = get_argument (argc, argv, "-live")) {
+    remove_argument (N, &argc, argv);
+    sprintf (cmd, "ALIVE");
+  }
+  if (N = get_argument (argc, argv, "-stop")) {
+    remove_argument (N, &argc, argv);
+    sprintf (cmd, "STOP");
+  }
+  if (N = get_argument (argc, argv, "-kill")) {
+    remove_argument (N, &argc, argv);
+    sprintf (cmd, "ABORT");
+  }
+ 
+  if (argc != 2) {
+    fprintf (stderr, "USAGE: elixir (elixir) [-time] [-live]\n");
+    return (FALSE);
+  }
+
+  if (!VarConfig (argv[1], "%s", ElixirBase)) {
+    fprintf (stderr, "elixir %s not in config file\n", argv[1]);
+    return (FALSE);
+  }
+  sprintf (fifo, "%s.msg", ElixirBase);
+  if (!VarConfig ("FIFOS", "%s", fifodir)) {
+    fprintf (stderr, "FIFOS not in config, using local /tmp\n");
+    strcpy (fifodir, "/tmp");
+  }
+  sprintf (fifo, "%s.msg", ElixirBase);
+
+  sprintf (msgfile, "%s/EMsg.XXXXXX", fifodir);
+  mkstemp (msgfile);
+  sprintf (message, "%s %s", cmd, msgfile);
+  unlink (msgfile);
+
+  if (!WriteMsg (fifo, message)) {
+    fprintf (stderr, "can't access fifo %s\n", fifo);
+    return (FALSE);
+  }
+
+  if (ReadMsg (msgfile, &answer)) {
+    fprintf (stderr, "%s\n", answer);
+  } 
+  unlink (msgfile);
+  return (TRUE);
+  
+}
+
+int WriteMsg (char *fifo, char *message) {
+
+  int fd, state, mode;
+  FILE *f;
+
+  /* check lockfile */
+  fd = setlockfile2 (fifo, 2.0, LCK_XCLD, &state);
+  if (fd == -1) return (0);
+  f = fdopen (fd, "r+");
+  if (f == (FILE *) NULL) {
+    mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH;
+    fchmod (fd, mode);
+    clearlockfile2 (fifo, fd, LCK_XCLD, &state);
+    return (0);
+  }
+
+  /* write message to end of file */
+  fseek (f, 0, SEEK_END);
+  fprintf (f, "%s\n", message);
+
+  mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH;
+  fchmod (fd, mode);
+
+  clearlockfile2 (fifo, fd, LCK_XCLD, &state);
+  fclose (f);
+
+  return (1);
+
+}
+
+int ReadMsg (char *fifo, char **message) {
+
+  int i, nbytes, Nbytes, NBYTES;
+  char *buffer;
+  int fd, state, mode;
+  FILE *f;
+  struct stat filestat;
+
+  /* wait (2 sec) for file to exist, then try to read it */
+  for (i = 0; (stat (fifo, &filestat) == -1) && (i < 20); i++) {
+    usleep (100000);
+  }
+  if (i >= 20) {
+    fprintf (stderr, "no response\n");
+    return (0);
+  }
+
+  /* check lockfile */
+  fd = setlockfile2 (fifo, 2.0, LCK_XCLD, &state);
+  if (fd == -1) {
+    fprintf (stderr, "message locked (%d)\n", state);
+    return (0);
+  }
+  f = fdopen (fd, "r+");
+  if (f == (FILE *) NULL) {
+    fprintf (stderr, "message blocked\n");
+    mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH;
+    fchmod (fd, mode);
+    clearlockfile2 (fifo, fd, LCK_XCLD, &state);
+    return (0);
+  }
+
+  /* if file is empty, return 0 */
+  if (state == LCK_EMPTY) {
+    mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH;
+    fchmod (fd, mode);
+    clearlockfile2 (fifo, fd, LCK_XCLD, &state);
+    fclose (f);
+    return (0);
+  }  
+
+  Nbytes = 0;
+  NBYTES = 0x1000;
+  ALLOCATE (buffer, char, NBYTES);
+  while (TRUE) {
+    nbytes = fread (&buffer[Nbytes], 1, 0x1000, f);
+    if (nbytes < 0) { 
+      fprintf (stderr, "error in ReadMsg -- got -1 bytes\n");
+      return (0);
+    }
+    if (nbytes == 0) break;
+    Nbytes += nbytes;
+    NBYTES += 0x1000;
+    REALLOCATE (buffer, char, NBYTES);
+  }
+  buffer[Nbytes] = 0;
+
+  mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH;
+  fchmod (fd, mode);
+  clearlockfile2 (fifo, fd, LCK_XCLD, &state);
+  fclose (f);
+
+  if (Nbytes == 0) {
+    free (buffer);
+    return (0);
+  }
+
+  *message = buffer;
+  return (1);
+
+}
Index: unk/Ohana/src/opihi/mana/elixir.c
===================================================================
--- /trunk/Ohana/src/opihi/mana/elixir.c	(revision 2823)
+++ 	(revision )
@@ -1,162 +1,0 @@
-# include "dimm.h"
-
-int elixir (int argc, char **argv) {
-  
-  char message[256], cmd[256], ElixirBase[256];
-  char fifo[256], fifodir[256], msgfile[256];
-  char *answer;
-  int N;
-
-  sprintf (cmd, "STATUS");
-  if (N = get_argument (argc, argv, "-time")) {
-    remove_argument (N, &argc, argv);
-    sprintf (cmd, "TIMES");
-  }
-  if (N = get_argument (argc, argv, "-live")) {
-    remove_argument (N, &argc, argv);
-    sprintf (cmd, "ALIVE");
-  }
-  if (N = get_argument (argc, argv, "-stop")) {
-    remove_argument (N, &argc, argv);
-    sprintf (cmd, "STOP");
-  }
-  if (N = get_argument (argc, argv, "-kill")) {
-    remove_argument (N, &argc, argv);
-    sprintf (cmd, "ABORT");
-  }
- 
-  if (argc != 2) {
-    fprintf (stderr, "USAGE: elixir (elixir) [-time] [-live]\n");
-    return (FALSE);
-  }
-
-  if (!VarConfig (argv[1], "%s", ElixirBase)) {
-    fprintf (stderr, "elixir %s not in config file\n", argv[1]);
-    return (FALSE);
-  }
-  sprintf (fifo, "%s.msg", ElixirBase);
-  if (!VarConfig ("FIFOS", "%s", fifodir)) {
-    fprintf (stderr, "FIFOS not in config, using local /tmp\n");
-    strcpy (fifodir, "/tmp");
-  }
-  sprintf (fifo, "%s.msg", ElixirBase);
-
-  sprintf (msgfile, "%s/EMsg.XXXXXX", fifodir);
-  mkstemp (msgfile);
-  sprintf (message, "%s %s", cmd, msgfile);
-  unlink (msgfile);
-
-  if (!WriteMsg (fifo, message)) {
-    fprintf (stderr, "can't access fifo %s\n", fifo);
-    return (FALSE);
-  }
-
-  if (ReadMsg (msgfile, &answer)) {
-    fprintf (stderr, "%s\n", answer);
-  } 
-  unlink (msgfile);
-  return (TRUE);
-  
-}
-
-int WriteMsg (char *fifo, char *message) {
-
-  int fd, state, mode;
-  FILE *f;
-
-  /* check lockfile */
-  fd = setlockfile2 (fifo, 2.0, LCK_XCLD, &state);
-  if (fd == -1) return (0);
-  f = fdopen (fd, "r+");
-  if (f == (FILE *) NULL) {
-    mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH;
-    fchmod (fd, mode);
-    clearlockfile2 (fifo, fd, LCK_XCLD, &state);
-    return (0);
-  }
-
-  /* write message to end of file */
-  fseek (f, 0, SEEK_END);
-  fprintf (f, "%s\n", message);
-
-  mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH;
-  fchmod (fd, mode);
-
-  clearlockfile2 (fifo, fd, LCK_XCLD, &state);
-  fclose (f);
-
-  return (1);
-
-}
-
-int ReadMsg (char *fifo, char **message) {
-
-  int i, nbytes, Nbytes, NBYTES;
-  char *buffer;
-  int fd, state, mode;
-  FILE *f;
-  struct stat filestat;
-
-  /* wait (2 sec) for file to exist, then try to read it */
-  for (i = 0; (stat (fifo, &filestat) == -1) && (i < 20); i++) {
-    usleep (100000);
-  }
-  if (i >= 20) {
-    fprintf (stderr, "no response\n");
-    return (0);
-  }
-
-  /* check lockfile */
-  fd = setlockfile2 (fifo, 2.0, LCK_XCLD, &state);
-  if (fd == -1) {
-    fprintf (stderr, "message locked (%d)\n", state);
-    return (0);
-  }
-  f = fdopen (fd, "r+");
-  if (f == (FILE *) NULL) {
-    fprintf (stderr, "message blocked\n");
-    mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH;
-    fchmod (fd, mode);
-    clearlockfile2 (fifo, fd, LCK_XCLD, &state);
-    return (0);
-  }
-
-  /* if file is empty, return 0 */
-  if (state == LCK_EMPTY) {
-    mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH;
-    fchmod (fd, mode);
-    clearlockfile2 (fifo, fd, LCK_XCLD, &state);
-    fclose (f);
-    return (0);
-  }  
-
-  Nbytes = 0;
-  NBYTES = 0x1000;
-  ALLOCATE (buffer, char, NBYTES);
-  while (TRUE) {
-    nbytes = fread (&buffer[Nbytes], 1, 0x1000, f);
-    if (nbytes < 0) { 
-      fprintf (stderr, "error in ReadMsg -- got -1 bytes\n");
-      return (0);
-    }
-    if (nbytes == 0) break;
-    Nbytes += nbytes;
-    NBYTES += 0x1000;
-    REALLOCATE (buffer, char, NBYTES);
-  }
-  buffer[Nbytes] = 0;
-
-  mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH;
-  fchmod (fd, mode);
-  clearlockfile2 (fifo, fd, LCK_XCLD, &state);
-  fclose (f);
-
-  if (Nbytes == 0) {
-    free (buffer);
-    return (0);
-  }
-
-  *message = buffer;
-  return (1);
-
-}
